forked from vidigami/backbone-orm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream.min.js
9 lines (9 loc) · 49.2 KB
/
stream.min.js
1
2
3
4
5
6
7
8
9
/*
stream.js 0.7.13
Copyright (c) 2013-2016 Vidigami
License: MIT (http://www.opensource.org/licenses/mit-license.php)
Source: https://github.com/vidigami/backbone-orm
Dependencies: Backbone.js and Underscore.js.
*/
(function(){var e=function t(n,r,i){function o(a,u){if(!r[a]){if(!n[a]){var f="function"==typeof e&&e;if(!u&&f)return f(a,!0);if(s)return s(a,!0);throw new Error("Cannot find module '"+a+"'")}var l=r[a]={exports:{}};n[a][0].call(l.exports,function(e){var t=n[a][1][e];return o(t?t:e)},l,l.exports,t,n,r,i)}return r[a].exports}for(var s="function"==typeof e&&e,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t,n){function r(e){return"[object Array]"===f.call(e)}function i(e,t){var n;if(null===e)n={__proto__:null};else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var r=function(){};r.prototype=e,n=new r,n.__proto__=e}return"undefined"!=typeof t&&Object.defineProperties&&Object.defineProperties(n,t),n}function o(e){return"object"!=typeof e&&"function"!=typeof e||null===e}function s(e){if(o(e))throw new TypeError("Object.keys called on a non-object");var t=[];for(var n in e)l.call(e,n)&&t.push(n);return t}function a(e){if(o(e))throw new TypeError("Object.getOwnPropertyNames called on a non-object");var t=s(e);return n.isArray(e)&&-1===n.indexOf(e,"length")&&t.push("length"),t}function u(e,t){return{value:e[t]}}var f=Object.prototype.toString,l=Object.prototype.hasOwnProperty;n.isArray="function"==typeof Array.isArray?Array.isArray:r,n.indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1},n.filter=function(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n},n.forEach=function(e,t,n){if(e.forEach)return e.forEach(t,n);for(var r=0;r<e.length;r++)t.call(n,e[r],r,e)},n.map=function(e,t){if(e.map)return e.map(t);for(var n=new Array(e.length),r=0;r<e.length;r++)n[r]=t(e[r],r,e);return n},n.reduce=function(e,t,n){if(e.reduce)return e.reduce(t,n);var r,i=!1;2<arguments.length&&(r=n,i=!0);for(var o=0,s=e.length;s>o;++o)e.hasOwnProperty(o)&&(i?r=t(r,e[o],o,e):(r=e[o],i=!0));return r},"b"!=="ab".substr(-1)?n.substr=function(e,t,n){return 0>t&&(t=e.length+t),e.substr(t,n)}:n.substr=function(e,t,n){return e.substr(t,n)},n.trim=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},n.bind=function(){var e=Array.prototype.slice.call(arguments),t=e.shift();if(t.bind)return t.bind.apply(t,e);var n=e.shift();return function(){t.apply(n,e.concat([Array.prototype.slice.call(arguments)]))}},n.create="function"==typeof Object.create?Object.create:i;var c="function"==typeof Object.keys?Object.keys:s,h="function"==typeof Object.getOwnPropertyNames?Object.getOwnPropertyNames:a;if((new Error).hasOwnProperty("description")){var d=function(e,t){return"[object Error]"===f.call(e)&&(t=n.filter(t,function(e){return"description"!==e&&"number"!==e&&"message"!==e})),t};n.keys=function(e){return d(e,c(e))},n.getOwnPropertyNames=function(e){return d(e,h(e))}}else n.keys=c,n.getOwnPropertyNames=h;if("function"==typeof Object.getOwnPropertyDescriptor)try{Object.getOwnPropertyDescriptor({a:1},"a"),n.getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor}catch(p){n.getOwnPropertyDescriptor=function(e,t){try{return Object.getOwnPropertyDescriptor(e,t)}catch(n){return u(e,t)}}}else n.getOwnPropertyDescriptor=u},{}],2:[function(e,t,n){function r(e){return this instanceof r?(u.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.setImmediate(s.bind(this.end,this))}t.exports=r;var o=e("util"),s=e("_shims"),a=e("timers"),u=e("_stream_readable"),f=e("_stream_writable");o.inherits(r,u),s.forEach(s.keys(f.prototype),function(e){r.prototype[e]||(r.prototype[e]=f.prototype[e])})},{_shims:1,_stream_readable:4,_stream_writable:6,timers:12,util:13}],3:[function(e,t,n){function r(e){return this instanceof r?void i.call(this,e):new r(e)}t.exports=r;var i=e("_stream_transform"),o=e("util");o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},{_stream_transform:5,util:13}],4:[function(e,t,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&&(E||(E=e("string_decoder").StringDecoder),this.decoder=new E(t.encoding),this.encoding=t.encoding)}function i(e){return this instanceof i?(this._readableState=new r(e,this),this.readable=!0,void S.call(this)):new i(e)}function o(e,t,n,r,i){var o=f(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||l(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&&c(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>=j)e=j;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:isNaN(e)||null===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 f(e,t){var n=null;return I.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(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?c(e):w(e)}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?x.setImmediate(function(){h(e)}):h(e))}function h(e){e.emit("readable")}function d(e,t){t.readingMore||(t.readingMore=!0,x.setImmediate(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&&m(e)}}function m(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):L.forEach(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 v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,m(this))}function y(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=S.prototype.pipe,e.on=e.addListener=S.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?x.setImmediate(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(""):I.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 I(e);for(var u=0,f=0,l=r.length;l>f&&e>u;f++){var a=r[0],c=Math.min(e-u,a.length);o?n+=a.slice(0,c):a.copy(n,u,0,c),c<a.length?r[0]=a.slice(c):r.shift(),u+=c}}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,x.setImmediate(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}var _=e("__browserify_process");t.exports=i,i.ReadableState=r;var E,k=e("events").EventEmitter,S=e("stream"),L=e("_shims"),I=e("buffer").Buffer,x=e("timers"),O=e("util");O.inherits(i,S),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 I(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){E||(E=e("string_decoder").StringDecoder),this._readableState.decoder=new E(t),this._readableState.encoding=t};var j=8388608;i.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&w(this),null;var r=t.needReadable;t.length-e<=t.highWaterMark&&(r=!0),(t.ended||t.reading)&&(r=!1),r&&(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?b(e,t):null,null===i&&(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),i},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function n(e){e===f&&i()}function r(){e.end()}function i(){e.removeListener("close",s),e.removeListener("finish",a),e.removeListener("drain",d),e.removeListener("error",o),e.removeListener("unpipe",n),f.removeListener("end",r),f.removeListener("end",i),(!e._writableState||e._writableState.needDrain)&&d()}function o(t){u(),0===p&&0===k.listenerCount(e,"error")&&e.emit("error",t)}function s(){e.removeListener("finish",a),u()}function a(){e.removeListener("close",s),u()}function u(){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 c=(!t||t.end!==!1)&&e!==_.stdout&&e!==_.stderr,h=c?r:i;l.endEmitted?x.setImmediate(h):f.once("end",h),e.on("unpipe",n);var d=g(f);e.on("drain",d);var p=k.listenerCount(e,"error");return e.once("error",o),e.once("close",s),e.once("finish",a),e.emit("pipe",f),l.flowing||(this.on("readable",v),l.flowing=!0,x.setImmediate(function(){m(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",v),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",v),t.flowing=!1;for(var i=0;r>i;i++)n[i].emit("unpipe",this);return this}var i=L.indexOf(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=S.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&&c(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)),i&&(t.objectMode||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 L.forEach(o,function(t){e.on(t,L.bind(r.emit,r,t))}),r._read=function(t){n&&(n=!1,e.resume())},r},i._fromList=b},{__browserify_process:17,_shims:1,buffer:15,events:8,stream:"6AVn6v",string_decoder:11,timers:12,util:13}],5:[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("util");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;t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{_stream_duplex:2,util:13}],6:[function(e,t,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=[]}function o(e){return this instanceof o||this instanceof _.Duplex?(this._writableState=new i(e,this),this.writable=!0,void _.call(this)):new o(e)}function s(e,t,n){var r=new Error("write after end");e.emit("error",r),E.setImmediate(function(){n(r)})}function a(e,t,n,r){var i=!0;if(!k.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.setImmediate(function(){r(o)}),i=!1}return i}function u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new k(t,n)),t}function f(e,t,n,i,o){n=u(t,n,i);var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;return t.needDrain=!a,t.writing?t.buffer.push(new r(n,i,o)):l(e,t,s,n,i,o),a}function l(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 c(e,t,n,r,i){n?E.setImmediate(function(){i(r)}):i(r),e.emit("error",r)}function h(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function d(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(h(n),t)c(e,n,r,t,i);else{var o=v(e,n);o||n.bufferProcessing||!n.buffer.length||m(e,n),r?E.setImmediate(function(){p(e,n,o,i)}):p(e,n,o,i)}}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 m(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(l(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 v(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function y(e,t){var n=v(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function b(e,t,n){t.ending=!0,y(e,t),n&&(t.finished?E.setImmediate(n):e.once("finish",n)),t.ended=!0}t.exports=o,o.WritableState=i;var w=e("util"),_=e("stream"),E=e("timers"),k=e("buffer").Buffer;w.inherits(o,_),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),k.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=f(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)}},{buffer:15,stream:"6AVn6v",timers:12,util:13}],7:[function(e,t,n){function r(e,t){return d.isUndefined(t)?""+t:!d.isNumber(t)||!isNaN(t)&&isFinite(t)?d.isFunction(t)||d.isRegExp(t)?t.toString():t:t.toString()}function i(e,t){return d.isString(e)?e.length<t?e:e.slice(0,t):e}function o(e){return i(JSON.stringify(e.actual,r),128)+" "+e.operator+" "+i(JSON.stringify(e.expected,r),128)}function s(e,t,n,r,i){throw new m.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function a(e,t){e||s(e,!0,t,"==",m.ok)}function u(e,t){if(e===t)return!0;if(d.isBuffer(e)&&d.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return d.isDate(e)&&d.isDate(t)?e.getTime()===t.getTime():d.isRegExp(e)&&d.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:d.isObject(e)||d.isObject(t)?l(e,t):e==t}function f(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function l(e,t){if(d.isNullOrUndefined(e)||d.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(f(e))return f(t)?(e=g.call(e),t=g.call(t),u(e,t)):!1;try{var n,r,i=p.keys(e),o=p.keys(t)}catch(s){return!1}if(i.length!=o.length)return!1;for(i.sort(),o.sort(),r=i.length-1;r>=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!u(e[n],t[n]))return!1;return!0}function c(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function h(e,t,n,r){var i;d.isString(n)&&(r=n,n=null);try{t()}catch(o){i=o}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&s(i,n,"Missing expected exception"+r),!e&&c(i,n)&&s(i,n,"Got unwanted exception"+r),e&&i&&n&&!c(i,n)||!e&&i)throw i}var d=e("util"),p=e("_shims"),g=Array.prototype.slice,m=t.exports=a;m.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,this.message=e.message||o(this)},d.inherits(m.AssertionError,Error),m.fail=s,m.ok=a,m.equal=function(e,t,n){e!=t&&s(e,t,n,"==",m.equal)},m.notEqual=function(e,t,n){e==t&&s(e,t,n,"!=",m.notEqual)},m.deepEqual=function(e,t,n){u(e,t)||s(e,t,n,"deepEqual",m.deepEqual)},m.notDeepEqual=function(e,t,n){u(e,t)&&s(e,t,n,"notDeepEqual",m.notDeepEqual)},m.strictEqual=function(e,t,n){e!==t&&s(e,t,n,"===",m.strictEqual)},m.notStrictEqual=function(e,t,n){e===t&&s(e,t,n,"!==",m.notStrictEqual)},m["throws"]=function(e,t,n){h.apply(this,[!0].concat(g.call(arguments)))},m.doesNotThrow=function(e,t){h.apply(this,[!1].concat(g.call(arguments)))},m.ifError=function(e){if(e)throw e}},{_shims:1,util:13}],8:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var i=e("util");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(!i.isNumber(e)||0>e)throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,s,a;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i.isObject(this._events.error)&&!this._events.error.length))throw t=arguments[1],t instanceof Error?t:TypeError('Uncaught, unspecified "error" event.');if(n=this._events[e],i.isUndefined(n))return!1;if(i.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),s=1;r>s;s++)o[s-1]=arguments[s];n.apply(this,o)}else if(i.isObject(n)){for(r=arguments.length,o=new Array(r-1),s=1;r>s;s++)o[s-1]=arguments[s];for(a=n.slice(),r=a.length,s=0;r>s;s++)a[s].apply(this,o)}return!0},r.prototype.addListener=function(e,t){var n;if(!i.isFunction(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i.isFunction(t.listener)?t.listener:t),this._events[e]?i.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i.isObject(this._events[e])&&!this._events[e].warned){var n;n=i.isUndefined(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),console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),t.apply(this,arguments)}if(!i.isFunction(t))throw TypeError("listener must be a function");return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,s;if(!i.isFunction(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.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i.isObject(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;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.isFunction(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?i.isFunction(e._events[t])?1:e._events[t].length:0}},{util:13}],"6AVn6v":[function(e,t,n){function r(){i.call(this)}t.exports=r;var i=e("events").EventEmitter,o=e("util");o.inherits(r,i),r.Readable=e("_stream_readable"),r.Writable=e("_stream_writable"),r.Duplex=e("_stream_duplex"),r.Transform=e("_stream_transform"),r.PassThrough=e("_stream_passthrough"),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function r(){f.readable&&f.resume&&f.resume()}function o(){l||(l=!0,e.end())}function s(){l||(l=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){f.removeListener("data",n),e.removeListener("drain",r),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),e.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),e.removeListener("close",u)}var f=this;f.on("data",n),e.on("drain",r),e._isStdio||t&&t.end===!1||(f.on("end",o),f.on("close",s));var l=!1;return f.on("error",a),e.on("error",a),f.on("end",u),f.on("close",u),e.on("close",u),e.emit("pipe",f),e}},{_stream_duplex:2,_stream_passthrough:3,_stream_readable:4,_stream_transform:5,_stream_writable:6,events:8,util:13}],stream:[function(e,t,n){t.exports=e("6AVn6v")},{}],11:[function(e,t,n){function r(e){if(e&&!a.isEncoding(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){var t=this.charReceived=e.length%2;return this.charLength=t?2:0,t}function s(e){var t=this.charReceived=e.length%3;return this.charLength=t?3:0,t}var a=e("buffer").Buffer,u=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};u.prototype.write=function(e){for(var t="",n=0;this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,n,r),this.charReceived+=r-n,n=r,this.charReceived<this.charLength)return"";t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=t.charCodeAt(t.length-1);if(!(i>=55296&&56319>=i)){if(this.charReceived=this.charLength=0,r==e.length)return t;e=e.slice(r,e.length);break}this.charLength+=this.surrogateSize,t=""}var o=this.detectIncompleteChar(e),s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-o,s),this.charReceived=o,s-=o),t+=e.toString(this.encoding,0,s);var s=t.length-1,i=t.charCodeAt(s);if(i>=55296&&56319>=i){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(2>=t&&n>>4==14){this.charLength=3;break}if(3>=t&&n>>3==30){this.charLength=4;break}}return t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:15}],12:[function(e,t,n){function r(e,t){return function(){return e.apply(t,arguments)}}try{if(setTimeout.call)n.setTimeout=setTimeout,n.setInterval=setInterval;else{var i=Array.prototype.slice;n.setTimeout=function(e){var t=i.call(arguments,1);return setTimeout(function(){return e.apply(this,t)})},n.setInterval=function(e){var t=i.call(arguments,1);return setInterval(function(){return e.apply(this,t)})}}n.clearTimeout=clearTimeout,n.clearInterval=clearInterval,window.setImmediate&&(n.setImmediate=window.setImmediate,n.clearImmediate=window.clearImmediate),n.setTimeout(function(){})}catch(o){"undefined"!=typeof window?(n.setTimeout=r(setTimeout,window),n.setInterval=r(setInterval,window),n.clearTimeout=r(clearTimeout,window),n.clearInterval=r(clearInterval,window),window.setImmediate&&(n.setImmediate=r(window.setImmediate,window),n.clearImmediate=r(window.clearImmediate,window))):("undefined"!=typeof setTimeout&&(n.setTimeout=setTimeout),"undefined"!=typeof setInterval&&(n.setInterval=setInterval),"undefined"!=typeof clearTimeout&&(n.clearTimeout=clearTimeout),"function"==typeof clearInterval&&(n.clearInterval=clearInterval))}if(n.unref=function(){},n.ref=function(){},!n.setImmediate){var s=0,a={},u=!1;n.setImmediate=function(){function e(){u=!1;for(var e in a)if(a.hasOwnProperty(s,e)){var t=a[e];delete a[e],t()}}return"undefined"!=typeof window&&window.postMessage&&window.addEventListener?(window.addEventListener("message",function(t){t.source===window&&"browserify-tick"===t.data&&(t.stopPropagation(),e())},!0),function(e){var t=++s;return a[t]=e,u||(u=!0,window.postMessage("browserify-tick","*")),t}):function(t){var n=++s;return a[n]=t,u||(u=!0,setTimeout(e,0)),n}}(),n.clearImmediate=function(e){delete a[e]}}},{}],13:[function(e,t,n){function r(e,t){var r={seen:[],stylize:o};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(t)?r.showHidden=t:t&&n._extend(r,t),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),a(r,e,r.depth)}function i(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function o(e,t){return e}function s(e){var t={};return A.forEach(e,function(e,n){t[e]=!0}),t}function a(e,t,r){if(e.customInspect&&t&&L(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r);return y(i)||(i=a(e,i,r)),i}var o=u(e,t);if(o)return o;var p=A.keys(t),g=s(p);if(e.showHidden&&(p=A.getOwnPropertyNames(t)),0===p.length){if(L(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(k(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return f(t)}var v="",b=!1,w=["{","}"];if(d(t)&&(b=!0,w=["[","]"]),L(t)){var E=t.name?": "+t.name:"";v=" [Function"+E+"]"}if(_(t)&&(v=" "+RegExp.prototype.toString.call(t)),k(t)&&(v=" "+Date.prototype.toUTCString.call(t)),S(t)&&(v=" "+f(t)),0===p.length&&(!b||0==t.length))return w[0]+v+w[1];if(0>r)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var I;return I=b?l(e,t,r,g,p):p.map(function(n){return c(e,t,r,g,n,b)}),e.seen.pop(),h(I,v,w)}function u(e,t){if(w(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return v(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):g(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)T(t,String(s))?o.push(c(e,t,n,r,String(s),!0)):o.push("");return A.forEach(i,function(i){i.match(/^\d+$/)||o.push(c(e,t,n,r,i,!0))}),o}function c(e,t,n,r,i,o){var s,u,f;if(f=A.getOwnPropertyDescriptor(t,i)||{value:t[i]},f.get?u=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(u=e.stylize("[Setter]","special")),T(r,i)||(s="["+i+"]"),u||(A.indexOf(e.seen,f.value)<0?(u=g(n)?a(e,f.value,null):a(e,f.value,n-1),u.indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return u;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+": "+u}function h(e,t,n){var r=0,i=A.reduce(e,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 d(e){return A.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return null==e}function v(e){return"number"==typeof e}function y(e){return"string"==typeof e}function b(e){return"symbol"==typeof e;
}function w(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===O(e)}function E(e){return"object"==typeof e&&e}function k(e){return E(e)&&"[object Date]"===O(e)}function S(e){return E(e)&&"[object Error]"===O(e)}function L(e){return"function"==typeof e}function I(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function x(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.binarySlice}function O(e){return Object.prototype.toString.call(e)}function j(e){return 10>e?"0"+e.toString(10):e.toString(10)}function M(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=e("_shims"),C=/%[sdj%]/g;n.format=function(e){if(!y(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(r(arguments[n]));return t.join(" ")}for(var n=1,i=arguments,o=i.length,s=String(e).replace(C,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return e}}),a=i[n];o>n;a=i[++n])s+=g(a)||!E(a)?" "+a:" "+r(a);return s},n.inspect=r,r.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]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=d,n.isBoolean=p,n.isNull=g,n.isNullOrUndefined=m,n.isNumber=v,n.isString=y,n.isSymbol=b,n.isUndefined=w,n.isRegExp=_,n.isObject=E,n.isDate=k,n.isError=S,n.isFunction=L,n.isPrimitive=I,n.isBuffer=x;var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",M(),n.format.apply(n,arguments))},n.inherits=function(e,t){e.super_=t,e.prototype=A.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},n._extend=function(e,t){if(!t||!E(t))return e;for(var n=A.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}},{_shims:1}],14:[function(e,t,n){n.readIEEE754=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,f=u>>1,l=-7,c=n?0:i-1,h=n?1:-1,d=e[t+c];for(c+=h,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+c],c+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+c],c+=h,l-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:(d?-1:1)*(1/0);s+=Math.pow(2,r),o-=f}return(d?-1:1)*s*Math.pow(2,o-r)},n.writeIEEE754=function(e,t,n,r,i,o){var s,a,u,f=8*o-i-1,l=(1<<f)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?o-1:0,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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+c>=1?h/u:h*Math.pow(2,1-c),t*u>=2&&(s++,u/=2),s+c>=l?(a=0,s=l):s+c>=1?(a=(t*u-1)*Math.pow(2,i),s+=c):(a=t*Math.pow(2,c-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,f+=i;f>0;e[n+d]=255&s,d+=p,s/=256,f-=8);e[n+d-p]|=128*g}},{}],15:[function(e,t,n){function r(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function i(t,n,o){if(M||(M=e("assert")),!(this instanceof i))return new i(t,n,o);if(this.parent=this,this.offset=0,"base64"==n&&"string"==typeof t)for(t=r(t);t.length%4!=0;)t+="=";var a;if("number"==typeof o){this.length=s(n);for(var f=0;f<this.length;f++)this[f]=t.get(f+o)}else{switch(a=typeof t){case"number":this.length=s(t);break;case"string":this.length=i.byteLength(t,n);break;case"object":this.length=s(t.length);break;default:throw new Error("First argument needs to be a number, array or string.")}if(u(t))for(var f=0;f<this.length;f++)t instanceof i?this[f]=t.readUInt8(f):this[f]=t[f];else if("string"==a)this.length=this.write(t,0,n);else if("number"===a)for(var f=0;f<this.length;f++)this[f]=0}}function o(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function s(e){return e=~~Math.ceil(+e),0>e?0:e}function a(e){return(Array.isArray||function(e){return"[object Array]"=={}.toString.apply(e)})(e)}function u(e){return a(e)||i.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function f(e){return 16>e?"0"+e.toString(16):e.toString(16)}function l(e){for(var t=[],n=0;n<e.length;n++)if(e.charCodeAt(n)<=127)t.push(e.charCodeAt(n));else for(var r=encodeURIComponent(e.charAt(n)).substr(1).split("%"),i=0;i<r.length;i++)t.push(parseInt(r[i],16));return t}function c(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function h(t){return e("base64-js").toByteArray(t)}function d(e,t,n,r){for(var i=0;r>i&&!(i+n>=t.length||i>=e.length);)t[i+n]=e[i],i++;return i}function p(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function g(e,t,n,r){var i=0;return r||(M.ok("boolean"==typeof n,"missing or invalid endian"),M.ok(void 0!==t&&null!==t,"missing offset"),M.ok(t+1<e.length,"Trying to read beyond buffer length")),t>=e.length?0:(n?(i=e[t]<<8,t+1<e.length&&(i|=e[t+1])):(i=e[t],t+1<e.length&&(i|=e[t+1]<<8)),i)}function m(e,t,n,r){var i=0;return r||(M.ok("boolean"==typeof n,"missing or invalid endian"),M.ok(void 0!==t&&null!==t,"missing offset"),M.ok(t+3<e.length,"Trying to read beyond buffer length")),t>=e.length?0:(n?(t+1<e.length&&(i=e[t+1]<<16),t+2<e.length&&(i|=e[t+2]<<8),t+3<e.length&&(i|=e[t+3]),i+=e[t]<<24>>>0):(t+2<e.length&&(i=e[t+2]<<16),t+1<e.length&&(i|=e[t+1]<<8),i|=e[t],t+3<e.length&&(i+=e[t+3]<<24>>>0)),i)}function v(e,t,n,r){var i,o;return r||(M.ok("boolean"==typeof n,"missing or invalid endian"),M.ok(void 0!==t&&null!==t,"missing offset"),M.ok(t+1<e.length,"Trying to read beyond buffer length")),o=g(e,t,n,r),i=32768&o,i?-1*(65535-o+1):o}function y(e,t,n,r){var i,o;return r||(M.ok("boolean"==typeof n,"missing or invalid endian"),M.ok(void 0!==t&&null!==t,"missing offset"),M.ok(t+3<e.length,"Trying to read beyond buffer length")),o=m(e,t,n,r),i=2147483648&o,i?-1*(4294967295-o+1):o}function b(t,n,r,i){return i||(M.ok("boolean"==typeof r,"missing or invalid endian"),M.ok(n+3<t.length,"Trying to read beyond buffer length")),e("./buffer_ieee754").readIEEE754(t,n,r,23,4)}function w(t,n,r,i){return i||(M.ok("boolean"==typeof r,"missing or invalid endian"),M.ok(n+7<t.length,"Trying to read beyond buffer length")),e("./buffer_ieee754").readIEEE754(t,n,r,52,8)}function _(e,t){M.ok("number"==typeof e,"cannot write a non-number as a number"),M.ok(e>=0,"specified a negative value for writing an unsigned value"),M.ok(t>=e,"value is larger than maximum value for type"),M.ok(Math.floor(e)===e,"value has a fractional component")}function E(e,t,n,r,i){i||(M.ok(void 0!==t&&null!==t,"missing value"),M.ok("boolean"==typeof r,"missing or invalid endian"),M.ok(void 0!==n&&null!==n,"missing offset"),M.ok(n+1<e.length,"trying to write beyond buffer length"),_(t,65535));for(var o=0;o<Math.min(e.length-n,2);o++)e[n+o]=(t&255<<8*(r?1-o:o))>>>8*(r?1-o:o)}function k(e,t,n,r,i){i||(M.ok(void 0!==t&&null!==t,"missing value"),M.ok("boolean"==typeof r,"missing or invalid endian"),M.ok(void 0!==n&&null!==n,"missing offset"),M.ok(n+3<e.length,"trying to write beyond buffer length"),_(t,4294967295));for(var o=0;o<Math.min(e.length-n,4);o++)e[n+o]=t>>>8*(r?3-o:o)&255}function S(e,t,n){M.ok("number"==typeof e,"cannot write a non-number as a number"),M.ok(t>=e,"value larger than maximum allowed value"),M.ok(e>=n,"value smaller than minimum allowed value"),M.ok(Math.floor(e)===e,"value has a fractional component")}function L(e,t,n){M.ok("number"==typeof e,"cannot write a non-number as a number"),M.ok(t>=e,"value larger than maximum allowed value"),M.ok(e>=n,"value smaller than minimum allowed value")}function I(e,t,n,r,i){i||(M.ok(void 0!==t&&null!==t,"missing value"),M.ok("boolean"==typeof r,"missing or invalid endian"),M.ok(void 0!==n&&null!==n,"missing offset"),M.ok(n+1<e.length,"Trying to write beyond buffer length"),S(t,32767,-32768)),t>=0?E(e,t,n,r,i):E(e,65535+t+1,n,r,i)}function x(e,t,n,r,i){i||(M.ok(void 0!==t&&null!==t,"missing value"),M.ok("boolean"==typeof r,"missing or invalid endian"),M.ok(void 0!==n&&null!==n,"missing offset"),M.ok(n+3<e.length,"Trying to write beyond buffer length"),S(t,2147483647,-2147483648)),t>=0?k(e,t,n,r,i):k(e,4294967295+t+1,n,r,i)}function O(t,n,r,i,o){o||(M.ok(void 0!==n&&null!==n,"missing value"),M.ok("boolean"==typeof i,"missing or invalid endian"),M.ok(void 0!==r&&null!==r,"missing offset"),M.ok(r+3<t.length,"Trying to write beyond buffer length"),L(n,3.4028234663852886e38,-3.4028234663852886e38)),e("./buffer_ieee754").writeIEEE754(t,n,r,i,23,4)}function j(t,n,r,i,o){o||(M.ok(void 0!==n&&null!==n,"missing value"),M.ok("boolean"==typeof i,"missing or invalid endian"),M.ok(void 0!==r&&null!==r,"missing offset"),M.ok(r+7<t.length,"Trying to write beyond buffer length"),L(n,1.7976931348623157e308,-1.7976931348623157e308)),e("./buffer_ieee754").writeIEEE754(t,n,r,i,52,8)}var M;n.Buffer=i,n.SlowBuffer=i,i.poolSize=8192,n.INSPECT_MAX_BYTES=50,i.prototype.get=function(e){if(0>e||e>=this.length)throw new Error("oob");return this[e]},i.prototype.set=function(e,t){if(0>e||e>=this.length)throw new Error("oob");return this[e]=t},i.byteLength=function(e,t){switch(t||"utf8"){case"hex":return e.length/2;case"utf8":case"utf-8":return l(e).length;case"ascii":case"binary":return e.length;case"base64":return h(e).length;default:throw new Error("Unknown encoding")}},i.prototype.utf8Write=function(e,t,n){return i._charsWritten=d(l(e),this,t,n)},i.prototype.asciiWrite=function(e,t,n){return i._charsWritten=d(c(e),this,t,n)},i.prototype.binaryWrite=i.prototype.asciiWrite,i.prototype.base64Write=function(e,t,n){return i._charsWritten=d(h(e),this,t,n)},i.prototype.base64Slice=function(t,n){var r=Array.prototype.slice.apply(this,arguments);return e("base64-js").fromByteArray(r)},i.prototype.utf8Slice=function(){for(var e=Array.prototype.slice.apply(this,arguments),t="",n="",r=0;r<e.length;)e[r]<=127?(t+=p(n)+String.fromCharCode(e[r]),n=""):n+="%"+e[r].toString(16),r++;return t+p(n)},i.prototype.asciiSlice=function(){for(var e=Array.prototype.slice.apply(this,arguments),t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},i.prototype.binarySlice=i.prototype.asciiSlice,i.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=f(this[r]),r==n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},i.prototype.hexSlice=function(e,t){var n=this.length;(!e||0>e)&&(e=0),(!t||0>t||t>n)&&(t=n);for(var r="",i=e;t>i;i++)r+=f(this[i]);return r},i.prototype.toString=function(e,t,n){if(e=String(e||"utf8").toLowerCase(),t=+t||0,"undefined"==typeof n&&(n=this.length),+n==t)return"";switch(e){case"hex":return this.hexSlice(t,n);case"utf8":case"utf-8":return this.utf8Slice(t,n);case"ascii":return this.asciiSlice(t,n);case"binary":return this.binarySlice(t,n);case"base64":return this.base64Slice(t,n);case"ucs2":case"ucs-2":return this.ucs2Slice(t,n);default:throw new Error("Unknown encoding")}},i.prototype.hexWrite=function(e,t,n){t=+t||0;var r=this.length-t;n?(n=+n,n>r&&(n=r)):n=r;var o=e.length;if(o%2)throw new Error("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;n>s;s++){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))throw new Error("Invalid hex string");this[t+s]=a}return i._charsWritten=2*s,s},i.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var i=r;r=t,t=n,n=i}t=+t||0;var o=this.length-t;switch(n?(n=+n,n>o&&(n=o)):n=o,r=String(r||"utf8").toLowerCase()){case"hex":return this.hexWrite(e,t,n);case"utf8":case"utf-8":return this.utf8Write(e,t,n);case"ascii":return this.asciiWrite(e,t,n);case"binary":return this.binaryWrite(e,t,n);case"base64":return this.base64Write(e,t,n);case"ucs2":case"ucs-2":return this.ucs2Write(e,t,n);default:throw new Error("Unknown encoding")}},i.prototype.slice=function(e,t){var n=this.length;return e=o(e,n,0),t=o(t,n,n),new i(this,t-e,+e)},i.prototype.copy=function(e,t,n,r){var i=this;if(n||(n=0),(void 0===r||isNaN(r))&&(r=this.length),t||(t=0),n>r)throw new Error("sourceEnd < sourceStart");if(r===n)return 0;if(0==e.length||0==i.length)return 0;if(0>t||t>=e.length)throw new Error("targetStart out of bounds");if(0>n||n>=i.length)throw new Error("sourceStart out of bounds");if(0>r||r>i.length)throw new Error("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);for(var o=[],s=n;r>s;s++)M.ok("undefined"!=typeof this[s],"copying undefined buffer bytes!"),o.push(this[s]);for(var s=t;s<t+o.length;s++)e[s]=o[s-t]},i.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),"number"!=typeof e||isNaN(e))throw new Error("value is not a number");if(t>n)throw new Error("end < start");if(n===t)return 0;if(0==this.length)return 0;if(0>t||t>=this.length)throw new Error("start out of bounds");if(0>n||n>this.length)throw new Error("end out of bounds");for(var r=t;n>r;r++)this[r]=e},i.isBuffer=function(e){return e instanceof i||e instanceof i},i.concat=function(e,t){if(!a(e))throw new Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===e.length)return new i(0);if(1===e.length)return e[0];if("number"!=typeof t){t=0;for(var n=0;n<e.length;n++){var r=e[n];t+=r.length}}for(var o=new i(t),s=0,n=0;n<e.length;n++){var r=e[n];r.copy(o,s),s+=r.length}return o},i.isEncoding=function(e){switch((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}},i.prototype.readUInt8=function(e,t){var n=this;return t||(M.ok(void 0!==e&&null!==e,"missing offset"),M.ok(e<n.length,"Trying to read beyond buffer length")),e>=n.length?void 0:n[e]},i.prototype.readUInt16LE=function(e,t){return g(this,e,!1,t)},i.prototype.readUInt16BE=function(e,t){return g(this,e,!0,t)},i.prototype.readUInt32LE=function(e,t){return m(this,e,!1,t)},i.prototype.readUInt32BE=function(e,t){return m(this,e,!0,t)},i.prototype.readInt8=function(e,t){var n,r=this;return t||(M.ok(void 0!==e&&null!==e,"missing offset"),M.ok(e<r.length,"Trying to read beyond buffer length")),e>=r.length?void 0:(n=128&r[e],n?-1*(255-r[e]+1):r[e])},i.prototype.readInt16LE=function(e,t){return v(this,e,!1,t)},i.prototype.readInt16BE=function(e,t){return v(this,e,!0,t)},i.prototype.readInt32LE=function(e,t){return y(this,e,!1,t)},i.prototype.readInt32BE=function(e,t){return y(this,e,!0,t)},i.prototype.readFloatLE=function(e,t){return b(this,e,!1,t)},i.prototype.readFloatBE=function(e,t){return b(this,e,!0,t)},i.prototype.readDoubleLE=function(e,t){return w(this,e,!1,t)},i.prototype.readDoubleBE=function(e,t){return w(this,e,!0,t)},i.prototype.writeUInt8=function(e,t,n){var r=this;n||(M.ok(void 0!==e&&null!==e,"missing value"),M.ok(void 0!==t&&null!==t,"missing offset"),M.ok(t<r.length,"trying to write beyond buffer length"),_(e,255)),t<r.length&&(r[t]=e)},i.prototype.writeUInt16LE=function(e,t,n){E(this,e,t,!1,n)},i.prototype.writeUInt16BE=function(e,t,n){E(this,e,t,!0,n)},i.prototype.writeUInt32LE=function(e,t,n){k(this,e,t,!1,n)},i.prototype.writeUInt32BE=function(e,t,n){k(this,e,t,!0,n)},i.prototype.writeInt8=function(e,t,n){var r=this;n||(M.ok(void 0!==e&&null!==e,"missing value"),M.ok(void 0!==t&&null!==t,"missing offset"),M.ok(t<r.length,"Trying to write beyond buffer length"),S(e,127,-128)),e>=0?r.writeUInt8(e,t,n):r.writeUInt8(255+e+1,t,n)},i.prototype.writeInt16LE=function(e,t,n){I(this,e,t,!1,n)},i.prototype.writeInt16BE=function(e,t,n){I(this,e,t,!0,n)},i.prototype.writeInt32LE=function(e,t,n){x(this,e,t,!1,n)},i.prototype.writeInt32BE=function(e,t,n){x(this,e,t,!0,n)},i.prototype.writeFloatLE=function(e,t,n){O(this,e,t,!1,n)},i.prototype.writeFloatBE=function(e,t,n){O(this,e,t,!0,n)},i.prototype.writeDoubleLE=function(e,t,n){j(this,e,t,!1,n)},i.prototype.writeDoubleBE=function(e,t,n){j(this,e,t,!0,n)}},{"./buffer_ieee754":14,assert:7,"base64-js":16}],16:[function(e,t,n){!function(e){"use strict";function n(e){var t,n,r,o,s,a;if(e.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(s=e.indexOf("="),s=s>0?e.length-s:0,a=[],r=s>0?e.length-4:e.length,t=0,n=0;r>t;t+=4,n+=3)o=i.indexOf(e[t])<<18|i.indexOf(e[t+1])<<12|i.indexOf(e[t+2])<<6|i.indexOf(e[t+3]),a.push((16711680&o)>>16),a.push((65280&o)>>8),a.push(255&o);return 2===s?(o=i.indexOf(e[t])<<2|i.indexOf(e[t+1])>>4,a.push(255&o)):1===s&&(o=i.indexOf(e[t])<<10|i.indexOf(e[t+1])<<4|i.indexOf(e[t+2])>>2,a.push(o>>8&255),a.push(255&o)),a}function r(e){function t(e){return i[e>>18&63]+i[e>>12&63]+i[e>>6&63]+i[63&e]}var n,r,o,s=e.length%3,a="";for(n=0,o=e.length-s;o>n;n+=3)r=(e[n]<<16)+(e[n+1]<<8)+e[n+2],a+=t(r);switch(s){case 1:r=e[e.length-1],a+=i[r>>2],a+=i[r<<4&63],a+="==";break;case 2:r=(e[e.length-2]<<8)+e[e.length-1],a+=i[r>>10],a+=i[r>>4&63],a+=i[r<<2&63],a+="="}return a}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports.toByteArray=n,t.exports.fromByteArray=r}()},{}],17:[function(e,t,n){var r=t.exports={};r.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var t=n.shift();t()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")}},{}]},{},[]);"object"==typeof exports?module.exports=e("stream"):("function"==typeof define&&define.amd&&define("stream",function(){return e("stream")}),"undefined"!=typeof window&&(window.stream=e("stream")))}).call(this);