-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathsocketpeer.min.js
3 lines (3 loc) · 67.2 KB
/
socketpeer.min.js
1
2
3
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SocketPeer=e()}}(function(){return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[s]={exports:{}};t[s][0].call(f.exports,function(e){var n=t[s][1][e];return i(n?n:e)},f,f.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({"/browser":[function(e,t,n){function r(e){var t=this;return t instanceof r?(e=e||{},c.call(t),t._connections={socket:{success:0,error:0,attempt:0},rtc:{success:0,error:0,attempt:0}},t.peer=null,t.rtcConnected=!1,t.socketConnected=!1,s(t,{pairCode:"pairCode"in e?e.pairCode:null,socketFallback:!("socketFallback"in e)||e.socketFallback,socket:"socket"in e?e.socket:null,stream:"stream"in e?e.stream:null,url:"url"in e?e.url:"http://localhost",reconnect:!("reconnect"in e)||e.reconnect,reconnectDelay:"reconnectDelay"in e?e.reconnectDelay:1e3,timeout:"timeout"in e?e.timeout:0,autoconnect:!("autoconnect"in e)||e.autoconnect,debug:"debug"in e&&e.debug},e),t._debug("New peer"),t.on("peer.found",function(e){t.socketConnected=!0,clearTimeout(t._socketConnectTimeout),clearTimeout(t._socketReconnectDelayTimeout),t._connections.socket.attempt=0,t._connections.socket.success++,t.emit("connect"),t._connections.socket.success>0&&t.emit("reconnect"),t.initiator=e.initiator,e.initiator&&(t._send("rtc.connect"),t._rtcInit())}),t.on("rtc.signal",t._rtcSignal),t.on("rtc.connect",function(){t._rtcInit()}),t.on("busy",function(){t._socketError(new Error('Pair code "'+t.pairCode+'" already in use')),t.socket.close()}),void(t.autoconnect&&setTimeout(function(){t.connect()},0))):new r(e)}var i=e("events"),o=e("inherits"),s=e("xtend/mutable"),a=e("simple-peer"),c=i.EventEmitter;o(r,c),r.prototype.pair=function(e){var t=this;"undefined"!=typeof e&&(t.pairCode=e),t._send("pair",t.pairCode)},r.prototype.connect=function(){var e=this;return e._connections.socket.attempt++,e.socketConnected?void console.warn("Socket already connected"):(e.timeout&&(e._socketConnectTimeout=setTimeout(function(){e.socket.close();var t=new Error("Connection timeout after "+e.timeout+" ms");e.emit("connect_timeout",t),e._socketError(t)},e.timeout)),e.socket=new WebSocket(e.url.replace(/^http/,"ws")),e.socket.onopen=function(){e.pair()},e.socket.onerror=function(t){e._socketError(new Error(t.data||"Unexpected WebSocket error"))},e.socket.onmessage=function(t){var n={};try{n=JSON.parse(t.data)}catch(t){e.emit(new Error("Expected JSON-formatted WebSocket message"))}"data"===n.type?e.emit("data",n.data):e.emit(n.type,n.data)},e.socket.onclose=function(){if(e.socketConnected=!1,e._debug("close"),e.reconnect){var t=e._calcReconnectTimeout(e._connections.socket.attempt);clearTimeout(e._socketReconnectDelayTimeout),e._socketReconnectDelayTimeout=setTimeout(function(){e.connect()},t)}},e.emit("connect_attempt"),void(e._connections.socket.success>0&&e.emit("reconnect_attempt")))},r.prototype._socketError=function(e){var t=this;t._connections.socket.error++,t.emit("error",e),t.emit("connect_error",e),t._connections.socket.success>0&&t.emit("reconnect_error")},r.prototype._calcReconnectTimeout=function(e){var t=this;return Math.min(Math.pow(2,e)*t.reconnectDelay,3e4)},r.prototype._rtcInit=function(){var e=this;return e.rtcConnected?void console.warn("WebRTC peer already connected"):(e.peer=new a({initiator:e.initiator,stream:e.stream}),e.peer.on("connect",function(){clearTimeout(e._rtcReconnectTimeout),e._connections.rtc.success++,e._connections.rtc.attempt=0,e.rtcConnected=!0,e.emit("upgrade")}),e.peer.on("stream",function(t){e.emit("stream",t)}),e.peer.on("error",function(t){e._connections.rtc.error++,e.emit("upgrade_error",t),e.emit("error",t)}),e.peer.on("signal",function(t){e.rtcConnected||e._send("rtc.signal",t)}),e.peer.on("data",function(t){e.emit("data",t)}),e.peer.on("close",function(t){if(e.destroyPeer(),e.socketConnected&&e.reconnect&&e.initiator){var n=e._calcReconnectTimeout(e._connections.rtc.attempt);clearTimeout(e._rtcReconnectTimeout),e._rtcReconnectTimeout=setTimeout(function(){e._send("rtc.connect"),e._rtcInit()},n)}e.emit("downgrade")}),e._connections.rtc.attempt++,void e.emit("upgrade_attempt"))},r.prototype._rtcSignal=function(e){var t=this;t.rtcConnected||!t.peer||t.peer.destroyed||t.peer.signal(e)},r.prototype._send=function(e,t){var n=this;return n.socket?(t=JSON.stringify({type:e,data:t}),n._debug("_send",t),void n.socket.send(t)):void console.warn("Attempted to send message when socket was closed: %s",e)},r.prototype.send=function(e){var t=this;t.rtcConnected?t.peer.send(e):t._send("data",e)},r.prototype.close=function(){var e=this;e.destroyPeer(),e.socket&&e.socket.close()},r.prototype.destroy=function(){var e=this;e.reconnect=!1,e.close(),e.peer=null,e.socket=null,e.socketConnected=!1,e.rtcConnected=!1,clearTimeout(e._socketConnectTimeout),clearTimeout(e._socketReconnectDelayTimeout),clearTimeout(e._rtcReconnectTimeout)},r.prototype.destroyPeer=function(){var e=this;e.peer&&e.peer.destroy(),e.peer=null,e.rtcConnected=!1},r.prototype._debug=function(){var e=this;if(e.debug){var t=Array.prototype.slice.call(arguments);t[0]="["+e.pairCode+"] "+t[0],console.log.apply(console,t)}},t.exports=r},{events:7,inherits:10,"simple-peer":17,"xtend/mutable":34}],1:[function(e,t,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===s||t===h?62:t===a||t===l?63:t<c?-1:t<c+10?t-c+26+26:t<f+26?t-f:t<u+26?t-u+26:void 0}function n(e){function n(e){u[h++]=e}var r,i,s,a,c,u;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=e.length;c="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0,u=new o(3*e.length/4-c),s=c>0?e.length-4:e.length;var h=0;for(r=0,i=0;r<s;r+=4,i+=3)a=t(e.charAt(r))<<18|t(e.charAt(r+1))<<12|t(e.charAt(r+2))<<6|t(e.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===c?(a=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&a)):1===c&&(a=t(e.charAt(r))<<10|t(e.charAt(r+1))<<4|t(e.charAt(r+2))>>2,n(a>>8&255),n(255&a)),u}function i(e){function t(e){return r.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var i,o,s,a=e.length%3,c="";for(i=0,s=e.length-a;i<s;i+=3)o=(e[i]<<16)+(e[i+1]<<8)+e[i+2],c+=n(o);switch(a){case 1:o=e[e.length-1],c+=t(o>>2),c+=t(o<<4&63),c+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],c+=t(o>>10),c+=t(o>>4&63),c+=t(o<<2&63),c+="="}return c}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),c="0".charCodeAt(0),u="a".charCodeAt(0),f="A".charCodeAt(0),h="-".charCodeAt(0),l="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=i}("undefined"==typeof n?this.base64js={}:n)},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){(function(t){"use strict";function r(){function e(){}try{var t=new Uint8Array(1);return t.foo=function(){return 42},t.constructor=e,42===t.foo()&&t.constructor===e&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function i(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e){return this instanceof o?(o.TYPED_ARRAY_SUPPORT||(this.length=0,this.parent=void 0),"number"==typeof e?s(this,e):"string"==typeof e?a(this,e,arguments.length>1?arguments[1]:"utf8"):c(this,e)):arguments.length>1?new o(e,arguments[1]):new o(e)}function s(e,t){if(e=g(e,t<0?0:0|y(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;n++)e[n]=0;return e}function a(e,t,n){"string"==typeof n&&""!==n||(n="utf8");var r=0|w(t,n);return e=g(e,r),e.write(t,n),e}function c(e,t){if(o.isBuffer(t))return u(e,t);if(V(t))return f(e,t);if(null==t)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(t.buffer instanceof ArrayBuffer)return h(e,t);if(t instanceof ArrayBuffer)return l(e,t)}return t.length?d(e,t):p(e,t)}function u(e,t){var n=0|y(t.length);return e=g(e,n),t.copy(e,0,0,n),e}function f(e,t){var n=0|y(t.length);e=g(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e,t){var n=0|y(t.length);e=g(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function l(e,t){return o.TYPED_ARRAY_SUPPORT?(t.byteLength,e=o._augment(new Uint8Array(t))):e=h(e,new Uint8Array(t)),e}function d(e,t){var n=0|y(t.length);e=g(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e,t){var n,r=0;"Buffer"===t.type&&V(t.data)&&(n=t.data,r=0|y(n.length)),e=g(e,r);for(var i=0;i<r;i+=1)e[i]=255&n[i];return e}function g(e,t){o.TYPED_ARRAY_SUPPORT?(e=o._augment(new Uint8Array(t)),e.__proto__=o.prototype):(e.length=t,e._isBuffer=!0);var n=0!==t&&t<=o.poolSize>>>1;return n&&(e.parent=X),e}function y(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function b(e,t){if(!(this instanceof b))return new b(e,t);var n=new o(e,t);return delete n.parent,n}function w(e,t){"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=!1;if(t|=0,n=void 0===n||n===1/0?this.length:0|n,e||(e="utf8"),t<0&&(t=0),n>this.length&&(n=this.length),n<=t)return"";for(;;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"binary":return I(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;s++){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");e[n+s]=a}return s}function _(e,t,n,r){return $(z(t,e.length-n),e,n,r)}function E(e,t,n,r){return $(J(t),e,n,r)}function A(e,t,n,r){return E(e,t,n,r)}function S(e,t,n,r){return $(H(t),e,n,r)}function R(e,t,n,r){return $(q(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?Z.fromByteArray(e):Z.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var c,u,f,h;switch(a){case 1:o<128&&(s=o);break;case 2:c=e[i+1],128===(192&c)&&(h=(31&o)<<6|63&c,h>127&&(s=h));break;case 3:c=e[i+1],u=e[i+2],128===(192&c)&&128===(192&u)&&(h=(15&o)<<12|(63&c)<<6|63&u,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:c=e[i+1],u=e[i+2],f=e[i+3],128===(192&c)&&128===(192&u)&&128===(192&f)&&(h=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&f,h>65535&&h<1114112&&(s=h))}}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 L(r)}function L(e){var t=e.length;if(t<=K)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=K));return n}function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;i++)r+=String.fromCharCode(127&e[i]);return r}function I(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;i++)r+=String.fromCharCode(e[i]);return r}function x(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;o++)i+=W(e[o]);return i}function B(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function M(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,i,s){if(!o.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||t<s)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function P(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(t>i||t<o)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range");if(n<0)throw new RangeError("index out of range")}function O(e,t,n,r,i){return i||D(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),G.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,i){return i||D(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),G.write(e,t,n,r,52,8),n+8}function Y(e){if(e=F(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function F(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s<r;s++){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=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((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function J(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function q(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);s++)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function H(e){return Z.toByteArray(Y(e))}function $(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}var Z=e("base64-js"),G=e("ieee754"),V=e("isarray");n.Buffer=o,n.SlowBuffer=b,n.INSPECT_MAX_BYTES=50,o.poolSize=8192;var X={};o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),o.TYPED_ARRAY_SUPPORT?(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array):(o.prototype.length=void 0,o.prototype.parent=void 0),o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,s=Math.min(n,r);i<s&&e[i]===t[i];)++i;return i!==s&&(n=e[i],r=t[i]),n<r?-1:r<n?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!V(e))throw new TypeError("list argument must be an Array of Buffers.");if(0===e.length)return new o(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=new o(t),i=0;for(n=0;n<e.length;n++){var s=e[n];s.copy(r,i),i+=s.length}return r},o.byteLength=w,o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):m.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},o.prototype.compare=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?0:o.compare(this,e)},o.prototype.indexOf=function(e,t){function n(e,t,n){for(var r=-1,i=0;n+i<e.length;i++)if(e[n+i]===t[r===-1?0:i-r]){if(r===-1&&(r=i),i-r+1===t.length)return n+r}else r=-1;return-1}if(t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e)return 0===e.length?-1:String.prototype.indexOf.call(this,e,t);if(o.isBuffer(e))return n(this,e,t);if("number"==typeof e)return o.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):n(this,[e],t);throw new TypeError("val must be string, number or Buffer")},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var i=r;r=t,t=0|n,n=i}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return E(this,e,t,n);case"binary":return A(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var K=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=o._augment(this.subarray(e,t));else{var i=t-e;r=new o(i,void 0);for(var s=0;s<i;s++)r[s]=this[s+e]}return r.length&&(r.parent=this.parent||this),r},o.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},o.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||M(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),G.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),G.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),G.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),G.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||U(this,e,t,n,Math.pow(2,8*n),0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||U(this,e,t,n,Math.pow(2,8*n),0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var o=0,s=1,a=e<0?1:0;for(this[t]=255&e;++o<n&&(s*=256);)this[t+o]=(e/s>>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);U(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=e<0?1:0;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=(e/s>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||U(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<r-n&&(r=e.length-t+n);var i,s=r-n;if(this===e&&n<t&&t<r)for(i=s-1;i>=0;i--)e[i+t]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i<s;i++)e[i+t]=this[i+n];else e._set(this.subarray(n,n+s),t);return s},o.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),n<t)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(t<0||t>=this.length)throw new RangeError("start out of bounds");if(n<0||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;r<n;r++)this[r]=e;else{var i=z(e.toString()),o=i.length;for(r=t;r<n;r++)this[r]=i[r%o]}return this}},o.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(o.TYPED_ARRAY_SUPPORT)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Q=o.prototype;o._augment=function(e){return e.constructor=o,e._isBuffer=!0,e._set=e.set,e.get=Q.get,e.set=Q.set,e.write=Q.write,e.toString=Q.toString,e.toLocaleString=Q.toString,e.toJSON=Q.toJSON,e.equals=Q.equals,e.compare=Q.compare,e.indexOf=Q.indexOf,e.copy=Q.copy,e.slice=Q.slice,e.readUIntLE=Q.readUIntLE,e.readUIntBE=Q.readUIntBE,e.readUInt8=Q.readUInt8,e.readUInt16LE=Q.readUInt16LE,e.readUInt16BE=Q.readUInt16BE,e.readUInt32LE=Q.readUInt32LE,e.readUInt32BE=Q.readUInt32BE,e.readIntLE=Q.readIntLE,e.readIntBE=Q.readIntBE,e.readInt8=Q.readInt8,e.readInt16LE=Q.readInt16LE,e.readInt16BE=Q.readInt16BE,e.readInt32LE=Q.readInt32LE,e.readInt32BE=Q.readInt32BE,e.readFloatLE=Q.readFloatLE,e.readFloatBE=Q.readFloatBE,e.readDoubleLE=Q.readDoubleLE,e.readDoubleBE=Q.readDoubleBE,e.writeUInt8=Q.writeUInt8,e.writeUIntLE=Q.writeUIntLE,e.writeUIntBE=Q.writeUIntBE,e.writeUInt16LE=Q.writeUInt16LE,e.writeUInt16BE=Q.writeUInt16BE,e.writeUInt32LE=Q.writeUInt32LE,e.writeUInt32BE=Q.writeUInt32BE,e.writeIntLE=Q.writeIntLE,e.writeIntBE=Q.writeIntBE,e.writeInt8=Q.writeInt8,e.writeInt16LE=Q.writeInt16LE,e.writeInt16BE=Q.writeInt16BE,e.writeInt32LE=Q.writeInt32LE,e.writeInt32BE=Q.writeInt32BE,e.writeFloatLE=Q.writeFloatLE,e.writeFloatBE=Q.writeFloatBE,e.writeDoubleLE=Q.writeDoubleLE,e.writeDoubleBE=Q.writeDoubleBE,e.fill=Q.fill,e.inspect=Q.inspect,e.toArrayBuffer=Q.toArrayBuffer,e};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:9,isarray:13}],4:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===y(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function c(e){return"symbol"==typeof e}function u(e){return void 0===e}function f(e){return"[object RegExp]"===y(e)}function h(e){return"object"==typeof e&&null!==e}function l(e){return"[object Date]"===y(e)}function d(e){return"[object Error]"===y(e)||e instanceof Error}function p(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function y(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=i,n.isNullOrUndefined=o,n.isNumber=s,n.isString=a,n.isSymbol=c,n.isUndefined=u,n.isRegExp=f,n.isObject=h,n.isDate=l,n.isError=d,n.isFunction=p,n.isPrimitive=g,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":11}],5:[function(e,t,n){(function(r){function i(){return!("undefined"==typeof window||!window||"undefined"==typeof window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window&&window.console&&(console.firebug||console.exception&&console.table)||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,0,r)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}}function c(){try{return n.storage.debug}catch(e){}if("undefined"!=typeof r&&"env"in r)return r.env.DEBUG}function u(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=s,n.formatArgs=o,n.save=a,n.load=c,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},n.enable(c())}).call(this,e("_process"))},{"./debug":6,_process:16}],6:[function(e,t,n){function r(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return n.colors[Math.abs(r)%n.colors.length]}function i(e){function t(){if(t.enabled){var e=t,r=+new Date,i=r-(u||r);e.diff=i,e.prev=u,e.curr=r,u=r;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=n.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var a=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(t,r){if("%%"===t)return t;a++;var i=n.formatters[r];if("function"==typeof i){var s=o[a];t=i.call(e,s),o.splice(a,1),a--}return t}),n.formatArgs.call(e,o);var c=t.log||n.log||console.log.bind(console);c.apply(e,o)}}return t.namespace=e,t.enabled=n.enabled(e),t.useColors=n.useColors(),t.color=r(e),"function"==typeof n.init&&n.init(t),t}function o(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,i=0;i<r;i++)t[i]&&(e=t[i].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")))}function s(){n.enable("")}function a(e){var t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=i.debug=i.default=i,n.coerce=c,n.disable=s,n.enable=o,n.enabled=a,n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={};var u},{ms:14}],7:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],a(n))return!1;if(i(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:for(r=arguments.length,o=new Array(r-1),c=1;c<r;c++)o[c-1]=arguments[c];n.apply(this,o)}else if(s(n)){for(r=arguments.length,o=new Array(r-1),c=1;c<r;c++)o[c-1]=arguments[c];for(u=n.slice(),r=u.length,c=0;c<r;c++)u[c].apply(this,o)}return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned){var n;n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,
r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=o;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?i(e._events[t])?1:e._events[t].length:0}},{}],8:[function(e,t,n){var r=t.exports=function(e,t){if(t||(t=16),void 0===e&&(e=128),e<=0)return"0";for(var n=Math.log(Math.pow(2,e))/Math.log(t),i=2;n===1/0;i*=2)n=Math.log(Math.pow(2,e/i))/Math.log(t)*i;for(var o=n-Math.floor(n),s="",i=0;i<Math.floor(n);i++){var a=Math.floor(Math.random()*t).toString(t);s=a+s}if(o){var c=Math.pow(t,o),a=Math.floor(Math.random()*c).toString(t);s=a+s}var u=parseInt(s,t);return u!==1/0&&u>=Math.pow(2,e)?r(e,t):s};r.rack=function(e,t,n){var i=function(i){var s=0;do{if(s++>10){if(!n)throw new Error("too many ID collisions, use more bits");e+=n}var a=r(e,t)}while(Object.hasOwnProperty.call(o,a));return o[a]=i,a},o=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=t||16,i}},{}],9:[function(e,t,n){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,f=-7,h=n?i-1:0,l=n?-1:1,d=e[t+h];for(h+=l,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+h],h+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+e[t+h],h+=l,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,r),o-=u}return(d?-1:1)*s*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,h=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),t+=s+h>=1?l/c:l*Math.pow(2,1-h),t*c>=2&&(s++,c/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(t*c-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+d]=255&s,d+=p,s/=256,u-=8);e[n+d-p]|=128*g}},{}],10:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],11:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}t.exports=function(e){return null!=e&&(r(e)||i(e)||!!e._isBuffer)}},{}],12:[function(e,t,n){function r(e){return i(e)||o(e)}function i(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return a[s.call(e)]}t.exports=r,r.strict=i,r.loose=o;var s=Object.prototype.toString,a={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0}},{}],13:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],14:[function(e,t,n){function r(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*h;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*u;case"minutes":case"minute":case"mins":case"min":case"m":return n*c;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function i(e){return e>=f?Math.round(e/f)+"d":e>=u?Math.round(e/u)+"h":e>=c?Math.round(e/c)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function o(e){return s(e,f,"day")||s(e,u,"hour")||s(e,c,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var a=1e3,c=60*a,u=60*c,f=24*u,h=365.25*f;t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return r(e);if("number"===n&&isNaN(e)===!1)return t.long?o(e):i(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],15:[function(e,t,n){function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}var o=e("wrappy");t.exports=o(r),t.exports.strict=o(i),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})})},{wrappy:33}],16:[function(e,t,n){function r(){if(!a){a=!0;for(var e,t=s.length;t;){e=s,s=[];for(var n=-1;++n<t;)e[n]();t=s.length}a=!1}}function i(){}var o=t.exports={},s=[],a=!1;o.nextTick=function(e){s.push(e),a||setTimeout(r,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=i,o.addListener=i,o.once=i,o.off=i,o.removeListener=i,o.removeAllListeners=i,o.emit=i,o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],17:[function(e,t,n){(function(n){function r(e){var t=this;if(!(t instanceof r))return new r(e);if(e||(e={}),e.allowHalfOpen=!1,d.Duplex.call(t,e),c(t,{initiator:!1,stream:!1,config:r.config,constraints:r.constraints,channelName:e&&e.initiator?u(160):null,trickle:!0},e),"function"!=typeof g)throw"undefined"==typeof window?new Error("Missing WebRTC support - was `wrtc` dependency installed?"):new Error("Missing WebRTC support - is this a supported browser?");t._debug("new peer (initiator: %s)",t.initiator),t.destroyed=!1,t.connected=!1,t._pcReady=!1,t._channelReady=!1,t._iceComplete=!1,t._channel=null,t._buffer=[],t._pc=new g(t.config,t.constraints),t._pc.oniceconnectionstatechange=t._onIceConnectionStateChange.bind(t),t._pc.onsignalingstatechange=t._onSignalingStateChange.bind(t),t._pc.onicecandidate=t._onIceCandidate.bind(t),t.stream&&t._setupVideo(t.stream),t._pc.onaddstream=t._onAddStream.bind(t),t.initiator?(t._setupData({channel:t._pc.createDataChannel(t.channelName)}),t._pc.onnegotiationneeded=l(t._createOffer.bind(t)),"undefined"!=typeof window&&window.webkitRTCPeerConnection||t._pc.onnegotiationneeded()):t._pc.ondatachannel=t._setupData.bind(t),t.on("finish",function(){t.connected?setTimeout(function(){t._destroy()},100):t.once("connect",function(){setTimeout(function(){t._destroy()},100)})})}function i(e){var t=e.sdp.split("b=AS:30");t.length>1&&(e.sdp=t[0]+"b=AS:1638400"+t[1])}function o(){}t.exports=r;var s,a=e("debug")("simple-peer"),c=e("xtend/mutable"),u=e("hat"),f=e("inherits"),h=e("is-typedarray"),l=e("once"),d=e("stream"),p=e("typedarray-to-buffer");try{s=e("wrtc")}catch(e){s={}}var g="undefined"!=typeof window?window.mozRTCPeerConnection||window.RTCPeerConnection||window.webkitRTCPeerConnection:s.RTCPeerConnection,y="undefined"!=typeof window?window.mozRTCSessionDescription||window.RTCSessionDescription||window.webkitRTCSessionDescription:s.RTCSessionDescription,b="undefined"!=typeof window?window.mozRTCIceCandidate||window.RTCIceCandidate||window.webkitRTCIceCandidate:s.RTCIceCandidate;f(r,d.Duplex),r.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]},r.constraints={},r.prototype.send=function(e,t){var n=this;t||(t=o),n._write(e,void 0,t)},r.prototype.signal=function(e){var t=this;if(t.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}if(t._debug("signal"),e.sdp&&t._pc.setRemoteDescription(new y(e),function(){"offer"===t._pc.remoteDescription.type&&t._createAnswer()},t._onError.bind(t)),e.candidate)try{t._pc.addIceCandidate(new b(e.candidate),o,t._onError.bind(t))}catch(e){t._destroy(new Error("error adding candidate: "+e.message))}e.sdp||e.candidate||t._destroy(new Error("signal() called with invalid signal data"))},r.prototype.destroy=function(e){var t=this;t._destroy(null,e)},r.prototype._destroy=function(e,t){var n=this;if(!n.destroyed){if(t&&n.once("close",t),n._debug("destroy (error: %s)",e&&e.message),n.destroyed=!0,n.connected=!1,n._pcReady=!1,n._channelReady=!1,n._pc){try{n._pc.close()}catch(e){}n._pc.oniceconnectionstatechange=null,n._pc.onsignalingstatechange=null,n._pc.onicecandidate=null}if(n._channel){try{n._channel.close()}catch(e){}n._channel.onmessage=null,n._channel.onopen=null,n._channel.onclose=null}n._pc=null,n._channel=null,this.readable=this.writable=!1,n._readableState.ended||n.push(null),n._writableState.finished||n.end(),e&&n.emit("error",e),n.emit("close")}},r.prototype._setupData=function(e){var t=this;t._channel=e.channel,t.channelName=t._channel.label,t._channel.binaryType="arraybuffer",t._channel.onmessage=t._onChannelMessage.bind(t),t._channel.onopen=t._onChannelOpen.bind(t),t._channel.onclose=t._onChannelClose.bind(t)},r.prototype._setupVideo=function(e){var t=this;t._pc.addStream(e)},r.prototype._read=function(){},r.prototype._write=function(e,t,r){var i=this;if(i.destroyed)return r(new Error("cannot write after peer is destroyed"));var o=e.length||e.byteLength||e.size;return i.connected?(i._debug("_write: length %d",o),h.strict(e)||e instanceof ArrayBuffer||"string"==typeof e||"undefined"!=typeof Blob&&e instanceof Blob?i._channel.send(e):n.isBuffer(e)?i._channel.send(new Uint8Array(e)):i._channel.send(JSON.stringify(e)),void r(null)):(i._debug("_write before ready: length %d",o),i._buffer.push(e),void r(null))},r.prototype._createOffer=function(){var e=this;e.destroyed||e._pc.createOffer(function(t){if(!e.destroyed){i(t),e._pc.setLocalDescription(t,o,e._onError.bind(e));var n=function(){e.emit("signal",e._pc.localDescription||t)};e.trickle||e._iceComplete?n():e.once("_iceComplete",n)}},e._onError.bind(e),e.offerConstraints)},r.prototype._createAnswer=function(){var e=this;e.destroyed||e._pc.createAnswer(function(t){if(!e.destroyed){i(t),e._pc.setLocalDescription(t,o,e._onError.bind(e));var n=function(){e.emit("signal",e._pc.localDescription||t)};e.trickle||e._iceComplete?n():e.once("_iceComplete",n)}},e._onError.bind(e),e.answerConstraints)},r.prototype._onIceConnectionStateChange=function(){var e=this;if(!e.destroyed){var t=e._pc.iceGatheringState,n=e._pc.iceConnectionState;e.emit("iceConnectionStateChange",t,n),e._debug("iceConnectionStateChange %s %s",t,n),"connected"!==n&&"completed"!==n||(e._pcReady=!0,e._maybeReady()),"disconnected"!==n&&"closed"!==n||e._destroy()}},r.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady),!e.connected&&e._pcReady&&e._channelReady&&(e.connected=!0,e._buffer.forEach(function(t){e.send(t)}),e._buffer=[],e._debug("connect"),e.emit("connect"))},r.prototype._onSignalingStateChange=function(){var e=this;e.destroyed||(e.emit("signalingStateChange",e._pc.signalingState),e._debug("signalingStateChange %s",e._pc.signalingState))},r.prototype._onIceCandidate=function(e){var t=this;t.destroyed||(e.candidate&&t.trickle?t.emit("signal",{candidate:e.candidate}):e.candidate||(t._iceComplete=!0,t.emit("_iceComplete")))},r.prototype._onChannelMessage=function(e){var t=this;if(!t.destroyed){var n=e.data;if(t._debug("on channel message: length %d",n.byteLength||n.length),n instanceof ArrayBuffer)n=p(new Uint8Array(n)),t.push(n);else{try{n=JSON.parse(n)}catch(e){}t.emit("data",n)}}},r.prototype._onChannelOpen=function(){var e=this;e.connected||e.destroyed||(e._debug("on channel open"),e._channelReady=!0,e._maybeReady())},r.prototype._onChannelClose=function(){var e=this;e.destroyed||(e._debug("on channel close"),e._destroy())},r.prototype._onAddStream=function(e){var t=this;t.destroyed||(t._debug("on add stream"),t.emit("stream",e.stream))},r.prototype._onError=function(e){var t=this;t.destroyed||(t._debug("error %s",e.message||e),t._destroy(e))},r.prototype._debug=function(){var e=this,t=[].slice.call(arguments),n=e.channelName&&e.channelName.substring(0,7);t[0]="["+n+"] "+t[0],a.apply(null,t)}}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":11,debug:5,hat:8,inherits:10,"is-typedarray":12,once:15,stream:18,"typedarray-to-buffer":31,wrtc:2,"xtend/mutable":34}],18:[function(e,t,n){function r(){i.call(this)}t.exports=r;var i=e("events").EventEmitter,o=e("inherits");o(r,i),r.Readable=e("readable-stream/readable.js"),r.Writable=e("readable-stream/writable.js"),r.Duplex=e("readable-stream/duplex.js"),r.Transform=e("readable-stream/transform.js"),r.PassThrough=e("readable-stream/passthrough.js"),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&u.pause&&u.pause()}function r(){u.readable&&u.resume&&u.resume()}function o(){f||(f=!0,e.end())}function s(){f||(f=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(c(),0===i.listenerCount(this,"error"))throw e}function c(){u.removeListener("data",n),e.removeListener("drain",r),u.removeListener("end",o),u.removeListener("close",s),u.removeListener("error",a),e.removeListener("error",a),u.removeListener("end",c),u.removeListener("close",c),e.removeListener("close",c)}var u=this;u.on("data",n),e.on("drain",r),e._isStdio||t&&t.end===!1||(u.on("end",o),u.on("close",s));var f=!1;return u.on("error",a),e.on("error",a),u.on("end",c),u.on("close",c),e.on("close",c),e.emit("pipe",u),e}},{events:7,inherits:10,"readable-stream/duplex.js":20,"readable-stream/passthrough.js":26,"readable-stream/readable.js":27,"readable-stream/transform.js":28,"readable-stream/writable.js":29}],19:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],20:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":21}],21:[function(e,t,n){(function(n){function r(e){return this instanceof r?(c.call(this,e),u.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),void this.once("end",i)):new r(e)}function i(){this.allowHalfOpen||this._writableState.ended||n.nextTick(this.end.bind(this))}function o(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}t.exports=r;var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},a=e("core-util-is");a.inherits=e("inherits");var c=e("./_stream_readable"),u=e("./_stream_writable");a.inherits(r,c),o(s(u.prototype),function(e){r.prototype[e]||(r.prototype[e]=u.prototype[e])})}).call(this,e("_process"))},{"./_stream_readable":23,"./_stream_writable":25,_process:16,"core-util-is":4,inherits:10}],22:[function(e,t,n){function r(e){return this instanceof r?void i.call(this,e):new r(e)}t.exports=r;var i=e("./_stream_transform"),o=e("core-util-is");o.inherits=e("inherits"),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},{"./_stream_transform":24,"core-util-is":4,inherits:10}],23:[function(e,t,n){(function(n){function r(t,n){var r=e("./_stream_duplex");t=t||{};var i=t.highWaterMark,o=t.objectMode?16:16384;this.highWaterMark=i||0===i?i:o,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,n instanceof r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(L||(L=e("string_decoder/").StringDecoder),this.decoder=new L(t.encoding),this.encoding=t.encoding)}function i(t){e("./_stream_duplex");return this instanceof i?(this._readableState=new r(t,this),this.readable=!0,void k.call(this)):new i(t)}function o(e,t,n,r,i){var o=u(t,n);if(o)e.emit("error",o);else if(C.isNullOrUndefined(n))t.reading=!1,t.ended||f(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||i||r||(n=t.decoder.write(n)),i||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&h(e)),d(e,t);else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=I)e=I;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function c(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||C.isNull(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function u(e,t){var n=null;return C.isBuffer(t)||C.isString(t)||C.isNullOrUndefined(t)||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,h(e)}function h(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(T("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(function(){l(e)}):l(e))}function l(e){T("emit readable"),e.emit("readable"),w(e)}function d(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){p(e,t)}))}function p(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(T("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function g(e){return function(){var t=e._readableState;T("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&R.listenerCount(e,"data")&&(t.flowing=!0,w(e))}}function y(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(function(){b(e,t)}))}function b(e,t){t.resumeScheduled=!1,e.emit("resume"),w(e),t.flowing&&!t.reading&&e.read(0)}function w(e){var t=e._readableState;if(T("flow",t.flowing),t.flowing)do var n=e.read();while(null!==n&&t.flowing)}function m(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!e||e>=i)n=o?r.join(""):S.concat(r,i),r.length=0;else if(e<r[0].length){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=o?"":new S(e);for(var c=0,u=0,f=r.length;u<f&&c<e;u++){var a=r[0],h=Math.min(e-c,a.length);o?n+=a.slice(0,h):a.copy(n,c,0,h),h<a.length?r[0]=a.slice(h):r.shift(),c+=h}}return n}function v(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function _(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function E(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}t.exports=i;var A=e("isarray"),S=e("buffer").Buffer;i.ReadableState=r;var R=e("events").EventEmitter;R.listenerCount||(R.listenerCount=function(e,t){return e.listeners(t).length});var k=e("stream"),C=e("core-util-is");C.inherits=e("inherits");var L,T=e("util");T=T&&T.debuglog?T.debuglog("stream"):function(){},C.inherits(i,k),i.prototype.push=function(e,t){var n=this._readableState;return C.isString(e)&&!n.objectMode&&(t=t||n.defaultEncoding,t!==n.encoding&&(e=new S(e,t),t="")),o(this,n,e,t,!1)},i.prototype.unshift=function(e){var t=this._readableState;return o(this,t,e,"",!0)},i.prototype.setEncoding=function(t){return L||(L=e("string_decoder/").StringDecoder),this._readableState.decoder=new L(t),this._readableState.encoding=t,this};var I=8388608;i.prototype.read=function(e){T("read",e);var t=this._readableState,n=e;if((!C.isNumber(e)||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return T("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?v(this):h(this),null;if(e=c(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var r=t.needReadable;T("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,T("length less than watermark",r)),(t.ended||t.reading)&&(r=!1,T("reading or ended",r)),r&&(T("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),r&&!t.reading&&(e=c(n,t));var i;return i=e>0?m(e,t):null,C.isNull(i)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&v(this),C.isNull(i)||this.emit("data",i),i},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function r(e){T("onunpipe"),e===h&&o()}function i(){T("onend"),e.end()}function o(){T("cleanup"),e.removeListener("close",c),e.removeListener("finish",u),e.removeListener("drain",y),e.removeListener("error",a),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",o),h.removeListener("data",s),!l.awaitDrain||e._writableState&&!e._writableState.needDrain||y()}function s(t){T("ondata");var n=e.write(t);!1===n&&(T("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,h.pause())}function a(t){T("onerror",t),f(),e.removeListener("error",a),0===R.listenerCount(e,"error")&&e.emit("error",t)}function c(){e.removeListener("finish",u),f()}function u(){T("onfinish"),e.removeListener("close",c),f()}function f(){T("unpipe"),h.unpipe(e)}var h=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1,T("pipe count=%d opts=%j",l.pipesCount,t);var d=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,p=d?i:o;l.endEmitted?n.nextTick(p):h.once("end",p),e.on("unpipe",r);var y=g(h);return e.on("drain",y),h.on("data",s),e._events&&e._events.error?A(e._events.error)?e._events.error.unshift(a):e._events.error=[a,e._events.error]:e.on("error",a),e.once("close",c),e.once("finish",u),e.emit("pipe",h),l.flowing||(T("pipe resume"),h.resume()),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var i=E(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},i.prototype.on=function(e,t){var r=k.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var i=this._readableState;if(!i.readableListening)if(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading)i.length&&h(this,i);else{var o=this;n.nextTick(function(){T("readable nexttick read 0"),o.read(0)})}}return r},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){var e=this._readableState;return e.flowing||(T("resume"),e.flowing=!0,e.reading||(T("resume read 0"),this.read(0)),y(this,e)),this},i.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this},i.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(T("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(T("wrapped data"),t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)C.isFunction(e[i])&&C.isUndefined(this[i])&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return _(o,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){T("wrapped _read",t),n&&(n=!1,e.resume())},r},i._fromList=m}).call(this,e("_process"))},{"./_stream_duplex":21,_process:16,buffer:3,"core-util-is":4,events:7,inherits:10,isarray:19,stream:18,"string_decoder/":30,util:2}],24:[function(e,t,n){function r(e,t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,c.isNullOrUndefined(n)||e.push(n),i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);a.call(this,e),this._transformState=new r(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",function(){c.isFunction(this._flush)?this._flush(function(e){s(t,e)}):s(t)})}function s(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=e._transformState;if(n.length)throw new Error("calling transform done when ws.length != 0");if(r.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=o;var a=e("./_stream_duplex"),c=e("core-util-is");c.inherits=e("inherits"),c.inherits(o,a),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;c.isNull(t.writechunk)||!t.writecb||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))}},{"./_stream_duplex":21,"core-util-is":4,inherits:10}],25:[function(e,t,n){(function(n){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function i(t,n){var r=e("./_stream_duplex");t=t||{};var i=t.highWaterMark,o=t.objectMode?16:16384;this.highWaterMark=i||0===i?i:o,this.objectMode=!!t.objectMode,n instanceof r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var s=t.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){d(n,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function o(t){var n=e("./_stream_duplex");return this instanceof o||this instanceof n?(this._writableState=new i(t,this),this.writable=!0,void A.call(this)):new o(t)}function s(e,t,r){var i=new Error("write after end");e.emit("error",i),n.nextTick(function(){r(i)})}function a(e,t,r,i){var o=!0;if(!(E.isBuffer(r)||E.isString(r)||E.isNullOrUndefined(r)||t.objectMode)){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),n.nextTick(function(){i(s)}),o=!1}return o}function c(e,t,n){return!e.objectMode&&e.decodeStrings!==!1&&E.isString(t)&&(t=new _(t,n)),t}function u(e,t,n,i,o){n=c(t,n,i),E.isBuffer(n)&&(i="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked?t.buffer.push(new r(n,i,o)):f(e,t,!1,s,n,i,o),a}function f(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function h(e,t,r,i,o){r?n.nextTick(function(){t.pendingcb--,o(i)}):(t.pendingcb--,o(i)),e._writableState.errorEmitted=!0,e.emit("error",i)}function l(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function d(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if(l(r),t)h(e,r,i,t,o);else{var s=b(e,r);s||r.corked||r.bufferProcessing||!r.buffer.length||y(e,r),i?n.nextTick(function(){p(e,r,s,o)}):p(e,r,s,o)}}function p(e,t,n,r){n||g(e,t),t.pendingcb--,r(),m(e,t)}function g(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function y(e,t){if(t.bufferProcessing=!0,e._writev&&t.buffer.length>1){for(var n=[],r=0;r<t.buffer.length;r++)n.push(t.buffer[r].callback);t.pendingcb++,f(e,t,!0,t.length,t.buffer,"",function(e){for(var r=0;r<n.length;r++)t.pendingcb--,n[r](e)}),t.buffer=[]}else{for(var r=0;r<t.buffer.length;r++){var i=t.buffer[r],o=i.chunk,s=i.encoding,a=i.callback,c=t.objectMode?1:o.length;if(f(e,t,!1,c,o,s,a),t.writing){r++;break}}r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}t.bufferProcessing=!1}function b(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function w(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function m(e,t){var n=b(e,t);return n&&(0===t.pendingcb?(w(e,t),t.finished=!0,e.emit("finish")):w(e,t)),n}function v(e,t,r){t.ending=!0,m(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0}t.exports=o;var _=e("buffer").Buffer;o.WritableState=i;var E=e("core-util-is");E.inherits=e("inherits");var A=e("stream");E.inherits(o,A),o.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},o.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return E.isFunction(t)&&(n=t,t=null),E.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),E.isFunction(n)||(n=function(){}),r.ended?s(this,r,n):a(this,r,e,n)&&(r.pendingcb++,i=u(this,r,e,t,n)),i},o.prototype.cork=function(){var e=this._writableState;e.corked++},o.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.buffer.length||y(this,e))},o.prototype._write=function(e,t,n){n(new Error("not implemented"))},o.prototype._writev=null,o.prototype.end=function(e,t,n){var r=this._writableState;E.isFunction(e)?(n=e,e=null,t=null):E.isFunction(t)&&(n=t,t=null),E.isNullOrUndefined(e)||this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||v(this,r,n)}}).call(this,e("_process"))},{"./_stream_duplex":21,
_process:16,buffer:3,"core-util-is":4,inherits:10,stream:18}],26:[function(e,t,n){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":22}],27:[function(e,t,n){(function(r){n=t.exports=e("./lib/_stream_readable.js"),n.Stream=e("stream"),n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),r.browser||"disable"!==r.env.READABLE_STREAM||(t.exports=e("stream"))}).call(this,e("_process"))},{"./lib/_stream_duplex.js":21,"./lib/_stream_passthrough.js":22,"./lib/_stream_readable.js":23,"./lib/_stream_transform.js":24,"./lib/_stream_writable.js":25,_process:16,stream:18}],28:[function(e,t,n){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":24}],29:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":25}],30:[function(e,t,n){function r(e){if(e&&!c(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e("buffer").Buffer,c=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},u=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:3}],31:[function(e,t,n){(function(n){var r=e("is-typedarray").strict;t.exports=function(e){if(r(e)){var t=new n(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return new n(e)}}).call(this,e("buffer").Buffer)},{buffer:3,"is-typedarray":32}],32:[function(e,t,n){function r(e){return i(e)||o(e)}function i(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return a[s.call(e)]}t.exports=r,r.strict=i,r.loose=o;var s=Object.prototype.toString,a={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0}},{}],33:[function(e,t,n){function r(e,t){function n(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];var r=e.apply(this,t),i=t[t.length-1];return"function"==typeof r&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}if(e&&t)return r(e)(t);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(t){n[t]=e[t]}),n}t.exports=r},{}],34:[function(e,t,n){function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)i.call(n,r)&&(e[r]=n[r])}return e}t.exports=r;var i=Object.prototype.hasOwnProperty},{}]},{},[])("/browser")});