Skip to content

Instantly share code, notes, and snippets.

@alessioalex
Created September 18, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alessioalex/4fc79ffa60ff5699002a357037452f9f to your computer and use it in GitHub Desktop.
Save alessioalex/4fc79ffa60ff5699002a357037452f9f to your computer and use it in GitHub Desktop.
swarmchat.html
<html>
<head>
<style>
.lines { height: 20em; }
input[type="text"] {
width: 500px;
padding: 5px;
}
</style>
</head>
<body>
<div id="content"></div>
<script>!function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}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}({1:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){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"):u(this,e)):arguments.length>1?new o(e,arguments[1]):new o(e)}function s(e,t){if(e=g(e,0>t?0:0|v(t)),!o.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function a(e,t,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|y(t,n);return e=g(e,r),e.write(t,n),e}function u(e,t){if(o.isBuffer(t))return c(e,t);if($(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 l(e,t);if(t instanceof ArrayBuffer)return h(e,t)}return t.length?d(e,t):p(e,t)}function c(e,t){var n=0|v(t.length);return e=g(e,n),t.copy(e,0,0,n),e}function f(e,t){var n=0|v(t.length);e=g(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function l(e,t){var n=0|v(t.length);e=g(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function h(e,t){return t.byteLength,o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):e=l(e,new Uint8Array(t)),e}function d(e,t){var n=0|v(t.length);e=g(e,n);for(var r=0;n>r;r+=1)e[r]=255&t[r];return e}function p(e,t){var n,r=0;"Buffer"===t.type&&$(t.data)&&(n=t.data,r=0|v(n.length)),e=g(e,r);for(var i=0;r>i;i+=1)e[i]=255&n[i];return e}function g(e,t){o.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=o.prototype):e.length=t;var n=0!==t&&t<=o.poolSize>>>1;return n&&(e.parent=Z),e}function v(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function m(e,t){if(!(this instanceof m))return new m(e,t);var n=new o(e,t);return delete n.parent,n}function y(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 V(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function b(e,t,n){var r=!1;if(t=0|t,n=void 0===n||n===1/0?this.length:0|n,e||(e="utf8"),0>t&&(t=0),n>this.length&&(n=this.length),t>=n)return"";for(;;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return C(this,t,n);case"binary":return A(this,t,n);case"base64":return R(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function w(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;r>s;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 X(z(t,e.length-n),e,n,r)}function E(e,t,n,r){return X(H(t),e,n,r)}function x(e,t,n,r){return E(e,t,n,r)}function S(e,t,n,r){return X(V(t),e,n,r)}function k(e,t,n,r){return X(F(t,e.length-n),e,n,r)}function R(e,t,n){return 0===t&&n===e.length?G.fromByteArray(e):G.fromByteArray(e.slice(t,n))}function j(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;n>i;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(n>=i+a){var u,c,f,l;switch(a){case 1:128>o&&(s=o);break;case 2:u=e[i+1],128===(192&u)&&(l=(31&o)<<6|63&u,l>127&&(s=l));break;case 3:u=e[i+1],c=e[i+2],128===(192&u)&&128===(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c,l>2047&&(55296>l||l>57343)&&(s=l));break;case 4:u=e[i+1],c=e[i+2],f=e[i+3],128===(192&u)&&128===(192&c)&&128===(192&f)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&f,l>65535&&1114112>l&&(s=l))}}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 T(r)}function T(e){var t=e.length;if(K>=t)return String.fromCharCode.apply(String,e);for(var n="",r=0;t>r;)n+=String.fromCharCode.apply(String,e.slice(r,r+=K));return n}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(127&e[i]);return r}function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;n>i;i++)r+=String.fromCharCode(e[i]);return r}function M(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=t;n>o;o++)i+=Y(e[o]);return i}function O(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 L(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,s){if(!o.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");if(t>i||s>t)throw new RangeError("value is out of bounds");if(n+r>e.length)throw new RangeError("index out of range")}function D(e,t,n,r){0>t&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);o>i;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(e,t,n,r){0>t&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);o>i;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function I(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(e,t,n,r,52,8),n+8}function W(e){if(e=q(e).replace(Q,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return 16>e?"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;r>s;s++){if(n=e.charCodeAt(s),n>55295&&57344>n){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(56320>n){(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,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))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 H(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function F(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 V(e){return G.toByteArray(W(e))}function X(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}var G=e("base64-js"),J=e("ieee754"),$=e("isarray");n.Buffer=o,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,o.poolSize=8192;var Z={};o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),o._augment=function(e){return e.__proto__=o.prototype,e},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);s>i&&e[i]===t[i];)++i;return i!==s&&(n=e[i],r=t[i]),r>n?-1:n>r?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(!$(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=y,o.prototype._isBuffer=!0,o.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?j(this,0,e):b.apply(this,arguments)},o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0: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[-1===r?0:i-r]){if(-1===r&&(r=i),i-r+1===t.length)return n+r}else r=-1;return-1}if(t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(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.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|t,isFinite(n)?(n=0|n,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&&(0>n||0>t)||t>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return w(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 x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(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,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var r;if(o.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=o.prototype;else{var i=t-e;r=new o(i,void 0);for(var s=0;i>s;s++)r[s]=this[s+e]}return r.length&&(r.parent=this.parent||this),r},o.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||L(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|e,t=0|t,n||L(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||L(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||L(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||L(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|e,t=0|t,n||L(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|e,t=0|t,n||L(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||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||L(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||L(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||L(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||L(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||L(e,4,this.length),J.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),J.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),J.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),J.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){e=+e,t=0|t,n=0|n,r||P(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|t,n=0|n,r||P(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|t,n||P(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|t,n||P(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||P(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):N(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||P(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):N(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t=0|t,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=0,s=1,a=0>e?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|t,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0>e?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|t,n||P(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||P(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):N(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||P(this,e,t,4,2147483647,-2147483648),0>e&&(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):N(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return U(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&&n>r&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)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&&t>n&&r>t)for(i=s-1;i>=0;i--)e[i+t]=this[i+n];else if(1e3>s||!o.TYPED_ARRAY_SUPPORT)for(i=0;s>i;i++)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,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),t>n)throw new RangeError("end < start");if(n!==t&&0!==this.length){if(0>t||t>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof e)for(r=t;n>r;r++)this[r]=e;else{var i=z(e.toString()),o=i.length;for(r=t;n>r;r++)this[r]=i[r%o]}return this}};var Q=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":2,ieee754:3,isarray:4}],2:[function(e,t,n){!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===s||t===l?62:t===a||t===h?63:u>t?-1:u+10>t?t-u+26+26:f+26>t?t-f:c+26>t?t-c+26:void 0}function n(e){function n(e){c[l++]=e}var r,i,s,a,u,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=e.length;u="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0,c=new o(3*e.length/4-u),s=u>0?e.length-4:e.length;var l=0;for(r=0,i=0;s>r;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===u?(a=t(e.charAt(r))<<2|t(e.charAt(r+1))>>4,n(255&a)):1===u&&(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)),c}function r(e){function t(e){return i.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var r,o,s,a=e.length%3,u="";for(r=0,s=e.length-a;s>r;r+=3)o=(e[r]<<16)+(e[r+1]<<8)+e[r+2],u+=n(o);switch(a){case 1:o=e[e.length-1],u+=t(o>>2),u+=t(o<<4&63),u+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],u+=t(o>>10),u+=t(o>>4&63),u+=t(o<<2&63),u+="="}return u}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),f="A".charCodeAt(0),l="-".charCodeAt(0),h="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=r}("undefined"==typeof n?this.base64js={}:n)},{}],3:[function(e,t,n){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,f=-7,l=n?i-1:0,h=n?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=0>t||0===t&&0>1/t?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*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+l>=1?h/u:h*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-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,c+=i;c>0;e[n+d]=255&s,d+=p,s/=256,c-=8);e[n+d-p]|=128*g}},{}],4:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],5:[function(e,t,n){},{}],6:[function(e,t,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],7:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(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 u(e){return"symbol"==typeof e}function c(e){return void 0===e}function f(e){return"[object RegExp]"===v(e)}function l(e){return"object"==typeof e&&null!==e}function h(e){return"[object Date]"===v(e)}function d(e){return"[object Error]"===v(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 v(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=u,n.isUndefined=c,n.isRegExp=f,n.isObject=l,n.isDate=h,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":10}],8:[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)||0>e||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,u,c;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:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(s(n))for(o=Array.prototype.slice.call(arguments,1),c=n.slice(),r=c.length,u=0;r>u;u++)c[u].apply(this,o);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return 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&&(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())),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(0>r)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 if(n)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.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],9:[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}},{}],10:[function(e,t,n){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],11:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],12:[function(e,t,n){(function(e){"use strict";function n(t){for(var n=new Array(arguments.length-1),r=0;r<n.length;)n[r++]=arguments[r];e.nextTick(function(){t.apply(null,n)})}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=n:t.exports=e.nextTick}).call(this,e("_process"))},{_process:13}],13:[function(e,t,n){function r(){f=!1,a.length?c=a.concat(c):l=-1,c.length&&i()}function i(){if(!f){var e=setTimeout(r);f=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,f=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function s(){}var a,u=t.exports={},c=[],f=!1,l=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new o(e,t)),1!==c.length||f||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],14:[function(e,t,n){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":15}],15:[function(e,t,n){"use strict";function r(e){return this instanceof r?(c.call(this,e),f.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||a(o,this)}function o(e){e.end()}var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var a=e("process-nextick-args"),u=e("core-util-is");u.inherits=e("inherits");var c=e("./_stream_readable"),f=e("./_stream_writable");u.inherits(r,c);for(var l=s(f.prototype),h=0;h<l.length;h++){var d=l[h];r.prototype[d]||(r.prototype[d]=f.prototype[d])}},{"./_stream_readable":17,"./_stream_writable":19,"core-util-is":7,inherits:9,"process-nextick-args":12}],16:[function(e,t,n){"use strict";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":18,"core-util-is":7,inherits:9}],17:[function(e,t,n){(function(n){"use strict";function r(t,n){P=P||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,n instanceof P&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,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.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){return P=P||e("./_stream_duplex"),this instanceof i?(this._readableState=new r(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),void T.call(this)):new i(t)}function o(e,t,n,r,i){var o=c(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,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&&l(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){return e>=D?e=D:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var n=null;return j.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function f(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,l(e)}}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(M("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?k(h,e):h(e))}function h(e){M("emit readable"),e.emit("readable"),b(e)}function d(e,t){t.readingMore||(t.readingMore=!0,k(p,e,t))}function p(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(M("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function g(e){return function(){var t=e._readableState;M("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&C(e,"data")&&(t.flowing=!0,b(e))}}function v(e){M("readable nexttick read 0"),e.read(0)}function m(e,t){t.resumeScheduled||(t.resumeScheduled=!0,k(y,e,t))}function y(e,t){t.reading||(M("resume read 0"),e.read(0)),t.resumeScheduled=!1,e.emit("resume"),b(e),t.flowing&&!t.reading&&e.read(0)}function b(e){var t=e._readableState;if(M("flow",t.flowing),t.flowing)do var n=e.read();while(null!==n&&t.flowing)}function w(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(""):1===r.length?r[0]:j.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 j(e);for(var u=0,c=0,f=r.length;f>c&&e>u;c++){var a=r[0],l=Math.min(e-u,a.length);o?n+=a.slice(0,l):a.copy(n,u,0,l),l<a.length?r[0]=a.slice(l):r.shift(),u+=l}}return n}function _(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,k(E,t,e))}function E(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function x(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n],n)}function S(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=i;var k=e("process-nextick-args"),R=e("isarray"),j=e("buffer").Buffer;i.ReadableState=r;var T,C=(e("events"),function(e,t){return e.listeners(t).length});!function(){try{T=e("stream")}catch(t){}finally{T||(T=e("events").EventEmitter)}}();var j=e("buffer").Buffer,A=e("core-util-is");A.inherits=e("inherits");var M,O=e("util");
M=O&&O.debuglog?O.debuglog("stream"):function(){};var L;A.inherits(i,T);var P,P;i.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new j(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.isPaused=function(){return this._readableState.flowing===!1},i.prototype.setEncoding=function(t){return L||(L=e("string_decoder/").StringDecoder),this._readableState.decoder=new L(t),this._readableState.encoding=t,this};var D=8388608;i.prototype.read=function(e){M("read",e);var t=this._readableState,n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return M("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?_(this):l(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&_(this),null;var r=t.needReadable;M("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,M("length less than watermark",r)),(t.ended||t.reading)&&(r=!1,M("reading or ended",r)),r&&(M("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=u(n,t));var i;return i=e>0?w(e,t):null,null===i&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&_(this),null!==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){M("onunpipe"),e===l&&o()}function i(){M("onend"),e.end()}function o(){M("cleanup"),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("drain",v),e.removeListener("error",a),e.removeListener("unpipe",r),l.removeListener("end",i),l.removeListener("end",o),l.removeListener("data",s),m=!0,!h.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function s(t){M("ondata");var n=e.write(t);!1===n&&(1!==h.pipesCount||h.pipes[0]!==e||1!==l.listenerCount("data")||m||(M("false write response, pause",l._readableState.awaitDrain),l._readableState.awaitDrain++),l.pause())}function a(t){M("onerror",t),f(),e.removeListener("error",a),0===C(e,"error")&&e.emit("error",t)}function u(){e.removeListener("finish",c),f()}function c(){M("onfinish"),e.removeListener("close",u),f()}function f(){M("unpipe"),l.unpipe(e)}var l=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,M("pipe count=%d opts=%j",h.pipesCount,t);var d=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,p=d?i:o;h.endEmitted?k(p):l.once("end",p),e.on("unpipe",r);var v=g(l);e.on("drain",v);var m=!1;return l.on("data",s),e._events&&e._events.error?R(e._events.error)?e._events.error.unshift(a):e._events.error=[a,e._events.error]:e.on("error",a),e.once("close",u),e.once("finish",c),e.emit("pipe",l),h.flowing||(M("pipe resume"),l.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;r>i;i++)n[i].emit("unpipe",this);return this}var i=S(t.pipes,e);return-1===i?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 n=T.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this,r):k(v,this))}return n},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){var e=this._readableState;return e.flowing||(M("resume"),e.flowing=!0,m(this,e)),this},i.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(M("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(M("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(M("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));var o=["error","close","destroy","pause","resume"];return x(o,function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){M("wrapped _read",t),n&&(n=!1,e.resume())},r},i._fromList=w}).call(this,e("_process"))},{"./_stream_duplex":15,_process:13,buffer:1,"core-util-is":7,events:8,inherits:9,isarray:11,"process-nextick-args":12,"string_decoder/":25,util:6}],18:[function(e,t,n){"use strict";function r(e){this.afterTransform=function(t,n){return i(e,t,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,null!==n&&void 0!==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(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof 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"),u=e("core-util-is");u.inherits=e("inherits"),u.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;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":15,"core-util-is":7,inherits:9}],19:[function(e,t,n){"use strict";function r(){}function i(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function o(t,n){j=j||e("./_stream_duplex"),t=t||{},this.objectMode=!!t.objectMode,n instanceof j&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){p(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function s(t){return j=j||e("./_stream_duplex"),this instanceof s||this instanceof j?(this._writableState=new o(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),void k.call(this)):new s(t)}function a(e,t){var n=new Error("write after end");e.emit("error",n),E(t,n)}function u(e,t,n,r){var i=!0;if(!x.isBuffer(n)&&"string"!=typeof n&&null!==n&&void 0!==n&&!t.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");e.emit("error",o),E(r,o),i=!1}return i}function c(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new x(t,n)),t}function f(e,t,n,r,o){n=c(t,n,r),x.isBuffer(n)&&(r="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;if(a||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest=new i(n,r,o),u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest}else l(e,t,!1,s,n,r,o);return a}function l(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,n,r,i){--t.pendingcb,n?E(i,r):i(r),e._writableState.errorEmitted=!0,e.emit("error",r)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function p(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(d(n),t)h(e,n,r,t,i);else{var o=y(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||m(e,n),r?E(g,e,n,o,i):g(e,n,o,i)}}function g(e,t,n,r){n||v(e,t),t.pendingcb--,r(),w(e,t)}function v(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function m(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){for(var r=[],i=[];n;)i.push(n.callback),r.push(n),n=n.next;t.pendingcb++,t.lastBufferedRequest=null,l(e,t,!0,t.length,r,"",function(e){for(var n=0;n<i.length;n++)t.pendingcb--,i[n](e)})}else{for(;n;){var o=n.chunk,s=n.encoding,a=n.callback,u=t.objectMode?1:o.length;if(l(e,t,!1,u,o,s,a),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function y(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function b(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function w(e,t){var n=y(t);return n&&(0===t.pendingcb?(b(e,t),t.finished=!0,e.emit("finish")):b(e,t)),n}function _(e,t,n){t.ending=!0,w(e,t),n&&(t.finished?E(n):e.once("finish",n)),t.ended=!0}t.exports=s;var E=e("process-nextick-args"),x=e("buffer").Buffer;s.WritableState=o;var S=e("core-util-is");S.inherits=e("inherits");var k,R={deprecate:e("util-deprecate")};!function(){try{k=e("stream")}catch(t){}finally{k||(k=e("events").EventEmitter)}}();var x=e("buffer").Buffer;S.inherits(s,k);var j;o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:R.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var j;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},s.prototype.write=function(e,t,n){var i=this._writableState,o=!1;return"function"==typeof t&&(n=t,t=null),x.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=r),i.ended?a(this,n):u(this,i,e,n)&&(i.pendingcb++,o=f(this,i,e,t,n)),o},s.prototype.cork=function(){var e=this._writableState;e.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||m(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e},s.prototype._write=function(e,t,n){n(new Error("not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||_(this,r,n)}},{"./_stream_duplex":15,buffer:1,"core-util-is":7,events:8,inherits:9,"process-nextick-args":12,"util-deprecate":26}],20:[function(e,t,n){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":16}],21:[function(e,t,n){var r=function(){try{return e("stream")}catch(t){}}();n=t.exports=e("./lib/_stream_readable.js"),n.Stream=r||n,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")},{"./lib/_stream_duplex.js":15,"./lib/_stream_passthrough.js":16,"./lib/_stream_readable.js":17,"./lib/_stream_transform.js":18,"./lib/_stream_writable.js":19}],22:[function(e,t,n){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":18}],23:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":19}],24:[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)&&c.pause&&c.pause()}function r(){c.readable&&c.resume&&c.resume()}function o(){f||(f=!0,e.end())}function s(){f||(f=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){c.removeListener("data",n),e.removeListener("drain",r),c.removeListener("end",o),c.removeListener("close",s),c.removeListener("error",a),e.removeListener("error",a),c.removeListener("end",u),c.removeListener("close",u),e.removeListener("close",u)}var c=this;c.on("data",n),e.on("drain",r),e._isStdio||t&&t.end===!1||(c.on("end",o),c.on("close",s));var f=!1;return c.on("error",a),e.on("error",a),c.on("end",u),c.on("close",u),e.on("close",u),e.emit("pipe",c),e}},{events:8,inherits:9,"readable-stream/duplex.js":14,"readable-stream/passthrough.js":20,"readable-stream/readable.js":21,"readable-stream/transform.js":22,"readable-stream/writable.js":23}],25:[function(e,t,n){function r(e){if(e&&!u(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,u=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}},c=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};c.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&&56319>=r)){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&&56319>=r){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},c.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(2>=t&&n>>4==14){this.charLength=3;break}if(3>=t&&n>>3==30){this.charLength=4;break}}this.charReceived=t},c.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:1}],26:[function(e,t,n){(function(e){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(n){return!1}var r=e.localStorage[t];return null==r?!1:"true"===String(r).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],27:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],28:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&R(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return b(i)||(i=u(e,i,r)),i}var o=c(e,t);if(o)return o;var s=Object.keys(t),g=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),k(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(t);if(0===s.length){if(R(t)){var v=t.name?": "+t.name:"";return e.stylize("[Function"+v+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(k(t))return f(t)}var m="",y=!1,w=["{","}"];if(p(t)&&(y=!0,w=["[","]"]),R(t)){var _=t.name?": "+t.name:"";m=" [Function"+_+"]"}if(E(t)&&(m=" "+RegExp.prototype.toString.call(t)),S(t)&&(m=" "+Date.prototype.toUTCString.call(t)),k(t)&&(m=" "+f(t)),0===s.length&&(!y||0==t.length))return w[0]+m+w[1];if(0>r)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var x;return x=y?l(e,t,r,g,s):s.map(function(n){return h(e,t,r,g,n,y)}),e.seen.pop(),d(x,m,w)}function c(e,t){if(_(t))return e.stylize("undefined","undefined");if(b(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i){for(var o=[],s=0,a=t.length;a>s;++s)M(t,String(s))?o.push(h(e,t,n,r,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}function h(e,t,n,r,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),M(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=v(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function d(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function p(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function m(e){return null==e}function y(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return"symbol"==typeof e}function _(e){return void 0===e}function E(e){return x(e)&&"[object RegExp]"===T(e)}function x(e){return"object"==typeof e&&null!==e}function S(e){return x(e)&&"[object Date]"===T(e)}function k(e){return x(e)&&("[object Error]"===T(e)||e instanceof Error)}function R(e){return"function"==typeof e}function j(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function T(e){return Object.prototype.toString.call(e)}function C(e){return 10>e?"0"+e.toString(10):e.toString(10)}function A(){var e=new Date,t=[C(e.getHours()),C(e.getMinutes()),C(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O=/%[sdj%]/g;n.format=function(e){if(!b(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(e).replace(O,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];o>n;a=r[++n])s+=v(a)||!x(a)?" "+a:" "+i(a);return s},n.deprecate=function(e,i){function o(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}if(_(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var L,P={};n.debuglog=function(e){if(_(L)&&(L=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!P[e])if(new RegExp("\\b"+e+"\\b","i").test(L)){var r=t.pid;P[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else P[e]=function(){};return P[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=g,n.isNull=v,n.isNullOrUndefined=m,n.isNumber=y,n.isString=b,n.isSymbol=w,n.isUndefined=_,n.isRegExp=E,n.isObject=x,n.isDate=S,n.isError=k,n.isFunction=R,n.isPrimitive=j,n.isBuffer=e("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",A(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!x(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":27,_process:13,inherits:9}],29:[function(e,t,n){function r(e){function t(e){e.preventDefault();var t=this.elements.msg.value,n=u(8).toString("hex");Object.keys(v).forEach(function(e){v[e].write(n+","+t+"\n")}),i(n,t),this.reset()}return f("div",[f("div.lines",e.lines.map(function(e){return f("pre",e)})),f("form",{onsubmit:t},[f("input",{type:"text",name:"msg"})])])}function i(e,t){if(m[e])return!1;m[e]=!0;var n=h.state.lines;n.push(t),h.update({lines:n.slice(-10)})}var o=e("webrtc-swarm"),s=e("signalhub"),a=o(s("swarmchat-example",["https://signalhub.mafintosh.com"])),u=e("randombytes"),c=e("virtual-dom"),f=c.h,l=e("main-loop"),h=l({lines:[]},r,c);document.querySelector("#content").appendChild(h.target);var d=e("split2"),p=e("through2"),g=e("end-of-stream"),v={},m={};a.on("peer",function(e,t){console.log("CONNECTED",t),v[t]=e,g(e,function(){delete v[t]}),e.pipe(d()).pipe(p(function(e,n,r){var o=e.toString().split(","),s=o.slice(1).join(","),a=o[0];return i(a,s)===!1?r():(Object.keys(v).forEach(function(n){n!==t&&v[t].write(e+"\n")}),void r())}))})},{"end-of-stream":36,"main-loop":49,randombytes:59,signalhub:60,split2:76,through2:85,"virtual-dom":91,"webrtc-swarm":115}],30:[function(e,t,n){t.exports=function(e){var t,n=String.prototype.split,r=/()??/.exec("")[1]===e;return t=function(t,i,o){if("[object RegExp]"!==Object.prototype.toString.call(i))return n.call(t,i,o);var s,a,u,c,f=[],l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),h=0,i=new RegExp(i.source,l+"g");for(t+="",r||(s=new RegExp("^"+i.source+"$(?!\\s)",l)),o=o===e?-1>>>0:o>>>0;(a=i.exec(t))&&(u=a.index+a[0].length,!(u>h&&(f.push(t.slice(h,a.index)),!r&&a.length>1&&a[0].replace(s,function(){for(var t=1;t<arguments.length-2;t++)arguments[t]===e&&(a[t]=e)}),a.length>1&&a.index<t.length&&Array.prototype.push.apply(f,a.slice(1)),c=a[0].length,h=u,f.length>=o)));)i.lastIndex===a.index&&i.lastIndex++;return h===t.length?(c||!i.test(""))&&f.push(""):f.push(t.slice(h)),f.length>o?f.slice(0,o):f}}()},{}],31:[function(e,t,n){function r(e){return e&&"object"==typeof e?u(e)||c(e)?e:a(e)?o(e,r):s(l(e),function(t,n){var o=i(n);return t[o]=r(e[n]),t},{}):e}function i(e){return e.replace(/[_.-](\w|$)/g,function(e,t){return t.toUpperCase()})}function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}function s(e,t,n){if(e.reduce)return e.reduce(t,n);for(var r=0;r<e.length;r++)n=t(n,e[r],r);return n}t.exports=function(e){return"string"==typeof e?i(e):r(e)};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u=function(e){return"[object Date]"===Object.prototype.toString.call(e)},c=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},f=Object.prototype.hasOwnProperty,l=Object.keys||function(e){var t=[];for(var n in e)f.call(e,n)&&t.push(n);return t}},{}],32:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(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 u(e){return"symbol"==typeof e}function c(e){return void 0===e}function f(e){return"[object RegExp]"===v(e)}function l(e){return"object"==typeof e&&null!==e}function h(e){return"[object Date]"===v(e)}function d(e){return"[object Error]"===v(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 v(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=u,n.isUndefined=c,n.isRegExp=f,n.isObject=l,n.isDate=h,n.isError=d,n.isFunction=p,n.isPrimitive=g,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../../../../node-browserify/node_modules/is-buffer/index.js")})},{"../../../../../node-browserify/node_modules/is-buffer/index.js":10}],33:[function(e,t,n){!function(e){"use strict";var n="cuid",r=0,i=4,o=36,s=Math.pow(o,i),a=function(e,t){var n="000000000"+e;return n.substr(n.length-t)},u=function(){return a((Math.random()*s<<0).toString(o),i)},c=function(){return r=s>r?r:0,r++,r-1},f=function(){var e,t="c",n=(new Date).getTime().toString(o),r=f.fingerprint(),s=u()+u();return e=a(c().toString(o),i),t+n+e+r+s};f.slug=function(){var e,t=(new Date).getTime().toString(36),n=f.fingerprint().slice(0,1)+f.fingerprint().slice(-1),r=u().slice(-2);return e=c().toString(36).slice(-4),t.slice(-2)+e+n+r},f.globalCount=function(){var e=function(){var e,t=0;for(e in window)t++;return t}();return f.globalCount=function(){return e},e},f.fingerprint=function(){return a((navigator.mimeTypes.length+navigator.userAgent.length).toString(36)+f.globalCount().toString(36),4)},e.register?e.register(n,f):"undefined"!=typeof t?t.exports=f:e[n]=f}(this.applitude||this)},{}],34:[function(e,t,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,0,r),e}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(t){}}function a(){var e;try{e=n.storage.debug}catch(t){}return e}function u(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=o,n.formatArgs=i,n.save=s,n.load=a,n.useColors=r,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){return JSON.stringify(e)},n.enable(a())},{"./debug":35}],35:[function(e,t,n){function r(){return n.colors[f++%n.colors.length]}function i(e){function t(){}function i(){var e=i,t=+new Date,o=t-(c||t);e.diff=o,e.prev=c,e.curr=t,c=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=r());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;a++;var i=n.formatters[r];if("function"==typeof i){var o=s[a];t=i.call(e,o),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var u=i.log||n.log||console.log.bind(console);u.apply(e,s)}t.enabled=!1,i.enabled=!0;var o=n.enabled(e)?i:t;return o.namespace=e,o}function o(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,i=0;r>i;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;r>t;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;r>t;t++)if(n.names[t].test(e))return!0;return!1}function u(e){return e instanceof Error?e.stack||e.message:e}n=t.exports=i,n.coerce=u,n.disable=s,n.enable=o,n.enabled=a,n.humanize=e("ms"),n.names=[],n.skips=[],n.formatters={};var c,f=0},{ms:52}],36:[function(e,t,n){var r=e("once"),i=function(){},o=function(e){return e.setHeader&&"function"==typeof e.abort},s=function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length},a=function(e,t,n){if("function"==typeof t)return a(e,null,t);t||(t={}),n=r(n||i);var u=e._writableState,c=e._readableState,f=t.readable||t.readable!==!1&&e.readable,l=t.writable||t.writable!==!1&&e.writable,h=function(){e.writable||d()},d=function(){l=!1,f||n()},p=function(){f=!1,l||n()},g=function(e){n(e?new Error("exited with error code: "+e):null)},v=function(){return(!f||c&&c.ended)&&(!l||u&&u.ended)?void 0:n(new Error("premature close"))},m=function(){e.req.on("finish",d)};return o(e)?(e.on("complete",d),e.on("abort",v),e.req?m():e.on("request",m)):l&&!u&&(e.on("end",h),e.on("close",h)),s(e)&&e.on("exit",g),e.on("end",p),e.on("finish",d),t.error!==!1&&e.on("error",n),e.on("close",v),
function(){e.removeListener("complete",d),e.removeListener("abort",v),e.removeListener("request",m),e.req&&e.req.removeListener("finish",d),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("exit",g),e.removeListener("end",p),e.removeListener("error",n),e.removeListener("close",v)}};t.exports=a},{once:54}],37:[function(e,t,n){"use strict";function r(e){var t=e[s];return t||(t=e[s]={}),t}var i=e("individual/one-version"),o="7";i("ev-store",o);var s="__EV_STORE_KEY@"+o;t.exports=r},{"individual/one-version":45}],38:[function(e,t,n){var r=e("stream");t.exports=function(e,t){t||(t={});var n=new EventSource(e),i=new r.Readable({objectMode:!0}),o=!!t.json,s=function(e){try{return o?JSON.parse(e):e}catch(t){return}};i._read=function(){},n.onmessage=function(e){i.push(s(e.data))},n.onerror=function(e){i.listeners("error").length&&i.emit("error",e)},n.onopen=function(){i.emit("open")};var a=!1;return i.destroy=function(){a||(a=!0,n.close(),i.emit("close"))},i}},{stream:24}],39:[function(e,t,n){function r(e,t,n){if(!a(t))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===u.call(e)?i(e,t,n):"string"==typeof e?o(e,t,n):s(e,t,n)}function i(e,t,n){for(var r=0,i=e.length;i>r;r++)c.call(e,r)&&t.call(n,e[r],r,e)}function o(e,t,n){for(var r=0,i=e.length;i>r;r++)t.call(n,e.charAt(r),r,e)}function s(e,t,n){for(var r in e)c.call(e,r)&&t.call(n,e[r],r,e)}var a=e("is-function");t.exports=r;var u=Object.prototype.toString,c=Object.prototype.hasOwnProperty},{"is-function":46}],40:[function(e,t,n){t.exports=function(){if("undefined"==typeof window)return null;var e={RTCPeerConnection:window.RTCPeerConnection||window.mozRTCPeerConnection||window.webkitRTCPeerConnection,RTCSessionDescription:window.RTCSessionDescription||window.mozRTCSessionDescription||window.webkitRTCSessionDescription,RTCIceCandidate:window.RTCIceCandidate||window.mozRTCIceCandidate||window.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],41:[function(e,t,n){(function(n){var r="undefined"!=typeof n?n:"undefined"!=typeof window?window:{},i=e("min-document");if("undefined"!=typeof document)t.exports=document;else{var o=r["__GLOBAL_DOCUMENT_CACHE@4"];o||(o=r["__GLOBAL_DOCUMENT_CACHE@4"]=i),t.exports=o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"min-document":6}],42:[function(e,t,n){(function(e){"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],43:[function(e,t,n){var r=t.exports=function(e,t){if(t||(t=16),void 0===e&&(e=128),0>=e)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 u=Math.pow(t,o),a=Math.floor(Math.random()*u).toString(t);s=a+s}var c=parseInt(s,t);return c!==1/0&&c>=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}},{}],44:[function(e,t,n){(function(e){"use strict";function n(e,t){return e in r?r[e]:(r[e]=t,t)}var r="undefined"!=typeof window?window:"undefined"!=typeof e?e:{};t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(e,t,n){"use strict";function r(e,t,n){var r="__INDIVIDUAL_ONE_VERSION_"+e,o=r+"_ENFORCE_SINGLETON",s=i(o,t);if(s!==t)throw new Error("Can only have one copy of "+e+".\nYou already have version "+s+" installed.\nThis means you cannot install version "+t);return i(r,n)}var i=e("./index.js");t.exports=r},{"./index.js":44}],46:[function(e,t,n){function r(e){var t=i.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=r;var i=Object.prototype.toString},{}],47:[function(e,t,n){"use strict";t.exports=function(e){return"object"==typeof e&&null!==e}},{}],48:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],49:[function(e,t,n){function r(e,t,n){function r(e){if(p)throw s({diff:e._diff,stringDiff:JSON.stringify(e._diff)});null!==a||l||(l=!0,i(o)),a=e,g.state=e}function o(){if(l=!1,null!==a){p=!0;var e=t(a);if(n.createOnly)p=!1,u(e,n);else{var r=c(h,e,n);p=!1,d=f(d,r,n)}h=e,a=null}}n=n||{};var a=e,u=n.create,c=n.diff,f=n.patch,l=!1,h=n.initialTree||t(a),d=n.target||u(h,n),p=!1;a=null;var g={state:e,target:d,update:r};return g}var i=e("raf"),o=e("error/typed"),s=o({type:"main-loop.invalid.update.in-render",message:"main-loop: Unexpected update occurred in loop.\nWe are currently rendering a view, you can't change state right now.\nThe diff is: {stringDiff}.\nSUGGESTED FIX: find the state mutation in your view or rendering function and remove it.\nThe view should not have any side effects.\n",diff:null,stringDiff:null});t.exports=r},{"error/typed":50,raf:51}],50:[function(e,t,n){function r(e){function t(t){var r=new Error;Object.defineProperty(r,"type",{value:r.type,enumerable:!0,writable:!0,configurable:!0});var i=s({},e,t);return s(r,i),r.message=o(n,i),r}if(!e)throw new Error("args is required");if(!e.type)throw new Error("args.type is required");if(!e.message)throw new Error("args.message is required");var n=e.message;if(e.type&&!e.name){var r=i(e.type)+"Error";e.name=r[0].toUpperCase()+r.substr(1)}return s(t,e),t._name=e.name,t}var i=e("camelize"),o=e("string-template"),s=e("xtend/mutable");t.exports=r},{camelize:31,"string-template":77,"xtend/mutable":121}],51:[function(e,t,n){for(var r=e("performance-now"),i="undefined"==typeof window?{}:window,o=["moz","webkit"],s="AnimationFrame",a=i["request"+s],u=i["cancel"+s]||i["cancelRequest"+s],c=!0,f=0;f<o.length&&!a;f++)a=i[o[f]+"Request"+s],u=i[o[f]+"Cancel"+s]||i[o[f]+"CancelRequest"+s];if(!a||!u){c=!1;var l=0,h=0,d=[],p=1e3/60;a=function(e){if(0===d.length){var t=r(),n=Math.max(0,p-(t-l));l=n+t,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(l)}catch(n){setTimeout(function(){throw n},0)}},Math.round(n))}return d.push({handle:++h,callback:e,cancelled:!1}),h},u=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}t.exports=function(e){return c?a.call(i,function(){try{e.apply(this,arguments)}catch(t){setTimeout(function(){throw t},0)}}):a.call(i,e)},t.exports.cancel=function(){u.apply(i,arguments)}},{"performance-now":56}],52:[function(e,t,n){function r(e){if(e=""+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*l;case"days":case"day":case"d":return n*f;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;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}}}}function i(e){return e>=f?Math.round(e/f)+"d":e>=c?Math.round(e/c)+"h":e>=u?Math.round(e/u)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function o(e){return s(e,f,"day")||s(e,c,"hour")||s(e,u,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,n){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var a=1e3,u=60*a,c=60*u,f=24*c,l=365.25*f;t.exports=function(e,t){return t=t||{},"string"==typeof e?r(e):t["long"]?o(e):i(e)}},{}],53:[function(e,t,n){(function(n,r){function i(e,t){function i(e,t,n){n&&(n=new r(new Uint8Array(n))),s(e,t,n)}if("string"==typeof e&&(e={uri:e}),e.hasOwnProperty("encoding")||(e.encoding=null),n.browser&&!e.hasOwnProperty("json")&&null===e.encoding){e.responseType="arraybuffer";var s=t;t=i}return o(e,t)}var o=e("request");t.exports=i}).call(this,e("_process"),e("buffer").Buffer)},{_process:13,buffer:1,request:118}],54:[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}var i=e("wrappy");t.exports=i(r),r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0})})},{wrappy:116}],55:[function(e,t,n){var r=e("trim"),i=e("for-each"),o=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return i(r(e).split("\n"),function(e){var n=e.indexOf(":"),i=r(e.slice(0,n)).toLowerCase(),s=r(e.slice(n+1));"undefined"==typeof t[i]?t[i]=s:o(t[i])?t[i].push(s):t[i]=[t[i],s]}),t}},{"for-each":39,trim:86}],56:[function(e,t,n){(function(e){(function(){var n,r,i;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:"undefined"!=typeof e&&null!==e&&e.hrtime?(t.exports=function(){return(n()-i)/1e6},r=e.hrtime,n=function(){var e;return e=r(),1e9*e[0]+e[1]},i=n()):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(this)}).call(this,e("_process"))},{_process:13}],57:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{_process:13,dup:12}],58:[function(e,t,n){var r=e("once"),i=e("end-of-stream"),o=e("fs"),s=function(){},a=function(e){return"function"==typeof e},u=function(e){return(e instanceof(o.ReadStream||s)||e instanceof(o.WriteStream||s))&&a(e.close)},c=function(e){return e.setHeader&&a(e.abort)},f=function(e,t,n,o){o=r(o);var s=!1;e.on("close",function(){s=!0}),i(e,{readable:t,writable:n},function(e){return e?o(e):(s=!0,void o())});var f=!1;return function(t){return s||f?void 0:(f=!0,u(e)?e.close():c(e)?e.abort():a(e.destroy)?e.destroy():void o(t||new Error("stream was destroyed")))}},l=function(e){e()},h=function(e,t){return e.pipe(t)},d=function(){var e=Array.prototype.slice.call(arguments),t=a(e[e.length-1]||s)&&e.pop()||s;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var n,r=e.map(function(i,o){var s=o<e.length-1,a=o>0;return f(i,s,a,function(e){n||(n=e),e&&r.forEach(l),s||(r.forEach(l),t(n))})});return e.reduce(h)};t.exports=d},{"end-of-stream":36,fs:5,once:54}],59:[function(e,t,n){(function(e,n,r){"use strict";function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function o(t,i){if(t>65536)throw new Error("requested too many random bytes");var o=new n.Uint8Array(t);t>0&&s.getRandomValues(o);var a=new r(o.buffer);return"function"==typeof i?e.nextTick(function(){i(null,a)}):a}var s=n.crypto||n.msCrypto;s&&s.getRandomValues?t.exports=o:t.exports=i}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{_process:13,buffer:1}],60:[function(e,t,n){var r=e("event-source-stream"),i=e("nets"),o=e("pump"),s=e("through2"),a=function(){};t.exports=function(e,t){if(!e)throw new Error("app name required");if(!t||!t.length)throw new Error("signalhub url(s) required");var n={};Array.isArray(t)||(t=[t]),t=t.map(function(e){return e=e.replace(/\/$/,""),-1===e.indexOf("://")?"http://"+e:e}),n.subscribe=function(n){var i;i=Array.isArray(n)?n.join(","):n;var a=s.obj(),u=t.map(function(t){return r(t+"/v1/"+e+"/"+i,{json:!0})});if(1===u.length)return u[0];var a=s.obj();return a.setMaxListeners(0),u.forEach(function(e){e.on("open",function(){a.emit("open")}),o(e,a)}),a};var u=function(t,n,r,o){i({method:"POST",json:r,url:t+"/v1/"+e+"/"+n},function(e,t){return e?o(e):200!==t.statusCode?o(new Error("Bad status: "+t.statusCode)):void o()})};return n.broadcast=function(e,n,r){r||(r=a);var i=t.length,o=0;t.forEach(function(s){u(s,e,n,function(e){return e&&o++,--i?void 0:o===t.length?r(e):void r()})})},n}},{"event-source-stream":38,nets:53,pump:58,through2:67}],61:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],62:[function(e,t,n){(function(n){function r(e){return this instanceof r?(u.call(this,e),c.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;r>n;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 u=e("./_stream_readable"),c=e("./_stream_writable");a.inherits(r,u),o(s(c.prototype),function(e){r.prototype[e]||(r.prototype[e]=c.prototype[e])})}).call(this,e("_process"))},{"./_stream_readable":63,"./_stream_writable":65,_process:13,"core-util-is":32,inherits:61}],63:[function(e,t,n){(function(n){function r(t,n){t=t||{};var r=t.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(T||(T=e("string_decoder/").StringDecoder),this.decoder=new T(t.encoding),this.encoding=t.encoding)}function i(e){return this instanceof i?(this._readableState=new r(e,this),this.readable=!0,void R.call(this)):new i(e)}function o(e,t,n,r,i){var o=c(t,n);if(o)e.emit("error",o);else if(null===n||void 0===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)),t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(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>=C)e=C;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var n=null;return S.isBuffer(t)||"string"==typeof t||null===t||void 0===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,t.length>0?l(e):w(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?n.nextTick(function(){h(e)}):h(e))}function h(e){e.emit("readable")}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&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function g(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&v(e)}}function v(e){function t(e,t,i){var o=e.write(n);!1===o&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):_(r.pipes,t),e.emit("data",n),r.awaitDrain>0)return;return 0===r.pipesCount?(r.flowing=!1,void(k.listenerCount(e,"data")>0&&y(e))):void(r.ranOut=!0)}function m(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function y(e,t){var r=e._readableState;if(r.flowing)throw new Error("Cannot switch to old mode now.");var i=t||!1,o=!1;e.readable=!0,e.pipe=R.prototype.pipe,e.on=e.addListener=R.prototype.on,e.on("readable",function(){o=!0;for(var t;!i&&null!==(t=e.read());)e.emit("data",t);null===t&&(o=!1,e._readableState.needReadable=!0)}),e.pause=function(){i=!0,this.emit("pause")},e.resume=function(){i=!1,o?n.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function b(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 u=0,c=0,f=r.length;f>c&&e>u;c++){var a=r[0],l=Math.min(e-u,a.length);o?n+=a.slice(0,l):a.copy(n,u,0,l),l<a.length?r[0]=a.slice(l):r.shift(),u+=l}}return n}function w(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(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;r>n;n++)t(e[n],n)}function E(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}t.exports=i;var x=e("isarray"),S=e("buffer").Buffer;i.ReadableState=r;var k=e("events").EventEmitter;k.listenerCount||(k.listenerCount=function(e,t){return e.listeners(t).length});var R=e("stream"),j=e("core-util-is");j.inherits=e("inherits");var T;j.inherits(i,R),i.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof 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){T||(T=e("string_decoder/").StringDecoder),this._readableState.decoder=new T(t),this._readableState.encoding=t};var C=8388608;i.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n,r=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(e=u(e,t),0===e&&t.ended)return n=null,t.length>0&&t.decoder&&(n=b(e,t),t.length-=n.length),0===t.length&&w(this),n;var i=t.needReadable;return t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=u(r,t)),n=e>0?b(e,t):null,null===n&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&w(this),n},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function r(e){e===f&&o()}function i(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),f.removeListener("end",i),f.removeListener("end",o),(!e._writableState||e._writableState.needDrain)&&p()}function s(t){c(),e.removeListener("error",s),0===k.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){f.unpipe(e)}var f=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;var h=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,d=h?i:o;l.endEmitted?n.nextTick(d):f.once("end",d),e.on("unpipe",r);var p=g(f);return e.on("drain",p),e._events&&e._events.error?x(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",f),l.flowing||(this.on("readable",m),l.flowing=!0,n.nextTick(function(){v(f)})),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,this.removeListener("readable",m),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",m),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=E(t.pipes,e);return-1===i?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 n=R.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this,r):this.read(0))}return n},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){y(this,!0),this.emit("pause")},i.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(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.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){var o=r.push(i);o||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&"undefined"==typeof 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){n&&(n=!1,e.resume())},r},i._fromList=b}).call(this,e("_process"))},{_process:13,buffer:1,"core-util-is":32,events:8,inherits:61,isarray:48,stream:24,"string_decoder/":78}],64:[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,null!==n&&void 0!==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);var t=(this._transformState=new r(e,this),this);this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof 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._readableState,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"),u=e("core-util-is");u.inherits=e("inherits"),u.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;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":62,"core-util-is":32,inherits:61}],65:[function(e,t,n){(function(n){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function i(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){d(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],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 E.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(!w.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==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 u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new w(t,n)),t}function c(e,t,n,i,o){n=u(t,n,i),w.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.buffer.push(new r(n,i,o)):f(e,t,s,n,i,o),a}function f(e,t,n,r,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,i,t.onwrite),t.sync=!1}function l(e,t,r,i,o){r?n.nextTick(function(){o(i)}):o(i),e._writableState.errorEmitted=!0,e.emit("error",i)}function h(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(h(r),t)l(e,r,i,t,o);else{var s=m(e,r);s||r.bufferProcessing||!r.buffer.length||v(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),r(),n&&y(e,t)}function g(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function v(e,t){t.bufferProcessing=!0;for(var n=0;n<t.buffer.length;n++){var r=t.buffer[n],i=r.chunk,o=r.encoding,s=r.callback,a=t.objectMode?1:i.length;if(f(e,t,a,i,o,s),t.writing){n++;break}}t.bufferProcessing=!1,n<t.buffer.length?t.buffer=t.buffer.slice(n):t.buffer.length=0}function m(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function y(e,t){var n=m(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function b(e,t,r){t.ending=!0,y(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0}t.exports=o;var w=e("buffer").Buffer;o.WritableState=i;var _=e("core-util-is");_.inherits=e("inherits");var E=e("stream");_.inherits(o,E),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"function"==typeof t&&(n=t,t=null),w.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?s(this,r,n):a(this,r,e,n)&&(i=c(this,r,e,t,n)),i},o.prototype._write=function(e,t,n){n(new Error("not implemented"))},o.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),"undefined"!=typeof e&&null!==e&&this.write(e,t),r.ending||r.finished||b(this,r,n)}}).call(this,e("_process"))},{"./_stream_duplex":62,_process:13,buffer:1,"core-util-is":32,inherits:61,stream:24}],66:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{"./lib/_stream_transform.js":64,dup:22}],67:[function(e,t,n){(function(n){function r(e){s.call(this,e),this._destroyed=!1}function i(e,t,n){n(null,e)}function o(e){return function(t,n,r){return"function"==typeof t&&(r=n,n=t,t={}),"function"!=typeof n&&(n=i),"function"!=typeof r&&(r=null),e(t,n,r)}}var s=e("readable-stream/transform"),a=e("util").inherits,u=e("xtend");a(r,s),r.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;n.nextTick(function(){e&&t.emit("error",e),t.emit("close")})}},t.exports=o(function(e,t,n){var i=new r(e);return i._transform=t,n&&(i._flush=n),i}),t.exports.ctor=o(function(e,t,n){function i(t){return this instanceof i?(this.options=u(e,t),void r.call(this,this.options)):new i(t)}return a(i,r),i.prototype._transform=t,n&&(i.prototype._flush=n),i}),t.exports.obj=o(function(e,t,n){var i=new r(u({objectMode:!0,highWaterMark:16},e));return i._transform=t,n&&(i._flush=n),i})}).call(this,e("_process"))},{_process:13,"readable-stream/transform":66,util:28,xtend:120}],68:[function(e,t,n){(function(n){function r(e){var t=this;if(!(t instanceof r))return new r(e);if(t._debug("new peer %o",e),e||(e={}),e.allowHalfOpen=!1,null==e.highWaterMark&&(e.highWaterMark=1048576),f.Duplex.call(t,e),t.initiator=e.initiator||!1,t.channelConfig=e.channelConfig||r.channelConfig,t.channelName=e.initiator?e.channelName||a(160):null,t.config=e.config||r.config,t.constraints=e.constraints||r.constraints,t.offerConstraints=e.offerConstraints,t.answerConstraints=e.answerConstraints,t.reconnectTimer=e.reconnectTimer||!1,t.sdpTransform=e.sdpTransform||function(e){return e},t.stream=e.stream||!1,t.trickle=void 0!==e.trickle?e.trickle:!0,t.destroyed=!1,t.connected=!1,t.remoteAddress=void 0,t.remoteFamily=void 0,t.remotePort=void 0,t.localAddress=void 0,t.localPort=void 0,t._isWrtc=!!e.wrtc,t._wrtc=e.wrtc||s(),!t._wrtc)throw"undefined"==typeof window?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser");t._maxBufferedAmount=e.highWaterMark,t._pcReady=!1,t._channelReady=!1,t._iceComplete=!1,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=t._onIceConnectionStateChange.bind(t),t._pc.onsignalingstatechange=t._onSignalingStateChange.bind(t),t._pc.onicecandidate=t._onIceCandidate.bind(t),t.stream&&t._pc.addStream(t.stream),t._pc.onaddstream=t._onAddStream.bind(t),t.initiator?(t._setupData({channel:t._pc.createDataChannel(t.channelName,t.channelConfig)}),t._pc.onnegotiationneeded=c(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(){}t.exports=r;var o=e("debug")("simple-peer"),s=e("get-browser-rtc"),a=e("hat"),u=e("inherits"),c=e("once"),f=e("readable-stream");u(r,f.Duplex),r.WEBRTC_SUPPORT=!!s(),r.config={iceServers:[{url:"stun:23.21.150.121",urls:"stun:23.21.150.121"}]},r.constraints={},r.channelConfig={},Object.defineProperty(r.prototype,"bufferSize",{get:function(){var e=this;return e._channel&&e._channel.bufferedAmount||0}}),r.prototype.address=function(){var e=this;return{port:e.localPort,family:"IPv4",address:e.localAddress}},r.prototype.signal=function(e){function t(e){try{n._pc.addIceCandidate(new n._wrtc.RTCIceCandidate(e),i,n._onError.bind(n))}catch(t){n._destroy(new Error("error adding candidate: "+t.message))}}var n=this;if(n.destroyed)throw new Error("cannot signal after peer is destroyed");if("string"==typeof e)try{e=JSON.parse(e)}catch(r){e={}}n._debug("signal()"),e.sdp&&n._pc.setRemoteDescription(new n._wrtc.RTCSessionDescription(e),function(){n.destroyed||("offer"===n._pc.remoteDescription.type&&n._createAnswer(),n._pendingCandidates.forEach(t),n._pendingCandidates=[])},n._onError.bind(n)),e.candidate&&(n._pc.remoteDescription?t(e.candidate):n._pendingCandidates.push(e.candidate)),e.sdp||e.candidate||n._destroy(new Error("signal() called with invalid signal data"))},r.prototype.send=function(e){var t=this;n.isBuffer(e)&&t._isWrtc&&(e=new Uint8Array(e));var r=e.length||e.byteLength||e.size;t._channel.send(e),t._debug("write: %d bytes",r)},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.readable=n.writable=!1,n._readableState.ended||n.push(null),n._writableState.finished||n.end(),n.destroyed=!0,n.connected=!1,n._pcReady=!1,n._channelReady=!1,n._chunk=null,n._cb=null,clearInterval(n._interval),clearTimeout(n._reconnectTimeout),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,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._read=function(){},r.prototype._write=function(e,t,n){var r=this;if(r.destroyed)return n(new Error("cannot write after peer is destroyed"));if(r.connected){try{r.send(e)}catch(i){return r._onError(i)}r._channel.bufferedAmount>r._maxBufferedAmount?(r._debug("start backpressure: bufferedAmount %d",r._channel.bufferedAmount),r._cb=n):n(null)}else r._debug("write before connect"),r._chunk=e,r._cb=n},r.prototype._createOffer=function(){var e=this;e.destroyed||e._pc.createOffer(function(t){if(!e.destroyed){t.sdp=e.sdpTransform(t.sdp),e._pc.setLocalDescription(t,i,e._onError.bind(e));var n=function(){var n=e._pc.localDescription||t;e._debug("signal"),e.emit("signal",{type:n.type,sdp:n.sdp})};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){t.sdp=e.sdpTransform(t.sdp),e._pc.setLocalDescription(t,i,e._onError.bind(e));var n=function(){var n=e._pc.localDescription||t;e._debug("signal"),e.emit("signal",{type:n.type,sdp:n.sdp})};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._debug("iceConnectionStateChange %s %s",t,n),e.emit("iceConnectionStateChange",t,n),("connected"===n||"completed"===n)&&(clearTimeout(e._reconnectTimeout),e._pcReady=!0,e._maybeReady()),"disconnected"===n&&(e.reconnectTimer?(clearTimeout(e._reconnectTimeout),e._reconnectTimeout=setTimeout(function(){e._destroy()},e.reconnectTimer)):e._destroy()),"failed"===n&&e._destroy(),"closed"===n&&e._destroy()}},r.prototype.getStats=function(e){var t=this;t._pc.getStats?"undefined"!=typeof window&&window.mozRTCPeerConnection?t._pc.getStats(null,function(t){var n=[];t.forEach(function(e){n.push(e)}),e(n)},t._onError.bind(t)):t._pc.getStats(function(t){var n=[];t.result().forEach(function(e){var t={};e.names().forEach(function(n){t[n]=e.stat(n)}),t.id=e.id,t.type=e.type,t.timestamp=e.timestamp,n.push(t)}),e(n)}):e([])},r.prototype._maybeReady=function(){var e=this;e._debug("maybeReady pc %s channel %s",e._pcReady,e._channelReady),!e.connected&&!e._connecting&&e._pcReady&&e._channelReady&&(e._connecting=!0,e.getStats(function(t){function n(t){var n=i[t.localCandidateId],o=r[t.remoteCandidateId];n?(e.localAddress=n.ipAddress,e.localPort=Number(n.portNumber)):"string"==typeof t.googLocalAddress&&(n=t.googLocalAddress.split(":"),e.localAddress=n[0],e.localPort=Number(n[1])),e._debug("connect local: %s:%s",e.localAddress,e.localPort),o?(e.remoteAddress=o.ipAddress,e.remotePort=Number(o.portNumber),e.remoteFamily="IPv4"):"string"==typeof t.googRemoteAddress&&(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)}e._connecting=!1,e.connected=!0;var r={},i={};if(t.forEach(function(e){"remotecandidate"===e.type&&(r[e.id]=e),"localcandidate"===e.type&&(i[e.id]=e)}),t.forEach(function(e){var t="googCandidatePair"===e.type&&"true"===e.googActiveConnection||"candidatepair"===e.type&&e.selected;t&&n(e)}),e._chunk){try{e.send(e._chunk)}catch(o){return e._onError(o)}e._chunk=null,e._debug('sent chunk from "write before connect"');var s=e._cb;e._cb=null,s(null)}e._interval=setInterval(function(){if(e._cb&&e._channel&&!(e._channel.bufferedAmount>e._maxBufferedAmount)){e._debug("ending backpressure: bufferedAmount %d",e._channel.bufferedAmount);var t=e._cb;e._cb=null,t(null)}},150),e._interval.unref&&e._interval.unref(),e._debug("connect"),e.emit("connect")}))},r.prototype._onSignalingStateChange=function(){var e=this;e.destroyed||(e._debug("signalingStateChange %s",e._pc.signalingState),e.emit("signalingStateChange",e._pc.signalingState))},r.prototype._onIceCandidate=function(e){var t=this;t.destroyed||(e.candidate&&t.trickle?t.emit("signal",{candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||(t._iceComplete=!0,t.emit("_iceComplete")))},r.prototype._onChannelMessage=function(e){var t=this;if(!t.destroyed){var r=e.data;t._debug("read: %d bytes",r.byteLength||r.length),r instanceof ArrayBuffer&&(r=new n(r)),t.push(r)}},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],o.apply(null,t)}}).call(this,e("buffer").Buffer)},{buffer:1,debug:34,"get-browser-rtc":40,hat:43,inherits:69,once:54,"readable-stream":75}],69:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],70:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{"./_stream_readable":72,"./_stream_writable":74,"core-util-is":32,dup:15,inherits:69,"process-nextick-args":57}],71:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{"./_stream_transform":73,"core-util-is":32,dup:16,inherits:69}],72:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_duplex":70,_process:13,buffer:1,"core-util-is":32,dup:17,events:8,inherits:69,isarray:48,"process-nextick-args":57,"string_decoder/":78,util:6}],73:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"./_stream_duplex":70,"core-util-is":32,dup:18,inherits:69}],74:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"./_stream_duplex":70,buffer:1,"core-util-is":32,dup:19,events:8,inherits:69,"process-nextick-args":57,"util-deprecate":87}],75:[function(e,t,n){arguments[4][21][0].apply(n,arguments)},{"./lib/_stream_duplex.js":70,"./lib/_stream_passthrough.js":71,"./lib/_stream_readable.js":72,"./lib/_stream_transform.js":73,"./lib/_stream_writable.js":74,dup:21}],76:[function(e,t,n){"use strict";function r(e,t,n){this._last+=this._decoder.write(e);var r=this._last.split(this.matcher);this._last=r.pop();for(var i=0;i<r.length;i++)o(this,this.mapper(r[i]));n()}function i(e){this._last+=this._decoder.end(),this._last&&o(this,this.mapper(this._last)),e()}function o(e,t){void 0!==t&&e.push(t)}function s(e){return e}function a(e,t,n){switch(e=e||/\r?\n/,t=t||s,n=n||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||(n=e,e=/\r?\n/);break;case 2:"function"==typeof e?(n=t,t=e,e=/\r?\n/):"object"==typeof t&&(n=t,t=s)}var o=u(n,r,i);return o._readableState.objectMode=!0,o._last="",o._decoder=new c("utf8"),o.matcher=e,o.mapper=t,o}var u=e("through2"),c=e("string_decoder").StringDecoder;t.exports=a},{string_decoder:25,through2:85}],77:[function(e,t,n){function r(e){var t;return t=2===arguments.length&&"object"==typeof arguments[1]?arguments[1]:o.call(arguments,1),t&&t.hasOwnProperty||(t={}),e.replace(i,function(n,r,i){var o;return"{"===e[i-1]&&"}"===e[i+n.length]?r:(o=t.hasOwnProperty(r)?t[r]:null,null===o||void 0===o?"":o)})}var i=/\{([0-9a-zA-Z]+)\}/g,o=Array.prototype.slice;t.exports=r},{}],78:[function(e,t,n){arguments[4][25][0].apply(n,arguments)},{buffer:1,dup:25}],79:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],80:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{"./_stream_readable":81,"./_stream_writable":83,"core-util-is":32,dup:15,inherits:79,"process-nextick-args":57}],81:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_duplex":80,_process:13,buffer:1,"core-util-is":32,dup:17,events:8,inherits:79,isarray:48,"process-nextick-args":57,"string_decoder/":78,util:6}],82:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"./_stream_duplex":80,"core-util-is":32,dup:18,inherits:79}],83:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"./_stream_duplex":80,buffer:1,"core-util-is":32,dup:19,events:8,inherits:79,"process-nextick-args":57,"util-deprecate":87}],84:[function(e,t,n){arguments[4][22][0].apply(n,arguments)},{"./lib/_stream_transform.js":82,dup:22}],85:[function(e,t,n){arguments[4][67][0].apply(n,arguments)},{_process:13,dup:67,"readable-stream/transform":84,util:28,xtend:120}],86:[function(e,t,n){function r(e){return e.replace(/^\s*|\s*$/g,"")}n=t.exports=r,n.left=function(e){return e.replace(/^\s*/,"")},n.right=function(e){return e.replace(/\s*$/,"")}},{}],87:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{dup:26}],88:[function(e,t,n){var r=e("./vdom/create-element.js");t.exports=r},{"./vdom/create-element.js":94}],89:[function(e,t,n){var r=e("./vtree/diff.js");t.exports=r},{"./vtree/diff.js":114}],90:[function(e,t,n){var r=e("./virtual-hyperscript/index.js");t.exports=r},{"./virtual-hyperscript/index.js":101}],91:[function(e,t,n){var r=e("./diff.js"),i=e("./patch.js"),o=e("./h.js"),s=e("./create-element.js"),a=e("./vnode/vnode.js"),u=e("./vnode/vtext.js");t.exports={diff:r,patch:i,h:o,create:s,VNode:a,VText:u}},{"./create-element.js":88,"./diff.js":89,"./h.js":90,"./patch.js":92,"./vnode/vnode.js":110,"./vnode/vtext.js":112}],92:[function(e,t,n){var r=e("./vdom/patch.js");t.exports=r},{"./vdom/patch.js":97}],93:[function(e,t,n){function r(e,t,n){for(var r in t){var s=t[r];void 0===s?i(e,r,s,n):u(s)?(i(e,r,s,n),s.hook&&s.hook(e,r,n?n[r]:void 0)):a(s)?o(e,t,n,r,s):e[r]=s}}function i(e,t,n,r){if(r){var i=r[t];if(u(i))i.unhook&&i.unhook(e,t,n);else if("attributes"===t)for(var o in i)e.removeAttribute(o);else if("style"===t)for(var s in i)e.style[s]="";else"string"==typeof i?e[t]="":e[t]=null}}function o(e,t,n,r,i){var o=n?n[r]:void 0;if("attributes"!==r){if(o&&a(o)&&s(o)!==s(i))return void(e[r]=i);a(e[r])||(e[r]={});var u="style"===r?"":void 0;for(var c in i){var f=i[c];e[r][c]=void 0===f?u:f}}else for(var l in i){var h=i[l];void 0===h?e.removeAttribute(l):e.setAttribute(l,h)}}function s(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__?e.__proto__:e.constructor?e.constructor.prototype:void 0}var a=e("is-object"),u=e("../vnode/is-vhook.js");t.exports=r},{"../vnode/is-vhook.js":105,"is-object":47}],94:[function(e,t,n){function r(e,t){var n=t?t.document||i:i,f=t?t.warn:null;if(e=c(e).a,u(e))return e.init();if(a(e))return n.createTextNode(e.text);if(!s(e))return f&&f("Item is not a valid virtual dom node",e),null;var l=null===e.namespace?n.createElement(e.tagName):n.createElementNS(e.namespace,e.tagName),h=e.properties;o(l,h);for(var d=e.children,p=0;p<d.length;p++){var g=r(d[p],t);g&&l.appendChild(g)}return l}var i=e("global/document"),o=e("./apply-properties"),s=e("../vnode/is-vnode.js"),a=e("../vnode/is-vtext.js"),u=e("../vnode/is-widget.js"),c=e("../vnode/handle-thunk.js");t.exports=r},{"../vnode/handle-thunk.js":103,"../vnode/is-vnode.js":106,"../vnode/is-vtext.js":107,"../vnode/is-widget.js":108,"./apply-properties":93,"global/document":41}],95:[function(e,t,n){function r(e,t,n,r){return n&&0!==n.length?(n.sort(s),i(e,t,n,r,0)):{}}function i(e,t,n,r,s){if(r=r||{},e){o(n,s,s)&&(r[s]=e);var u=t.children;if(u)for(var c=e.childNodes,f=0;f<t.children.length;f++){s+=1;var l=u[f]||a,h=s+(l.count||0);o(n,s,h)&&i(c[f],l,n,r,s),s=h}}return r}function o(e,t,n){if(0===e.length)return!1;for(var r,i,o=0,s=e.length-1;s>=o;){if(r=(s+o)/2>>0,i=e[r],o===s)return i>=t&&n>=i;if(t>i)o=r+1;else{if(!(i>n))return!0;s=r-1}}return!1}function s(e,t){return e>t?1:-1}var a={};t.exports=r},{}],96:[function(e,t,n){function r(e,t,n){var r=e.type,c=e.vNode,d=e.patch;switch(r){case p.REMOVE:return i(t,c);case p.INSERT:return o(t,d,n);case p.VTEXT:return s(t,c,d,n);case p.WIDGET:return a(t,c,d,n);case p.VNODE:return u(t,c,d,n);case p.ORDER:return f(t,d),t;case p.PROPS:return h(t,d,c.properties),t;case p.THUNK:return l(t,n.patch(t,d,n));default:return t}}function i(e,t){var n=e.parentNode;return n&&n.removeChild(e),c(e,t),null}function o(e,t,n){var r=n.render(t,n);return e&&e.appendChild(r),e}function s(e,t,n,r){var i;if(3===e.nodeType)e.replaceData(0,e.length,n.text),i=e;else{var o=e.parentNode;i=r.render(n,r),o&&i!==e&&o.replaceChild(i,e)}return i}function a(e,t,n,r){var i,o=g(t,n);i=o?n.update(t,e)||e:r.render(n,r);var s=e.parentNode;return s&&i!==e&&s.replaceChild(i,e),o||c(e,t),i}function u(e,t,n,r){var i=e.parentNode,o=r.render(n,r);return i&&o!==e&&i.replaceChild(o,e),o}function c(e,t){"function"==typeof t.destroy&&d(t)&&t.destroy(e)}function f(e,t){for(var n,r,i,o=e.childNodes,s={},a=0;a<t.removes.length;a++)r=t.removes[a],n=o[r.from],r.key&&(s[r.key]=n),e.removeChild(n);for(var u=o.length,c=0;c<t.inserts.length;c++)i=t.inserts[c],n=s[i.key],e.insertBefore(n,i.to>=u++?null:o[i.to])}function l(e,t){return e&&t&&e!==t&&e.parentNode&&e.parentNode.replaceChild(t,e),t}var h=e("./apply-properties"),d=e("../vnode/is-widget.js"),p=e("../vnode/vpatch.js"),g=e("./update-widget");t.exports=r},{"../vnode/is-widget.js":108,"../vnode/vpatch.js":111,"./apply-properties":93,"./update-widget":98}],97:[function(e,t,n){function r(e,t,n){return n=n||{},n.patch=n.patch&&n.patch!==r?n.patch:i,n.render=n.render||c,n.patch(e,t,n)}function i(e,t,n){var r=s(t);if(0===r.length)return e;var i=f(e,t.a,r),u=e.ownerDocument;n.document||u===a||(n.document=u);for(var c=0;c<r.length;c++){var l=r[c];e=o(e,i[l],t[l],n)}return e}function o(e,t,n,r){if(!t)return e;var i;if(u(n))for(var o=0;o<n.length;o++)i=l(n[o],t,r),t===e&&(e=i);else i=l(n,t,r),t===e&&(e=i);return e}function s(e){var t=[];for(var n in e)"a"!==n&&t.push(Number(n));return t}var a=e("global/document"),u=e("x-is-array"),c=e("./create-element"),f=e("./dom-index"),l=e("./patch-op");t.exports=r},{"./create-element":94,"./dom-index":95,"./patch-op":96,"global/document":41,"x-is-array":117}],98:[function(e,t,n){function r(e,t){return i(e)&&i(t)?"name"in e&&"name"in t?e.id===t.id:e.init===t.init:!1}var i=e("../vnode/is-widget.js");t.exports=r},{"../vnode/is-widget.js":108}],99:[function(e,t,n){"use strict";function r(e){return this instanceof r?void(this.value=e):new r(e)}var i=e("ev-store");t.exports=r,r.prototype.hook=function(e,t){var n=i(e),r=t.substr(3);n[r]=this.value},r.prototype.unhook=function(e,t){var n=i(e),r=t.substr(3);n[r]=void 0}},{"ev-store":37}],100:[function(e,t,n){"use strict";function r(e){return this instanceof r?void(this.value=e):new r(e)}t.exports=r,r.prototype.hook=function(e,t){e[t]!==this.value&&(e[t]=this.value)}},{}],101:[function(e,t,n){"use strict";function r(e,t,n){var r,s,u,c,f=[];return!n&&a(t)&&(n=t,s={}),s=s||t||{},r=y(e,s),s.hasOwnProperty("key")&&(u=s.key,s.key=void 0),s.hasOwnProperty("namespace")&&(c=s.namespace,s.namespace=void 0),"INPUT"!==r||c||!s.hasOwnProperty("value")||void 0===s.value||v(s.value)||(s.value=b(s.value)),o(s),void 0!==n&&null!==n&&i(n,f,r,s),new l(r,s,f,u,c)}function i(e,t,n,r){if("string"==typeof e)t.push(new h(e));else if("number"==typeof e)t.push(new h(String(e)));else if(s(e))t.push(e);else{if(!f(e)){if(null===e||void 0===e)return;throw u({foreignObject:e,parentVnode:{tagName:n,properties:r}})}for(var o=0;o<e.length;o++)i(e[o],t,n,r)}}function o(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];if(v(n))continue;"ev-"===t.substr(0,3)&&(e[t]=w(n))}}function s(e){return d(e)||p(e)||g(e)||m(e)}function a(e){return"string"==typeof e||f(e)||s(e)}function u(e){var t=new Error;return t.type="virtual-hyperscript.unexpected.virtual-element",t.message="Unexpected virtual child passed to h().\nExpected a VNode / Vthunk / VWidget / string but:\ngot:\n"+c(e.foreignObject)+".\nThe parent vnode is:\n"+c(e.parentVnode),t.foreignObject=e.foreignObject,t.parentVnode=e.parentVnode,t}function c(e){try{return JSON.stringify(e,null," ")}catch(t){return String(e)}}var f=e("x-is-array"),l=e("../vnode/vnode.js"),h=e("../vnode/vtext.js"),d=e("../vnode/is-vnode"),p=e("../vnode/is-vtext"),g=e("../vnode/is-widget"),v=e("../vnode/is-vhook"),m=e("../vnode/is-thunk"),y=e("./parse-tag.js"),b=e("./hooks/soft-set-hook.js"),w=e("./hooks/ev-hook.js");t.exports=r},{"../vnode/is-thunk":104,"../vnode/is-vhook":105,"../vnode/is-vnode":106,"../vnode/is-vtext":107,"../vnode/is-widget":108,"../vnode/vnode.js":110,"../vnode/vtext.js":112,"./hooks/ev-hook.js":99,"./hooks/soft-set-hook.js":100,"./parse-tag.js":102,"x-is-array":117}],102:[function(e,t,n){"use strict";function r(e,t){if(!e)return"DIV";var n=!t.hasOwnProperty("id"),r=i(e,o),a=null;s.test(r[1])&&(a="DIV");var u,c,f,l;for(l=0;l<r.length;l++)c=r[l],c&&(f=c.charAt(0),a?"."===f?(u=u||[],u.push(c.substring(1,c.length))):"#"===f&&n&&(t.id=c.substring(1,c.length)):a=c);return u&&(t.className&&u.push(t.className),t.className=u.join(" ")),t.namespace?a:a.toUpperCase()}var i=e("browser-split"),o=/([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/,s=/^\.|#/;t.exports=r},{"browser-split":30}],103:[function(e,t,n){function r(e,t){var n=e,r=t;return u(t)&&(r=i(t,e)),u(e)&&(n=i(e,null)),{a:n,b:r}}function i(e,t){var n=e.vnode;if(n||(n=e.vnode=e.render(t)),!(o(n)||s(n)||a(n)))throw new Error("thunk did not return a valid node");return n}var o=e("./is-vnode"),s=e("./is-vtext"),a=e("./is-widget"),u=e("./is-thunk");t.exports=r},{"./is-thunk":104,"./is-vnode":106,"./is-vtext":107,"./is-widget":108}],104:[function(e,t,n){function r(e){return e&&"Thunk"===e.type}t.exports=r},{}],105:[function(e,t,n){function r(e){return e&&("function"==typeof e.hook&&!e.hasOwnProperty("hook")||"function"==typeof e.unhook&&!e.hasOwnProperty("unhook"))}t.exports=r},{}],106:[function(e,t,n){function r(e){return e&&"VirtualNode"===e.type&&e.version===i}var i=e("./version");t.exports=r},{"./version":109}],107:[function(e,t,n){function r(e){return e&&"VirtualText"===e.type&&e.version===i}var i=e("./version");t.exports=r},{"./version":109}],108:[function(e,t,n){function r(e){return e&&"Widget"===e.type}t.exports=r},{}],109:[function(e,t,n){t.exports="2"},{}],110:[function(e,t,n){function r(e,t,n,r,i){this.tagName=e,this.properties=t||c,this.children=n||f,this.key=null!=r?String(r):void 0,this.namespace="string"==typeof i?i:null;var l,h=n&&n.length||0,d=0,p=!1,g=!1,v=!1;for(var m in t)if(t.hasOwnProperty(m)){var y=t[m];u(y)&&y.unhook&&(l||(l={}),l[m]=y)}for(var b=0;h>b;b++){var w=n[b];o(w)?(d+=w.count||0,!p&&w.hasWidgets&&(p=!0),!g&&w.hasThunks&&(g=!0),v||!w.hooks&&!w.descendantHooks||(v=!0)):!p&&s(w)?"function"==typeof w.destroy&&(p=!0):!g&&a(w)&&(g=!0)}this.count=h+d,this.hasWidgets=p,this.hasThunks=g,this.hooks=l,this.descendantHooks=v}var i=e("./version"),o=e("./is-vnode"),s=e("./is-widget"),a=e("./is-thunk"),u=e("./is-vhook");t.exports=r;var c={},f=[];r.prototype.version=i,r.prototype.type="VirtualNode"},{"./is-thunk":104,"./is-vhook":105,"./is-vnode":106,"./is-widget":108,"./version":109}],111:[function(e,t,n){function r(e,t,n){this.type=Number(e),this.vNode=t,this.patch=n}var i=e("./version");r.NONE=0,r.VTEXT=1,r.VNODE=2,r.WIDGET=3,r.PROPS=4,r.ORDER=5,r.INSERT=6,r.REMOVE=7,r.THUNK=8,t.exports=r,r.prototype.version=i,r.prototype.type="VirtualPatch"},{"./version":109}],112:[function(e,t,n){function r(e){this.text=String(e)}var i=e("./version");t.exports=r,r.prototype.version=i,r.prototype.type="VirtualText"},{"./version":109}],113:[function(e,t,n){function r(e,t){var n;for(var a in e){a in t||(n=n||{},n[a]=void 0);var u=e[a],c=t[a];if(u!==c)if(o(u)&&o(c))if(i(c)!==i(u))n=n||{},n[a]=c;else if(s(c))n=n||{},n[a]=c;else{var f=r(u,c);f&&(n=n||{},n[a]=f)}else n=n||{},n[a]=c}for(var l in t)l in e||(n=n||{},n[l]=t[l]);return n}function i(e){return Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__?e.__proto__:e.constructor?e.constructor.prototype:void 0}var o=e("is-object"),s=e("../vnode/is-vhook");t.exports=r},{"../vnode/is-vhook":105,"is-object":47}],114:[function(e,t,n){function r(e,t){var n={a:e};return i(e,t,n,0),n}function i(e,t,n,r){if(e!==t){var i=n[r],a=!1;if(_(e)||_(t))u(e,t,n,r);else if(null==t)w(e)||(s(e,n,r),i=n[r]),i=g(i,new m(m.REMOVE,e,t));else if(y(t))if(y(e))if(e.tagName===t.tagName&&e.namespace===t.namespace&&e.key===t.key){var c=x(e.properties,t.properties);c&&(i=g(i,new m(m.PROPS,e,c))),i=o(e,t,n,i,r)}else i=g(i,new m(m.VNODE,e,t)),a=!0;else i=g(i,new m(m.VNODE,e,t)),a=!0;else b(t)?b(e)?e.text!==t.text&&(i=g(i,new m(m.VTEXT,e,t))):(i=g(i,new m(m.VTEXT,e,t)),a=!0):w(t)&&(w(e)||(a=!0),i=g(i,new m(m.WIDGET,e,t)));i&&(n[r]=i),a&&s(e,n,r)}}function o(e,t,n,r,o){for(var s=e.children,a=h(s,t.children),u=a.children,c=s.length,f=u.length,l=c>f?c:f,d=0;l>d;d++){var p=s[d],v=u[d];o+=1,p?i(p,v,n,o):v&&(r=g(r,new m(m.INSERT,null,v))),y(p)&&p.count&&(o+=p.count)}return a.moves&&(r=g(r,new m(m.ORDER,e,a.moves))),r}function s(e,t,n){f(e,t,n),a(e,t,n)}function a(e,t,n){if(w(e))"function"==typeof e.destroy&&(t[n]=g(t[n],new m(m.REMOVE,e,null)));else if(y(e)&&(e.hasWidgets||e.hasThunks))for(var r=e.children,i=r.length,o=0;i>o;o++){var s=r[o];n+=1,a(s,t,n),y(s)&&s.count&&(n+=s.count)}else _(e)&&u(e,null,t,n)}function u(e,t,n,i){var o=E(e,t),s=r(o.a,o.b);c(s)&&(n[i]=new m(m.THUNK,null,s))}function c(e){for(var t in e)if("a"!==t)return!0;return!1}function f(e,t,n){if(y(e)){if(e.hooks&&(t[n]=g(t[n],new m(m.PROPS,e,l(e.hooks)))),e.descendantHooks||e.hasThunks)for(var r=e.children,i=r.length,o=0;i>o;o++){var s=r[o];n+=1,f(s,t,n),y(s)&&s.count&&(n+=s.count)}}else _(e)&&u(e,null,t,n)}function l(e){var t={};for(var n in e)t[n]=void 0;return t}function h(e,t){var n=p(t),r=n.keys,i=n.free;if(i.length===t.length)return{children:t,moves:null};var o=p(e),s=o.keys,a=o.free;if(a.length===e.length)return{children:t,moves:null};for(var u=[],c=0,f=i.length,l=0,h=0;h<e.length;h++){var g,v=e[h];v.key?r.hasOwnProperty(v.key)?(g=r[v.key],u.push(t[g])):(g=h-l++,u.push(null)):f>c?(g=i[c++],u.push(t[g])):(g=h-l++,u.push(null))}for(var m=c>=i.length?t.length:i[c],y=0;y<t.length;y++){var b=t[y];b.key?s.hasOwnProperty(b.key)||u.push(b):y>=m&&u.push(b)}for(var w,_=u.slice(),E=0,x=[],S=[],k=0;k<t.length;){var R=t[k];for(w=_[E];null===w&&_.length;)x.push(d(_,E,null)),w=_[E];w&&w.key===R.key?(E++,k++):R.key?(w&&w.key&&r[w.key]!==k+1?(x.push(d(_,E,w.key)),w=_[E],w&&w.key===R.key?E++:S.push({key:R.key,to:k})):S.push({key:R.key,to:k}),k++):w&&w.key&&x.push(d(_,E,w.key))}for(;E<_.length;)w=_[E],x.push(d(_,E,w&&w.key));return x.length!==l||S.length?{children:u,moves:{removes:x,inserts:S}}:{children:u,moves:null}}function d(e,t,n){return e.splice(t,1),{from:t,key:n}}function p(e){for(var t={},n=[],r=e.length,i=0;r>i;i++){var o=e[i];o.key?t[o.key]=i:n.push(i)}return{keys:t,free:n}}function g(e,t){return e?(v(e)?e.push(t):e=[e,t],e):t}var v=e("x-is-array"),m=e("../vnode/vpatch"),y=e("../vnode/is-vnode"),b=e("../vnode/is-vtext"),w=e("../vnode/is-widget"),_=e("../vnode/is-thunk"),E=e("../vnode/handle-thunk"),x=e("./diff-props");t.exports=r},{"../vnode/handle-thunk":103,"../vnode/is-thunk":104,"../vnode/is-vnode":106,"../vnode/is-vtext":107,"../vnode/is-widget":108,"../vnode/vpatch":111,"./diff-props":113,"x-is-array":117}],115:[function(e,t,n){var r=e("simple-peer"),i=e("events"),o=e("through2"),s=e("cuid"),a=e("once"),u=e("debug")("webrtc-swarm");t.exports=function(e,t){t||(t={});var n=t.wrap||function(e){return e},c=t.unwrap||function(e){return e},f=new i.EventEmitter,l={},h=t.uuid||s();u("my uuid:",h),f.maxPeers=t.maxPeers||1/0,f.peers=[];var d=function(t,r){t.on("connect",function(){u("connected to peer",r),f.peers.push(t),f.emit("peer",t,r),f.emit("connect",t,r)});var i=a(function(e){u("disconnected from peer",r,e),l[r]===t&&delete l[r];var n=f.peers.indexOf(t);n>-1&&f.peers.splice(n,1),f.emit("disconnect",t,r)}),o=[],s=!1,c=function(){if(!s&&o.length){s=!0;var t={from:h,signal:o.shift()};t=n(t,r),e.broadcast(r,t,function(){s=!1,c()})}};t.on("signal",function(e){o.push(e),c()}),t.on("error",i),t.once("close",i)};e.subscribe("all").pipe(o.obj(function(e,n,i){if(e=c(e,"all"),!e)return i();if(u("/all",e),e.from===h)return u("skipping self",e.from),i();if("connect"===e.type){if(f.peers.length>=f.maxPeers)return u("skipping because maxPeers is met",e.from),i();if(l[e.from])return u("skipping existing remote",e.from),i();u("connecting to new peer (as initiator)",e.from);var o=new r({wrtc:t.wrtc,initiator:!0,config:t.config});d(o,e.from),l[e.from]=o}i()}));var p=function(){if(!(f.peers.length>=f.maxPeers)){var t={type:"connect",from:h};t=n(t,"all"),e.broadcast("all",t,function(){setTimeout(p,Math.floor(2e3*Math.random())+(f.peers.length?13e3:3e3))})}};return e.subscribe(h).once("open",p).pipe(o.obj(function(e,n,i){if(e=c(e,h),!e)return i();var o=l[e.from];if(!o){if(!e.signal||"offer"!==e.signal.type)return u("skipping non-offer",e),i();u("connecting to new peer (as not initiator)",e.from),o=l[e.from]=new r({wrtc:t.wrtc,config:t.config}),d(o,e.from)}u("signalling",e.from,e.signal),o.signal(e.signal),i()})),f}},{cuid:33,debug:34,events:8,once:54,"simple-peer":68,through2:85}],116:[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},{}],117:[function(e,t,n){function r(e){return"[object Array]"===o.call(e)}var i=Array.isArray,o=Object.prototype.toString;t.exports=i||r},{}],118:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<e.length;n++)t(e[n])}function i(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function o(e,t,n){var r=e;return l(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=d(t,{uri:e}),r.callback=n,r}function s(e,t,n){return t=o(e,t,n),a(t)}function a(e){function t(){4===c.readyState&&o()}function n(){var e=void 0;if(c.response?e=c.response:"text"!==c.responseType&&c.responseType||(e=c.responseText||c.responseXML),w)try{e=JSON.parse(e)}catch(t){}return e}function r(e){clearTimeout(p),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,u)}function o(){if(!d){var t;clearTimeout(p),t=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status;var r=u,i=null;0!==t?(r={body:n(),statusCode:t,method:v,headers:{},url:g,rawRequest:c},c.getAllResponseHeaders&&(r.headers=h(c.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,r,r.body)}}var a=e.callback;if("undefined"==typeof a)throw new Error("callback argument missing");a=f(a);var u={body:void 0,headers:{},statusCode:0,method:v,url:g,rawRequest:c},c=e.xhr||null;c||(c=e.cors||e.useXDR?new s.XDomainRequest:new s.XMLHttpRequest);var l,d,p,g=c.url=e.uri||e.url,v=c.method=e.method||"GET",m=e.body||e.data||null,y=c.headers=e.headers||{},b=!!e.sync,w=!1;if("json"in e&&(w=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),m=JSON.stringify(e.json))),c.onreadystatechange=t,c.onload=o,c.onerror=r,c.onprogress=function(){},c.ontimeout=r,c.open(v,g,!b,e.username,e.password),b||(c.withCredentials=!!e.withCredentials),!b&&e.timeout>0&&(p=setTimeout(function(){d=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)},e.timeout)),c.setRequestHeader)for(l in y)y.hasOwnProperty(l)&&c.setRequestHeader(l,y[l]);else if(e.headers&&!i(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(m),c}function u(){}var c=e("global/window"),f=e("once"),l=e("is-function"),h=e("parse-headers"),d=e("xtend");t.exports=s,s.XMLHttpRequest=c.XMLHttpRequest||u,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:c.XDomainRequest,r(["get","put","post","patch","head","delete"],function(e){s["delete"===e?"del":e]=function(t,n,r){return n=o(t,n,r),n.method=e.toUpperCase(),a(n)}})},{"global/window":42,"is-function":46,once:119,"parse-headers":55,xtend:120}],119:[function(e,t,n){function r(e){var t=!1;return function(){return t?void 0:(t=!0,e.apply(this,arguments))}}t.exports=r,r.proto=r(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0})})},{}],120:[function(e,t,n){function r(){for(var e={},t=0;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},{}],121:[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},{}]},{},[29]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment