!function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},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=23)}([function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){function i(t){if(t)return function(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}(t)}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},i.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n=0;n1?{type:p[n],data:t.substring(1)}:{type:p[n]}:d}n=new Uint8Array(t)[0];var s=o(t,1);return m&&"blob"===r&&(s=new m([s])),{type:p[n],data:s}},e.decodeBase64Packet=function(t,e){var r=p[t.charAt(0)];if(!i)return{type:r,data:{base64:!0,data:t.substr(1)}};var n=i.decode(t.substr(1));return"blob"===e&&m&&(n=new m([n])),{type:r,data:n}},e.encodePayload=function(t,r,i){"function"==typeof r&&(i=r,r=null);var n=s(t);if(r&&n)return m&&!u?e.encodePayloadAsBlob(t,i):e.encodePayloadAsArrayBuffer(t,i);if(!t.length)return i("0:");_(t,function(t,i){e.encodePacket(t,!!n&&r,!1,function(t){i(null,function(t){return t.length+":"+t}(t))})},function(t,e){return i(e.join(""))})},e.decodePayload=function(t,r,i){if("string"!=typeof t)return e.decodePayloadAsBinary(t,r,i);var n;if("function"==typeof r&&(i=r,r=null),""===t)return i(d,0,1);for(var s,o,a="",l=0,c=t.length;l0;){for(var a=new Uint8Array(n),l=0===a[0],c="",h=1;255!==a[h];h++){if(c.length>310)return i(d,0,1);c+=a[h]}n=o(n,2+c.length),c=parseInt(c);var u=o(n,0,c);if(l)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(t){var f=new Uint8Array(u);u="";for(h=0;h=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())}).call(e,r(4))},function(t,e){var r,i,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:s}catch(t){r=s}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var l,c=[],h=!1,u=-1;function f(){h&&l&&(h=!1,l.length?c=l.concat(c):u=-1,c.length&&p())}function p(){if(!h){var t=a(f);h=!0;for(var e=c.length;e;){for(l=c,c=[];++u1)for(var r=1;r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())}).call(e,r(4))},function(t,e){var r=1e3,i=60*r,n=60*i,s=24*n,o=365.25*s;function a(t,e,r){if(!(t0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*o;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*i;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===c&&!1===isNaN(t))return e.long?a(l=t,s,"day")||a(l,n,"hour")||a(l,i,"minute")||a(l,r,"second")||l+" ms":function(t){if(t>=s)return Math.round(t/s)+"d";if(t>=n)return Math.round(t/n)+"h";if(t>=i)return Math.round(t/i)+"m";if(t>=r)return Math.round(t/r)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,r){var i=r(27)("socket.io-parser"),n=r(1),s=r(13),o=r(30),a=r(14);function l(){}function c(t){var r=""+t.type;return e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(r+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(r+=t.nsp+","),null!=t.id&&(r+=t.id),null!=t.data&&(r+=JSON.stringify(t.data)),i("encoded %j as %s",t,r),r}function h(){this.reconstructor=null}function u(t){this.reconPack=t,this.buffers=[]}function f(){return{type:e.ERROR,data:"parser error"}}e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=l,e.Decoder=h,l.prototype.encode=function(t,r){(t.type!==e.EVENT&&t.type!==e.ACK||!s(t.data)||(t.type=t.type===e.EVENT?e.BINARY_EVENT:e.BINARY_ACK),i("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)?function(t,e){o.removeBlobs(t,function(t){var r=o.deconstructPacket(t),i=c(r.packet),n=r.buffers;n.unshift(i),e(n)})}(t,r):r([c(t)])},n(h.prototype),h.prototype.add=function(t){var r;if("string"==typeof t)r=function(t){var r=0,n={type:Number(t.charAt(0))};if(null==e.types[n.type])return f();if(e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type){for(var s="";"-"!==t.charAt(++r)&&(s+=t.charAt(r),r!=t.length););if(s!=Number(s)||"-"!==t.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===t.charAt(r+1))for(n.nsp="";++r;){var o=t.charAt(r);if(","===o)break;if(n.nsp+=o,r===t.length)break}else n.nsp="/";var a=t.charAt(r+1);if(""!==a&&Number(a)==a){for(n.id="";++r;){var o=t.charAt(r);if(null==o||Number(o)!=o){--r;break}if(n.id+=t.charAt(r),r===t.length)break}n.id=Number(n.id)}t.charAt(++r)&&(n=function(t,e){try{t.data=JSON.parse(e)}catch(t){return f()}return t}(n,t.substr(r)));return i("decoded %s as %j",t,n),n}(t),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new u(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!a(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(r=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",r))}},h.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},u.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=o.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},u.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,r){(function(e){var i=r(34);t.exports=function(t){var r=t.xdomain,n=t.xscheme,s=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!r||i))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&s)return new XDomainRequest}catch(t){}if(!r)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}}).call(e,r(0))},function(t,e,r){var i=r(2),n=r(1);function s(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.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}t.exports=s,n(s.prototype),s.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},s.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},s.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},s.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},s.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},s.prototype.onData=function(t){var e=i.decodePacket(t,this.socket.binaryType);this.onPacket(e)},s.prototype.onPacket=function(t){this.emit("packet",t)},s.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,n=t.indexOf("["),s=t.indexOf("]");-1!=n&&-1!=s&&(t=t.substring(0,n)+t.substring(n,s).replace(/:/g,";")+t.substring(s,t.length));for(var o=r.exec(t||""),a={},l=14;l--;)a[i[l]]=o[l]||"";return-1!=n&&-1!=s&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,r){(function(e){var i=r(29),n=Object.prototype.toString,s="function"==typeof e.Blob||"[object BlobConstructor]"===n.call(e.Blob),o="function"==typeof e.File||"[object FileConstructor]"===n.call(e.File);t.exports=function t(r){if(!r||"object"!=typeof r)return!1;if(i(r)){for(var n=0,a=r.length;n0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},p.prototype.cleanup=function(){c("cleanup");for(var t=this.subs.length,e=0;e=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){(function(t){var i=r(10),n=r(35),s=r(44),o=r(45);e.polling=function(e){var r=!1,o=!1,a=!1!==e.jsonp;if(t.location){var l="https:"===location.protocol,c=location.port;c||(c=l?443:80),r=e.hostname!==location.hostname||c!==e.port,o=e.secure!==l}if(e.xdomain=r,e.xscheme=o,"open"in new i(e)&&!e.forceJSONP)return new n(e);if(!a)throw new Error("JSONP disabled");return new s(e)},e.websocket=o}).call(e,r(0))},function(t,e,r){var i=r(11),n=r(5),s=r(2),o=r(6),a=r(18),l=r(7)("engine.io-client:polling");t.exports=h;var c=null!=new(r(10))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),i.call(this,t)}o(h,i),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 i=0;this.polling&&(l("we are currently polling - waiting to pause"),i++,this.once("pollComplete",function(){l("pre-pause polling complete"),--i||r()})),this.writable||(l("we are currently writing - waiting to pause"),i++,this.once("drain",function(){l("pre-pause writing complete"),--i||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);s.decodePayload(t,this.socket.binaryType,function(t,r,i){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;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};s.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=n.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){"use strict";var i,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),s=64,o={},a=0,l=0;function c(t){var e="";do{e=n[t%s]+e,t=Math.floor(t/s)}while(t>0);return e}function h(){var t=c(+new Date);return t!==i?(a=0,i=t):t+"."+c(a++)}for(;l Start Log',console.log("stopping log, "+A),b=new Date,y=y+"\r\n\r\nLog End for "+g+": "+b.getFullYear()+"/"+(b.getMonth()+1)+"/"+b.getDate()+" @ "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+"\r\n",v=b,E.focus(),!1):(A=!0,x=!0,logBtn.innerHTML=' Stop Log',downloadLogBtn.style.color="#000",downloadLogBtn.addEventListener("click",F),console.log("starting log, "+A),b=new Date,y="Log Start for "+g+": "+b.getFullYear()+"/"+(b.getMonth()+1)+"/"+b.getDate()+" @ "+b.getHours()+":"+b.getMinutes()+":"+b.getSeconds()+"\r\n\r\n",v=b,E.focus(),!1)}function F(){if(!0===x){C="WebSSH2-"+v.getFullYear()+(v.getMonth()+1)+v.getDate()+"_"+v.getHours()+v.getMinutes()+v.getSeconds()+".log";var t=new Blob([y.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,C);else{var e=window.document.createElement("a");e.href=window.URL.createObjectURL(t),e.download=C,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}E.focus()}E.on("data",function(t){k.emit("data",t)}),k.on("data",function(t){E.write(t),A&&(y+=t)}),k.on("connect",function(){k.emit("geometry",E.cols,E.rows)}),k.on("setTerminalOpts",function(t){E.setOption("cursorBlink",t.cursorBlink),E.setOption("scrollback",t.scrollback),E.setOption("tabStopWidth",t.tabStopWidth),E.setOption("bellStyle",t.bellStyle)}),k.on("title",function(t){document.title=t}),k.on("menu",function(t){P(t)}),k.on("status",function(t){L.innerHTML=t}),k.on("ssherror",function(t){L.innerHTML=t,L.style.backgroundColor="red",w=!0}),k.on("headerBackground",function(t){R.style.backgroundColor=t}),k.on("header",function(t){t&&(R.innerHTML=t,R.style.display="block",B.style.height="calc(100% - 38px)",O())}),k.on("footer",function(t){g=t,T.innerHTML=t}),k.on("statusBackground",function(t){L.style.backgroundColor=t}),k.on("allowreplay",function(t){!0===t?(console.log("allowreplay: "+t),S=!0,P(M.innerHTML+' Credentials')):(S=!1,console.log("allowreplay: "+t))}),k.on("disconnect",function(t){w||(L.style.backgroundColor="red",L.innerHTML="WEBSOCKET SERVER DISCONNECTED: "+t),k.io.reconnection(!1)}),k.on("error",function(t){w||(L.style.backgroundColor="red",L.innerHTML="ERROR: "+t)}),E.on("title",function(t){document.title=t})},function(t,e,r){var i=r(25),n=r(9),s=r(15),o=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,n=i(t),l=n.source,c=n.id,h=n.path,u=a[c]&&h in a[c].nsps;return e.forceNew||e["force new connection"]||!1===e.multiplex||u?(o("ignoring socket cache for %s",l),r=s(l,e)):(a[c]||(o("new io instance for %s",l),a[c]=s(l,e)),r=a[c]),n.query&&!e.query&&(e.query=n.query),r.socket(n.path,e)}e.protocol=n.protocol,e.connect=l,e.Manager=r(15),e.Socket=r(20)},function(t,e,r){(function(e){var i=r(12),n=r(3)("socket.io-client:url");t.exports=function(t,r){var s=t;r=r||e.location,null==t&&(t=r.protocol+"//"+r.host);"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(n("protocol-less url %s",t),t=void 0!==r?r.protocol+"//"+t:"https://"+t),n("parse %s",t),s=i(t));s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443"));s.path=s.path||"/";var o=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port,s.href=s.protocol+"://"+o+(r&&r.port===s.port?"":":"+s.port),s}}).call(e,r(0))},function(t,e,r){var i;function n(t){function r(){if(r.enabled){var t=r,n=+new Date,s=n-(i||n);t.diff=s,t.prev=i,t.curr=n,i=n;for(var o=new Array(arguments.length),a=0;a=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(n())}).call(e,r(4))},function(t,e,r){var i;function n(t){function r(){if(r.enabled){var t=r,n=+new Date,s=n-(i||n);t.diff=s,t.prev=i,t.curr=n,i=n;for(var o=new Array(arguments.length),a=0;a0&&(this.extraHeaders=r.extraHeaders),r.localAddress&&(this.localAddress=r.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}t.exports=h,h.priorWebsocketSuccess=!1,n(h.prototype),h.protocol=a.protocol,h.Socket=h,h.Transport=r(11),h.transports=r(16),h.parser=r(2),h.prototype.createTransport=function(t){s('creating transport "%s"',t);var e=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(this.query);e.EIO=a.protocol,e.transport=t;var r=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new i[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0})},h.prototype.open=function(){var t;if(this.rememberUpgrade&&h.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},h.prototype.setTransport=function(t){s("setting transport %s",t.name);var e=this;this.transport&&(s("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},h.prototype.probe=function(t){s('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,i=this;function n(){if(i.onlyBinaryUpgrades){var n=!this.supportsBinary&&i.transport.supportsBinary;r=r||n}r||(s('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(n){if(!r)if("pong"===n.type&&"probe"===n.data){if(s('probe transport "%s" pong',t),i.upgrading=!0,i.emit("upgrading",e),!e)return;h.priorWebsocketSuccess="websocket"===e.name,s('pausing current transport "%s"',i.transport.name),i.transport.pause(function(){r||"closed"!==i.readyState&&(s("changing transport and sending upgrade packet"),f(),i.setTransport(e),e.send([{type:"upgrade"}]),i.emit("upgrade",e),e=null,i.upgrading=!1,i.flush())})}else{s('probe transport "%s" failed',t);var o=new Error("probe error");o.transport=e.name,i.emit("upgradeError",o)}}))}function o(){r||(r=!0,f(),e.close(),e=null)}function a(r){var n=new Error("probe error: "+r);n.transport=e.name,o(),s('probe transport "%s" failed because of error: %s',t,r),i.emit("upgradeError",n)}function l(){a("transport closed")}function c(){a("socket closed")}function u(t){e&&t.name!==e.name&&(s('"%s" works - aborting "%s"',t.name,e.name),o())}function f(){e.removeListener("open",n),e.removeListener("error",a),e.removeListener("close",l),i.removeListener("close",c),i.removeListener("upgrading",u)}h.priorWebsocketSuccess=!1,e.once("open",n),e.once("error",a),e.once("close",l),this.once("close",c),this.once("upgrading",u),e.open()},h.prototype.onOpen=function(){if(s("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){s("starting upgrade probes");for(var t=0,e=this.upgrades.length;ti&&(r=i),e>=i||e>=r||0===i)return new ArrayBuffer(0);for(var n=new Uint8Array(t),s=new Uint8Array(r-e),o=e,a=0;o=55296&&e<=56319&&n=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function d(t,e){return u(t>>e&63|128)}function m(t,e){if(0==(4294967168&t))return u(t);var r="";return 0==(4294965248&t)?r=u(t>>6&31|192):0==(4294901760&t)?(p(t,e)||(t=65533),r=u(t>>12&15|224),r+=d(t,6)):0==(4292870144&t)&&(r=u(t>>18&7|240),r+=d(t,12),r+=d(t,6)),r+=u(63&t|128)}function _(){if(h>=c)throw Error("Invalid byte index");var t=255&l[h];if(h++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function y(t){var e,r;if(h>c)throw Error("Invalid byte index");if(h==c)return!1;if(e=255&l[h],h++,0==(128&e))return e;if(192==(224&e)){if((r=(31&e)<<6|_())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&e)){if((r=(15&e)<<12|_()<<6|_())>=2048)return p(r,t)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(r=(7&e)<<18|_()<<12|_()<<6|_())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var g={version:"2.1.2",encode:function(t,e){for(var r=!1!==(e=e||{}).strict,i=f(t),n=i.length,s=-1,o="";++s65535&&(n+=u((e-=65536)>>>10&1023|55296),e=56320|1023&e),n+=u(e);return n}(n)}};void 0===(n=function(){return g}.call(e,r,e,t))||(t.exports=n)}()}).call(e,r(40)(t),r(0))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),i=0;i>2],s+=t[(3&i[r])<<4|i[r+1]>>4],s+=t[(15&i[r+1])<<2|i[r+2]>>6],s+=t[63&i[r+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s},e.decode=function(t){var e,i,n,s,o,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&n)<<4|s>>2,u[c++]=(3&s)<<6|63&o;return h}}()},function(t,e,r){(function(e){var r=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,i=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),n=i&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),s=r&&r.prototype.append&&r.prototype.getBlob;function o(t){for(var e=0;e';i=document.createElement(t)}catch(t){(i=document.createElement("iframe")).name=r.iframeId,i.src="javascript:0"}i.id=r.iframeId,r.form.appendChild(i),r.iframe=i}this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(o,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&c()}:this.iframe.onload=c}}).call(e,r(0))},function(t,e,r){(function(e){var i,n=r(11),s=r(2),o=r(5),a=r(6),l=r(18),c=r(7)("engine.io-client:websocket"),h=e.WebSocket||e.MozWebSocket;if("undefined"==typeof window)try{i=r(46)}catch(t){}var u=h;function f(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=h&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(u=i),n.call(this,t)}u||"undefined"!=typeof window||(u=i),t.exports=f,a(f,n),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?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 i=t.length,n=0,o=i;n0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-r:t+r}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}},function(t,e,r){var i,n;n=function(){return function t(e,r,n){function s(a,l){if(!r[a]){if(!e[a]){if(!l&&("function"==typeof i&&i))return i(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){var r=e[a][1][t];return s(r||t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof i&&i,a=0;athis._terminal.rows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&tr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:e},t.prototype.fillViewportRows=function(){if(0===this._lines.length)for(var t=this._terminal.rows;t--;)this.lines.push(this._terminal.blankLine())},t.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this._lines=new i.CircularList(this._getCorrectBufferLength(this._terminal.rows)),this.scrollTop=0,this.scrollBottom=this._terminal.rows-1,this.setupTabStops()},t.prototype.resize=function(t,e){var r=this._getCorrectBufferLength(e);if(r>this._lines.maxLength&&(this._lines.maxLength=r),this._lines.length>0){if(this._terminal.cols0&&this._lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,this.ydisp>0&&this.ydisp--):this._lines.push(this._terminal.blankLine(void 0,void 0,t)));else for(o=this._terminal.rows;o>e;o--)this._lines.length>e+this.ybase&&(this._lines.length>this.ybase+this.y+1?this._lines.pop():(this.ybase++,this.ydisp++));if(r0&&(this._lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0)),this._lines.maxLength=r}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),s&&(this.y+=s),this.savedY=Math.min(this.savedY,e-1),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}this.scrollBottom=e-1},t.prototype.translateBufferLineToString=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=null);var s="",o=this.lines.get(t);if(!o)return"";var a=i;null===n&&(n=o.length);for(var l=n,c=0;c=c&&a--,n>=c&&l--):h[r.CHAR_DATA_CHAR_INDEX].length>1&&(i>c&&(a+=h[r.CHAR_DATA_CHAR_INDEX].length-1),n>c&&(l+=h[r.CHAR_DATA_CHAR_INDEX].length-1))}if(e){var u=s.search(/\s+$/);if(-1!==u&&(l=Math.min(l,u)),l<=a)return""}return s.substring(a,l)},t.prototype.setupTabStops=function(t){for(null!=t?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t0;);return t>=this._terminal.cols?this._terminal.cols-1:t<0?0:t},t.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t=this._terminal.cols?this._terminal.cols-1:t<0?0:t},t}();r.Buffer=n},{"./utils/CircularList":32}],2:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=t("./Buffer"),o=function(t){function e(e){var r=t.call(this)||this;return r._terminal=e,r._normal=new s.Buffer(r._terminal,!0),r._normal.fillViewportRows(),r._alt=new s.Buffer(r._terminal,!1),r._activeBuffer=r._normal,r.setupTabStops(),r}return n(e,t),Object.defineProperty(e.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),e.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._alt.clear(),this._activeBuffer=this._normal,this.emit("activate",{activeBuffer:this._normal,inactiveBuffer:this._alt}))},e.prototype.activateAltBuffer=function(){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(),this._activeBuffer=this._alt,this.emit("activate",{activeBuffer:this._alt,inactiveBuffer:this._normal}))},e.prototype.resize=function(t,e){this._normal.resize(t,e),this._alt.resize(t,e)},e.prototype.setupTabStops=function(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)},e}(t("./EventEmitter").EventEmitter);r.BufferSet=o},{"./Buffer":1,"./EventEmitter":7}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),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]];function i(t,e){var r,i=0,n=e.length-1;if(te[n][1])return!1;for(;n>=i;)if(t>e[r=i+n>>1][1])i=r+1;else{if(!(t=127&&r<160?t.control:i(r,e)?0:function(t){return t>=4352&&(t<=4447||9001===t||9002===t||t>=11904&&t<=42191&&12351!==t||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510)}(r)?2:1);s[n]=o}return s}();return o<65536?l[o>>4]>>((15&o)<<1)&3:i(a=o,r)?0:a>=131072&&a<=196605||a>=196608&&a<=262141?2:1}}({nul:0,control:0})},{}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"◆",a:"▒",b:"\t",c:"\f",d:"\r",e:"\n",f:"°",g:"±",h:"␤",i:"\v",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=null,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},{}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=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=void 0;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 i=this.textarea.value.substring(this.compositionPosition.start,this.compositionPosition.end);this.terminal.handler(i)}},t.prototype.handleAnyTextareaChanges=function(){var t=this,e=this.textarea.value;setTimeout(function(){if(!t.isComposing){var r=t.textarea.value.replace(e,"");r.length>0&&t.terminal.handler(r)}},0)},t.prototype.updateCompositionElements=function(t){var e=this;if(this.isComposing){if(this.terminal.buffer.isCursorInViewport){var r=Math.ceil(this.terminal.charMeasure.height*this.terminal.options.lineHeight),i=this.terminal.buffer.y*r,n=this.terminal.buffer.x*this.terminal.charMeasure.width;this.compositionView.style.left=n+"px",this.compositionView.style.top=i+"px",this.compositionView.style.height=r+"px",this.compositionView.style.lineHeight=r+"px";var s=this.compositionView.getBoundingClientRect();this.textarea.style.left=n+"px",this.textarea.style.top=i+"px",this.textarea.style.width=s.width+"px",this.textarea.style.height=s.height+"px",this.textarea.style.lineHeight=s.height+"px"}t||setTimeout(function(){return e.updateCompositionElements(!0)},0)}},t.prototype.clearTextareaPosition=function(){this.textarea.style.left="",this.textarea.style.top=""},t}();r.CompositionHelper=i},{}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(t){t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="",t.BS="\b",t.HT="\t",t.LF="\n",t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""}(r.C0||(r.C0={}))},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){this._events=this._events||{}}return t.prototype.on=function(t,e){this._events[t]=this._events[t]||[],this._events[t].push(e)},t.prototype.off=function(t,e){if(this._events[t])for(var r=this._events[t],i=r.length;i--;)if(r[i]===e)return void r.splice(i,1)},t.prototype.removeAllListeners=function(t){this._events[t]&&delete this._events[t]},t.prototype.emit=function(t){for(var e=[],r=1;r=" "){var r=a.wcwidth(e);this._terminal.charset&&this._terminal.charset[t]&&(t=this._terminal.charset[t]);var i=this._terminal.buffer.y+this._terminal.buffer.ybase;if(!r&&this._terminal.buffer.x)return void(this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-1]&&(this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-1][s.CHAR_DATA_WIDTH_INDEX]?(this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-1][s.CHAR_DATA_CHAR_INDEX]+=t,this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-1][3]=t.charCodeAt(0)):this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-2]&&(this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-2][s.CHAR_DATA_CHAR_INDEX]+=t,this._terminal.buffer.lines.get(i)[this._terminal.buffer.x-2][3]=t.charCodeAt(0)),this._terminal.updateRange(this._terminal.buffer.y)));if(this._terminal.buffer.x+r-1>=this._terminal.cols)if(this._terminal.wraparoundMode)this._terminal.buffer.x=0,this._terminal.buffer.y++,this._terminal.buffer.y>this._terminal.buffer.scrollBottom?(this._terminal.buffer.y--,this._terminal.scroll(!0)):this._terminal.buffer.lines.get(this._terminal.buffer.y).isWrapped=!0;else if(2===r)return;if(i=this._terminal.buffer.y+this._terminal.buffer.ybase,this._terminal.insertMode)for(var n=0;nthis._terminal.buffer.scrollBottom&&(this._terminal.buffer.y--,this._terminal.scroll()),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.emit("linefeed")},t.prototype.carriageReturn=function(){this._terminal.buffer.x=0},t.prototype.backspace=function(){this._terminal.buffer.x>0&&this._terminal.buffer.x--},t.prototype.tab=function(){this._terminal.buffer.x=this._terminal.buffer.nextStop()},t.prototype.shiftOut=function(){this._terminal.setgLevel(1)},t.prototype.shiftIn=function(){this._terminal.setgLevel(0)},t.prototype.insertChars=function(t){var e=t[0];e<1&&(e=1);for(var r=this._terminal.buffer.y+this._terminal.buffer.ybase,i=this._terminal.buffer.x,n=[this._terminal.eraseAttr()," ",1,32];e--&&i=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},t.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)},t.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)},t.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},t.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},t.prototype.cursorCharAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x=e-1},t.prototype.cursorPosition=function(t){var e,r=t[0]-1;e=t.length>=2?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},t.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},t.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(this._terminal.eraseRight(this._terminal.buffer.x,this._terminal.buffer.y),e=this._terminal.buffer.y+1;e0&&(this._terminal.buffer.lines.trimStart(r),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-r,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-r,0),this._terminal.emit("scroll",0))}},t.prototype.eraseInLine=function(t){switch(t[0]){case 0:this._terminal.eraseRight(this._terminal.buffer.x,this._terminal.buffer.y);break;case 1:this._terminal.eraseLeft(this._terminal.buffer.x,this._terminal.buffer.y);break;case 2:this._terminal.eraseLine(this._terminal.buffer.y)}},t.prototype.insertLines=function(t){var e=t[0];e<1&&(e=1);for(var r=this._terminal.buffer.y+this._terminal.buffer.ybase,i=this._terminal.rows-1-this._terminal.buffer.scrollBottom,n=this._terminal.rows-1+this._terminal.buffer.ybase-i+1;e--;)this._terminal.buffer.lines.splice(n-1,1),this._terminal.buffer.lines.splice(r,0,this._terminal.blankLine(!0));this._terminal.updateRange(this._terminal.buffer.y),this._terminal.updateRange(this._terminal.buffer.scrollBottom)},t.prototype.deleteLines=function(t){var e=t[0];e<1&&(e=1);var r,i=this._terminal.buffer.y+this._terminal.buffer.ybase;for(r=this._terminal.rows-1-this._terminal.buffer.scrollBottom,r=this._terminal.rows-1+this._terminal.buffer.ybase-r;e--;)this._terminal.buffer.lines.splice(i,1),this._terminal.buffer.lines.splice(r,0,this._terminal.blankLine(!0));this._terminal.updateRange(this._terminal.buffer.y),this._terminal.updateRange(this._terminal.buffer.scrollBottom)},t.prototype.deleteChars=function(t){var e=t[0];e<1&&(e=1);for(var r=this._terminal.buffer.y+this._terminal.buffer.ybase,i=[this._terminal.eraseAttr()," ",1,32];e--;)this._terminal.buffer.lines.get(r).splice(this._terminal.buffer.x,1),this._terminal.buffer.lines.get(r).push(i);this._terminal.updateRange(this._terminal.buffer.y)},t.prototype.scrollUp=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.lines.splice(this._terminal.buffer.ybase+this._terminal.buffer.scrollTop,1),this._terminal.buffer.lines.splice(this._terminal.buffer.ybase+this._terminal.buffer.scrollBottom,0,this._terminal.blankLine());this._terminal.updateRange(this._terminal.buffer.scrollTop),this._terminal.updateRange(this._terminal.buffer.scrollBottom)},t.prototype.scrollDown=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.lines.splice(this._terminal.buffer.ybase+this._terminal.buffer.scrollBottom,1),this._terminal.buffer.lines.splice(this._terminal.buffer.ybase+this._terminal.buffer.scrollTop,0,this._terminal.blankLine());this._terminal.updateRange(this._terminal.buffer.scrollTop),this._terminal.updateRange(this._terminal.buffer.scrollBottom)},t.prototype.eraseChars=function(t){var e=t[0];e<1&&(e=1);for(var r=this._terminal.buffer.y+this._terminal.buffer.ybase,i=this._terminal.buffer.x,n=[this._terminal.eraseAttr()," ",1,32];e--&&i=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},t.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)},t.prototype.repeatPrecedingCharacter=function(t){for(var e=t[0]||1,r=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+this._terminal.buffer.y),i=r[this._terminal.buffer.x-1]||[this._terminal.defAttr," ",1,32];e--;)r[this._terminal.buffer.x++]=i},t.prototype.sendDeviceAttributes=function(t){t[0]>0||(this._terminal.prefix?">"===this._terminal.prefix&&(this._terminal.is("xterm")?this._terminal.send(i.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.send(i.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.send(t[0]+"c"):this._terminal.is("screen")&&this._terminal.send(i.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.send(i.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.send(i.C0.ESC+"[?6c"))},t.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)},t.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--},t.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)},t.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={})},t.prototype.setMode=function(t){if(t.length>1)for(var e=0;e1e3,this._terminal.mouseEvents=!0,this._terminal.element.classList.add("enable-mouse-events"),this._terminal.selectionManager.disable(),this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1049:case 47:case 1047:this._terminal.buffers.activateAltBuffer(),this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}}else switch(t[0]){case 4:this._terminal.insertMode=!0}},t.prototype.resetMode=function(t){if(t.length>1)for(var e=0;e>18,n=this._terminal.curAttr>>9&511,s=511&this._terminal.curAttr,a=0;a=30&&e<=37?n=e-30:e>=40&&e<=47?s=e-40:e>=90&&e<=97?n=(e+=8)-90:e>=100&&e<=107?s=(e+=8)-100:0===e?(i=this._terminal.defAttr>>18,n=this._terminal.defAttr>>9&511,s=511&this._terminal.defAttr):1===e?i|=o.FLAGS.BOLD:4===e?i|=o.FLAGS.UNDERLINE:5===e?i|=o.FLAGS.BLINK:7===e?i|=o.FLAGS.INVERSE:8===e?i|=o.FLAGS.INVISIBLE:2===e?i|=o.FLAGS.DIM:22===e?(i&=~o.FLAGS.BOLD,i&=~o.FLAGS.DIM):24===e?i&=~o.FLAGS.UNDERLINE:25===e?i&=~o.FLAGS.BLINK:27===e?i&=~o.FLAGS.INVERSE:28===e?i&=~o.FLAGS.INVISIBLE:39===e?n=this._terminal.defAttr>>9&511:49===e?s=511&this._terminal.defAttr:38===e?2===t[a+1]?(a+=2,-1===(n=this._terminal.matchColor(255&t[a],255&t[a+1],255&t[a+2]))&&(n=511),a+=2):5===t[a+1]&&(n=e=255&t[a+=2]):48===e?2===t[a+1]?(a+=2,-1===(s=this._terminal.matchColor(255&t[a],255&t[a+1],255&t[a+2]))&&(s=511),a+=2):5===t[a+1]&&(s=e=255&t[a+=2]):100===e?(n=this._terminal.defAttr>>9&511,s=511&this._terminal.defAttr):this._terminal.error("Unknown SGR attribute: %d.",e);this._terminal.curAttr=i<<18|n<<9|s}else this._terminal.curAttr=this._terminal.defAttr},t.prototype.deviceStatus=function(t){if(this._terminal.prefix){if("?"===this._terminal.prefix)switch(t[0]){case 6:this._terminal.send(i.C0.ESC+"[?"+(this._terminal.buffer.y+1)+";"+(this._terminal.buffer.x+1)+"R")}}else switch(t[0]){case 5:this._terminal.send(i.C0.ESC+"[0n");break;case 6:this._terminal.send(i.C0.ESC+"["+(this._terminal.buffer.y+1)+";"+(this._terminal.buffer.x+1)+"R")}},t.prototype.softReset=function(t){this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=!1,this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.buffer.scrollTop=0,this._terminal.buffer.scrollBottom=this._terminal.rows-1,this._terminal.curAttr=this._terminal.defAttr,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null]},t.prototype.setCursorStyle=function(t){var e=t[0]<1?1:t[0];switch(e){case 1:case 2:this._terminal.setOption("cursorStyle","block");break;case 3:case 4:this._terminal.setOption("cursorStyle","underline");break;case 5:case 6:this._terminal.setOption("cursorStyle","bar")}var r=e%2==1;this._terminal.setOption("cursorBlink",r)},t.prototype.setScrollRegion=function(t){this._terminal.prefix||(this._terminal.buffer.scrollTop=(t[0]||1)-1,this._terminal.buffer.scrollBottom=(t[1]&&t[1]<=this._terminal.rows?t[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},t.prototype.saveCursor=function(t){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y},t.prototype.restoreCursor=function(t){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0},t}();r.InputHandler=l},{"./Buffer":1,"./CharWidth":3,"./Charsets":4,"./EscapeSequences":6,"./renderer/Types":28}],9:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=t("./Types"),o=t("./input/MouseZoneManager"),a=t("./EventEmitter"),l=new RegExp("(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,6}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?(\\/[\\/\\w\\.\\-%~]*)*(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)"),c=0,h=function(t){function e(e){var r=t.call(this)||this;return r._terminal=e,r._linkMatchers=[],r._nextLinkMatcherId=c,r._rowsToLinkify={start:null,end:null},r.registerLinkMatcher(l,null,{matchIndex:1}),r}return n(e,t),e.prototype.attachToDom=function(t){this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,r){var i=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=r):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,r)),this._mouseZoneManager.clearAll(t,r),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return i._linkifyRows()},e.TIME_BEFORE_LINKIFY))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=null;for(var t=this._rowsToLinkify.start;t<=this._rowsToLinkify.end;t++)this._linkifyRow(t);this._rowsToLinkify.start=null,this._rowsToLinkify.end=null},e.prototype.setHypertextLinkHandler=function(t){this._linkMatchers[c].handler=t},e.prototype.setHypertextValidationCallback=function(t){this._linkMatchers[c].validationCallback=t},e.prototype.registerLinkMatcher=function(t,e,r){if(void 0===r&&(r={}),this._nextLinkMatcherId!==c&&!e)throw new Error("handler must be defined");var i={id:this._nextLinkMatcherId++,regex:t,handler:e,matchIndex:r.matchIndex,validationCallback:r.validationCallback,hoverTooltipCallback:r.tooltipCallback,hoverLeaveCallback:r.leaveCallback,willLinkActivate:r.willLinkActivate,priority:r.priority||0};return this._addLinkMatcherToList(i),i.id},e.prototype._addLinkMatcherToList=function(t){if(0!==this._linkMatchers.length){for(var e=this._linkMatchers.length-1;e>=0;e--)if(t.priority<=this._linkMatchers[e].priority)return void this._linkMatchers.splice(e+1,0,t);this._linkMatchers.splice(0,0,t)}else this._linkMatchers.push(t)},e.prototype.deregisterLinkMatcher=function(t){for(var e=1;e=this._terminal.buffer.lines.length))for(var r=this._terminal.buffer.translateBufferLineToString(e,!1),i=0;i0&&this._doLinkifyRow(t,c,r,i+l)}},e.prototype._addLink=function(t,e,r,i){var n=this;this._mouseZoneManager.add(new o.MouseZone(t+1,t+1+r.length,e+1,function(t){if(i.handler)return i.handler(t,r);window.open(r,"_blank")},function(i){n.emit(s.LinkHoverEventTypes.HOVER,{x:t,y:e,length:r.length}),n._terminal.element.style.cursor="pointer"},function(o){n.emit(s.LinkHoverEventTypes.TOOLTIP,{x:t,y:e,length:r.length}),i.hoverTooltipCallback&&i.hoverTooltipCallback(o,r)},function(){n.emit(s.LinkHoverEventTypes.LEAVE,{x:t,y:e,length:r.length}),n._terminal.element.style.cursor="",i.hoverLeaveCallback&&i.hoverLeaveCallback()},function(t){return!i.willLinkActivate||i.willLinkActivate(t,r)}))},e.TIME_BEFORE_LINKIFY=200,e}(a.EventEmitter);r.Linkifier=h},{"./EventEmitter":7,"./Types":14,"./input/MouseZoneManager":18}],10:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./EscapeSequences"),n=t("./Charsets"),s={};s[i.C0.BEL]=function(t,e){return e.bell()},s[i.C0.LF]=function(t,e){return e.lineFeed()},s[i.C0.VT]=s[i.C0.LF],s[i.C0.FF]=s[i.C0.LF],s[i.C0.CR]=function(t,e){return e.carriageReturn()},s[i.C0.BS]=function(t,e){return e.backspace()},s[i.C0.HT]=function(t,e){return e.tab()},s[i.C0.SO]=function(t,e){return e.shiftOut()},s[i.C0.SI]=function(t,e){return e.shiftIn()},s[i.C0.ESC]=function(t,e){return t.setState(l.ESCAPED)};var o={"[":function(t,e){e.params=[],e.currentParam=0,t.setState(l.CSI_PARAM)},"]":function(t,e){e.params=[],e.currentParam=0,t.setState(l.OSC)},P:function(t,e){e.params=[],e.currentParam=0,t.setState(l.DCS)},_:function(t,e){t.setState(l.IGNORE)},"^":function(t,e){t.setState(l.IGNORE)},c:function(t,e){e.reset()},E:function(t,e){e.buffer.x=0,e.index(),t.setState(l.NORMAL)},D:function(t,e){e.index(),t.setState(l.NORMAL)},M:function(t,e){e.reverseIndex(),t.setState(l.NORMAL)},"%":function(t,e){e.setgLevel(0),e.setgCharset(0,n.DEFAULT_CHARSET),t.setState(l.NORMAL),t.skipNextChar()}};o[i.C0.CAN]=function(t){return t.setState(l.NORMAL)};var a={"?":function(t){return t.setPrefix("?")},">":function(t){return t.setPrefix(">")},"!":function(t){return t.setPrefix("!")},0:function(t){return t.setParam(10*t.getParam())},1:function(t){return t.setParam(10*t.getParam()+1)},2:function(t){return t.setParam(10*t.getParam()+2)},3:function(t){return t.setParam(10*t.getParam()+3)},4:function(t){return t.setParam(10*t.getParam()+4)},5:function(t){return t.setParam(10*t.getParam()+5)},6:function(t){return t.setParam(10*t.getParam()+6)},7:function(t){return t.setParam(10*t.getParam()+7)},8:function(t){return t.setParam(10*t.getParam()+8)},9:function(t){return t.setParam(10*t.getParam()+9)},$:function(t){return t.setPostfix("$")},'"':function(t){return t.setPostfix('"')}," ":function(t){return t.setPostfix(" ")},"'":function(t){return t.setPostfix("'")},";":function(t){return t.finalizeParam()}};a[i.C0.CAN]=function(t){return t.setState(l.NORMAL)};var l,c={};c["@"]=function(t,e,r){return t.insertChars(e)},c.A=function(t,e,r){return t.cursorUp(e)},c.B=function(t,e,r){return t.cursorDown(e)},c.C=function(t,e,r){return t.cursorForward(e)},c.D=function(t,e,r){return t.cursorBackward(e)},c.E=function(t,e,r){return t.cursorNextLine(e)},c.F=function(t,e,r){return t.cursorPrecedingLine(e)},c.G=function(t,e,r){return t.cursorCharAbsolute(e)},c.H=function(t,e,r){return t.cursorPosition(e)},c.I=function(t,e,r){return t.cursorForwardTab(e)},c.J=function(t,e,r){return t.eraseInDisplay(e)},c.K=function(t,e,r){return t.eraseInLine(e)},c.L=function(t,e,r){return t.insertLines(e)},c.M=function(t,e,r){return t.deleteLines(e)},c.P=function(t,e,r){return t.deleteChars(e)},c.S=function(t,e,r){return t.scrollUp(e)},c.T=function(t,e,r){e.length<2&&!r&&t.scrollDown(e)},c.X=function(t,e,r){return t.eraseChars(e)},c.Z=function(t,e,r){return t.cursorBackwardTab(e)},c["`"]=function(t,e,r){return t.charPosAbsolute(e)},c.a=function(t,e,r){return t.HPositionRelative(e)},c.b=function(t,e,r){return t.repeatPrecedingCharacter(e)},c.c=function(t,e,r){return t.sendDeviceAttributes(e)},c.d=function(t,e,r){return t.linePosAbsolute(e)},c.e=function(t,e,r){return t.VPositionRelative(e)},c.f=function(t,e,r){return t.HVPosition(e)},c.g=function(t,e,r){return t.tabClear(e)},c.h=function(t,e,r){return t.setMode(e)},c.l=function(t,e,r){return t.resetMode(e)},c.m=function(t,e,r){return t.charAttributes(e)},c.n=function(t,e,r){return t.deviceStatus(e)},c.p=function(t,e,r){switch(r){case"!":t.softReset(e)}},c.q=function(t,e,r,i){" "===i&&t.setCursorStyle(e)},c.r=function(t,e){return t.setScrollRegion(e)},c.s=function(t,e){return t.saveCursor(e)},c.u=function(t,e){return t.restoreCursor(e)},c[i.C0.CAN]=function(t,e,r,i,n){return n.setState(l.NORMAL)},function(t){t[t.NORMAL=0]="NORMAL",t[t.ESCAPED=1]="ESCAPED",t[t.CSI_PARAM=2]="CSI_PARAM",t[t.CSI=3]="CSI",t[t.OSC=4]="OSC",t[t.CHARSET=5]="CHARSET",t[t.DCS=6]="DCS",t[t.IGNORE=7]="IGNORE"}(l=r.ParserState||(r.ParserState={}));var h=function(){function t(t,e){this._inputHandler=t,this._terminal=e,this._state=l.NORMAL}return t.prototype.parse=function(t){var e,r,h,u,f=t.length,p=this._terminal.buffer.x,d=this._terminal.buffer.y;for(this._terminal.debug&&this._terminal.log("data: "+t),this._position=0,this._terminal.surrogate_high&&(t=this._terminal.surrogate_high+t,this._terminal.surrogate_high="");this._position":this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._state=l.NORMAL;break;default:this._state=l.NORMAL,this._terminal.error("Unknown ESC control: %s.",r)}break;case l.CHARSET:r in n.CHARSETS?(e=n.CHARSETS[r],"/"===r&&this.skipNextChar()):e=n.DEFAULT_CHARSET,this._terminal.setgCharset(this._terminal.gcharset,e),this._terminal.gcharset=null,this._state=l.NORMAL;break;case l.OSC:if(r===i.C0.ESC||r===i.C0.BEL){switch(r===i.C0.ESC&&this._position++,this._terminal.params.push(this._terminal.currentParam),this._terminal.params[0]){case 0:case 1:case 2:this._terminal.params[1]&&(this._terminal.title=this._terminal.params[1],this._terminal.handleTitle(this._terminal.title))}this._terminal.params=[],this._terminal.currentParam=0,this._state=l.NORMAL}else this._terminal.params.length?this._terminal.currentParam+=r:r>="0"&&r<="9"?this._terminal.currentParam=10*this._terminal.currentParam+r.charCodeAt(0)-48:";"===r&&(this._terminal.params.push(this._terminal.currentParam),this._terminal.currentParam="");break;case l.CSI_PARAM:if(r in a){a[r](this);break}this.finalizeParam(),this._state=l.CSI;case l.CSI:r in c?(this._terminal.debug&&this._terminal.log("CSI "+(this._terminal.prefix?this._terminal.prefix:"")+" "+(this._terminal.params?this._terminal.params.join(";"):"")+" "+(this._terminal.postfix?this._terminal.postfix:"")+" "+r),c[r](this._inputHandler,this._terminal.params,this._terminal.prefix,this._terminal.postfix,this)):this._terminal.error("Unknown CSI code: %s.",r),this._state=l.NORMAL,this._terminal.prefix="",this._terminal.postfix="";break;case l.DCS:if(r===i.C0.ESC||r===i.C0.BEL){r===i.C0.ESC&&this._position++;var m=void 0,_=void 0;switch(this._terminal.prefix){case"":break;case"$q":switch(_=!1,m=this._terminal.currentParam){case'"q':m='0"q';break;case'"p':m='61"p';break;case"r":m=this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r";break;case"m":m="0m";break;default:this._terminal.error("Unknown DCS Pt: %s.",m),m=""}this._terminal.send(i.C0.ESC+"P"+ +_+"$r"+m+i.C0.ESC+"\\");break;case"+p":break;case"+q":m=this._terminal.currentParam,_=!1,this._terminal.send(i.C0.ESC+"P"+ +_+"+r"+m+i.C0.ESC+"\\");break;default:this._terminal.error("Unknown DCS prefix: %s.",this._terminal.prefix)}this._terminal.currentParam=0,this._terminal.prefix="",this._state=l.NORMAL}else this._terminal.currentParam?this._terminal.currentParam+=r:this._terminal.prefix||"$"===r||"+"===r?2===this._terminal.prefix.length?this._terminal.currentParam=r:this._terminal.prefix+=r:this._terminal.currentParam=r;break;case l.IGNORE:r!==i.C0.ESC&&r!==i.C0.BEL||(r===i.C0.ESC&&this._position++,this._state=l.NORMAL)}}return this._terminal.buffer.x===p&&this._terminal.buffer.y===d||this._terminal.emit("cursormove"),this._state},t.prototype.setState=function(t){this._state=t},t.prototype.setPrefix=function(t){this._terminal.prefix=t},t.prototype.setPostfix=function(t){this._terminal.postfix=t},t.prototype.setParam=function(t){this._terminal.currentParam=t},t.prototype.getParam=function(){return this._terminal.currentParam},t.prototype.finalizeParam=function(){this._terminal.params.push(this._terminal.currentParam),this._terminal.currentParam=0},t.prototype.skipNextChar=function(){this._position++},t}();r.Parser=h},{"./Charsets":4,"./EscapeSequences":6}],11:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s,o=t("./utils/MouseHelper"),a=t("./shared/utils/Browser"),l=t("./EventEmitter"),c=t("./SelectionModel"),h=t("./Buffer"),u=t("./handlers/AltClickHandler"),f=String.fromCharCode(160),p=new RegExp(f,"g");!function(t){t[t.NORMAL=0]="NORMAL",t[t.WORD=1]="WORD",t[t.LINE=2]="LINE"}(s||(s={}));var d=function(t){function e(e,r){var i=t.call(this)||this;return i._terminal=e,i._charMeasure=r,i._enabled=!0,i._initListeners(),i.enable(),i._model=new c.SelectionModel(e),i._activeSelectionMode=s.NORMAL,i}return n(e,t),Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var t=this;this._mouseMoveListener=function(e){return t._onMouseMove(e)},this._mouseUpListener=function(e){return t._onMouseUp(e)},this._trimListener=function(e){return t._onTrim(e)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var t=this;this._terminal.buffer.lines.on("trim",this._trimListener),this._terminal.buffers.on("activate",function(e){return t._onBufferActivate(e)})},e.prototype.disable=function(){this.clearSelection(),this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSelection",{get:function(){var t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;return!(!t||!e)&&(t[0]!==e[0]||t[1]!==e[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;if(!t||!e)return"";var r=t[1]===e[1]?e[0]:null,i=[];i.push(this._buffer.translateBufferLineToString(t[1],!0,t[0],r));for(var n=t[1]+1;n<=e[1]-1;n++){var s=this._buffer.lines.get(n),o=this._buffer.translateBufferLineToString(n,!0);s.isWrapped?i[i.length-1]+=o:i.push(o)}if(t[1]!==e[1]){s=this._buffer.lines.get(e[1]),o=this._buffer.translateBufferLineToString(e[1],!0,0,e[0]);s.isWrapped?i[i.length-1]+=o:i.push(o)}return i.map(function(t){return t.replace(p," ")}).join(a.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},e.prototype.refresh=function(t){var e=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return e._refresh()})),a.isLinux&&t)&&(this.selectionText.length&&this.emit("newselection",this.selectionText))},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this.emit("refresh",{start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd})},e.prototype.isClickInSelection=function(t){var e=this._getMouseBufferCoords(t),r=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!(!r||!i)&&(e[1]>r[1]&&e[1]r[0]&&e[0]=0&&e<=r?0:(e>r&&(e-=r),e=Math.min(Math.max(e,-50),50),(e/=50)/Math.abs(e)+Math.round(14*e))},e.prototype.shouldForceSelection=function(t){return a.isMac?t.altKey:t.shiftKey},e.prototype.onMouseDown=function(t){if(this._mouseDownTimeStamp=t.timeStamp,(2!==t.button||!this.hasSelection)&&0===t.button){if(!this._enabled){if(!this.shouldForceSelection(t))return;t.stopPropagation()}t.preventDefault(),this._dragScrollAmount=0,this._enabled&&t.shiftKey?this._onIncrementalClick(t):1===t.detail?this._onSingleClick(t):2===t.detail?this._onDoubleClick(t):3===t.detail&&this._onTripleClick(t),this._addMouseDownListeners(),this.refresh(!0)}},e.prototype._addMouseDownListeners=function(){var t=this;this._terminal.element.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.addEventListener("mouseup",this._mouseUpListener),this._dragScrollIntervalTimer=setInterval(function(){return t._dragScroll()},50)},e.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},e.prototype._onIncrementalClick=function(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))},e.prototype._onSingleClick=function(t){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=s.NORMAL,this._model.selectionStart=this._getMouseBufferCoords(t),this._model.selectionStart){this._model.selectionEnd=null;var e=this._buffer.lines.get(this._model.selectionStart[1]);if(e)if(!(e.length>=this._model.selectionStart[0]))0===e[this._model.selectionStart[0]][h.CHAR_DATA_WIDTH_INDEX]&&this._model.selectionStart[0]++}},e.prototype._onDoubleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=s.WORD,this._selectWordAt(e,!0))},e.prototype._onTripleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=s.LINE,this._selectLineAt(e[1]))},e.prototype._onMouseMove=function(t){t.stopImmediatePropagation();var e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(t),this._model.selectionEnd){if(this._activeSelectionMode===s.LINE?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._terminal.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]0?this._model.selectionEnd=[this._terminal.cols-1,Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)]:this._model.selectionEnd=[0,this._terminal.buffer.ydisp],this.refresh())},e.prototype._onMouseUp=function(t){var e=t.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&e<500?new u.AltClickHandler(t,this._terminal).move():this.hasSelection&&this._terminal.emit("selection")},e.prototype._onBufferActivate=function(t){this.clearSelection(),t.inactiveBuffer.lines.off("trim",this._trimListener),t.activeBuffer.lines.on("trim",this._trimListener)},e.prototype._convertViewportColToCharacterIndex=function(t,e){for(var r=e[0],i=0;e[0]>=i;i++){var n=t[i];0===n[h.CHAR_DATA_WIDTH_INDEX]?r--:n[h.CHAR_DATA_CHAR_INDEX].length>1&&e[0]!==i&&(r+=n[h.CHAR_DATA_CHAR_INDEX].length-1)}return r},e.prototype.setSelection=function(t,e,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,e],this._model.selectionStartLength=r,this.refresh()},e.prototype._getWordAt=function(t,e){var r=this._buffer.lines.get(t[1]);if(!r)return null;var i=this._buffer.translateBufferLineToString(t[1],!1),n=this._convertViewportColToCharacterIndex(r,t),s=n,o=t[0]-n,a=0,l=0,c=0,u=0;if(" "===i.charAt(n)){for(;n>0&&" "===i.charAt(n-1);)n--;for(;s1&&(u+=r[p][h.CHAR_DATA_CHAR_INDEX].length-1,s+=r[p][h.CHAR_DATA_CHAR_INDEX].length-1);f>0&&n>0&&!this._isCharWordSeparator(r[f-1]);){0===(d=r[f-1])[h.CHAR_DATA_WIDTH_INDEX]?(a++,f--):d[h.CHAR_DATA_CHAR_INDEX].length>1&&(c+=d[h.CHAR_DATA_CHAR_INDEX].length-1,n-=d[h.CHAR_DATA_CHAR_INDEX].length-1),n--,f--}for(;p1&&(u+=d[h.CHAR_DATA_CHAR_INDEX].length-1,s+=d[h.CHAR_DATA_CHAR_INDEX].length-1),s++,p++}}s++;var m=n+o-a+c,_=Math.min(this._terminal.cols,s-n+a+l-c-u);return e||""!==i.slice(n,s).trim()?{start:m,length:_}:null},e.prototype._selectWordAt=function(t,e){var r=this._getWordAt(t,e);r&&(this._model.selectionStart=[r.start,t[1]],this._model.selectionStartLength=r.length)},e.prototype._selectToWordAt=function(t){var e=this._getWordAt(t,!0);e&&(this._model.selectionEnd=[this._model.areSelectionValuesReversed()?e.start:e.start+e.length,t[1]])},e.prototype._isCharWordSeparator=function(t){return 0!==t[h.CHAR_DATA_WIDTH_INDEX]&&" ()[]{}'\"".indexOf(t[h.CHAR_DATA_CHAR_INDEX])>=0},e.prototype._selectLineAt=function(t){this._model.selectionStart=[0,t],this._model.selectionStartLength=this._terminal.cols},e}(l.EventEmitter);r.SelectionManager=d},{"./Buffer":1,"./EventEmitter":7,"./SelectionModel":12,"./handlers/AltClickHandler":16,"./shared/utils/Browser":30,"./utils/MouseHelper":33}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=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(){return this.isSelectAllActive?[this._terminal.cols,this._terminal.buffer.ybase+this._terminal.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?[this.selectionStart[0]+this.selectionStartLength,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:null},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=i},{}],13:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=t("./BufferSet"),o=t("./Buffer"),a=t("./CompositionHelper"),l=t("./EventEmitter"),c=t("./Viewport"),h=t("./handlers/Clipboard"),u=t("./EscapeSequences"),f=t("./InputHandler"),p=t("./Parser"),d=t("./renderer/Renderer"),m=t("./Linkifier"),_=t("./SelectionManager"),y=t("./utils/CharMeasure"),g=t("./shared/utils/Browser"),v=t("./utils/MouseHelper"),b=t("./utils/Sounds"),C=t("./renderer/ColorManager"),w=t("./input/MouseZoneManager"),k="undefined"!=typeof window?window.document:null,A={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:b.BELL_SOUND,bellStyle:"none",enableBold:!0,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,scrollback:1e3,screenKeys:!1,debug:!1,macOptionIsMeta:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:null,rightClickSelectsWord:g.isMac},x=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.browser=g,r.options=e,r.setup(),r}return n(e,t),e.prototype.setup=function(){var t=this;Object.keys(A).forEach(function(e){null==t.options[e]&&(t.options[e]=A[e]),t[e]=t.options[e]}),this.parent=k?k.body:null,this.cols=this.options.cols,this.rows=this.options.rows,this.options.handler&&this.on("data",this.options.handler),this.cursorState=0,this.cursorHidden=!1,this.sendDataQueue="",this.customKeyEventHandler=null,this.applicationKeypad=!1,this.applicationCursor=!1,this.originMode=!1,this.insertMode=!1,this.wraparoundMode=!0,this.bracketedPasteMode=!1,this.charset=null,this.gcharset=null,this.glevel=0,this.charsets=[null],this.readable=!0,this.writable=!0,this.defAttr=131840,this.curAttr=131840,this.params=[],this.currentParam=0,this.prefix="",this.postfix="",this.writeBuffer=[],this.writeInProgress=!1,this.xoffSentToCatchUp=!1,this.writeStopped=!1,this.surrogateHigh="",this.userScrolling=!1,this.inputHandler=new f.InputHandler(this),this.parser=new p.Parser(this.inputHandler,this),this.renderer=this.renderer||null,this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new m.Linkifier(this),this._mouseZoneManager=this._mouseZoneManager||null,this.buffers=new s.BufferSet(this),this.selectionManager&&(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners())},Object.defineProperty(e.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),e.prototype.eraseAttr=function(){return-512&this.defAttr|511&this.curAttr},e.prototype.focus=function(){this.textarea&&this.textarea.focus()},Object.defineProperty(e.prototype,"isFocused",{get:function(){return k.activeElement===this.textarea},enumerable:!0,configurable:!0}),e.prototype.getOption=function(t){if(!(t in A))throw new Error('No option with key "'+t+'"');return void 0!==this.options[t]?this.options[t]:this[t]},e.prototype.setOption=function(t,e){if(!(t in A))throw new Error('No option with key "'+t+'"');switch(t){case"bellStyle":e||(e="none");break;case"cursorStyle":e||(e="block");break;case"fontWeight":e||(e="normal");break;case"fontWeightBold":e||(e="bold");break;case"lineHeight":if(e<1)return void console.warn(t+" cannot be less than 1, value: "+e);case"tabStopWidth":if(e<1)return void console.warn(t+" cannot be less than 1, value: "+e);break;case"theme":if(this.renderer)return void this._setTheme(e);break;case"scrollback":if((e=Math.min(e,o.MAX_BUFFER_SIZE))<0)return void console.warn(t+" cannot be less than 0, value: "+e);if(this.options[t]!==e){var r=this.rows+e;if(this.buffer.lines.length>r){var i=this.buffer.lines.length-r,n=this.buffer.ydisp-i<0;this.buffer.lines.trimStart(i),this.buffer.ybase=Math.max(this.buffer.ybase-i,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-i,0),n&&this.refresh(0,this.rows-1)}}}switch(this[t]=e,this.options[t]=e,t){case"fontFamily":case"fontSize":this.renderer.clear(),this.charMeasure.measure(this.options);break;case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":var s="fontWeight"===t||"fontWeightBold"===t||"enableBold"===t;this.renderer.clear(),this.renderer.onResize(this.cols,this.rows,s),this.refresh(0,this.rows-1);case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport.syncScrollArea();break;case"tabStopWidth":this.buffers.setupTabStops();break;case"bellSound":case"bellStyle":this.syncBellSound()}this.renderer&&this.renderer.onOptionsChanged()},e.prototype._onTextAreaFocus=function(){this.sendFocus&&this.send(u.C0.ESC+"[I"),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},e.prototype.blur=function(){return this.textarea.blur()},e.prototype._onTextAreaBlur=function(){this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this.send(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},e.prototype.initGlobal=function(){var t=this;this.bindKeys(),S(this.element,"copy",function(e){t.hasSelection()&&h.copyHandler(e,t,t.selectionManager)});var e=function(e){return h.pasteHandler(e,t)};S(this.textarea,"paste",e),S(this.element,"paste",e),g.isFirefox?S(this.element,"mousedown",function(e){2===e.button&&h.rightClickHandler(e,t.textarea,t.selectionManager,t.options.rightClickSelectsWord)}):S(this.element,"contextmenu",function(e){h.rightClickHandler(e,t.textarea,t.selectionManager,t.options.rightClickSelectsWord)}),g.isLinux&&S(this.element,"auxclick",function(e){1===e.button&&h.moveTextAreaUnderMouseCursor(e,t.textarea)})},e.prototype.bindKeys=function(){var t=this,e=this;S(this.element,"keydown",function(t){k.activeElement===this&&e._keyDown(t)},!0),S(this.element,"keypress",function(t){k.activeElement===this&&e._keyPress(t)},!0),S(this.element,"keyup",function(e){(function(t){return 16===t.keyCode||17===t.keyCode||18===t.keyCode})(e)||t.focus()},!0),S(this.textarea,"keydown",function(e){t._keyDown(e)},!0),S(this.textarea,"keypress",function(e){t._keyPress(e),t.textarea.value=""},!0),S(this.textarea,"compositionstart",function(){return t.compositionHelper.compositionstart()}),S(this.textarea,"compositionupdate",function(e){return t.compositionHelper.compositionupdate(e)}),S(this.textarea,"compositionend",function(){return t.compositionHelper.compositionend()}),this.on("refresh",function(){return t.compositionHelper.updateCompositionElements()}),this.on("refresh",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.body=this.document.body,this.element=this.document.createElement("div"),this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),this.parent.appendChild(this.element);var r=k.createDocumentFragment();this.viewportElement=k.createElement("div"),this.viewportElement.classList.add("xterm-viewport"),r.appendChild(this.viewportElement),this.viewportScrollArea=k.createElement("div"),this.viewportScrollArea.classList.add("xterm-scroll-area"),this.viewportElement.appendChild(this.viewportScrollArea),this.screenElement=k.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.helperContainer=k.createElement("div"),this.helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this.helperContainer),r.appendChild(this.screenElement),this._mouseZoneManager=new w.MouseZoneManager(this),this.on("scroll",function(){return e._mouseZoneManager.clearAll()}),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=k.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.textarea.addEventListener("focus",function(){return e._onTextAreaFocus()}),this.textarea.addEventListener("blur",function(){return e._onTextAreaBlur()}),this.helperContainer.appendChild(this.textarea),this.compositionView=k.createElement("div"),this.compositionView.classList.add("composition-view"),this.compositionHelper=new a.CompositionHelper(this.textarea,this.compositionView,this),this.helperContainer.appendChild(this.compositionView),this.charSizeStyleElement=k.createElement("style"),this.helperContainer.appendChild(this.charSizeStyleElement),this.charMeasure=new y.CharMeasure(k,this.helperContainer),this.syncBellSound(),this.element.appendChild(r),this.renderer=new d.Renderer(this,this.options.theme),this.options.theme=null,this.viewport=new c.Viewport(this,this.viewportElement,this.viewportScrollArea,this.charMeasure),this.viewport.onThemeChanged(this.renderer.colorManager.colors),this.on("cursormove",function(){return e.renderer.onCursorMove()}),this.on("resize",function(){return e.renderer.onResize(e.cols,e.rows,!1)}),this.on("blur",function(){return e.renderer.onBlur()}),this.on("focus",function(){return e.renderer.onFocus()}),this.charMeasure.on("charsizechanged",function(){return e.renderer.onResize(e.cols,e.rows,!0)}),this.renderer.on("resize",function(t){return e.viewport.syncScrollArea()}),this.selectionManager=new _.SelectionManager(this,this.charMeasure),this.element.addEventListener("mousedown",function(t){return e.selectionManager.onMouseDown(t)}),this.selectionManager.on("refresh",function(t){return e.renderer.onSelectionChanged(t.start,t.end)}),this.selectionManager.on("newselection",function(t){e.textarea.value=t,e.textarea.focus(),e.textarea.select()}),this.on("scroll",function(){e.viewport.syncScrollArea(),e.selectionManager.refresh()}),this.viewportElement.addEventListener("scroll",function(){return e.selectionManager.refresh()}),this.mouseHelper=new v.MouseHelper(this.renderer),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this.initGlobal(),this.bindMouse()},e.prototype._setTheme=function(t){var e=this.renderer.setTheme(t);this.viewport&&this.viewport.onThemeChanged(e)},e.applyAddon=function(t){t.apply(e)},e.prototype.bindMouse=function(){var t=this,e=this.element,r=this,i=32;function n(t){var e,n;if(e=function(t){var e,i,n,s,o;switch(t.overrideType||t.type){case"mousedown":e=null!=t.button?+t.button:null!=t.which?t.which-1:null,g.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.wheelDeltaY>0?64:65}i=t.shiftKey?4:0,n=t.metaKey?8:0,s=t.ctrlKey?16:0,o=i|n|s,r.vt200Mouse?o&=s:r.normalMouse||(o=0);return e=32+(o<<2)+e}(t),n=r.mouseHelper.getRawByteCoords(t,r.screenElement,r.charMeasure,r.options.lineHeight,r.cols,r.rows))switch(a(e,n),t.overrideType||t.type){case"mousedown":i=e;break;case"mouseup":i=32}}function s(t){var e=i,n=r.mouseHelper.getRawByteCoords(t,r.screenElement,r.charMeasure,r.options.lineHeight,r.cols,r.rows);n&&a(e+=32,n)}function o(t,e){if(r.utfMouse){if(2047===e)return void t.push(0);e<127?t.push(e):(e>2047&&(e=2047),t.push(192|e>>6),t.push(128|63&e))}else{if(255===e)return void t.push(0);e>127&&(e=127),t.push(e)}}function a(t,e){if(r.vt300Mouse){t&=3,e.x-=32,e.y-=32;var i=u.C0.ESC+"[24";if(0===t)i+="1";else if(1===t)i+="3";else if(2===t)i+="5";else{if(3===t)return;i+="0"}return i+="~["+e.x+","+e.y+"]\r",void r.send(i)}if(r.decLocator)return t&=3,e.x-=32,e.y-=32,0===t?t=2:1===t?t=4:2===t?t=6:3===t&&(t=3),void r.send(u.C0.ESC+"["+t+";"+(3===t?4:0)+";"+e.y+";"+e.x+";"+e.page||"0&w");if(r.urxvtMouse)return e.x-=32,e.y-=32,e.x++,e.y++,void r.send(u.C0.ESC+"["+t+";"+e.x+";"+e.y+"M");if(r.sgrMouse)return e.x-=32,e.y-=32,void r.send(u.C0.ESC+"[<"+((3==(3&t)?-4&t:t)-32)+";"+e.x+";"+e.y+(3==(3&t)?"m":"M"));var n=[];o(n,t),o(n,e.x),o(n,e.y),r.send(u.C0.ESC+"[M"+String.fromCharCode.apply(String,n))}S(e,"mousedown",function(e){if(e.preventDefault(),t.focus(),t.mouseEvents&&!t.selectionManager.shouldForceSelection(e)){if(n(e),t.vt200Mouse)return e.overrideType="mouseup",n(e),t.cancel(e);if(t.normalMouse&&S(t.document,"mousemove",s),!t.x10Mouse){var r=function(e){return n(e),t.normalMouse&&E(t.document,"mousemove",s),E(t.document,"mouseup",r),t.cancel(e)};S(t.document,"mouseup",r)}return t.cancel(e)}}),S(e,"wheel",function(e){t.mouseEvents&&(t.x10Mouse||t.vt300Mouse||t.decLocator||(n(e),e.preventDefault()))}),S(e,"wheel",function(e){if(!t.mouseEvents)return t.viewport.onWheel(e),t.cancel(e)}),S(e,"touchstart",function(e){if(!t.mouseEvents)return t.viewport.onTouchStart(e),t.cancel(e)}),S(e,"touchmove",function(e){if(!t.mouseEvents)return t.viewport.onTouchMove(e),t.cancel(e)})},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.readable=!1,this.writable=!1,this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},e.prototype.refresh=function(t,e){this.renderer&&this.renderer.queueRefresh(t,e)},e.prototype.queueLinkification=function(t,e){this.linkifier&&this.linkifier.linkifyRows(t,e)},e.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))},e.prototype.scroll=function(t){var e=this.blankLine(void 0,t),r=this.buffer.ybase+this.buffer.scrollTop,i=this.buffer.ybase+this.buffer.scrollBottom;if(0===this.buffer.scrollTop){var n=this.buffer.lines.length===this.buffer.lines.maxLength;i===this.buffer.lines.length-1?this.buffer.lines.push(e):this.buffer.lines.splice(i+1,0,e),n?this.userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this.userScrolling||this.buffer.ydisp++)}else{var s=i-r+1;this.buffer.lines.shiftElements(r+1,s-1,-1),this.buffer.lines.set(i,e)}this.userScrolling||(this.buffer.ydisp=this.buffer.ybase),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom),this.emit("scroll",this.buffer.ydisp)},e.prototype.scrollLines=function(t,e){if(t<0){if(0===this.buffer.ydisp)return;this.userScrolling=!0}else t+this.buffer.ydisp>=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.emit("scroll",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.write=function(t){var e=this;this.writeBuffer.push(t),this.options.useFlowControl&&!this.xoffSentToCatchUp&&this.writeBuffer.length>=5&&(this.send(u.C0.DC3),this.xoffSentToCatchUp=!0),!this.writeInProgress&&this.writeBuffer.length>0&&(this.writeInProgress=!0,setTimeout(function(){e.innerWrite()}))},e.prototype.innerWrite=function(){for(var t=this,e=this.writeBuffer.splice(0,300);e.length>0;){var r=e.shift();this.xoffSentToCatchUp&&0===e.length&&0===this.writeBuffer.length&&(this.send(u.C0.DC1),this.xoffSentToCatchUp=!1),this.refreshStart=this.buffer.y,this.refreshEnd=this.buffer.y;var i=this.parser.parse(r);this.parser.setState(i),this.updateRange(this.buffer.y),this.refresh(this.refreshStart,this.refreshEnd)}this.writeBuffer.length>0?setTimeout(function(){return t.innerWrite()},0):this.writeInProgress=!1},e.prototype.writeln=function(t){this.write(t+"\r\n")},e.prototype.attachCustomKeyEventHandler=function(t){this.customKeyEventHandler=t},e.prototype.setHypertextLinkHandler=function(t){if(!this.linkifier)throw new Error("Cannot attach a hypertext link handler before Terminal.open is called");this.linkifier.setHypertextLinkHandler(t),this.refresh(0,this.rows-1)},e.prototype.setHypertextValidationCallback=function(t){if(!this.linkifier)throw new Error("Cannot attach a hypertext validation callback before Terminal.open is called");this.linkifier.setHypertextValidationCallback(t),this.refresh(0,this.rows-1)},e.prototype.registerLinkMatcher=function(t,e,r){if(this.linkifier){var i=this.linkifier.registerLinkMatcher(t,e,r);return this.refresh(0,this.rows-1),i}return 0},e.prototype.deregisterLinkMatcher=function(t){this.linkifier&&this.linkifier.deregisterLinkMatcher(t)&&this.refresh(0,this.rows-1)},e.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},e.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},e.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},e.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},e.prototype._keyDown=function(t){if(this.customKeyEventHandler&&!1===this.customKeyEventHandler(t))return!1;if(!this.compositionHelper.keydown(t))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var e=this._evaluateKeyEscapeSequence(t);return e.key===u.C0.DC3?this.writeStopped=!0:e.key===u.C0.DC1&&(this.writeStopped=!1),e.scrollLines?(this.scrollLines(e.scrollLines),this.cancel(t,!0)):!!this._isThirdLevelShift(this.browser,t)||(e.cancel&&this.cancel(t,!0),!e.key||(this.emit("keydown",t),this.emit("key",e.key,t),this.showCursor(),this.handler(e.key),this.cancel(t,!0)))},e.prototype._isThirdLevelShift=function(t,e){var r=t.isMac&&!this.options.macOptionIsMeta&&e.altKey&&!e.ctrlKey&&!e.metaKey||t.isMSWindows&&e.altKey&&e.ctrlKey&&!e.metaKey;return"keypress"===e.type?r:r&&(!e.keyCode||e.keyCode>47)},e.prototype._evaluateKeyEscapeSequence=function(t){var e={cancel:!1,key:void 0,scrollLines:void 0},r=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:"UIKeyInputUpArrow"===t.key?this.applicationCursor?e.key=u.C0.ESC+"OA":e.key=u.C0.ESC+"[A":"UIKeyInputLeftArrow"===t.key?this.applicationCursor?e.key=u.C0.ESC+"OD":e.key=u.C0.ESC+"[D":"UIKeyInputRightArrow"===t.key?this.applicationCursor?e.key=u.C0.ESC+"OC":e.key=u.C0.ESC+"[C":"UIKeyInputDownArrow"===t.key&&(this.applicationCursor?e.key=u.C0.ESC+"OB":e.key=u.C0.ESC+"[B");break;case 8:if(t.shiftKey){e.key=u.C0.BS;break}if(t.altKey){e.key=u.C0.ESC+u.C0.DEL;break}e.key=u.C0.DEL;break;case 9:if(t.shiftKey){e.key=u.C0.ESC+"[Z";break}e.key=u.C0.HT,e.cancel=!0;break;case 13:e.key=u.C0.CR,e.cancel=!0;break;case 27:e.key=u.C0.ESC,e.cancel=!0;break;case 37:r?(e.key=u.C0.ESC+"[1;"+(r+1)+"D",e.key===u.C0.ESC+"[1;3D"&&(e.key=this.browser.isMac?u.C0.ESC+"b":u.C0.ESC+"[1;5D")):this.applicationCursor?e.key=u.C0.ESC+"OD":e.key=u.C0.ESC+"[D";break;case 39:r?(e.key=u.C0.ESC+"[1;"+(r+1)+"C",e.key===u.C0.ESC+"[1;3C"&&(e.key=this.browser.isMac?u.C0.ESC+"f":u.C0.ESC+"[1;5C")):this.applicationCursor?e.key=u.C0.ESC+"OC":e.key=u.C0.ESC+"[C";break;case 38:r?(e.key=u.C0.ESC+"[1;"+(r+1)+"A",e.key===u.C0.ESC+"[1;3A"&&(e.key=u.C0.ESC+"[1;5A")):this.applicationCursor?e.key=u.C0.ESC+"OA":e.key=u.C0.ESC+"[A";break;case 40:r?(e.key=u.C0.ESC+"[1;"+(r+1)+"B",e.key===u.C0.ESC+"[1;3B"&&(e.key=u.C0.ESC+"[1;5B")):this.applicationCursor?e.key=u.C0.ESC+"OB":e.key=u.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(e.key=u.C0.ESC+"[2~");break;case 46:e.key=r?u.C0.ESC+"[3;"+(r+1)+"~":u.C0.ESC+"[3~";break;case 36:r?e.key=u.C0.ESC+"[1;"+(r+1)+"H":this.applicationCursor?e.key=u.C0.ESC+"OH":e.key=u.C0.ESC+"[H";break;case 35:r?e.key=u.C0.ESC+"[1;"+(r+1)+"F":this.applicationCursor?e.key=u.C0.ESC+"OF":e.key=u.C0.ESC+"[F";break;case 33:t.shiftKey?e.scrollLines=-(this.rows-1):e.key=u.C0.ESC+"[5~";break;case 34:t.shiftKey?e.scrollLines=this.rows-1:e.key=u.C0.ESC+"[6~";break;case 112:e.key=r?u.C0.ESC+"[1;"+(r+1)+"P":u.C0.ESC+"OP";break;case 113:e.key=r?u.C0.ESC+"[1;"+(r+1)+"Q":u.C0.ESC+"OQ";break;case 114:e.key=r?u.C0.ESC+"[1;"+(r+1)+"R":u.C0.ESC+"OR";break;case 115:e.key=r?u.C0.ESC+"[1;"+(r+1)+"S":u.C0.ESC+"OS";break;case 116:e.key=r?u.C0.ESC+"[15;"+(r+1)+"~":u.C0.ESC+"[15~";break;case 117:e.key=r?u.C0.ESC+"[17;"+(r+1)+"~":u.C0.ESC+"[17~";break;case 118:e.key=r?u.C0.ESC+"[18;"+(r+1)+"~":u.C0.ESC+"[18~";break;case 119:e.key=r?u.C0.ESC+"[19;"+(r+1)+"~":u.C0.ESC+"[19~";break;case 120:e.key=r?u.C0.ESC+"[20;"+(r+1)+"~":u.C0.ESC+"[20~";break;case 121:e.key=r?u.C0.ESC+"[21;"+(r+1)+"~":u.C0.ESC+"[21~";break;case 122:e.key=r?u.C0.ESC+"[23;"+(r+1)+"~":u.C0.ESC+"[23~";break;case 123:e.key=r?u.C0.ESC+"[24;"+(r+1)+"~":u.C0.ESC+"[24~";break;default:!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?this.browser.isMac&&!this.options.macOptionIsMeta||!t.altKey||t.ctrlKey||t.metaKey?this.browser.isMac&&!t.altKey&&!t.ctrlKey&&t.metaKey&&65===t.keyCode&&this.selectAll():t.keyCode>=65&&t.keyCode<=90?e.key=u.C0.ESC+String.fromCharCode(t.keyCode+32):192===t.keyCode?e.key=u.C0.ESC+"`":t.keyCode>=48&&t.keyCode<=57&&(e.key=u.C0.ESC+(t.keyCode-48)):t.keyCode>=65&&t.keyCode<=90?e.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?e.key=String.fromCharCode(0):t.keyCode>=51&&t.keyCode<=55?e.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?e.key=String.fromCharCode(127):219===t.keyCode?e.key=String.fromCharCode(27):220===t.keyCode?e.key=String.fromCharCode(28):221===t.keyCode&&(e.key=String.fromCharCode(29))}return e},e.prototype.setgLevel=function(t){this.glevel=t,this.charset=this.charsets[t]},e.prototype.setgCharset=function(t,e){this.charsets[t]=e,this.glevel===t&&(this.charset=e)},e.prototype._keyPress=function(t){var e;if(this.customKeyEventHandler&&!1===this.customKeyEventHandler(t))return!1;if(this.cancel(t),t.charCode)e=t.charCode;else if(null==t.which)e=t.keyCode;else{if(0===t.which||0===t.charCode)return!1;e=t.which}return!(!e||(t.altKey||t.ctrlKey||t.metaKey)&&!this._isThirdLevelShift(this.browser,t))&&(e=String.fromCharCode(e),this.emit("keypress",e,t),this.emit("key",e,t),this.showCursor(),this.handler(e),!0)},e.prototype.send=function(t){var e=this;this.sendDataQueue||setTimeout(function(){e.handler(e.sendDataQueue),e.sendDataQueue=""},1),this.sendDataQueue+=t},e.prototype.bell=function(){var t=this;this.emit("bell"),this.soundBell()&&this.bellAudioElement.play(),this.visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this.visualBellTimer),this.visualBellTimer=window.setTimeout(function(){t.element.classList.remove("visual-bell-active")},200))},e.prototype.log=function(t,e){this.options.debug&&this.context.console&&this.context.console.log&&this.context.console.log(t,e)},e.prototype.error=function(t,e){this.options.debug&&this.context.console&&this.context.console.error&&this.context.console.error(t,e)},e.prototype.resize=function(t,e){isNaN(t)||isNaN(e)||(t!==this.cols||e!==this.rows?(t<1&&(t=1),e<1&&(e=1),this.buffers.resize(t,e),this.cols=t,this.rows=e,this.buffers.setupTabStops(this.cols),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this.emit("resize",{cols:t,rows:e})):this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options))},e.prototype.updateRange=function(t){tthis.refreshEnd&&(this.refreshEnd=t)},e.prototype.maxRange=function(){this.refreshStart=0,this.refreshEnd=this.rows-1},e.prototype.eraseRight=function(t,e){var r=this.buffer.lines.get(this.buffer.ybase+e);if(r){for(var i=[this.eraseAttr()," ",1,32];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.blankLine(!0)),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;this.setup(),this.customKeyEventHandler=t,this.inputHandler=e,this.refresh(0,this.rows-1),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.matchColor=function(t,e,r){return function(t,e,r){var i=t<<16|e<<8|r;if(null!=R[i])return R[i];for(var n,s,o,a,l,c=1/0,h=-1,u=0;u0){this.currentRowHeight=this.terminal.renderer.dimensions.scaledCellHeight/window.devicePixelRatio,this.lastRecordedViewportHeight=this.viewportElement.offsetHeight;var t=Math.round(this.currentRowHeight*this.lastRecordedBufferLength)+(this.lastRecordedViewportHeight-this.terminal.renderer.dimensions.canvasHeight);this.lastRecordedBufferHeight!==t&&(this.lastRecordedBufferHeight=t,this.scrollArea.style.height=this.lastRecordedBufferHeight+"px")}},t.prototype.syncScrollArea=function(){this.lastRecordedBufferLength!==this.terminal.buffer.lines.length?(this.lastRecordedBufferLength=this.terminal.buffer.lines.length,this.refresh()):this.lastRecordedViewportHeight!==this.terminal.renderer.dimensions.canvasHeight?this.refresh():this.terminal.renderer.dimensions.scaledCellHeight/window.devicePixelRatio!==this.currentRowHeight&&this.refresh();var t=this.terminal.buffer.ydisp*this.currentRowHeight;this.viewportElement.scrollTop!==t&&(this.viewportElement.scrollTop=t)},t.prototype.onScroll=function(t){if(this.viewportElement.offsetParent){var e=Math.round(this.viewportElement.scrollTop/this.currentRowHeight)-this.terminal.buffer.ydisp;this.terminal.scrollLines(e,!0)}},t.prototype.onWheel=function(t){if(0!==t.deltaY){var e=1;t.deltaMode===WheelEvent.DOM_DELTA_LINE?e=this.currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e=this.currentRowHeight*this.terminal.rows),this.viewportElement.scrollTop+=t.deltaY*e,t.preventDefault()}},t.prototype.onTouchStart=function(t){this.lastTouchY=t.touches[0].pageY},t.prototype.onTouchMove=function(t){var e=this.lastTouchY-t.touches[0].pageY;this.lastTouchY=t.touches[0].pageY,0!==e&&(this.viewportElement.scrollTop+=e,t.preventDefault())},t}();r.Viewport=n},{}],16:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i,n=t("../EscapeSequences");!function(t){t.Up="A",t.Down="B",t.Right="C",t.Left="D"}(i||(i={}));var s=function(){function t(t,e){var r;this._mouseEvent=t,this._terminal=e,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y,r=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.options.lineHeight,this._terminal.cols,this._terminal.rows,!1).map(function(t){return t-1}),this._endCol=r[0],this._endRow=r[1]}return t.prototype.move=function(){this._mouseEvent.altKey&&this._terminal.send(this._arrowSequences())},t.prototype._arrowSequences=function(){return this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},t.prototype._resetStartingRow=function(){this._endRow,this._wrappedRowsForRow(this._endRow),this._endRow;return 0===this._moveToRequestedRow().length?"":o(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence(i.Left))},t.prototype._moveToRequestedRow=function(){var t=this._startRow-this._wrappedRowsForRow(this._startRow),e=this._endRow-this._wrappedRowsForRow(this._endRow);return o(Math.abs(t-e)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},t.prototype._moveToRequestedCol=function(){var t;t=this._moveToRequestedRow().length>0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;var e=this._endRow,r=this._horizontalDirection();return o(this._bufferLine(this._startCol,t,this._endCol,e,r===i.Right).length,this._sequence(r))},t.prototype._wrappedRowsCount=function(){for(var t=0,e=this._startRow-this._wrappedRowsForRow(this._startRow),r=this._endRow-this._wrappedRowsForRow(this._endRow),n=0;n=0&&t0?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow,this._startCol=this._endCol&&tthis._endRow?i.Up:i.Down},t.prototype._bufferLine=function(t,e,r,i,n){for(var s=t,o=e,a="";s!==r||o!==i;)s+=n?1:-1,n&&s>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(o,!1,t,s),s=0,t=0,o++):!n&&s<0&&(a+=this._terminal.buffer.translateBufferLineToString(o,!1,0,t+1),t=s=this._terminal.cols-1,o--);return a+this._terminal.buffer.translateBufferLineToString(o,!1,t,s)},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="",i=0;it&&i.y<=e+1&&(this._currentZone&&this._currentZone===i&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(r--,1))}0===this._zones.length&&this._deactivate()}},t.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("click",this._clickListener))},t.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("click",this._clickListener))},t.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},t.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,r.hoverCallback&&r.hoverCallback(t),this._tooltipTimeout=setTimeout(function(){return e._onTooltip(t)},500)))},t.prototype._onTooltip=function(t){this._tooltipTimeout=null;var e=this._findZoneEventAt(t);e&&e.tooltipCallback&&e.tooltipCallback(t)},t.prototype._onMouseDown=function(t){if(this._areZonesActive){var e=this._findZoneEventAt(t);e&&e.willLinkActivate(t)&&(t.preventDefault(),t.stopImmediatePropagation())}},t.prototype._onClick=function(t){var e=this._findZoneEventAt(t);e&&(e.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},t.prototype._findZoneEventAt=function(t){var e=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.options.lineHeight,this._terminal.cols,this._terminal.rows);if(!e)return null;for(var r=0;re[0])return i}return null},t}();r.MouseZoneManager=i;var n=function(){return function(t,e,r,i,n,s,o,a){this.x1=t,this.x2=e,this.y=r,this.clickCallback=i,this.hoverCallback=n,this.tooltipCallback=s,this.leaveCallback=o,this.willLinkActivate=a}}();r.MouseZone=n},{}],19:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./CharAtlas"),n=t("../Buffer");r.INVERTED_DEFAULT_COLOR=-1;var s=function(){function t(t,e,r,i,n){this._container=t,this._alpha=i,this._colors=n,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,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._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){},t.prototype.onThemeChanged=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){var r=this;if(!(this._scaledCharWidth<=0&&this._scaledCharHeight<=0)){this._charAtlas=null;var n=i.acquireCharAtlas(t,e,this._scaledCharWidth,this._scaledCharHeight);n instanceof HTMLCanvasElement?this._charAtlas=n:n.then(function(t){return r._charAtlas=t})}},t.prototype.resize=function(t,e,r){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(),r&&this._refreshCharAtlas(t,this._colors)},t.prototype.fillCells=function(t,e,r,i){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,r*this._scaledCellWidth,i*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,i){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,i*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,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},t.prototype.clearCells=function(t,e,r,i){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,e*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background,this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,r*this._scaledCellWidth,i*this._scaledCellHeight))},t.prototype.fillCharTrueColor=function(t,e,r,i){this._ctx.font=this._getFont(t,!1),this._ctx.textBaseline="top",this._clipRow(t,i),this._ctx.fillText(e[n.CHAR_DATA_CHAR_INDEX],r*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop)},t.prototype.drawChar=function(t,e,r,n,s,o,a,l,c,h){var u=0;a<256?u=a+2:c&&t.options.enableBold&&(u=1);var f=r<256,p=u>1&&a<16&&(a<8||c),d=a>=256,m=l>=256;if(this._charAtlas&&f&&(p||d)&&m){var _=this._scaledCharWidth+i.CHAR_ATLAS_CELL_SPACING,y=this._scaledCharHeight+i.CHAR_ATLAS_CELL_SPACING;h&&(this._ctx.globalAlpha=.5),c&&!t.options.enableBold&&u>1&&(u-=8),this._ctx.drawImage(this._charAtlas,r*_,u*y,_,this._scaledCharHeight,s*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop,_,this._scaledCharHeight)}else this._drawUncachedChar(t,e,n,a,s,o,c&&t.options.enableBold,h)},t.prototype._drawUncachedChar=function(t,e,i,n,s,o,a,l){this._ctx.save(),this._ctx.font=this._getFont(t,a),this._ctx.textBaseline="top",n===r.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background:this._ctx.fillStyle=n<256?this._colors.ansi[n]:this._colors.foreground,this._clipRow(t,o),l&&(this._ctx.globalAlpha=.5),this._ctx.fillText(e,s*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop),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){return(e?t.options.fontWeightBold:t.options.fontWeight)+" "+t.options.fontSize*window.devicePixelRatio+"px "+t.options.fontFamily},t}();r.BaseRenderLayer=s},{"../Buffer":1,"./CharAtlas":20}],20:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("../shared/CharAtlasGenerator");r.CHAR_ATLAS_CELL_SPACING=1;var n=[];function s(t,e){for(var r=0;r=0){if(s(h.config,a))return h.bitmap;1===h.ownedBy.length?n.splice(l,1):h.ownedBy.splice(c,1);break}}for(l=0;l=t.rows)this._clearCursor();else{var n=t.buffer.lines.get(r)[t.buffer.x];if(n){if(!t.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor,this._renderBlurCursor(t,t.buffer.x,i,n),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=i,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,void(this._state.width=n[s.CHAR_DATA_WIDTH_INDEX]);if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t.buffer.x&&this._state.y===i&&this._state.isFocused===t.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===n[s.CHAR_DATA_WIDTH_INDEX])return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,t.buffer.x,i,n),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=i,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=n[s.CHAR_DATA_WIDTH_INDEX]}else this._clearCursor()}}}else this._clearCursor()},e.prototype._clearCursor=function(){this._state&&(this.clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:null,y:null,isFocused:null,style:null,width:null})},e.prototype._renderBarCursor=function(t,e,r,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor,this.fillLeftLineAtCell(e,r),this._ctx.restore()},e.prototype._renderBlockCursor=function(t,e,r,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor,this.fillCells(e,r,i[s.CHAR_DATA_WIDTH_INDEX],1),this._ctx.fillStyle=this._colors.cursorAccent,this.fillCharTrueColor(t,i,e,r),this._ctx.restore()},e.prototype._renderUnderlineCursor=function(t,e,r,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor,this.fillBottomLineAtCells(e,r),this._ctx.restore()},e.prototype._renderBlurCursor=function(t,e,r,i){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor,this.strokeRectAtCell(e,r,i[s.CHAR_DATA_WIDTH_INDEX],1),this._ctx.restore()},e}(o.BaseRenderLayer);r.CursorRenderLayer=a;var l=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,t>0)return void e._restartInterval(t)}e.isCursorVisible=!1,e._animationFrame=window.requestAnimationFrame(function(){e.renderCallback(),e._animationFrame=null}),e._blinkInterval=setInterval(function(){if(e._animationTimeRestarted){var t=600-(Date.now()-e._animationTimeRestarted);return e._animationTimeRestarted=null,void e._restartInterval(t)}e.isCursorVisible=!e.isCursorVisible,e._animationFrame=window.requestAnimationFrame(function(){e.renderCallback(),e._animationFrame=null})},600)},t)},t.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},t.prototype.resume=function(t){this._animationTimeRestarted=null,this._restartInterval(),this.restartBlinkAnimation(t)},t}()},{"../Buffer":1,"./BaseRenderLayer":19}],23:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function t(){this.cache=[]}return t.prototype.resize=function(t,e){for(var r=0;r4)t=0,e=this._terminal.rows-1;else{t=this._refreshRowsQueue[0].start,e=this._refreshRowsQueue[0].end;for(var i=1;ie&&(e=this._refreshRowsQueue[i].end)}this._refreshRowsQueue=[],this._refreshAnimationFrame=null,t=Math.max(t,0),e=Math.min(e,this._terminal.rows-1),this._renderLayers.forEach(function(i){return i.onGridChanged(r._terminal,t,e)}),this._terminal.emit("refresh",{start:t,end:e})},e.prototype._updateDimensions=function(){this._terminal.charMeasure.width&&this._terminal.charMeasure.height&&(this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols)},e}(h.EventEmitter);r.Renderer=f},{"../EventEmitter":7,"../utils/ScreenDprMonitor":34,"./ColorManager":21,"./CursorRenderLayer":22,"./LinkRenderLayer":24,"./SelectionRenderLayer":26,"./TextRenderLayer":27}],26:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=function(t){function e(e,r,i){var n=t.call(this,e,"selection",r,!0,i)||this;return n._state={start:null,end:null},n}return n(e,t),e.prototype.resize=function(e,r,i){t.prototype.resize.call(this,e,r,i),this._state={start:null,end:null}},e.prototype.reset=function(t){this._state.start&&this._state.end&&(this._state={start:null,end:null},this.clearAll())},e.prototype.onSelectionChanged=function(t,e,r){if(this._state.start!==e&&this._state.end!==r&&(this.clearAll(),e&&r)){var i=e[1]-t.buffer.ydisp,n=r[1]-t.buffer.ydisp,s=Math.max(i,0),o=Math.min(n,t.rows-1);if(!(s>=t.rows||o<0)){var a=i===s?e[0]:0,l=s===o?r[0]:t.cols;this._ctx.fillStyle=this._colors.selection,this.fillCells(a,s,l-a,1);var c=Math.max(o-s-1,0);if(this.fillCells(0,s+1,t.cols,c),s!==o){var h=n===o?r[0]:t.cols;this.fillCells(0,o,h,1)}this._state.start=[e[0],e[1]],this._state.end=[r[0],r[1]]}}},e}(t("./BaseRenderLayer").BaseRenderLayer);r.SelectionRenderLayer=s},{"./BaseRenderLayer":19}],27:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=t("../Buffer"),o=t("./Types"),a=t("./GridCache"),l=t("./BaseRenderLayer"),c=function(t){function e(e,r,i,n){var s=t.call(this,e,"text",r,n,i)||this;return s._characterOverlapCache={},s._state=new a.GridCache,s}return n(e,t),e.prototype.resize=function(e,r,i){t.prototype.resize.call(this,e,r,i);var n=this._getFont(e,!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.onGridChanged=function(t,e,r){if(0!==this._state.cache.length)for(var i=e;i<=r;i++){var n=i+t.buffer.ydisp,a=t.buffer.lines.get(n);this.clearCells(0,i,t.cols,1);for(var c=0;c0){var m=a[c-1];if(this._isOverlapping(m))continue}var _=p>>18,y=511&p,g=y>=256,v=_&o.FLAGS.INVISIBLE,b=_&o.FLAGS.INVERSE;if(u&&(32!==u||!g||b)&&!v){0!==d&&this._isOverlapping(h)&&c>9&511;if(b){var w=y;y=C,256===(C=w)&&(C=l.INVERTED_DEFAULT_COLOR),257===y&&(y=l.INVERTED_DEFAULT_COLOR)}y<256&&(this._ctx.save(),this._ctx.fillStyle=y===l.INVERTED_DEFAULT_COLOR?this._colors.foreground:this._colors.ansi[y],this.fillCells(c,i,d,1),this._ctx.restore()),this._ctx.save(),_&o.FLAGS.BOLD&&(this._ctx.font=this._getFont(t,!0),C<8&&(C+=8)),_&o.FLAGS.UNDERLINE&&(C===l.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background:this._ctx.fillStyle=C<256?this._colors.ansi[C]:this._colors.foreground,this.fillBottomLineAtCells(c,i)),this.drawChar(t,f,u,d,c,i,C,y,!!(_&o.FLAGS.BOLD),!!(_&o.FLAGS.DIM)),this._ctx.restore()}}}}},e.prototype.onOptionsChanged=function(t){this.setTransparency(t,t.options.allowTransparency)},e.prototype._isOverlapping=function(t){if(1!==t[s.CHAR_DATA_WIDTH_INDEX])return!1;if(t[s.CHAR_DATA_CODE_INDEX]<256)return!1;var e=t[s.CHAR_DATA_CHAR_INDEX];if(this._characterOverlapCache.hasOwnProperty(e))return this._characterOverlapCache[e];this._ctx.save(),this._ctx.font=this._characterFont;var r=Math.floor(this._ctx.measureText(e).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[e]=r,r},e.prototype._clearChar=function(t,e){var r=1,i=this._state.cache[t][e];i&&2===i[s.CHAR_DATA_WIDTH_INDEX]&&(r=2),this.clearCells(t,e,r,1)},e}(l.BaseRenderLayer);r.TextRenderLayer=c},{"../Buffer":1,"./BaseRenderLayer":19,"./GridCache":23,"./Types":28}],28:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(t){t[t.BOLD=1]="BOLD",t[t.UNDERLINE=2]="UNDERLINE",t[t.BLINK=4]="BLINK",t[t.INVERSE=8]="INVERSE",t[t.INVISIBLE=16]="INVISIBLE",t[t.DIM=32]="DIM"}(r.FLAGS||(r.FLAGS={}))},{}],29:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t("./utils/Browser");function n(t,e){return t+" "+e.fontSize*e.devicePixelRatio+"px "+e.fontFamily}r.CHAR_ATLAS_CELL_SPACING=1,r.generateCharAtlas=function(t,e,s){var o=s.scaledCharWidth+r.CHAR_ATLAS_CELL_SPACING,a=s.scaledCharHeight+r.CHAR_ATLAS_CELL_SPACING,l=e(255*o,18*a),c=l.getContext("2d",{alpha:s.allowTransparency});c.fillStyle=s.background,c.fillRect(0,0,l.width,l.height),c.save(),c.fillStyle=s.foreground,c.font=n(s.fontWeight,s),c.textBaseline="top";for(var h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*o,0,o,a),c.clip(),c.fillText(String.fromCharCode(h),h*o,0),c.restore();for(c.save(),c.font=n(s.fontWeightBold,s),h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*o,a,o,a),c.clip(),c.fillText(String.fromCharCode(h),h*o,a),c.restore();c.restore(),c.font=n(s.fontWeight,s);for(var u=0;u<16;u++){8===u&&(c.font=n(s.fontWeightBold,s));var f=(u+2)*a;for(h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*o,f,o,a),c.clip(),c.fillStyle=s.ansiColors[u],c.fillText(String.fromCharCode(h),h*o,f),c.restore()}if(c.restore(),!("createImageBitmap"in t)||i.isFirefox)return l instanceof HTMLCanvasElement?l:new Promise(function(t){return t(l.transferToImageBitmap())});var p=c.getImageData(0,0,l.width,l.height);return function(t,e,r,i){for(var n=0;n=0}r.isFirefox=!!~n.indexOf("Firefox"),r.isMSIE=!!~n.indexOf("MSIE")||!!~n.indexOf("Trident"),r.isMac=o(["Macintosh","MacIntel","MacPPC","Mac68K"],s),r.isIpad="iPad"===s,r.isIphone="iPhone"===s,r.isMSWindows=o(["Windows","Win16","Win32","WinCE"],s),r.isLinux=s.indexOf("Linux")>=0},{}],31:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=function(t){function e(e,r){var i=t.call(this)||this;return i._document=e,i._parentElement=r,i._measureElement=i._document.createElement("span"),i._measureElement.style.position="absolute",i._measureElement.style.top="0",i._measureElement.style.left="-9999em",i._measureElement.style.lineHeight="normal",i._measureElement.textContent="W",i._measureElement.setAttribute("aria-hidden","true"),i._parentElement.appendChild(i._measureElement),i}return n(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.measure=function(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&&(this._width===e.width&&this._height===e.height||(this._width=e.width,this._height=Math.ceil(e.height),this.emit("charsizechanged")))},e}(t("../EventEmitter").EventEmitter);r.CharMeasure=s},{"../EventEmitter":7}],32:[function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=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])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(r,"__esModule",{value:!0});var s=function(t){function e(e){var r=t.call(this)||this;return r._maxLength=e,r._array=new Array(r._maxLength),r._startIndex=0,r._length=0,r}return n(e,t),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(t){if(this._maxLength!==t){for(var e=new Array(t),r=0;rthis._length)for(var e=this._length;e=t;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(n=0;nthis.maxLength){var s=this._length+r.length-this.maxLength;this._startIndex+=s,this._length=this.maxLength,this.emit("trim",s)}else this._length+=r.length}},e.prototype.trimStart=function(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.emit("trim",t)},e.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(r>0){for(var i=e-1;i>=0;i--)this.set(t+i+r,this.get(t+i));var n=t+e+r-this._length;if(n>0)for(this._length+=n;this._length>this.maxLength;)this._length--,this._startIndex++,this.emit("trim",1)}else for(i=0;i1&&void 0!==arguments[1]?arguments[1]:{}).asNewDefault,r=void 0!==e&&e,i=Object.keys(B),n=r?function(t){return~i.indexOf(t)&&!~M.indexOf(t)}:function(t){return~i.indexOf(t)};Object.keys(t).forEach(function(e){n(e)&&(B[e]=t[e])})}c.FontAwesomeConfig=B;var D=c||{};D.___FONT_AWESOME___||(D.___FONT_AWESOME___={}),D.___FONT_AWESOME___.styles||(D.___FONT_AWESOME___.styles={}),D.___FONT_AWESOME___.hooks||(D.___FONT_AWESOME___.hooks={}),D.___FONT_AWESOME___.shims||(D.___FONT_AWESOME___.shims=[]);var H=D.___FONT_AWESOME___,P=[],I=!1;d&&((I=(h.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(h.readyState))||h.addEventListener("DOMContentLoaded",function t(){h.removeEventListener("DOMContentLoaded",t),I=1,P.map(function(t){return t()})}));var N=function(t){d&&(I?setTimeout(t,0):P.push(t))},F=_,j={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function W(t){if(t&&d){var e=h.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t;for(var r=h.head.childNodes,i=null,n=r.length-1;n>-1;n--){var s=r[n],o=(s.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(i=s)}return h.head.insertBefore(e,i),t}}var z=0;function U(){return++z}function q(t){for(var e=[],r=(t||[]).length>>>0;r--;)e[r]=t[r];return e}function X(t){return t.classList?q(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(t){return t})}function V(t,e){var r,i=e.split("-"),n=i[0],s=i.slice(1).join("-");return n!==t||""===s||(r=s,~A.indexOf(r))?null:s}function K(t){return(""+t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function G(t){return Object.keys(t||{}).reduce(function(e,r){return e+(r+": ")+t[r]+";"},"")}function Z(t){return t.size!==j.size||t.x!==j.x||t.y!==j.y||t.rotate!==j.rotate||t.flipX||t.flipY}function Y(t){var e=t.transform,r=t.containerWidth,i=t.iconWidth;return{outer:{transform:"translate("+r/2+" 256)"},inner:{transform:"translate("+32*e.x+", "+32*e.y+") "+" "+("scale("+e.size/16*(e.flipX?-1:1)+", "+e.size/16*(e.flipY?-1:1)+") ")+" "+("rotate("+e.rotate+" 0 0)")},path:{transform:"translate("+i/2*-1+" -256)"}}}var Q={x:0,y:0,width:"100%",height:"100%"},J=function(t){var e=t.children,r=t.attributes,i=t.main,n=t.mask,s=t.transform,o=i.width,a=i.icon,l=n.width,c=n.icon,h=Y({transform:s,containerWidth:l,iconWidth:o}),u={tag:"rect",attributes:E({},Q,{fill:"white"})},f={tag:"g",attributes:E({},h.inner),children:[{tag:"path",attributes:E({},a.attributes,h.path,{fill:"black"})}]},p={tag:"g",attributes:E({},h.outer),children:[f]},d="mask-"+U(),m="clip-"+U(),_={tag:"defs",children:[{tag:"clipPath",attributes:{id:m},children:[c]},{tag:"mask",attributes:E({},Q,{id:d,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[u,p]}]};return e.push(_,{tag:"rect",attributes:E({fill:"currentColor","clip-path":"url(#"+m+")",mask:"url(#"+d+")"},Q)}),{children:e,attributes:r}},$=function(t){var e=t.children,r=t.attributes,i=t.main,n=t.transform,s=G(t.styles);if(s.length>0&&(r.style=s),Z(n)){var o=Y({transform:n,containerWidth:i.width,iconWidth:i.width});e.push({tag:"g",attributes:E({},o.outer),children:[{tag:"g",attributes:E({},o.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:E({},i.icon.attributes,o.path)}]}]})}else e.push(i.icon);return{children:e,attributes:r}},tt=function(t){var e=t.children,r=t.main,i=t.mask,n=t.attributes,s=t.styles,o=t.transform;if(Z(o)&&r.found&&!i.found){var a={x:r.width/r.height/2,y:.5};n.style=G(E({},s,{"transform-origin":a.x+o.x/16+"em "+(a.y+o.y/16)+"em"}))}return[{tag:"svg",attributes:n,children:e}]},et=function(t){var e=t.prefix,r=t.iconName,i=t.children,n=t.attributes,s=t.symbol,o=!0===s?e+"-"+B.familyPrefix+"-"+r:s;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:E({},n,{id:o}),children:i}]}]};function rt(t){var e=t.icons,r=e.main,i=e.mask,n=t.prefix,s=t.iconName,o=t.transform,a=t.symbol,l=t.title,c=t.extra,h=t.watchable,u=void 0!==h&&h,f=i.found?i:r,p=f.width,d=f.height,m="fa-w-"+Math.ceil(p/d*16),_=[B.replacementClass,s?B.familyPrefix+"-"+s:"",m].concat(c.classes).join(" "),g={children:[],attributes:E({},c.attributes,{"data-prefix":n,"data-icon":s,class:_,role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 "+p+" "+d})};u&&(g.attributes[y]=""),l&&g.children.push({tag:"title",attributes:{id:g.attributes["aria-labelledby"]||"title-"+U()},children:[l]});var v=E({},g,{prefix:n,iconName:s,main:r,mask:i,transform:o,symbol:a,styles:c.styles}),b=i.found&&r.found?J(v):$(v),C=b.children,w=b.attributes;return v.children=C,v.attributes=w,a?et(v):tt(v)}function it(t){var e=t.content,r=t.width,i=t.height,n=t.transform,s=t.title,o=t.extra,a=t.watchable,l=void 0!==a&&a,c=E({},o.attributes,s?{title:s}:{},{class:o.classes.join(" ")});l&&(c[y]="");var h=E({},o.styles);Z(n)&&(h.transform=function(t){var e=t.transform,r=t.width,i=void 0===r?_:r,n=t.height,s=void 0===n?_:n,o=t.startCentered,a=void 0!==o&&o,l="";return l+=a&&m?"translate("+(e.x/F-i/2)+"em, "+(e.y/F-s/2)+"em) ":a?"translate(calc(-50% + "+e.x/F+"em), calc(-50% + "+e.y/F+"em)) ":"translate("+e.x/F+"em, "+e.y/F+"em) ",l+="scale("+e.size/F*(e.flipX?-1:1)+", "+e.size/F*(e.flipY?-1:1)+") ",l+="rotate("+e.rotate+"deg) "}({transform:n,startCentered:!0,width:r,height:i}),h["-webkit-transform"]=h.transform);var u=G(h);u.length>0&&(c.style=u);var f=[];return f.push({tag:"span",attributes:c,children:[e]}),s&&f.push({tag:"span",attributes:{class:"sr-only"},children:[s]}),f}var nt=function(){},st=B.measurePerformance&&f&&f.mark&&f.measure?f:{mark:nt,measure:nt},ot=function(t){st.mark('FA "5.0.5" '+t+" ends"),st.measure('FA "5.0.5" '+t,'FA "5.0.5" '+t+" begins",'FA "5.0.5" '+t+" ends")},at={begin:function(t){return st.mark('FA "5.0.5" '+t+" begins"),function(){return ot(t)}},end:ot},lt=function(t,e,r,i){var n,s,o,a=Object.keys(t),l=a.length,c=void 0!==i?function(t,e){return function(r,i,n,s){return t.call(e,r,i,n,s)}}(e,i):e;for(void 0===r?(n=1,o=t[a[0]]):(n=0,o=r);n"+s.map(vt).join("")+""}var bt=function(){};function Ct(t){return"string"==typeof(t.getAttribute?t.getAttribute(y):null)}var wt={replace:function(t){var e=t[0],r=t[1].map(function(t){return vt(t)}).join("\n");if(e.parentNode&&e.outerHTML)e.outerHTML=r+(B.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- "+e.outerHTML+" --\x3e":"");else if(e.parentNode){var i=document.createElement("span");e.parentNode.replaceChild(i,e),i.outerHTML=r}},nest:function(t){var e=t[0],r=t[1];if(~X(e).indexOf(B.replacementClass))return wt.replace(t);var i=new RegExp(B.familyPrefix+"-.*");delete r[0].attributes.style;var n=r[0].attributes.class.split(" ").reduce(function(t,e){return e===B.replacementClass||e.match(i)?t.toSvg.push(e):t.toNode.push(e),t},{toNode:[],toSvg:[]});r[0].attributes.class=n.toSvg.join(" ");var s=r.map(function(t){return vt(t)}).join("\n");e.setAttribute("class",n.toNode.join(" ")),e.setAttribute(y,""),e.innerHTML=s}};function kt(t,e){var r="function"==typeof e?e:bt;0===t.length?r():(c.requestAnimationFrame||function(t){return t()})(function(){var e=!0===B.autoReplaceSvg?wt.replace:wt[B.autoReplaceSvg]||wt.replace,i=at.begin("mutate");t.map(e),i(),r()})}var At=!1;var xt=function(t){var e=t.getAttribute("style"),r=[];return e&&(r=e.split(";").reduce(function(t,e){var r=e.split(":"),i=r[0],n=r.slice(1);return i&&n.length>0&&(t[i]=n.join(":").trim()),t},{})),r};var St=function(t){var e,r,i=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),s=void 0!==t.innerText?t.innerText.trim():"",o=yt(X(t));return i&&n&&(o.prefix=i,o.iconName=n),o.prefix&&s.length>1?o.iconName=(e=o.prefix,r=t.innerText,ft[e][r]):o.prefix&&1===s.length&&(o.iconName=function(t,e){return ut[t][e]}(o.prefix,function(t){for(var e="",r=0;r-1&&qt(n.nextSibling),qt(n),n=null),i&&!n){var s=r.getPropertyValue("content"),o=h.createElement("i");o.setAttribute("class",""+Wt[i[1]]),o.setAttribute(g,e),o.innerText=3===s.length?s.substr(1,1):s,":before"===e?t.insertBefore(o,t.firstChild):t.appendChild(o)}})})}(),At=!1,e()}}function Vt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(d){var r=h.documentElement.classList,i=function(t){return r.add(v+"-"+t)},n=function(t){return r.remove(v+"-"+t)},s=Object.keys(Nt),o=["."+Ft+":not(["+y+"])"].concat(s.map(function(t){return"."+t+":not(["+y+"])"})).join(", ");if(0!==o.length){var a=q(t.querySelectorAll(o));if(a.length>0){i("pending"),n("complete");var l=at.begin("onTree"),c=a.reduce(function(t,e){try{var r=Ut(e);r&&t.push(r)}catch(t){b||t instanceof Bt&&console.error(t)}return t},[]);l(),kt(c,function(){i("active"),i("complete"),n("pending"),"function"==typeof e&&e()})}}}}function Kt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=Ut(t);r&&kt([r],e)}var Gt=function(){var t="svg-inline--fa",e=B.familyPrefix,r=B.replacementClass,i='svg:not(:root).svg-inline--fa {\n overflow: visible; }\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -.125em; }\n .svg-inline--fa.fa-lg {\n vertical-align: -.225em; }\n .svg-inline--fa.fa-w-1 {\n width: 0.0625em; }\n .svg-inline--fa.fa-w-2 {\n width: 0.125em; }\n .svg-inline--fa.fa-w-3 {\n width: 0.1875em; }\n .svg-inline--fa.fa-w-4 {\n width: 0.25em; }\n .svg-inline--fa.fa-w-5 {\n width: 0.3125em; }\n .svg-inline--fa.fa-w-6 {\n width: 0.375em; }\n .svg-inline--fa.fa-w-7 {\n width: 0.4375em; }\n .svg-inline--fa.fa-w-8 {\n width: 0.5em; }\n .svg-inline--fa.fa-w-9 {\n width: 0.5625em; }\n .svg-inline--fa.fa-w-10 {\n width: 0.625em; }\n .svg-inline--fa.fa-w-11 {\n width: 0.6875em; }\n .svg-inline--fa.fa-w-12 {\n width: 0.75em; }\n .svg-inline--fa.fa-w-13 {\n width: 0.8125em; }\n .svg-inline--fa.fa-w-14 {\n width: 0.875em; }\n .svg-inline--fa.fa-w-15 {\n width: 0.9375em; }\n .svg-inline--fa.fa-w-16 {\n width: 1em; }\n .svg-inline--fa.fa-w-17 {\n width: 1.0625em; }\n .svg-inline--fa.fa-w-18 {\n width: 1.125em; }\n .svg-inline--fa.fa-w-19 {\n width: 1.1875em; }\n .svg-inline--fa.fa-w-20 {\n width: 1.25em; }\n .svg-inline--fa.fa-pull-left {\n margin-right: .3em;\n width: auto; }\n .svg-inline--fa.fa-pull-right {\n margin-left: .3em;\n width: auto; }\n .svg-inline--fa.fa-border {\n height: 1.5em; }\n .svg-inline--fa.fa-li {\n width: 2em; }\n .svg-inline--fa.fa-fw {\n width: 1.25em; }\n\n.fa-layers svg.svg-inline--fa {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0; }\n\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -.125em;\n width: 1em; }\n .fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center; }\n\n.fa-layers-text, .fa-layers-counter {\n display: inline-block;\n position: absolute;\n text-align: center; }\n\n.fa-layers-text {\n left: 50%;\n top: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n -webkit-transform-origin: center center;\n transform-origin: center center; }\n\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n color: #fff;\n height: 1.5em;\n line-height: 1;\n max-width: 5em;\n min-width: 1.5em;\n overflow: hidden;\n padding: .25em;\n right: 0;\n text-overflow: ellipsis;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right; }\n\n.fa-layers-bottom-right {\n bottom: 0;\n right: 0;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom right;\n transform-origin: bottom right; }\n\n.fa-layers-bottom-left {\n bottom: 0;\n left: 0;\n right: auto;\n top: auto;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: bottom left;\n transform-origin: bottom left; }\n\n.fa-layers-top-right {\n right: 0;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top right;\n transform-origin: top right; }\n\n.fa-layers-top-left {\n left: 0;\n right: auto;\n top: 0;\n -webkit-transform: scale(0.25);\n transform: scale(0.25);\n -webkit-transform-origin: top left;\n transform-origin: top left; }\n\n.fa-lg {\n font-size: 1.33333em;\n line-height: 0.75em;\n vertical-align: -.0667em; }\n\n.fa-xs {\n font-size: .75em; }\n\n.fa-sm {\n font-size: .875em; }\n\n.fa-1x {\n font-size: 1em; }\n\n.fa-2x {\n font-size: 2em; }\n\n.fa-3x {\n font-size: 3em; }\n\n.fa-4x {\n font-size: 4em; }\n\n.fa-5x {\n font-size: 5em; }\n\n.fa-6x {\n font-size: 6em; }\n\n.fa-7x {\n font-size: 7em; }\n\n.fa-8x {\n font-size: 8em; }\n\n.fa-9x {\n font-size: 9em; }\n\n.fa-10x {\n font-size: 10em; }\n\n.fa-fw {\n text-align: center;\n width: 1.25em; }\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0; }\n .fa-ul > li {\n position: relative; }\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit; }\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: .1em;\n padding: .2em .25em .15em; }\n\n.fa-pull-left {\n float: left; }\n\n.fa-pull-right {\n float: right; }\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: .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: .3em; }\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear; }\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8); }\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\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.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg); }\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.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.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.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: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 -webkit-filter: none;\n filter: none; }\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2em; }\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.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1em; }\n\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2em; }\n\n.fa-inverse {\n color: #fff; }\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.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';if("fa"!==e||r!==t){var n=new RegExp("\\.fa\\-","g"),s=new RegExp("\\."+t,"g");i=i.replace(n,"."+e+"-").replace(s,"."+r)}return i};var Zt=function(){function t(){x(this,t),this.definitions={}}return S(t,[{key:"add",value:function(){for(var t=this,e=arguments.length,r=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{},r=e.transform,i=void 0===r?j:r,n=e.symbol,s=void 0!==n&&n,o=e.mask,a=void 0===o?null:o,l=e.title,c=void 0===l?null:l,h=e.classes,u=void 0===h?[]:h,f=e.attributes,p=void 0===f?{}:f,d=e.styles,m=void 0===d?{}:d;if(t){var _=t.prefix,y=t.iconName,g=t.icon;return $t(E({type:"icon"},t),function(){return Jt(),B.autoA11y&&(c?p["aria-labelledby"]=B.replacementClass+"-title-"+U():p["aria-hidden"]="true"),rt({icons:{main:Yt(g),mask:a?Yt(a.icon):{found:!1,width:null,height:null,icon:{}}},prefix:_,iconName:y,transform:E({},j,i),symbol:s,title:c,extra:{attributes:p,styles:m,classes:u}})})}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(t||{}).icon?t:te(t||{}),i=e.mask;return i&&(i=(i||{}).icon?i:te(i||{})),ee(r,E({},e,{mask:i}))}),ne={noAuto:function(){var t;O({autoReplaceSvg:t=!1,observeMutations:t})},dom:{i2svg:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(d){Jt();var e=t.node,r=void 0===e?h:e,i=t.callback,n=void 0===i?function(){}:i;B.searchPseudoElements&&Xt(r),Vt(r,n)}},css:Gt,insertCss:function(){W(Gt())}},library:re,parse:{transform:function(t){return Et(t)}},findIconDefinition:te,icon:ie,text:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.transform,i=void 0===r?j:r,n=e.title,s=void 0===n?null:n,o=e.classes,a=void 0===o?[]:o,l=e.attributes,c=void 0===l?{}:l,h=e.styles,u=void 0===h?{}:h;return $t({type:"text",content:t},function(){return Jt(),it({content:t,transform:E({},j,i),title:s,extra:{attributes:c,styles:u,classes:[B.familyPrefix+"-layers-text"].concat(L(a))}})})},layer:function(t){return $t({type:"layer"},function(){Jt();var e=[];return t(function(t){e=Array.isArray(t)?t.map(function(t){e=e.concat(t.abstract)}):e.concat(t.abstract)}),[{tag:"span",attributes:{class:B.familyPrefix+"-layers"},children:e}]})}},se=function(){d&&B.autoReplaceSvg&&ne.dom.i2svg({node:h})};Object.defineProperty(ne,"config",{get:function(){return B},set:function(t){O(t)}}),d&&function(t){try{t()}catch(t){if(!b)throw t}}(function(){p&&(c.FontAwesome||(c.FontAwesome=ne),N(function(){Object.keys(H.styles).length>0&&se(),B.observeMutations&&"function"==typeof MutationObserver&&function(t){if(u){var e=t.treeCallback,r=t.nodeCallback,i=t.pseudoElementsCallback,n=new u(function(t){At||q(t).forEach(function(t){if("childList"===t.type&&t.addedNodes.length>0&&!Ct(t.addedNodes[0])&&(B.searchPseudoElements&&i(t.target),e(t.target)),"attributes"===t.type&&t.target.parentNode&&B.searchPseudoElements&&i(t.target.parentNode),"attributes"===t.type&&Ct(t.target)&&~k.indexOf(t.attributeName))if("class"===t.attributeName){var n=yt(X(t.target)),s=n.prefix,o=n.iconName;s&&t.target.setAttribute("data-prefix",s),o&&t.target.setAttribute("data-icon",o)}else r(t.target)})});d&&n.observe(h.getElementsByTagName("body")[0],{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}({treeCallback:Vt,nodeCallback:Kt,pseudoElementsCallback:Xt})})),H.hooks=E({},H.hooks,{addPack:function(t,e){H.styles[t]=E({},H.styles[t]||{},e),dt(),se()},addShims:function(t){var e;(e=H.shims).push.apply(e,L(t)),dt(),se()}})});ne.config;e.a=ne}).call(e,r(4))},function(t,e){t.exports={prefix:"fas",iconName:"bars",icon:[448,512,[],"f0c9","M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"]}},function(t,e){t.exports={prefix:"fas",iconName:"clipboard",icon:[384,512,[],"f328","M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z"]}},function(t,e){t.exports={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"]}},function(t,e){t.exports={prefix:"fas",iconName:"key",icon:[512,512,[],"f084","M512 176.001C512 273.203 433.202 352 336 352c-11.22 0-22.19-1.062-32.827-3.069l-24.012 27.014A23.999 23.999 0 0 1 261.223 384H224v40c0 13.255-10.745 24-24 24h-40v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-78.059c0-6.365 2.529-12.47 7.029-16.971l161.802-161.802C163.108 213.814 160 195.271 160 176 160 78.798 238.797.001 335.999 0 433.488-.001 512 78.511 512 176.001zM336 128c0 26.51 21.49 48 48 48s48-21.49 48-48-21.49-48-48-48-48 21.49-48 48z"]}},function(t,e){t.exports={prefix:"fas",iconName:"cog",icon:[512,512,[],"f013","M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"]}},function(t,e){},function(t,e){}]);