webssh2/app/client/public/webssh2.bundle.js
2021-05-12 13:59:43 -04:00

1 line
No EOL
358 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=56)}([function(t,e,n){var r,i=n(42),o=n(21),s=n(43),a=n(44),l=n(45);"undefined"!=typeof ArrayBuffer&&(r=n(46));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),h="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),u=c||h;e.protocol=3;var f=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},p=i(f),d={type:"error",data:"parser error"},_=n(47);function m(t,e,n){for(var r=new Array(t.length),i=a(t.length,n),o=0;o<t.length;o++)!function(t,n,i){e(n,(function(e,n){r[t]=n,i(e,r)}))}(o,t[o],i)}e.encodePacket=function(t,n,r,i){"function"==typeof n&&(i=n,n=!1),"function"==typeof r&&(i=r,r=null);var o=void 0===t.data?void 0:t.data.buffer||t.data;return"undefined"!=typeof ArrayBuffer&&o instanceof ArrayBuffer?function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);n=t.data;var i=new Uint8Array(n),o=new Uint8Array(1+n.byteLength);o[0]=f[t.type];for(var s=0;s<i.length;s++)o[s+1]=i[s];return r(o.buffer)}(t,n,i):void 0!==_&&o instanceof _?function(t,n,r){return n?u?function(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var i=new FileReader;return i.onload=function(){e.encodePacket({type:t.type,data:i.result},n,!0,r)},i.readAsArrayBuffer(t.data)}(t,n,r):((n=new Uint8Array(1))[0]=f[t.type],r(t=new _([n.buffer,t.data]))):e.encodeBase64Packet(t,r)}(t,n,i):o&&o.base64?function(t,n){return n(t="b"+e.packets[t.type]+t.data.data)}(t,i):(o=f[t.type],void 0!==t.data&&(o+=r?l.encode(String(t.data),{strict:!1}):String(t.data)),i(""+o))},e.encodeBase64Packet=function(t,n){var r,i="b"+e.packets[t.type];if(void 0!==_&&t.data instanceof _){var o=new FileReader;return o.onload=function(){var t=o.result.split(",")[1];n(i+t)},o.readAsDataURL(t.data)}try{r=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch(e){for(var s=new Uint8Array(t.data),a=new Array(s.length),l=0;l<s.length;l++)a[l]=s[l];r=String.fromCharCode.apply(null,a)}return i+=btoa(r),n(i)},e.decodePacket=function(t,n,r){if(void 0===t)return d;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&!1===(t=function(t){try{t=l.decode(t,{strict:!1})}catch(t){return!1}return t}(t)))return d;var i=t.charAt(0);return Number(i)==i&&p[i]?1<t.length?{type:p[i],data:t.substring(1)}:{type:p[i]}:d}return i=new Uint8Array(t)[0],t=s(t,1),_&&"blob"===n&&(t=new _([t])),{type:p[i],data:t}},e.decodeBase64Packet=function(t,e){var n=p[t.charAt(0)];return r?(t=r.decode(t.substr(1)),{type:n,data:t="blob"===e&&_?new _([t]):t}):{type:n,data:{base64:!0,data:t.substr(1)}}},e.encodePayload=function(t,n,r){"function"==typeof n&&(r=n,n=null);var i=o(t);return n&&i?_&&!u?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r):t.length?void m(t,(function(t,r){e.encodePacket(t,!!i&&n,!1,(function(t){r(null,t.length+":"+t)}))}),(function(t,e){return r(e.join(""))})):r("0:")},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);if("function"==typeof n&&(r=n,n=null),""===t)return r(d,0,1);for(var i,o,s="",a=0,l=t.length;a<l;a++){var c=t.charAt(a);if(":"===c){if(""===s||s!=(i=Number(s)))return r(d,0,1);if(s!=(o=t.substr(a+1,i)).length)return r(d,0,1);if(o.length){if(o=e.decodePacket(o,n,!1),d.type===o.type&&d.data===o.data)return r(d,0,1);if(!1===r(o,a+i,l))return}a+=i,s=""}else s+=c}return""!==s?r(d,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));m(t,(function(t,n){e.encodePacket(t,!0,!0,(function(t){return n(null,t)}))}),(function(t,e){var r=e.reduce((function(t,e){return t+(e="string"==typeof e?e.length:e.byteLength).toString().length+e+2}),0),i=new Uint8Array(r),o=0;return e.forEach((function(t){var e="string"==typeof t,n=t;if(e){for(var r=new Uint8Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);n=r.buffer}i[o++]=e?0:1;var a=n.byteLength.toString();for(s=0;s<a.length;s++)i[o++]=parseInt(a[s]);for(i[o++]=255,r=new Uint8Array(n),s=0;s<r.length;s++)i[o++]=r[s]})),n(i.buffer)}))},e.encodePayloadAsBlob=function(t,n){m(t,(function(t,n){e.encodePacket(t,!0,!0,(function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var r=new Uint8Array(t.length),i=0;i<t.length;i++)r[i]=t.charCodeAt(i);t=r.buffer,e[0]=0}var o=(t instanceof ArrayBuffer?t.byteLength:t.size).toString(),s=new Uint8Array(o.length+1);for(i=0;i<o.length;i++)s[i]=parseInt(o[i]);s[o.length]=255,_&&(e=new _([e.buffer,s.buffer,t]),n(null,e))}))}),(function(t,e){return n(new _(e))}))},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var i=t,o=[];0<i.byteLength;){for(var a=new Uint8Array(i),l=0===a[0],c="",h=1;255!==a[h];h++){if(310<c.length)return r(d,0,1);c+=a[h]}i=s(i,2+c.length),c=parseInt(c);var u=s(i,0,c);if(l)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(t){var f=new Uint8Array(u);for(u="",h=0;h<f.length;h++)u+=String.fromCharCode(f[h])}o.push(u),i=s(i,c)}var p=o.length;o.forEach((function(t,i){r(e.decodePacket(t,n,!0),i,p)}))}},function(t,e){var n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}(t.exports=r).prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n)for(var r=0,i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e);return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){(function(r){function i(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r?r.env.DEBUG:t}(e=t.exports=n(30)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n,r,i=this.useColors;t[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+t[0]+(i?"%c ":" ")+"+"+e.humanize(this.diff),i&&(i="color: "+this.color,t.splice(1,0,i,"color: inherit"),t[r=n=0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(r=n))})),t.splice(r,0,i))},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=i,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"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=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(i())}).call(this,n(4))},function(t,e){var n,r;t=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,l=[],c=!1,h=-1;function u(){c&&a&&(c=!1,a.length?l=a.concat(l):h=-1,l.length&&f())}function f(){if(!c){var t=s(u);c=!0;for(var e=l.length;e;){for(a=l,l=[];++h<e;)a&&a[h].run();h=-1,e=l.length}a=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}t.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new p(t,e)),1!==l.length||c||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=d,t.addListener=d,t.once=d,t.off=d,t.removeListener=d,t.removeAllListeners=d,t.emit=d,t.prependListener=d,t.prependOnceListener=d,t.listeners=function(t){return[]},t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(t,e){e.encode=function(t){var e,n="";for(e in t)t.hasOwnProperty(e)&&(n.length&&(n+="&"),n+=encodeURIComponent(e)+"="+encodeURIComponent(t[e]));return n},e.decode=function(t){for(var e={},n=t.split("&"),r=0,i=n.length;r<i;r++){var o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}},function(t,e){t.exports=function(t,e){function n(){}n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){(function(r){function i(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r?r.env.DEBUG:t}(e=t.exports=n(48)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n,r,i=this.useColors;t[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+t[0]+(i?"%c ":" ")+"+"+e.humanize(this.diff),i&&(i="color: "+this.color,t.splice(1,0,i,"color: inherit"),t[r=n=0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(r=n))})),t.splice(r,0,i))},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=i,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"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=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(i())}).call(this,n(4))},function(t,e){var n=36e5,r=864e5;function i(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}t.exports=function(t,e){e=e||{};var o=typeof t;if("string"==o&&0<t.length)return function(t){if(!(100<(t=String(t)).length)&&(t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t))){var e=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*e;case"days":case"day":case"d":return e*r;case"hours":case"hour":case"hrs":case"hr":case"h":return e*n;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*e;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}(t);if("number"==o&&!1===isNaN(t))return e.long?i(e=t,r,"day")||i(e,n,"hour")||i(e,6e4,"minute")||i(e,1e3,"second")||e+" ms":function(t){return r<=t?Math.round(t/r)+"d":n<=t?Math.round(t/n)+"h":6e4<=t?Math.round(t/6e4)+"m":1e3<=t?Math.round(t/1e3)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){var r=n(31)("socket.io-parser"),i=n(33),o=n(34),s=n(10),a=n(17);function l(){}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=u;var c=e.ERROR+'"encode error"';function h(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var i=function(t){try{return JSON.stringify(t)}catch(t){return!1}}(t.data);if(!1===i)return c;n+=i}return r("encoded %j as %s",t,n),n}function u(){this.reconstructor=null}function f(t){this.reconPack=t,this.buffers=[]}function p(t){return{type:e.ERROR,data:"parser error: "+t}}l.prototype.encode=function(t,n){var i;r("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type?(i=n,o.removeBlobs(t,(function(t){var e=o.deconstructPacket(t);t=h(e.packet);(e=e.buffers).unshift(t),i(e)}))):n([h(t)])},i(u.prototype),u.prototype.add=function(t){var n;if("string"==typeof t)n=function(t){var n=0,i={type:Number(t.charAt(0))};if(null==e.types[i.type])return p("unknown packet type "+i.type);if(e.BINARY_EVENT===i.type||e.BINARY_ACK===i.type){for(var o=n+1;"-"!==t.charAt(++n)&&n!=t.length;);var a=t.substring(o,n);if(a!=Number(a)||"-"!==t.charAt(n))throw new Error("Illegal attachments");i.attachments=Number(a)}if("/"===t.charAt(n+1)){for(o=n+1;++n&&","!==(l=t.charAt(n))&&n!==t.length;);i.nsp=t.substring(o,n)}else i.nsp="/";if(""!==(a=t.charAt(n+1))&&Number(a)==a){var l;for(o=n+1;++n;){if(null==(l=t.charAt(n))||Number(l)!=l){--n;break}if(n===t.length)break}i.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){if(!1===(o=function(t){try{return JSON.parse(t)}catch(t){return!1}}(t.substr(n)))||i.type!==e.ERROR&&!s(o))return p("invalid payload");i.data=o}return r("decoded %s as %j",t,i),i}(t),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?(this.reconstructor=new f(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);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");(n=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,this.emit("decoded",n))}},u.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},f.prototype.takeBinaryData=function(t){return this.buffers.push(t),this.buffers.length!==this.reconPack.attachments?null:(t=o.reconstructPacket(this.reconPack,this.buffers),this.finishedReconstruction(),t)},f.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";(function(t){var r=n(35),i=n(36),o=n(37);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(t=null===t?new l(e):t).length=e,t}function l(t,e,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,n);if("number"!=typeof t)return c(this,t,e,n);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(this,t)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=f(t,e),t}(t,e,n,r):"string"==typeof e?function(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n);return(n=(t=a(t,r)).write(e,n))!==r&&(t=t.slice(0,n)),t}(t,e,n):function(t,e){if(l.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e){if(h(e),t=a(t,e<0?0:0|p(e)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var n=(t="string"!=typeof t?""+t:t).length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(t).length;default:if(r)return M(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var i,o,s,a=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||r<n)&&(n=r);for(var i="",o=e;o<n;++o)i+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[o]);return i}(this,e,n);case"utf8":case"utf-8":return v(this,e,n);case"ascii":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}(this,e,n);case"latin1":case"binary":return function(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}(this,e,n);case"base64":return i=this,s=n,0===(o=e)&&s===i.length?r.fromByteArray(i):r.fromByteArray(i.slice(o,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,e,n);default:if(a)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),a=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,(n=(n=isNaN(n)?i?0:t.length-1:n)<0?t.length+n:n)>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o=1,s=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s/=o=2,a/=2,n/=2}function l(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var c=-1,h=n;h<s;h++)if(l(t,h)===l(e,-1===c?0:h-c)){if(h-(c=-1===c?h:c)+1===a)return c*o}else-1!==c&&(h-=h-c),c=-1;else for(h=n=s<n+a?s-a:n;0<=h;h--){for(var u=!0,f=0;f<a;f++)if(l(t,h+f)!==l(e,f)){u=!1;break}if(u)return h}return-1}function C(t,e,n,r){return B(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function b(t,e,n,r){return B(function(t,e){for(var n,r,i=[],o=0;o<t.length&&!((e-=2)<0);++o)n=(r=t.charCodeAt(o))>>8,r%=256,i.push(r),i.push(n);return i}(e,t.length-n),t,n,r)}function v(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,l,c=t[i],h=null,u=239<c?4:223<c?3:191<c?2:1;if(i+u<=n)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[i+1]))&&127<(l=(31&c)<<6|63&o)&&(h=l);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&2047<(l=(15&c)<<12|(63&o)<<6|63&s)&&(l<55296||57343<l)&&(h=l);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&65535<(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)&&l<1114112&&(h=l)}null===h?(h=65533,u=1):65535<h&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),i+=u}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=w));return n}(r)}e.Buffer=l,e.SlowBuffer=function(t){return+t!=t&&(t=0),l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,n){return c(null,t,e,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,n){return r=null,e=e,n=n,h(t=t),t<=0||void 0===e?a(r,t):"string"==typeof n?a(r,t).fill(e,n):a(r,t).fill(e);var r},l.allocUnsafe=function(t){return u(null,t)},l.allocUnsafeSlow=function(t){return u(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);if(void 0===e)for(i=e=0;i<t.length;++i)e+=t[i].length;for(var n=l.allocUnsafe(e),r=0,i=0;i<t.length;++i){var s=t[i];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,r),r+=s.length}return n},l.byteLength=d,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?v(this,0,t):_.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,n,r,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),(e=void 0===e?0:e)<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=e)return 0;if(i<=r)return-1;if(n<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(r,i),h=t.slice(e,n),u=0;u<a;++u)if(c[u]!==h[u]){o=c[u],s=h[u];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||i<n)&&(n=i),0<t.length&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,s,a,l=!1;;)switch(r){case"hex":return function(t,e,n,r){n=Number(n)||0;var i=t.length-n;if((!r||i<(r=Number(r)))&&(r=i),(i=e.length)%2!=0)throw new TypeError("Invalid hex string");i/2<r&&(r=i/2);for(var o=0;o<r;++o){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))return o;t[n+o]=s}return o}(this,t,e,n);case"utf8":case"utf-8":return s=e,a=n,B(M(t,(o=this).length-s),o,s,a);case"ascii":return C(this,t,e,n);case"latin1":case"binary":return C(this,t,e,n);case"base64":return o=this,s=e,a=n,B(D(t),o,s,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,n);default:if(l)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),l=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function S(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(n<t+e)throw new RangeError("Trying to access beyond buffer length")}function E(t,e,n,r,i,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<e||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function A(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function x(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function k(t,e,n,r){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,o){return o||k(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function T(t,e,n,r,o){return o||k(t,0,n,8),i.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else for(var r=e-t,i=new l(r,void 0),o=0;o<r;++o)i[o]=this[o+t];return i},l.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},l.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t+--e],i=1;0<e&&(i*=256);)r+=this[t+--e]*i;return r},l.prototype.readUInt8=function(t,e){return e||S(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||S(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||S(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return(i*=128)<=r&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||S(t,e,this.length);for(var r=e,i=1,o=this[t+--r];0<r&&(i*=256);)o+=this[t+--r]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){return e||S(t,2,this.length),32768&(t=this[t]|this[t+1]<<8)?4294901760|t:t},l.prototype.readInt16BE=function(t,e){return e||S(t,2,this.length),32768&(t=this[t+1]|this[t]<<8)?4294901760|t:t},l.prototype.readInt32LE=function(t,e){return e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||S(t,4,this.length),i.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||S(t,4,this.length),i.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||S(t,8,this.length),i.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||S(t,8,this.length),i.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){t=+t,e|=0,n|=0,r||E(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},l.prototype.writeUIntBE=function(t,e,n,r){t=+t,e|=0,n|=0,r||E(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;0<=--i&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):x(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):x(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){t=+t,e|=0,r||E(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,s=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){t=+t,e|=0,r||E(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,s=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):x(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):x(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return T(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return T(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n=n||0,r||0===r||(r=this.length),e>=t.length&&(e=t.length),(r=0<r&&r<n?n:r)===n)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var i,o=(r=t.length-e<r-n?t.length-e+n:r)-n;if(this===t&&n<e&&e<r)for(i=o-1;0<=i;--i)t[i+e]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){var i;if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1!==t.length||(i=t.charCodeAt(0))<256&&(t=i),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;if(e>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(t=t||0))for(a=e;a<n;++a)this[a]=t;else for(var o=l.isBuffer(t)?t:M(new l(t,r).toString()),s=o.length,a=0;a<n-e;++a)this[a+e]=o[a%s];return this};var R=/[^+\/0-9A-Za-z-_]/g;function M(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if(55295<(n=t.charCodeAt(s))&&n<57344){if(!i){if(56319<n){-1<(e-=3)&&o.push(239,191,189);continue}if(s+1===r){-1<(e-=3)&&o.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(e-=3)&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(e-=3)&&o.push(239,191,189);if(i=null,n<128){if(--e<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function D(t){return r.toByteArray(function(t){var e;if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(1))},function(t,e,n){var r=n(40);t.exports=function(t){var e=t.xdomain,n=t.xscheme;t=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||r))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&t)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},function(t,e,n){var r=n(0);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}n(2)((t.exports=i).prototype),i.prototype.onError=function(t,e){return(t=new Error(t)).type="TransportError",t.description=e,this.emit("error",t),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){t=r.decodePacket(t,this.socket.binaryType),this.onPacket(t)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){t.exports=function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}l=n[s]={exports:{}},e[s][0].call(l.exports,(function(t){return i(e[s][1][t]||t)}),l,l.exports,t,e,n,r)}return n[s].exports}for(var o=!1,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./Strings"),a=t("./common/Platform"),l=t("./ui/RenderDebouncer"),c=t("./ui/Lifecycle"),h=t("./common/Lifecycle"),u=t("./ui/ScreenDprMonitor");i(f,o=h.Disposable),f.prototype.dispose=function(){o.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},f.prototype._onBoundaryFocus=function(t,e){var n,r,i,o=t.target,s=this._rowElements[0===e?1:this._rowElements.length-2];o.getAttribute("aria-posinset")!==(0===e?"1":""+this._terminal.buffer.lines.length)&&t.relatedTarget===s&&(0===e?(n=o,r=this._rowElements.pop(),this._rowContainer.removeChild(r)):(n=this._rowElements.shift(),r=o,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),r.removeEventListener("focus",this._bottomBoundaryFocusListener),0===e?(i=this._createAccessibilityTreeNode(),this._rowElements.unshift(i),this._rowContainer.insertAdjacentElement("afterbegin",i)):(i=this._createAccessibilityTreeNode(),this._rowElements.push(i),this._rowContainer.appendChild(i)),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===e?-1:1),this._rowElements[0===e?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation())},f.prototype._onResize=function(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},f.prototype._createAccessibilityTreeNode=function(){var t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t},f.prototype._onTab=function(t){for(var e=0;e<t;e++)this._onChar(" ")},f.prototype._onChar=function(t){var e=this;this._liveRegionLineCount<21&&(0<this._charsToConsume.length&&this._charsToConsume.shift()===t||(this._charsToAnnounce+=t),"\n"===t&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),a.isMac&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout((function(){e._accessibilityTreeRoot.appendChild(e._liveRegion)}),0))},f.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,a.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},f.prototype._onKey=function(t){this._clearLiveRegion(),this._charsToConsume.push(t)},f.prototype._refreshRows=function(t,e){this._renderRowsDebouncer.refresh(t,e,this._terminal.rows)},f.prototype._renderRows=function(t,e){for(var n=this._terminal.buffer,r=n.lines.length.toString(),i=t;i<=e;i++){var o=n.translateBufferLineToString(n.ydisp+i,!0),a=(n.ydisp+i+1).toString(),l=this._rowElements[i];l&&(l.textContent=0===o.length?s.blankLine:o,l.setAttribute("aria-posinset",a),l.setAttribute("aria-setsize",r))}this._announceCharacters()},f.prototype._refreshRowsDimensions=function(){if(this._dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t])}},f.prototype.setDimensions=function(t){this._dimensions=t,this._refreshRowsDimensions()},f.prototype._refreshRowDimensions=function(t){t.style.height=this._dimensions.actualCellHeight+"px"},f.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},i=f;function f(t,e){var n=o.call(this)||this;n._terminal=t,n._dimensions=e,n._liveRegionLineCount=0,n._charsToConsume=[],n._charsToAnnounce="",n._accessibilityTreeRoot=document.createElement("div"),n._accessibilityTreeRoot.classList.add("xterm-accessibility"),n._rowContainer=document.createElement("div"),n._rowContainer.classList.add("xterm-accessibility-tree"),n._rowElements=[];for(var r=0;r<n._terminal.rows;r++)n._rowElements[r]=n._createAccessibilityTreeNode(),n._rowContainer.appendChild(n._rowElements[r]);return n._topBoundaryFocusListener=function(t){return n._onBoundaryFocus(t,0)},n._bottomBoundaryFocusListener=function(t){return n._onBoundaryFocus(t,1)},n._rowElements[0].addEventListener("focus",n._topBoundaryFocusListener),n._rowElements[n._rowElements.length-1].addEventListener("focus",n._bottomBoundaryFocusListener),n._refreshRowsDimensions(),n._accessibilityTreeRoot.appendChild(n._rowContainer),n._renderRowsDebouncer=new l.RenderDebouncer(n._renderRows.bind(n)),n._refreshRows(),n._liveRegion=document.createElement("div"),n._liveRegion.classList.add("live-region"),n._liveRegion.setAttribute("aria-live","assertive"),n._accessibilityTreeRoot.appendChild(n._liveRegion),n._terminal.element.insertAdjacentElement("afterbegin",n._accessibilityTreeRoot),n.register(n._renderRowsDebouncer),n.register(n._terminal.onResize((function(t){return n._onResize(t.rows)}))),n.register(n._terminal.onRender((function(t){return n._refreshRows(t.start,t.end)}))),n.register(n._terminal.onScroll((function(){return n._refreshRows()}))),n.register(n._terminal.addDisposableListener("a11y.char",(function(t){return n._onChar(t)}))),n.register(n._terminal.onLineFeed((function(){return n._onChar("\n")}))),n.register(n._terminal.addDisposableListener("a11y.tab",(function(t){return n._onTab(t)}))),n.register(n._terminal.onKey((function(t){return n._onKey(t.key)}))),n.register(n._terminal.addDisposableListener("blur",(function(){return n._clearLiveRegion()}))),n._screenDprMonitor=new u.ScreenDprMonitor,n.register(n._screenDprMonitor),n._screenDprMonitor.setListener((function(){return n._refreshRowsDimensions()})),n.register(c.addDisposableDomListener(window,"resize",(function(){return n._refreshRowsDimensions()}))),n}n.AccessibilityManager=i},{"./Strings":16,"./common/Lifecycle":24,"./common/Platform":25,"./ui/Lifecycle":59,"./ui/RenderDebouncer":60,"./ui/ScreenDprMonitor":61}],2:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./common/CircularList"),i=t("./core/buffer/BufferLine"),o=t("./core/buffer/BufferReflow"),s=t("./core/buffer/Marker");function a(t,e){this._terminal=t,this._hasScrollback=e,this.savedCurAttrData=i.DEFAULT_ATTR_DATA.clone(),this.markers=[],this._nullCell=i.CellData.fromCharData([0,i.NULL_CELL_CHAR,i.NULL_CELL_WIDTH,i.NULL_CELL_CODE]),this._whitespaceCell=i.CellData.fromCharData([0,i.WHITESPACE_CELL_CHAR,i.WHITESPACE_CELL_WIDTH,i.WHITESPACE_CELL_CODE]),this._cols=this._terminal.cols,this._rows=this._terminal.rows,this.clear()}n.MAX_BUFFER_SIZE=4294967295,a.prototype.getNullCell=function(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg):(this._nullCell.fg=0,this._nullCell.bg=0),this._nullCell},a.prototype.getWhitespaceCell=function(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0),this._whitespaceCell},a.prototype.getBlankLine=function(t,e){return new i.BufferLine(this._terminal.cols,this.getNullCell(t),e)},Object.defineProperty(a.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return 0<=t&&t<this._rows},enumerable:!0,configurable:!0}),a.prototype._getCorrectBufferLength=function(t){return this._hasScrollback&&(t+=this._terminal.options.scrollback)>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:t},a.prototype.fillViewportRows=function(t){if(0===this.lines.length){void 0===t&&(t=i.DEFAULT_ATTR_DATA);for(var e=this._rows;e--;)this.lines.push(this.getBlankLine(t))}},a.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},a.prototype.resize=function(t,e){var n=this.getNullCell(i.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(e);if(r>this.lines.maxLength&&(this.lines.maxLength=r),0<this.lines.length){if(this._cols<t)for(var o=0;o<this.lines.length;o++)this.lines.get(o).resize(t,n);var s,a=0;if(this._rows<e)for(var l=this._rows;l<e;l++)this.lines.length<e+this.ybase&&(0<this.ybase&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,0<this.ydisp&&this.ydisp--):this.lines.push(new i.BufferLine(t,n)));else for(l=this._rows;e<l;l--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));r<this.lines.maxLength&&(0<(s=this.lines.length-r)&&(this.lines.trimStart(s),this.ybase=Math.max(this.ybase-s,0),this.ydisp=Math.max(this.ydisp-s,0)),this.lines.maxLength=r),this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),a&&(this.y+=a),this.savedY=Math.min(this.savedY,e-1),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(o=0;o<this.lines.length;o++)this.lines.get(o).resize(t,n);this._cols=t,this._rows=e},Object.defineProperty(a.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._terminal.options.windowsMode},enumerable:!0,configurable:!0}),a.prototype._reflow=function(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))},a.prototype._reflowLarger=function(t,e){var n=o.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(i.DEFAULT_ATTR_DATA));0<n.length&&(n=o.reflowLargerCreateNewLayout(this.lines,n),o.reflowLargerApplyNewLayout(this.lines,n.layout),this._reflowLargerAdjustViewport(t,e,n.countRemoved))},a.prototype._reflowLargerAdjustViewport=function(t,e,n){for(var r=this.getNullCell(i.DEFAULT_ATTR_DATA),o=n;0<o--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<e&&this.lines.push(new i.BufferLine(t,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--)},a.prototype._reflowSmaller=function(t,e){for(var n=this.getNullCell(i.DEFAULT_ATTR_DATA),r=[],s=0,a=this.lines.length-1;0<=a;a--){var l=this.lines.get(a);if(!(!l||!l.isWrapped&&l.getTrimmedLength()<=t)){for(var c=[l];l.isWrapped&&0<a;)l=this.lines.get(--a),c.unshift(l);if(!(a<=(p=this.ybase+this.y)&&p<a+c.length)){for(var h=c[c.length-1].getTrimmedLength(),u=o.reflowSmallerGetNewLineLengths(c,this._cols,t),f=u.length-c.length,p=void 0,d=(p=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f),[]),_=0;_<f;_++){var m=this.getBlankLine(i.DEFAULT_ATTR_DATA,!0);d.push(m)}0<d.length&&(r.push({start:a+c.length+s,newLines:d}),s+=d.length),c.push.apply(c,d);var g=u.length-1,y=u[g];0===y&&(y=u[--g]);for(var C=c.length-f-1,b=h;0<=C;){var v=Math.min(b,y);c[g].copyCellsFrom(c[C],b-v,y-v,v,!0),0==(y-=v)&&(y=u[--g]),0==(b-=v)&&(C--,v=Math.max(C,0),b=o.getWrappedLineTrimmedLength(c,v,this._cols))}for(_=0;_<c.length;_++)u[_]<t&&c[_].setCell(u[_],n);for(var w=f-p;0<w--;)0===this.ybase?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++)}}}if(0<r.length){var S=[],E=[];for(_=0;_<this.lines.length;_++)E.push(this.lines.get(_));var A=this.lines.length,x=A-1,k=0,L=r[k];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);var T=0;for(_=Math.min(this.lines.maxLength-1,A+s-1);0<=_;_--)if(L&&L.start>x+T){for(var R=L.newLines.length-1;0<=R;R--)this.lines.set(_--,L.newLines[R]);_++,S.push({index:x+1,amount:L.newLines.length}),T+=L.newLines.length,L=r[++k]}else this.lines.set(_,E[x--]);var M=0;for(_=S.length-1;0<=_;_--)S[_].index+=M,this.lines.onInsertEmitter.fire(S[_]),M+=S[_].amount;0<(A=Math.max(0,A+s-this.lines.maxLength))&&this.lines.onTrimEmitter.fire(A)}},a.prototype.stringIndexToBufferIndex=function(t,e,n){for(void 0===n&&(n=!1);e;){var r=this.lines.get(t);if(!r)return[-1,-1];for(var o=n?r.getTrimmedLength():r.length,s=0;s<o;++s)if(r.get(s)[i.CHAR_DATA_WIDTH_INDEX]&&(e-=r.get(s)[i.CHAR_DATA_CHAR_INDEX].length||1),e<0)return[t,s];t++}return[t,0]},a.prototype.translateBufferLineToString=function(t,e,n,r){return void 0===n&&(n=0),(t=this.lines.get(t))?t.translateToString(e,n,r):""},a.prototype.getWrappedRangeForLine=function(t){for(var e=t,n=t;0<e&&this.lines.get(e).isWrapped;)e--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:e,last:n}},a.prototype.setupTabStops=function(t){for(null!=t?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._terminal.options.tabStopWidth)this.tabs[t]=!0},a.prototype.prevStop=function(t){for(null==t&&(t=this.x);!this.tabs[--t]&&0<t;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t},a.prototype.addMarker=function(t){var e=this,n=new s.Marker(t);return this.markers.push(n),n.register(this.lines.onTrim((function(t){n.line-=t,n.line<0&&n.dispose()}))),n.register(this.lines.onInsert((function(t){n.line>=t.index&&(n.line+=t.amount)}))),n.register(this.lines.onDelete((function(t){n.line>=t.index&&n.line<t.index+t.amount&&n.dispose(),n.line>t.index&&(n.line-=t.amount)}))),n.register(n.onDispose((function(){return e._removeMarker(n)}))),n},a.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},a.prototype.iterator=function(t,e,n,r,i){return new l(this,t,e,n,r,i)},t=a,n.Buffer=t;var l=(c.prototype.hasNext=function(){return this._current<this._endIndex},c.prototype.next=function(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var e="",n=t.first;n<=t.last;++n)e+=this._buffer.translateBufferLineToString(n,this._trimRight);return this._current=t.last+1,{range:t,content:e}},c);function c(t,e,n,r,i,o){void 0===n&&(n=0),void 0===r&&(r=t.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=t,this._trimRight=e,this._startIndex=n,this._endIndex=r,this._startOverscan=i,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}n.BufferStringIterator=l},{"./common/CircularList":20,"./core/buffer/BufferLine":29,"./core/buffer/BufferReflow":30,"./core/buffer/Marker":31}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./Buffer"),i=t("./common/EventEmitter2");Object.defineProperty(o.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),o.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},o.prototype.activateAltBuffer=function(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},o.prototype.resize=function(t,e){this._normal.resize(t,e),this._alt.resize(t,e)},o.prototype.setupTabStops=function(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)},t=o;function o(t){this._terminal=t,this._onBufferActivate=new i.EventEmitter2,this._normal=new r.Buffer(this._terminal,!0),this._normal.fillViewportRows(),this._alt=new r.Buffer(this._terminal,!1),this._activeBuffer=this._normal,this.setupTabStops()}n.BufferSet=t},{"./Buffer":2,"./common/EventEmitter2":23}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./common/EventEmitter2");Object.defineProperty(i.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),i.prototype.measure=function(t){this._measureElement.style.fontFamily=t.fontFamily,this._measureElement.style.fontSize=t.fontSize+"px";var e=this._measureElement.getBoundingClientRect();0!==e.width&&0!==e.height&&(t=Math.ceil(e.height),this._width===e.width&&this._height===t||(this._width=e.width,this._height=t,this._onCharSizeChanged.fire()))},t=i;function i(t,e){this._onCharSizeChanged=new r.EventEmitter2,this._document=t,this._parentElement=e,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}n.CharMeasure=t},{"./common/EventEmitter2":23}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./common/TypedArrayUtils");n.wcwidth=function(t){var e=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];var i=0|t.control,o=new Uint8Array(65536);r.fill(o,1),o[0]=t.nul,r.fill(o,t.control,1,32),r.fill(o,t.control,127,160),r.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,r.fill(o,2,11904,42192),o[12351]=1,r.fill(o,2,44032,55204),r.fill(o,2,63744,64256),r.fill(o,2,65040,65050),r.fill(o,2,65072,65136),r.fill(o,2,65280,65377),r.fill(o,2,65504,65511);for(var s=0;s<e.length;++s)r.fill(o,0,e[s][0],e[s][1]+1);return function(t){return t<32?0|i:t<127?1:t<65536?o[t]:function(t){return function(t,e){var n,r=0,i=e.length-1;if(!(t<e[0][0]||t>e[i][1]))for(;r<=i;)if(t>e[n=r+i>>1][1])r=1+n;else{if(!(t<e[n][0]))return 1;i=n-1}}(t,n)?0:131072<=t&&t<=196605||196608<=t&&t<=262141?2:1}(t)}}({nul:0,control:0}),n.getStringCellWidth=function(t){for(var e=0,r=t.length,i=0;i<r;++i){var o=t.charCodeAt(i);if(55296<=o&&o<=56319){if(++i>=r)return e+n.wcwidth(o);var s=t.charCodeAt(i);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:e+=n.wcwidth(s)}e+=n.wcwidth(o)}return e}},{"./common/TypedArrayUtils":26}],6:[function(t,e,n){"use strict";function r(t){return t.replace(/\r?\n/g,"\r")}function i(t,e){return e?"[200~"+t+"[201~":t}function o(t,e){var n=e.screenElement.getBoundingClientRect(),r=t.clientX-n.left-10;n=t.clientY-n.top-10;e.textarea.style.position="absolute",e.textarea.style.width="20px",e.textarea.style.height="20px",e.textarea.style.left=r+"px",e.textarea.style.top=n+"px",e.textarea.style.zIndex="1000",e.textarea.focus(),setTimeout((function(){e.textarea.style.position=null,e.textarea.style.width=null,e.textarea.style.height=null,e.textarea.style.left=null,e.textarea.style.top=null,e.textarea.style.zIndex=null}),200)}Object.defineProperty(n,"__esModule",{value:!0}),n.prepareTextForTerminal=r,n.bracketTextForPaste=i,n.copyHandler=function(t,e,n){e.browser.isMSIE?window.clipboardData.setData("Text",n.selectionText):t.clipboardData.setData("text/plain",n.selectionText),t.preventDefault()},n.pasteHandler=function(t,e){function n(n){n=i(n=r(n),e.bracketedPasteMode),e.handler(n),e.textarea.value="",e.emit("paste",n),e.cancel(t)}t.stopPropagation(),e.browser.isMSIE?window.clipboardData&&n(window.clipboardData.getData("Text")):t.clipboardData&&n(t.clipboardData.getData("text/plain"))},n.moveTextAreaUnderMouseCursor=o,n.rightClickHandler=function(t,e,n,r){o(t,e),r&&!n.isClickInSelection(t)&&n.selectWordAtCursor(t),e.textarea.value=n.selectionText,e.textarea.select()}},{}],7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},i.prototype.compositionupdate=function(t){var e=this;this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout((function(){e._compositionPosition.end=e._textarea.value.length}),0)},i.prototype.compositionend=function(){this._finalizeComposition(!0)},i.prototype.keydown=function(t){if(this._isComposing||this._isSendingComposition){if(229===t.keyCode)return!1;if(16===t.keyCode||17===t.keyCode||18===t.keyCode)return!1;this._finalizeComposition(!1)}return 229!==t.keyCode||(this._handleAnyTextareaChanges(),!1)},i.prototype._finalizeComposition=function(t){var e,n=this;this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),t?(e={start:this._compositionPosition.start,end:this._compositionPosition.end},this._isSendingComposition=!0,setTimeout((function(){var t;n._isSendingComposition&&(n._isSendingComposition=!1,void 0,t=n._isComposing?n._textarea.value.substring(e.start,e.end):n._textarea.value.substring(e.start),n._terminal.handler(t))}),0)):(this._isSendingComposition=!1,t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end),this._terminal.handler(t))},i.prototype._handleAnyTextareaChanges=function(){var t=this,e=this._textarea.value;setTimeout((function(){var n;t._isComposing||0<(n=t._textarea.value.replace(e,"")).length&&t._terminal.handler(n)}),0)},i.prototype.updateCompositionElements=function(t){var e,n,r,i=this;this._isComposing&&(this._terminal.buffer.isCursorInViewport&&(r=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),e=this._terminal.buffer.y*r,n=this._terminal.buffer.x*this._terminal.charMeasure.width,this._compositionView.style.left=n+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._terminal.options.fontFamily,this._compositionView.style.fontSize=this._terminal.options.fontSize+"px",r=this._compositionView.getBoundingClientRect(),this._textarea.style.left=n+"px",this._textarea.style.top=e+"px",this._textarea.style.width=r.width+"px",this._textarea.style.height=r.height+"px",this._textarea.style.lineHeight=r.height+"px"),t||setTimeout((function(){return i.updateCompositionElements(!0)}),0))},i.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},i);function i(t,e,n){this._textarea=t,this._compositionView=e,this._terminal=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}n.CompositionHelper=r},{}],8:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("./common/Lifecycle"),s=t("./core/input/TextDecoder");function a(t,e){for(var n=e-t,r=new Array(n);n--;)r[n]=--e;return r}var l=(c.prototype.add=function(t,e,n,r){this.table[e<<8|t]=(0|n)<<4|(void 0===r?e:r)},c.prototype.addMany=function(t,e,n,r){for(var i=0;i<t.length;i++)this.add(t[i],e,n,r)},c);function c(t){this.table=new("undefined"==typeof Uint8Array?Array:Uint8Array)(t)}n.TransitionTable=l;var h=a(32,127),u=a(0,24);u.push(25),u.push.apply(u,a(28,32)),n.VT500_TRANSITION_TABLE=function(){var t,e=new l(4095),n=a(0,14);for(t in n)for(var r=0;r<=160;++r)e.add(r,t,1,0);for(t in e.addMany(h,0,2,0),n)e.addMany([24,26,153,154],t,3,0),e.addMany(a(128,144),t,3,0),e.addMany(a(144,152),t,3,0),e.add(156,t,0,0),e.add(27,t,11,1),e.add(157,t,4,8),e.addMany([152,158,159],t,0,7),e.add(155,t,11,3),e.add(144,t,11,9);return e.addMany(u,0,3,0),e.addMany(u,1,3,1),e.add(127,1,0,1),e.addMany(u,8,0,8),e.addMany(u,3,3,3),e.add(127,3,0,3),e.addMany(u,4,3,4),e.add(127,4,0,4),e.addMany(u,6,3,6),e.addMany(u,5,3,5),e.add(127,5,0,5),e.addMany(u,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(h,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(a(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(h,7,0,7),e.addMany(u,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(a(64,127),3,7,0),e.addMany(a(48,58),3,8,4),e.add(59,3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(a(48,58),4,8,4),e.add(59,4,8,4),e.addMany(a(64,127),4,7,0),e.addMany([58,60,61,62,63],4,0,6),e.addMany(a(32,64),6,0,6),e.add(127,6,0,6),e.addMany(a(64,127),6,0,0),e.add(58,3,0,6),e.addMany(a(32,48),3,9,5),e.addMany(a(32,48),5,9,5),e.addMany(a(48,64),5,0,6),e.addMany(a(64,127),5,7,0),e.addMany(a(32,48),4,9,5),e.addMany(a(32,48),1,9,2),e.addMany(a(32,48),2,9,2),e.addMany(a(48,127),2,10,0),e.addMany(a(48,80),1,10,0),e.addMany(a(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(a(96,127),1,10,0),e.add(80,1,11,9),e.addMany(u,9,0,9),e.add(127,9,0,9),e.addMany(a(28,32),9,0,9),e.addMany(a(32,48),9,9,12),e.add(58,9,0,11),e.addMany(a(48,58),9,8,10),e.add(59,9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(u,11,0,11),e.addMany(a(32,128),11,0,11),e.addMany(a(28,32),11,0,11),e.addMany(u,10,0,10),e.add(127,10,0,10),e.addMany(a(28,32),10,0,10),e.addMany(a(48,58),10,8,10),e.add(59,10,8,10),e.addMany([58,60,61,62,63],10,0,11),e.addMany(a(32,48),10,9,12),e.addMany(u,12,0,12),e.add(127,12,0,12),e.addMany(a(28,32),12,0,12),e.addMany(a(32,48),12,9,12),e.addMany(a(48,64),12,0,11),e.addMany(a(64,127),12,12,13),e.addMany(a(64,127),10,12,13),e.addMany(a(64,127),9,12,13),e.addMany(u,13,13,13),e.addMany(h,13,13,13),e.add(127,13,0,13),e.addMany([27,156],13,14,0),e.add(160,8,5,8),e}();var f=(p.prototype.hook=function(t,e,n){},p.prototype.put=function(t,e,n){},p.prototype.unhook=function(){},p);function p(){}var d;i(_,d=o.Disposable),_.prototype.dispose=function(){this._printHandlerFb=null,this._executeHandlerFb=null,this._csiHandlerFb=null,this._escHandlerFb=null,this._oscHandlerFb=null,this._dcsHandlerFb=null,this._errorHandlerFb=null,this._printHandler=null,this._executeHandlers=null,this._escHandlers=null,this._csiHandlers=null,this._oscHandlers=null,this._dcsHandlers=null,this._activeDcsHandler=null,this._errorHandler=null},_.prototype.setPrintHandler=function(t){this._printHandler=t},_.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},_.prototype.setExecuteHandler=function(t,e){this._executeHandlers[t.charCodeAt(0)]=e},_.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},_.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},_.prototype.addCsiHandler=function(t,e){t=t.charCodeAt(0),void 0===this._csiHandlers[t]&&(this._csiHandlers[t]=[]);var n=this._csiHandlers[t];return n.push(e),{dispose:function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}},_.prototype.setCsiHandler=function(t,e){this._csiHandlers[t.charCodeAt(0)]=[e]},_.prototype.clearCsiHandler=function(t){this._csiHandlers[t.charCodeAt(0)]&&delete this._csiHandlers[t.charCodeAt(0)]},_.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},_.prototype.setEscHandler=function(t,e){this._escHandlers[t]=e},_.prototype.clearEscHandler=function(t){this._escHandlers[t]&&delete this._escHandlers[t]},_.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},_.prototype.addOscHandler=function(t,e){void 0===this._oscHandlers[t]&&(this._oscHandlers[t]=[]);var n=this._oscHandlers[t];return n.push(e),{dispose:function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}},_.prototype.setOscHandler=function(t,e){this._oscHandlers[t]=[e]},_.prototype.clearOscHandler=function(t){this._oscHandlers[t]&&delete this._oscHandlers[t]},_.prototype.setOscHandlerFallback=function(t){this._oscHandlerFb=t},_.prototype.setDcsHandler=function(t,e){this._dcsHandlers[t]=e},_.prototype.clearDcsHandler=function(t){this._dcsHandlers[t]&&delete this._dcsHandlers[t]},_.prototype.setDcsHandlerFallback=function(t){this._dcsHandlerFb=t},_.prototype.setErrorHandler=function(t){this._errorHandler=t},_.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},_.prototype.reset=function(){this.currentState=this.initialState,this._osc="",this._params=[0],this._collect="",this._activeDcsHandler=null},_.prototype.parse=function(t,e){for(var n=0,r=0,i=!1,o=this.currentState,a=-1,l=-1,c=this._osc,h=this._collect,u=this._params,f=this.TRANSITIONS.table,p=this._activeDcsHandler,d=null,_=0;_<e;++_)if(n=t[_],0===o&&31<n&&n<128){for(a=~a?a:_;++_<e&&31<t[_]&&t[_]<128;);_--}else if(4===o&&47<n&&n<57)u[u.length-1]=10*u[u.length-1]+n-48;else{switch((r=f[o<<8|(n<160?n:160)])>>4){case 2:a=~a?a:_;break;case 3:~a&&(this._printHandler(t,a,_),a=-1),(d=this._executeHandlers[n])?d():this._executeHandlerFb(n);break;case 0:~a?(this._printHandler(t,a,_),a=-1):~l&&(p.put(t,l,_),l=-1);break;case 1:if(159<n)switch(o){case 0:a=~a?a:_;break;case 6:r|=6;break;case 11:r|=11;break;case 13:l=~l?l:_,r|=13;break;default:i=!0}else i=!0;if(i){if(this._errorHandler({position:_,code:n,currentState:o,print:a,dcs:l,osc:c,collect:h,params:u,abort:!1}).abort)return;i=!1}break;case 7:for(var m=this._csiHandlers[n],g=m?m.length-1:-1;0<=g&&!1===m[g](u,h);g--);g<0&&this._csiHandlerFb(h,u,n);break;case 8:59===n?u.push(0):u[u.length-1]=10*u[u.length-1]+n-48;break;case 9:h+=String.fromCharCode(n);break;case 10:(d=this._escHandlers[h+String.fromCharCode(n)])?d(h,n):this._escHandlerFb(h,n);break;case 11:~a&&(this._printHandler(t,a,_),a=-1),u=[0],h=c="",l=-1;break;case 12:(p=(p=this._dcsHandlers[h+String.fromCharCode(n)])||this._dcsHandlerFb).hook(h,u,n);break;case 13:l=~l?l:_;break;case 14:p&&(~l&&p.put(t,l,_),p.unhook(),p=null),27===n&&(r|=1),u=[0],h=c="",l=-1;break;case 4:~a&&(this._printHandler(t,a,_),a=-1),c="";break;case 5:for(var y=_+1;;y++)if(e<=y||(n=t[y])<32||127<n&&n<=159){c+=s.utf32ToString(t,_,y),_=y-1;break}break;case 6:if(c&&24!==n&&26!==n){var C=c.indexOf(";");if(-1===C)this._oscHandlerFb(-1,c);else{for(var b=parseInt(c.substring(0,C)),v=c.substring(C+1),w=this._oscHandlers[b],S=w?w.length-1:-1;0<=S&&!1===w[S](v);S--);S<0&&this._oscHandlerFb(b,v)}}27===n&&(r|=1),u=[0],h=c="",l=-1}o=15&r}0===o&&~a?this._printHandler(t,a,e):13===o&&~l&&p&&p.put(t,l,e),this._osc=c,this._collect=h,this._params=u,this._activeDcsHandler=p,this.currentState=o},i=_;function _(t){void 0===t&&(t=n.VT500_TRANSITION_TABLE);var e=d.call(this)||this;return e.TRANSITIONS=t,e.initialState=0,e.currentState=e.initialState,e._osc="",e._params=[0],e._collect="",e._printHandlerFb=function(t,e,n){},e._executeHandlerFb=function(t){},e._csiHandlerFb=function(t,e,n){},e._escHandlerFb=function(t,e){},e._oscHandlerFb=function(t,e){},e._dcsHandlerFb=new f,e._errorHandlerFb=function(t){return t},e._printHandler=e._printHandlerFb,e._executeHandlers=Object.create(null),e._csiHandlers=Object.create(null),e._escHandlers=Object.create(null),e._oscHandlers=Object.create(null),e._dcsHandlers=Object.create(null),e._activeDcsHandler=null,e._errorHandler=e._errorHandlerFb,e.setEscHandler("\\",(function(){})),e}n.EscapeSequenceParser=i},{"./common/Lifecycle":24,"./core/input/TextDecoder":34}],9:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("./common/data/EscapeSequences"),s=t("./core/data/Charsets"),a=t("./CharWidth"),l=t("./EscapeSequenceParser"),c=t("./common/Lifecycle"),h=t("./common/TypedArrayUtils"),u=t("./core/input/TextDecoder"),f=t("./core/buffer/BufferLine"),p=t("./common/EventEmitter2"),d={"(":0,")":1,"*":2,"+":3,"-":1,".":2},_=(m.prototype.hook=function(t,e,n){this._data=new Uint32Array(0)},m.prototype.put=function(t,e,n){this._data=h.concat(this._data,t.subarray(e,n))},m.prototype.unhook=function(){var t=u.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':return this._terminal.handler(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._terminal.handler(o.C0.ESC+'P1$r61"p'+o.C0.ESC+"\\");case"r":var e=this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r";return this._terminal.handler(o.C0.ESC+"P1$r"+e+o.C0.ESC+"\\");case"m":return this._terminal.handler(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":return e={block:2,underline:4,bar:6}[this._terminal.getOption("cursorStyle")],e-=this._terminal.getOption("cursorBlink"),this._terminal.handler(o.C0.ESC+"P1$r"+e+" q"+o.C0.ESC+"\\");default:this._terminal.error("Unknown DCS $q %s",t),this._terminal.handler(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}},m);function m(t){this._terminal=t,this._data=new Uint32Array(0)}var g;i(y,g=c.Disposable),Object.defineProperty(y.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),y.prototype.dispose=function(){g.prototype.dispose.call(this),this._terminal=null},y.prototype.parse=function(t){var e,n,r;this._terminal&&(n=(e=this._terminal.buffer).x,r=e.y,this._terminal.debug&&this._terminal.log("data: "+t),this._parseBuffer.length<t.length&&(this._parseBuffer=new Uint32Array(t.length)),this._parser.parse(this._parseBuffer,this._stringDecoder.decode(t,this._parseBuffer)),(e=this._terminal.buffer).x===n&&e.y===r||this._onCursorMove.fire())},y.prototype.parseUtf8=function(t){var e,n,r;this._terminal&&(n=(e=this._terminal.buffer).x,r=e.y,this._terminal.debug&&this._terminal.log("data: "+t),this._parseBuffer.length<t.length&&(this._parseBuffer=new Uint32Array(t.length)),this._parser.parse(this._parseBuffer,this._utf8Decoder.decode(t,this._parseBuffer)),(e=this._terminal.buffer).x===n&&e.y===r||this._terminal.emit("cursormove"))},y.prototype.print=function(t,e,n){var r=this._terminal.buffer,i=this._terminal.charset,o=this._terminal.options.screenReaderMode,s=this._terminal.cols,l=this._terminal.wraparoundMode,c=this._terminal.insertMode,h=this._terminal.curAttrData,p=r.lines.get(r.y+r.ybase);this._terminal.updateRange(r.y);for(var d=e;d<n;++d){var _,m=t[d],g=a.wcwidth(m);if(m<127&&i&&(_=i[String.fromCharCode(m)])&&(m=_.charCodeAt(0)),o&&this._terminal.emit("a11y.char",u.stringFromCodePoint(m)),g||!r.x){if(r.x+g-1>=s)if(l)r.x=0,r.y++,r.y>r.scrollBottom?(r.y--,this._terminal.scroll(!0)):r.lines.get(r.y).isWrapped=!0,p=r.lines.get(r.y+r.ybase);else if(2===g)continue;if(c&&(p.insertCells(r.x,g,r.getNullCell(h)),2===p.getWidth(s-1)&&p.setCellFromCodePoint(s-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,h.fg,h.bg)),p.setCellFromCodePoint(r.x++,m,g,h.fg,h.bg),0<g)for(;--g;)p.setCellFromCodePoint(r.x++,0,0,h.fg,h.bg)}else p.getWidth(r.x-1)?p.addCodepointToCell(r.x-1,m):p.addCodepointToCell(r.x-2,m)}this._terminal.updateRange(r.y)},y.prototype.addCsiHandler=function(t,e){return this._parser.addCsiHandler(t,e)},y.prototype.addOscHandler=function(t,e){return this._parser.addOscHandler(t,e)},y.prototype.bell=function(){this._terminal.bell()},y.prototype.lineFeed=function(){var t=this._terminal.buffer;this._terminal.options.convertEol&&(t.x=0),t.y++,t.y>t.scrollBottom&&(t.y--,this._terminal.scroll()),t.x>=this._terminal.cols&&t.x--,this._onLineFeed.fire()},y.prototype.carriageReturn=function(){this._terminal.buffer.x=0},y.prototype.backspace=function(){0<this._terminal.buffer.x&&this._terminal.buffer.x--},y.prototype.tab=function(){var t=this._terminal.buffer.x;this._terminal.buffer.x=this._terminal.buffer.nextStop(),this._terminal.options.screenReaderMode&&this._terminal.emit("a11y.tab",this._terminal.buffer.x-t)},y.prototype.shiftOut=function(){this._terminal.setgLevel(1)},y.prototype.shiftIn=function(){this._terminal.setgLevel(0)},y.prototype.insertChars=function(t){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).insertCells(this._terminal.buffer.x,t[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},y.prototype.cursorUp=function(t){t=t[0],this._terminal.buffer.y-=t=t<1?1:t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0)},y.prototype.cursorDown=function(t){t=t[0],this._terminal.buffer.y+=t=t<1?1:t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},y.prototype.cursorForward=function(t){t=t[0],this._terminal.buffer.x+=t=t<1?1:t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.cursorBackward=function(t){(t=t[0])<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},y.prototype.cursorNextLine=function(t){t=t[0],this._terminal.buffer.y+=t=t<1?1:t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},y.prototype.cursorPrecedingLine=function(t){t=t[0],this._terminal.buffer.y-=t=t<1?1:t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},y.prototype.cursorCharAbsolute=function(t){t=t[0],this._terminal.buffer.x=(t=t<1?1:t)-1},y.prototype.cursorPosition=function(t){var e=t[0]-1;t=2<=t.length?t[1]-1:0;e<0?e=0:e>=this._terminal.rows&&(e=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=e},y.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},y.prototype._eraseInBufferLine=function(t,e,n,r){void 0===r&&(r=!1),(t=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+t)).replaceCells(e,n,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),r&&(t.isWrapped=!1)},y.prototype._resetBufferLine=function(t){this._eraseInBufferLine(t,0,this._terminal.cols,!0)},y.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(e=this._terminal.buffer.y,this._terminal.updateRange(e),this._eraseInBufferLine(e++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);e<this._terminal.rows;e++)this._resetBufferLine(e);this._terminal.updateRange(e);break;case 1:for(e=this._terminal.buffer.y,this._terminal.updateRange(e),this._eraseInBufferLine(e,0,this._terminal.buffer.x+1,!0),this._terminal.buffer.x+1>=this._terminal.cols&&(this._terminal.buffer.lines.get(e+1).isWrapped=!1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 2:for(e=this._terminal.rows,this._terminal.updateRange(e-1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 3:var n=this._terminal.buffer.lines.length-this._terminal.rows;0<n&&(this._terminal.buffer.lines.trimStart(n),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-n,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-n,0),this._onScroll.fire(0))}},y.prototype.eraseInLine=function(t){switch(t[0]){case 0:this._eraseInBufferLine(this._terminal.buffer.y,this._terminal.buffer.x,this._terminal.cols);break;case 1:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.buffer.x+1);break;case 2:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.cols)}this._terminal.updateRange(this._terminal.buffer.y)},y.prototype.insertLines=function(t){var e=t[0];e<1&&(e=1);for(var n=this._terminal.buffer,r=n.y+n.ybase,i=(t=this._terminal.rows-1-n.scrollBottom,this._terminal.rows-1+n.ybase-t+1);e--;)n.lines.splice(i-1,1),n.lines.splice(r,0,n.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(n.y),this._terminal.updateRange(n.scrollBottom)},y.prototype.deleteLines=function(t){var e=t[0];e<1&&(e=1);var n=this._terminal.buffer,r=n.y+n.ybase,i=this._terminal.rows-1-n.scrollBottom;for(i=this._terminal.rows-1+n.ybase-i;e--;)n.lines.splice(r,1),n.lines.splice(i,0,n.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(n.y),this._terminal.updateRange(n.scrollBottom)},y.prototype.deleteChars=function(t){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).deleteCells(this._terminal.buffer.x,t[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),this._terminal.updateRange(this._terminal.buffer.y)},y.prototype.scrollUp=function(t){for(var e=t[0]||1,n=this._terminal.buffer;e--;)n.lines.splice(n.ybase+n.scrollTop,1),n.lines.splice(n.ybase+n.scrollBottom,0,n.getBlankLine(f.DEFAULT_ATTR_DATA));this._terminal.updateRange(n.scrollTop),this._terminal.updateRange(n.scrollBottom)},y.prototype.scrollDown=function(t,e){if(t.length<2&&!e){for(var n=t[0]||1,r=this._terminal.buffer;n--;)r.lines.splice(r.ybase+r.scrollBottom,1),r.lines.splice(r.ybase+r.scrollTop,0,r.getBlankLine(f.DEFAULT_ATTR_DATA));this._terminal.updateRange(r.scrollTop),this._terminal.updateRange(r.scrollBottom)}},y.prototype.eraseChars=function(t){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).replaceCells(this._terminal.buffer.x,this._terminal.buffer.x+(t[0]||1),this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()))},y.prototype.cursorBackwardTab=function(t){for(var e=t[0]||1,n=this._terminal.buffer;e--;)n.x=n.prevStop()},y.prototype.charPosAbsolute=function(t){t=t[0],this._terminal.buffer.x=(t=t<1?1:t)-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.hPositionRelative=function(t){t=t[0],this._terminal.buffer.x+=t=t<1?1:t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.repeatPrecedingCharacter=function(t){var e=this._terminal.buffer,n=e.lines.get(e.ybase+e.y);n.loadCell(e.x-1,this._workCell),n.replaceCells(e.x,e.x+(t[0]||1),void 0!==this._workCell.content?this._workCell:e.getNullCell(f.DEFAULT_ATTR_DATA))},y.prototype.sendDeviceAttributes=function(t,e){0<t[0]||(e?">"===e&&(this._terminal.is("xterm")?this._terminal.handler(o.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(o.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(t[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(o.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(o.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(o.C0.ESC+"[?6c"))},y.prototype.linePosAbsolute=function(t){t=t[0],this._terminal.buffer.y=(t=t<1?1:t)-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},y.prototype.vPositionRelative=function(t){t=t[0],this._terminal.buffer.y+=t=t<1?1:t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},y.prototype.hVPosition=function(t){t[0]<1&&(t[0]=1),t[1]<1&&(t[1]=1),this._terminal.buffer.y=t[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=t[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.tabClear=function(t){(t=t[0])<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},y.prototype.setMode=function(t,e){if(1<t.length)for(var n=0;n<t.length;n++)this.setMode([t[n]]);else if(e){if("?"===e)switch(t[0]){case 1:this._terminal.applicationCursor=!0;break;case 2:this._terminal.setgCharset(0,s.DEFAULT_CHARSET),this._terminal.setgCharset(1,s.DEFAULT_CHARSET),this._terminal.setgCharset(2,s.DEFAULT_CHARSET),this._terminal.setgCharset(3,s.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._terminal.cols,this._terminal.resize(132,this._terminal.rows);break;case 6:this._terminal.originMode=!0;break;case 7:this._terminal.wraparoundMode=!0;break;case 12:break;case 66:this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=9===t[0],this._terminal.vt200Mouse=1e3===t[0],this._terminal.normalMouse=1e3<t[0],this._terminal.mouseEvents=!0,this._terminal.element&&this._terminal.element.classList.add("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.disable(),this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1048:this.saveCursor(t);break;case 1049:this.saveCursor(t);case 47:case 1047:this._terminal.buffers.activateAltBuffer(this._terminal.eraseAttrData()),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}}else 4===t[0]&&(this._terminal.insertMode=!0)},y.prototype.resetMode=function(t,e){if(1<t.length)for(var n=0;n<t.length;n++)this.resetMode([t[n]]);else if(e){if("?"===e)switch(t[0]){case 1:this._terminal.applicationCursor=!1;break;case 3:132===this._terminal.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._terminal.rows),delete this._terminal.savedCols;break;case 6:this._terminal.originMode=!1;break;case 7:this._terminal.wraparoundMode=!1;break;case 12:break;case 66:this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._terminal.x10Mouse=!1,this._terminal.vt200Mouse=!1,this._terminal.normalMouse=!1,this._terminal.mouseEvents=!1,this._terminal.element&&this._terminal.element.classList.remove("enable-mouse-events"),this._terminal.selectionManager&&this._terminal.selectionManager.enable();break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._terminal.utfMouse=!1;break;case 1006:this._terminal.sgrMouse=!1;break;case 1015:this._terminal.urxvtMouse=!1;break;case 25:this._terminal.cursorHidden=!0;break;case 1048:this.restoreCursor(t);break;case 1049:case 47:case 1047:this._terminal.buffers.activateNormalBuffer(),1049===t[0]&&this.restoreCursor(t),this._terminal.refresh(0,this._terminal.rows-1),this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}}else 4===t[0]&&(this._terminal.insertMode=!1)},y.prototype.charAttributes=function(t){if(1===t.length&&0===t[0])return this._terminal.curAttrData.fg=f.DEFAULT_ATTR_DATA.fg,void(this._terminal.curAttrData.bg=f.DEFAULT_ATTR_DATA.bg);for(var e,n=t.length,r=this._terminal.curAttrData,i=0;i<n;i++)30<=(e=t[i])&&e<=37?(r.fg&=-50331904,r.fg|=16777216|e-30):40<=e&&e<=47?(r.bg&=-50331904,r.bg|=16777216|e-40):90<=e&&e<=97?(r.fg&=-50331904,r.fg|=16777224|e-90):100<=e&&e<=107?(r.bg&=-50331904,r.bg|=16777224|e-100):0===e?(r.fg=f.DEFAULT_ATTR_DATA.fg,r.bg=f.DEFAULT_ATTR_DATA.bg):1===e?r.fg|=134217728:3===e?r.bg|=67108864:4===e?r.fg|=268435456:5===e?r.fg|=536870912:7===e?r.fg|=67108864:8===e?r.fg|=1073741824:2===e?r.bg|=134217728:22===e?(r.fg&=-134217729,r.bg&=-134217729):23===e?r.bg&=-67108865:24===e?r.fg&=-268435457:25===e?r.fg&=-536870913:27===e?r.fg&=-67108865:28===e?r.fg&=-1073741825:39===e?(r.fg&=-67108864,r.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):49===e?(r.bg&=-67108864,r.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):38===e?2===t[i+1]?(i+=2,r.fg|=50331648,r.fg&=-16777216,r.fg|=f.AttributeData.fromColorRGB([t[i],t[i+1],t[i+2]]),i+=2):5===t[i+1]&&(e=255&t[i+=2],r.fg&=-50331904,r.fg|=33554432|e):48===e?2===t[i+1]?(i+=2,r.bg|=50331648,r.bg&=-16777216,r.bg|=f.AttributeData.fromColorRGB([t[i],t[i+1],t[i+2]]),i+=2):5===t[i+1]&&(e=255&t[i+=2],r.bg&=-50331904,r.bg|=33554432|e):100===e?(r.fg&=-67108864,r.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._terminal.error("Unknown SGR attribute: %d.",e)},y.prototype.deviceStatus=function(t,e){if(e)"?"===e&&6===t[0]&&(n=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1,this._onData.fire(o.C0.ESC+"[?"+n+";"+r+"R"));else switch(t[0]){case 5:this._onData.fire(o.C0.ESC+"[0n");break;case 6:var n=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._onData.fire(o.C0.ESC+"["+n+";"+r+"R")}},y.prototype.softReset=function(t,e){"!"===e&&(this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.buffer.scrollTop=0,this._terminal.buffer.scrollBottom=this._terminal.rows-1,this._terminal.curAttrData=f.DEFAULT_ATTR_DATA.clone(),this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},y.prototype.setCursorStyle=function(t,e){if(" "===e){switch(t=t[0]<1?1:t[0]){case 1:case 2:this._terminal.setOption("cursorStyle","block");break;case 3:case 4:this._terminal.setOption("cursorStyle","underline");break;case 5:case 6:this._terminal.setOption("cursorStyle","bar")}this._terminal.setOption("cursorBlink",t%2==1)}},y.prototype.setScrollRegion=function(t,e){e||(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)},y.prototype.saveCursor=function(t){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttrData.fg=this._terminal.curAttrData.fg,this._terminal.buffer.savedCurAttrData.bg=this._terminal.curAttrData.bg},y.prototype.restoreCursor=function(t){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttrData.fg=this._terminal.buffer.savedCurAttrData.fg,this._terminal.curAttrData.bg=this._terminal.buffer.savedCurAttrData.bg},y.prototype.setTitle=function(t){this._terminal.handleTitle(t)},y.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},y.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},y.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},y.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,s.DEFAULT_CHARSET)},y.prototype.selectCharset=function(t){2===t.length?"/"!==t[0]&&this._terminal.setgCharset(d[t[0]],s.CHARSETS[t[1]]||s.DEFAULT_CHARSET):this.selectDefaultCharset()},y.prototype.index=function(){this._terminal.index()},y.prototype.tabSet=function(){this._terminal.tabSet()},y.prototype.reverseIndex=function(){this._terminal.reverseIndex()},y.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},y.prototype.setgLevel=function(t){this._terminal.setgLevel(t)},i=y;function y(t,e){void 0===e&&(e=new l.EscapeSequenceParser);var n=g.call(this)||this;n._terminal=t,n._parser=e,n._parseBuffer=new Uint32Array(4096),n._stringDecoder=new u.StringToUtf32,n._utf8Decoder=new u.Utf8ToUtf32,n._workCell=new f.CellData,n._onCursorMove=new p.EventEmitter2,n._onData=new p.EventEmitter2,n._onLineFeed=new p.EventEmitter2,n._onScroll=new p.EventEmitter2,n.register(n._parser),n._parser.setCsiHandlerFallback((function(t,e,r){n._terminal.error("Unknown CSI code: ",{collect:t,params:e,flag:String.fromCharCode(r)})})),n._parser.setEscHandlerFallback((function(t,e){n._terminal.error("Unknown ESC code: ",{collect:t,flag:String.fromCharCode(e)})})),n._parser.setExecuteHandlerFallback((function(t){n._terminal.error("Unknown EXECUTE code: ",{code:t})})),n._parser.setOscHandlerFallback((function(t,e){n._terminal.error("Unknown OSC code: ",{identifier:t,data:e})})),n._parser.setPrintHandler((function(t,e,r){return n.print(t,e,r)})),n._parser.setCsiHandler("@",(function(t,e){return n.insertChars(t)})),n._parser.setCsiHandler("A",(function(t,e){return n.cursorUp(t)})),n._parser.setCsiHandler("B",(function(t,e){return n.cursorDown(t)})),n._parser.setCsiHandler("C",(function(t,e){return n.cursorForward(t)})),n._parser.setCsiHandler("D",(function(t,e){return n.cursorBackward(t)})),n._parser.setCsiHandler("E",(function(t,e){return n.cursorNextLine(t)})),n._parser.setCsiHandler("F",(function(t,e){return n.cursorPrecedingLine(t)})),n._parser.setCsiHandler("G",(function(t,e){return n.cursorCharAbsolute(t)})),n._parser.setCsiHandler("H",(function(t,e){return n.cursorPosition(t)})),n._parser.setCsiHandler("I",(function(t,e){return n.cursorForwardTab(t)})),n._parser.setCsiHandler("J",(function(t,e){return n.eraseInDisplay(t)})),n._parser.setCsiHandler("K",(function(t,e){return n.eraseInLine(t)})),n._parser.setCsiHandler("L",(function(t,e){return n.insertLines(t)})),n._parser.setCsiHandler("M",(function(t,e){return n.deleteLines(t)})),n._parser.setCsiHandler("P",(function(t,e){return n.deleteChars(t)})),n._parser.setCsiHandler("S",(function(t,e){return n.scrollUp(t)})),n._parser.setCsiHandler("T",(function(t,e){return n.scrollDown(t,e)})),n._parser.setCsiHandler("X",(function(t,e){return n.eraseChars(t)})),n._parser.setCsiHandler("Z",(function(t,e){return n.cursorBackwardTab(t)})),n._parser.setCsiHandler("`",(function(t,e){return n.charPosAbsolute(t)})),n._parser.setCsiHandler("a",(function(t,e){return n.hPositionRelative(t)})),n._parser.setCsiHandler("b",(function(t,e){return n.repeatPrecedingCharacter(t)})),n._parser.setCsiHandler("c",(function(t,e){return n.sendDeviceAttributes(t,e)})),n._parser.setCsiHandler("d",(function(t,e){return n.linePosAbsolute(t)})),n._parser.setCsiHandler("e",(function(t,e){return n.vPositionRelative(t)})),n._parser.setCsiHandler("f",(function(t,e){return n.hVPosition(t)})),n._parser.setCsiHandler("g",(function(t,e){return n.tabClear(t)})),n._parser.setCsiHandler("h",(function(t,e){return n.setMode(t,e)})),n._parser.setCsiHandler("l",(function(t,e){return n.resetMode(t,e)})),n._parser.setCsiHandler("m",(function(t,e){return n.charAttributes(t)})),n._parser.setCsiHandler("n",(function(t,e){return n.deviceStatus(t,e)})),n._parser.setCsiHandler("p",(function(t,e){return n.softReset(t,e)})),n._parser.setCsiHandler("q",(function(t,e){return n.setCursorStyle(t,e)})),n._parser.setCsiHandler("r",(function(t,e){return n.setScrollRegion(t,e)})),n._parser.setCsiHandler("s",(function(t,e){return n.saveCursor(t)})),n._parser.setCsiHandler("u",(function(t,e){return n.restoreCursor(t)})),n._parser.setExecuteHandler(o.C0.BEL,(function(){return n.bell()})),n._parser.setExecuteHandler(o.C0.LF,(function(){return n.lineFeed()})),n._parser.setExecuteHandler(o.C0.VT,(function(){return n.lineFeed()})),n._parser.setExecuteHandler(o.C0.FF,(function(){return n.lineFeed()})),n._parser.setExecuteHandler(o.C0.CR,(function(){return n.carriageReturn()})),n._parser.setExecuteHandler(o.C0.BS,(function(){return n.backspace()})),n._parser.setExecuteHandler(o.C0.HT,(function(){return n.tab()})),n._parser.setExecuteHandler(o.C0.SO,(function(){return n.shiftOut()})),n._parser.setExecuteHandler(o.C0.SI,(function(){return n.shiftIn()})),n._parser.setExecuteHandler(o.C1.IND,(function(){return n.index()})),n._parser.setExecuteHandler(o.C1.NEL,(function(){return n.nextLine()})),n._parser.setExecuteHandler(o.C1.HTS,(function(){return n.tabSet()})),n._parser.setOscHandler(0,(function(t){return n.setTitle(t)})),n._parser.setOscHandler(2,(function(t){return n.setTitle(t)})),n._parser.setEscHandler("7",(function(){return n.saveCursor([])})),n._parser.setEscHandler("8",(function(){return n.restoreCursor([])})),n._parser.setEscHandler("D",(function(){return n.index()})),n._parser.setEscHandler("E",(function(){return n.nextLine()})),n._parser.setEscHandler("H",(function(){return n.tabSet()})),n._parser.setEscHandler("M",(function(){return n.reverseIndex()})),n._parser.setEscHandler("=",(function(){return n.keypadApplicationMode()})),n._parser.setEscHandler(">",(function(){return n.keypadNumericMode()})),n._parser.setEscHandler("c",(function(){return n.reset()})),n._parser.setEscHandler("n",(function(){return n.setgLevel(2)})),n._parser.setEscHandler("o",(function(){return n.setgLevel(3)})),n._parser.setEscHandler("|",(function(){return n.setgLevel(3)})),n._parser.setEscHandler("}",(function(){return n.setgLevel(2)})),n._parser.setEscHandler("~",(function(){return n.setgLevel(1)})),n._parser.setEscHandler("%@",(function(){return n.selectDefaultCharset()})),n._parser.setEscHandler("%G",(function(){return n.selectDefaultCharset()}));var r,i=this;for(r in s.CHARSETS)!function(t){i._parser.setEscHandler("("+t,(function(){return n.selectCharset("("+t)})),i._parser.setEscHandler(")"+t,(function(){return n.selectCharset(")"+t)})),i._parser.setEscHandler("*"+t,(function(){return n.selectCharset("*"+t)})),i._parser.setEscHandler("+"+t,(function(){return n.selectCharset("+"+t)})),i._parser.setEscHandler("-"+t,(function(){return n.selectCharset("-"+t)})),i._parser.setEscHandler("."+t,(function(){return n.selectCharset("."+t)})),i._parser.setEscHandler("/"+t,(function(){return n.selectCharset("/"+t)}))}(r);return n._parser.setErrorHandler((function(t){return n._terminal.error("Parsing error: ",t),t})),n._parser.setDcsHandler("$q",new _(n._terminal)),n}n.InputHandler=i},{"./CharWidth":5,"./EscapeSequenceParser":8,"./common/EventEmitter2":23,"./common/Lifecycle":24,"./common/TypedArrayUtils":26,"./common/data/EscapeSequences":28,"./core/buffer/BufferLine":29,"./core/data/Charsets":32,"./core/input/TextDecoder":34}],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./MouseZoneManager"),i=t("./CharWidth"),o=t("./common/EventEmitter2");Object.defineProperty(s.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),s.prototype.attachToDom=function(t){this._mouseZoneManager=t},s.prototype.linkifyRows=function(t,e){var n=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=e):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,e)),this._mouseZoneManager.clearAll(t,e),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout((function(){return n._linkifyRows()}),s.TIME_BEFORE_LINKIFY))},s.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var t=(n=this._terminal.buffer).ydisp+this._rowsToLinkify.start;if(!(t>=n.lines.length)){for(var e=n.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,n=Math.ceil(s.OVERSCAN_CHAR_LIMIT/this._terminal.cols),r=this._terminal.buffer.iterator(!1,t,e,n,n);r.hasNext();)for(var i=r.next(),o=0;o<this._linkMatchers.length;o++)this._doLinkifyRow(i.range.first,i.content,this._linkMatchers[o]);this._rowsToLinkify.start=null,this._rowsToLinkify.end=null}},s.prototype.registerLinkMatcher=function(t,e,n){if(void 0===n&&(n={}),!e)throw new Error("handler must be defined");return n={id:this._nextLinkMatcherId++,regex:t,handler:e,matchIndex:n.matchIndex,validationCallback:n.validationCallback,hoverTooltipCallback:n.tooltipCallback,hoverLeaveCallback:n.leaveCallback,willLinkActivate:n.willLinkActivate,priority:n.priority||0},this._addLinkMatcherToList(n),n.id},s.prototype._addLinkMatcherToList=function(t){if(0!==this._linkMatchers.length){for(var e=this._linkMatchers.length-1;0<=e;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)},s.prototype.deregisterLinkMatcher=function(t){for(var e=0;e<this._linkMatchers.length;e++)if(this._linkMatchers[e].id===t)return this._linkMatchers.splice(e,1),!0;return!1},s.prototype._doLinkifyRow=function(t,e,n){for(var r,i=this,o=new RegExp(n.regex.source,n.regex.flags+"g"),s=-1,a=this;null!==(r=o.exec(e))&&"break"!==function(){var l=r["number"!=typeof n.matchIndex?0:n.matchIndex];if(!l){if(a._terminal.debug)throw console.log({match:r,matcher:n}),new Error("match found without corresponding matchIndex");return"break"}if(s=e.indexOf(l,s+1),o.lastIndex=s+l.length,s<0)return"break";var c=a._terminal.buffer.stringIndexToBufferIndex(t,s);if(c[0]<0)return"break";var h,u=a._terminal.buffer.lines.get(c[0]).getFg(c[1]);u&&(h=u>>9&511),n.validationCallback?n.validationCallback(l,(function(t){i._rowsTimeoutId||t&&i._addLink(c[1],c[0]-i._terminal.buffer.ydisp,l,n,h)})):a._addLink(c[1],c[0]-a._terminal.buffer.ydisp,l,n,h)}(););},s.prototype._addLink=function(t,e,n,o,s){var a=this,l=i.getStringCellWidth(n),c=t%this._terminal.cols,h=e+Math.floor(t/this._terminal.cols),u=(c+l)%this._terminal.cols,f=h+Math.floor((c+l)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new r.MouseZone(1+c,h+1,u+1,f+1,(function(t){if(o.handler)return o.handler(t,n);window.open(n,"_blank")}),(function(){a._onLinkHover.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.add("xterm-cursor-pointer")}),(function(t){a._onLinkTooltip.fire(a._createLinkHoverEvent(c,h,u,f,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(t,n)}),(function(){a._onLinkLeave.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()}),(function(t){return!o.willLinkActivate||o.willLinkActivate(t,n)})))},s.prototype._createLinkHoverEvent=function(t,e,n,r,i){return{x1:t,y1:e,x2:n,y2:r,cols:this._terminal.cols,fg:i}},s.TIME_BEFORE_LINKIFY=200,s.OVERSCAN_CHAR_LIMIT=2e3,t=s;function s(t){this._terminal=t,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new o.EventEmitter2,this._onLinkLeave=new o.EventEmitter2,this._onLinkTooltip=new o.EventEmitter2,this._rowsToLinkify={start:null,end:null}}n.Linkifier=t},{"./CharWidth":5,"./MouseZoneManager":12,"./common/EventEmitter2":23}],11:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.getCoordsRelativeToElement=function(t,e){return e=e.getBoundingClientRect(),[t.clientX-e.left,t.clientY-e.top]},i.prototype.getCoords=function(t,e,n,r,o,s){return n.width&&n.height&&(e=i.getCoordsRelativeToElement(t,e))?(e[0]=Math.ceil((e[0]+(s?this._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth),e[1]=Math.ceil(e[1]/this._renderCoordinator.dimensions.actualCellHeight),e[0]=Math.min(Math.max(e[0],1),r+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),o),e):null},i.prototype.getRawByteCoords=function(t,e,n,r,i){return i=(r=this.getCoords(t,e,n,r,i))[0],r=r[1],{x:i+=32,y:r+=32}},i);function i(t){this._renderCoordinator=t}n.MouseHelper=r},{}],12:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./common/Lifecycle"),a=t("./ui/Lifecycle");i(l,o=s.Disposable),l.prototype.dispose=function(){o.prototype.dispose.call(this),this._deactivate()},l.prototype.add=function(t){this._zones.push(t),1===this._zones.length&&this._activate()},l.prototype.clearAll=function(t,e){if(0!==this._zones.length){e||(t=0,e=this._terminal.rows-1);for(var n=0;n<this._zones.length;n++){var r=this._zones[n];(r.y1>t&&r.y1<=e+1||r.y2>t&&r.y2<=e+1||r.y1<t&&r.y2>e+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(n--,1))}0===this._zones.length&&this._deactivate()}},l.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.addEventListener("click",this._clickListener))},l.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.removeEventListener("click",this._clickListener))},l.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},l.prototype._onHover=function(t){var e=this,n=this._findZoneEventAt(t);n!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),n&&((this._currentZone=n).hoverCallback&&n.hoverCallback(t),this._tooltipTimeout=setTimeout((function(){return e._onTooltip(t)}),500)))},l.prototype._onTooltip=function(t){this._tooltipTimeout=null;var e=this._findZoneEventAt(t);e&&e.tooltipCallback&&e.tooltipCallback(t)},l.prototype._onMouseDown=function(t){var e;this._initialSelectionLength=this._terminal.getSelection().length,!this._areZonesActive||(e=this._findZoneEventAt(t))&&e.willLinkActivate(t)&&(t.preventDefault(),t.stopImmediatePropagation())},l.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},l.prototype._onClick=function(t){var e=this._findZoneEventAt(t),n=this._terminal.getSelection().length;e&&n===this._initialSelectionLength&&(e.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},l.prototype._findZoneEventAt=function(t){if(!(t=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows)))return null;for(var e=t[0],n=t[1],r=0;r<this._zones.length;r++){var i=this._zones[r];if(i.y1===i.y2){if(n===i.y1&&e>=i.x1&&e<i.x2)return i}else if(n===i.y1&&e>=i.x1||n===i.y2&&e<i.x2||n>i.y1&&n<i.y2)return i}return null},i=l;function l(t){var e=o.call(this)||this;return e._terminal=t,e._zones=[],e._areZonesActive=!1,e._tooltipTimeout=null,e._currentZone=null,e._lastHoverCoords=[null,null],e.register(a.addDisposableDomListener(e._terminal.element,"mousedown",(function(t){return e._onMouseDown(t)}))),e._mouseMoveListener=function(t){return e._onMouseMove(t)},e._mouseLeaveListener=function(t){return e._onMouseLeave(t)},e._clickListener=function(t){return e._onClick(t)},e}n.MouseZoneManager=i,n.MouseZone=function(t,e,n,r,i,o,s,a,l){this.x1=t,this.y1=e,this.x2=n,this.y2=r,this.clickCallback=i,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=l}},{"./common/Lifecycle":24,"./ui/Lifecycle":59}],13:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./MouseHelper"),i=t("./common/Platform"),o=t("./SelectionModel"),s=t("./handlers/AltClickHandler"),a=t("./core/buffer/BufferLine"),l=t("./common/EventEmitter2"),c=(t=String.fromCharCode(160),new RegExp(t,"g"));Object.defineProperty(h.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),h.prototype.dispose=function(){this._removeMouseDownListeners()},Object.defineProperty(h.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),h.prototype._initListeners=function(){var t=this;this._mouseMoveListener=function(e){return t._onMouseMove(e)},this._mouseUpListener=function(e){return t._onMouseUp(e)},this.initBuffersListeners()},h.prototype.initBuffersListeners=function(){var t=this;this._trimListener=this._terminal.buffer.lines.onTrim((function(e){return t._onTrim(e)})),this._terminal.buffers.onBufferActivate((function(e){return t._onBufferActivate(e)}))},h.prototype.disable=function(){this.clearSelection(),this._enabled=!1},h.prototype.enable=function(){this._enabled=!0},Object.defineProperty(h.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(h.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(h.prototype,"selectionText",{get:function(){var t=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;if(!t||!e)return"";var n=[];if(3===this._activeSelectionMode){if(t[0]===e[0])return"";for(var r=t[1];r<=e[1];r++){var o=this._buffer.translateBufferLineToString(r,!0,t[0],e[0]);n.push(o)}}else{var s=t[1]===e[1]?e[0]:void 0;for(n.push(this._buffer.translateBufferLineToString(t[1],!0,t[0],s)),r=t[1]+1;r<=e[1]-1;r++){var a=this._buffer.lines.get(r);o=this._buffer.translateBufferLineToString(r,!0);a.isWrapped?n[n.length-1]+=o:n.push(o)}t[1]!==e[1]&&(a=this._buffer.lines.get(e[1]),o=this._buffer.translateBufferLineToString(e[1],!0,0,e[0]),a.isWrapped?n[n.length-1]+=o:n.push(o))}return n.map((function(t){return t.replace(c," ")})).join(i.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),h.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},h.prototype.refresh=function(t){var e=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame((function(){return e._refresh()}))),i.isLinux&&t&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},h.prototype._refresh=function(){this._refreshAnimationFrame=null,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},h.prototype.isClickInSelection=function(t){var e=this._getMouseBufferCoords(t),n=this._model.finalSelectionStart;t=this._model.finalSelectionEnd;return!(!n||!t)&&this._areCoordsInSelection(e,n,t)},h.prototype._areCoordsInSelection=function(t,e,n){return t[1]>e[1]&&t[1]<n[1]||e[1]===n[1]&&t[1]===e[1]&&t[0]>=e[0]&&t[0]<n[0]||e[1]<n[1]&&t[1]===n[1]&&t[0]<n[0]||e[1]<n[1]&&t[1]===e[1]&&t[0]>=e[0]},h.prototype.selectWordAtCursor=function(t){(t=this._getMouseBufferCoords(t))&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},h.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},h.prototype.selectLines=function(t,e){this._model.clearSelection(),t=Math.max(t,0),e=Math.min(e,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._terminal.cols,e],this.refresh(),this._onSelectionChange.fire()},h.prototype._onTrim=function(t){this._model.onTrim(t)&&this.refresh()},h.prototype._getMouseBufferCoords=function(t){return(t=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0))?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},h.prototype._getMouseEventScrollAmount=function(t){var e=r.MouseHelper.getCoordsRelativeToElement(t,this._terminal.screenElement)[1];t=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return 0<=e&&e<=t?0:(t<e&&(e-=t),e=Math.min(Math.max(e,-50),50),(e/=50)/Math.abs(e)+Math.round(14*e))},h.prototype.shouldForceSelection=function(t){return i.isMac?t.altKey&&this._terminal.options.macOptionClickForcesSelection:t.shiftKey},h.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)}},h.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)},h.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument&&(this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=null},h.prototype._onIncrementalClick=function(t){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(t))},h.prototype._onSingleClick=function(t){this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(t)?3:0,this._model.selectionStart=this._getMouseBufferCoords(t),this._model.selectionStart&&(this._model.selectionEnd=null,(t=this._buffer.lines.get(this._model.selectionStart[1]))&&(t.length>=this._model.selectionStart[0]||0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++))},h.prototype._onDoubleClick=function(t){(t=this._getMouseBufferCoords(t))&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},h.prototype._onTripleClick=function(t){(t=this._getMouseBufferCoords(t))&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},h.prototype.shouldColumnSelect=function(t){return t.altKey&&!(i.isMac&&this._terminal.options.macOptionClickForcesSelection)},h.prototype._onMouseMove=function(t){t.stopImmediatePropagation();var e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(t),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._terminal.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(t),3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._terminal.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0)),this._model.selectionEnd[1]<this._buffer.lines.length&&0===this._buffer.lines.get(this._model.selectionEnd[1]).hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++,e&&e[0]===this._model.selectionEnd[0]&&e[1]===this._model.selectionEnd[1]||this.refresh(!0)):this.refresh(!0)},h.prototype._dragScroll=function(){this._dragScrollAmount&&(this._terminal.scrollLines(this._dragScrollAmount,!1),0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._terminal.cols),this._model.selectionEnd[1]=Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=this._terminal.buffer.ydisp),this.refresh())},h.prototype._onMouseUp=function(t){var e=t.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&e<500?new s.AltClickHandler(t,this._terminal).move():this.hasSelection&&this._onSelectionChange.fire()},h.prototype._onBufferActivate=function(t){var e=this;this.clearSelection(),this._trimListener&&this._trimListener.dispose(),this._trimListener=t.activeBuffer.lines.onTrim((function(t){return e._onTrim(t)}))},h.prototype._convertViewportColToCharacterIndex=function(t,e){for(var n=e[0],r=0;e[0]>=r;r++){var i=t.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?n--:1<i&&e[0]!==r&&(n+=i-1)}return n},h.prototype.setSelection=function(t,e,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[t,e],this._model.selectionStartLength=n,this.refresh()},h.prototype._getWordAt=function(t,e,n,r){if(void 0===n&&(n=!0),void 0===r&&(r=!0),t[0]>=this._terminal.cols)return null;var i=this._buffer.lines.get(t[1]);if(!i)return null;var o=this._buffer.translateBufferLineToString(t[1],!1),s=this._convertViewportColToCharacterIndex(i,t),a=s,l=t[0]-s,c=0,h=0,u=0,f=0;if(" "===o.charAt(s)){for(;0<s&&" "===o.charAt(s-1);)s--;for(;a<o.length&&" "===o.charAt(a+1);)a++}else{var p=t[0],d=t[0];0===i.getWidth(p)&&(c++,p--),2===i.getWidth(d)&&(h++,d++);var _=i.getString(d).length;for(1<_&&(f+=_-1,a+=_-1);0<p&&0<s&&!this._isCharWordSeparator(i.loadCell(p-1,this._workCell));){i.loadCell(p-1,this._workCell);var m=this._workCell.getChars().length;0===this._workCell.getWidth()?(c++,p--):1<m&&(u+=m-1,s-=m-1),s--,p--}for(;d<i.length&&a+1<o.length&&!this._isCharWordSeparator(i.loadCell(d+1,this._workCell));){i.loadCell(d+1,this._workCell);var g=this._workCell.getChars().length;2===this._workCell.getWidth()?(h++,d++):1<g&&(f+=g-1,a+=g-1),a++,d++}}return a++,_=s+l-c+u,l=Math.min(this._terminal.cols,a-s+c+h-u-f),e||""!==o.slice(s,a).trim()?(n&&(0!==_||32===i.getCodePoint(0)||(n=this._buffer.lines.get(t[1]-1))&&i.isWrapped&&32!==n.getCodePoint(this._terminal.cols-1)&&(n=this._getWordAt([this._terminal.cols-1,t[1]-1],!1,!0,!1))&&(_-=n=this._terminal.cols-n.start,l+=n)),r&&(_+l!==this._terminal.cols||32===i.getCodePoint(this._terminal.cols-1)||(r=this._buffer.lines.get(t[1]+1))&&r.isWrapped&&32!==r.getCodePoint(0)&&(t=this._getWordAt([0,t[1]+1],!1,!1,!0))&&(l+=t.length)),{start:_,length:l}):null},h.prototype._selectWordAt=function(t,e){var n=this._getWordAt(t,e);if(n){for(;n.start<0;)n.start+=this._terminal.cols,t[1]--;this._model.selectionStart=[n.start,t[1]],this._model.selectionStartLength=n.length}},h.prototype._selectToWordAt=function(t){var e=this._getWordAt(t,!0);if(e){for(var n=t[1];e.start<0;)e.start+=this._terminal.cols,n--;if(!this._model.areSelectionValuesReversed())for(;e.start+e.length>this._terminal.cols;)e.length-=this._terminal.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?e.start:e.start+e.length,n]}},h.prototype._isCharWordSeparator=function(t){return 0!==t.getWidth()&&0<=" ()[]{}'\"".indexOf(t.getChars())},h.prototype._selectLineAt=function(t){t=this._buffer.getWrappedRangeForLine(t),this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},t=h;function h(t,e){this._terminal=t,this._charMeasure=e,this._enabled=!0,this._workCell=new a.CellData,this._onLinuxMouseSelection=new l.EventEmitter2,this._onRedrawRequest=new l.EventEmitter2,this._onSelectionChange=new l.EventEmitter2,this._initListeners(),this.enable(),this._model=new o.SelectionModel(t),this._activeSelectionMode=0}n.SelectionManager=t},{"./MouseHelper":11,"./SelectionModel":14,"./common/EventEmitter2":23,"./common/Platform":25,"./core/buffer/BufferLine":29,"./handlers/AltClickHandler":35}],14:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(i.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._terminal.cols,this._terminal.buffer.ybase+this._terminal.rows-1];if(!this.selectionStart)return null;if(this.selectionEnd&&!this.areSelectionValuesReversed())return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd;var t=this.selectionStart[0]+this.selectionStartLength;return t>this._terminal.cols?[t%this._terminal.cols,this.selectionStart[1]+Math.floor(t/this._terminal.cols)]:[t,this.selectionStart[1]]},enumerable:!0,configurable:!0}),i.prototype.areSelectionValuesReversed=function(){var t=this.selectionStart,e=this.selectionEnd;return!(!t||!e)&&(t[1]>e[1]||t[1]===e[1]&&t[0]>e[0])},i.prototype.onTrim=function(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},i);function i(t){this._terminal=t,this.clearSelection()}n.SelectionModel=r},{}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_BELL_SOUND="data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==";var r=(Object.defineProperty(i,"audioContext",{get:function(){if(!i._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;i._audioContext=new t}return i._audioContext},enumerable:!0,configurable:!0}),i.prototype.playBellSound=function(){var t,e=i.audioContext;e&&(t=e.createBufferSource(),e.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),(function(n){t.buffer=n,t.connect(e.destination),t.start(0)})))},i.prototype._base64ToArrayBuffer=function(t){for(var e=window.atob(t),n=e.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=e.charCodeAt(i);return r.buffer},i.prototype._removeMimeType=function(t){return t.split(",")[1]},i);function i(t){this._terminal=t}n.SoundManager=r},{}],16:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.blankLine="Blank line",n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},{}],17:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./BufferSet"),a=t("./Buffer"),l=t("./CompositionHelper"),c=t("./common/EventEmitter"),h=t("./Viewport"),u=t("./Clipboard"),f=t("./common/data/EscapeSequences"),p=t("./InputHandler"),d=t("./renderer/Renderer"),_=t("./Linkifier"),m=t("./SelectionManager"),g=t("./CharMeasure"),y=t("./common/Platform"),C=t("./ui/Lifecycle"),b=t("./Strings"),v=t("./MouseHelper"),w=t("./SoundManager"),S=t("./MouseZoneManager"),E=t("./AccessibilityManager"),A=t("./renderer/atlas/CharAtlasCache"),x=t("./renderer/dom/DomRenderer"),k=t("./core/input/Keyboard"),L=t("./common/Clone"),T=t("./common/EventEmitter2"),R=t("./core/buffer/BufferLine"),M=t("./WindowsMode"),D=t("./ui/ColorManager"),B=t("./renderer/RenderCoordinator"),O="undefined"!=typeof window?window.document:null,F=["cols","rows"],P={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:w.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,enableBold:!0,experimentalCharAtlas:"static",fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,scrollback:1e3,screenKeys:!1,screenReaderMode:!1,debug:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:void 0,rightClickSelectsWord:y.isMac,rendererType:"canvas",windowsMode:!1};i(H,o=c.EventEmitter),Object.defineProperty(H.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),H.prototype.dispose=function(){o.prototype.dispose.call(this),this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0),this._customKeyEventHandler=null,A.removeTerminalFromCache(this),this.handler=function(){},this.write=function(){},this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)},H.prototype.destroy=function(){this.dispose()},H.prototype._setup=function(){var t=this;Object.keys(P).forEach((function(e){null!==t.options[e]&&void 0!==t.options[e]||(t.options[e]=P[e])})),this._parent=O?O.body:null,this.cols=Math.max(this.options.cols,2),this.rows=Math.max(this.options.rows,1),this.options.handler&&this.onData(this.options.handler),this.cursorState=0,this.cursorHidden=!1,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.curAttrData=R.DEFAULT_ATTR_DATA.clone(),this._eraseAttrData=R.DEFAULT_ATTR_DATA.clone(),this.params=[],this.currentParam=0,this.writeBuffer=[],this.writeBufferUtf8=[],this._writeInProgress=!1,this._xoffSentToCatchUp=!1,this._userScrolling=!1,this._inputHandler=new p.InputHandler(this),this._inputHandler.onCursorMove((function(){return t._onCursorMove.fire()})),this._inputHandler.onLineFeed((function(){return t._onLineFeed.fire()})),this._inputHandler.onData((function(e){return t._onData.fire(e)})),this.register(this._inputHandler),this.selectionManager=this.selectionManager||null,this.linkifier=this.linkifier||new _.Linkifier(this),this._mouseZoneManager=this._mouseZoneManager||null,this.soundManager=this.soundManager||new w.SoundManager(this),this.buffers=new s.BufferSet(this),this.selectionManager&&(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners()),this.options.windowsMode&&(this._windowsMode=M.applyWindowsMode(this))},Object.defineProperty(H.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),H.prototype.eraseAttrData=function(){return this._eraseAttrData.bg&=-67108864,this._eraseAttrData.bg|=67108863&this.curAttrData.bg,this._eraseAttrData},H.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},Object.defineProperty(H.prototype,"isFocused",{get:function(){return O.activeElement===this.textarea&&O.hasFocus()},enumerable:!0,configurable:!0}),H.prototype.getOption=function(t){if(!(t in P))throw new Error('No option with key "'+t+'"');return this.options[t]},H.prototype.setOption=function(t,e){if(!(t in P))throw new Error('No option with key "'+t+'"');if(-1!==F.indexOf(t)&&console.error('Option "'+t+'" can only be set in the constructor'),this.options[t]!==e){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"rendererType":e=e||"canvas";break;case"tabStopWidth":if(e<1)return void console.warn(t+" cannot be less than 1, value: "+e);break;case"theme":this._setTheme(e);break;case"scrollback":if((e=Math.min(e,a.MAX_BUFFER_SIZE))<0)return void console.warn(t+" cannot be less than 0, value: "+e);var n,r;this.options[t]!==e&&(r=this.rows+e,this.buffer.lines.length>r&&(n=this.buffer.lines.length-r,r=this.buffer.ydisp-n<0,this.buffer.lines.trimStart(n),this.buffer.ybase=Math.max(this.buffer.ybase-n,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-n,0),r&&this.refresh(0,this.rows-1)))}switch(this.options[t]=e,t){case"fontFamily":case"fontSize":this._renderCoordinator&&(this._renderCoordinator.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this._renderCoordinator&&(this._renderCoordinator.clear(),this._renderCoordinator.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderCoordinator&&this._renderCoordinator.setRenderer(this._createRenderer());break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":e?!this._accessibilityManager&&this._renderCoordinator&&(this._accessibilityManager=new E.AccessibilityManager(this,this._renderCoordinator.dimensions)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"windowsMode":e?this._windowsMode||(this._windowsMode=M.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this._renderCoordinator&&this._renderCoordinator.onOptionsChanged()}},H.prototype._onTextAreaFocus=function(t){this.sendFocus&&this.handler(f.C0.ESC+"[I"),this.updateCursorStyle(t),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},H.prototype.blur=function(){return this.textarea.blur()},H.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this.handler(f.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},H.prototype._initGlobal=function(){var t=this;function e(e){return u.pasteHandler(e,t)}this._bindKeys(),this.register(C.addDisposableDomListener(this.element,"copy",(function(e){t.hasSelection()&&u.copyHandler(e,t,t.selectionManager)}))),this.register(C.addDisposableDomListener(this.textarea,"paste",e)),this.register(C.addDisposableDomListener(this.element,"paste",e)),y.isFirefox?this.register(C.addDisposableDomListener(this.element,"mousedown",(function(e){2===e.button&&u.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)}))):this.register(C.addDisposableDomListener(this.element,"contextmenu",(function(e){u.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)}))),y.isLinux&&this.register(C.addDisposableDomListener(this.element,"auxclick",(function(e){1===e.button&&u.moveTextAreaUnderMouseCursor(e,t)})))},H.prototype._bindKeys=function(){var t=this,e=this;this.register(C.addDisposableDomListener(this.element,"keydown",(function(t){O.activeElement===this&&e._keyDown(t)}),!0)),this.register(C.addDisposableDomListener(this.element,"keypress",(function(t){O.activeElement===this&&e._keyPress(t)}),!0)),this.register(C.addDisposableDomListener(this.element,"keyup",(function(n){var r;16!==(r=n).keyCode&&17!==r.keyCode&&18!==r.keyCode&&t.focus(),e._keyUp(n)}),!0)),this.register(C.addDisposableDomListener(this.textarea,"keydown",(function(e){return t._keyDown(e)}),!0)),this.register(C.addDisposableDomListener(this.textarea,"keypress",(function(e){return t._keyPress(e)}),!0)),this.register(C.addDisposableDomListener(this.textarea,"compositionstart",(function(){return t._compositionHelper.compositionstart()}))),this.register(C.addDisposableDomListener(this.textarea,"compositionupdate",(function(e){return t._compositionHelper.compositionupdate(e)}))),this.register(C.addDisposableDomListener(this.textarea,"compositionend",(function(){return t._compositionHelper.compositionend()}))),this.register(this.onRender((function(){return t._compositionHelper.updateCompositionElements()}))),this.register(this.onRender((function(e){return t._queueLinkification(e.start,e.end)})))},H.prototype.open=function(t){var e=this;if(this._parent=t||this._parent,!this._parent)throw new Error("Terminal requires a parent element.");this._context=this._parent.ownerDocument.defaultView,this._document=this._parent.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),this._parent.appendChild(this.element),t=O.createDocumentFragment(),this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this._mouseZoneManager=new S.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll((function(){return e._mouseZoneManager.clearAll()}))),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(C.addDisposableDomListener(this.textarea,"focus",(function(t){return e._onTextAreaFocus(t)}))),this.register(C.addDisposableDomListener(this.textarea,"blur",(function(){return e._onTextAreaBlur()}))),this._helperContainer.appendChild(this.textarea),this._compositionView=O.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new l.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new g.CharMeasure(O,this._helperContainer),this.element.appendChild(t),this._theme=this.options.theme,this._colorManager=new D.ColorManager(O,this.options.allowTransparency),this._colorManager.setTheme(this._theme),t=this._createRenderer(),this._renderCoordinator=new B.RenderCoordinator(t,this.rows,this.screenElement),this._renderCoordinator.onRender((function(t){return e._onRender.fire(t)})),this.onResize((function(t){return e._renderCoordinator.resize(t.cols,t.rows)})),this.viewport=new h.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure,this._renderCoordinator.dimensions),this.viewport.onThemeChange(this._colorManager.colors),this.register(this.viewport),this.register(this.onCursorMove((function(){return e._renderCoordinator.onCursorMove()}))),this.register(this.onResize((function(){return e._renderCoordinator.onResize(e.cols,e.rows)}))),this.register(this.addDisposableListener("blur",(function(){return e._renderCoordinator.onBlur()}))),this.register(this.addDisposableListener("focus",(function(){return e._renderCoordinator.onFocus()}))),this.register(this.charMeasure.onCharSizeChanged((function(){return e._renderCoordinator.onCharSizeChanged()}))),this.register(this._renderCoordinator.onDimensionsChange((function(){return e.viewport.syncScrollArea()}))),this.selectionManager=new m.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange((function(){return e._onSelectionChange.fire()}))),this.register(C.addDisposableDomListener(this.element,"mousedown",(function(t){return e.selectionManager.onMouseDown(t)}))),this.register(this.selectionManager.onRedrawRequest((function(t){return e._renderCoordinator.onSelectionChanged(t.start,t.end,t.columnSelectMode)}))),this.register(this.selectionManager.onLinuxMouseSelection((function(t){e.textarea.value=t,e.textarea.focus(),e.textarea.select()}))),this.register(this.onScroll((function(){e.viewport.syncScrollArea(),e.selectionManager.refresh()}))),this.register(C.addDisposableDomListener(this._viewportElement,"scroll",(function(){return e.selectionManager.refresh()}))),this.mouseHelper=new v.MouseHelper(this._renderCoordinator),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new E.AccessibilityManager(this,this._renderCoordinator.dimensions),this._accessibilityManager.register(this._renderCoordinator.onDimensionsChange((function(t){return e._accessibilityManager.setDimensions(t)})))),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},H.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return new d.Renderer(this,this._colorManager.colors);case"dom":return new x.DomRenderer(this,this._colorManager.colors);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},H.prototype._setTheme=function(t){this._theme=t,this._colorManager&&this._colorManager.setTheme(t),this._renderCoordinator&&this._renderCoordinator.setColors(this._colorManager.colors),this.viewport&&this.viewport.onThemeChange(this._colorManager.colors)},H.prototype.bindMouse=function(){var t=this,e=this.element,n=this,r=32;function i(t){var e=function(t){var e,r,i;switch(t.overrideType||t.type){case"mousedown":e=null!==t.button&&void 0!==t.button?+t.button:null!==t.which&&void 0!==t.which?t.which-1:null,y.isMSIE&&(e=1===e?0:4===e?1:e);break;case"mouseup":e=3;break;case"DOMMouseScroll":e=t.detail<0?64:65;break;case"wheel":e=t.deltaY<0?64:65}return i=(t.shiftKey?4:0)|(i=t.metaKey?8:0)|(r=t.ctrlKey?16:0),n.vt200Mouse?i&=r:n.normalMouse||(i=0),32+(i<<2)+e}(t),i=n.mouseHelper.getRawByteCoords(t,n.screenElement,n.charMeasure,n.cols,n.rows);if(i)switch(s(e,i),t.overrideType||t.type){case"mousedown":r=e;break;case"mouseup":r=32}}function o(t,e){n.utfMouse?2047<e?t.push(2047):t.push(e):255!==e?t.push(e=127<e?127:e):t.push(0)}function s(t,e){if(n._vt300Mouse){t&=3,e.x-=32,e.y-=32;var r=f.C0.ESC+"[24";if(0===t)r+="1";else if(1===t)r+="3";else if(2===t)r+="5";else{if(3===t)return;r+="0"}return r+="~["+e.x+","+e.y+"]\r",void n.handler(r)}return n._decLocator?(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 n.handler(f.C0.ESC+"["+t+";"+(3===t?4:0)+";"+e.y+";"+e.x+";"+e.page||"0&w")):n.urxvtMouse?(e.x-=32,e.y-=32,e.x++,e.y++,void n.handler(f.C0.ESC+"["+t+";"+e.x+";"+e.y+"M")):n.sgrMouse?(e.x-=32,e.y-=32,void n.handler(f.C0.ESC+"[<"+((3==(3&t)?-4&t:t)-32)+";"+e.x+";"+e.y+(3==(3&t)?"m":"M"))):(o(r=[],t),o(r,e.x),o(r,e.y),void n.handler(f.C0.ESC+"[M"+String.fromCharCode.apply(String,r)))}this.register(C.addDisposableDomListener(e,"mousedown",(function(e){if(e.preventDefault(),t.focus(),t.mouseEvents&&!t.selectionManager.shouldForceSelection(e)){if(i(e),t.vt200Mouse)return e.overrideType="mouseup",i(e),t.cancel(e);var o;t.normalMouse&&t._document.addEventListener("mousemove",o=function(e){var i,o;t.normalMouse&&(e,o=r,(i=n.mouseHelper.getRawByteCoords(e,n.screenElement,n.charMeasure,n.cols,n.rows))&&s(o+=32,i))});var a=function(e){return t.normalMouse&&!t.x10Mouse&&i(e),o&&(t._document.removeEventListener("mousemove",o),o=null),t._document.removeEventListener("mouseup",a),t.cancel(e)};return t._document.addEventListener("mouseup",a),t.cancel(e)}}))),this.register(C.addDisposableDomListener(e,"wheel",(function(e){if(t.mouseEvents)t.x10Mouse||t._vt300Mouse||t._decLocator||(i(e),e.preventDefault());else if(!t.buffer.hasScrollback){var n=t.viewport.getLinesScrolled(e);if(0===n)return;for(var r=f.C0.ESC+(t.applicationCursor?"O":"[")+(e.deltaY<0?"A":"B"),o="",s=0;s<Math.abs(n);s++)o+=r;t.handler(o)}}))),this.register(C.addDisposableDomListener(e,"wheel",(function(e){if(!t.mouseEvents)return t.viewport.onWheel(e),t.cancel(e)}))),this.register(C.addDisposableDomListener(e,"touchstart",(function(e){if(!t.mouseEvents)return t.viewport.onTouchStart(e),t.cancel(e)}))),this.register(C.addDisposableDomListener(e,"touchmove",(function(e){if(!t.mouseEvents)return t.viewport.onTouchMove(e),t.cancel(e)})))},H.prototype.refresh=function(t,e){this._renderCoordinator&&this._renderCoordinator.refreshRows(t,e)},H.prototype._queueLinkification=function(t,e){this.linkifier&&this.linkifier.linkifyRows(t,e)},H.prototype.updateCursorStyle=function(t){this.selectionManager&&this.selectionManager.shouldColumnSelect(t)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},H.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))},H.prototype.scroll=function(t){void 0===t&&(t=!1);var e=this._blankLine,n=this.eraseAttrData();e&&e.length===this.cols&&e.getFg(0)===n.fg&&e.getBg(0)===n.bg||(e=this.buffer.getBlankLine(n,t),this._blankLine=e),e.isWrapped=t;var r=this.buffer.ybase+this.buffer.scrollTop;n=this.buffer.ybase+this.buffer.scrollBottom;0===this.buffer.scrollTop?(t=this.buffer.lines.isFull,n===this.buffer.lines.length-1?t?this.buffer.lines.recycle().copyFrom(e):this.buffer.lines.push(e.clone()):this.buffer.lines.splice(n+1,0,e.clone()),t?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)):(this.buffer.lines.shiftElements(r+1,n-r+1-1,-1),this.buffer.lines.set(n,e.clone())),this._userScrolling||(this.buffer.ydisp=this.buffer.ybase),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom),this._onScroll.fire(this.buffer.ydisp)},H.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 n=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+t,this.buffer.ybase),0),n!==this.buffer.ydisp&&(e||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},H.prototype.scrollPages=function(t){this.scrollLines(t*(this.rows-1))},H.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},H.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},H.prototype.scrollToLine=function(t){0!=(t-=this.buffer.ydisp)&&this.scrollLines(t)},H.prototype.writeUtf8=function(t){var e=this;this._isDisposed||t&&(this.writeBufferUtf8.push(t),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBufferUtf8.length&&(this.handler(f.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0<this.writeBufferUtf8.length&&(this._writeInProgress=!0,setTimeout((function(){e._innerWriteUtf8()}))))},H.prototype._innerWriteUtf8=function(t){var e=this;void 0===t&&(t=0),this._isDisposed&&(this.writeBufferUtf8=[]);for(var n=Date.now();this.writeBufferUtf8.length>t;){var r=this.writeBufferUtf8[t];if(t++,this._xoffSentToCatchUp&&this.writeBufferUtf8.length===t&&(this.handler(f.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parseUtf8(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),12<=Date.now()-n)break}this.writeBufferUtf8.length>t?(50<t&&(this.writeBufferUtf8=this.writeBufferUtf8.slice(t),t=0),setTimeout((function(){return e._innerWriteUtf8(t)}),0)):(this._writeInProgress=!1,this.writeBufferUtf8=[])},H.prototype.write=function(t){var e=this;this._isDisposed||t&&(this.writeBuffer.push(t),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBuffer.length&&(this.handler(f.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0<this.writeBuffer.length&&(this._writeInProgress=!0,setTimeout((function(){e._innerWrite()}))))},H.prototype._innerWrite=function(t){var e=this;void 0===t&&(t=0),this._isDisposed&&(this.writeBuffer=[]);for(var n=Date.now();this.writeBuffer.length>t;){var r=this.writeBuffer[t];if(t++,this._xoffSentToCatchUp&&this.writeBuffer.length===t&&(this.handler(f.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),12<=Date.now()-n)break}this.writeBuffer.length>t?(50<t&&(this.writeBuffer=this.writeBuffer.slice(t),t=0),setTimeout((function(){return e._innerWrite(t)}),0)):(this._writeInProgress=!1,this.writeBuffer=[])},H.prototype.writeln=function(t){this.write(t+"\r\n")},H.prototype.attachCustomKeyEventHandler=function(t){this._customKeyEventHandler=t},H.prototype.addCsiHandler=function(t,e){return this._inputHandler.addCsiHandler(t,e)},H.prototype.addOscHandler=function(t,e){return this._inputHandler.addOscHandler(t,e)},H.prototype.registerLinkMatcher=function(t,e,n){return n=this.linkifier.registerLinkMatcher(t,e,n),this.refresh(0,this.rows-1),n},H.prototype.deregisterLinkMatcher=function(t){this.linkifier.deregisterLinkMatcher(t)&&this.refresh(0,this.rows-1)},H.prototype.registerCharacterJoiner=function(t){return t=this._renderCoordinator.registerCharacterJoiner(t),this.refresh(0,this.rows-1),t},H.prototype.deregisterCharacterJoiner=function(t){this._renderCoordinator.deregisterCharacterJoiner(t)&&this.refresh(0,this.rows-1)},Object.defineProperty(H.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),H.prototype.addMarker=function(t){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+t)},H.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},H.prototype.select=function(t,e,n){this.selectionManager.setSelection(t,e,n)},H.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},H.prototype.getSelectionPosition=function(){if(this.selectionManager.hasSelection)return{startColumn:this.selectionManager.selectionStart[0],startRow:this.selectionManager.selectionStart[1],endColumn:this.selectionManager.selectionEnd[0],endRow:this.selectionManager.selectionEnd[1]}},H.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},H.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},H.prototype.selectLines=function(t,e){this.selectionManager&&this.selectionManager.selectLines(t,e)},H.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=k.evaluateKeyboardEvent(t,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(t),3!==e.type&&2!==e.type)return 1===e.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,t)||(e.cancel&&this.cancel(t,!0),!e.key||(this.emit("keydown",t),this._onKey.fire({key:e.key,domEvent:t}),this.showCursor(),this.handler(e.key),this.cancel(t,!0)));var n=this.rows-1;return this.scrollLines(2===e.type?-n:n),this.cancel(t,!0)},H.prototype._isThirdLevelShift=function(t,e){return t=t.isMac&&!this.options.macOptionIsMeta&&e.altKey&&!e.ctrlKey&&!e.metaKey||t.isMSWindows&&e.altKey&&e.ctrlKey&&!e.metaKey,"keypress"===e.type?t:t&&(!e.keyCode||47<e.keyCode)},H.prototype.setgLevel=function(t){this.glevel=t,this.charset=this.charsets[t]},H.prototype.setgCharset=function(t,e){this.charsets[t]=e,this.glevel===t&&(this.charset=e)},H.prototype._keyUp=function(t){this.updateCursorStyle(t)},H.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||void 0===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._onKey.fire({key:e,domEvent:t}),this.showCursor(),this.handler(e),0))},H.prototype.bell=function(){var t=this;this.emit("bell"),this._soundBell()&&this.soundManager.playBellSound(),this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout((function(){t.element.classList.remove("visual-bell-active")}),200))},H.prototype.log=function(t,e){this.options.debug&&this._context.console&&this._context.console.log&&this._context.console.log(t,e)},H.prototype.error=function(t,e){this.options.debug&&this._context.console&&this._context.console.error&&this._context.console.error(t,e)},H.prototype.resize=function(t,e){isNaN(t)||isNaN(e)||(t!==this.cols||e!==this.rows?(this.buffers.resize(t=t<2?2:t,e=e<1?1:e),this.cols=t,this.rows=e,this.buffers.setupTabStops(this.cols),this.charMeasure&&this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._onResize.fire({cols:t,rows:e})):!this.charMeasure||this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options))},H.prototype.updateRange=function(t){t<this._refreshStart&&(this._refreshStart=t),t>this._refreshEnd&&(this._refreshEnd=t)},H.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},H.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var t=1;t<this.rows;t++)this.buffer.lines.push(this.buffer.getBlankLine(R.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},H.prototype.is=function(t){return 0===(this.options.termName+"").indexOf(t)},H.prototype.handler=function(t){this.options.disableStdin||(this.selectionManager&&this.selectionManager.hasSelection&&this.selectionManager.clearSelection(),this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),this._onData.fire(t))},H.prototype.handleTitle=function(t){this._onTitleChange.fire(t)},H.prototype.index=function(){this.buffer.y++,this.buffer.y>this.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},H.prototype.reverseIndex=function(){var t;this.buffer.y===this.buffer.scrollTop?(t=this.buffer.scrollBottom-this.buffer.scrollTop,this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,t,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)):this.buffer.y--},H.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var t=this._customKeyEventHandler,e=this._inputHandler,n=this.cursorState,r=this.writeBuffer,i=this.writeBufferUtf8,o=this._writeInProgress,s=this._xoffSentToCatchUp,a=this._userScrolling;this._setup(),this._customKeyEventHandler=t,this._inputHandler=e,this.cursorState=n,this.writeBuffer=r,this.writeBufferUtf8=i,this._writeInProgress=o,this._xoffSentToCatchUp=s,this._userScrolling=a,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},H.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},H.prototype.cancel=function(t,e){if(this.options.cancelEvents||e)return t.preventDefault(),t.stopPropagation(),!1},H.prototype._visualBell=function(){return!1},H.prototype._soundBell=function(){return"sound"===this.options.bellStyle},i=H;function H(t){void 0===t&&(t={});var e=o.call(this)||this;return e.browser=y,e._blankLine=null,e._onCursorMove=new T.EventEmitter2,e._onData=new T.EventEmitter2,e._onKey=new T.EventEmitter2,e._onLineFeed=new T.EventEmitter2,e._onRender=new T.EventEmitter2,e._onResize=new T.EventEmitter2,e._onScroll=new T.EventEmitter2,e._onSelectionChange=new T.EventEmitter2,e._onTitleChange=new T.EventEmitter2,e.options=L.clone(t),e._setup(),e.onCursorMove((function(){return e.emit("cursormove")})),e.onData((function(t){return e.emit("data",t)})),e.onKey((function(t){return e.emit("key",t.key,t.domEvent)})),e.onLineFeed((function(){return e.emit("linefeed")})),e.onRender((function(t){return e.emit("refresh",t)})),e.onResize((function(t){return e.emit("resize",t)})),e.onSelectionChange((function(){return e.emit("selection")})),e.onScroll((function(t){return e.emit("scroll",t)})),e.onTitleChange((function(t){return e.emit("title",t)})),e}n.Terminal=i},{"./AccessibilityManager":1,"./Buffer":2,"./BufferSet":3,"./CharMeasure":4,"./Clipboard":6,"./CompositionHelper":7,"./InputHandler":9,"./Linkifier":10,"./MouseHelper":11,"./MouseZoneManager":12,"./SelectionManager":13,"./SoundManager":15,"./Strings":16,"./Viewport":18,"./WindowsMode":19,"./common/Clone":21,"./common/EventEmitter":22,"./common/EventEmitter2":23,"./common/Platform":25,"./common/data/EscapeSequences":28,"./core/buffer/BufferLine":29,"./core/input/Keyboard":33,"./renderer/RenderCoordinator":43,"./renderer/Renderer":44,"./renderer/atlas/CharAtlasCache":48,"./renderer/dom/DomRenderer":56,"./ui/ColorManager":58,"./ui/Lifecycle":59}],18:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./common/Lifecycle"),a=t("./ui/Lifecycle");i(l,o=s.Disposable),l.prototype.onDimensionsChance=function(t){this._dimensions=t},l.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},l.prototype._refresh=function(){var t=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},l.prototype._innerRefresh=function(){0<this._charMeasure.height&&(this._currentRowHeight=this._dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight,t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._dimensions.canvasHeight),this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px"));var t=this._terminal.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},l.prototype.syncScrollArea=function(){if(this._lastRecordedBufferLength!==this._terminal.buffer.lines.length)return this._lastRecordedBufferLength=this._terminal.buffer.lines.length,void this._refresh();var t;this._lastRecordedViewportHeight===this._dimensions.canvasHeight?(t=this._terminal.buffer.ydisp*this._currentRowHeight,this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh()):this._refresh()},l.prototype._onScroll=function(t){var e;this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent&&(this._ignoreNextScrollEvent?this._ignoreNextScrollEvent=!1:(e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._terminal.buffer.ydisp,this._terminal.scrollLines(e,!0)))},l.prototype.onWheel=function(t){var e=this._getPixelsScrolled(t);0!==e&&(this._viewportElement.scrollTop+=e,t.preventDefault())},l.prototype._getPixelsScrolled=function(t){if(0===t.deltaY)return 0;var e=t.deltaY;return t.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._currentRowHeight*this._terminal.rows),e},l.prototype.getLinesScrolled=function(t){if(0===t.deltaY)return 0;var e=t.deltaY;return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(0<this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._terminal.rows),e},l.prototype.onTouchStart=function(t){this._lastTouchY=t.touches[0].pageY},l.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())},i=l;function l(t,e,n,r,i){var s=o.call(this)||this;return s._terminal=t,s._viewportElement=e,s._scrollArea=n,s._charMeasure=r,s._dimensions=i,s.scrollBarWidth=0,s._currentRowHeight=0,s._lastRecordedBufferLength=0,s._lastRecordedViewportHeight=0,s._lastRecordedBufferHeight=0,s._lastScrollTop=0,s._wheelPartialScroll=0,s._refreshAnimationFrame=null,s._ignoreNextScrollEvent=!1,s.scrollBarWidth=s._viewportElement.offsetWidth-s._scrollArea.offsetWidth||15,s.register(a.addDisposableDomListener(s._viewportElement,"scroll",s._onScroll.bind(s))),setTimeout((function(){return s.syncScrollArea()}),0),s}n.Viewport=i},{"./common/Lifecycle":24,"./ui/Lifecycle":59}],19:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./core/buffer/BufferLine");n.applyWindowsMode=function(t){return t.onLineFeed((function(){var e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1).get(t.cols-1);t.buffer.lines.get(t.buffer.ybase+t.buffer.y).isWrapped=e[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&e[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE}))}},{"./core/buffer/BufferLine":29}],20:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./EventEmitter2");Object.defineProperty(i.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxLength",{get:function(){return this._maxLength},set:function(t){if(this._maxLength!==t){for(var e=new Array(t),n=0;n<Math.min(t,this.length);n++)e[n]=this._array[this._getCyclicIndex(n)];this._array=e,this._maxLength=t,this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"length",{get:function(){return this._length},set:function(t){if(t>this._length)for(var e=this._length;e<t;e++)this._array[e]=void 0;this._length=t},enumerable:!0,configurable:!0}),i.prototype.get=function(t){return this._array[this._getCyclicIndex(t)]},i.prototype.set=function(t,e){this._array[this._getCyclicIndex(t)]=e},i.prototype.push=function(t){this._array[this._getCyclicIndex(this._length)]=t,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},i.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(i.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),i.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},i.prototype.splice=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e){for(var i=t;i<this._length-e;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+e)];this._length-=e}for(i=this._length-1;t<=i;i--)this._array[this._getCyclicIndex(i+n.length)]=this._array[this._getCyclicIndex(i)];var o;for(i=0;i<n.length;i++)this._array[this._getCyclicIndex(t+i)]=n[i];this._length+n.length>this._maxLength?(o=this._length+n.length-this._maxLength,this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)):this._length+=n.length},i.prototype.trimStart=function(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)},i.prototype.shiftElements=function(t,e,n){if(!(e<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(0<n){for(var r=e-1;0<=r;r--)this.set(t+r+n,this.get(t+r));var i=t+e+n-this._length;if(0<i)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;r<e;r++)this.set(t+r+n,this.get(t+r))}},i.prototype._getCyclicIndex=function(t){return(this._startIndex+t)%this._maxLength},t=i;function i(t){this._maxLength=t,this.onDeleteEmitter=new r.EventEmitter2,this.onInsertEmitter=new r.EventEmitter2,this.onTrimEmitter=new r.EventEmitter2,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}n.CircularList=t},{"./EventEmitter2":23}],21:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.clone=function t(e,n){if(void 0===n&&(n=5),"object"!=typeof e)return e;if(null===e)return null;var r,i=Array.isArray(e)?[]:{};for(r in e)i[r]=n<=1?e[r]:t(e[r],n-1);return i}},{}],22:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o;t=t("./Lifecycle"),i(s,o=t.Disposable),s.prototype.on=function(t,e){this._events[t]=this._events[t]||[],this._events[t].push(e)},s.prototype.addDisposableListener=function(t,e){var n=this;this.on(t,e);var r=!1;return{dispose:function(){r||(n.off(t,e),r=!0)}}},s.prototype.off=function(t,e){if(this._events[t])for(var n=this._events[t],r=n.length;r--;)if(n[r]===e)return void n.splice(r,1)},s.prototype.removeAllListeners=function(t){this._events[t]&&delete this._events[t]},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(this._events[t])for(var r=this._events[t],i=0;i<r.length;i++)r[i].apply(this,e)},s.prototype.emitMayRemoveListeners=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(this._events[t])for(var r=this._events[t],i=r.length,o=0;o<r.length;o++)r[o].apply(this,e),o-=i-r.length,i=r.length},s.prototype.listeners=function(t){return this._events[t]||[]},s.prototype.dispose=function(){o.prototype.dispose.call(this),this._events={}},i=s;function s(){var t=o.call(this)||this;return t._events=t._events||{},t}n.EventEmitter=i},{"./Lifecycle":24}],23:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(Object.defineProperty(i.prototype,"event",{get:function(){var t=this;return this._event||(this._event=function(e){return t._listeners.push(e),{dispose:function(){for(var n=0;n<t._listeners.length;n++)if(t._listeners[n]===e)return void t._listeners.splice(n,1)}}}),this._event},enumerable:!0,configurable:!0}),i.prototype.fire=function(t){for(var e=[],n=0;n<this._listeners.length;n++)e.push(this._listeners[n]);for(n=0;n<e.length;n++)e[n].call(void 0,t)},i);function i(){this._listeners=[]}n.EventEmitter2=r},{}],24:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.dispose=function(){this._isDisposed=!0,this._disposables.forEach((function(t){return t.dispose()})),this._disposables.length=0},i.prototype.register=function(t){this._disposables.push(t)},i.prototype.unregister=function(t){-1!==(t=this._disposables.indexOf(t))&&this._disposables.splice(t,1)},i);function i(){this._disposables=[],this._isDisposed=!1}n.Disposable=r},{}],25:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i="undefined"==typeof navigator)?"node":navigator.userAgent,i=i?"node":navigator.platform;function o(t,e){return 0<=t.indexOf(e)}n.isFirefox=!!~r.indexOf("Firefox"),n.isSafari=/^((?!chrome|android).)*safari/i.test(r),n.isMSIE=!!~r.indexOf("MSIE")||!!~r.indexOf("Trident"),n.isMac=o(["Macintosh","MacIntel","MacPPC","Mac68K"],i),n.isIpad="iPad"===i,n.isIphone="iPhone"===i,n.isMSWindows=o(["Windows","Win16","Win32","WinCE"],i),n.isLinux=0<=i.indexOf("Linux")},{}],26:[function(t,e,n){"use strict";function r(t,e,n,r){if(void 0===r&&(r=t.length),(n=void 0===n?0:n)>=t.length)return t;n=(t.length+n)%t.length,r=r>=t.length?t.length:(t.length+r)%t.length;for(var i=n;i<r;++i)t[i]=e;return t}Object.defineProperty(n,"__esModule",{value:!0}),n.fill=function(t,e,n,i){return t.fill?t.fill(e,n,i):r(t,e,n,i)},n.fillFallback=r,n.concat=function(t,e){var n=new t.constructor(t.length+e.length);return n.set(t),n.set(e,t.length),n}},{}],27:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_COLOR=256},{}],28:[function(t,e,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0}),(r=n.C0||(n.C0={})).NUL="\0",r.SOH="",r.STX="",r.ETX="",r.EOT="",r.ENQ="",r.ACK="",r.BEL="",r.BS="\b",r.HT="\t",r.LF="\n",r.VT="\v",r.FF="\f",r.CR="\r",r.SO="",r.SI="",r.DLE="",r.DC1="",r.DC2="",r.DC3="",r.DC4="",r.NAK="",r.SYN="",r.ETB="",r.CAN="",r.EM="",r.SUB="",r.ESC="",r.FS="",r.GS="",r.RS="",r.US="",r.SP=" ",r.DEL="",(n=n.C1||(n.C1={})).PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"},{}],29:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("../input/TextDecoder");t=t("../../common/Types");function s(){this.fg=0,this.bg=0}n.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32,s.toColorRGB=function(t){return[t>>>16&255,t>>>8&255,255&t]},s.fromColorRGB=function(t){return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},s.prototype.clone=function(){var t=new s;return t.fg=this.fg,t.bg=this.bg,t},s.prototype.isInverse=function(){return 67108864&this.fg},s.prototype.isBold=function(){return 134217728&this.fg},s.prototype.isUnderline=function(){return 268435456&this.fg},s.prototype.isBlink=function(){return 536870912&this.fg},s.prototype.isInvisible=function(){return 1073741824&this.fg},s.prototype.isItalic=function(){return 67108864&this.bg},s.prototype.isDim=function(){return 134217728&this.bg},s.prototype.getFgColorMode=function(){return 50331648&this.fg},s.prototype.getBgColorMode=function(){return 50331648&this.bg},s.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},s.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},s.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},s.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},s.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},s.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},s.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},s.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},t=s,n.AttributeData=t,n.DEFAULT_ATTR_DATA=Object.freeze(new t);var a,l=(i(c,a=t),c.fromCharData=function(t){var e=new c;return e.setFromCharData(t),e},c.prototype.isCombined=function(){return 2097152&this.content},c.prototype.getWidth=function(){return this.content>>22},c.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?o.stringFromCodePoint(2097151&this.content):""},c.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},c.prototype.setFromCharData=function(t){this.fg=t[n.CHAR_DATA_ATTR_INDEX],this.bg=0;var e,r,i=!1;2<t[n.CHAR_DATA_CHAR_INDEX].length?i=!0:2===t[n.CHAR_DATA_CHAR_INDEX].length?55296<=(e=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0))&&e<=56319&&56320<=(r=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(1))&&r<=57343?this.content=1024*(e-55296)+r-56320+65536|t[n.CHAR_DATA_WIDTH_INDEX]<<22:i=!0:this.content=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22,i&&(this.combinedData=t[n.CHAR_DATA_CHAR_INDEX],this.content=2097152|t[n.CHAR_DATA_WIDTH_INDEX]<<22)},c.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},c);function c(){var t=null!==a&&a.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.combinedData="",t}function h(t,e,r){this.isWrapped=r=void 0!==r&&r,this._combined={},this._data=new Uint32Array(3*t);for(var i=e||l.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),o=0;o<t;++o)this.setCell(o,i);this.length=t}n.CellData=l,h.prototype.get=function(t){var e=this._data[3*t+0],n=2097151&e;return[this._data[3*t+1],2097152&e?this._combined[t]:n?o.stringFromCodePoint(n):"",e>>22,2097152&e?this._combined[t].charCodeAt(this._combined[t].length-1):n]},h.prototype.set=function(t,e){this._data[3*t+1]=e[n.CHAR_DATA_ATTR_INDEX],1<e[n.CHAR_DATA_CHAR_INDEX].length?(this._combined[t]=e[1],this._data[3*t+0]=2097152|t|e[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=e[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[n.CHAR_DATA_WIDTH_INDEX]<<22},h.prototype.getWidth=function(t){return this._data[3*t+0]>>22},h.prototype.hasWidth=function(t){return 12582912&this._data[3*t+0]},h.prototype.getFg=function(t){return this._data[3*t+1]},h.prototype.getBg=function(t){return this._data[3*t+2]},h.prototype.hasContent=function(t){return 4194303&this._data[3*t+0]},h.prototype.getCodePoint=function(t){var e=this._data[3*t+0];return 2097152&e?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&e},h.prototype.isCombined=function(t){return 2097152&this._data[3*t+0]},h.prototype.getString=function(t){var e=this._data[3*t+0];return 2097152&e?this._combined[t]:2097151&e?o.stringFromCodePoint(2097151&e):""},h.prototype.loadCell=function(t,e){var n=3*t;return e.content=this._data[0+n],e.fg=this._data[1+n],e.bg=this._data[2+n],2097152&e.content&&(e.combinedData=this._combined[t]),e},h.prototype.setCell=function(t,e){2097152&e.content&&(this._combined[t]=e.combinedData),this._data[3*t+0]=e.content,this._data[3*t+1]=e.fg,this._data[3*t+2]=e.bg},h.prototype.setCellFromCodePoint=function(t,e,n,r,i){this._data[3*t+0]=e|n<<22,this._data[3*t+1]=r,this._data[3*t+2]=i},h.prototype.addCodepointToCell=function(t,e){var n=this._data[3*t+0];2097152&n?this._combined[t]+=o.stringFromCodePoint(e):(2097151&n?(this._combined[t]=o.stringFromCodePoint(2097151&n)+o.stringFromCodePoint(e),n&=-2097152,n|=2097152):n=e|1<<22,this._data[3*t+0]=n)},h.prototype.insertCells=function(t,e,n){if(t%=this.length,e<this.length-t){for(var r=new l,i=this.length-t-e-1;0<=i;--i)this.setCell(t+e+i,this.loadCell(t+i,r));for(i=0;i<e;++i)this.setCell(t+i,n)}else for(i=t;i<this.length;++i)this.setCell(i,n)},h.prototype.deleteCells=function(t,e,n){if(t%=this.length,e<this.length-t){for(var r=new l,i=0;i<this.length-t-e;++i)this.setCell(t+i,this.loadCell(t+e+i,r));for(i=this.length-e;i<this.length;++i)this.setCell(i,n)}else for(i=t;i<this.length;++i)this.setCell(i,n)},h.prototype.replaceCells=function(t,e,n){for(;t<e&&t<this.length;)this.setCell(t++,n)},h.prototype.resize=function(t,e){if(t!==this.length){if(t>this.length){var n=new Uint32Array(3*t);this.length&&(3*t<this._data.length?n.set(this._data.subarray(0,3*t)):n.set(this._data)),this._data=n;for(var r=this.length;r<t;++r)this.setCell(r,e)}else if(t){(n=new Uint32Array(3*t)).set(this._data.subarray(0,3*t)),this._data=n;var i=Object.keys(this._combined);for(r=0;r<i.length;r++){var o=parseInt(i[r],10);t<=o&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=t}},h.prototype.fill=function(t){this._combined={};for(var e=0;e<this.length;++e)this.setCell(e,t)},h.prototype.copyFrom=function(t){for(var e in this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={},t._combined)this._combined[e]=t._combined[e];this.isWrapped=t.isWrapped},h.prototype.clone=function(){var t,e=new h(0);for(t in e._data=new Uint32Array(this._data),e.length=this.length,this._combined)e._combined[t]=this._combined[t];return e.isWrapped=this.isWrapped,e},h.prototype.getTrimmedLength=function(){for(var t=this.length-1;0<=t;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0},h.prototype.copyCellsFrom=function(t,e,n,r,i){var o=t._data;if(i)for(var s=r-1;0<=s;s--)for(var a=0;a<3;a++)this._data[3*(n+s)+a]=o[3*(e+s)+a];else for(s=0;s<r;s++)for(a=0;a<3;a++)this._data[3*(n+s)+a]=o[3*(e+s)+a];var l=Object.keys(t._combined);for(a=0;a<l.length;a++){var c=parseInt(l[a],10);e<=c&&(this._combined[c-e+n]=t._combined[c])}},h.prototype.translateToString=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=this.length),(t=void 0!==t&&t)&&(r=Math.min(r,this.getTrimmedLength()));for(var i="";e<r;){var s=this._data[3*e+0],a=2097151&s;i+=2097152&s?this._combined[e]:a?o.stringFromCodePoint(a):n.WHITESPACE_CELL_CHAR,e+=s>>22||1}return i},t=h,n.BufferLine=t},{"../../common/Types":27,"../input/TextDecoder":34}],30:[function(t,e,n){"use strict";function r(t,e,n){if(e===t.length-1)return t[e].getTrimmedLength();var r=!t[e].hasContent(n-1)&&1===t[e].getWidth(n-1);e=2===t[e+1].getWidth(0);return r&&e?n-1:n}Object.defineProperty(n,"__esModule",{value:!0}),n.reflowLargerGetLinesToRemove=function(t,e,n,i,o){for(var s=[],a=0;a<t.length-1;a++){var l=a,c=t.get(++l);if(c.isWrapped){for(var h=[t.get(a)];l<t.length&&c.isWrapped;)h.push(c),c=t.get(++l);if(a<=i&&i<l)a+=h.length-1;else{for(var u=0,f=r(h,u,e),p=1,d=0;p<h.length;){var _=r(h,p,e),m=Math.min(_-d,n-f);h[u].copyCellsFrom(h[p],d,f,m,!1),(f+=m)===n&&(u++,f=0),(d+=m)===_&&(p++,d=0),0===f&&0!==u&&2===h[u-1].getWidth(n-1)&&(h[u].copyCellsFrom(h[u-1],n-1,f++,1,!1),h[u-1].setCell(n-1,o))}h[u].replaceCells(f,n,o);for(var g=0,y=h.length-1;0<y&&(u<y||0===h[y].getTrimmedLength());y--)g++;0<g&&(s.push(a+h.length-g),s.push(g)),a+=h.length-1}}}return s},n.reflowLargerCreateNewLayout=function(t,e){for(var n,r=[],i=0,o=e[i],s=0,a=0;a<t.length;a++)o===a?(n=e[++i],t.onDeleteEmitter.fire({index:a-s,amount:n}),a+=n-1,s+=n,o=e[++i]):r.push(a);return{layout:r,countRemoved:s}},n.reflowLargerApplyNewLayout=function(t,e){for(var n=[],r=0;r<e.length;r++)n.push(t.get(e[r]));for(r=0;r<n.length;r++)t.set(r,n[r]);t.length=e.length},n.reflowSmallerGetNewLineLengths=function(t,e,n){for(var i=[],o=t.map((function(n,i){return r(t,i,e)})).reduce((function(t,e){return t+e})),s=0,a=0,l=0;l<o;){if(o-l<n){i.push(o-l);break}s+=n;var c=r(t,a,e);c<s&&(s-=c,a++),(c=2===t[a].getWidth(s-1))&&s--,c=c?n-1:n,i.push(c),l+=c}return i},n.getWrappedLineTrimmedLength=r},{}],31:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("../../common/EventEmitter2");t=t("../../common/Lifecycle"),i(a,o=t.Disposable),Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),a.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._onDispose.fire())},a._nextId=1,i=a;function a(t){var e=o.call(this)||this;return e.line=t,e._id=a._nextId++,e.isDisposed=!1,e._onDispose=new s.EventEmitter2,e}n.Marker=i},{"../../common/EventEmitter2":23,"../../common/Lifecycle":24}],32:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=null,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},{}],33:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../../common/data/EscapeSequences"),i={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(t,e,n,o){var s,a={type:0,cancel:!1,key:void 0},l=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:"UIKeyInputUpArrow"===t.key?a.key=e?r.C0.ESC+"OA":r.C0.ESC+"[A":"UIKeyInputLeftArrow"===t.key?a.key=e?r.C0.ESC+"OD":r.C0.ESC+"[D":"UIKeyInputRightArrow"===t.key?a.key=e?r.C0.ESC+"OC":r.C0.ESC+"[C":"UIKeyInputDownArrow"===t.key&&(a.key=e?r.C0.ESC+"OB":r.C0.ESC+"[B");break;case 8:if(t.shiftKey){a.key=r.C0.BS;break}if(t.altKey){a.key=r.C0.ESC+r.C0.DEL;break}a.key=r.C0.DEL;break;case 9:if(t.shiftKey){a.key=r.C0.ESC+"[Z";break}a.key=r.C0.HT,a.cancel=!0;break;case 13:a.key=r.C0.CR,a.cancel=!0;break;case 27:a.key=r.C0.ESC,a.cancel=!0;break;case 37:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"D",a.key===r.C0.ESC+"[1;3D"&&(a.key=n?r.C0.ESC+"b":r.C0.ESC+"[1;5D")):a.key=e?r.C0.ESC+"OD":r.C0.ESC+"[D";break;case 39:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"C",a.key===r.C0.ESC+"[1;3C"&&(a.key=n?r.C0.ESC+"f":r.C0.ESC+"[1;5C")):a.key=e?r.C0.ESC+"OC":r.C0.ESC+"[C";break;case 38:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"A",a.key===r.C0.ESC+"[1;3A"&&(a.key=r.C0.ESC+"[1;5A")):a.key=e?r.C0.ESC+"OA":r.C0.ESC+"[A";break;case 40:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"B",a.key===r.C0.ESC+"[1;3B"&&(a.key=r.C0.ESC+"[1;5B")):a.key=e?r.C0.ESC+"OB":r.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(a.key=r.C0.ESC+"[2~");break;case 46:a.key=l?r.C0.ESC+"[3;"+(1+l)+"~":r.C0.ESC+"[3~";break;case 36:a.key=l?r.C0.ESC+"[1;"+(1+l)+"H":e?r.C0.ESC+"OH":r.C0.ESC+"[H";break;case 35:a.key=l?r.C0.ESC+"[1;"+(1+l)+"F":e?r.C0.ESC+"OF":r.C0.ESC+"[F";break;case 33:t.shiftKey?a.type=2:a.key=r.C0.ESC+"[5~";break;case 34:t.shiftKey?a.type=3:a.key=r.C0.ESC+"[6~";break;case 112:a.key=l?r.C0.ESC+"[1;"+(1+l)+"P":r.C0.ESC+"OP";break;case 113:a.key=l?r.C0.ESC+"[1;"+(1+l)+"Q":r.C0.ESC+"OQ";break;case 114:a.key=l?r.C0.ESC+"[1;"+(1+l)+"R":r.C0.ESC+"OR";break;case 115:a.key=l?r.C0.ESC+"[1;"+(1+l)+"S":r.C0.ESC+"OS";break;case 116:a.key=l?r.C0.ESC+"[15;"+(1+l)+"~":r.C0.ESC+"[15~";break;case 117:a.key=l?r.C0.ESC+"[17;"+(1+l)+"~":r.C0.ESC+"[17~";break;case 118:a.key=l?r.C0.ESC+"[18;"+(1+l)+"~":r.C0.ESC+"[18~";break;case 119:a.key=l?r.C0.ESC+"[19;"+(1+l)+"~":r.C0.ESC+"[19~";break;case 120:a.key=l?r.C0.ESC+"[20;"+(1+l)+"~":r.C0.ESC+"[20~";break;case 121:a.key=l?r.C0.ESC+"[21;"+(1+l)+"~":r.C0.ESC+"[21~";break;case 122:a.key=l?r.C0.ESC+"[23;"+(1+l)+"~":r.C0.ESC+"[23~";break;case 123:a.key=l?r.C0.ESC+"[24;"+(1+l)+"~":r.C0.ESC+"[24~";break;default:!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?n&&!o||!t.altKey||t.metaKey?n&&!t.altKey&&!t.ctrlKey&&t.metaKey?65===t.keyCode&&(a.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&48<=t.keyCode&&1===t.key.length?a.key=t.key:t.key&&t.ctrlKey&&"_"===t.key&&(a.key=r.C0.US):(s=(s=i[t.keyCode])&&s[t.shiftKey?1:0])?a.key=r.C0.ESC+s:65<=t.keyCode&&t.keyCode<=90&&(s=t.ctrlKey?t.keyCode-64:t.keyCode+32,a.key=r.C0.ESC+String.fromCharCode(s)):65<=t.keyCode&&t.keyCode<=90?a.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?a.key=String.fromCharCode(0):51<=t.keyCode&&t.keyCode<=55?a.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?a.key=String.fromCharCode(127):219===t.keyCode?a.key=String.fromCharCode(27):220===t.keyCode?a.key=String.fromCharCode(28):221===t.keyCode&&(a.key=String.fromCharCode(29))}return a}},{"../../common/data/EscapeSequences":28}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.stringFromCodePoint=function(t){return 65535<t?(t-=65536,String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)},n.utf32ToString=function(t,e,n){void 0===n&&(n=t.length);for(var r="",i=e=void 0===e?0:e;i<n;++i){var o=t[i];65535<o?(o-=65536,r+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var r=(i.prototype.clear=function(){this._interim=0},i.prototype.decode=function(t,e){var n=t.length;if(!n)return 0;var r=0,i=0;this._interim&&(56320<=(s=t.charCodeAt(i++))&&s<=57343?e[r++]=1024*(this._interim-55296)+s-56320+65536:(e[r++]=this._interim,e[r++]=s),this._interim=0);for(var o=i;o<n;++o){var s,a=t.charCodeAt(o);if(55296<=a&&a<=56319){if(++o>=n)return this._interim=a,r;56320<=(s=t.charCodeAt(o))&&s<=57343?e[r++]=1024*(a-55296)+s-56320+65536:(e[r++]=a,e[r++]=s)}else e[r++]=a}return r},i);function i(){this._interim=0}function o(){this.interim=new Uint8Array(3)}n.StringToUtf32=r,o.prototype.clear=function(){this.interim.fill(0)},o.prototype.decode=function(t,e){var n=t.length;if(!n)return 0;var r,i,o,s,a=0,l=0,c=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,p=void 0;(p=63&this.interim[++f])&&f<4;)u<<=6,u|=p;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,_=d-f;c<_;){if(n<=c)return 0;if(128!=(192&(p=t[c++]))){c--,h=!0;break}u<<=6,u|=63&(this.interim[f++]=p)}h||(2==d?u<128?c--:e[a++]=u:3==d?u<2048||55296<=u&&u<=57343||(e[a++]=u):l<65536||1114111<l||(e[a++]=u)),this.interim.fill(0)}for(var m=n-4,g=c;g<n;){for(;!(!(g<m)||128&(r=t[g])||128&(i=t[g+1])||128&(o=t[g+2])||128&(s=t[g+3]));)e[a++]=r,e[a++]=i,e[a++]=o,e[a++]=s,g+=4;if((r=t[g++])<128)e[a++]=r;else if(192==(224&r)){if(n<=g)return this.interim[0]=r,a;128==(192&(i=t[g++]))?(l=(31&r)<<6|63&i)<128?g--:e[a++]=l:g--}else if(224==(240&r)){if(n<=g)return this.interim[0]=r,a;if(128==(192&(i=t[g++]))){if(n<=g)return this.interim[0]=r,this.interim[1]=i,a;128==(192&(o=t[g++]))?(l=(15&r)<<12|(63&i)<<6|63&o)<2048||55296<=l&&l<=57343||(e[a++]=l):g--}else g--}else if(240==(248&r)){if(n<=g)return this.interim[0]=r,a;if(128==(192&(i=t[g++]))){if(n<=g)return this.interim[0]=r,this.interim[1]=i,a;if(128==(192&(o=t[g++]))){if(n<=g)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=o,a;128==(192&(s=t[g++]))?(l=(7&r)<<18|(63&i)<<12|(63&o)<<6|63&s)<65536||1114111<l||(e[a++]=l):g--}else g--}else g--}}return a},r=o,n.Utf8ToUtf32=r},{}],35:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../common/data/EscapeSequences");i.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},i.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},i.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":o(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))},i.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()))},i.prototype._moveToRequestedCol=function(){var t=0<this._moveToRequestedRow().length?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow,e=this._endRow,n=this._horizontalDirection();return o(this._bufferLine(this._startCol,t,this._endCol,e,"C"===n).length,this._sequence(n))},i.prototype._moveHorizontallyOnly=function(){var t=this._horizontalDirection();return o(Math.abs(this._startCol-this._endCol),this._sequence(t))},i.prototype._wrappedRowsCount=function(){for(var t=0,e=this._startRow-this._wrappedRowsForRow(this._startRow),n=this._endRow-this._wrappedRowsForRow(this._endRow),r=0;r<Math.abs(e-n);r++){var i="A"===this._verticalDirection()?-1:1;this._lines.get(e+i*r).isWrapped&&t++}return t},i.prototype._wrappedRowsForRow=function(t){for(var e=0,n=this._lines.get(t).isWrapped;n&&0<=t&&t<this._terminal.rows;)e++,n=this._lines.get(--t).isWrapped;return e},i.prototype._horizontalDirection=function(){var t=0<this._moveToRequestedRow().length?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;return this._startCol<this._endCol&&t<=this._endRow||this._startCol>=this._endCol&&t<this._endRow?"C":"D"},i.prototype._verticalDirection=function(){return this._startRow>this._endRow?"A":"B"},i.prototype._bufferLine=function(t,e,n,r,i){for(var o=t,s=e,a="";o!==n||s!==r;)o+=i?1:-1,i&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,t,o),t=o=0,s++):!i&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,t+1),t=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,t,o)},i.prototype._sequence=function(t){var e=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+e+t},t=i;function i(t,e){this._mouseEvent=t,this._terminal=e,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y,(e=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1))&&(e=e.map((function(t){return t-1})),this._endCol=e[0],this._endRow=e[1])}function o(t,e){t=Math.floor(t);for(var n="",r=0;r<t;r++)n+=e;return n}n.AltClickHandler=t},{"../common/data/EscapeSequences":28}],36:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.dispose=function(){for(var t=this._addons.length-1;0<=t;t--)this._addons[t].instance.dispose()},i.prototype.loadAddon=function(t,e){var n=this,r={instance:e,dispose:e.dispose,isDisposed:!1};this._addons.push(r),e.dispose=function(){return n._wrappedAddonDispose(r)},e.activate(t)},i.prototype._wrappedAddonDispose=function(t){if(!t.isDisposed){for(var e=-1,n=0;n<this._addons.length;n++)if(this._addons[n]===t){e=n;break}if(-1===e)throw new Error("Could not dispose an addon that has not been loaded");t.isDisposed=!0,t.dispose.apply(t.instance),this._addons.splice(e,1)}},i);function i(){this._addons=[]}n.AddonManager=r},{}],37:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../Terminal"),i=t("../Strings"),o=t("./AddonManager");Object.defineProperty(s.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"buffer",{get:function(){return new a(this._core.buffer)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),s.prototype.blur=function(){this._core.blur()},s.prototype.focus=function(){this._core.focus()},s.prototype.on=function(t,e){this._core.on(t,e)},s.prototype.off=function(t,e){this._core.off(t,e)},s.prototype.emit=function(t,e){this._core.emit(t,e)},s.prototype.addDisposableListener=function(t,e){return this._core.addDisposableListener(t,e)},s.prototype.resize=function(t,e){this._core.resize(t,e)},s.prototype.writeln=function(t){this._core.writeln(t)},s.prototype.open=function(t){this._core.open(t)},s.prototype.attachCustomKeyEventHandler=function(t){this._core.attachCustomKeyEventHandler(t)},s.prototype.addCsiHandler=function(t,e){return this._core.addCsiHandler(t,e)},s.prototype.addOscHandler=function(t,e){return this._core.addOscHandler(t,e)},s.prototype.registerLinkMatcher=function(t,e,n){return this._core.registerLinkMatcher(t,e,n)},s.prototype.deregisterLinkMatcher=function(t){this._core.deregisterLinkMatcher(t)},s.prototype.registerCharacterJoiner=function(t){return this._core.registerCharacterJoiner(t)},s.prototype.deregisterCharacterJoiner=function(t){this._core.deregisterCharacterJoiner(t)},s.prototype.addMarker=function(t){return this._core.addMarker(t)},s.prototype.hasSelection=function(){return this._core.hasSelection()},s.prototype.select=function(t,e,n){this._core.select(t,e,n)},s.prototype.getSelection=function(){return this._core.getSelection()},s.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},s.prototype.clearSelection=function(){this._core.clearSelection()},s.prototype.selectAll=function(){this._core.selectAll()},s.prototype.selectLines=function(t,e){this._core.selectLines(t,e)},s.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},s.prototype.destroy=function(){this._core.destroy()},s.prototype.scrollLines=function(t){this._core.scrollLines(t)},s.prototype.scrollPages=function(t){this._core.scrollPages(t)},s.prototype.scrollToTop=function(){this._core.scrollToTop()},s.prototype.scrollToBottom=function(){this._core.scrollToBottom()},s.prototype.scrollToLine=function(t){this._core.scrollToLine(t)},s.prototype.clear=function(){this._core.clear()},s.prototype.write=function(t){this._core.write(t)},s.prototype.writeUtf8=function(t){this._core.writeUtf8(t)},s.prototype.getOption=function(t){return this._core.getOption(t)},s.prototype.setOption=function(t,e){this._core.setOption(t,e)},s.prototype.refresh=function(t,e){this._core.refresh(t,e)},s.prototype.reset=function(){this._core.reset()},s.applyAddon=function(t){t.apply(s)},s.prototype.loadAddon=function(t){return this._addonManager.loadAddon(this,t)},Object.defineProperty(s,"strings",{get:function(){return i},enumerable:!0,configurable:!0}),t=s;function s(t){this._core=new r.Terminal(t),this._addonManager=new o.AddonManager}n.Terminal=t;var a=(Object.defineProperty(l.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0}),l.prototype.getLine=function(t){if(t=this._buffer.lines.get(t))return new c(t)},l);function l(t){this._buffer=t}var c=(Object.defineProperty(h.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0}),h.prototype.getCell=function(t){if(!(t<0||t>=this._line.length))return new u(this._line,t)},h.prototype.translateToString=function(t,e,n){return this._line.translateToString(t,e,n)},h);function h(t){this._line=t}var u=(Object.defineProperty(f.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),f);function f(t,e){this._line=t,this._x=e}},{"../Strings":16,"../Terminal":17,"./AddonManager":36}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../common/Types"),i=t("./atlas/Types"),o=t("./atlas/CharAtlasCache"),s=t("../core/buffer/BufferLine");a.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},a.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},a.prototype.onOptionsChanged=function(t){},a.prototype.onBlur=function(t){},a.prototype.onFocus=function(t){},a.prototype.onCursorMove=function(t){},a.prototype.onGridChanged=function(t,e,n){},a.prototype.onSelectionChanged=function(t,e,n,r){void 0===r&&(r=!1)},a.prototype.setColors=function(t,e){this._refreshCharAtlas(t,e)},a.prototype.setTransparency=function(t,e){var n;e!==this._alpha&&(n=this._canvas,this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(t,this._colors),this.onGridChanged(t,0,t.rows-1))},a.prototype._refreshCharAtlas=function(t,e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(t,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},a.prototype.resize=function(t,e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this.clearAll(),this._refreshCharAtlas(t,this._colors)},a.prototype.fillCells=function(t,e,n,r){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight)},a.prototype.fillBottomLineAtCells=function(t,e,n){void 0===n&&(n=1),this._ctx.fillRect(t*this._scaledCellWidth,(e+1)*this._scaledCellHeight-window.devicePixelRatio-1,n*this._scaledCellWidth,window.devicePixelRatio)},a.prototype.fillLeftLineAtCell=function(t,e){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},a.prototype.strokeRectAtCell=function(t,e,n,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(t*this._scaledCellWidth+window.devicePixelRatio/2,e*this._scaledCellHeight+window.devicePixelRatio/2,n*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},a.prototype.clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},a.prototype.clearCells=function(t,e,n,r){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,e*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight))},a.prototype.fillCharTrueColor=function(t,e,n,r){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline="middle",this._clipRow(t,r),this._ctx.fillText(e.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},a.prototype.drawChars=function(t,e,n,o){var a,l;e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(t,e,n,o):(e.isInverse()?(a=e.isBgDefault()?i.INVERTED_DEFAULT_COLOR:e.getBgColor(),l=e.isFgDefault()?i.INVERTED_DEFAULT_COLOR:e.getFgColor()):(l=e.isBgDefault()?r.DEFAULT_COLOR:e.getBgColor(),a=e.isFgDefault()?r.DEFAULT_COLOR:e.getFgColor()),a+=t.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&a!==i.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=e.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=a,this._currentGlyphIdentifier.bold=e.isBold()&&t.options.enableBold,this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,n*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(t,e,n,o))},a.prototype._drawUncachedChars=function(t,e,n,r){var o;this._ctx.save(),this._ctx.font=this._getFont(t,e.isBold()&&t.options.enableBold,!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse()?e.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:e.isBgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[e.getBgColor()].css:e.isFgDefault()?this._ctx.fillStyle=this._colors.foreground.css:e.isFgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":(o=e.getFgColor(),t.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css),this._clipRow(t,r),e.isDim()&&(this._ctx.globalAlpha=i.DIM_OPACITY),this._ctx.fillText(e.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},a.prototype._clipRow=function(t,e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,t.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},a.prototype._getFont=function(t,e,n){return(n?"italic":"")+" "+(e?t.options.fontWeightBold:t.options.fontWeight)+" "+t.options.fontSize*window.devicePixelRatio+"px "+t.options.fontFamily},t=a;function a(t,e,n,r,i){this._container=t,this._alpha=r,this._colors=i,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+e+"-layer"),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}n.BaseRenderLayer=t},{"../common/Types":27,"../core/buffer/BufferLine":29,"./atlas/CharAtlasCache":48,"./atlas/Types":55}],39:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("../core/buffer/BufferLine");i(a,o=s.AttributeData),a.prototype.isCombined=function(){return 2097152},a.prototype.getWidth=function(){return this._width},a.prototype.getChars=function(){return this.combinedData},a.prototype.getCode=function(){return 2097151},a.prototype.setFromCharData=function(t){throw new Error("not implemented")},a.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},i=a;function a(t,e,n){var r=o.call(this)||this;return r.content=0,r.combinedData="",r.fg=t.fg,r.bg=t.bg,r.combinedData=e,r._width=n,r}function l(t){this._terminal=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}n.JoinedCellData=i,l.prototype.registerCharacterJoiner=function(t){return t={id:this._nextCharacterJoinerId++,handler:t},this._characterJoiners.push(t),t.id},l.prototype.deregisterCharacterJoiner=function(t){for(var e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1},l.prototype.getJoinedCharacters=function(t){if(0===this._characterJoiners.length)return[];var e=this._terminal.buffer.lines.get(t);if(0===e.length)return[];for(var n=[],r=e.translateToString(!0),i=0,o=0,a=0,l=e.getFg(0),c=e.getBg(0),h=0;h<e.getTrimmedLength();h++)if(e.loadCell(h,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==c){if(1<h-i)for(var u=this._getJoinedRanges(r,a,o,e,i),f=0;f<u.length;f++)n.push(u[f]);i=h,a=o,l=this._workCell.fg,c=this._workCell.bg}o+=this._workCell.getChars().length||s.WHITESPACE_CELL_CHAR.length}if(1<this._terminal.cols-i)for(u=this._getJoinedRanges(r,a,o,e,i),f=0;f<u.length;f++)n.push(u[f]);return n},l.prototype._getJoinedRanges=function(t,e,n,r,i){for(var o=t.substring(e,n),s=this._characterJoiners[0].handler(o),a=1;a<this._characterJoiners.length;a++)for(var c=this._characterJoiners[a].handler(o),h=0;h<c.length;h++)l._mergeRanges(s,c[h]);return this._stringRangesToCellRanges(s,r,i),s},l.prototype._stringRangesToCellRanges=function(t,e,n){var r=0,i=!1,o=0,a=t[r];if(a){for(var l=n;l<this._terminal.cols;l++){var c=e.getWidth(l),h=e.getString(l).length||s.WHITESPACE_CELL_CHAR.length;if(0!==c){if(!i&&a[0]<=o&&(a[0]=l,i=!0),a[1]<=o){if(a[1]=l,!(a=t[++r]))break;i=a[0]<=o&&(a[0]=l,!0)}o+=h}}a&&(a[1]=this._terminal.cols)}},l._mergeRanges=function(t,e){for(var n=!1,r=0;r<t.length;r++){var i=t[r];if(n){if(e[1]<=i[0])return t[r-1][1]=e[1],t;if(e[1]<=i[1])return t[r-1][1]=Math.max(e[1],i[1]),t.splice(r,1),n=!1,t;t.splice(r,1),r--}else{if(e[1]<=i[0])return t.splice(r,0,e),t;if(e[1]<=i[1])return i[0]=Math.min(e[0],i[0]),t;e[0]<i[1]&&(i[0]=Math.min(e[0],i[0]),n=!0)}}return n?t[t.length-1][1]=e[1]:t.push(e),t},i=l,n.CharacterJoinerRegistry=i},{"../core/buffer/BufferLine":29}],40:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./BaseRenderLayer"),a=t("../core/buffer/BufferLine");i(l,o=s.BaseRenderLayer),l.prototype.resize=function(t,e){o.prototype.resize.call(this,t,e),this._state={x:null,y:null,isFocused:null,style:null,width:null}},l.prototype.reset=function(t){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(t))},l.prototype.onBlur=function(t){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),t.refresh(t.buffer.y,t.buffer.y)},l.prototype.onFocus=function(t){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(t):t.refresh(t.buffer.y,t.buffer.y)},l.prototype.onOptionsChanged=function(t){var e=this;t.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new c(t,(function(){e._render(t,!0)}))):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),t.refresh(t.buffer.y,t.buffer.y))},l.prototype.onCursorMove=function(t){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(t)},l.prototype.onGridChanged=function(t,e,n){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(t,!1):this._cursorBlinkStateManager.restartBlinkAnimation(t)},l.prototype._render=function(t,e){if(t.cursorState&&!t.cursorHidden){var n=t.buffer.ybase+t.buffer.y,r=n-t.buffer.ydisp;if(r<0||r>=t.rows)this._clearCursor();else if(t.buffer.lines.get(n).loadCell(t.buffer.x,this._cell),void 0!==this._cell.content){if(!t.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(t,t.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t.buffer.x&&this._state.y===r&&this._state.isFocused===t.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,t.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},l.prototype._clearCursor=function(){this._state&&(this.clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:null,y:null,isFocused:null,style:null,width:null})},l.prototype._renderBarCursor=function(t,e,n,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(e,n),this._ctx.restore()},l.prototype._renderBlockCursor=function(t,e,n,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(e,n,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(t,r,e,n),this._ctx.restore()},l.prototype._renderUnderlineCursor=function(t,e,n,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(e,n),this._ctx.restore()},l.prototype._renderBlurCursor=function(t,e,n,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(e,n,r.getWidth(),1),this._ctx.restore()},i=l;function l(t,e,n){return(n=o.call(this,t,"cursor",e,!0,n)||this)._cell=new a.CellData,n._state={x:null,y:null,isFocused:null,style:null,width:null},n._cursorRenderers={bar:n._renderBarCursor.bind(n),block:n._renderBlockCursor.bind(n),underline:n._renderUnderlineCursor.bind(n)},n}n.CursorRenderLayer=i;var c=(Object.defineProperty(h.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),h.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)},h.prototype.restartBlinkAnimation=function(t){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=null}))))},h.prototype._restartInterval=function(t){var e=this;void 0===t&&(t=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout((function(){if(e._animationTimeRestarted){var t=600-(Date.now()-e._animationTimeRestarted);if(e._animationTimeRestarted=null,0<t)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)},h.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)},h.prototype.resume=function(t){this._animationTimeRestarted=null,this._restartInterval(),this.restartBlinkAnimation(t)},h);function h(t,e){this._renderCallback=e,this.isCursorVisible=!0,t.isFocused&&this._restartInterval()}},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38}],41:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.resize=function(t,e){for(var n=0;n<t;n++){this.cache.length<=n&&this.cache.push([]);for(var r=this.cache[n].length;r<e;r++)this.cache[n].push(null);this.cache[n].length=e}this.cache.length=t},i.prototype.clear=function(){for(var t=0;t<this.cache.length;t++)for(var e=0;e<this.cache[t].length;e++)this.cache[t][e]=null},i);function i(){this.cache=[]}n.GridCache=r},{}],42:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./BaseRenderLayer"),a=t("./atlas/Types"),l=t("./atlas/CharAtlasUtils");i(c,o=s.BaseRenderLayer),c.prototype.resize=function(t,e){o.prototype.resize.call(this,t,e),this._state=null},c.prototype.reset=function(t){this._clearCurrentLink()},c.prototype._clearCurrentLink=function(){var t;this._state&&(this.clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1),0<(t=this._state.y2-this._state.y1-1)&&this.clearCells(0,this._state.y1+1,this._state.cols,t),this.clearCells(0,this._state.y2,this._state.x2,1),this._state=null)},c.prototype._onLinkHover=function(t){if(t.fg===a.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:l.is256Color(t.fg)?this._ctx.fillStyle=this._colors.ansi[t.fg].css:this._ctx.fillStyle=this._colors.foreground.css,t.y1===t.y2)this.fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this.fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(var e=t.y1+1;e<t.y2;e++)this.fillBottomLineAtCells(0,e,t.cols);this.fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t},c.prototype._onLinkLeave=function(t){this._clearCurrentLink()},i=c;function c(t,e,n,r){var i=o.call(this,t,"link",e,!0,n)||this;return i._state=null,r.linkifier.onLinkHover((function(t){return i._onLinkHover(t)})),r.linkifier.onLinkLeave((function(t){return i._onLinkLeave(t)})),i}n.LinkRenderLayer=i},{"./BaseRenderLayer":38,"./atlas/CharAtlasUtils":50,"./atlas/Types":55}],43:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("../ui/RenderDebouncer"),a=t("../common/EventEmitter2"),l=t("../common/Lifecycle"),c=t("../ui/ScreenDprMonitor"),h=t("../ui/Lifecycle");i(u,o=l.Disposable),Object.defineProperty(u.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0}),u.prototype._onIntersectionChange=function(t){this._isPaused=0===t.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},u.prototype.refreshRows=function(t,e){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(t,e,this._rowCount)},u.prototype._renderRows=function(t,e){this._renderer.renderRows(t,e),this._onRender.fire({start:t,end:e})},u.prototype.resize=function(t,e){this._rowCount=e,this._fireOnCanvasResize()},u.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this._fireOnCanvasResize()},u.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},u.prototype.setRenderer=function(t){this._renderer.dispose(),this._renderer=t},u.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount)},u.prototype.setColors=function(t){this._renderer.setColors(t),this._fullRefresh()},u.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange()},u.prototype.onResize=function(t,e){this._renderer.onResize(t,e),this._fullRefresh()},u.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},u.prototype.onBlur=function(){this._renderer.onBlur()},u.prototype.onFocus=function(){this._renderer.onFocus()},u.prototype.onSelectionChanged=function(t,e,n){this._renderer.onSelectionChanged(t,e,n)},u.prototype.onCursorMove=function(){this._renderer.onCursorMove()},u.prototype.onOptionsChanged=function(){this._renderer.onOptionsChanged()},u.prototype.clear=function(){this._renderer.clear()},u.prototype.registerCharacterJoiner=function(t){return this._renderer.registerCharacterJoiner(t)},u.prototype.deregisterCharacterJoiner=function(t){return this._renderer.deregisterCharacterJoiner(t)},i=u;function u(t,e,n){var r,i=o.call(this)||this;return i._renderer=t,i._rowCount=e,i._isPaused=!1,i._needsFullRefresh=!1,i._canvasWidth=0,i._canvasHeight=0,i._onDimensionsChange=new a.EventEmitter2,i._onRender=new a.EventEmitter2,i._onRefreshRequest=new a.EventEmitter2,i._renderDebouncer=new s.RenderDebouncer((function(t,e){return i._renderRows(t,e)})),i.register(i._renderDebouncer),i._screenDprMonitor=new c.ScreenDprMonitor,i._screenDprMonitor.setListener((function(){return i._renderer.onDevicePixelRatioChange()})),i.register(i._screenDprMonitor),i.register(h.addDisposableDomListener(window,"resize",(function(){return i._renderer.onDevicePixelRatioChange()}))),"IntersectionObserver"in window&&((r=new IntersectionObserver((function(t){return i._onIntersectionChange(t[t.length-1])}),{threshold:0})).observe(n),i.register({dispose:function(){return r.disconnect()}})),i}n.RenderCoordinator=i},{"../common/EventEmitter2":23,"../common/Lifecycle":24,"../ui/Lifecycle":59,"../ui/RenderDebouncer":60,"../ui/ScreenDprMonitor":61}],44:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./TextRenderLayer"),a=t("./SelectionRenderLayer"),l=t("./CursorRenderLayer"),c=t("./LinkRenderLayer"),h=t("../renderer/CharacterJoinerRegistry");t=t("../common/Lifecycle"),i(u,o=t.Disposable),u.prototype.dispose=function(){o.prototype.dispose.call(this),this._renderLayers.forEach((function(t){return t.dispose()}))},u.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._terminal.cols,this._terminal.rows))},u.prototype.setColors=function(t){var e=this;this._colors=t,this._renderLayers.forEach((function(t){t.setColors(e._terminal,e._colors),t.reset(e._terminal)}))},u.prototype.onResize=function(t,e){var n=this;this._updateDimensions(),this._renderLayers.forEach((function(t){return t.resize(n._terminal,n.dimensions)})),this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},u.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)},u.prototype.onBlur=function(){var t=this;this._runOperation((function(e){return e.onBlur(t._terminal)}))},u.prototype.onFocus=function(){var t=this;this._runOperation((function(e){return e.onFocus(t._terminal)}))},u.prototype.onSelectionChanged=function(t,e,n){var r=this;void 0===n&&(n=!1),this._runOperation((function(i){return i.onSelectionChanged(r._terminal,t,e,n)}))},u.prototype.onCursorMove=function(){var t=this;this._runOperation((function(e){return e.onCursorMove(t._terminal)}))},u.prototype.onOptionsChanged=function(){var t=this;this._runOperation((function(e){return e.onOptionsChanged(t._terminal)}))},u.prototype.clear=function(){var t=this;this._runOperation((function(e){return e.reset(t._terminal)}))},u.prototype._runOperation=function(t){this._renderLayers.forEach((function(e){return t(e)}))},u.prototype.renderRows=function(t,e){var n=this;this._renderLayers.forEach((function(r){return r.onGridChanged(n._terminal,t,e)}))},u.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)},u.prototype.registerCharacterJoiner=function(t){return this._characterJoinerRegistry.registerCharacterJoiner(t)},u.prototype.deregisterCharacterJoiner=function(t){return this._characterJoinerRegistry.deregisterCharacterJoiner(t)},i=u;function u(t,e){var n=o.call(this)||this;return n._terminal=t,n._colors=e,e=n._terminal.options.allowTransparency,n._characterJoinerRegistry=new h.CharacterJoinerRegistry(t),n._renderLayers=[new s.TextRenderLayer(n._terminal.screenElement,0,n._colors,n._characterJoinerRegistry,e),new a.SelectionRenderLayer(n._terminal.screenElement,1,n._colors),new c.LinkRenderLayer(n._terminal.screenElement,2,n._colors,n._terminal),new l.CursorRenderLayer(n._terminal.screenElement,3,n._colors)],n.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},n._devicePixelRatio=window.devicePixelRatio,n._updateDimensions(),n.onOptionsChanged(),n}n.Renderer=i},{"../common/Lifecycle":24,"../renderer/CharacterJoinerRegistry":39,"./CursorRenderLayer":40,"./LinkRenderLayer":42,"./SelectionRenderLayer":45,"./TextRenderLayer":46}],45:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o;t=t("./BaseRenderLayer"),i(s,o=t.BaseRenderLayer),s.prototype._clearState=function(){this._state={start:null,end:null,columnSelectMode:null,ydisp:null}},s.prototype.resize=function(t,e){o.prototype.resize.call(this,t,e),this._clearState()},s.prototype.reset=function(t){this._state.start&&this._state.end&&(this._clearState(),this.clearAll())},s.prototype.onSelectionChanged=function(t,e,n,r){var i,o,s,a,l,c;this._didStateChange(e,n,r,t.buffer.ydisp)&&(this.clearAll(),e&&n?(a=e[1]-t.buffer.ydisp,c=n[1]-t.buffer.ydisp,i=Math.max(a,0),o=Math.min(c,t.rows-1),i>=t.rows||o<0||(this._ctx.fillStyle=this._colors.selection.css,r?(l=e[0],s=n[0]-l,this.fillCells(l,i,s,o-i+1)):(l=a===i?e[0]:0,a=i===o?n[0]:t.cols,this.fillCells(l,i,a-l,1),l=Math.max(o-i-1,0),this.fillCells(0,i+1,t.cols,l),i!==o&&(c=c===o?n[0]:t.cols,this.fillCells(0,o,c,1))),this._state.start=[e[0],e[1]],this._state.end=[n[0],n[1]],this._state.columnSelectMode=r,this._state.ydisp=t.buffer.ydisp)):this._clearState())},s.prototype._didStateChange=function(t,e,n,r){return!this._areCoordinatesEqual(t,this._state.start)||!this._areCoordinatesEqual(e,this._state.end)||n!==this._state.columnSelectMode||r!==this._state.ydisp},s.prototype._areCoordinatesEqual=function(t,e){return!(!t||!e)&&t[0]===e[0]&&t[1]===e[1]},i=s;function s(t,e,n){return(n=o.call(this,t,"selection",e,!0,n)||this)._clearState(),n}n.SelectionRenderLayer=i},{"./BaseRenderLayer":38}],46:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./GridCache"),a=t("./BaseRenderLayer"),l=t("../core/buffer/BufferLine"),c=t("./CharacterJoinerRegistry");i(h,o=a.BaseRenderLayer),h.prototype.resize=function(t,e){o.prototype.resize.call(this,t,e);var n=this._getFont(t,!1,!1);this._characterWidth===e.scaledCharWidth&&this._characterFont===n||(this._characterWidth=e.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(t.cols,t.rows)},h.prototype.reset=function(t){this._state.clear(),this.clearAll()},h.prototype._forEachCell=function(t,e,n,r,i){for(var o=e;o<=n;o++)for(var s=o+t.buffer.ydisp,a=t.buffer.lines.get(s),h=r?r.getJoinedCharacters(s):[],u=0;u<t.cols;u++){a.loadCell(u,this._workCell);var f,p=this._workCell,d=!1,_=u;0!==p.getWidth()&&(0<h.length&&u===h[0][0]&&(d=!0,f=h.shift(),p=new c.JoinedCellData(this._workCell,a.translateToString(!0,f[0],f[1]),f[1]-f[0]),_=f[1]-1),!d&&this._isOverlapping(p)&&_<a.length-1&&a.getCodePoint(_+1)===l.NULL_CELL_CODE&&(p.content&=-12582913,p.content|=2<<22),i(p,u,o),u=_)}},h.prototype._drawBackground=function(t,e,n){var r=this,i=this._ctx,o=t.cols,s=0,a=0,c=null;i.save(),this._forEachCell(t,e,n,null,(function(t,e,n){var h=null;t.isInverse()?h=t.isFgDefault()?r._colors.foreground.css:t.isFgRGB()?"rgb("+l.AttributeData.toColorRGB(t.getFgColor()).join(",")+")":r._colors.ansi[t.getFgColor()].css:t.isBgRGB()?h="rgb("+l.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":t.isBgPalette()&&(h=r._colors.ansi[t.getBgColor()].css),null===c&&(s=e,a=n),n!==a?(i.fillStyle=c,r.fillCells(s,a,o-s,1),s=e,a=n):c!==h&&(i.fillStyle=c,r.fillCells(s,a,e-s,1),s=e,a=n),c=h})),null!==c&&(i.fillStyle=c,this.fillCells(s,a,o-s,1)),i.restore()},h.prototype._drawForeground=function(t,e,n){var r=this;this._forEachCell(t,e,n,this._characterJoinerRegistry,(function(e,n,i){var o;e.isInvisible()||(r.drawChars(t,e,n,i),e.isUnderline()&&(r._ctx.save(),e.isInverse()?e.isBgDefault()?r._ctx.fillStyle=r._colors.background.css:e.isBgRGB()?r._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":r._ctx.fillStyle=r._colors.ansi[e.getBgColor()].css:e.isFgDefault()?r._ctx.fillStyle=r._colors.foreground.css:e.isFgRGB()?r._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":(o=e.getFgColor(),t.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),r._ctx.fillStyle=r._colors.ansi[o].css),r.fillBottomLineAtCells(n,i,e.getWidth()),r._ctx.restore()))}))},h.prototype.onGridChanged=function(t,e,n){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,e,t.cols,n-e+1),this._drawBackground(t,e,n),this._drawForeground(t,e,n))},h.prototype.onOptionsChanged=function(t){this.setTransparency(t,t.options.allowTransparency)},h.prototype._isOverlapping=function(t){if(1!==t.getWidth())return!1;if(t.getCode()<256)return!1;var e=t.getChars();return this._characterOverlapCache.hasOwnProperty(e)?this._characterOverlapCache[e]:(this._ctx.save(),this._ctx.font=this._characterFont,t=Math.floor(this._ctx.measureText(e).width)>this._characterWidth,this._ctx.restore(),this._characterOverlapCache[e]=t)},i=h;function h(t,e,n,r,i){return(n=o.call(this,t,"text",e,i,n)||this)._characterOverlapCache={},n._workCell=new l.CellData,n._state=new s.GridCache,n._characterJoinerRegistry=r,n}n.TextRenderLayer=i},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38,"./CharacterJoinerRegistry":39,"./GridCache":41}],47:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.dispose=function(){},i.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},i.prototype._doWarmUp=function(){},i.prototype.beginFrame=function(){},i);function i(){this._didWarmUp=!1}n.default=r},{}],48:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./CharAtlasUtils"),i=t("./DynamicCharAtlas"),o=t("./NoneCharAtlas"),s=(t=t("./StaticCharAtlas"),{none:o.default,static:t.default,dynamic:i.default}),a=[];n.acquireCharAtlas=function(t,e,n,i){for(var o=r.generateConfig(n,i,t,e),l=0;l<a.length;l++){var c=(h=a[l]).ownedBy.indexOf(t);if(0<=c){if(r.configEquals(h.config,o))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),a.splice(l,1)):h.ownedBy.splice(c,1);break}}for(l=0;l<a.length;l++){var h=a[l];if(r.configEquals(h.config,o))return h.ownedBy.push(t),h.atlas}return e={atlas:new s[t.options.experimentalCharAtlas](document,o),config:o,ownedBy:[t]},a.push(e),e.atlas},n.removeTerminalFromCache=function(t){for(var e=0;e<a.length;e++){var n=a[e].ownedBy.indexOf(t);if(-1!==n){1===a[e].ownedBy.length?(a[e].atlas.dispose(),a.splice(e,1)):a[e].ownedBy.splice(n,1);break}}}},{"./CharAtlasUtils":50,"./DynamicCharAtlas":51,"./NoneCharAtlas":53,"./StaticCharAtlas":54}],49:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../../common/Platform"),i=t("./Types");function o(t,e){for(var n=!0,r=e.rgba>>>24,i=e.rgba>>>16&255,o=e.rgba>>>8&255,s=0;s<t.data.length;s+=4)t.data[s]===r&&t.data[s+1]===i&&t.data[s+2]===o?t.data[s+3]=0:n=!1;return n}function s(t,e){return t+" "+e.fontSize*e.devicePixelRatio+"px "+e.fontFamily}n.generateStaticCharAtlasTexture=function(t,e,n){var a=n.scaledCharWidth+i.CHAR_ATLAS_CELL_SPACING,l=n.scaledCharHeight+i.CHAR_ATLAS_CELL_SPACING,c=(e=e(255*a,34*l)).getContext("2d",{alpha:n.allowTransparency});c.fillStyle=n.colors.background.css,c.fillRect(0,0,e.width,e.height),c.save(),c.fillStyle=n.colors.foreground.css,c.font=s(n.fontWeight,n),c.textBaseline="middle";for(var h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*a,0,a,l),c.clip(),c.fillText(String.fromCharCode(h),h*a,l/2),c.restore();for(c.save(),c.font=s(n.fontWeightBold,n),h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*a,l,a,l),c.clip(),c.fillText(String.fromCharCode(h),h*a,1.5*l),c.restore();c.restore(),c.font=s(n.fontWeight,n);for(var u=0;u<16;u++){var f=(u+2)*l;for(h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*a,f,a,l),c.clip(),c.fillStyle=n.colors.ansi[u].css,c.fillText(String.fromCharCode(h),h*a,f+l/2),c.restore()}for(c.font=s(n.fontWeightBold,n),u=0;u<16;u++)for(f=(u+2+16)*l,h=0;h<256;h++)c.save(),c.beginPath(),c.rect(h*a,f,a,l),c.clip(),c.fillStyle=n.colors.ansi[u].css,c.fillText(String.fromCharCode(h),h*a,f+l/2),c.restore();return c.restore(),!("createImageBitmap"in t)||r.isFirefox||r.isSafari?e:(o(e=c.getImageData(0,0,e.width,e.height),n.colors.background),t.createImageBitmap(e))},n.clearColor=o},{"../../common/Platform":25,"./Types":55}],50:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../../common/Types");n.generateConfig=function(t,e,n,r){return r={foreground:r.foreground,background:r.background,cursor:null,cursorAccent:null,selection:null,ansi:r.ansi.slice(0,16)},{type:n.options.experimentalCharAtlas,devicePixelRatio:window.devicePixelRatio,scaledCharWidth:t,scaledCharHeight:e,fontFamily:n.options.fontFamily,fontSize:n.options.fontSize,fontWeight:n.options.fontWeight,fontWeightBold:n.options.fontWeightBold,allowTransparency:n.options.allowTransparency,colors:r}},n.configEquals=function(t,e){for(var n=0;n<t.colors.ansi.length;n++)if(t.colors.ansi[n].rgba!==e.colors.ansi[n].rgba)return!1;return t.type===e.type&&t.devicePixelRatio===e.devicePixelRatio&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.scaledCharWidth===e.scaledCharWidth&&t.scaledCharHeight===e.scaledCharHeight&&t.colors.foreground===e.colors.foreground&&t.colors.background===e.colors.background},n.is256Color=function(t){return t<r.DEFAULT_COLOR}},{"../../common/Types":27}],51:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("./Types"),s=t("./BaseCharAtlas"),a=t("../../ui/ColorManager"),l=t("./CharAtlasGenerator"),c=t("./LRUMap"),h=t("../../common/Platform"),u={css:"rgba(0, 0, 0, 0)",rgba:0};function f(t){return t.code<<21|t.bg<<12|t.fg<<3|(t.bold?0:4)+(t.dim?0:2)+(t.italic?0:1)}n.getGlyphCacheKey=f;var p;i(d,p=s.default),d.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},d.prototype.beginFrame=function(){this._drawToCacheCount=0},d.prototype.draw=function(t,e,n,r){if(32===e.code)return!0;if(!this._canCache(e))return!1;var i=f(e),o=this._cacheMap.get(i);return null!=o?(this._drawFromCache(t,o,n,r),!0):this._drawToCacheCount<100&&(o=void 0,o=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index,o=this._drawToCache(e,o),this._cacheMap.set(i,o),this._drawFromCache(t,o,n,r),!0)},d.prototype._canCache=function(t){return t.code<256},d.prototype._toCoordinateX=function(t){return t%this._width*this._config.scaledCharWidth},d.prototype._toCoordinateY=function(t){return Math.floor(t/this._width)*this._config.scaledCharHeight},d.prototype._drawFromCache=function(t,e,n,r){var i,o;e.isEmpty||(i=this._toCoordinateX(e.index),o=this._toCoordinateY(e.index),t.drawImage(e.inBitmap?this._bitmap:this._cacheCanvas,i,o,this._config.scaledCharWidth,this._config.scaledCharHeight,n,r,this._config.scaledCharWidth,this._config.scaledCharHeight))},d.prototype._getColorFromAnsiIndex=function(t){return(t<this._config.colors.ansi.length?this._config.colors.ansi:a.DEFAULT_ANSI_COLORS)[t]},d.prototype._getBackgroundColor=function(t){return this._config.allowTransparency?u:t.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:t.bg<256?this._getColorFromAnsiIndex(t.bg):this._config.colors.background},d.prototype._getForegroundColor=function(t){return t.fg===o.INVERTED_DEFAULT_COLOR?this._config.colors.background:t.fg<256?this._getColorFromAnsiIndex(t.fg):this._config.colors.foreground},d.prototype._drawToCache=function(t,e){this._drawToCacheCount++,this._tmpCtx.save();var n=this._getBackgroundColor(t);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=n.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var r=t.bold?this._config.fontWeightBold:this._config.fontWeight,i=t.italic?"italic":"";return this._tmpCtx.font=i+" "+r+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(t).css,t.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(t.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore(),i=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),r=!1,this._config.allowTransparency||(r=l.clearColor(i,n)),t=this._toCoordinateX(e),n=this._toCoordinateY(e),this._cacheCtx.putImageData(i,t,n),r={index:e,isEmpty:r,inBitmap:!1},this._addGlyphToBitmap(r),r},d.prototype._addGlyphToBitmap=function(t){var e=this;"createImageBitmap"in window&&!h.isFirefox&&!h.isSafari&&(this._glyphsWaitingOnBitmap.push(t),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout((function(){return e._generateBitmap()}),100)))},d.prototype._generateBitmap=function(){var t=this,e=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then((function(n){t._bitmap=n;for(var r=0;r<e.length;r++)e[r].inBitmap=!0})),this._bitmapCommitTimeout=null},i=d;function d(t,e){var n=p.call(this)||this;return n._config=e,n._drawToCacheCount=0,n._glyphsWaitingOnBitmap=[],n._bitmapCommitTimeout=null,n._bitmap=null,n._cacheCanvas=t.createElement("canvas"),n._cacheCanvas.width=1024,n._cacheCanvas.height=1024,n._cacheCtx=n._cacheCanvas.getContext("2d",{alpha:!0}),(t=t.createElement("canvas")).width=n._config.scaledCharWidth,t.height=n._config.scaledCharHeight,n._tmpCtx=t.getContext("2d",{alpha:n._config.allowTransparency}),n._width=Math.floor(1024/n._config.scaledCharWidth),n._height=Math.floor(1024/n._config.scaledCharHeight),t=n._width*n._height,n._cacheMap=new c.default(t),n._cacheMap.prealloc(t),n}n.default=i},{"../../common/Platform":25,"../../ui/ColorManager":58,"./BaseCharAtlas":47,"./CharAtlasGenerator":49,"./LRUMap":52,"./Types":55}],52:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype._unlinkNode=function(t){var e=t.prev,n=t.next;t===this._head&&(this._head=n),t===this._tail&&(this._tail=e),null!==e&&(e.next=n),null!==n&&(n.prev=e)},i.prototype._appendNode=function(t){var e=this._tail;null!==e&&(e.next=t),t.prev=e,t.next=null,this._tail=t,null===this._head&&(this._head=t)},i.prototype.prealloc=function(t){for(var e=this._nodePool,n=0;n<t;n++)e.push({prev:null,next:null,key:null,value:null})},i.prototype.get=function(t){return void 0!==(t=this._map[t])?(this._unlinkNode(t),this._appendNode(t),t.value):null},i.prototype.peekValue=function(t){return void 0!==(t=this._map[t])?t.value:null},i.prototype.peek=function(){var t=this._head;return null===t?null:t.value},i.prototype.set=function(t,e){var n,r=this._map[t];void 0!==r?(r=this._map[t],this._unlinkNode(r),r.value=e):this.size>=this.capacity?(r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=t,r.value=e,this._map[t]=r):(0<(n=this._nodePool).length?((r=n.pop()).key=t,r.value=e):r={prev:null,next:null,key:t,value:e},this._map[t]=r,this.size++),this._appendNode(r)},i);function i(t){this.capacity=t,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}n.default=r},{}],53:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o;t=t("./BaseCharAtlas"),i(s,o=t.default),s.prototype.draw=function(t,e,n,r){return!1},i=s;function s(t,e){return o.call(this)||this}n.default=i},{"./BaseCharAtlas":47}],54:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./Types"),a=t("./CharAtlasGenerator"),l=t("./BaseCharAtlas"),c=t("./CharAtlasUtils"),h=t("../../common/Types");i(u,o=l.default),u.prototype._doWarmUp=function(){var t=this,e=a.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);e instanceof HTMLCanvasElement?this._texture=e:e.then((function(e){t._texture=e}))},u.prototype._isCached=function(t,e){var n=t.code<256,r=t.fg<16,i=t.fg===h.DEFAULT_COLOR,o=t.bg===h.DEFAULT_COLOR;return n&&(r||i)&&o&&!t.italic},u.prototype.draw=function(t,e,n,r){if(null===this._texture||void 0===this._texture)return!1;var i=0;if(c.is256Color(e.fg)?i=2+e.fg+(e.bold?16:0):e.fg===h.DEFAULT_COLOR&&e.bold&&(i=1),!this._isCached(e,i))return!1;t.save();var o=this._config.scaledCharWidth+s.CHAR_ATLAS_CELL_SPACING,a=this._config.scaledCharHeight+s.CHAR_ATLAS_CELL_SPACING;return e.dim&&(t.globalAlpha=s.DIM_OPACITY),t.drawImage(this._texture,e.code*o,i*a,o,this._config.scaledCharHeight,n,r,o,this._config.scaledCharHeight),t.restore(),!0},i=u;function u(t,e){var n=o.call(this)||this;return n._document=t,n._config=e,n._canvasFactory=function(t,e){var r=n._document.createElement("canvas");return r.width=t,r.height=e,r},n}n.default=i},{"../../common/Types":27,"./BaseCharAtlas":47,"./CharAtlasGenerator":49,"./CharAtlasUtils":50,"./Types":55}],55:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.CHAR_ATLAS_CELL_SPACING=1},{}],56:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./DomRendererRowFactory"),a=t("../atlas/Types"),l=(t=t("../../common/Lifecycle"),"xterm-dom-renderer-owner-"),c="xterm-rows",h="xterm-fg-",u="xterm-bg-",f="xterm-focus",p="xterm-selection",d=1;i(_,o=t.Disposable),_.prototype.dispose=function(){this._terminal.element.classList.remove(l+this._terminalClass),this._terminal.screenElement.removeChild(this._rowContainer),this._terminal.screenElement.removeChild(this._selectionContainer),this._terminal.screenElement.removeChild(this._themeStyleElement),this._terminal.screenElement.removeChild(this._dimensionsStyleElement),o.prototype.dispose.call(this)},_.prototype._updateDimensions=function(){var t=this;this.dimensions.scaledCharWidth=this._terminal.charMeasure.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this._rowElements.forEach((function(e){e.style.width=t.dimensions.canvasWidth+"px",e.style.height=t.dimensions.actualCellHeight+"px",e.style.lineHeight=t.dimensions.actualCellHeight+"px",e.style.overflow="hidden"})),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));var e=this._terminalSelector+" ."+c+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=e,this._selectionContainer.style.height=this._terminal._viewportElement.style.height,this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},_.prototype.setColors=function(t){this._colors=t,this._injectCss()},_.prototype._injectCss=function(){var t=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var e=this._terminalSelector+" ."+c+" { color: "+this._colors.foreground.css+"; background-color: "+this._colors.background.css+"; font-family: "+this._terminal.options.fontFamily+"; font-size: "+this._terminal.options.fontSize+"px;}";e+=this._terminalSelector+" span:not(."+s.BOLD_CLASS+") { font-weight: "+this._terminal.options.fontWeight+";}"+this._terminalSelector+" span."+s.BOLD_CLASS+" { font-weight: "+this._terminal.options.fontWeightBold+";}"+this._terminalSelector+" span."+s.ITALIC_CLASS+" { font-style: italic;}",e+="@keyframes blink { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; }}",e+=this._terminalSelector+" ."+c+":not(."+f+") ."+s.CURSOR_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_BLINK_CLASS+" { animation: blink 1s step-end infinite;}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",e+=this._terminalSelector+" ."+p+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+p+" div { position: absolute; background-color: "+this._colors.selection.css+";}",this._colors.ansi.forEach((function(n,r){e+=t._terminalSelector+" ."+h+r+" { color: "+n.css+"; }"+t._terminalSelector+" ."+u+r+" { background-color: "+n.css+"; }"})),e+=this._terminalSelector+" ."+h+a.INVERTED_DEFAULT_COLOR+" { color: "+this._colors.background.css+"; }"+this._terminalSelector+" ."+u+a.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=e},_.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},_.prototype._refreshRowElements=function(t,e){for(var n=this._rowElements.length;n<=e;n++){var r=document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop())},_.prototype.onResize=function(t,e){this._refreshRowElements(t,e),this._updateDimensions()},_.prototype.onCharSizeChanged=function(){this._updateDimensions()},_.prototype.onBlur=function(){this._rowContainer.classList.remove(f)},_.prototype.onFocus=function(){this._rowContainer.classList.add(f)},_.prototype.onSelectionChanged=function(t,e,n){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);var r,i,o,s,a;t&&e&&(a=t[1]-this._terminal.buffer.ydisp,r=e[1]-this._terminal.buffer.ydisp,i=Math.max(a,0),o=Math.min(r,this._terminal.rows-1),i>=this._terminal.rows||o<0||(s=document.createDocumentFragment(),n?s.appendChild(this._createSelectionElement(i,t[0],e[0],o-i+1)):(a=a===i?t[0]:0,t=i===o?e[0]:this._terminal.cols,s.appendChild(this._createSelectionElement(i,a,t)),s.appendChild(this._createSelectionElement(i+1,0,this._terminal.cols,o-i-1)),i!==o&&(e=r===o?e[0]:this._terminal.cols,s.appendChild(this._createSelectionElement(o,0,e)))),this._selectionContainer.appendChild(s)))},_.prototype._createSelectionElement=function(t,e,n,r){void 0===r&&(r=1);var i=document.createElement("div");return i.style.height=r*this.dimensions.actualCellHeight+"px",i.style.top=t*this.dimensions.actualCellHeight+"px",i.style.left=e*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(n-e)+"px",i},_.prototype.onCursorMove=function(){},_.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss(),this._terminal.refresh(0,this._terminal.rows-1)},_.prototype.clear=function(){this._rowElements.forEach((function(t){return t.innerHTML=""}))},_.prototype.renderRows=function(t,e){for(var n=this._terminal,r=n.buffer.ybase+n.buffer.y,i=this._terminal.buffer.x,o=this._terminal.options.cursorBlink,s=t;s<=e;s++){var a=this._rowElements[s];a.innerHTML="";var l=s+n.buffer.ydisp,c=n.buffer.lines.get(l),h=n.options.cursorStyle;a.appendChild(this._rowFactory.createRow(c,l===r,h,i,o,this.dimensions.actualCellWidth,n.cols))}},Object.defineProperty(_.prototype,"_terminalSelector",{get:function(){return"."+l+this._terminalClass},enumerable:!0,configurable:!0}),_.prototype.registerCharacterJoiner=function(t){return-1},_.prototype.deregisterCharacterJoiner=function(t){return!1},_.prototype._onLinkHover=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)},_.prototype._onLinkLeave=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)},_.prototype._setCellUnderline=function(t,e,n,r,i,o){for(;t!==e||n!==r;){var s=this._rowElements[n];if(!s)return;(s=s.children[t])&&(s.style.textDecoration=o?"underline":"none"),++t>=i&&(t=0,n++)}},i=_;function _(t,e){var n=o.call(this)||this;return n._terminal=t,n._colors=e,n._terminalClass=d++,n._rowElements=[],n._rowContainer=document.createElement("div"),n._rowContainer.classList.add(c),n._rowContainer.style.lineHeight="normal",n._rowContainer.setAttribute("aria-hidden","true"),n._refreshRowElements(n._terminal.cols,n._terminal.rows),n._selectionContainer=document.createElement("div"),n._selectionContainer.classList.add(p),n._selectionContainer.setAttribute("aria-hidden","true"),n.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},n._updateDimensions(),n._injectCss(),n._rowFactory=new s.DomRendererRowFactory(t.options,document),n._terminal.element.classList.add(l+n._terminalClass),n._terminal.screenElement.appendChild(n._rowContainer),n._terminal.screenElement.appendChild(n._selectionContainer),n._terminal.linkifier.onLinkHover((function(t){return n._onLinkHover(t)})),n._terminal.linkifier.onLinkLeave((function(t){return n._onLinkLeave(t)})),n}n.DomRenderer=i},{"../../common/Lifecycle":24,"../atlas/Types":55,"./DomRendererRowFactory":57}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../atlas/Types"),i=t("../../core/buffer/BufferLine");function o(t,e){this._terminalOptions=t,this._document=e,this._workCell=new i.CellData}n.BOLD_CLASS="xterm-bold",n.DIM_CLASS="xterm-dim",n.ITALIC_CLASS="xterm-italic",n.UNDERLINE_CLASS="xterm-underline",n.CURSOR_CLASS="xterm-cursor",n.CURSOR_BLINK_CLASS="xterm-cursor-blink",n.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",n.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",n.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline",o.prototype.createRow=function(t,e,o,s,a,l,c){for(var h=this._document.createDocumentFragment(),u=0,f=Math.min(t.length,c)-1;0<=f;f--)if(t.loadCell(f,this._workCell).getCode()!==i.NULL_CELL_CODE||e&&f===s){u=f+1;break}for(f=0;f<u;f++){t.loadCell(f,this._workCell);var p=this._workCell.getWidth();if(0!==p){var d=this._document.createElement("span");if(1<p&&(d.style.width=l*p+"px"),e&&f===s)switch(d.classList.add(n.CURSOR_CLASS),a&&d.classList.add(n.CURSOR_BLINK_CLASS),o){case"bar":d.classList.add(n.CURSOR_STYLE_BAR_CLASS);break;case"underline":d.classList.add(n.CURSOR_STYLE_UNDERLINE_CLASS);break;default:d.classList.add(n.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&this._terminalOptions.enableBold&&d.classList.add(n.BOLD_CLASS),this._workCell.isItalic()&&d.classList.add(n.ITALIC_CLASS),this._workCell.isDim()&&d.classList.add(n.DIM_CLASS),this._workCell.isUnderline()&&d.classList.add(n.UNDERLINE_CLASS),d.textContent=this._workCell.getChars()||i.WHITESPACE_CELL_CHAR;var _,m=this._workCell.isInverse();this._workCell.isFgRGB()?(_=d.getAttribute("style")||"",_+=(m?"background-":"")+"color:rgb("+i.AttributeData.toColorRGB(this._workCell.getFgColor()).join(",")+");",d.setAttribute("style",_)):this._workCell.isFgPalette()?(p=this._workCell.getFgColor(),this._workCell.isBold()&&p<8&&!m&&this._terminalOptions.enableBold&&this._terminalOptions.drawBoldTextInBrightColors&&(p+=8),d.classList.add("xterm-"+(m?"b":"f")+"g-"+p)):m&&d.classList.add("xterm-bg-"+r.INVERTED_DEFAULT_COLOR),this._workCell.isBgRGB()?(_=d.getAttribute("style")||"",_+=(m?"":"background-")+"color:rgb("+i.AttributeData.toColorRGB(this._workCell.getBgColor()).join(",")+");",d.setAttribute("style",_)):this._workCell.isBgPalette()?d.classList.add("xterm-"+(m?"f":"b")+"g-"+this._workCell.getBgColor()):m&&d.classList.add("xterm-fg-"+r.INVERTED_DEFAULT_COLOR),h.appendChild(d)}}return h},t=o,n.DomRendererRowFactory=t},{"../../core/buffer/BufferLine":29,"../atlas/Types":55}],58:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=l("#ffffff"),i=l("#000000"),o=l("#ffffff"),s=l("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967159};function l(t){return{css:t,rgba:parseInt(t.slice(1),16)<<8|255}}function c(t){return(t=t.toString(16)).length<2?"0"+t:t}n.DEFAULT_ANSI_COLORS=function(){for(var t=[l("#2e3436"),l("#cc0000"),l("#4e9a06"),l("#c4a000"),l("#3465a4"),l("#75507b"),l("#06989a"),l("#d3d7cf"),l("#555753"),l("#ef2929"),l("#8ae234"),l("#fce94f"),l("#729fcf"),l("#ad7fa8"),l("#34e2e2"),l("#eeeeec")],e=[0,95,135,175,215,255],n=0;n<216;n++){var r=e[n/36%6|0],i=e[n/6%6|0],o=e[n%6];t.push({css:"#"+c(r)+c(i)+c(o),rgba:(r<<24|i<<16|o<<8|255)>>>0})}for(n=0;n<24;n++){var s=8+10*n,a=c(s);t.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return t}();var h=(u.prototype.setTheme=function(t){this.colors.foreground=this._parseColor((t=void 0===t?{}:t).foreground,r),this.colors.background=this._parseColor(t.background,i),this.colors.cursor=this._parseColor(t.cursor,o,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,s,!0),this.colors.selection=this._parseColor(t.selection,a,!0),this.colors.ansi[0]=this._parseColor(t.black,n.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(t.red,n.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(t.green,n.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(t.yellow,n.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(t.blue,n.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(t.magenta,n.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(t.cyan,n.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(t.white,n.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(t.brightBlack,n.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(t.brightRed,n.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(t.brightGreen,n.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(t.brightYellow,n.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(t.brightBlue,n.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(t.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(t.brightCyan,n.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(t.brightWhite,n.DEFAULT_ANSI_COLORS[15])},u.prototype._parseColor=function(t,e,n){if(void 0===n&&(n=this.allowTransparency),void 0===t)return e;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=t,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+t+" is invalid using fallback "+e.css),e;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;return n||255===r[3]?{css:t,rgba:(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0}:(console.warn("Color: "+t+" is using transparency, but allowTransparency is false. Using fallback "+e.css+"."),e)},u);function u(t,e){if(this.allowTransparency=e,(t=t.createElement("canvas")).width=1,t.height=1,!(t=t.getContext("2d")))throw new Error("Could not get rendering context");this._ctx=t,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:r,background:i,cursor:o,cursorAccent:s,selection:a,ansi:n.DEFAULT_ANSI_COLORS.slice()}}n.ColorManager=h},{}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=function(t,e,n,r){return t.addEventListener(e,n,r),{dispose:function(){n&&t.removeEventListener(e,n,r)}}}},{}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},i.prototype.refresh=function(t,e,n){var r=this;this._rowCount=n,t=void 0!==t?t:0,e=void 0!==e?e:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,t):t,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,e):e,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){return r._innerRefresh()})))},i.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},i);function i(t){this._renderCallback=t}n.RenderDebouncer=r},{}],61:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o;t=t("../common/Lifecycle"),i(s,o=t.Disposable),s.prototype.setListener=function(t){var e=this;this._listener&&this.clearListener(),this._listener=t,this._outerListener=function(){e._listener&&(e._listener(window.devicePixelRatio,e._currentDevicePixelRatio),e._updateDpr())},this._updateDpr()},s.prototype.dispose=function(){o.prototype.dispose.call(this),this.clearListener()},s.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},s.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},i=s;function s(){var t=null!==o&&o.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}n.ScreenDprMonitor=i},{"../common/Lifecycle":24}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),t=t("./public/Terminal"),e.exports=t.Terminal},{"./public/Terminal":37}]},{},[62])(62)},function(t,e,n){"use strict";(function(t,r){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);(r="function"==typeof Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))):r).forEach((function(e){var r,i;r=t,e=n[i=e],i in r?Object.defineProperty(r,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[i]=e}))}return t}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==a.return||a.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(e,"b",(function(){return he})),n.d(e,"a",(function(){return fe}));var c={},h={},u=null,f={mark:p=function(){},measure:p};try{"undefined"!=typeof window&&(c=window),"undefined"!=typeof document&&(h=document),"undefined"!=typeof MutationObserver&&(u=MutationObserver),"undefined"!=typeof performance&&(f=performance)}catch(r){}var p=void 0===(p=(c.navigator||{}).userAgent)?"":p,d=c,_=h,m=u,g=(h=f,d.document,!!_.documentElement&&!!_.head&&"function"==typeof _.addEventListener&&"function"==typeof _.createElement),y=~p.indexOf("MSIE")||~p.indexOf("Trident/"),C=(u="___FONT_AWESOME___","svg-inline--fa"),b="data-fa-i2svg",v="data-fa-pseudo-element",w="fontawesome-i2svg",S=["HTML","HEAD","STYLE","SCRIPT"],E=function(){try{return!0}catch(t){return!1}}(),A={fas:"solid",far:"regular",fal:"light",fad:"duotone",fab:"brands",fak:"kit",fa:"solid"},x={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab",kit:"fak"},k="fa-layers-text",L=/Font Awesome ([5 ]*)(Solid|Regular|Light|Duotone|Brands|Free|Pro|Kit).*/,T={900:"fas",400:"far",normal:"far",300:"fal"},R=(p=(f=[1,2,3,4,5,6,7,8,9,10]).concat([11,12,13,14,15,16,17,18,19,20]),["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"]),M={GROUP:"group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},D=["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","flip-both","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter",M.GROUP,M.SWAP_OPACITY,M.PRIMARY,M.SECONDARY].concat(f.map((function(t){return"".concat(t,"x")}))).concat(p.map((function(t){return"w-".concat(t)}))),B=d.FontAwesomeConfig||{};_&&"function"==typeof _.querySelector&&[["data-family-prefix","familyPrefix"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach((function(t){t=(e=a(t,2))[0];var e=e[1];null!=(t=""===(t=function(t){var e=_.querySelector("script["+t+"]");if(e)return e.getAttribute(t)}(t))||"false"!==t&&("true"===t||t))&&(B[e]=t)})),(p=s({},{familyPrefix:"fa",replacementClass:C,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0},B)).autoReplaceSvg||(p.observeMutations=!1);var O=s({},p);d.FontAwesomeConfig=O,(p=d||{})[u]||(p[u]={}),p[u].styles||(p[u].styles={}),p[u].hooks||(p[u].hooks={}),p[u].shims||(p[u].shims=[]);var F=p[u],P=[],H=(p=function t(){_.removeEventListener("DOMContentLoaded",t),H=1,P.map((function(t){return t()}))},!1);function I(){}g&&((H=(_.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(_.readyState))||_.addEventListener("DOMContentLoaded",p));var U,j="pending",N="settled",W="fulfilled",z="rejected",q=void 0!==t&&void 0!==t.process&&"function"==typeof t.process.emit,Y=void 0===r?setTimeout:r,K=[];function V(){for(var t=0;t<K.length;t++)K[t][0](K[t][1]);U=!(K=[])}function X(t,e){K.push([t,e]),U||(U=!0,Y(V,0))}function G(t){var e=(r=t.owner)._state,n=r._data,r=t[e];t=t.then;if("function"==typeof r){e=W;try{n=r(n)}catch(r){Q(t,r)}}J(t,n)||(e===W&&Z(t,n),e===z&&Q(t,n))}function J(t,e){var n;try{if(t===e)throw new TypeError("A promises callback cannot return that same promise.");if(e&&("function"==typeof e||"object"===i(e))){var r=e.then;if("function"==typeof r)return r.call(e,(function(r){n||(n=!0,(e===r?$:Z)(t,r))}),(function(e){n||(n=!0,Q(t,e))})),1}}catch(r){return n||Q(t,r),1}}function Z(t,e){t!==e&&J(t,e)||$(t,e)}function $(t,e){t._state===j&&(t._state=N,t._data=e,X(et,t))}function Q(t,e){t._state===j&&(t._state=N,t._data=e,X(nt,t))}function tt(t){t._then=t._then.forEach(G)}function et(t){t._state=W,tt(t)}function nt(e){e._state=z,tt(e),!e._handled&&q&&t.process.emit("unhandledRejection",e._data,e)}function rt(e){t.process.emit("rejectionHandled",e)}function it(t){if("function"!=typeof t)throw new TypeError("Promise resolver "+t+" is not a function");if(this instanceof it==0)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(t,e){function n(t){Q(e,t)}try{t((function(t){Z(e,t)}),n)}catch(t){n(t)}}(t,this)}it.prototype={constructor:it,_state:j,_then:null,_data:void 0,_handled:!1,then:function(t,e){var n={owner:this,then:new this.constructor(I),fulfilled:t,rejected:e};return!e&&!t||this._handled||(this._handled=!0,this._state===z&&q&&X(rt,this)),this._state===W||this._state===z?X(G,n):this._then.push(n),n.then},catch:function(t){return this.then(null,t)}},it.all=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.all().");return new it((function(e,n){for(var r,i=[],o=0,s=0;s<t.length;s++)(r=t[s])&&"function"==typeof r.then?r.then(function(t){return o++,function(n){i[t]=n,--o||e(i)}}(s),n):i[s]=r;o||e(i)}))},it.race=function(t){if(!Array.isArray(t))throw new TypeError("You must pass an array to Promise.race().");return new it((function(e,n){for(var r,i=0;i<t.length;i++)(r=t[i])&&"function"==typeof r.then?r.then(e,n):e(r)}))},it.resolve=function(t){return t&&"object"===i(t)&&t.constructor===it?t:new it((function(e){e(t)}))},it.reject=function(t){return new it((function(e,n){n(t)}))};var ot="function"==typeof Promise?Promise:it,st={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function at(t){if(t&&g){var e=_.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t;for(var n=_.head.childNodes,r=null,i=n.length-1;-1<i;i--){var o=n[i],s=(o.tagName||"").toUpperCase();-1<["STYLE","LINK"].indexOf(s)&&(r=o)}return _.head.insertBefore(e,r),t}}function lt(){for(var t=12,e="";0<t--;)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[62*Math.random()|0];return e}function ct(t){for(var e=[],n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function ht(t){return t.classList?ct(t.classList):(t.getAttribute("class")||"").split(" ").filter((function(t){return t}))}function ut(t){return"".concat(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ft(t){return Object.keys(t||{}).reduce((function(e,n){return e+"".concat(n,": ").concat(t[n],";")}),"")}function pt(t){return t.size!==st.size||t.x!==st.x||t.y!==st.y||t.rotate!==st.rotate||t.flipX||t.flipY}function dt(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")};t="translate(".concat(32*e.x,", ").concat(32*e.y,") "),n="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),e="rotate(".concat(e.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(t," ").concat(n," ").concat(e)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}var _t={x:0,y:0,width:"100%",height:"100%"};function mt(t){return t.attributes&&(t.attributes.fill||!(1<arguments.length&&void 0!==arguments[1])||arguments[1])&&(t.attributes.fill="black"),t}function gt(t){var e,n=(d=t.icons).main,r=d.mask,i=t.prefix,o=t.iconName,a=t.transform,l=t.symbol,c=t.title,h=t.maskId,u=t.titleId,f=t.extra,p=void 0!==(e=t.watchable)&&e,d=(_=r.found?r:n).width,_=(t=_.height,(e="fak"===i)?"":"fa-w-".concat(Math.ceil(d/t*16)));_=[O.replacementClass,o?"".concat(O.familyPrefix,"-").concat(o):"",_].filter((function(t){return-1===f.classes.indexOf(t)})).filter((function(t){return""!==t||!!t})).concat(f.classes).join(" "),_={children:[],attributes:s({},f.attributes,{"data-prefix":i,"data-icon":o,class:_,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(d," ").concat(t)})},t=e&&!~f.classes.indexOf("fa-fw")?{width:"".concat(d/t*16*.0625,"em")}:{};p&&(_.attributes[b]=""),c&&_.children.push({tag:"title",attributes:{id:_.attributes["aria-labelledby"]||"title-".concat(u||lt())},children:[c]});o=s({},_,{prefix:i,iconName:o,main:n,mask:r,maskId:h,transform:a,symbol:l,styles:s({},t,f.styles)});var m,g,y,C,v,w,S,E,A,x=(A=r.found&&n.found?(m=(h=o).children,g=h.attributes,a=h.main,t=h.mask,r=h.maskId,n=h.transform,y=a.width,h=a.icon,a=t.width,t=t.icon,n=dt({transform:n,containerWidth:a,iconWidth:y}),a={tag:"rect",attributes:s({},_t,{fill:"white"})},y=h.children?{children:h.children.map(mt)}:{},y={tag:"g",attributes:s({},n.inner),children:[mt(s({tag:h.tag,attributes:s({},h.attributes,n.path)},y))]},n={tag:"g",attributes:s({},n.outer),children:[y]},y="mask-".concat(r||lt()),r="clip-".concat(r||lt()),n={tag:"mask",attributes:s({},_t,{id:y,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[a,n]},n={tag:"defs",children:[{tag:"clipPath",attributes:{id:r},children:"g"===(t=t).tag?t.children:[t]},n]},m.push(n,{tag:"rect",attributes:s({fill:"currentColor","clip-path":"url(#".concat(r,")"),mask:"url(#".concat(y,")")},_t)}),{children:m,attributes:g}):(y=o,A=o.children,x=o.attributes,m=o.main,g=o.transform,0<(y=ft(o.styles)).length&&(x.style=y),pt(g)?(g=dt({transform:g,containerWidth:m.width,iconWidth:m.width}),A.push({tag:"g",attributes:s({},g.outer),children:[{tag:"g",attributes:s({},g.inner),children:[{tag:m.icon.tag,children:m.icon.children,attributes:s({},m.icon.attributes,g.path)}]}]})):A.push(m.icon),{children:A,attributes:x})).attributes;return o.children=A.children,o.attributes=x,l?(v=(C=o).prefix,w=C.iconName,S=C.children,[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:s({},E=C.attributes,{id:!0===(C=C.symbol)?"".concat(v,"-").concat(O.familyPrefix,"-").concat(w):C}),children:S}]}]):(E=(l=o).children,v=l.main,w=l.mask,C=l.attributes,S=l.styles,pt(o=l.transform)&&v.found&&!w.found&&(l=v.width,w=v.height,v=.5,C.style=ft(s({},S,{"transform-origin":"".concat(l/w/2+o.x/16,"em ").concat(v+o.y/16,"em")}))),[{tag:"svg",attributes:C,children:E}])}function yt(t){var e=t.content,n=t.width,r=t.height,i=t.transform,o=t.title,a=t.extra,l=t.watchable,c=void 0!==l&&l;t=s({},a.attributes,o?{title:o}:{},{class:a.classes.join(" ")});return c&&(t[b]=""),l=s({},a.styles),pt(i)&&(l.transform=(a=(c={transform:i,startCentered:!0,width:n,height:r}).transform,i=c.width,r=void 0===(n=c.height)?16:n,c=void 0!==(n=c.startCentered)&&n,n="",n+=c&&y?"translate(".concat(a.x/16-(void 0===i?16:i)/2,"em, ").concat(a.y/16-r/2,"em) "):c?"translate(calc(-50% + ".concat(a.x/16,"em), calc(-50% + ").concat(a.y/16,"em)) "):"translate(".concat(a.x/16,"em, ").concat(a.y/16,"em) "),n+="scale(".concat(a.size/16*(a.flipX?-1:1),", ").concat(a.size/16*(a.flipY?-1:1),") "),n+="rotate(".concat(a.rotate,"deg) ")),l["-webkit-transform"]=l.transform),0<(l=ft(l)).length&&(t.style=l),(l=[]).push({tag:"span",attributes:t,children:[e]}),o&&l.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),l}function Ct(t,e,n,r){for(var i,o,s,a,l=Object.keys(t),c=l.length,h=void 0!==r?(s=e,a=r,function(t,e,n,r){return s.call(a,t,e,n,r)}):e,u=void 0===n?(i=1,t[l[0]]):(i=0,n);i<c;i++)u=h(u,t[o=l[i]],o,t);return u}u=function(){};var bt=O.measurePerformance&&h&&h.mark&&h.measure?h:{mark:u,measure:u},vt='FA "5.15.3"',wt=function(t){bt.mark("".concat(vt," ").concat(t," ends")),bt.measure("".concat(vt," ").concat(t),"".concat(vt," ").concat(t," begins"),"".concat(vt," ").concat(t," ends"))},St=function(t){return bt.mark("".concat(vt," ").concat(t," begins")),function(){return wt(t)}};function Et(t){for(var e="",n=0;n<t.length;n++)e+=("000"+t.charCodeAt(n).toString(16)).slice(-4);return e}function At(){function t(t){return Ct(xt,(function(e,n,r){return e[r]=Ct(n,t,{}),e}),{})}Lt=t((function(t,e,n){return e[3]&&(t[e[3]]=n),t})),Tt=t((function(t,e,n){return e=e[2],t[n]=n,e.forEach((function(e){t[e]=n})),t}));var e="far"in xt;Rt=Ct(kt,(function(t,n){var r=n[0],i=n[1];n=n[2];return t[r]={prefix:i="far"!==i||e?i:"fas",iconName:n},t}),{})}var xt=F.styles,kt=F.shims,Lt={},Tt={},Rt={};function Mt(t,e){return(Lt[t]||{})[e]}At();var Dt=F.styles;function Bt(t){return t.reduce((function(t,e){var n,r=function(t,e){e=(n=e.split("-"))[0];var n=n.slice(1).join("-");return e!==t||""===n||~D.indexOf(n)?null:n}(O.familyPrefix,e);return Dt[e]||O.autoFetchSvg&&-1<Object.keys(A).indexOf(e)?t.prefix=e:r?(n="fa"===t.prefix?Rt[r]||{prefix:null,iconName:null}:{},t.iconName=n.iconName||r,t.prefix=n.prefix||t.prefix):e!==O.replacementClass&&0!==e.indexOf("fa-w-")&&t.rest.push(e),t}),{prefix:null,iconName:null,rest:[]})}function Ot(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}function Ft(t){var e,n=t.tag,r=void 0===(i=t.attributes)?{}:i,i=void 0===(i=t.children)?[]:i;return"string"==typeof t?ut(t):"<".concat(n," ").concat((e=r,Object.keys(e||{}).reduce((function(t,n){return t+"".concat(n,'="').concat(ut(e[n]),'" ')}),"").trim()),">").concat(i.map(Ft).join(""),"</").concat(n,">")}var Pt=function(){};function Ht(t){return"string"==typeof(t.getAttribute?t.getAttribute(b):null)}var It={replace:function(t){var e=t[0],n=t[1].map(Ft).join("\n");e.parentNode&&e.outerHTML?e.outerHTML=n+(O.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," Font Awesome fontawesome.com --\x3e"):""):e.parentNode&&(t=document.createElement("span"),e.parentNode.replaceChild(t,e),t.outerHTML=n)},nest:function(t){var e=t[0],n=t[1];if(~ht(e).indexOf(O.replacementClass))return It.replace(t);var r=new RegExp("".concat(O.familyPrefix,"-.*"));delete n[0].attributes.style,delete n[0].attributes.id,t=n[0].attributes.class.split(" ").reduce((function(t,e){return(e===O.replacementClass||e.match(r)?t.toSvg:t.toNode).push(e),t}),{toNode:[],toSvg:[]}),n[0].attributes.class=t.toSvg.join(" "),n=n.map(Ft).join("\n"),e.setAttribute("class",t.toNode.join(" ")),e.setAttribute(b,""),e.innerHTML=n}};function Ut(t){t()}function jt(t,e){var n="function"==typeof e?e:Pt;0===t.length?n():("async"===O.mutateApproach&&d.requestAnimationFrame||Ut)((function(){var e=!0!==O.autoReplaceSvg&&It[O.autoReplaceSvg]||It.replace,r=St("mutate");t.map(e),r(),n()}))}var Nt=!1;function Wt(){Nt=!1}var zt=null;var qt=function(t){var e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t?t.toLowerCase().split(" ").reduce((function(t,e){var n=e.toLowerCase().split("-"),r=(e=n[0],n.slice(1).join("-"));if(e&&"h"===r)return t.flipX=!0,t;if(e&&"v"===r)return t.flipY=!0,t;if(r=parseFloat(r),isNaN(r))return t;switch(e){case"grow":t.size=t.size+r;break;case"shrink":t.size=t.size-r;break;case"left":t.x=t.x-r;break;case"right":t.x=t.x+r;break;case"up":t.y=t.y-r;break;case"down":t.y=t.y+r;break;case"rotate":t.rotate=t.rotate+r}return t}),e):e};function Yt(t){var e,n=(a=function(t){var e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),r=void 0!==t.innerText?t.innerText.trim():"",i=Bt(ht(t));return e&&n&&(i.prefix=e,i.iconName=n),i.prefix&&1<r.length?i.iconName=(e=i.prefix,n=t.innerText,(Tt[e]||{})[n]):i.prefix&&1===r.length&&(i.iconName=Mt(i.prefix,Et(t.innerText))),i}(t)).iconName,r=a.prefix,i=a.rest,o=(l=(c=t).getAttribute("style"),c=[],c=l?l.split(";").reduce((function(t,e){e=(n=e.split(":"))[0];var n=n.slice(1);return e&&0<n.length&&(t[e]=n.join(":").trim()),t}),{}):c),s=qt(t.getAttribute("data-fa-transform")),a=null!==(e=(e=t).getAttribute("data-fa-symbol"))&&(""===e||e),l=(c=ct((l=t).attributes).reduce((function(t,e){return"class"!==t.name&&"style"!==t.name&&(t[e.name]=e.value),t}),{}),e=l.getAttribute("title"),l=l.getAttribute("data-fa-title-id"),O.autoA11y&&(e?c["aria-labelledby"]="".concat(O.replacementClass,"-title-").concat(l||lt()):(c["aria-hidden"]="true",c.focusable="false")),c),c=(c=(c=t).getAttribute("data-fa-mask"))?Bt(c.split(" ").map((function(t){return t.trim()}))):{prefix:null,iconName:null,rest:[]};return{iconName:n,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:r,transform:s,symbol:a,mask:c,maskId:t.getAttribute("data-fa-mask-id"),extra:{classes:i,styles:o,attributes:l}}}function Kt(t){this.name="MissingIcon",this.message=t||"Icon unavailable",this.stack=(new Error).stack}(Kt.prototype=Object.create(Error.prototype)).constructor=Kt;r={attributeType:"XML",repeatCount:"indefinite",dur:"2s"},h={tag:"path",attributes:s({},p={fill:"currentColor"},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})},u=s({},r,{attributeName:"opacity"});var Vt={tag:"g",children:[h,{tag:"circle",attributes:s({},p,{cx:"256",cy:"364",r:"28"}),children:[{tag:"animate",attributes:s({},r,{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:s({},u,{values:"1;0;1;1;0;1;"})}]},{tag:"path",attributes:s({},p,{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:[{tag:"animate",attributes:s({},u,{values:"1;0;0;0;0;1;"})}]},{tag:"path",attributes:s({},p,{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:s({},u,{values:"0;0;1;1;0;0;"})}]}]},Xt=F.styles;function Gt(t){var e=t[0],n=t[1];t=a(t.slice(4),1)[0];return{found:!0,width:e,height:n,icon:Array.isArray(t)?{tag:"g",attributes:{class:"".concat(O.familyPrefix,"-").concat(M.GROUP)},children:[{tag:"path",attributes:{class:"".concat(O.familyPrefix,"-").concat(M.SECONDARY),fill:"currentColor",d:t[0]}},{tag:"path",attributes:{class:"".concat(O.familyPrefix,"-").concat(M.PRIMARY),fill:"currentColor",d:t[1]}}]}:{tag:"path",attributes:{fill:"currentColor",d:t}}}}function Jt(t,e){return new ot((function(n,r){var i={found:!1,width:512,height:512,icon:Vt};if(t&&e&&Xt[e]&&Xt[e][t])return n(Gt(Xt[e][t]));t&&e&&!O.showMissingIcons?r(new Kt("Icon is missing for prefix ".concat(e," with icon name ").concat(t))):n(i)}))}var Zt=F.styles;function $t(t){var e,n,r,i,o,s,l,c,h,u,f,p,d,_,m,g,C,b,v=Yt(t);return~v.extra.classes.indexOf(k)?(f=t,_=(p=v).title,m=p.transform,g=p.extra,b=C=null,y&&(d=parseInt(getComputedStyle(f).fontSize,10),C=(p=f.getBoundingClientRect()).width/d,b=p.height/d),O.autoA11y&&!_&&(g.attributes["aria-hidden"]="true"),ot.resolve([f,yt({content:f.innerHTML,width:C,height:b,transform:m,title:_,extra:g,watchable:!0})])):(e=t,n=v.iconName,r=v.title,i=v.titleId,o=v.prefix,s=v.transform,l=v.symbol,c=v.mask,h=v.maskId,u=v.extra,new ot((function(t,f){ot.all([Jt(n,o),Jt(c.iconName,c.prefix)]).then((function(c){c=(f=a(c,2))[0];var f=f[1];t([e,gt({icons:{main:c,mask:f},prefix:o,iconName:n,transform:s,symbol:l,mask:f,maskId:h,title:r,titleId:i,extra:u,watchable:!0})])}))})))}function Qt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(g){var n=_.documentElement.classList,r=function(t){return n.add("".concat(w,"-").concat(t))},i=function(t){return n.remove("".concat(w,"-").concat(t))},o=O.autoFetchSvg?Object.keys(A):Object.keys(Zt),s=[".".concat(k,":not([").concat(b,"])")].concat(o.map((function(t){return".".concat(t,":not([").concat(b,"])")}))).join(", ");if(0!==s.length){o=[];try{o=ct(t.querySelectorAll(s))}catch(t){}if(0<o.length){r("pending"),i("complete");var a=St("onTree"),l=o.reduce((function(t,e){try{var n=$t(e);n&&t.push(n)}catch(t){E||t instanceof Kt&&console.error(t)}return t}),[]);return new ot((function(t,n){ot.all(l).then((function(n){jt(n,(function(){r("active"),r("complete"),i("pending"),"function"==typeof e&&e(),a(),t()}))})).catch((function(){a(),n()}))}))}}}}function te(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;$t(t).then((function(t){t&&jt([t],e)}))}function ee(t,e){var n="".concat("data-fa-pseudo-element-pending").concat(e.replace(":","-"));return new ot((function(r,i){if(null!==t.getAttribute(n))return r();var o,a,l,c,h=ct(t.children).filter((function(t){return t.getAttribute(v)===e}))[0],u=d.getComputedStyle(t,e),f=u.getPropertyValue("font-family").match(L),p=u.getPropertyValue("font-weight"),m=u.getPropertyValue("content");if(h&&!f)return t.removeChild(h),r();f&&"none"!==m&&""!==m?(u=u.getPropertyValue("content"),o=~["Solid","Regular","Light","Duotone","Brands","Kit"].indexOf(f[2])?x[f[2].toLowerCase()]:T[p],u=Et(3===u.length?u.substr(1,1):u),u=Mt(o,u),!(a=u)||h&&h.getAttribute("data-prefix")===o&&h.getAttribute("data-icon")===a?r():(t.setAttribute(n,a),h&&t.removeChild(h),(c=(l={iconName:null,title:null,titleId:null,prefix:null,transform:st,symbol:!1,mask:null,maskId:null,extra:{classes:[],styles:{},attributes:{}}}).extra).attributes[v]=e,Jt(u,o).then((function(i){var h=gt(s({},l,{icons:{main:i,mask:{prefix:null,iconName:null,rest:[]}},prefix:o,iconName:a,extra:c,watchable:!0}));i=_.createElement("svg");":before"===e?t.insertBefore(i,t.firstChild):t.appendChild(i),i.outerHTML=h.map(Ft).join("\n"),t.removeAttribute(n),r()})).catch(i))):r()}))}function ne(t){return ot.all([ee(t,":before"),ee(t,":after")])}function re(t){return!(t.parentNode===document.head||~S.indexOf(t.tagName.toUpperCase())||t.getAttribute(v)||t.parentNode&&"svg"===t.parentNode.tagName)}function ie(t){if(g)return new ot((function(e,n){var r=ct(t.querySelectorAll("*")).filter(re).map(ne),i=St("searchPseudoElements");Nt=!0,ot.all(r).then((function(){i(),Wt(),e()})).catch((function(){i(),Wt(),n()}))}))}function oe(){var t,e="fa",n=C,r=O.familyPrefix,i=O.replacementClass,o='svg:not(:root).svg-inline--fa {\n overflow: visible;\n}\n\n.svg-inline--fa {\n display: inline-block;\n font-size: inherit;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n}\n.svg-inline--fa.fa-lg {\n vertical-align: -0.225em;\n}\n.svg-inline--fa.fa-w-1 {\n width: 0.0625em;\n}\n.svg-inline--fa.fa-w-2 {\n width: 0.125em;\n}\n.svg-inline--fa.fa-w-3 {\n width: 0.1875em;\n}\n.svg-inline--fa.fa-w-4 {\n width: 0.25em;\n}\n.svg-inline--fa.fa-w-5 {\n width: 0.3125em;\n}\n.svg-inline--fa.fa-w-6 {\n width: 0.375em;\n}\n.svg-inline--fa.fa-w-7 {\n width: 0.4375em;\n}\n.svg-inline--fa.fa-w-8 {\n width: 0.5em;\n}\n.svg-inline--fa.fa-w-9 {\n width: 0.5625em;\n}\n.svg-inline--fa.fa-w-10 {\n width: 0.625em;\n}\n.svg-inline--fa.fa-w-11 {\n width: 0.6875em;\n}\n.svg-inline--fa.fa-w-12 {\n width: 0.75em;\n}\n.svg-inline--fa.fa-w-13 {\n width: 0.8125em;\n}\n.svg-inline--fa.fa-w-14 {\n width: 0.875em;\n}\n.svg-inline--fa.fa-w-15 {\n width: 0.9375em;\n}\n.svg-inline--fa.fa-w-16 {\n width: 1em;\n}\n.svg-inline--fa.fa-w-17 {\n width: 1.0625em;\n}\n.svg-inline--fa.fa-w-18 {\n width: 1.125em;\n}\n.svg-inline--fa.fa-w-19 {\n width: 1.1875em;\n}\n.svg-inline--fa.fa-w-20 {\n width: 1.25em;\n}\n.svg-inline--fa.fa-pull-left {\n margin-right: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-pull-right {\n margin-left: 0.3em;\n width: auto;\n}\n.svg-inline--fa.fa-border {\n height: 1.5em;\n}\n.svg-inline--fa.fa-li {\n width: 2em;\n}\n.svg-inline--fa.fa-fw {\n width: 1.25em;\n}\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\n.fa-layers {\n display: inline-block;\n height: 1em;\n position: relative;\n text-align: center;\n vertical-align: -0.125em;\n width: 1em;\n}\n.fa-layers svg.svg-inline--fa {\n -webkit-transform-origin: center center;\n transform-origin: center center;\n}\n\n.fa-layers-counter, .fa-layers-text {\n display: inline-block;\n position: absolute;\n text-align: center;\n}\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\n.fa-layers-counter {\n background-color: #ff253a;\n border-radius: 1em;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\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: 0.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\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\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\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\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\n.fa-lg {\n font-size: 1.3333333333em;\n line-height: 0.75em;\n vertical-align: -0.0667em;\n}\n\n.fa-xs {\n font-size: 0.75em;\n}\n\n.fa-sm {\n font-size: 0.875em;\n}\n\n.fa-1x {\n font-size: 1em;\n}\n\n.fa-2x {\n font-size: 2em;\n}\n\n.fa-3x {\n font-size: 3em;\n}\n\n.fa-4x {\n font-size: 4em;\n}\n\n.fa-5x {\n font-size: 5em;\n}\n\n.fa-6x {\n font-size: 6em;\n}\n\n.fa-7x {\n font-size: 7em;\n}\n\n.fa-8x {\n font-size: 8em;\n}\n\n.fa-9x {\n font-size: 9em;\n}\n\n.fa-10x {\n font-size: 10em;\n}\n\n.fa-fw {\n text-align: center;\n width: 1.25em;\n}\n\n.fa-ul {\n list-style-type: none;\n margin-left: 2.5em;\n padding-left: 0;\n}\n.fa-ul > li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';return r===e&&i===n||(t=new RegExp("\\.".concat(e,"\\-"),"g"),e=new RegExp("\\--".concat(e,"\\-"),"g"),n=new RegExp("\\.".concat(n),"g"),o=o.replace(t,".".concat(r,"-")).replace(e,"--".concat(r,"-")).replace(n,".".concat(i))),o}function se(){O.autoAddCss&&!ue&&(at(oe()),ue=!0)}function ae(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(Ft)}}),Object.defineProperty(t,"node",{get:function(){if(g){var e=_.createElement("div");return e.innerHTML=t.html,e.children}}}),t}function le(t){var e=void 0===(e=t.prefix)?"fa":e;if(t=t.iconName)return Ot(he.definitions,e,t)||Ot(F.styles,e,t)}var ce,he=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.definitions={}}var e,n;return e=t,(n=[{key:"add",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.reduce(this._pullDefinitions,{});Object.keys(i).forEach((function(e){t.definitions[e]=s({},t.definitions[e]||{},i[e]),function t(e,n,r){r=void 0!==(i=(2<arguments.length&&void 0!==r?r:{}).skipHooks)&&i;var i=Object.keys(n).reduce((function(t,e){var r=n[e];return r.icon?t[r.iconName]=r.icon:t[e]=r,t}),{});"function"!=typeof F.hooks.addPack||r?F.styles[e]=s({},F.styles[e]||{},i):F.hooks.addPack(e,i),"fas"===e&&t("fa",n)}(e,i[e]),At()}))}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(t,e){var n=e.prefix&&e.iconName&&e.icon?{0:e}:e;return Object.keys(n).map((function(e){var r=(i=n[e]).prefix,i=(e=i.iconName,i.icon);t[r]||(t[r]={}),t[r][e]=i})),t}}])&&o(e.prototype,n),t}()),ue=!1,fe={i2svg:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(g){se();var e=void 0===(e=t.node)?_:e;t=void 0===(t=t.callback)?function(){}:t;return O.searchPseudoElements&&ie(e),Qt(e,t)}return ot.reject("Operation requires a DOM of some kind.")},css:oe,insertCss:function(){ue||(at(oe()),ue=!0)},watch:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.autoReplaceSvgRoot,n=t.observeMutationsRoot;!1===O.autoReplaceSvg&&(O.autoReplaceSvg=!0),O.observeMutations=!0,t=function(){var t,r,i,o;de({autoReplaceSvgRoot:e}),t={treeCallback:Qt,nodeCallback:te,pseudoElementsCallback:ie,observeMutationsRoot:n},m&&O.observeMutations&&(r=t.treeCallback,i=t.nodeCallback,o=t.pseudoElementsCallback,t=void 0===(t=t.observeMutationsRoot)?_:t,zt=new m((function(t){Nt||ct(t).forEach((function(t){var e,n;"childList"===t.type&&0<t.addedNodes.length&&!Ht(t.addedNodes[0])&&(O.searchPseudoElements&&o(t.target),r(t.target)),"attributes"===t.type&&t.target.parentNode&&O.searchPseudoElements&&o(t.target.parentNode),"attributes"===t.type&&Ht(t.target)&&~R.indexOf(t.attributeName)&&("class"===t.attributeName?(e=(n=Bt(ht(t.target))).prefix,n=n.iconName,e&&t.target.setAttribute("data-prefix",e),n&&t.target.setAttribute("data-icon",n)):i(t.target))}))})),g&&zt.observe(t,{childList:!0,attributes:!0,characterData:!0,subtree:!0}))},g&&(H?setTimeout(t,0):P.push(t))}},pe=(u=(ce=function(t){var e,n,r=void 0===(e=(n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).transform)?st:e,i=void 0!==(e=n.symbol)&&e,o=void 0===(e=n.mask)?null:e,a=void 0===(e=n.maskId)?null:e,l=void 0===(e=n.title)?null:e,c=void 0===(e=n.titleId)?null:e,h=void 0===(e=n.classes)?[]:e,u=void 0===(e=n.attributes)?{}:e,f=void 0===(n=n.styles)?{}:n;if(t){var p=t.prefix,d=t.iconName,_=t.icon;return ae(s({type:"icon"},t),(function(){return se(),O.autoA11y&&(l?u["aria-labelledby"]="".concat(O.replacementClass,"-title-").concat(c||lt()):(u["aria-hidden"]="true",u.focusable="false")),gt({icons:{main:Gt(_),mask:o?Gt(o.icon):{found:!1,width:null,height:null,icon:{}}},prefix:p,iconName:d,transform:s({},st,r),symbol:i,title:l,maskId:a,titleId:c,extra:{attributes:u,styles:f,classes:h}})}))}},function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(t||{}).icon?t:le(t||{});t=(t=e.mask)&&((t||{}).icon?t:le(t||{}));return ce(n,s({},e,{mask:t}))}),{noAuto:function(){O.autoReplaceSvg=!1,O.observeMutations=!1,zt&&zt.disconnect()},config:O,dom:fe,library:he,parse:{transform:function(t){return qt(t)}},findIconDefinition:le,icon:u,text:function(t){var e,n,r=void 0===(e=(n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).transform)?st:e,i=void 0===(e=n.title)?null:e,o=void 0===(e=n.classes)?[]:e,a=void 0===(e=n.attributes)?{}:e,c=void 0===(n=n.styles)?{}:n;return ae({type:"text",content:t},(function(){return se(),yt({content:t,transform:s({},st,r),title:i,extra:{attributes:a,styles:c,classes:["".concat(O.familyPrefix,"-layers-text")].concat(l(o))}})}))},counter:function(t){var e,n,r=void 0===(e=(n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).title)?null:e,i=void 0===(e=n.classes)?[]:e,o=void 0===(e=n.attributes)?{}:e,a=void 0===(n=n.styles)?{}:n;return ae({type:"counter",content:t},(function(){return se(),n=(e={content:t.toString(),title:r,extra:{attributes:o,styles:a,classes:["".concat(O.familyPrefix,"-layers-counter")].concat(l(i))}}).content,c=e.title,e=s({},(h=e.extra).attributes,c?{title:c}:{},{class:h.classes.join(" ")}),0<(h=ft(h.styles)).length&&(e.style=h),(h=[]).push({tag:"span",attributes:e,children:[n]}),c&&h.push({tag:"span",attributes:{class:"sr-only"},children:[c]}),h;var e,n,c,h}))},layer:function(t){var e=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).classes,n=void 0===e?[]:e;return ae({type:"layer"},(function(){se();var e=[];return t((function(t){Array.isArray(t)?t.map((function(t){e=e.concat(t.abstract)})):e=e.concat(t.abstract)})),[{tag:"span",attributes:{class:["".concat(O.familyPrefix,"-layers")].concat(l(n)).join(" ")},children:e}]}))},toHtml:Ft}),de=function(){var t=void 0===(t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).autoReplaceSvgRoot)?_:t;(0<Object.keys(F.styles).length||O.autoFetchSvg)&&g&&O.autoReplaceSvg&&pe.dom.i2svg({node:t})}}).call(this,n(1),n(54).setImmediate)},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,i=t.indexOf("["),o=t.indexOf("]");-1!=i&&-1!=o&&(t=t.substring(0,i)+t.substring(i,o).replace(/:/g,";")+t.substring(o,t.length));for(var s=n.exec(t||""),a={},l=14;l--;)a[r[l]]=s[l]||"";return-1!=i&&-1!=o&&(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,n){(function(e){t.exports=function(t){return n&&e.isBuffer(t)||r&&(t instanceof ArrayBuffer||i(t))};var n="function"==typeof e&&"function"==typeof e.isBuffer,r="function"==typeof ArrayBuffer,i=function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}}).call(this,n(11).Buffer)},function(t,e,n){var r=n(38),i=n(24),o=n(2),s=n(9),a=n(25),l=n(26),c=n(3)("socket.io-client:manager"),h=n(23),u=n(53),f=Object.prototype.hasOwnProperty;function p(t,e){if(!(this instanceof p))return new p(t,e);t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new u({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],t=e.parser||s,this.encoder=new t.Encoder,this.decoder=new t.Decoder,this.autoConnect=!1!==e.autoConnect,this.autoConnect&&this.open()}(t.exports=p).prototype.emitAll=function(){for(var t in this.emit.apply(this,arguments),this.nsps)f.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},p.prototype.updateSocketIds=function(){for(var t in this.nsps)f.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},p.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},o(p.prototype),p.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},p.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},p.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},p.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},p.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},p.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},p.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},p.prototype.open=p.prototype.connect=function(t,e){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=r(this.uri,this.opts);var n=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var o,s,l=a(n,"open",(function(){i.onopen(),t&&t()})),h=a(n,"error",(function(e){var n;c("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",e),t?((n=new Error("Connection error")).data=e,t(n)):i.maybeReconnectOnOpen()}));return!1!==this._timeout&&(o=this._timeout,c("connect attempt will timeout after %d",o),s=setTimeout((function(){c("connect attempt timed out after %d",o),l.destroy(),n.close(),n.emit("error","timeout"),i.emitAll("connect_timeout",o)}),o),this.subs.push({destroy:function(){clearTimeout(s)}})),this.subs.push(l),this.subs.push(h),this},p.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(a(t,"data",l(this,"ondata"))),this.subs.push(a(t,"ping",l(this,"onping"))),this.subs.push(a(t,"pong",l(this,"onpong"))),this.subs.push(a(t,"error",l(this,"onerror"))),this.subs.push(a(t,"close",l(this,"onclose"))),this.subs.push(a(this.decoder,"decoded",l(this,"ondecoded")))},p.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},p.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},p.prototype.ondata=function(t){this.decoder.add(t)},p.prototype.ondecoded=function(t){this.emit("packet",t)},p.prototype.onerror=function(t){c("error",t),this.emitAll("error",t)},p.prototype.socket=function(t,e){var n,r=this.nsps[t];function o(){~h(n.connecting,r)||n.connecting.push(r)}return r||(r=new i(this,t,e),this.nsps[t]=r,n=this,r.on("connecting",o),r.on("connect",(function(){r.id=n.generateId(t)})),this.autoConnect&&o()),r},p.prototype.destroy=function(t){~(t=h(this.connecting,t))&&this.connecting.splice(t,1),this.connecting.length||this.close()},p.prototype.packet=function(t){c("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,(function(n){for(var r=0;r<n.length;r++)e.engine.write(n[r],t.options);e.encoding=!1,e.processPacketQueue()})))},p.prototype.processPacketQueue=function(){var t;0<this.packetBuffer.length&&!this.encoding&&(t=this.packetBuffer.shift(),this.packet(t))},p.prototype.cleanup=function(){c("cleanup");for(var t=this.subs.length,e=0;e<t;e++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},p.prototype.close=p.prototype.disconnect=function(){c("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},p.prototype.onclose=function(t){c("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},p.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t,e,n=this;this.backoff.attempts>=this._reconnectionAttempts?(c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(t=this.backoff.duration(),c("will wait %dms before reconnect attempt",t),this.reconnecting=!0,e=setTimeout((function(){n.skipReconnect||(c("attempting reconnect"),n.emitAll("reconnect_attempt",n.backoff.attempts),n.emitAll("reconnecting",n.backoff.attempts),n.skipReconnect||n.open((function(t){t?(c("reconnect attempt error"),n.reconnecting=!1,n.reconnect(),n.emitAll("reconnect_error",t.data)):(c("reconnect success"),n.onreconnect())})))}),t),this.subs.push({destroy:function(){clearTimeout(e)}}))},p.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){var r=n(12),i=n(41),o=n(49);n=n(50);e.polling=function(t){var e,n,s=!1,a=!1,l=!1!==t.jsonp;if("undefined"!=typeof location&&(e="https:"===location.protocol,n=(n=location.port)||(e?443:80),s=t.hostname!==location.hostname||n!==t.port,a=t.secure!==e),t.xdomain=s,t.xscheme=a,"open"in new r(t)&&!t.forceJSONP)return new i(t);if(!l)throw new Error("JSONP disabled");return new o(t)},e.websocket=n},function(t,e,n){var r=n(13),i=n(5),o=n(0),s=n(6),a=n(22),l=n(7)("engine.io-client:polling");t.exports=h;var c=null!=new(n(12))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),r.call(this,t)}s(h,r),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e,n=this;function r(){l("paused"),n.readyState="paused",t()}this.readyState="pausing",this.polling||!this.writable?(e=0,this.polling&&(l("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){l("pre-pause polling complete"),--e||r()}))),this.writable||(l("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){l("pre-pause writing complete"),--e||r()})))):r()},h.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;l("polling got data %s",t),o.decodePayload(t,this.socket.binaryType,(function(t,n,r){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){l("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;function n(){e.writable=!0,e.emit("drain")}this.writable=!1,o.encodePayload(t,this.supportsBinary,(function(t){e.doWrite(t,n)}))},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"==e&&443!==Number(this.port)||"http"==e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){(function(e){var r=n(10),i=Object.prototype.toString,o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);t.exports=function t(n){if(!n||"object"!=typeof n)return!1;if(r(n)){for(var i=0,a=n.length;i<a;i++)if(t(n[i]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(n)||"function"==typeof ArrayBuffer&&n instanceof ArrayBuffer||o&&n instanceof Blob||s&&n instanceof File)return!0;if(n.toJSON&&"function"==typeof n.toJSON&&1===arguments.length)return t(n.toJSON(),!0);for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l)&&t(n[l]))return!0;return!1}}).call(this,n(11).Buffer)},function(t,e,n){"use strict";var r,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o={},s=0,a=0;function l(t){for(var e="";e=i[t%64]+e,0<(t=Math.floor(t/64)););return e}function c(){var t=l(+new Date);return t!==r?(s=0,r=t):t+"."+l(s++)}for(;a<64;a++)o[i[a]]=a;c.encode=l,c.decode=function(t){var e=0;for(a=0;a<t.length;a++)e=64*e+o[t.charAt(a)];return e},t.exports=c},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e,n){var r=n(9),i=n(2),o=n(52),s=n(25),a=n(26),l=n(3)("socket.io-client:socket"),c=n(5),h=n(21);t.exports=p;var u={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=i.prototype.emit;function p(t,e,n){this.io=t,this.nsp=e,(this.json=this).ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}i(p.prototype),p.prototype.subEvents=function(){var t;this.subs||(t=this.io,this.subs=[s(t,"open",a(this,"onopen")),s(t,"packet",a(this,"onpacket")),s(t,"close",a(this,"onclose"))])},p.prototype.open=p.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},p.prototype.send=function(){var t=o(arguments);return t.unshift("message"),this.emit.apply(this,t),this},p.prototype.emit=function(t){if(u.hasOwnProperty(t))return f.apply(this,arguments),this;var e=o(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:h(e))?r.BINARY_EVENT:r.EVENT,data:e,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(l("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},p.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},p.prototype.onopen=function(){var t;l("transport is open - connecting"),"/"!==this.nsp&&(this.query?(t="object"==typeof this.query?c.encode(this.query):this.query,l("sending connect packet with query %s",t),this.packet({type:r.CONNECT,query:t})):this.packet({type:r.CONNECT}))},p.prototype.onclose=function(t){l("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},p.prototype.onpacket=function(t){var e=t.nsp===this.nsp,n=t.type===r.ERROR&&"/"===t.nsp;if(e||n)switch(t.type){case r.CONNECT:this.onconnect();break;case r.EVENT:case r.BINARY_EVENT:this.onevent(t);break;case r.ACK:case r.BINARY_ACK:this.onack(t);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",t.data)}},p.prototype.onevent=function(t){var e=t.data||[];l("emitting event %j",e),null!=t.id&&(l("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?f.apply(this,e):this.receiveBuffer.push(e)},p.prototype.ack=function(t){var e=this,n=!1;return function(){var i;n||(n=!0,i=o(arguments),l("sending ack %j",i),e.packet({type:h(i)?r.BINARY_ACK:r.ACK,id:t,data:i}))}},p.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(l("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):l("bad ack %s",t.id)},p.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},p.prototype.emitBuffered=function(){for(var t=0;t<this.receiveBuffer.length;t++)f.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},p.prototype.ondisconnect=function(){l("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},p.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},p.prototype.close=p.prototype.disconnect=function(){return this.connected&&(l("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},p.prototype.compress=function(t){return this.flags.compress=t,this},p.prototype.binary=function(t){return this.flags.binary=t,this}},function(t,e){t.exports=function(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}},function(t,e){var n=[].slice;t.exports=function(t,e){if("function"!=typeof(e="string"==typeof e?t[e]:e))throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}},function(t,e,n){var r=n(29),i=n(9),o=n(18),s=n(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 n=r(t),i=n.source,l=n.id;t=n.path,t=a[l]&&t in a[l].nsps,l=e.forceNew||e["force new connection"]||!1===e.multiplex||t?(s("ignoring socket cache for %s",i),o(i,e)):(a[l]||(s("new io instance for %s",i),a[l]=o(i,e)),a[l]);return n.query&&!e.query&&(e.query=n.query),l.socket(n.path,e)}e.protocol=i.protocol,e.connect=l,e.Manager=n(18),e.Socket=n(24)},function(t,e,n){t.exports=function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}l=n[s]={exports:{}},e[s][0].call(l.exports,(function(t){return i(e[s][1][t]||t)}),l,l.exports,t,e,n,r)}return n[s].exports}for(var o=!1,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){"use strict";function r(t){if(!t.element.parentElement)return null;var e=window.getComputedStyle(t.element.parentElement),n=parseInt(e.getPropertyValue("height")),r=Math.max(0,parseInt(e.getPropertyValue("width")));e=window.getComputedStyle(t.element),n-=parseInt(e.getPropertyValue("padding-top"))+parseInt(e.getPropertyValue("padding-bottom")),e=r-(parseInt(e.getPropertyValue("padding-right"))+parseInt(e.getPropertyValue("padding-left")))-t._core.viewport.scrollBarWidth;return{cols:Math.floor(e/t._core._renderCoordinator.dimensions.actualCellWidth),rows:Math.floor(n/t._core._renderCoordinator.dimensions.actualCellHeight)}}function i(t){var e=r(t);e&&(t.rows===e.rows&&t.cols===e.cols||(t._core._renderCoordinator.clear(),t.resize(e.cols,e.rows)))}Object.defineProperty(n,"__esModule",{value:!0}),n.proposeGeometry=r,n.fit=i,n.apply=function(t){t.prototype.proposeGeometry=function(){return r(this)},t.prototype.fit=function(){i(this)}}},{}]},{},[1])(1)},function(t,e,n){var r=n(16),i=n(3)("socket.io-client:url");t.exports=function(t,e){var n=t;return e=e||"undefined"!=typeof location&&location,null==t&&(t=e.protocol+"//"+e.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?e.protocol+t:e.host+t),/^(https?|wss?):\/\//.test(t)||(i("protocol-less url %s",t),t=void 0!==e?e.protocol+"//"+t:"https://"+t),i("parse %s",t),n=r(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/",t=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host,n.id=n.protocol+"://"+t+":"+n.port,n.href=n.protocol+"://"+t+(e&&e.port===n.port?"":":"+n.port),n}},function(t,e,n){function r(t){var n;function r(){if(r.enabled){var t=r,i=+new Date;t.diff=i-(n||i),t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=e.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var a=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;a++;var i=e.formatters[r];return"function"==typeof i&&(r=o[a],n=i.call(t,r),o.splice(a,1),a--),n})),e.formatArgs.call(t,o),(r.log||e.log||console.log.bind(console)).apply(t,o)}}return r.namespace=t,r.enabled=e.enabled(t),r.useColors=e.useColors(),r.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),r.destroy=i,"function"==typeof e.init&&e.init(r),e.instances.push(r),r}function i(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=r.debug=r.default=r).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var n;e.save(t),e.names=[],e.skips=[];var r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(n=0;n<e.instances.length;n++){var o=e.instances[n];o.enabled=e.enabled(o.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(8),e.instances=[],e.names=[],e.skips=[],e.formatters={}},function(t,e,n){(function(r){function i(){var t;try{t=e.storage.debug}catch(t){}return!t&&void 0!==r&&"env"in r?r.env.DEBUG:t}(e=t.exports=n(32)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n,r,i=this.useColors;t[0]=(i?"%c":"")+this.namespace+(i?" %c":" ")+t[0]+(i?"%c ":" ")+"+"+e.humanize(this.diff),i&&(i="color: "+this.color,t.splice(1,0,i,"color: inherit"),t[r=n=0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(r=n))})),t.splice(r,0,i))},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=i,e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"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=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(i())}).call(this,n(4))},function(t,e,n){function r(t){var n;function r(){if(r.enabled){var t=r,i=+new Date;t.diff=i-(n||i),t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=e.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var a=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;a++;var i=e.formatters[r];return"function"==typeof i&&(r=o[a],n=i.call(t,r),o.splice(a,1),a--),n})),e.formatArgs.call(t,o),(r.log||e.log||console.log.bind(console)).apply(t,o)}}return r.namespace=t,r.enabled=e.enabled(t),r.useColors=e.useColors(),r.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),r.destroy=i,"function"==typeof e.init&&e.init(r),e.instances.push(r),r}function i(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=r.debug=r.default=r).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var n;e.save(t),e.names=[],e.skips=[];var r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(n=0;n<e.instances.length;n++){var o=e.instances[n];o.enabled=e.enabled(o.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(8),e.instances=[],e.names=[],e.skips=[],e.formatters={}},function(t,e,n){function r(t){if(t)return function(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}(t)}(t.exports=r).prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){var r=n(10),i=n(17),o=(n=Object.prototype.toString,"function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===n.call(Blob)),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===n.call(File);e.deconstructPacket=function(t){var e=[],n=t.data;return(t=t).data=function t(e,n){if(!e)return e;if(i(e)){var o={_placeholder:!0,num:n.length};return n.push(e),o}if(r(e)){for(var s=new Array(e.length),a=0;a<e.length;a++)s[a]=t(e[a],n);return s}if("object"==typeof e&&!(e instanceof Date)){var l;s={};for(l in e)s[l]=t(e[l],n);return s}return e}(n,e),t.attachments=e.length,{packet:t,buffers:e}},e.reconstructPacket=function(t,e){return t.data=function t(e,n){if(!e)return e;if(e&&e._placeholder)return n[e.num];if(r(e))for(var i=0;i<e.length;i++)e[i]=t(e[i],n);else if("object"==typeof e)for(var o in e)e[o]=t(e[o],n);return e}(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){var n=0,a=t;!function t(l,c,h){if(!l)return l;if(o&&l instanceof Blob||s&&l instanceof File){n++;var u=new FileReader;u.onload=function(){h?h[c]=this.result:a=this.result,--n||e(a)},u.readAsArrayBuffer(l)}else if(r(l))for(var f=0;f<l.length;f++)t(l[f],f,l);else if("object"==typeof l&&!i(l))for(var p in l)t(l[p],p,l)}(a),n||e(a)}},function(t,e,n){"use strict";e.byteLength=function(t){var e;return 3*((t=(e=c(t))[0])+(e=e[1]))/4-e},e.toByteArray=function(t){var e,n,r=(s=c(t))[0],s=s[1],a=new o(function(t,e){return 3*(t+e)/4-e}(r,s)),l=0,h=0<s?r-4:r;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],a[l++]=e>>16&255,a[l++]=e>>8&255,a[l++]=255&e;return 2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,a[l++]=255&e),1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(function(t,e,n){for(var i,o=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(function(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}(i));return o.join("")}(t,s,a<s+16383?a:s+16383));return 1==i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2==i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");return[t=-1===(t=t.indexOf("="))?e:t,t===e?0:4-t%4]}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,c=l>>1,h=-7,u=n?i-1:0,f=n?-1:1;n=t[e+u];for(u+=f,o=n&(1<<-h)-1,n>>=-h,h+=a;0<h;o=256*o+t[e+u],u+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;0<h;s=256*s+t[e+u],u+=f,h-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(n?-1:1);s+=Math.pow(2,r),o-=c}return(n?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,l=8*o-i-1,c=(1<<l)-1,h=c>>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1;o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(e+=1<=s+h?u/r:u*Math.pow(2,1-h))*r&&(s++,r/=2),c<=s+h?(a=0,s=c):1<=s+h?(a=(e*r-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));8<=i;t[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;0<l;t[n+f]=255&s,f+=p,s/=256,l-=8);t[n+f-p]|=128*o}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){t.exports=n(39),t.exports.parser=n(0)},function(t,e,n){var r=n(19),i=n(2),o=n(7)("engine.io-client:socket"),s=n(23),a=n(0),l=n(16),c=n(5);function h(t,e){if(!(this instanceof h))return new h(t,e);e=e||{},t&&"object"==typeof t&&(e=t,t=null),t?(t=l(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=l(e.host).host),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=!1!==e.jsonp,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=!1!==e.perMessageDeflate&&(e.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||null,this.key=e.key||null,this.passphrase=e.passphrase||null,this.cert=e.cert||null,this.ca=e.ca||null,this.ciphers=e.ciphers||null,this.rejectUnauthorized=void 0===e.rejectUnauthorized||e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),"undefined"!=typeof self&&!this.isReactNative||(e.extraHeaders&&0<Object.keys(e.extraHeaders).length&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}(t.exports=h).priorWebsocketSuccess=!1,i(h.prototype),h.protocol=a.protocol,(h.Socket=h).Transport=n(13),h.transports=n(19),h.parser=n(0),h.prototype.createTransport=function(t){o('creating transport "%s"',t);var e=function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(this.query);e.EIO=a.protocol,e.transport=t;var n=this.transportOptions[t]||{};return this.id&&(e.sid=this.id),new r[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},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){o("setting transport %s",t.name);var e=this;this.transport&&(o("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),(this.transport=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){o('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),n=!1,r=this;function i(){var i;r.onlyBinaryUpgrades&&(i=!this.supportsBinary&&r.transport.supportsBinary,n=n||i),n||(o('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",(function(i){n||("pong"===i.type&&"probe"===i.data?(o('probe transport "%s" pong',t),r.upgrading=!0,r.emit("upgrading",e),e&&(h.priorWebsocketSuccess="websocket"===e.name,o('pausing current transport "%s"',r.transport.name),r.transport.pause((function(){n||"closed"!==r.readyState&&(o("changing transport and sending upgrade packet"),f(),r.setTransport(e),e.send([{type:"upgrade"}]),r.emit("upgrade",e),e=null,r.upgrading=!1,r.flush())})))):(o('probe transport "%s" failed',t),(i=new Error("probe error")).transport=e.name,r.emit("upgradeError",i)))})))}function s(){n||(n=!0,f(),e.close(),e=null)}function a(n){var i=new Error("probe error: "+n);i.transport=e.name,s(),o('probe transport "%s" failed because of error: %s',t,n),r.emit("upgradeError",i)}function l(){a("transport closed")}function c(){a("socket closed")}function u(t){e&&t.name!==e.name&&(o('"%s" works - aborting "%s"',t.name,e.name),s())}function f(){e.removeListener("open",i),e.removeListener("error",a),e.removeListener("close",l),r.removeListener("close",c),r.removeListener("upgrading",u)}h.priorWebsocketSuccess=!1,e.once("open",i),e.once("error",a),e.once("close",l),this.once("close",c),this.once("upgrading",u),e.open()},h.prototype.onOpen=function(){if(o("socket open"),this.readyState="open",h.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){o("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},h.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(o('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else o('packet received with socket readyState "%s"',this.readyState)},h.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},h.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout((function(){"closed"!==e.readyState&&e.onClose("ping timeout")}),t||e.pingInterval+e.pingTimeout)},h.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout((function(){o("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)}),t.pingInterval)},h.prototype.ping=function(){var t=this;this.sendPacket("ping",(function(){t.emit("ping")}))},h.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emit("drain"):this.flush()},h.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(o("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},h.prototype.write=h.prototype.send=function(t,e,n){return this.sendPacket("message",t,e,n),this},h.prototype.sendPacket=function(t,e,n,r){"function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((n=n||{}).compress=!1!==n.compress,this.emit("packetCreate",n={type:t,data:e,options:n}),this.writeBuffer.push(n),r&&this.once("flush",r),this.flush())},h.prototype.close=function(){var t;function e(){t.onClose("forced close"),o("socket closing - telling transport to close"),t.transport.close()}function n(){t.removeListener("upgrade",n),t.removeListener("upgradeError",n),e()}function r(){t.once("upgrade",n),t.once("upgradeError",n)}return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",(t=this).writeBuffer.length?this.once("drain",(function(){(this.upgrading?r:e)()})):(this.upgrading?r:e)()),this},h.prototype.onError=function(t){o("socket error %j",t),h.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},h.prototype.onClose=function(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(o('socket close with reason: "%s"',t),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)},h.prototype.filterUpgrades=function(t){for(var e=[],n=0,r=t.length;n<r;n++)~s(this.transports,t[n])&&e.push(t[n]);return e}},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},function(t,e,n){var r=n(12),i=n(20),o=n(2),s=n(6),a=n(7)("engine.io-client:polling-xhr");function l(){}function c(t){var e,n;i.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,"undefined"!=typeof location&&(e="https:"===location.protocol,n=(n=location.port)||(e?443:80),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port,this.xs=t.secure!==e)}function h(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,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.extraHeaders=t.extraHeaders,this.create()}function u(){for(var t in h.requests)h.requests.hasOwnProperty(t)&&h.requests[t].abort()}t.exports=c,t.exports.Request=h,s(c,i),c.prototype.supportsBinary=!0,c.prototype.request=function(t){return(t=t||{}).uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new h(t)},c.prototype.doWrite=function(t,e){t=this.request({method:"POST",data:t,isBinary:"string"!=typeof t&&void 0!==t});var n=this;t.on("success",e),t.on("error",(function(t){n.onError("xhr post error",t)})),this.sendXhr=t},c.prototype.doPoll=function(){a("xhr poll");var t=this.request(),e=this;t.on("data",(function(t){e.onData(t)})),t.on("error",(function(t){e.onError("xhr poll error",t)})),this.pollXhr=t},o(h.prototype),h.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new r(t),n=this;try{a("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var i in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&e.setRequestHeader(i,this.extraHeaders[i])}catch(t){}if("POST"===this.method)try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=!0),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){n.onLoad()},e.onerror=function(){n.onError(e.responseText)}):e.onreadystatechange=function(){if(2===e.readyState)try{var t=e.getResponseHeader("Content-Type");n.supportsBinary&&"application/octet-stream"===t&&(e.responseType="arraybuffer")}catch(t){}4===e.readyState&&(200===e.status||1223===e.status?n.onLoad():setTimeout((function(){n.onError(e.status)}),0))},a("xhr data %s",this.data),e.send(this.data)}catch(t){return void setTimeout((function(){n.onError(t)}),0)}"undefined"!=typeof document&&(this.index=h.requestsCount++,h.requests[this.index]=this)},h.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},h.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},h.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},h.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=l:this.xhr.onreadystatechange=l,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete h.requests[this.index],this.xhr=null}},h.prototype.onLoad=function(){var t,e;try{try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t="application/octet-stream"===e&&this.xhr.response||this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},h.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},h.prototype.abort=function(){this.cleanup()},h.requestsCount=0,h.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",u):"function"==typeof addEventListener&&(o="onpagehide"in self?"pagehide":"unload",addEventListener(o,u,!1)))},function(t,e){t.exports=Object.keys||function(t){var e,n=[],r=Object.prototype.hasOwnProperty;for(e in t)r.call(t,e)&&n.push(e);return n}},function(t,e){t.exports=function(t,e,n){var r=t.byteLength;if(e=e||0,n=n||r,t.slice)return t.slice(e,n);if(e<0&&(e+=r),n<0&&(n+=r),r<n&&(n=r),r<=e||n<=e||0===r)return new ArrayBuffer(0);for(var i=new Uint8Array(t),o=new Uint8Array(n-e),s=e,a=0;s<n;s++,a++)o[a]=i[s];return o.buffer}},function(t,e){function n(){}t.exports=function(t,e,r){var i=!1;return r=r||n,0===(o.count=t)?e():o;function o(t,n){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(i=!0,e(t),e=r):0!==o.count||i||e(null,n)}}},function(t,e){var n,r,i,o=String.fromCharCode;function s(t){for(var e,n,r=[],i=0,o=t.length;i<o;)55296<=(e=t.charCodeAt(i++))&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function a(t,e){if(!(55296<=t&&t<=57343))return 1;if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function l(t,e){return o(t>>e&63|128)}function c(){if(r<=i)throw Error("Invalid byte index");var t=255&n[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}t.exports={version:"2.1.2",encode:function(t,e){for(var n=!1!==(e=e||{}).strict,r=s(t),i=r.length,c=-1,h="";++c<i;)h+=function(t,e){if(0==(4294967168&t))return o(t);var n="";return 0==(4294965248&t)?n=o(t>>6&31|192):0==(4294901760&t)?(a(t,e)||(t=65533),n=o(t>>12&15|224),n+=l(t,6)):0==(4292870144&t)&&(n=o(t>>18&7|240),n+=l(t,12),n+=l(t,6)),n+o(63&t|128)}(r[c],n);return h},decode:function(t,e){var l=!1!==(e=e||{}).strict;n=s(t),r=n.length,i=0;for(var h,u=[];!1!==(h=function(t){var e,o;if(r<i)throw Error("Invalid byte index");if(i==r)return!1;if(e=255&n[i],i++,0==(128&e))return e;if(192==(224&e)){if(128<=(o=(31&e)<<6|c()))return o;throw Error("Invalid continuation byte")}if(224==(240&e)){if(2048<=(o=(15&e)<<12|c()<<6|c()))return a(o,t)?o:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&65536<=(o=(7&e)<<18|c()<<12|c()<<6|c())&&o<=1114111)return o;throw Error("Invalid UTF-8 detected")}(l));)u.push(h);return function(t){for(var e,n=t.length,r=-1,i="";++r<n;)65535<(e=t[r])&&(i+=o((e-=65536)>>>10&1023|55296),e=56320|1023&e),i+=o(e);return i}(u)}}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<t.length;r++)n[t.charCodeAt(r)]=r;e.encode=function(e){for(var n=new Uint8Array(e),r=n.length,i="",o=0;o<r;o+=3)i+=t[n[o]>>2],i+=t[(3&n[o])<<4|n[o+1]>>4],i+=t[(15&n[o+1])<<2|n[o+2]>>6],i+=t[63&n[o+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,i,o,s=.75*t.length,a=t.length,l=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);s=new ArrayBuffer(s);for(var c=new Uint8Array(s),h=0;h<a;h+=4)e=n[t.charCodeAt(h)],r=n[t.charCodeAt(h+1)],i=n[t.charCodeAt(h+2)],o=n[t.charCodeAt(h+3)],c[l++]=e<<2|r>>4,c[l++]=(15&r)<<4|i>>2,c[l++]=(3&i)<<6|63&o;return s}}()},function(t,e){var n=void 0!==n?n:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),i=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=n&&n.prototype.append&&n.prototype.getBlob;function s(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e,n=t.buffer;return t.byteLength!==n.byteLength&&((e=new Uint8Array(t.byteLength)).set(new Uint8Array(n,t.byteOffset,t.byteLength)),n=e.buffer),n}return t}))}function a(t,e){e=e||{};var r=new n;return s(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function l(t,e){return new Blob(s(t),e||{})}"undefined"!=typeof Blob&&(a.prototype=Blob.prototype,l.prototype=Blob.prototype),t.exports=r?i?Blob:l:o?a:void 0},function(t,e,n){function r(t){var n;function r(){if(r.enabled){var t=r,i=+new Date;t.diff=i-(n||i),t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=e.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var a=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;a++;var i=e.formatters[r];return"function"==typeof i&&(r=o[a],n=i.call(t,r),o.splice(a,1),a--),n})),e.formatArgs.call(t,o),(r.log||e.log||console.log.bind(console)).apply(t,o)}}return r.namespace=t,r.enabled=e.enabled(t),r.useColors=e.useColors(),r.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),r.destroy=i,"function"==typeof e.init&&e.init(r),e.instances.push(r),r}function i(){var t=e.instances.indexOf(this);return-1!==t&&(e.instances.splice(t,1),!0)}(e=t.exports=r.debug=r.default=r).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){var n;e.save(t),e.names=[],e.skips=[];var r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(n=0;n<e.instances.length;n++){var o=e.instances[n];o.enabled=e.enabled(o.namespace)}},e.enabled=function(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(8),e.instances=[],e.names=[],e.skips=[],e.formatters={}},function(t,e,n){(function(e){var r=n(20),i=n(6);t.exports=c;var o,s=/\n/g,a=/\\n/g;function l(){}function c(t){r.call(this,t),this.query=this.query||{},o||(t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},o=t.___eio=t.___eio||[]),this.index=o.length;var n=this;o.push((function(t){n.onData(t)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){n.script&&(n.script.onerror=l)}),!1)}i(c,r),c.prototype.supportsBinary=!1,c.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),r.prototype.doClose.call(this)},c.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)}),100)},c.prototype.doWrite=function(t,e){var n,r,i,o,l=this;function c(){h(),e()}function h(){if(l.iframe)try{l.form.removeChild(l.iframe)}catch(t){l.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+l.iframeId+'">';o=document.createElement(t)}catch(t){(o=document.createElement("iframe")).name=l.iframeId,o.src="javascript:0"}o.id=l.iframeId,l.form.appendChild(o),l.iframe=o}this.form||(n=document.createElement("form"),r=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=i,n.method="POST",n.setAttribute("accept-charset","utf-8"),r.name="d",n.appendChild(r),document.body.appendChild(n),this.form=n,this.area=r),this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===l.iframe.readyState&&c()}:this.iframe.onload=c}}).call(this,n(1))},function(t,e,n){(function(e){var r,i,o=n(13),s=n(0),a=n(5),l=n(6),c=n(22),h=n(7)("engine.io-client:websocket");if("undefined"!=typeof WebSocket)r=WebSocket;else if("undefined"!=typeof self)r=self.WebSocket||self.MozWebSocket;else try{i=n(51)}catch(l){}var u=r||i;function f(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=r&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(u=i),o.call(this,t)}l(t.exports=f,o),f.prototype.name="websocket",f.prototype.supportsBinary=!0,f.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new u(t,e):new u(t):new u(t,e,n)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},f.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},f.prototype.write=function(t){var n=this;this.writable=!1;for(var r=t.length,i=0,o=r;i<o;i++)!function(t){s.encodePacket(t,n.supportsBinary,(function(i){var o;n.usingBrowserWebSocket||(o={},t.options&&(o.compress=t.options.compress),n.perMessageDeflate&&("string"==typeof i?e.byteLength(i):i.length)<n.perMessageDeflate.threshold&&(o.compress=!1));try{n.usingBrowserWebSocket?n.ws.send(i):n.ws.send(i,o)}catch(i){h("websocket closed before onclose event")}--r||(n.emit("flush"),setTimeout((function(){n.writable=!0,n.emit("drain")}),0))}))}(t[i])},f.prototype.onClose=function(){o.prototype.onClose.call(this)},f.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},f.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";return this.port&&("wss"==e&&443!==Number(this.port)||"ws"==e&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||(t.b64=1),(t=a.encode(t)).length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t},f.prototype.check=function(){return!(!u||"__initialize"in u&&this.name===f.prototype.name)}}).call(this,n(11).Buffer)},function(t,e){},function(t,e){t.exports=function(t,e){for(var n=[],r=(e=e||0)||0;r<t.length;r++)n[r-e]=t[r];return n}},function(t,e){function n(t){this.ms=(t=t||{}).min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=0<t.jitter&&t.jitter<=1?t.jitter:0,this.attempts=0}(t.exports=n).prototype.duration=function(){var t,e,n=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(t=Math.random(),e=Math.floor(t*this.jitter*n),n=0==(1&Math.floor(10*t))?n-e:n+e),0|Math.min(n,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;0<=e&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(55),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(1))},function(t,e,n){(function(t,e){!function(t,n){"use strict";var r,i,o,s,a,l,c,h;function u(t){delete i[t]}function f(t){if(o)setTimeout(f,0,t);else{var e=i[t];if(e){o=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{u(t),o=!1}}}}t.setImmediate||(r=1,o=!(i={}),s=t.document,h=(h=Object.getPrototypeOf&&Object.getPrototypeOf(t))&&h.setTimeout?h:t,"[object process]"==={}.toString.call(t.process)?a=function(t){e.nextTick((function(){f(t)}))}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){function e(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(n)&&f(+e.data.slice(n.length))}var n="setImmediate$"+Math.random()+"$";t.addEventListener?t.addEventListener("message",e,!1):t.attachEvent("onmessage",e),a=function(e){t.postMessage(n+e,"*")}}():a=t.MessageChannel?((c=new MessageChannel).port1.onmessage=function(t){f(t.data)},function(t){c.port2.postMessage(t)}):s&&"onreadystatechange"in s.createElement("script")?(l=s.documentElement,function(t){var e=s.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,l.removeChild(e),e=null},l.appendChild(e)}):function(t){setTimeout(f,0,t)},h.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];return i[r]={callback:t,args:e},a(r),r++},h.clearImmediate=u)}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(1),n(4))},function(t,e,n){"use strict";n.r(e);var r=n(27),i=n(14),o=n(28),s=n(15);e={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"]};s.b.add({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"]},{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"]},{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"]},e,{prefix:"fas",iconName:"cog",icon:[512,512,[],"f013","M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"]}),s.a.watch(),n(57),n(62),i.applyAddon(o);var a,l,c,h,u,f,p,d=!1,_=!1,m=!1,g=!1,y=new i,C=document.getElementById("status"),b=document.getElementById("header"),v=document.getElementById("dropupContent"),w=document.getElementById("footer"),S=document.getElementById("terminal-container");function E(){y.fit(),p.emit("resize",{cols:y.cols,rows:y.rows})}function A(t){v.innerHTML=t,logBtn.addEventListener("click",L),g&&reauthBtn.addEventListener("click",x),m&&credentialsBtn.addEventListener("click",k),_&&downloadLogBtn.addEventListener("click",T)}function x(){return console.log("re-authenticating"),!(window.location.href="/ssh/reauth")}function k(){return p.emit("control","replayCredentials"),console.log("replaying credentials"),y.focus(),!1}function L(){return a=!0===d?(_=!(d=!1),logBtn.innerHTML='<i class="fas fa-clipboard fa-fw"></i> Start Log',console.log("stopping log, "+d),h=new Date,a+"\r\n\r\nLog End for "+l+": "+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" @ "+h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"\r\n"):(_=d=!0,logBtn.innerHTML='<i class="fas fa-cog fa-spin fa-fw"></i> Stop Log',downloadLogBtn.style.color="#000",downloadLogBtn.addEventListener("click",T),console.log("starting log, "+d),h=new Date,"Log Start for "+l+": "+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" @ "+h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"\r\n\r\n"),c=h,y.focus(),!1}function T(){var t,e;!0===_&&(u="WebSSH2-"+c.getFullYear()+(c.getMonth()+1)+c.getDate()+"_"+c.getHours()+c.getMinutes()+c.getSeconds()+".log",t=new Blob([a.replace(/[\u001b\u009b][[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><;]/g,"")],{type:"text/plain"}),window.navigator.msSaveOrOpenBlob?window.navigator.msSaveBlob(t,u):((e=window.document.createElement("a")).href=window.URL.createObjectURL(t),e.download=u,document.body.appendChild(e),e.click(),document.body.removeChild(e))),y.focus()}y.open(S),y.focus(),y.fit(),window.addEventListener("resize",E,!1),p=r.connect({path:"/ssh/socket.io"}),y.on("data",(function(t){p.emit("data",t)})),p.on("data",(function(t){y.write(t),d&&(a+=t)})),p.on("connect",(function(){p.emit("geometry",y.cols,y.rows)})),p.on("setTerminalOpts",(function(t){y.setOption("cursorBlink",t.cursorBlink),y.setOption("scrollback",t.scrollback),y.setOption("tabStopWidth",t.tabStopWidth),y.setOption("bellStyle",t.bellStyle)})),p.on("title",(function(t){document.title=t})),p.on("menu",(function(t){A(t)})),p.on("status",(function(t){C.innerHTML=t})),p.on("ssherror",(function(t){C.innerHTML=t,C.style.backgroundColor="red",f=!0})),p.on("headerBackground",(function(t){b.style.backgroundColor=t})),p.on("header",(function(t){t&&(b.innerHTML=t,b.style.display="block",S.style.height="calc(100% - 38px)",E())})),p.on("footer",(function(t){l=t,w.innerHTML=t})),p.on("statusBackground",(function(t){C.style.backgroundColor=t})),p.on("allowreplay",(function(t){!0===t?(console.log("allowreplay: "+t),m=!0,A(v.innerHTML+'<a id="credentialsBtn"><i class="fas fa-key fa-fw"></i> Credentials</a>')):(m=!1,console.log("allowreplay: "+t))})),p.on("allowreauth",(function(t){!0===t?(console.log("allowreauth: "+t),g=!0,A(v.innerHTML+'<a id="reauthBtn"><i class="fas fa-key fa-fw"></i> Switch User</a>')):(g=!1,console.log("allowreauth: "+t))})),p.on("disconnect",(function(t){f||(C.style.backgroundColor="red",C.innerHTML="WEBSOCKET SERVER DISCONNECTED: "+t),p.io.reconnection(!1)})),p.on("error",(function(t){f||(C.style.backgroundColor="red",C.innerHTML="ERROR: "+t)})),p.on("reauth",(function(){g&&x()})),y.on("title",(function(t){document.title=t}))},function(t,e){},,,,,function(t,e){}]);