fcc-core
Version:
Fusion communication center.
20 lines • 61.4 kB
JavaScript
!function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="/dist/",e(0)}([function(t,e,n){window.NATS=n(1)},function(t,e,n){(function(t,r){/*!
* Nats
* Copyright(c) 2012-2016 Apcera Inc. All rights reserved.
* Copyright(c) 2011-2014 Derek Collison (derek.collison@gmail.com)
* MIT Licensed
*/
"use strict";function i(t){f.EventEmitter.call(this),this.parseOptions(t),this.initState(),this.createConnection()}function o(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t}function s(t){this.url=t,this.didConnect=!1,this.reconnects=0}var a=n(8),u=n(13),h=n(14),c=n(9),f=n(12),l=n(20),p="0.6.8",d=4222,g="nats://localhost:",y=g+d,v=512,m=0,b=1,w=2e3,E=10,_=/^MSG\s+([^\s\r\n]+)\s+([^\s\r\n]+)\s+(([^\s\r\n]+)[^\S\r\n]+)?(\d+)\r\n/i,A=/^\+OK\s*\r\n/i,S=/^-ERR\s+('.+')?\r\n/i,R=/^PING\r\n/i,O=/^PONG\r\n/i,T=/^INFO\s+([^\r\n]+)\r\n/i,x=/^SUB\s+([^\r\n]+)\r\n/i,C="\r\n",P=C.length,I=(new t(C),""),B=" ",U="SUB",j="UNSUB",L="CONNECT",k="PING"+C,z="PONG"+C,M="Subject must be supplied",N="Message can't be a function",Y="Reply can't be a function",D="Connection closed",q="Message should be a JSON object",F="User and Token can not both be provided",J=65536;e.version=p;var H=e.createInbox=function(){return"_INBOX."+l.next()};e.connect=function(t){return new i(t)},c.inherits(i,f.EventEmitter),i.prototype.createInbox=H,i.prototype.assignOption=function(t,e,n){void 0===n&&(n=e),void 0!==t[e]&&(this.options[n]=t[e])},i.prototype.parseOptions=function(e){var n=this.options={verbose:!1,pedantic:!1,reconnect:!0,maxReconnectAttempts:E,reconnectTimeWait:w,encoding:"utf8",tls:!1,waitOnFirstConnect:!1};void 0===e?n.url=y:"number"==typeof e?n.url=g+e:"string"==typeof e?n.url=e:"object"==typeof e&&(void 0!==e.port&&(n.url=g+e.port),this.assignOption(e,"url"),this.assignOption(e,"uri","url"),this.assignOption(e,"user"),this.assignOption(e,"pass"),this.assignOption(e,"token"),this.assignOption(e,"password","pass"),this.assignOption(e,"verbose"),this.assignOption(e,"pedantic"),this.assignOption(e,"reconnect"),this.assignOption(e,"maxReconnectAttempts"),this.assignOption(e,"reconnectTimeWait"),this.assignOption(e,"servers"),this.assignOption(e,"urls","servers"),this.assignOption(e,"noRandomize"),this.assignOption(e,"NoRandomize","noRandomize"),this.assignOption(e,"dontRandomize","noRandomize"),this.assignOption(e,"encoding"),this.assignOption(e,"tls"),this.assignOption(e,"secure","tls"),this.assignOption(e,"name"),this.assignOption(e,"client","name"),this.assignOption(e,"yieldTime"),this.assignOption(e,"waitOnFirstConnect"),this.assignOption(e,"json"));var r=this;if(r.user=n.user,r.pass=n.pass,r.token=n.token,r.user&&r.token)throw new Error(F);if(!t.isEncoding(n.encoding))throw new Error("Invalid Encoding:"+n.encoding);r.encoding=n.encoding,r.servers=[],Array.isArray(n.servers)?n.servers.forEach(function(t){r.servers.push(new s(h.parse(t)))}):(void 0===n.url&&(n.url=y),r.servers.push(new s(h.parse(n.url)))),n.noRandomize!==!0&&o(r.servers)},i.prototype.selectServer=function(){var t=this,e=t.servers.shift();if(t.currentServer=e,t.url=e.url,"auth"in e.url&&e.url.auth){var n=e.url.auth.split(":");1!==n.length?(void 0===t.options.user&&(t.user=n[0]),void 0===t.options.pass&&(t.pass=n[1])):void 0===t.options.token&&(t.token=n[0])}t.servers.push(e)},i.prototype.checkTLSMismatch=function(){return this.info.tls_required===!0&&this.options.tls===!1?(this.emit("error","Server requires a secure connection."),this.closeStream(),!0):this.info.tls_required===!1&&this.options.tls!==!1?(this.emit("error","Server does not support a secure connection."),this.closeStream(),!0):this.info.tls_verify===!0&&void 0===this.options.tls.cert&&(this.emit("error","Server requires a client certificate."),this.closeStream(),!0)},i.prototype.connectCB=function(){var t=this.reconnecting,e=t===!0?"reconnect":"connect";this.reconnecting=!1,this.reconnects=0,this.wasConnected=!0,this.currentServer.didConnect=!0,this.emit(e,this),this.flushPending()},i.prototype.setupHandlers=function(){var e=this,n=e.stream;void 0!==n&&(n.on("connect",function(){e.connected=!0}),n.on("close",function(t){e.closeStream(),e.emit("disconnect"),e.closed===!0||e.options.reconnect===!1||e.reconnects>=e.options.maxReconnectAttempts&&e.options.maxReconnectAttempts!==-1?e.emit("close"):e.scheduleReconnect()}),n.on("error",function(t){e.wasConnected===!0&&e.currentServer.didConnect===!0||(e.wasConnected===!1&&e.currentServer.didConnect===!1&&(e.options.waitOnFirstConnect?e.currentServer.didConnect=!0:e.servers.splice(e.servers.length-1,1)),e.wasConnected===!1&&0===e.servers.length&&e.emit("error","Could not connect to server: "+t),e.closeStream())}),n.on("data",function(n){e.inbound?e.inbound=t.concat([e.inbound,n]):e.inbound=n,e.processInbound()}))},i.prototype.sendConnect=function(){var t={lang:"node",version:p,verbose:this.options.verbose,pedantic:this.options.pedantic};void 0!==this.user&&(t.user=this.user,t.pass=this.pass),void 0!==this.token&&(t.auth_token=this.token),void 0!==this.options.name&&(t.name=this.options.name),this.stream.write(L+B+JSON.stringify(t)+C)},i.prototype.createConnection=function(){var e=[],n=[],r=0,i=this;if(null!==i.pending){var o=0;i.pending.forEach(function(s){var a=t.isBuffer(s)?s.length:t.byteLength(s);if(s===k&&null!==i.pongs&&o<i.pongs.length){var u=i.pongs[o++];void 0!==u&&(n.push(s),r+=a,e.push(u))}else s.length>3&&"P"==s[0]&&"U"==s[1]&&"B"==s[2]&&(n.push(s),r+=a)})}this.pongs=e,this.pending=n,this.pSize=r,this.pstate=m,this.info=null,this.infoReceived=!1,this.selectServer(),this.stream=a.createConnection(this.url),this.setupHandlers()},i.prototype.initState=function(){this.ssid=1,this.subs={},this.reconnects=0,this.connected=!1,this.wasConnected=!1,this.reconnecting=!1,this.server=null,this.pending=[]},i.prototype.close=function(){this.closed=!0,this.removeAllListeners(),this.closeStream(),this.ssid=-1,this.subs=null,this.pstate=-1,this.pongs=null,this.pending=null,this.pSize=0},i.prototype.closeStream=function(){null!==this.stream&&(this.stream.end(),this.stream.destroy(),this.stream=null),this.connected!==!0&&this.closed!==!0||(this.pongs=null,this.pending=null,this.pSize=0,this.connected=!1),this.inbound=null},i.prototype.flushPending=function(){if(this.connected!==!1&&null!==this.pending&&0!==this.pending.length&&this.infoReceived===!0){var e=this,n=function(t){return e.pending=[],e.pSize=0,e.stream.write(t)};if(this.pBufs){for(var r=!0,i=0;i<this.pending.length;i++)if(!t.isBuffer(this.pending[i])){r=!1;break}if(r)return n(t.concat(this.pending,this.pSize));var o=this.pending;this.pending=[],this.pSize=0;var s=!0;for(i=0;i<o.length;i++)s=this.stream.write(o[i])&&s;return s}return n(this.pending.join(I))}},i.prototype.stripPendingSubs=function(){var t=this.pending;this.pending=[],this.pSize=0;for(var e=0;e<t.length;e++)x.test(t[e])||this.sendCommand(t[e])},i.prototype.sendCommand=function(e){if(!this.closed&&null!==this.pending&&(this.pending.push(e),t.isBuffer(e)?(this.pSize+=e.length,this.pBufs=!0):this.pSize+=t.byteLength(e),this.connected===!0))if(1===this.pending.length){var n=this;r(function(){n.flushPending()})}else this.pSize>J&&this.flushPending()},i.prototype.sendSubscriptions=function(){var t="";for(var e in this.subs)if(this.subs.hasOwnProperty(e)){var n,r=this.subs[e];n=r.qgroup?[U,r.subject,r.qgroup,e+C]:[U,r.subject,e+C],t+=n.join(B)}t.length>0&&this.stream.write(t)},i.prototype.processInbound=function(){var e,n,i=this;for(i.stream.resume(),void 0!==i.options.yieldTime&&(n=Date.now());!i.closed&&i.inbound&&i.inbound.length>0;){switch(i.pstate){case m:var o=i.inbound.toString("binary",0,v);if(null!==(e=_.exec(o)))i.payload={subj:e[1],sid:parseInt(e[2],10),reply:e[4],size:parseInt(e[5],10)},i.payload.psize=i.payload.size+P,i.pstate=b;else if(null!==(e=A.exec(o)));else if(null!==(e=S.exec(o)))i.emit("error",e[1]);else if(null!==(e=O.exec(o))){var s=i.pongs&&i.pongs.shift();s&&s()}else if(null!==(e=R.exec(o)))i.sendCommand(z);else{if(null===(e=T.exec(o)))return;if(i.info=JSON.parse(e[1]),i.checkTLSMismatch()===!0)return;if(i.infoReceived===!1){if(i.options.tls!==!1&&i.stream.encrypted!==!0){var a={socket:i.stream};if("object"==typeof i.options.tls)for(var h in i.options.tls)a[h]=i.options.tls[h];i.stream=u.connect(a,function(){i.flushPending()}),i.setupHandlers()}i.sendConnect(),i.sendSubscriptions(),i.pongs.unshift(function(){i.connectCB()}),i.stream.write(k),i.infoReceived=!0,i.stripPendingSubs(),i.flushPending()}}break;case b:if(i.inbound.length<i.payload.psize)return void 0===i.payload.chunks&&(i.payload.chunks=[]),i.payload.chunks.push(i.inbound),i.payload.psize-=i.inbound.length,void(i.inbound=null);if(i.payload.chunks){i.payload.chunks.push(i.inbound.slice(0,i.payload.psize));var c=t.concat(i.payload.chunks,i.payload.size+P);i.payload.msg=c.toString(i.encoding,0,i.payload.size)}else i.payload.msg=i.inbound.toString(i.encoding,0,i.payload.size);if(i.inbound.length===i.payload.psize?i.inbound=null:i.inbound=i.inbound.slice(i.payload.psize),i.processMsg(),i.pstate=m,i.payload=null,void 0!==n&&Date.now()-n>i.options.yieldTime)return i.stream.pause(),void r(i.processInbound.bind(this))}if(e&&!this.closed){var f=e[0].length;f>=i.inbound.length?i.inbound=null:i.inbound=i.inbound.slice(f)}e=null}},i.prototype.processMsg=function(){var e=this.subs[this.payload.sid];if(void 0!==e&&(e.received+=1,e.timeout&&e.received>=e.expected&&(clearTimeout(e.timeout),e.timeout=null),void 0!==e.max&&(e.received===e.max?(delete this.subs[this.payload.sid],this.emit("unsubscribe",this.payload.sid,e.subject)):e.received>e.max&&(this.unsubscribe(this.payload.sid),e.callback=null)),e.callback)){var n=this.payload.msg;if(this.options.json)try{n=JSON.parse(new t(this.payload.msg,this.options.encoding).toString())}catch(t){n=t}e.callback(n,this.payload.reply,this.payload.subj,this.payload.sid)}},i.prototype.addServer=function(t){this.servers.push(new s(h.parse(t))),this.options.noRandomize!==!0&&o(this.servers)},i.prototype.flush=function(t){if(this.closed){if("function"==typeof t)return void t(new Error(D));throw new Error(D)}this.pongs&&(this.pongs.push(t),this.sendCommand(k),this.flushPending())},i.prototype.publish=function(e,n,r,i){if("function"==typeof e&&(i=e,e=void 0),n||(n=I),!e){if(!i)throw new Error(M);i(new Error(M))}if("function"==typeof n){if(i||r)return void i(new Error(N));i=n,n=I,r=void 0}if("function"==typeof r){if(i)return void i(new Error(Y));i=r,r=void 0}var o;if(o=void 0===r?"PUB "+e+B:"PUB "+e+B+r+B,"ArrayBuffer"in window&&ArrayBuffer.isView(n)&&(n=t.from(n)),t.isBuffer(n)){var s=new t(o.length+n.length+2*P+n.length.toString().length),a=s.write(o+n.length+C);n.copy(s,a),s.write(C,a+n.length),this.sendCommand(s)}else{var u=n;if(this.options.json){if("object"!=typeof n||Array.isArray(n))throw new Error(q);try{u=JSON.stringify(n)}catch(t){throw new Error(q)}}this.sendCommand(o+t.byteLength(u)+C+u+C)}if(void 0!==i)this.flush(i);else if(this.closed)throw new Error(D)},i.prototype.subscribe=function(t,e,n){if(this.closed)throw new Error(D);var r,i;"function"==typeof e?(n=e,e=void 0):e&&"object"==typeof e&&(r=e.queue,i=e.max),this.ssid+=1,this.subs[this.ssid]={subject:t,callback:n,received:0};var o;return"string"==typeof r?(this.subs[this.ssid].qgroup=r,o=[U,t,r,this.ssid+C]):o=[U,t,this.ssid+C],this.sendCommand(o.join(B)),this.emit("subscribe",this.ssid,t,e),i&&this.unsubscribe(this.ssid,i),this.ssid},i.prototype.unsubscribe=function(t,e){if(t&&!this.closed){var n;n=e?[j,t,e+C]:[j,t+C],this.sendCommand(n.join(B));var r=this.subs[t];void 0!==r&&(r.max=e,(void 0===r.max||r.received>=r.max)&&(delete this.subs[t],this.emit("unsubscribe",t,r.subject)))}},i.prototype.timeout=function(t,e,n,r){if(t){var i=this.subs[t];null!==i&&(i.expected=n,i.timeout=setTimeout(function(){r(t)},e))}},i.prototype.request=function(t,e,n,r){"function"==typeof e&&(r=e,e=I,n=null),"function"==typeof n&&(r=n,n=null);var i=H(),o=this.subscribe(i,n,function(t,e){r(t,e)});return this.publish(t,e,i),o},i.prototype.numSubscriptions=function(){return Object.keys(this.subs).length},i.prototype.reconnect=function(){this.closed||(this.reconnects+=1,this.createConnection(),this.currentServer.didConnect===!0&&this.emit("reconnecting"))},i.prototype.scheduleReconnect=function(){var t=this;if(0!==t.servers.length){t.wasConnected===!0&&(t.reconnecting=!0);var e=0;t.servers[0].didConnect===!0&&(e=this.options.reconnectTimeWait),setTimeout(function(){t.reconnect()},e)}}}).call(e,n(2).Buffer,n(6).setImmediate)},function(t,e,n){(function(t,r){/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
"use strict";function i(){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}}function o(){return t.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,n){if(o()<n)throw new RangeError("Invalid typed array length");return t.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(n),e.__proto__=t.prototype):(null===e&&(e=new t(n)),e.length=n),e}function t(e,n,r){if(!(t.TYPED_ARRAY_SUPPORT||this instanceof t))return new t(e,n,r);if("number"==typeof e){if("string"==typeof n)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}return a(this,e,n,r)}function a(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?p(t,e,n,r):"string"==typeof e?f(t,e,n):d(t,e)}function u(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 h(t,e,n,r){return u(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}function c(e,n){if(u(n),e=s(e,n<0?0:0|g(n)),!t.TYPED_ARRAY_SUPPORT)for(var r=0;r<n;++r)e[r]=0;return e}function f(e,n,r){if("string"==typeof r&&""!==r||(r="utf8"),!t.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var i=0|v(n,r);e=s(e,i);var o=e.write(n,r);return o!==i&&(e=e.slice(0,o)),e}function l(t,e){var n=e.length<0?0:0|g(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(e,n,r,i){if(n.byteLength,r<0||n.byteLength<r)throw new RangeError("'offset' is out of bounds");if(n.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");return n=void 0===r&&void 0===i?new Uint8Array(n):void 0===i?new Uint8Array(n,r):new Uint8Array(n,r,i),t.TYPED_ARRAY_SUPPORT?(e=n,e.__proto__=t.prototype):e=l(e,n),e}function d(e,n){if(t.isBuffer(n)){var r=0|g(n.length);return e=s(e,r),0===e.length?e:(n.copy(e,0,0,r),e)}if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||V(n.length)?s(e,0):l(e,n);if("Buffer"===n.type&&Q(n.data))return l(e,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function g(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function y(e){return+e!=e&&(e=0),t.alloc(+e)}function v(e,n){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(n){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return H(e).length;n=(""+n).toLowerCase(),i=!0}}function m(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return B(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function w(e,n,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof n&&(n=t.from(n,i)),t.isBuffer(n))return 0===n.length?-1:E(e,n,r,i,o);if("number"==typeof n)return n&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,n,r):Uint8Array.prototype.lastIndexOf.call(e,n,r):E(e,[n],r,i,o);throw new TypeError("val must be string, number or Buffer")}function E(t,e,n,r,i){function o(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}var s=1,a=t.length,u=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}var h;if(i){var c=-1;for(h=n;h<a;h++)if(o(t,h)===o(e,c===-1?0:h-c)){if(c===-1&&(c=h),h-c+1===u)return c*s}else c!==-1&&(h-=h-c),c=-1}else for(n+u>a&&(n=a-u),h=n;h>=0;h--){for(var f=!0,l=0;l<u;l++)if(o(t,h+l)!==o(e,l)){f=!1;break}if(f)return h}return-1}function _(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function A(t,e,n,r){return Z(H(e,t.length-n),t,n,r)}function S(t,e,n,r){return Z(G(e),t,n,r)}function R(t,e,n,r){return S(t,e,n,r)}function O(t,e,n,r){return Z($(e),t,n,r)}function T(t,e,n,r){return Z(W(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,h,c,f;switch(a){case 1:o<128&&(s=o);break;case 2:u=t[i+1],128===(192&u)&&(f=(31&o)<<6|63&u,f>127&&(s=f));break;case 3:u=t[i+1],h=t[i+2],128===(192&u)&&128===(192&h)&&(f=(15&o)<<12|(63&u)<<6|63&h,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:u=t[i+1],h=t[i+2],c=t[i+3],128===(192&u)&&128===(192&h)&&128===(192&c)&&(f=(15&o)<<18|(63&u)<<12|(63&h)<<6|63&c,f>65535&&f<1114112&&(s=f))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return P(r)}function P(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=tt));return n}function I(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}function B(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}function U(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=J(t[o]);return i}function j(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}function L(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function k(e,n,r,i,o,s){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>o||n<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function z(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 M(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 N(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Y(t,e,n,r,i){return i||N(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,n,r,23,4),n+4}function D(t,e,n,r,i){return i||N(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,n,r,52,8),n+8}function q(t){if(t=F(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function F(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function J(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){e=e||1/0;for(var n,r=t.length,i=null,o=[],s=0;s<r;++s){if(n=t.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<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 G(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function W(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function $(t){return K.toByteArray(q(t))}function Z(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}function V(t){return t!==t}var K=n(3),X=n(4),Q=n(5);e.Buffer=t,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==r.TYPED_ARRAY_SUPPORT?r.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,n){return a(null,t,e,n)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,n){return h(null,t,e,n)},t.allocUnsafe=function(t){return c(null,t)},t.allocUnsafeSlow=function(t){return c(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,n){if(!t.isBuffer(e)||!t.isBuffer(n))throw new TypeError("Arguments must be Buffers");if(e===n)return 0;for(var r=e.length,i=n.length,o=0,s=Math.min(r,i);o<s;++o)if(e[o]!==n[o]){r=e[o],i=n[o];break}return r<i?-1:i<r?1:0},t.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}},t.concat=function(e,n){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return t.alloc(0);var r;if(void 0===n)for(n=0,r=0;r<e.length;++r)n+=e[r].length;var i=t.allocUnsafe(n),o=0;for(r=0;r<e.length;++r){var s=e[r];if(!t.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},t.byteLength=v,t.prototype._isBuffer=!0,t.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)b(this,e,e+1);return this},t.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)b(this,e,e+3),b(this,e+1,e+2);return this},t.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)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},t.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):m.apply(this,arguments)},t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},t.prototype.compare=function(e,n,r,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),n<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&n>=r)return 0;if(i>=o)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=r-n,u=Math.min(s,a),h=this.slice(i,o),c=e.slice(n,r),f=0;f<u;++f)if(h[f]!==c[f]){s=h[f],a=c[f];break}return s<a?-1:a<s?1:0},t.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1},t.prototype.indexOf=function(t,e,n){return w(this,t,e,n,!0)},t.prototype.lastIndexOf=function(t,e,n){return w(this,t,e,n,!1)},t.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||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return A(this,t,e,n);case"ascii":return S(this,t,e,n);case"latin1":case"binary":return R(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,n){var r=this.length;e=~~e,n=void 0===n?r:~~n,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),n<e&&(n=e);var i;if(t.TYPED_ARRAY_SUPPORT)i=this.subarray(e,n),i.__proto__=t.prototype;else{var o=n-e;i=new t(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},t.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},t.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},t.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||L(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>=i&&(r-=Math.pow(2,8*e)),r},t.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||L(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},t.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),X.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),X.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),X.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),X.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;k(this,t,e,n,i,0)}var o=1,s=0;for(this[e]=255&t;++s<n&&(o*=256);)this[e+s]=t/o&255;return e+n},t.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var i=Math.pow(2,8*n)-1;k(this,t,e,n,i,0)}var o=n-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+n},t.prototype.writeUInt8=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[n]=255&e,n+1},t.prototype.writeUInt16LE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):z(this,e,n,!0),n+2},t.prototype.writeUInt16BE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):z(this,e,n,!1),n+2},t.prototype.writeUInt32LE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=255&e):M(this,e,n,!0),n+4},t.prototype.writeUInt32BE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):M(this,e,n,!1),n+4},t.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);k(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},t.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);k(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},t.prototype.writeInt8=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[n]=255&e,n+1},t.prototype.writeInt16LE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8):z(this,e,n,!0),n+2},t.prototype.writeInt16BE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>8,this[n+1]=255&e):z(this,e,n,!1),n+2},t.prototype.writeInt32LE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[n]=255&e,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24):M(this,e,n,!0),n+4},t.prototype.writeInt32BE=function(e,n,r){return e=+e,n|=0,r||k(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=255&e):M(this,e,n,!1),n+4},t.prototype.writeFloatLE=function(t,e,n){return Y(this,t,e,!0,n)},t.prototype.writeFloatBE=function(t,e,n){return Y(this,t,e,!1,n)},t.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},t.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},t.prototype.copy=function(e,n,r,i){if(r||(r=0),i||0===i||(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n<i-r&&(i=e.length-n+r);var o,s=i-r;if(this===e&&r<n&&n<i)for(o=s-1;o>=0;--o)e[o+n]=this[o+r];else if(s<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+n]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),n);return s},t.prototype.fill=function(e,n,r,i){if("string"==typeof e){if("string"==typeof n?(i=n,n=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(n<0||this.length<n||this.length<r)throw new RangeError("Out of range index");if(r<=n)return this;n>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0);var s;if("number"==typeof e)for(s=n;s<r;++s)this[s]=e;else{var a=t.isBuffer(e)?e:H(new t(e,i).toString()),u=a.length;for(s=0;s<r-n;++s)this[s+n]=a[s%u]}return this};var et=/[^+\/0-9A-Za-z-_]/g}).call(e,n(2).Buffer,function(){return this}())},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,o,s,a,u=t.length;s=n(t),a=new c(3*u/4-s),i=s>0?u-4:u;var f=0;for(e=0,r=0;e<i;e+=4,r+=3)o=h[t.charCodeAt(e)]<<18|h[t.charCodeAt(e+1)]<<12|h[t.charCodeAt(e+2)]<<6|h[t.charCodeAt(e+3)],a[f++]=o>>16&255,a[f++]=o>>8&255,a[f++]=255&o;return 2===s?(o=h[t.charCodeAt(e)]<<2|h[t.charCodeAt(e+1)]>>4,a[f++]=255&o):1===s&&(o=h[t.charCodeAt(e)]<<10|h[t.charCodeAt(e+1)]<<4|h[t.charCodeAt(e+2)]>>2,a[f++]=o>>8&255,a[f++]=255&o),a}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,e,n){for(var r,i=[],s=e;s<n;s+=3)r=(t[s]<<16)+(t[s+1]<<8)+t[s+2],i.push(o(r));return i.join("")}function a(t){for(var e,n=t.length,r=n%3,i="",o=[],a=16383,h=0,c=n-r;h<c;h+=a)o.push(s(t,h,h+a>c?c:h+a));return 1===r?(e=t[n-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=a;for(var u=[],h=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=f.length;l<p;++l)u[l]=f[l],h[f.charCodeAt(l)]=l;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,h=u>>1,c=-7,f=n?i-1:0,l=n?-1:1,p=t[e+f];for(f+=l,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,r),o-=h}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,h=8*o-i-1,c=(1<<h)-1,f=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=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*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?l/u:l*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[n+p]=255&s,p+=d,s/=256,h-=8);t[n+p-d]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(t,r){function i(t,e){this._id=t,this._clearFn=e}var o=n(7).nextTick,s=Function.prototype.apply,a=Array.prototype.slice,u={},h=0;e.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,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;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var n=h++,r=!(arguments.length<2)&&a.call(arguments,1);return u[n]=!0,o(function(){u[n]&&(r?t.apply(null,r):t.call(null),e.clearImmediate(n))}),n},e.clearImmediate="function"==typeof r?r:function(t){delete u[t]}}).call(e,n(6).setImmediate,n(6).clearImmediate)},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function s(){g&&p&&(g=!1,p.length?d=p.concat(d):y=-1,d.length&&a())}function a(){if(!g){var t=i(s);g=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,g=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function h(){}var c,f,l=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(t){f=r}}();var p,d=[],g=!1,y=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new u(t,e)),1!==d.length||g||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=h,l.addListener=h,l.once=h,l.off=h,l.removeListener=h,l.removeAllListeners=h,l.emit=h,l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(t,e,n){(function(t){"use strict";function r(e){var n=this;o.call(this),this.sock=new WebSocket(e),this.sock.addEventListener("open",function(t){n.emit("connect")}),this.sock.addEventListener("message",function(e){n.emit("data",new t(e.data))}),this.sock.addEventListener("error",function(t){n.emit("error",t)}),this.sock.addEventListener("close",function(t){n.emit("close")})}var i=n(9),o=n(12).EventEmitter;i.inherits(r,o),r.prototype.end=function(){this.destroy()},r.prototype.destroy=function(){this.sock.readyState!==WebSocket.CONNECTING&&this.sock.readyState!==WebSocket.OPEN||this.sock.close()},r.prototype.write=function(t){this.sock.readyState===WebSocket.OPEN&&this.sock.send(t)},r.prototype.pause=function(){console.warn("WebSocketProxy stream pause/resume is not supported yet.")},r.prototype.resume=function(){},e.createConnection=function(t){return new r(t.format({protocol:t.protocol,slashes:t.slashes,host:t.host,hostname:t.hostname,port:t.port,pathname:t.pathname,search:t.search,path:t.path,query:t.query,hash:t.hash}))}}).call(e,n(2).Buffer)},function(t,e,n){(function(t,r){function i(t,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(n)?r.showHidden=n:n&&e._extend(r,n),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function s(t,e){return t}function a(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function u(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return b(i)||(i=u(t,i,r)),i}var o=h(t,n);if(o)return o;var s=Object.keys(n),g=a(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),R(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(n);if(0===s.length){if(O(n)){var y=n.name?": "+n.name:"";return t.stylize("[Function"+y+"]","special")}if(_(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return t.stylize(Date.prototype.toString.call(n),"date");if(R(n))return c(n)}var v="",m=!1,w=["{","}"];if(d(n)&&(m=!0,w=["[","]"]),O(n)){var E=n.name?": "+n.name:"";v=" [Function"+E+"]"}if(_(n)&&(v=" "+RegExp.prototype.toString.call(n)),S(n)&&(v=" "+Date.prototype.toUTCString.call(n)),R(n)&&(v=" "+c(n)),0===s.length&&(!m||0==n.length))return w[0]+v+w[1];if(r<0)return _(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var A;return A=m?f(t,n,r,g,s):s.map(function(e){return l(t,n,r,g,e,m)}),t.seen.pop(),p(A,v,w)}function h(t,e){if(E(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):y(e)?t.stylize("null","null"):void 0}function c(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i){for(var o=[],s=0,a=e.length;s<a;++s)I(e,String(s))?o.push(l(t,e,n,r,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(l(t,e,n,r,i,!0))}),o}function l(t,e,n,r,i,o){var s,a,h;if(h=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},h.get?a=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(a=t.stylize("[Setter]","special")),I(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(h.value)<0?(a=y(n)?u(t,h.value,null):u(t,h.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n"))):a=t.stylize("[Circular]","special")),E(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function y(t){return null===t}function v(t){return null==t}function m(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function E(t){return void 0===t}function _(t){return A(t)&&"[object RegExp]"===x(t)}function A(t){return"object"==typeof t&&null!==t}function S(t){return A(t)&&"[object Date]"===x(t)}function R(t){return A(t)&&("[object Error]"===x(t)||t instanceof Error)}function O(t){return"function"==typeof t}function T(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function x(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}function P(){var t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var B=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(i(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(t).replace(B,function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),a=r[n];n<o;a=r[++n])s+=y(a)||!A(a)?" "+a:" "+i(a);return s},e.deprecate=function(n,i){function o(){if(!s){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),s=!0}return n.apply(this,arguments)}if(E(t.process))return function(){return e.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var s=!1;return o};var U,j={};e.debuglog=function(t){if(E(U)&&(U=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!j[t])if(new RegExp("\\b"+t+"\\b","i").test(U)){var n=r.pid;j[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else j[t]=function(){};return j[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=g,e.isNull=y,e.isNullOrUndefined=v,e.isNumber=m,e.isString=b,e.isSymbol=w,e.isUndefined=E,e.isRegExp=_,e.isObject=A,e.isDate=S,e.isError=R,e.isFunction=O,e.isPrimitive=T,e.isBuffer=n(10);var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments));
},e.inherits=n(11),e._extend=function(t,e){if(!e||!A(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(e,function(){return this}(),n(7))},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,a,u,h;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),h=n.slice(),i=h.length,u=0;u<i;u++)h[u].apply(this,a);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){e.connect=function(t,e){throw"TLS is not supported in the browser. Use WSS instead."}},function(t,e,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,n){if(t&&h(t)&&t instanceof r)return t;var i=new r;return i.parse(t,e,n),i}function o(t){return u(t)&&(t=i(t)),t instanceof r?t.format():r.prototype.format.call(t)}function s(t,e){return i(t,!1,!0).resolve(e)}function a(t,e){return t?i(t,!1,!0).resolveObject(e):e}function u(t){return"string"==typeof t}function h(t){return"object"==typeof t&&null!==t}function c(t){return null===t}function f(t){return null==t}var l=n(15);e.parse=i,e.resolve=s,e.resolveObject=a,e.format=o,e.Url=r;var p=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,g=["<",">",'"',"`"," ","\r","\n","\t"],y=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(y),m=["%","/","?",";","#"].concat(v),b=["/","?","#"],w=255,E=/^[a-z0-9A-Z_-]{0,63}$/,_=/^([a-z0-9A-Z_-]{0,63})(.*)$/,A={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=n(17);r.prototype.parse=function(t,e,n){if(!u(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t;r=r.trim();var i=p.exec(r);if(i){i=i[0];var o=i.toLowerCase();this.protocol=o,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===r.substr(0,2);!s||i&&S[i]||(r=r.substr(2),this.slashes=!0)}if(!S[i]&&(s||i&&!R[i])){for(var a=-1,h=0;h<b.length;h++){var c=r.indexOf(b[h]);c!==-1&&(a===-1||c<a)&&(a=c)}var f,d;d=a===-1?r.lastIndexOf("@"):r.lastIndexOf("@",a),d!==-1&&(f=r.slice(0,d),r=r.slice(d+1),this.auth=decodeURIComponent(f)),a=-1;for(var h=0;h<m.length;h++){var c=r.indexOf(m[h]);c!==-1&&(a===-1||c<a)&&(a=c)}a===-1&&(a=r.length),this.host=r.slice(0,a),r=r.slice(a),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var y=this.hostname.split(/\./),h=0,T=y.length;h<T;h++){var x=y[h];if(x&&!x.match(E)){for(var C="",P=0,I=x.length;P<I;P++)C+=x.charCodeAt(P)>127?"x":x[P];if(!C.match(E)){var B=y.slice(0,h),U=y.slice(h+1),j=x.match(_);j&&(B.push(j[1]),U.unshift(j[2])),U.length&&(r="/"+U.join(".")+r),this.hostname=B.join(".");break}}}if(this.hostname.length>w?this.hostname="":this.hostname=this.hostname.toLowerCase(),!g){for(var L=this.hostname.split("."),k=[],h=0;h<L.length;++h){var z=L[h];k.push(z.match(/[^A-Za-z0-9_-]/)?"xn--"+l.encode(z):z)}this.hostname=k.join(".")}var M=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+M,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!A[o])for(var h=0,T=v.length;h<T;h++){var Y=v[h],D=encodeURIComponent(Y);D===Y&&(D=escape(Y)),r=r.split(Y).join(D)}var q=r.indexOf("#");q!==-1&&(this.hash=r.substr(q),r=r.slice(0,q));var F=r.indexOf("?");if(F!==-1?(this.search=r.substr(F),this.query=r.substr(F+1),e&&(this.query=O.parse(this.query)),r=r.slice(0,F)):e&&(this.search="",this.query={}),r&&(this.pathname=r),R[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var M=this.pathname||"",z=this.search||"";this.path=M+z}return this.href=this.format(),this},r.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&h(this.query)&&Object.keys(this.query).length&&(o=O.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||R[e])&&i!==!1?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+i+n+s+r},r.prototype.resolve=function(t){return this.resolveObject(i(t,!1,!0)).format()},r.prototype.resolveObject=function(t){if(u(t)){var e=new r;e.parse(t,!1,!0),t=e}var n=new r;if(Object.keys(this).forEach(function(t){n[t]=this[t]},this),n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(n[e]=t[e])}),R[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(t.protocol&&t.protocol!==n.protocol){if(!R[t.protocol])return Object.keys(t).forEach(function(e){n[e]=t[e]}),n.href=n.format(),n;if(n.protocol=t.protocol,t.host||S[t.protocol])n.pathname=t.pathname;else{for(var i=(t.pathname||"").split("/");i.length&&!(t.host=i.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),n.pathname=i.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var o=n.pathname||"",s=n.search||"";n.path=o+s}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var a=n.pathname&&"/"===n.pathname.charAt(0),h=t.host||t.pathname&&"/"===t.pathname.charAt(0),l=h||a||n.host&&t.pathname,p=l,d=n.pathname&&n.pathname.split("/")||[],i=t.pathname&&t.pathname.split("/")||[],g=n.protocol&&!R[n.protocol];if(g&&(n.hostname="",n.port=null,n.host&&(""===d[0]?d[0]=n.host:d.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===i[0]?i[0]=t.host:i.unshift(t.host)),t.host=null),l=l&&(""===i[0]||""===d[0])),h)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,d=i;else if(i.length)d||(d=[]),d.pop(),d=d.concat(i),n.search=t.search,n.query=t.query;else if(!f(t.search)){if(g){n.hostname=n.host=d.shift();var y=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");y&&(n.auth=y.shift(),n.host=n.hostname=y.shift())}return n.search=t.search,n.query=t.query,c(n.pathname)&&c(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!d.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var v=d.slice(-1)[0],m=(n.host||t.host)&&("."===v||".."===v)||""===v,b=0,w=d.length;w>=0;w--)v=d[w],"."==v?d.splice(w,1):".."===v?(d.splice(w,1),b++):b&&(d.splice(w,1),b--);if(!l&&!p)for(;b--;b)d.unshift("..");!l||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),m&&"/"!==d.join("/").substr(-1)&&d.push("");var E=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(g){n.hostname=n.host=E?"":d.length?d.shift():"";var y=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");y&&(n.auth=y.shift(),n.host=n.hostname=y.shift())}return l=l||n.host&&d.length,l&&!E&&d.unshift(""),d.length?n.pathname=d.join("/"):(n.pathname=null,n.path=null),c(n.pathname)&&c(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var t=this.host,e=d.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,n){var r;(function(t,i){!function(o){function s(t){throw RangeError(B[t])}function a(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function u(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(I,".");var i=t.split("."),o=a(i,e).join(".");return r+o}function h(t){for(var e,n,r=[],i=0,o=t.length;i<o;)e=t.charCodeAt(i++),e>=55296&&e<=56319&&i<o?(n=t.charCodeAt(i++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--)):r.push(e);return r}function c(t){return a(t,function(t){var e="";return t>65535&&(t-=65536,e+=L(t>>>10&1023|55296),t=56320|1023&t),e+=L(t)}).join("")}function f(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:E}function l(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function p(t,e,n){var r=0;for(t=n?j(t/R):t>>1,t+=j(t/e);t>U*A>>1;r+=E)t=j(t/U);return j(r+(U+1)*t/(t+S))}function d(t){var e,n,r,i,o,a,u,h,l,d,g=[],y=t.length,v=0,m=T,b=O;for(n=t.lastIndexOf(x),n<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&s("not-basic"),g.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<y;){for(o=v,a=1,u=E;i>=y&&s("invalid-input"),h=f(t.charCodeAt(i++)),(h>=E||h>j((w-v)/a))&&s("overflow"),v+=h*a,l=u<=b?_:u>=b+A?A:u-b,!(h<l);u+=E)d=E-l,a>j(w/d)&&s("overflow"),a*=d;e=g.length+1,b=p(v-o,e,0==o),j(v/e)>w-m&&s("overflow"),m+=j(v/e),v%=e,g.splice(v++,0,m)}return c(g)}function g(t){var e,n,r,i,o,a,u,c,f,d,g,y,v,m,b,S=[];for(t=h(t),y=t.length,e=T,n=0,o=O,a=0;a<y;++a)g=t[a],g<128&&S.push(L(g));for(r=i=S.length,i&&S.push(x);r<y;){for(u=w,a=0;a<y;++a)g=t[a],g>=e&&g<u&&(u=g);for(v=r+1,u-e>j((w-n)/v)&&s("overflow"),n+=(u-e)*v,e=u,a=0;a<y;++a)if(g=t[a],g<e&&++n>w&&s("overflow"),g==e){for(c=n,f=E;d=f<=o?_:f>=o+A?A:f-o,!(c<d);f+=E)b=c-d,m=E-d,S.push(L(l(d+b%m,0))),c=j(b/m);S.push(L(l(c,0))),o=p(n,v,r==i),n=0,++r}++n,++e}return S.join("")}function y(t){return u(t,function(t){return C.test(t)?d(t.slice(4).toLowerCase()):t})}function v(t){return u(t,function(t){return P.test(t)?"xn--"+g(t):t})}var m=("object"==typeof e&&e&&!e.nodeType&&e,"object"==typeof t&&t&&!t.nodeType&&t,"object"==typeof i&&i);m.global!==m&&m.window!==m&&m.self!==m||(o=m);var b,w=2147483647,E=36,_=1,A=26,S=38,R=700,O=72,T=128,x="-",C=/^xn--/,P=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},U=E-_,j=Math.floor,L=String.fromCharCode;b={version:"1.3.2",ucs2:{decode:h,encode:c},decode:d,encode:g,toASCII:v,toUnicode:y},r=function(){return b}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(this)}).call(e,n(16)(t),function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e,n){"use strict";e.decode=e.parse=n(18),e.encode=e.stringify=n(19)},function(t,e){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,i){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var u=t.length;a>0&&u>a&&(u=a);for(var h=0;h<u;++h){var c,f,l,p,d=t[h].replace(s,"%20"),g=d.indexOf(r);g>=0?(c=d.substr(0,g),f=d.substr(g+1)):(c=d,f=""),l=decodeURIComponent(c),p=decodeURIComponent(f),n(o,l)?Array.isArray(o[l])?o[l].push(p):o[l]=[o[l],p]:o[l]=p}return o}},function(t,e){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,i){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map(function(i){var o=encodeURIComponent(n(i))+r;return Array.isArray(t[i])?t[i].map(function(t){return o+encodeURIComponent(n(t))}).join(e):o+encodeURIComponent(n(t[i]))}).join(e):i?encodeURIComponent(n(i))+r+encodeURIComponent(n(t)):""}},function(t,e,n){(function(t){/*!
* Nats
* Copyright(c) 2016 Apcera Inc. All rights reserved.
* MIT Licensed
*/
"use strict";function r(){this.buf=new t(p),this.init()}var i=n(21),o="0.6.8",s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",a=36,u=12,h=10,c=0xcfd41b9100000,f=33,l=333,p=u+h;e.version=o,r.prototype.init=function(){this.setPre(),this.initSeqAndInc(),this.fillSeq()},r.prototype.initSeqAndInc=function(){this.seq=Math.floor(Math.random()*c),this.inc=Math.floor(Math.random()*(l-f)+f)},r.prototype.setPre=function(){for(var t=i.randomBytes(u),e=0;e<u;e++){var n=t[e]%a;this.buf[e]=s.charCodeAt(n)}},r.prototype.fillSeq=function(){for(var t=this.seq,e=p-1;e>=u;e--)this.buf[e]=s.charCodeAt(t%a),t=Math.floor(t/a)},r.prototype.next=function(){return this.seq+=this.inc,this.seq>c&&this.setPre(),this.initSeqAndInc(),this.fillSeq(),this.buf.toString("ascii")};var d=new r;e.reset=function(){d.init()},e.next=function(){return d.next()},e._global=d}).call(e,n(2).Buffer)},function(t,e){"use strict";var n=window.crypto||window.msCrypto;e.randomBytes=function(t,e){var r=new Uint8Array(t);return t>0&&n.getRandomValues(r),r}}]);
//# sourceMappingURL=bundle.js.map