javalon
Version:
javascript api for the avalon blockchain
1 lines • 1.02 MB
JavaScript
!function(){var t,e=function(t){var e;return function(r){return e||t(e={exports:{},parent:r},e.exports),e.exports}},r=e(function(t,e){(function(e,r){(function(){"use strict";var o;t.exports=x,x.ReadableState=A,Vi.EventEmitter;var s,h=function(t,e){return t.listeners(e).length},u=w({}).Buffer,l=r.Uint8Array||function(){},f=M({});s=f&&f.debuglog?f.debuglog("stream"):function(){};var c,d,p,m=Bu.getHighWaterMark,g=Au.codes,b=g.ERR_INVALID_ARG_TYPE,y=g.ERR_STREAM_PUSH_AFTER_EOF,_=g.ERR_METHOD_NOT_IMPLEMENTED,k=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Qt(x,vu);var S=Eu.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(t,e,r){o=o||a({}),t=t||{},"boolean"!=typeof r&&(r=e instanceof o),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",r),this.buffer=new Su,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.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=v({}).StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function x(t){if(o=o||a({}),!(this instanceof x))return new x(t);var e=this instanceof o;this._readableState=new A(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),vu.call(this)}function z(t,e,r,i,n){s("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(s("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,a);else if(n||(o=function(t,e){var r,i;return i=e,u.isBuffer(i)||i instanceof l||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),o)S(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),i)a.endEmitted?S(t,new k):j(t,a,e,!0);else if(a.ended)S(t,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?j(t,a,e,!1):q(t,a)):j(t,a,e,!1)}else i||(a.reading=!1,q(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function j(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&T(t)),q(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=Eu.destroy,x.prototype._undestroy=Eu.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=u.from(t,e),e=""),r=!0),z(this,t,e,!1,r)},x.prototype.unshift=function(t){return z(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){c||(c=v({}).StringDecoder);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var R=1073741824;function B(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var r=t._readableState;s("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(s("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(I,t))}function I(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function q(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(C,t,r))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(s("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function L(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){s("readable nexttick read 0"),t.read(0)}function O(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function U(t){var r=t._readableState;s("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(K,r,t))}function K(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function H(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}x.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):T(this),null;if(0===(t=B(t,e))&&e.ended)return 0===e.length&&U(this),null;var i,n=e.needReadable;return s("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",n=!0),e.ended||e.reading?s("reading or ended",n=!1):n&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=B(r,e))),null===(i=t>0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&U(this)),null!==i&&this.emit("data",i),i},x.prototype._read=function(t){S(this,new _("_read()"))},x.prototype.pipe=function(t,r){var i=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,s("pipe count=%d opts=%j",n.pipesCount,r);var o=r&&!1===r.end||t===e.stdout||t===e.stderr?m:a;function a(){s("onend"),t.end()}n.endEmitted?e.nextTick(o):i.once("end",o),t.on("unpipe",function e(r,o){s("onunpipe"),r===i&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,s("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",c),t.removeListener("unpipe",e),i.removeListener("end",a),i.removeListener("end",m),i.removeListener("data",f),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||u())});var u=function(t){return function(){var e=t._readableState;s("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&h(t,"data")&&(e.flowing=!0,N(t))}}(i);t.on("drain",u);var l=!1;function f(e){s("ondata");var r=t.write(e);s("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==H(n.pipes,t))&&!l&&(s("false write response, pause",n.awaitDrain),n.awaitDrain++),i.pause())}function c(e){s("onerror",e),m(),t.removeListener("error",c),0===h(t,"error")&&S(t,e)}function d(){t.removeListener("finish",p),m()}function p(){s("onfinish"),t.removeListener("close",d),m()}function m(){s("unpipe"),i.unpipe(t)}return i.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener("error",r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on("error",r)}(t,0,c),t.once("close",d),t.once("finish",p),t.emit("pipe",i),n.flowing||(s("pipe resume"),i.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=H(e.pipes,t);return-1===a?this:(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},x.prototype.on=function(t,r){var i=vu.prototype.on.call(this,t,r),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,s("on readable",n.length,n.reading),n.length?T(this):n.reading||e.nextTick(P,this))),i},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,r){var i=vu.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(L,this),i},x.prototype.removeAllListeners=function(t){var r=vu.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(L,this),r},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick(O,t,r))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",function(){if(s("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(n){s("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))}),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<E.length;o++)t.on(E[o],this.emit.bind(this,E[o]));return this._read=function(e){s("wrapped _read",e),i&&(i=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=n({})),d(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=D,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===p&&(p=i({})),p(x,t,e)})}).call(this)}).call(this,Ii,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}),i=e(function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}}),n=e(function(t,e){(function(e){(function(){"use strict";var r;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var n=o({}),a=Symbol("lastResolve"),s=Symbol("lastReject"),h=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),f=Symbol("handlePromise"),c=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[a];if(null!==e){var r=t[c].read();null!==r&&(t[l]=null,t[a]=null,t[s]=null,e(d(r,!1)))}}var m=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((i(r={get stream(){return this[c]},next:function(){var t=this,r=this[h];if(null!==r)return Promise.reject(r);if(this[u])return Promise.resolve(d(void 0,!0));if(this[c].destroyed)return new Promise(function(r,i){e.nextTick(function(){t[h]?i(t[h]):r(d(void 0,!0))})});var i,n=this[l];if(n)i=new Promise(function(t,e){return function(r,i){t.then(function(){e[u]?r(d(void 0,!0)):e[f](r,i)},i)}}(n,this));else{var o=this[c].read();if(null!==o)return Promise.resolve(d(o,!1));i=new Promise(this[f])}return this[l]=i,i}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var t=this;return new Promise(function(e,r){t[c].destroy(null,function(t){t?r(t):e(d(void 0,!0))})})}),r),m);t.exports=function(t){var r,o=Object.create(g,(i(r={},c,{value:t,writable:!0}),i(r,a,{value:null,writable:!0}),i(r,s,{value:null,writable:!0}),i(r,h,{value:null,writable:!0}),i(r,u,{value:t._readableState.endEmitted,writable:!0}),i(r,f,{value:function(t,e){var r=o[c].read();r?(o[l]=null,o[a]=null,o[s]=null,t(d(r,!1))):(o[a]=t,o[s]=e)},writable:!0}),r));return o[l]=null,n(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=o[s];return null!==e&&(o[l]=null,o[a]=null,o[s]=null,e(t)),void(o[h]=t)}var r=o[a];null!==r&&(o[l]=null,o[a]=null,o[s]=null,r(d(void 0,!0))),o[u]=!0}),t.on("readable",function(t){e.nextTick(p,t)}.bind(null,o)),o}}).call(this)}).call(this,Ii)}),o=e(function(t,e){"use strict";var r=Au.codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"==typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}(o||i);var a=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,h=function(){e.writable||l()},u=e._writableState&&e._writableState.finished,l=function(){s=!1,u=!0,a||o.call(e)},f=e._readableState&&e._readableState.endEmitted,c=function(){a=!1,f=!0,s||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return a&&!f?(e._readableState&&e._readableState.ended||(t=new r),o.call(e,t)):s&&!u?(e._writableState&&e._writableState.ended||(t=new r),o.call(e,t)):void 0},m=function(){e.req.on("finish",l)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",l),e.on("abort",p),e.req?m():e.on("request",m)):s&&!e._writableState&&(e.on("end",h),e.on("close",h)),e.on("end",c),e.on("finish",l),!1!==n.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",l),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",l),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",l),e.removeListener("end",c),e.removeListener("error",d),e.removeListener("close",p)}}}),a=e(function(t,e){(function(e){(function(){"use strict";var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var n=r({}),o=s({});Qt(l,n);for(var a=i(o.prototype),h=0;h<a.length;h++){var u=a[h];l.prototype[u]||(l.prototype[u]=o.prototype[u])}function l(t){if(!(this instanceof l))return new l(t);n.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||e.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,Ii)}),s=e(function(t,e){(function(e,r){(function(){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree.next=t}(e,t)}}var n;t.exports=S,S.WritableState=k;var o,s={deprecate:Sn},h=w({}).Buffer,u=r.Uint8Array||function(){},l=Bu.getHighWaterMark,f=Au.codes,c=f.ERR_INVALID_ARG_TYPE,d=f.ERR_METHOD_NOT_IMPLEMENTED,p=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,g=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,y=f.ERR_UNKNOWN_ENCODING,M=Eu.errorOrDestroy;function _(){}function k(t,r,o){n=n||a({}),t=t||{},"boolean"!=typeof o&&(o=r instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,r){var i=t._writableState,n=i.sync,o=i.writecb;if("function"!=typeof o)throw new p;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),r)!function(t,r,i,n,o){--r.pendingcb,i?(e.nextTick(o,n),e.nextTick(R,t,r),t._writableState.errorEmitted=!0,M(t,n)):(o(n),t._writableState.errorEmitted=!0,M(t,n),R(t,r))}(t,i,n,r,o);else{var a=z(i)||t.destroyed;a||i.corked||i.bufferProcessing||!i.bufferedRequest||x(t,i),n?e.nextTick(A,t,i,a,o):A(t,i,a,o)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function S(t){var e=this instanceof(n=n||a({}));if(!e&&!o.call(S,this))return new S(t);this._writableState=new k(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),vu.call(this)}function E(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function A(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),R(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),a=e.corkedRequestsFree;a.entry=r;for(var s=0,h=!0;r;)o[s]=r,r.isBuf||(h=!1),r=r.next,s+=1;o.allBuffers=h,E(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback;if(E(t,e,!1,e.objectMode?1:u.length,u,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function z(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function j(t,e){t._final(function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)})}function R(t,r){var i=z(r);if(i&&(function(t,r){r.prefinished||r.finalCalled||("function"!=typeof t._final||r.destroyed?(r.prefinished=!0,t.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,e.nextTick(j,t,r)))}(t,r),0===r.pendingcb&&(r.finished=!0,t.emit("finish"),r.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return i}Qt(S,vu),k.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===S&&t&&t._writableState instanceof k}})):o=function(t){return t instanceof this},S.prototype.pipe=function(){M(this,new m)},S.prototype.write=function(t,r,i){var n,o=this._writableState,a=!1,s=!o.objectMode&&(n=t,h.isBuffer(n)||n instanceof u);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof r&&(i=r,r=null),s?r="buffer":r||(r=o.defaultEncoding),"function"!=typeof i&&(i=_),o.ending?function(t,r){var i=new b;M(t,i),e.nextTick(r,i)}(this,i):(s||function(t,r,i,n){var o;return null===i?o=new v:"string"==typeof i||r.objectMode||(o=new c("chunk",["string","Buffer"],i)),!o||(M(t,o),e.nextTick(n,o),!1)}(this,o,t,i))&&(o.pendingcb++,a=function(t,e,r,i,n,o){if(!r){var a=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r)),e}(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=e.objectMode?1:i.length;e.length+=s;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else E(t,e,!1,s,i,n,o);return u}(this,o,s,t,r,i)),a},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},S.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new y(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(t,e,r){r(new d("_write()"))},S.prototype._writev=null,S.prototype.end=function(t,r,i){var n=this._writableState;return"function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t&&this.write(t,r),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,r,i){r.ending=!0,R(t,r),i&&(r.finished?e.nextTick(i):t.once("finish",i)),r.ended=!0,t.writable=!1}(this,n,i),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),S.prototype.destroy=Eu.destroy,S.prototype._undestroy=Eu.undestroy,S.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,Ii,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}),h=e(function(t,e){(function(e,r){(function(){"use strict";var i;t.exports=m,m.ReadableState=p,Vi.EventEmitter;var n=function(t,e){return t.listeners(e).length},o=Sa.Buffer,a=r.Uint8Array||function(){},s=Object.create(ja);s.inherits=Qt;var h,f=M({}),c=void 0;c=f&&f.debuglog?f.debuglog("stream"):function(){},s.inherits(m,ka);var d=["error","close","destroy","pause","resume"];function p(t,e){t=t||{};var r=e instanceof(i=i||l({}));this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Ba,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.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=u({}).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function m(t){if(i=i||l({}),!(this instanceof m))return new m(t);this._readableState=new p(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),ka.call(this)}function g(t,e,r,i,n){var s,h=t._readableState;return null===e?(h.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,w(t)}}(t,h)):(n||(s=function(t,e){var r,i;return i=e,o.isBuffer(i)||i instanceof a||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(h,e)),s?t.emit("error",s):h.objectMode||e&&e.length>0?("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),i?h.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):v(t,h,e,!0):h.ended?t.emit("error",new Error("stream.push() after EOF")):(h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?v(t,h,e,!1):k(t,h)):v(t,h,e,!1))):i||(h.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(h)}function v(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&w(t)),k(t,e)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),m.prototype.destroy=Ca.destroy,m.prototype._undestroy=Ca.undestroy,m.prototype._destroy=function(t,e){this.push(null),e(t)},m.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=o.from(t,e),e=""),r=!0),g(this,t,e,!1,r)},m.prototype.unshift=function(t){return g(this,t,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(t){return h||(h=u({}).StringDecoder),this._readableState.decoder=new h(t),this._readableState.encoding=t,this};var b=8388608;function y(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=b?t=b:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function w(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?wa.nextTick(_,t):_(t))}function _(t){c("emit readable"),t.emit("readable"),x(t)}function k(t,e){e.readingMore||(e.readingMore=!0,wa.nextTick(S,t,e))}function S(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(c("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function E(t){c("readable nexttick read 0"),t.read(0)}function A(t,e){e.reading||(c("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),x(t),e.flowing&&!e.reading&&t.read(0)}function x(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function z(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;return t<e.head.data.length?(i=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):i=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,i=1,n=r.data;for(t-=n.length;r=r.next;){var o=r.data,a=t>o.length?o.length:t;if(a===o.length?n+=o:n+=o.slice(0,t),0==(t-=a)){a===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=o.allocUnsafe(t),i=e.head,n=1;for(i.data.copy(r),t-=i.data.length;i=i.next;){var a=i.data,s=t>a.length?a.length:t;if(a.copy(r,r.length-t,0,s),0==(t-=s)){s===a.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=a.slice(s));break}++n}return e.length-=n,r}(t,e),i}(t,e.buffer,e.decoder),r);var r}function j(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,wa.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function B(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}m.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):w(this),null;if(0===(t=y(t,e))&&e.ended)return 0===e.length&&j(this),null;var i,n=e.needReadable;return c("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",n=!0),e.ended||e.reading?c("reading or ended",n=!1):n&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=y(r,e))),null===(i=t>0?z(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==i&&this.emit("data",i),i},m.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,r){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,r);var a=r&&!1===r.end||t===e.stdout||t===e.stderr?g:s;function s(){c("onend"),t.end()}o.endEmitted?wa.nextTick(a):i.once("end",a),t.on("unpipe",function e(r,n){c("onunpipe"),r===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",h),t.removeListener("error",d),t.removeListener("unpipe",e),i.removeListener("end",s),i.removeListener("end",g),i.removeListener("data",f),u=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())});var h=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&n(t,"data")&&(e.flowing=!0,x(t))}}(i);t.on("drain",h);var u=!1,l=!1;function f(e){c("ondata"),l=!1,!1!==t.write(e)||l||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==B(o.pipes,t))&&!u&&(c("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,l=!0),i.pause())}function d(e){c("onerror",e),g(),t.removeListener("error",d),0===n(t,"error")&&t.emit("error",e)}function p(){t.removeListener("finish",m),g()}function m(){c("onfinish"),t.removeListener("close",p),g()}function g(){c("unpipe"),i.unpipe(t)}return i.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener("error",r);t._events&&t._events.error?_a(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on("error",r)}(t,0,d),t.once("close",p),t.once("finish",m),t.emit("pipe",i),o.flowing||(c("pipe resume"),i.resume()),t},m.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,r);return this}var a=B(e.pipes,t);return-1===a?this:(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},m.prototype.on=function(t,e){var r=ka.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&w(this):wa.nextTick(E,this))}return r},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,wa.nextTick(A,t,e))}(this,t)),this},m.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(n){c("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n||(r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause()))}),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<d.length;o++)t.on(d[o],this.emit.bind(this,d[o]));return this._read=function(e){c("wrapped _read",e),i&&(i=!1,t.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=z}).call(this)}).call(this,Ii,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}),u=e(function(t,e){"use strict";var r=Sa.Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.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}};function n(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=s,this.end=h,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=u,this.end=l,e=3;break;default:return this.write=f,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function u(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function c(t){return t&&t.length?this.write(t):""}e.StringDecoder=n,n.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},n.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\ufffd":e},n.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var n=o(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||-2===n?0:(n=o(e[i]))>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||-2===n?0:(n=o(e[i]))>=0?(n>0&&(2===n?n=0:t.lastNeed=n-3),n):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},n.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}),l=e(function(t,e){"use strict";var r=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var i=Object.create(ja);i.inherits=Qt;var n=h({}),o=f({});i.inherits(l,n);for(var a=r(o.prototype),s=0;s<a.length;s++){var u=a[s];l.prototype[u]||(l.prototype[u]=o.prototype[u])}function l(t){if(!(this instanceof l))return new l(t);n.call(this,t),o.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",c)}function c(){this.allowHalfOpen||this._writableState.ended||wa.nextTick(d,this)}function d(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),l.prototype._destroy=function(t,e){this.push(null),this.end(),wa.nextTick(e,t)}}),f=e(function(t,e){(function(e,r,i){(function(){"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(void 0),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=m;var o,a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:wa.nextTick;m.WritableState=p;var s=Object.create(ja);s.inherits=Qt;var h,u={deprecate:Sn},f=Sa.Buffer,c=r.Uint8Array||function(){};function d(){}function p(t,e){o=o||l({}),t=t||{};var r=e instanceof o;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,s=t.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:h,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(wa.nextTick(n,i),wa.nextTick(M,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),M(t,e))}(t,r,i,e,n);else{var o=y(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||b(t,r),i?a(v,t,r,o,n):v(t,r,o,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function m(t){if(o=o||l({}),!(h.call(m,this)||this instanceof o))return new m(t);this._writableState=new p(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),ka.call(this)}function g(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function v(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),M(t,e)}function b(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),a=e.corkedRequestsFree;a.entry=r;for(var s=0,h=!0;r;)o[s]=r,r.isBuf||(h=!1),r=r.next,s+=1;o.allBuffers=h,g(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback;if(g(t,e,!1,e.objectMode?1:u.length,u,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function y(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function w(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),M(t,e)})}function M(t,e){var r=y(e);return r&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,wa.nextTick(w,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}s.inherits(m,ka),p.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(p.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===m&&t&&t._writableState instanceof p}})):h=function(t){return t instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(t,e,r){var i,n=this._writableState,o=!1,a=!n.objectMode&&(i=t,f.isBuffer(i)||i instanceof c);return a&&!f.isBuffer(t)&&(t=function(t){return f.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=d),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),wa.nextTick(e,r)}(this,r):(a||function(t,e,r,i){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),wa.nextTick(i,o),n=!1),n}(this,n,t,r))&&(n.pendingcb++,o=function(t,e,r,i,n,o){if(!r){var a=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=f.from(e,r)),e}(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=e.objectMode?1:i.length;e.length+=s;var h=e.length<e.highWaterMark;if(h||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else g(t,e,!1,s,i,n,o);return h}(this,n,a,t,e,r)),o},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||b(this,t))},m.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(t,e,r){var i=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,M(t,e),r&&(e.finished?wa.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),m.prototype.destroy=Ca.destroy,m.prototype._undestroy=Ca.undestroy,m.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this)}).call(this,Ii,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},c({}).setImmediate)}),c=e(function(t,e){(function(t,r){(function(){var i=Ii.nextTick,n=(Function.prototype.apply,Array.prototype.slice),o={},a=0;function s(t,e){this._id=t,this._clearFn=e}s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},e.setImmediate="function"==typeof t?t:function(t){var r=a++,s=!(arguments.length<2)&&n.call(arguments,1);return o[r]=!0,i(function(){o[r]&&(s?t.apply(null,s):t.call(null),e.clearImmediate(r))}),r},e.clearImmediate="function"==typeof r?r:function(t){delete o[t]}}).call(this)}).call(this,c({}).setImmediate,c({}).clearImmediate)}),d=e(function(t,e){(function(e,r){(function(){"use strict";var i;t.exports=x,x.ReadableState=A,Vi.EventEmitter;var n,o=function(t,e){return t.listeners(e).length},a=w({}).Buffer,s=r.Uint8Array||function(){},h=M({});n=h&&h.debuglog?h.debuglog("stream"):function(){};var u,l,f,c=kn.getHighWaterMark,d=bn.codes,g=d.ERR_INVALID_ARG_TYPE,y=d.ERR_STREAM_PUSH_AFTER_EOF,_=d.ERR_METHOD_NOT_IMPLEMENTED,k=d.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Qt(x,un);var S=vn.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(t,e,r){i=i||b({}),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=c(this,t,"readableHighWaterMark",r),this.buffer=new gn,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.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=v({}).StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function x(t){if(i=i||b({}),!(this instanceof x))return new x(t);var e=this instanceof i;this._readableState=new A(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),un.call(this)}function z(t,e,r,i,o){n("readableAddChunk",e);var h,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(n("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,I(t)))}}(t,u);else if(o||(h=function(t,e){var r,i;return i=e,a.isBuffer(i)||i instanceof s||"string"==typeof e||void 0===e||t.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],e)),r}(u,e)),h)S(t,h);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),i)u.endEmitted?S(t,new k):j(t,u,e,!0);else if(u.ended)S(t,new y);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?j(t,u,e,!1):q(t,u)):j(t,u,e,!1)}else i||(u.reading=!1,q(t,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function j(t,e,r,i){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&T(t)),q(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&t