forked from feross/simple-peer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simplepeer.min.js
3 lines (3 loc) · 74.2 KB
/
simplepeer.min.js
1
2
3
(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.SimplePeer=e()}})(function(){var e,t,r;return function e(t,r,n){function i(s,a){if(!r[s]){if(!t[s]){var f=typeof require=="function"&&require;if(!a&&f)return f(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,r){"use strict";r.byteLength=l;r.toByteArray=c;r.fromByteArray=p;var n=[];var i=[];var o=typeof Uint8Array!=="undefined"?Uint8Array:Array;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var a=0,f=s.length;a<f;++a){n[a]=s[a];i[s.charCodeAt(a)]=a}i["-".charCodeAt(0)]=62;i["_".charCodeAt(0)]=63;function u(e){var t=e.length;if(t%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return e[t-2]==="="?2:e[t-1]==="="?1:0}function l(e){return e.length*3/4-u(e)}function c(e){var t,r,n,s,a,f;var l=e.length;a=u(e);f=new o(l*3/4-a);n=a>0?l-4:l;var c=0;for(t=0,r=0;t<n;t+=4,r+=3){s=i[e.charCodeAt(t)]<<18|i[e.charCodeAt(t+1)]<<12|i[e.charCodeAt(t+2)]<<6|i[e.charCodeAt(t+3)];f[c++]=s>>16&255;f[c++]=s>>8&255;f[c++]=s&255}if(a===2){s=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4;f[c++]=s&255}else if(a===1){s=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2;f[c++]=s>>8&255;f[c++]=s&255}return f}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[e&63]}function d(e,t,r){var n;var i=[];for(var o=t;o<r;o+=3){n=(e[o]<<16)+(e[o+1]<<8)+e[o+2];i.push(h(n))}return i.join("")}function p(e){var t;var r=e.length;var i=r%3;var o="";var s=[];var a=16383;for(var f=0,u=r-i;f<u;f+=a){s.push(d(e,f,f+a>u?u:f+a))}if(i===1){t=e[r-1];o+=n[t>>2];o+=n[t<<4&63];o+="=="}else if(i===2){t=(e[r-2]<<8)+e[r-1];o+=n[t>>10];o+=n[t>>4&63];o+=n[t<<2&63];o+="="}s.push(o);return s.join("")}},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){(function(t){"use strict";var n=e("buffer");var i=n.Buffer;var o=n.SlowBuffer;var s=n.kMaxLength||2147483647;r.alloc=function e(t,r,n){if(typeof i.alloc==="function"){return i.alloc(t,r,n)}if(typeof n==="number"){throw new TypeError("encoding must not be number")}if(typeof t!=="number"){throw new TypeError("size must be a number")}if(t>s){throw new RangeError("size is too large")}var o=n;var a=r;if(a===undefined){o=undefined;a=0}var f=new i(t);if(typeof a==="string"){var u=new i(a,o);var l=u.length;var c=-1;while(++c<t){f[c]=u[c%l]}}else{f.fill(a)}return f};r.allocUnsafe=function e(t){if(typeof i.allocUnsafe==="function"){return i.allocUnsafe(t)}if(typeof t!=="number"){throw new TypeError("size must be a number")}if(t>s){throw new RangeError("size is too large")}return new i(t)};r.from=function e(r,n,o){if(typeof i.from==="function"&&(!t.Uint8Array||Uint8Array.from!==i.from)){return i.from(r,n,o)}if(typeof r==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof r==="string"){return new i(r,n)}if(typeof ArrayBuffer!=="undefined"&&r instanceof ArrayBuffer){var s=n;if(arguments.length===1){return new i(r)}if(typeof s==="undefined"){s=0}var a=o;if(typeof a==="undefined"){a=r.byteLength-s}if(s>=r.byteLength){throw new RangeError("'offset' is out of bounds")}if(a>r.byteLength-s){throw new RangeError("'length' is out of bounds")}return new i(r.slice(s,s+a))}if(i.isBuffer(r)){var f=new i(r.length);r.copy(f,0,0,r.length);return f}if(r){if(Array.isArray(r)||typeof ArrayBuffer!=="undefined"&&r.buffer instanceof ArrayBuffer||"length"in r){return new i(r)}if(r.type==="Buffer"&&Array.isArray(r.data)){return new i(r.data)}}throw new TypeError("First argument must be a string, Buffer, "+"ArrayBuffer, Array, or array-like object.")};r.allocUnsafeSlow=function e(t){if(typeof i.allocUnsafeSlow==="function"){return i.allocUnsafeSlow(t)}if(typeof t!=="number"){throw new TypeError("size must be a number")}if(t>=s){throw new RangeError("size is too large")}return new o(t)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{buffer:4}],4:[function(e,t,r){(function(t){"use strict";var n=e("base64-js");var i=e("ieee754");var o=e("isarray");r.Buffer=u;r.SlowBuffer=m;r.INSPECT_MAX_BYTES=50;u.TYPED_ARRAY_SUPPORT=t.TYPED_ARRAY_SUPPORT!==undefined?t.TYPED_ARRAY_SUPPORT:s();r.kMaxLength=a();function s(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return e.foo()===42&&typeof e.subarray==="function"&&e.subarray(1,1).byteLength===0}catch(e){return false}}function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(e,t){if(a()<t){throw new RangeError("Invalid typed array length")}if(u.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=u.prototype}else{if(e===null){e=new u(t)}e.length=t}return e}function u(e,t,r){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u)){return new u(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return d(this,e)}return l(this,e,t,r)}u.poolSize=8192;u._augment=function(e){e.__proto__=u.prototype;return e};function l(e,t,r,n){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return v(e,t,r,n)}if(typeof t==="string"){return p(e,t,r)}return y(e,t)}u.from=function(e,t,r){return l(null,e,t,r)};if(u.TYPED_ARRAY_SUPPORT){u.prototype.__proto__=Uint8Array.prototype;u.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&u[Symbol.species]===u){Object.defineProperty(u,Symbol.species,{value:null,configurable:true})}}function c(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function h(e,t,r,n){c(t);if(t<=0){return f(e,t)}if(r!==undefined){return typeof n==="string"?f(e,t).fill(r,n):f(e,t).fill(r)}return f(e,t)}u.alloc=function(e,t,r){return h(null,e,t,r)};function d(e,t){c(t);e=f(e,t<0?0:w(t)|0);if(!u.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}u.allocUnsafe=function(e){return d(null,e)};u.allocUnsafeSlow=function(e){return d(null,e)};function p(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!u.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=b(t,r)|0;e=f(e,n);var i=e.write(t,r);if(i!==n){e=e.slice(0,i)}return e}function g(e,t){var r=t.length<0?0:w(t.length)|0;e=f(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function v(e,t,r,n){t.byteLength;if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){t=new Uint8Array(t)}else if(n===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,n)}if(u.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=u.prototype}else{e=g(e,t)}return e}function y(e,t){if(u.isBuffer(t)){var r=w(t.length)|0;e=f(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||te(t.length)){return f(e,0)}return g(e,t)}if(t.type==="Buffer"&&o(t.data)){return g(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(e){if(e>=a()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+a().toString(16)+" bytes")}return e|0}function m(e){if(+e!=e){e=0}return u.alloc(+e)}u.isBuffer=function e(t){return!!(t!=null&&t._isBuffer)};u.compare=function e(t,r){if(!u.isBuffer(t)||!u.isBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var o=0,s=Math.min(n,i);o<s;++o){if(t[o]!==r[o]){n=t[o];i=r[o];break}}if(n<i)return-1;if(i<n)return 1;return 0};u.isEncoding=function e(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 true;default:return false}};u.concat=function e(t,r){if(!o(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return u.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<t.length;++n){r+=t[n].length}}var i=u.allocUnsafe(r);var s=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a)){throw new TypeError('"list" argument must be an Array of Buffers')}a.copy(i,s);s+=a.length}return i};function b(e,t){if(u.isBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var n=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(n)return X(e).length;t=(""+t).toLowerCase();n=true}}}u.byteLength=b;function _(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return L(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}u.prototype._isBuffer=true;function E(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}u.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<t;r+=2){E(this,r,r+1)}return this};u.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<t;r+=4){E(this,r,r+3);E(this,r+1,r+2)}return this};u.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<t;r+=8){E(this,r,r+7);E(this,r+1,r+6);E(this,r+2,r+5);E(this,r+3,r+4)}return this};u.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return P(this,0,t);return _.apply(this,arguments)};u.prototype.equals=function e(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return u.compare(this,t)===0};u.prototype.inspect=function e(){var t="";var n=r.INSPECT_MAX_BYTES;if(this.length>0){t=this.toString("hex",0,n).match(/.{2}/g).join(" ");if(this.length>n)t+=" ... "}return"<Buffer "+t+">"};u.prototype.compare=function e(t,r,n,i,o){if(!u.isBuffer(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=t?t.length:0}if(i===undefined){i=0}if(o===undefined){o=this.length}if(r<0||n>t.length||i<0||o>this.length){throw new RangeError("out of range index")}if(i>=o&&r>=n){return 0}if(i>=o){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;o>>>=0;if(this===t)return 0;var s=o-i;var a=n-r;var f=Math.min(s,a);var l=this.slice(i,o);var c=t.slice(r,n);for(var h=0;h<f;++h){if(l[h]!==c[h]){s=l[h];a=c[h];break}}if(s<a)return-1;if(a<s)return 1;return 0};function R(e,t,r,n,i){if(e.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=u.from(t,n)}if(u.isBuffer(t)){if(t.length===0){return-1}return S(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(u.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return S(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function S(e,t,r,n,i){var o=1;var s=e.length;var a=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}o=2;s/=2;a/=2;r/=2}}function f(e,t){if(o===1){return e[t]}else{return e.readUInt16BE(t*o)}}var u;if(i){var l=-1;for(u=r;u<s;u++){if(f(e,u)===f(t,l===-1?0:u-l)){if(l===-1)l=u;if(u-l+1===a)return l*o}else{if(l!==-1)u-=u-l;l=-1}}}else{if(r+a>s)r=s-a;for(u=r;u>=0;u--){var c=true;for(var h=0;h<a;h++){if(f(e,u+h)!==f(t,h)){c=false;break}}if(c)return u}}return-1}u.prototype.includes=function e(t,r,n){return this.indexOf(t,r,n)!==-1};u.prototype.indexOf=function e(t,r,n){return R(this,t,r,n,true)};u.prototype.lastIndexOf=function e(t,r,n){return R(this,t,r,n,false)};function A(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(n>o/2){n=o/2}for(var s=0;s<n;++s){var a=parseInt(t.substr(s*2,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function C(e,t,r,n){return ee(X(t,e.length-r),e,r,n)}function T(e,t,r,n){return ee(Z(t),e,r,n)}function k(e,t,r,n){return T(e,t,r,n)}function x(e,t,r,n){return ee(Q(t),e,r,n)}function B(e,t,r,n){return ee(K(t,e.length-r),e,r,n)}u.prototype.write=function e(t,r,n,i){if(r===undefined){i="utf8";n=this.length;r=0}else if(n===undefined&&typeof r==="string"){i=r;n=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var o=this.length-r;if(n===undefined||n>o)n=o;if(t.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return A(this,t,r,n);case"utf8":case"utf-8":return C(this,t,r,n);case"ascii":return T(this,t,r,n);case"latin1":case"binary":return k(this,t,r,n);case"base64":return x(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};u.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function P(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i<r){var o=e[i];var s=null;var a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var f,u,l,c;switch(a){case 1:if(o<128){s=o}break;case 2:f=e[i+1];if((f&192)===128){c=(o&31)<<6|f&63;if(c>127){s=c}}break;case 3:f=e[i+1];u=e[i+2];if((f&192)===128&&(u&192)===128){c=(o&15)<<12|(f&63)<<6|u&63;if(c>2047&&(c<55296||c>57343)){s=c}}break;case 4:f=e[i+1];u=e[i+2];l=e[i+3];if((f&192)===128&&(u&192)===128&&(l&192)===128){c=(o&15)<<18|(f&63)<<12|(u&63)<<6|l&63;if(c>65535&&c<1114112){s=c}}}}if(s===null){s=65533;a=1}else if(s>65535){s-=65536;n.push(s>>>10&1023|55296);s=56320|s&1023}n.push(s);i+=a}return U(n)}var M=4096;function U(e){var t=e.length;if(t<=M){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(n<t){r+=String.fromCharCode.apply(String,e.slice(n,n+=M))}return r}function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i]&127)}return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i])}return n}function j(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var o=t;o<r;++o){i+=G(e[o])}return i}function O(e,t,r){var n=e.slice(t,r);var i="";for(var o=0;o<n.length;o+=2){i+=String.fromCharCode(n[o]+n[o+1]*256)}return i}u.prototype.slice=function e(t,r){var n=this.length;t=~~t;r=r===undefined?n:~~r;if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(r<t)r=t;var i;if(u.TYPED_ARRAY_SUPPORT){i=this.subarray(t,r);i.__proto__=u.prototype}else{var o=r-t;i=new u(o,undefined);for(var s=0;s<o;++s){i[s]=this[s+t]}}return i};function Y(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)Y(t,r,this.length);var i=this[t];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[t+s]*o}return i};u.prototype.readUIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n){Y(t,r,this.length)}var i=this[t+--r];var o=1;while(r>0&&(o*=256)){i+=this[t+--r]*o}return i};u.prototype.readUInt8=function e(t,r){if(!r)Y(t,1,this.length);return this[t]};u.prototype.readUInt16LE=function e(t,r){if(!r)Y(t,2,this.length);return this[t]|this[t+1]<<8};u.prototype.readUInt16BE=function e(t,r){if(!r)Y(t,2,this.length);return this[t]<<8|this[t+1]};u.prototype.readUInt32LE=function e(t,r){if(!r)Y(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};u.prototype.readUInt32BE=function e(t,r){if(!r)Y(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};u.prototype.readIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)Y(t,r,this.length);var i=this[t];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[t+s]*o}o*=128;if(i>=o)i-=Math.pow(2,8*r);return i};u.prototype.readIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n)Y(t,r,this.length);var i=r;var o=1;var s=this[t+--i];while(i>0&&(o*=256)){s+=this[t+--i]*o}o*=128;if(s>=o)s-=Math.pow(2,8*r);return s};u.prototype.readInt8=function e(t,r){if(!r)Y(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};u.prototype.readInt16LE=function e(t,r){if(!r)Y(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};u.prototype.readInt16BE=function e(t,r){if(!r)Y(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};u.prototype.readInt32LE=function e(t,r){if(!r)Y(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};u.prototype.readInt32BE=function e(t,r){if(!r)Y(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};u.prototype.readFloatLE=function e(t,r){if(!r)Y(t,4,this.length);return i.read(this,t,true,23,4)};u.prototype.readFloatBE=function e(t,r){if(!r)Y(t,4,this.length);return i.read(this,t,false,23,4)};u.prototype.readDoubleLE=function e(t,r){if(!r)Y(t,8,this.length);return i.read(this,t,true,52,8)};u.prototype.readDoubleBE=function e(t,r){if(!r)Y(t,8,this.length);return i.read(this,t,false,52,8)};function N(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var o=Math.pow(2,8*n)-1;N(this,t,r,n,o,0)}var s=1;var a=0;this[r]=t&255;while(++a<n&&(s*=256)){this[r+a]=t/s&255}return r+n};u.prototype.writeUIntBE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var o=Math.pow(2,8*n)-1;N(this,t,r,n,o,0)}var s=n-1;var a=1;this[r+s]=t&255;while(--s>=0&&(a*=256)){this[r+s]=t/a&255}return r+n};u.prototype.writeUInt8=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,1,255,0);if(!u.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function q(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,o=Math.min(e.length-r,2);i<o;++i){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}u.prototype.writeUInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,2,65535,0);if(u.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{q(this,t,r,true)}return r+2};u.prototype.writeUInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,2,65535,0);if(u.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{q(this,t,r,false)}return r+2};function W(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,o=Math.min(e.length-r,4);i<o;++i){e[r+i]=t>>>(n?i:3-i)*8&255}}u.prototype.writeUInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,4,4294967295,0);if(u.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{W(this,t,r,true)}return r+4};u.prototype.writeUInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,4,4294967295,0);if(u.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{W(this,t,r,false)}return r+4};u.prototype.writeIntLE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var o=Math.pow(2,8*n-1);N(this,t,r,n,o-1,-o)}var s=0;var a=1;var f=0;this[r]=t&255;while(++s<n&&(a*=256)){if(t<0&&f===0&&this[r+s-1]!==0){f=1}this[r+s]=(t/a>>0)-f&255}return r+n};u.prototype.writeIntBE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var o=Math.pow(2,8*n-1);N(this,t,r,n,o-1,-o)}var s=n-1;var a=1;var f=0;this[r+s]=t&255;while(--s>=0&&(a*=256)){if(t<0&&f===0&&this[r+s+1]!==0){f=1}this[r+s]=(t/a>>0)-f&255}return r+n};u.prototype.writeInt8=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,1,127,-128);if(!u.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};u.prototype.writeInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,2,32767,-32768);if(u.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{q(this,t,r,true)}return r+2};u.prototype.writeInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,2,32767,-32768);if(u.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{q(this,t,r,false)}return r+2};u.prototype.writeInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,4,2147483647,-2147483648);if(u.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{W(this,t,r,true)}return r+4};u.prototype.writeInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)N(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(u.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{W(this,t,r,false)}return r+4};function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){if(!o){z(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}u.prototype.writeFloatLE=function e(t,r,n){return F(this,t,r,true,n)};u.prototype.writeFloatBE=function e(t,r,n){return F(this,t,r,false,n)};function $(e,t,r,n,o){if(!o){z(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}u.prototype.writeDoubleLE=function e(t,r,n){return $(this,t,r,true,n)};u.prototype.writeDoubleBE=function e(t,r,n){return $(this,t,r,false,n)};u.prototype.copy=function e(t,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(t.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(t.length-r<i-n){i=t.length-r+n}var o=i-n;var s;if(this===t&&n<r&&r<i){for(s=o-1;s>=0;--s){t[s+r]=this[s+n]}}else if(o<1e3||!u.TYPED_ARRAY_SUPPORT){for(s=0;s<o;++s){t[s+r]=this[s+n]}}else{Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r)}return o};u.prototype.fill=function e(t,r,n,i){if(typeof t==="string"){if(typeof r==="string"){i=r;r=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(t.length===1){var o=t.charCodeAt(0);if(o<256){t=o}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!u.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof t==="number"){t=t&255}if(r<0||this.length<r||this.length<n){throw new RangeError("Out of range index")}if(n<=r){return this}r=r>>>0;n=n===undefined?this.length:n>>>0;if(!t)t=0;var s;if(typeof t==="number"){for(s=r;s<n;++s){this[s]=t}}else{var a=u.isBuffer(t)?t:X(new u(t,i).toString());var f=a.length;for(s=0;s<n-r;++s){this[s+r]=a[s%f]}}return this};var H=/[^+\/0-9A-Za-z-_]/g;function J(e){e=V(e).replace(H,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function V(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function G(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function X(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var o=[];for(var s=0;s<n;++s){r=e.charCodeAt(s);if(r>55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)o.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)o.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)o.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return o}function Z(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function K(e,t){var r,n,i;var o=[];for(var s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s);n=r>>8;i=r%256;o.push(i);o.push(n)}return o}function Q(e){return n.toByteArray(J(e))}function ee(e,t,r,n){for(var i=0;i<n;++i){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function te(e){return e!==e}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"base64-js":1,ieee754:10,isarray:13}],5:[function(e,t,r){(function(e){function t(e){if(Array.isArray){return Array.isArray(e)}return v(e)==="[object Array]"}r.isArray=t;function n(e){return typeof e==="boolean"}r.isBoolean=n;function i(e){return e===null}r.isNull=i;function o(e){return e==null}r.isNullOrUndefined=o;function s(e){return typeof e==="number"}r.isNumber=s;function a(e){return typeof e==="string"}r.isString=a;function f(e){return typeof e==="symbol"}r.isSymbol=f;function u(e){return e===void 0}r.isUndefined=u;function l(e){return v(e)==="[object RegExp]"}r.isRegExp=l;function c(e){return typeof e==="object"&&e!==null}r.isObject=c;function h(e){return v(e)==="[object Date]"}r.isDate=h;function d(e){return v(e)==="[object Error]"||e instanceof Error}r.isError=d;function p(e){return typeof e==="function"}r.isFunction=p;function g(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}r.isPrimitive=g;r.isBuffer=e.isBuffer;function v(e){return Object.prototype.toString.call(e)}}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":12}],6:[function(e,t,r){(function(n){r=t.exports=e("./debug");r.log=s;r.formatArgs=o;r.save=a;r.load=f;r.useColors=i;r.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u();r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function i(){return typeof document!=="undefined"&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}r.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}};function o(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var o=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){o=i}});e.splice(o,0,n);return e}function s(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(e){}}function f(){var e;try{return r.storage.debug}catch(e){}if(typeof n!=="undefined"&&"env"in n){return n.env.DEBUG}}r.enable(f());function u(){try{return window.localStorage}catch(e){}}}).call(this,e("_process"))},{"./debug":7,_process:16}],7:[function(e,t,r){r=t.exports=s.debug=s;r.coerce=l;r.disable=f;r.enable=a;r.enabled=u;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function o(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=o();var a=new Array(arguments.length);for(var f=0;f<a.length;f++){a[f]=arguments[f]}a[0]=r.coerce(a[0]);if("string"!==typeof a[0]){a=["%o"].concat(a)}var u=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;u++;var i=r.formatters[n];if("function"===typeof i){var o=a[u];t=i.call(e,o);a.splice(u,1);u--}return t});a=r.formatArgs.apply(e,a);var l=n.log||r.log||console.log.bind(console);l.apply(e,a)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function a(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i<n;i++){if(!t[i])continue;e=t[i].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?");if(e[0]==="-"){r.skips.push(new RegExp("^"+e.substr(1)+"$"))}else{r.names.push(new RegExp("^"+e+"$"))}}}function f(){r.enable("")}function u(e){var t,n;for(t=0,n=r.skips.length;t<n;t++){if(r.skips[t].test(e)){return false}}for(t=0,n=r.names.length;t<n;t++){if(r.names[t].test(e)){return true}}return false}function l(e){if(e instanceof Error)return e.stack||e.message;return e}},{ms:14}],8:[function(e,t,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}t.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};n.prototype.emit=function(e){var t,r,n,o,f,u;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}else{var l=new Error('Uncaught, unspecified "error" event. ('+t+")");l.context=t;throw l}}}r=this._events[e];if(a(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1);r.apply(this,o)}}else if(s(r)){o=Array.prototype.slice.call(arguments,1);u=r.slice();n=u.length;for(f=0;f<n;f++)u[f].apply(this,o)}return true};n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",e,i(t.listener)?t.listener:t);if(!this._events[e])this._events[e]=t;else if(s(this._events[e]))this._events[e].push(t);else this._events[e]=[this._events[e],t];if(s(this._events[e])&&!this._events[e].warned){if(!a(this._maxListeners)){r=this._maxListeners}else{r=n.defaultMaxListeners}if(r&&r>0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!i(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;
r=this._events[e];o=r.length;n=-1;if(r===t||i(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(s(r)){for(a=o;a-- >0;){if(r[a]===t||r[a].listener&&r[a].listener===t){n=a;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(i(r)){this.removeListener(e,r)}else if(r){while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(i(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;else if(t)return t.length}return 0};n.listenerCount=function(e,t){return e.listenerCount(t)};function i(e){return typeof e==="function"}function o(e){return typeof e==="number"}function s(e){return typeof e==="object"&&e!==null}function a(e){return e===void 0}},{}],9:[function(e,t,r){t.exports=function e(){if(typeof window==="undefined")return null;var t={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};if(!t.RTCPeerConnection)return null;return t}},{}],10:[function(e,t,r){r.read=function(e,t,r,n,i){var o,s;var a=i*8-n-1;var f=(1<<a)-1;var u=f>>1;var l=-7;var c=r?i-1:0;var h=r?-1:1;var d=e[t+c];c+=h;o=d&(1<<-l)-1;d>>=-l;l+=a;for(;l>0;o=o*256+e[t+c],c+=h,l-=8){}s=o&(1<<-l)-1;o>>=-l;l+=n;for(;l>0;s=s*256+e[t+c],c+=h,l-=8){}if(o===0){o=1-u}else if(o===f){return s?NaN:(d?-1:1)*Infinity}else{s=s+Math.pow(2,n);o=o-u}return(d?-1:1)*s*Math.pow(2,o-n)};r.write=function(e,t,r,n,i,o){var s,a,f;var u=o*8-i-1;var l=(1<<u)-1;var c=l>>1;var h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:o-1;var p=n?1:-1;var g=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){a=isNaN(t)?1:0;s=l}else{s=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+c>=1){t+=h/f}else{t+=h*Math.pow(2,1-c)}if(t*f>=2){s++;f/=2}if(s+c>=l){a=0;s=l}else if(s+c>=1){a=(t*f-1)*Math.pow(2,i);s=s+c}else{a=t*Math.pow(2,c-1)*Math.pow(2,i);s=0}}for(;i>=8;e[r+d]=a&255,d+=p,a/=256,i-=8){}s=s<<i|a;u+=i;for(;u>0;e[r+d]=s&255,d+=p,s/=256,u-=8){}e[r+d-p]|=g*128}},{}],11:[function(e,t,r){if(typeof Object.create==="function"){t.exports=function e(t,r){t.super_=r;t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}})}}else{t.exports=function e(t,r){t.super_=r;var n=function(){};n.prototype=r.prototype;t.prototype=new n;t.prototype.constructor=t}}},{}],12:[function(e,t,r){t.exports=function(e){return e!=null&&(n(e)||i(e)||!!e._isBuffer)};function n(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function i(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&n(e.slice(0,0))}},{}],13:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)=="[object Array]"}},{}],14:[function(e,t,r){var n=1e3;var i=n*60;var o=i*60;var s=o*24;var a=s*365.25;t.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return f(e)}else if(r==="number"&&isNaN(e)===false){return t.long?l(e):u(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function f(e){e=String(e);if(e.length>1e4){return}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){return}var r=parseFloat(t[1]);var f=(t[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return r*a;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*o;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return undefined}}function u(e){if(e>=s){return Math.round(e/s)+"d"}if(e>=o){return Math.round(e/o)+"h"}if(e>=i){return Math.round(e/i)+"m"}if(e>=n){return Math.round(e/n)+"s"}return e+"ms"}function l(e){return c(e,s,"day")||c(e,o,"hour")||c(e,i,"minute")||c(e,n,"second")||e+" ms"}function c(e,t,r){if(e<t){return}if(e<t*1.5){return Math.floor(e/t)+" "+r}return Math.ceil(e/t)+" "+r+"s"}},{}],15:[function(e,t,r){(function(e){"use strict";if(!e.version||e.version.indexOf("v0.")===0||e.version.indexOf("v1.")===0&&e.version.indexOf("v1.8.")!==0){t.exports=r}else{t.exports=e.nextTick}function r(t,r,n,i){if(typeof t!=="function"){throw new TypeError('"callback" argument must be a function')}var o=arguments.length;var s,a;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function e(){t.call(null,r)});case 3:return e.nextTick(function e(){t.call(null,r,n)});case 4:return e.nextTick(function e(){t.call(null,r,n,i)});default:s=new Array(o-1);a=0;while(a<s.length){s[a++]=arguments[a]}return e.nextTick(function e(){t.apply(null,s)})}}}).call(this,e("_process"))},{_process:16}],16:[function(e,t,r){var n=t.exports={};var i;var o;function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){i=setTimeout}else{i=s}}catch(e){i=s}try{if(typeof clearTimeout==="function"){o=clearTimeout}else{o=a}}catch(e){o=a}})();function f(e){if(i===setTimeout){return setTimeout(e,0)}if((i===s||!i)&&setTimeout){i=setTimeout;return setTimeout(e,0)}try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function u(e){if(o===clearTimeout){return clearTimeout(e)}if((o===a||!o)&&clearTimeout){o=clearTimeout;return clearTimeout(e)}try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}var l=[];var c=false;var h;var d=-1;function p(){if(!c||!h){return}c=false;if(h.length){l=h.concat(l)}else{d=-1}if(l.length){g()}}function g(){if(c){return}var e=f(p);c=true;var t=l.length;while(t){h=l;l=[];while(++d<t){if(h){h[d].run()}}d=-1;t=l.length}h=null;c=false;u(e)}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}}l.push(new v(e,t));if(l.length===1&&!c){f(g)}};function v(e,t){this.fun=e;this.array=t}v.prototype.run=function(){this.fun.apply(null,this.array)};n.title="browser";n.browser=true;n.env={};n.argv=[];n.version="";n.versions={};function y(){}n.on=y;n.addListener=y;n.once=y;n.off=y;n.removeListener=y;n.removeAllListeners=y;n.emit=y;n.binding=function(e){throw new Error("process.binding is not supported")};n.cwd=function(){return"/"};n.chdir=function(e){throw new Error("process.chdir is not supported")};n.umask=function(){return 0}},{}],17:[function(e,t,r){(function(e,r,n){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r.crypto||r.msCrypto;if(o&&o.getRandomValues){t.exports=s}else{t.exports=i}function s(t,i){if(t>65536)throw new Error("requested too many random bytes");var s=new r.Uint8Array(t);if(t>0){o.getRandomValues(s)}var a=new n(s.buffer);if(typeof i==="function"){return e.nextTick(function(){i(null,a)})}return a}}).call(this,e("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},e("buffer").Buffer)},{_process:16,buffer:4}],18:[function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};t.exports=c;var i=e("process-nextick-args");var o=e("core-util-is");o.inherits=e("inherits");var s=e("./_stream_readable");var a=e("./_stream_writable");o.inherits(c,s);var f=n(a.prototype);for(var u=0;u<f.length;u++){var l=f[u];if(!c.prototype[l])c.prototype[l]=a.prototype[l]}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e);a.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",h)}function h(){if(this.allowHalfOpen||this._writableState.ended)return;i(d,this)}function d(e){e.end()}function p(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}},{"./_stream_readable":20,"./_stream_writable":22,"core-util-is":5,inherits:11,"process-nextick-args":15}],19:[function(e,t,r){"use strict";t.exports=o;var n=e("./_stream_transform");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(o,n);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":21,"core-util-is":5,inherits:11}],20:[function(e,t,r){(function(r){"use strict";t.exports=w;var n=e("process-nextick-args");var i=e("isarray");var o;w.ReadableState=y;var s=e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length};var f;(function(){try{f=e("st"+"ream")}catch(e){}finally{if(!f)f=e("events").EventEmitter}})();var u=e("buffer").Buffer;var l=e("buffer-shims");var c=e("core-util-is");c.inherits=e("inherits");var h=e("util");var d=void 0;if(h&&h.debuglog){d=h.debuglog("stream")}else{d=function(){}}var p=e("./internal/streams/BufferList");var g;c.inherits(w,f);function v(e,t,r){if(typeof e.prependListener==="function"){return e.prependListener(t,r)}else{if(!e._events||!e._events[t])e.on(t,r);else if(i(e._events[t]))e._events[t].unshift(r);else e._events[t]=[r,e._events[t]]}}function y(t,r){o=o||e("./_stream_duplex");t=t||{};this.objectMode=!!t.objectMode;if(r instanceof o)this.objectMode=this.objectMode||!!t.readableObjectMode;var n=t.highWaterMark;var i=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:i;this.highWaterMark=~~this.highWaterMark;this.buffer=new p;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.defaultEncoding=t.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(t.encoding){if(!g)g=e("string_decoder/").StringDecoder;this.decoder=new g(t.encoding);this.encoding=t.encoding}}function w(t){o=o||e("./_stream_duplex");if(!(this instanceof w))return new w(t);this._readableState=new y(t,this);this.readable=true;if(t&&typeof t.read==="function")this._read=t.read;f.call(this)}w.prototype.push=function(e,t){var r=this._readableState;if(!r.objectMode&&typeof e==="string"){t=t||r.defaultEncoding;if(t!==r.encoding){e=l.from(e,t);t=""}}return m(this,r,e,t,false)};w.prototype.unshift=function(e){var t=this._readableState;return m(this,t,e,"",true)};w.prototype.isPaused=function(){return this._readableState.flowing===false};function m(e,t,r,n,i){var o=S(t,r);if(o){e.emit("error",o)}else if(r===null){t.reading=false;A(e,t)}else if(t.objectMode||r&&r.length>0){if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else{var f;if(t.decoder&&!i&&!n){r=t.decoder.write(r);f=!t.objectMode&&r.length===0}if(!i)t.reading=false;if(!f){if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(i)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)C(e)}}k(e,t)}}else if(!i){t.reading=false}return b(t)}function b(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}w.prototype.setEncoding=function(t){if(!g)g=e("string_decoder/").StringDecoder;this._readableState.decoder=new g(t);this._readableState.encoding=t;return this};var _=8388608;function E(e){if(e>=_){e=_}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function R(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=E(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}w.prototype.read=function(e){d("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){d("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)Y(this);else C(this);return null}e=R(e,t);if(e===0&&t.ended){if(t.length===0)Y(this);return null}var n=t.needReadable;d("need readable",n);if(t.length===0||t.length-e<t.highWaterMark){n=true;d("length less than watermark",n)}if(t.ended||t.reading){n=false;d("reading or ended",n)}else if(n){d("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false;if(!t.reading)e=R(r,t)}var i;if(e>0)i=I(e,t);else i=null;if(i===null){t.needReadable=true;e=0}else{t.length-=e}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)Y(this)}if(i!==null)this.emit("data",i);return i};function S(e,t){var r=null;if(!u.isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function A(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;C(e)}function C(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){d("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)n(T,e);else T(e)}}function T(e){d("emit readable");e.emit("readable");U(e)}function k(e,t){if(!t.readingMore){t.readingMore=true;n(x,e,t)}}function x(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){d("maybeReadMore read 0");e.read(0);if(r===t.length)break;else r=t.length}t.readingMore=false}w.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};w.prototype.pipe=function(e,t){var i=this;var o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e);break}o.pipesCount+=1;d("pipe count=%d opts=%j",o.pipesCount,t);var s=(!t||t.end!==false)&&e!==r.stdout&&e!==r.stderr;var f=s?l:p;if(o.endEmitted)n(f);else i.once("end",f);e.on("unpipe",u);function u(e){d("onunpipe");if(e===i){p()}}function l(){d("onend");e.end()}var c=B(i);e.on("drain",c);var h=false;function p(){d("cleanup");e.removeListener("close",m);e.removeListener("finish",b);e.removeListener("drain",c);e.removeListener("error",w);e.removeListener("unpipe",u);i.removeListener("end",l);i.removeListener("end",p);i.removeListener("data",y);h=true;if(o.awaitDrain&&(!e._writableState||e._writableState.needDrain))c()}var g=false;i.on("data",y);function y(t){d("ondata");g=false;var r=e.write(t);if(false===r&&!g){if((o.pipesCount===1&&o.pipes===e||o.pipesCount>1&&W(o.pipes,e)!==-1)&&!h){d("false write response, pause",i._readableState.awaitDrain);i._readableState.awaitDrain++;g=true}i.pause()}}function w(t){d("onerror",t);_();e.removeListener("error",w);if(a(e,"error")===0)e.emit("error",t)}v(e,"error",w);function m(){e.removeListener("finish",b);_()}e.once("close",m);function b(){d("onfinish");e.removeListener("close",m);_()}e.once("finish",b);function _(){d("unpipe");i.unpipe(e)}e.emit("pipe",i);if(!o.flowing){d("pipe resume");i.resume()}return e};function B(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&a(e,"data")){t.flowing=true;U(e)}}}w.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var r=t.pipes;var n=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var i=0;i<n;i++){r[i].emit("unpipe",this)}return this}var o=W(t.pipes,e);if(o===-1)return this;t.pipes.splice(o,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this);return this};w.prototype.on=function(e,t){var r=f.prototype.on.call(this,e,t);if(e==="data"){if(this._readableState.flowing!==false)this.resume()}else if(e==="readable"){var i=this._readableState;if(!i.endEmitted&&!i.readableListening){i.readableListening=i.needReadable=true;i.emittedReadable=false;if(!i.reading){n(L,this)}else if(i.length){C(this,i)}}}return r};w.prototype.addListener=w.prototype.on;function L(e){d("readable nexttick read 0");e.read(0)}w.prototype.resume=function(){var e=this._readableState;if(!e.flowing){d("resume");e.flowing=true;P(this,e)}return this};function P(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;n(M,e,t)}}function M(e,t){if(!t.reading){d("resume read 0");e.read(0)}t.resumeScheduled=false;t.awaitDrain=0;e.emit("resume");U(e);if(t.flowing&&!t.reading)e.read(0)}w.prototype.pause=function(){d("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){d("pause");this._readableState.flowing=false;this.emit("pause")}return this};function U(e){var t=e._readableState;d("flow",t.flowing);while(t.flowing&&e.read()!==null){}}w.prototype.wrap=function(e){var t=this._readableState;var r=false;var n=this;e.on("end",function(){d("wrapped end");if(t.decoder&&!t.ended){var e=t.decoder.end();if(e&&e.length)n.push(e)}n.push(null)});e.on("data",function(i){d("wrapped data");if(t.decoder)i=t.decoder.write(i);if(t.objectMode&&(i===null||i===undefined))return;else if(!t.objectMode&&(!i||!i.length))return;var o=n.push(i);if(!o){r=true;e.pause()}});for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)}}var o=["error","close","destroy","pause","resume"];q(o,function(t){e.on(t,n.emit.bind(n,t))});n._read=function(t){d("wrapped _read",t);if(r){r=false;e.resume()}};return n};w._fromList=I;function I(e,t){if(t.length===0)return null;var r;if(t.objectMode)r=t.buffer.shift();else if(!e||e>=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.head.data;else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=D(e,t.buffer,t.decoder)}return r}function D(e,t,r){var n;if(e<t.head.data.length){n=t.head.data.slice(0,e);t.head.data=t.head.data.slice(e)}else if(e===t.head.data.length){n=t.shift()}else{n=r?j(e,t):O(e,t)}return n}function j(e,t){var r=t.head;var n=1;var i=r.data;e-=i.length;while(r=r.next){var o=r.data;var s=e>o.length?o.length:e;if(s===o.length)i+=o;else i+=o.slice(0,e);e-=s;if(e===0){if(s===o.length){++n;if(r.next)t.head=r.next;else t.head=t.tail=null}else{t.head=r;r.data=o.slice(s)}break}++n}t.length-=n;return i}function O(e,t){var r=l.allocUnsafe(e);var n=t.head;var i=1;n.data.copy(r);e-=n.data.length;while(n=n.next){var o=n.data;var s=e>o.length?o.length:e;o.copy(r,r.length-e,0,s);e-=s;if(e===0){if(s===o.length){++i;if(n.next)t.head=n.next;else t.head=t.tail=null}else{t.head=n;n.data=o.slice(s)}break}++i}t.length-=i;return r}function Y(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!t.endEmitted){t.ended=true;n(N,t,e)}}function N(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function q(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}}function W(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}}).call(this,e("_process"))},{"./_stream_duplex":18,"./internal/streams/BufferList":23,_process:16,buffer:4,"buffer-shims":3,"core-util-is":5,events:8,inherits:11,isarray:13,"process-nextick-args":15,"string_decoder/":25,util:2}],21:[function(e,t,r){"use strict";t.exports=a;var n=e("./_stream_duplex");var i=e("core-util-is");i.inherits=e("inherits");i.inherits(a,n);function o(e){this.afterTransform=function(t,r){return s(e,t,r)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null;this.writeencoding=null}function s(e,t,r){var n=e._transformState;n.transforming=false;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null;n.writecb=null;if(r!==null&&r!==undefined)e.push(r);i(t);var o=e._readableState;o.reading=false;if(o.needReadable||o.length<o.highWaterMark){e._read(o.highWaterMark)}}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e);this._transformState=new o(this);var t=this;this._readableState.needReadable=true;this._readableState.sync=false;if(e){if(typeof e.transform==="function")this._transform=e.transform;if(typeof e.flush==="function")this._flush=e.flush}this.once("prefinish",function(){if(typeof this._flush==="function")this._flush(function(e,r){f(t,e,r)});else f(t)})}a.prototype.push=function(e,t){this._transformState.needTransform=false;return n.prototype.push.call(this,e,t)};a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};a.prototype._write=function(e,t,r){var n=this._transformState;n.writecb=r;n.writechunk=e;n.writeencoding=t;if(!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};a.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};function f(e,t,r){if(t)return e.emit("error",t);if(r!==null&&r!==undefined)e.push(r);var n=e._writableState;var i=e._transformState;if(n.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}},{"./_stream_duplex":18,"core-util-is":5,inherits:11}],22:[function(e,t,r){(function(r){"use strict";t.exports=g;var n=e("process-nextick-args");var i=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?setImmediate:n;var o;g.WritableState=d;var s=e("core-util-is");s.inherits=e("inherits");var a={deprecate:e("util-deprecate")};var f;(function(){try{f=e("st"+"ream")}catch(e){}finally{if(!f)f=e("events").EventEmitter}})();var u=e("buffer").Buffer;var l=e("buffer-shims");s.inherits(g,f);function c(){}function h(e,t,r){this.chunk=e;this.encoding=t;this.callback=r;this.next=null}function d(t,r){o=o||e("./_stream_duplex");t=t||{};this.objectMode=!!t.objectMode;if(r instanceof o)this.objectMode=this.objectMode||!!t.writableObjectMode;var n=t.highWaterMark;var i=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:i;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var s=t.decodeStrings===false;this.decodeStrings=!s;this.defaultEncoding=t.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){R(r,e)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new L(this)}d.prototype.getBuffer=function e(){var t=this.bufferedRequest;var r=[];while(t){r.push(t);t=t.next}return r};(function(){try{Object.defineProperty(d.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(e){}})();var p;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){p=Function.prototype[Symbol.hasInstance];Object.defineProperty(g,Symbol.hasInstance,{value:function(e){if(p.call(this,e))return true;return e&&e._writableState instanceof d}})}else{p=function(e){return e instanceof this}}function g(t){o=o||e("./_stream_duplex");if(!p.call(g,this)&&!(this instanceof o)){return new g(t)}this._writableState=new d(t,this);this.writable=true;if(t){if(typeof t.write==="function")this._write=t.write;if(typeof t.writev==="function")this._writev=t.writev}f.call(this)}g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function v(e,t){var r=new Error("write after end");e.emit("error",r);n(t,r)}function y(e,t,r,i){var o=true;var s=false;if(r===null){s=new TypeError("May not write null values to stream")}else if(!u.isBuffer(r)&&typeof r!=="string"&&r!==undefined&&!t.objectMode){s=new TypeError("Invalid non-string/buffer chunk")}if(s){e.emit("error",s);n(i,s);o=false}return o}g.prototype.write=function(e,t,r){var n=this._writableState;var i=false;if(typeof t==="function"){r=t;t=null}if(u.isBuffer(e))t="buffer";else if(!t)t=n.defaultEncoding;if(typeof r!=="function")r=c;if(n.ended)v(this,r);else if(y(this,n,e,r)){n.pendingcb++;i=m(this,n,e,t,r)}return i};g.prototype.cork=function(){var e=this._writableState;e.corked++};g.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest)C(this,e)}};g.prototype.setDefaultEncoding=function e(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);this._writableState.defaultEncoding=t;return this};function w(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=l.from(t,r)}return t}function m(e,t,r,n,i){r=w(t,r,n);if(u.isBuffer(r))n="buffer";var o=t.objectMode?1:r.length;t.length+=o;var s=t.length<t.highWaterMark;if(!s)t.needDrain=true;if(t.writing||t.corked){var a=t.lastBufferedRequest;t.lastBufferedRequest=new h(r,n,i);if(a){a.next=t.lastBufferedRequest}else{t.bufferedRequest=t.lastBufferedRequest}t.bufferedRequestCount+=1}else{b(e,t,false,o,r,n,i)}return s}function b(e,t,r,n,i,o,s){t.writelen=n;t.writecb=s;t.writing=true;t.sync=true;if(r)e._writev(i,t.onwrite);else e._write(i,o,t.onwrite);t.sync=false}function _(e,t,r,i,o){--t.pendingcb;if(r)n(o,i);else o(i);e._writableState.errorEmitted=true;e.emit("error",i)}function E(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function R(e,t){var r=e._writableState;var n=r.sync;var o=r.writecb;E(r);if(t)_(e,r,n,t,o);else{var s=T(r);if(!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){C(e,r)}if(n){i(S,e,r,s,o)}else{S(e,r,s,o)}}}function S(e,t,r,n){if(!r)A(e,t);t.pendingcb--;n();x(e,t)}function A(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function C(e,t){t.bufferProcessing=true;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount;var i=new Array(n);var o=t.corkedRequestsFree;o.entry=r;var s=0;while(r){i[s]=r;r=r.next;s+=1}b(e,t,true,t.length,i,"",o.finish);t.pendingcb++;t.lastBufferedRequest=null;if(o.next){t.corkedRequestsFree=o.next;o.next=null}else{t.corkedRequestsFree=new L(t)}}else{while(r){var a=r.chunk;var f=r.encoding;var u=r.callback;var l=t.objectMode?1:a.length;b(e,t,false,l,a,f,u);r=r.next;if(t.writing){break}}if(r===null)t.lastBufferedRequest=null}t.bufferedRequestCount=0;t.bufferedRequest=r;t.bufferProcessing=false}g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};g.prototype._writev=null;g.prototype.end=function(e,t,r){var n=this._writableState;if(typeof e==="function"){r=e;e=null;t=null}else if(typeof t==="function"){r=t;t=null}if(e!==null&&e!==undefined)this.write(e,t);if(n.corked){n.corked=1;this.uncork()}if(!n.ending&&!n.finished)B(this,n,r)};function T(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function k(e,t){if(!t.prefinished){t.prefinished=true;e.emit("prefinish")}}function x(e,t){var r=T(t);if(r){if(t.pendingcb===0){k(e,t);t.finished=true;e.emit("finish")}else{k(e,t)}}return r}function B(e,t,r){t.ending=true;x(e,t);if(r){if(t.finished)n(r);else e.once("finish",r)}t.ended=true;e.writable=false}function L(e){var t=this;this.next=null;this.entry=null;this.finish=function(r){var n=t.entry;t.entry=null;while(n){var i=n.callback;e.pendingcb--;i(r);n=n.next}if(e.corkedRequestsFree){e.corkedRequestsFree.next=t}else{e.corkedRequestsFree=t}}}}).call(this,e("_process"))},{"./_stream_duplex":18,_process:16,buffer:4,"buffer-shims":3,"core-util-is":5,events:8,inherits:11,"process-nextick-args":15,"util-deprecate":26}],23:[function(e,t,r){"use strict";var n=e("buffer").Buffer;var i=e("buffer-shims");t.exports=o;function o(){this.head=null;this.tail=null;this.length=0}o.prototype.push=function(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length};o.prototype.unshift=function(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length};o.prototype.shift=function(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e};o.prototype.clear=function(){this.head=this.tail=null;this.length=0};o.prototype.join=function(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r};o.prototype.concat=function(e){if(this.length===0)return i.alloc(0);if(this.length===1)return this.head.data;var t=i.allocUnsafe(e>>>0);var r=this.head;var n=0;while(r){r.data.copy(t,n);n+=r.data.length;r=r.next}return t}},{buffer:4,"buffer-shims":3}],24:[function(e,t,r){(function(n){var i=function(){try{return e("st"+"ream")}catch(e){}}();r=t.exports=e("./lib/_stream_readable.js");r.Stream=i||r;r.Readable=r;r.Writable=e("./lib/_stream_writable.js");r.Duplex=e("./lib/_stream_duplex.js");r.Transform=e("./lib/_stream_transform.js");r.PassThrough=e("./lib/_stream_passthrough.js");if(!n.browser&&n.env.READABLE_STREAM==="disable"&&i){t.exports=i}}).call(this,e("_process"))},{"./lib/_stream_duplex.js":18,"./lib/_stream_passthrough.js":19,"./lib/_stream_readable.js":20,"./lib/_stream_transform.js":21,"./lib/_stream_writable.js":22,_process:16}],25:[function(e,t,r){var n=e("buffer").Buffer;var i=n.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 true;default:return false}};function o(e){if(e&&!i(e)){throw new Error("Unknown encoding: "+e)}}var s=r.StringDecoder=function(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");o(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=f;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=u;break;default:this.write=a;return}this.charBuffer=new n(6);this.charReceived=0;this.charLength=0};s.prototype.write=function(e){var t="";while(this.charLength){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,r);this.charReceived+=r;if(this.charReceived<this.charLength){return""}e=e.slice(r,e.length);t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0){return t}break}this.detectIncompleteChar(e);var i=e.length;if(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;var n=t.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;this.charLength+=o;this.charReceived+=o;this.charBuffer.copy(this.charBuffer,o,0,o);e.copy(this.charBuffer,0,0,o);return t.substring(0,i)}return t};s.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var r=e[e.length-t];if(t==1&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t};s.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var r=this.charReceived;var n=this.charBuffer;var i=this.encoding;t+=n.slice(0,r).toString(i)}return t};function a(e){return e.toString(this.encoding)}function f(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}},{buffer:4}],26:[function(e,t,r){(function(e){t.exports=r;function r(e,t){if(n("noDeprecation")){return e}var r=false;function i(){if(!r){if(n("throwDeprecation")){throw new Error(t)}else if(n("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return i}function n(t){try{if(!e.localStorage)return false}catch(e){return false}var r=e.localStorage[t];if(null==r)return false;return String(r).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],"/":[function(e,t,r){(function(r){t.exports=f;var n=e("debug")("simple-peer");var i=e("get-browser-rtc");var o=e("inherits");var s=e("randombytes");var a=e("readable-stream");o(f,a.Duplex);function f(e){var t=this;if(!(t instanceof f))return new f(e);t._id=s(4).toString("hex").slice(0,7);t._debug("new peer %o",e);e=Object.assign({},{allowHalfOpen:false,highWaterMark:1024*1024},e);a.Duplex.call(t,e);t.channelName=e.initiator?e.channelName||s(20).toString("hex"):null;t.initiator=e.initiator||false;t.channelConfig=e.channelConfig||f.channelConfig;t.config=e.config||f.config;t.constraints=e.constraints||f.constraints;t.offerConstraints=e.offerConstraints||{};t.answerConstraints=e.answerConstraints||{};t.reconnectTimer=e.reconnectTimer||false;t.sdpTransform=e.sdpTransform||function(e){return e};t.stream=e.stream||false;t.trickle=e.trickle!==undefined?e.trickle:true;t.destroyed=false;t.connected=false;t.remoteAddress=undefined;t.remoteFamily=undefined;t.remotePort=undefined;t.localAddress=undefined;t.localPort=undefined;t._isWrtc=!!e.wrtc;t._wrtc=e.wrtc&&typeof e.wrtc==="object"?e.wrtc:i();if(!t._wrtc){if(typeof window==="undefined"){throw new Error("No WebRTC support: Specify `opts.wrtc` option in this environment")}else{throw new Error("No WebRTC support: Not a supported browser")}}t._maxBufferedAmount=e.highWaterMark;t._pcReady=false;t._channelReady=false;t._iceComplete=false;t._channel=null;t._pendingCandidates=[];t._chunk=null;t._cb=null;t._interval=null;t._reconnectTimeout=null;t._pc=new t._wrtc.RTCPeerConnection(t.config,t.constraints);t._pc.oniceconnectionstatechange=function(){t._onIceConnectionStateChange()};t._pc.onsignalingstatechange=function(){t._onSignalingStateChange()};t._pc.onicecandidate=function(e){t._onIceCandidate(e)};if(t.stream)t._pc.addStream(t.stream);if("ontrack"in t._pc){t._pc.ontrack=function(e){t._onTrack(e)}}else{t._pc.onaddstream=function(e){t._onAddStream(e)}}if(t.initiator){t._setupData({channel:t._pc.createDataChannel(t.channelName,t.channelConfig)});var r=false;t._pc.onnegotiationneeded=function(){if(!r)t._createOffer();r=true};if(typeof window==="undefined"||!window.webkitRTCPeerConnection){t._pc.onnegotiationneeded()}}else{t._pc.ondatachannel=function(e){t._setupData(e)}}t.on("finish",function(){if(t.connected){setTimeout(function(){t._destroy()},100)}else{t.once("connect",function(){setTimeout(function(){t._destroy()},100)})}})}f.WEBRTC_SUPPORT=!!i();f.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]};f.constraints={};f.channelConfig={};Object.defineProperty(f.prototype,"bufferSize",{get:function(){var e=this;return e._channel&&e._channel.bufferedAmount||0}});f.prototype.address=function(){var e=this;return{port:e.localPort,family:"IPv4",address:e.localAddress}};f.prototype.signal=function(e){var t=this;if(t.destroyed)throw new Error("cannot signal after peer is destroyed");if(typeof e==="string"){try{e=JSON.parse(e)}catch(t){e={}}}t._debug("signal()");function r(e){try{t._pc.addIceCandidate(new t._wrtc.RTCIceCandidate(e),u,function(e){t._onError(e)})}catch(e){t._destroy(new Error("error adding candidate: "+e.message))}}if(e.sdp){t._pc.setRemoteDescription(new t._wrtc.RTCSessionDescription(e),function(){if(t.destroyed)return;if(t._pc.remoteDescription.type==="offer")t._createAnswer();t._pendingCandidates.forEach(r);t._pendingCandidates=[]},function(e){t._onError(e)})}if(e.candidate){if(t._pc.remoteDescription)r(e.candidate);else t._pendingCandidates.push(e.candidate)}if(!e.sdp&&!e.candidate){t._destroy(new Error("signal() called with invalid signal data"))}};f.prototype.send=function(e){var t=this;if(r.isBuffer(e)&&t._isWrtc){e=new Uint8Array(e)}var n=e.length||e.byteLength||e.size;t._channel.send(e);t._debug("write: %d bytes",n)};f.prototype.destroy=function(e){var t=this;t._destroy(null,e)};f.prototype._destroy=function(e,t){var r=this;if(r.destroyed)return;if(t)r.once("close",t);r._debug("destroy (error: %s)",e&&e.message);r.readable=r.writable=false;if(!r._readableState.ended)r.push(null);if(!r._writableState.finished)r.end();r.destroyed=true;r.connected=false;r._pcReady=false;r._channelReady=false;r._chunk=null;r._cb=null;clearInterval(r._interval);clearTimeout(r._reconnectTimeout);if(r._pc){try{r._pc.close()}catch(e){}r._pc.oniceconnectionstatechange=null;r._pc.onsignalingstatechange=null;r._pc.onicecandidate=null;if("ontrack"in r._pc){r._pc.ontrack=null}else{r._pc.onaddstream=null}r._pc.onnegotiationneeded=null;r._pc.ondatachannel=null}if(r._channel){try{r._channel.close()}catch(e){}r._channel.onmessage=null;r._channel.onopen=null;r._channel.onclose=null}r._pc=null;r._channel=null;if(e)r.emit("error",e);r.emit("close")};f.prototype._setupData=function(e){var t=this;t._channel=e.channel;t.channelName=t._channel.label;t._channel.binaryType="arraybuffer";t._channel.onmessage=function(e){t._onChannelMessage(e)};t._channel.onopen=function(){t._onChannelOpen()};t._channel.onclose=function(){t._onChannelClose()}};f.prototype._read=function(){};f.prototype._write=function(e,t,r){var n=this;if(n.destroyed)return r(new Error("cannot write after peer is destroyed"));if(n.connected){try{n.send(e)}catch(e){return n._onError(e)}if(n._channel.bufferedAmount>n._maxBufferedAmount){n._debug("start backpressure: bufferedAmount %d",n._channel.bufferedAmount);n._cb=r}else{r(null)}}else{n._debug("write before connect");n._chunk=e;n._cb=r}};f.prototype._createOffer=function(){var e=this;if(e.destroyed)return;e._pc.createOffer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,u,function(t){e._onError(t)});var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},function(t){e._onError(t)},e.offerConstraints)};f.prototype._createAnswer=function(){var e=this;if(e.destroyed)return;e._pc.createAnswer(function(t){if(e.destroyed)return;t.sdp=e.sdpTransform(t.sdp);e._pc.setLocalDescription(t,u,function(t){e._onError(t)});var r=function(){var r=e._pc.localDescription||t;e._debug("signal");e.emit("signal",{type:r.type,sdp:r.sdp})};if(e.trickle||e._iceComplete)r();else e.once("_iceComplete",r)},function(t){e._onError(t)},e.answerConstraints)};f.prototype._onIceConnectionStateChange=function(){var e=this;if(e.destroyed)return;var t=e._pc.iceGatheringState;var r=e._pc.iceConnectionState;e._debug("iceConnectionStateChange %s %s",t,r);e.emit("iceConnectionStateChange",t,r);if(r==="connected"||r==="completed"){clearTimeout(e._reconnectTimeout);e._pcReady=true;e._maybeReady()}if(r==="disconnected"){if(e.reconnectTimer){clearTimeout(e._reconnectTimeout);e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)}else{e._destroy()}}if(r==="failed"){e._destroy(new Error("Ice connection failed."))}if(r==="closed"){e._destroy()}};f.prototype.getStats=function(e){var t=this;if(!t._pc.getStats){e([])}else if(typeof window!=="undefined"&&!!window.mozRTCPeerConnection){t._pc.getStats(null,function(t){var r=[];t.forEach(function(e){r.push(e)});e(r)},function(e){t._onError(e)})}else{t._pc.getStats(function(t){var r=[];t.result().forEach(function(e){var t={};e.names().forEach(function(r){t[r]=e.stat(r)});t.id=e.id;t.type=e.type;t.timestamp=e.timestamp;r.push(t)});e(r)})}};f.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady);if(e.connected||e._connecting||!e._pcReady||!e._channelReady)return;e._connecting=true;e.getStats(function(t){e._connecting=false;e.connected=true;var r={};var n={};function i(t){var i=n[t.localCandidateId];var o=r[t.remoteCandidateId];if(i){e.localAddress=i.ipAddress;e.localPort=Number(i.portNumber)}else if(typeof t.googLocalAddress==="string"){i=t.googLocalAddress.split(":");e.localAddress=i[0];e.localPort=Number(i[1])}e._debug("connect local: %s:%s",e.localAddress,e.localPort);if(o){e.remoteAddress=o.ipAddress;e.remotePort=Number(o.portNumber);e.remoteFamily="IPv4"}else if(typeof t.googRemoteAddress==="string"){o=t.googRemoteAddress.split(":");e.remoteAddress=o[0];e.remotePort=Number(o[1]);e.remoteFamily="IPv4"}e._debug("connect remote: %s:%s",e.remoteAddress,e.remotePort)}t.forEach(function(e){if(e.type==="remotecandidate")r[e.id]=e;if(e.type==="localcandidate")n[e.id]=e});t.forEach(function(e){var t=e.type==="googCandidatePair"&&e.googActiveConnection==="true"||e.type==="candidatepair"&&e.selected;if(t)i(e)});if(e._chunk){try{e.send(e._chunk)}catch(t){return e._onError(t)}e._chunk=null;e._debug('sent chunk from "write before connect"');var o=e._cb;e._cb=null;o(null)}e._interval=setInterval(function(){if(!e._cb||!e._channel||e._channel.bufferedAmount>e._maxBufferedAmount)return;e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null;t(null)},150);if(e._interval.unref)e._interval.unref();e._debug("connect");e.emit("connect")})};f.prototype._onSignalingStateChange=function(){var e=this;if(e.destroyed)return;e._debug("signalingStateChange %s",e._pc.signalingState);e.emit("signalingStateChange",e._pc.signalingState)};f.prototype._onIceCandidate=function(e){var t=this;if(t.destroyed)return;if(e.candidate&&t.trickle){t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}})}else if(!e.candidate){t._iceComplete=true;t.emit("_iceComplete")}};f.prototype._onChannelMessage=function(e){var t=this;if(t.destroyed)return;var n=e.data;t._debug("read: %d bytes",n.byteLength||n.length);if(n instanceof ArrayBuffer)n=new r(n);t.push(n)};f.prototype._onChannelOpen=function(){var e=this;if(e.connected||e.destroyed)return;e._debug("on channel open");e._channelReady=true;e._maybeReady()};f.prototype._onChannelClose=function(){var e=this;if(e.destroyed)return;e._debug("on channel close");e._destroy()};f.prototype._onAddStream=function(e){var t=this;if(t.destroyed)return;t._debug("on add stream");t.emit("stream",e.stream)};f.prototype._onTrack=function(e){var t=this;if(t.destroyed)return;t._debug("on track");t.emit("stream",e.streams[0])};f.prototype._onError=function(e){var t=this;if(t.destroyed)return;t._debug("error %s",e.message||e);t._destroy(e)};f.prototype._debug=function(){var e=this;var t=[].slice.call(arguments);t[0]="["+e._id+"] "+t[0];n.apply(null,t)};function u(){}}).call(this,e("buffer").Buffer)},{buffer:4,debug:6,"get-browser-rtc":9,inherits:11,randombytes:17,"readable-stream":24}]},{},[])("/")});