=128&&g("not-basic"),d.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=p&&g("invalid-input"),((u=(h=t.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:36)>=36||u>y((l-m)/a))&&g("overflow"),m+=u*a,!(u<(c=s<=v?1:s>=v+26?26:s-v));s+=36)a>y(l/(f=36-c))&&g("overflow"),a*=f;v=A(m-o,e=d.length+1,0==o),y(m/e)>l-b&&g("overflow"),b+=y(m/e),m%=e,d.splice(m++,0,b)}return M(d)}function E(t){var e,r,n,i,o,a,s,u,c,f,h,d,p,m,b,w=[];for(d=(t=k(t)).length,e=128,r=0,o=72,a=0;a=e&&hy((l-r)/(p=n+1))&&g("overflow"),r+=(s-e)*p,e=s,a=0;al&&g("overflow"),h==e){for(u=r,c=36;!(u<(f=c<=o?1:c>=o+26?26:c-o));c+=36)b=u-f,m=36-f,w.push(v(S(f+b%m,0))),u=y(b/m);w.push(v(S(u,0))),o=A(r,p,n==i),r=0,++n}++r,++e}return w.join("")}if(f={version:"1.4.1",ucs2:{decode:k,encode:M},decode:x,encode:E,toASCII:function(t){return _(t,(function(t){return p.test(t)?"xn--"+E(t):t}))},toUnicode:function(t){return _(t,(function(t){return d.test(t)?x(t.slice(4).toLowerCase()):t}))}},"object"==(0,o.default)(r(77))&&r(77))void 0===(i=function(){return f}.call(e,r,e,t))||(t.exports=i);else if(s&&u)if(t.exports==s)u.exports=f;else for(h in f)f.hasOwnProperty(h)&&(s[h]=f[h]);else a.punycode=f}(void 0)}).call(this,r(18)(t),r(12))},function(t,e,r){"use strict";var n;try{n=r(241)}catch(t){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var i=n.WebSocket||n.MozWebSocket,o=r(242);function a(t,e){return e?new i(t,e):new i(t)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(t){Object.defineProperty(a,t,{get:function(){return i[t]}})})),t.exports={w3cwebsocket:i?a:null,version:o}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(245));var n=r(81);e.XMLHttpRequestEventTarget=n.XMLHttpRequestEventTarget},function(t,e,r){"use strict";(function(t){e.fetch=s(t.fetch)&&s(t.ReadableStream),e.writableStream=s(t.WritableStream),e.abortController=s(t.AbortController),e.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),e.blobConstructor=!0}catch(t){}var r;function n(){if(void 0!==r)return r;if(t.XMLHttpRequest){r=new t.XMLHttpRequest;try{r.open("GET",t.XDomainRequest?"/":"https://example.com")}catch(t){r=null}}else r=null;return r}function i(t){var e=n();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch(t){}return!1}var o=void 0!==t.ArrayBuffer,a=o&&s(t.ArrayBuffer.prototype.slice);function s(t){return"function"==typeof t}e.arraybuffer=e.fetch||o&&i("arraybuffer"),e.msstream=!e.fetch&&a&&i("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&o&&i("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||!!n()&&s(n().overrideMimeType),e.vbArray=s(t.VBArray),r=null}).call(this,r(12))},function(t,e,r){"use strict";(function(t,n,i){var o=r(120),a=r(3),s=r(122),u=e.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=e.IncomingMessage=function(e,r,a,u){var c=this;if(s.Readable.call(c),c._mode=a,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",(function(){t.nextTick((function(){c.emit("close")}))})),"fetch"===a){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach((function(t,e){c.headers[e.toLowerCase()]=t,c.rawHeaders.push(e,t)})),o.writableStream){var f=new WritableStream({write:function(t){return new Promise((function(e,r){c._destroyed?r():c.push(new i(t))?e():c._resumeFetch=e}))},close:function(){n.clearTimeout(u),c._destroyed||c.push(null)},abort:function(t){c._destroyed||c.emit("error",t)}});try{return void r.body.pipeTo(f).catch((function(t){n.clearTimeout(u),c._destroyed||c.emit("error",t)}))}catch(t){}}var h=r.body.getReader();!function t(){h.read().then((function(e){if(!c._destroyed){if(e.done)return n.clearTimeout(u),void c.push(null);c.push(new i(e.value)),t()}})).catch((function(t){n.clearTimeout(u),c._destroyed||c.emit("error",t)}))}()}else{if(c._xhr=e,c._pos=0,c.url=e.responseURL,c.statusCode=e.status,c.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(t){var e=t.match(/^([^:]+):\s*(.*)/);if(e){var r=e[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(e[2])):void 0!==c.headers[r]?c.headers[r]+=", "+e[2]:c.headers[r]=e[2],c.rawHeaders.push(e[1],e[2])}})),c._charset="x-user-defined",!o.overrideMimeType){var l=c.rawHeaders["mime-type"];if(l){var d=l.match(/;\s*charset=([^;])(;|$)/);d&&(c._charset=d[1].toLowerCase())}c._charset||(c._charset="utf-8")}}};a(c,s.Readable),c.prototype._read=function(){var t=this._resumeFetch;t&&(this._resumeFetch=null,t())},c.prototype._onXHRProgress=function(){var t=this,e=t._xhr,r=null;switch(t._mode){case"text:vbarray":if(e.readyState!==u.DONE)break;try{r=new n.VBArray(e.responseBody).toArray()}catch(t){}if(null!==r){t.push(new i(r));break}case"text":try{r=e.responseText}catch(e){t._mode="text:vbarray";break}if(r.length>t._pos){var o=r.substr(t._pos);if("x-user-defined"===t._charset){for(var a=new i(o.length),s=0;st._pos&&(t.push(new i(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){t.push(null)},c.readAsArrayBuffer(r)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&t.push(null)}}).call(this,r(13),r(12),r(1).Buffer)},function(t,e,r){"use strict";(e=t.exports=r(123)).Stream=e,e.Readable=e,e.Writable=r(126),e.Duplex=r(40),e.Transform=r(127),e.PassThrough=r(252)},function(t,e,r){"use strict";(function(e,n){var i=r(29);t.exports=g;var o,a=r(74);g.ReadableState=v;r(34).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(124),c=r(4).Buffer,f=e.Uint8Array||function(){};var h=Object.create(r(26));h.inherits=r(3);var l=r(247),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,m=r(248),b=r(125);h.inherits(g,u);var y=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var n=e instanceof(o=o||r(40));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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&&(p||(p=r(35).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function g(t){if(o=o||r(40),!(this instanceof g))return new g(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;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,M(t)}(t,a)):(i||(o=function(t,e){var r;n=e,c.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?_(t,a,e,!1):A(t,a)):_(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(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 M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(S,t):S(t))}function S(t){d("emit readable"),t.emit("readable"),C(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=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 n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):M(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&T(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&T(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var r=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,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?f:g;function c(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",y),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",b),t.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",g),r.removeListener("data",m),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function f(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",c);var h=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,C(t))}}(r);t.on("drain",h);var l=!1;var p=!1;function m(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==P(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function b(e){d("onerror",e),g(),t.removeListener("error",b),0===s(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",v),g()}function v(){d("onfinish"),t.removeListener("close",y),g()}function g(){d("unpipe"),r.unpipe(t)}return r.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",y),t.once("finish",v),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},g.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||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?n:o.nextTick;v.WritableState=y;var c=Object.create(r(26));c.inherits=r(3);var f={deprecate:r(79)},h=r(124),l=r(4).Buffer,d=i.Uint8Array||function(){};var p,m=r(125);function b(){}function y(t,e){s=s||r(40),t=t||{};var n=e instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,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 h=!1===t.decodeStrings;this.decodeStrings=!h,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,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(S,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),S(t,e))}(t,r,n,e,i);else{var a=k(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),n?u(w,t,r,a,i):w(t,r,a,i)}}(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 a(this)}function v(t){if(s=s||r(40),!(p.call(v,this)||this instanceof s))return new v(t);this._writableState=new y(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)),h.call(this)}function g(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function w(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),S(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,g(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,h=r.callback;if(g(t,e,!1,e.objectMode?1:c.length,c,f,h),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),S(t,e)}))}function S(t,e){var r=k(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(M,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}c.inherits(v,h),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.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]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof y)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,l.isBuffer(n)||n instanceof d);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=l.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,S(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(13),r(78).setImmediate,r(12))},function(t,e,r){"use strict";t.exports=a;var n=r(40),i=Object.create(r(26));function o(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length0&&(i=r),r=t[c++]);)switch(D++,"\n"===r?(H++,z=0):z++,U){case l:if("{"===r)U=p;else if("["===r)U=b;else if(!W(r))return K("Non-whitespace before {[.");continue;case g:case p:if(W(r))continue;if(U===g)N.push(w);else{if("}"===r){s({}),u(),U=N.pop()||d;continue}N.push(m)}if('"'!==r)return K('Malformed object key should start with " ');U=v;continue;case w:case m:if(W(r))continue;if(":"===r)U===m?(N.push(m),void 0!==o&&(s({}),a(o),o=void 0),q++):void 0!==o&&(a(o),o=void 0),U=d;else if("}"===r)void 0!==o&&(s(o),u(),o=void 0),u(),q--,U=N.pop()||d;else{if(","!==r)return K("Bad object");U===m&&N.push(m),void 0!==o&&(s(o),u(),o=void 0),U=g}continue;case b:case d:if(W(r))continue;if(U===b){if(s([]),q++,U=d,"]"===r){u(),q--,U=N.pop()||d;continue}N.push(y)}if('"'===r)U=v;else if("{"===r)U=p;else if("["===r)U=b;else if("t"===r)U=_;else if("f"===r)U=S;else if("n"===r)U=O;else if("-"===r)P+=r;else if("0"===r)P+=r,U=20;else{if(-1==="123456789".indexOf(r))return K("Bad value");P+=r,U=20}continue;case y:if(","===r)N.push(y),void 0!==o&&(s(o),u(),o=void 0),U=d;else{if("]"!==r){if(W(r))continue;return K("Bad array")}void 0!==o&&(s(o),u(),o=void 0),u(),q--,U=N.pop()||d}continue;case v:void 0===o&&(o="");var h=c-1;t:for(;;){for(;F>0;)if(L+=r,r=t.charAt(c++),4===F?(o+=String.fromCharCode(parseInt(L,16)),F=0,h=c-1):F++,!r)break t;if('"'===r&&!j){U=N.pop()||d,o+=t.substring(h,c-1);break}if(!("\\"!==r||j||(j=!0,o+=t.substring(h,c-1),r=t.charAt(c++))))break;if(j){if(j=!1,"n"===r?o+="\n":"r"===r?o+="\r":"t"===r?o+="\t":"f"===r?o+="\f":"b"===r?o+="\b":"u"===r?(F=1,L=""):o+=r,r=t.charAt(c++),h=c-1,r)continue;break}f.lastIndex=c;var V=f.exec(t);if(!V){c=t.length+1,o+=t.substring(h,c-1);break}if(c=V.index+1,!(r=t.charAt(V.index))){o+=t.substring(h,c-1);break}}continue;case _:if(!r)continue;if("r"!==r)return K("Invalid true started with t"+r);U=k;continue;case k:if(!r)continue;if("u"!==r)return K("Invalid true started with tr"+r);U=M;continue;case M:if(!r)continue;if("e"!==r)return K("Invalid true started with tru"+r);s(!0),u(),U=N.pop()||d;continue;case S:if(!r)continue;if("a"!==r)return K("Invalid false started with f"+r);U=A;continue;case A:if(!r)continue;if("l"!==r)return K("Invalid false started with fa"+r);U=x;continue;case x:if(!r)continue;if("s"!==r)return K("Invalid false started with fal"+r);U=E;continue;case E:if(!r)continue;if("e"!==r)return K("Invalid false started with fals"+r);s(!1),u(),U=N.pop()||d;continue;case O:if(!r)continue;if("u"!==r)return K("Invalid null started with n"+r);U=C;continue;case C:if(!r)continue;if("l"!==r)return K("Invalid null started with nu"+r);U=R;continue;case R:if(!r)continue;if("l"!==r)return K("Invalid null started with nul"+r);s(null),u(),U=N.pop()||d;continue;case T:if("."!==r)return K("Leading zero not followed by .");P+=r,U=20;continue;case 20:if(-1!=="0123456789".indexOf(r))P+=r;else if("."===r){if(-1!==P.indexOf("."))return K("Invalid number has two dots");P+=r}else if("e"===r||"E"===r){if(-1!==P.indexOf("e")||-1!==P.indexOf("E"))return K("Invalid number has two exponential");P+=r}else if("+"===r||"-"===r){if("e"!==i&&"E"!==i)return K("Invalid symbol in number");P+=r}else P&&(s(parseFloat(P)),u(),P=""),c--,U=N.pop()||d;continue;default:return K("Unknown state: "+U)}D>=B&&(n=0,void 0!==o&&o.length>65536&&(K("Max buffer length exceeded: textNode"),n=Math.max(n,o.length)),P.length>65536&&(K("Max buffer length exceeded: numberNode"),n=Math.max(n,P.length)),B=65536-n+D)}})),t(n.n).on((function(){if(U===l)return s({}),u(),void(I=!0);U===d&&0===q||K("Unexpected end"),void 0!==o&&(s(o),u(),o=void 0),I=!0}))}},function(t,e,r){r.d(e,"a",(function(){return u})),r.d(e,"b",(function(){return c}));var n=r(19),i=r(3),o=r(2),a=r(20),s=r(0);function u(){return new XMLHttpRequest}function c(t,e,r,u,c,f,h){var l=t(i.m).emit,d=t(i.b).emit,p=0,m=!0;function b(){if("2"===String(e.status)[0]){var t=e.responseText,r=(" "+t.substr(p)).substr(1);r&&l(r),p=Object(o.e)(t)}}function y(e){try{m&&t(i.c).emit(e.status,Object(a.a)(e.getAllResponseHeaders())),m=!1}catch(t){}}t(i.a).on((function(){e.onreadystatechange=null,e.abort()})),"onprogress"in e&&(e.onprogress=b),e.onreadystatechange=function(){switch(e.readyState){case 2:case 3:return y(e);case 4:y(e),"2"===String(e.status)[0]?(b(),t(i.n).emit()):d(Object(i.o)(e.status,e.responseText))}};try{for(var v in e.open(r,u,!0),f)e.setRequestHeader(v,f[v]);Object(n.a)(window.location,Object(n.b)(u))||e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.withCredentials=h,e.send(c)}catch(t){window.setTimeout(Object(s.j)(d,Object(i.o)(void 0,void 0,t)),0)}}},function(t,e,r){function n(t,e){function r(e){return String(e.port||{"http:":80,"https:":443}[e.protocol||t.protocol])}return!!(e.protocol&&e.protocol!==t.protocol||e.host&&e.host!==t.host||e.host&&r(e)!==r(t))}function i(t){var e=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(t)||[];return{protocol:e[1]||"",host:e[2]||"",port:e[3]||""}}r.d(e,"a",(function(){return n})),r.d(e,"b",(function(){return i}))},function(t,e,r){function n(t){var e={};return t&&t.split("\r\n").forEach((function(t){var r=t.indexOf(": ");e[t.substring(0,r)]=t.substring(r+2)})),e}r.d(e,"a",(function(){return n}))}]).default},"object"===(0,s.default)(e)&&"object"===(0,s.default)(t)?t.exports=a():(i=[],void 0===(o="function"==typeof(n=a)?n.apply(e,i):n)||(t.exports=o))}).call(this,r(18)(t))},function(t,e,r){"use strict";var n=r(39),i=function(t){var e,r,i=new Promise((function(){e=arguments[0],r=arguments[1]}));if(t)return{resolve:e,reject:r,eventEmitter:i};var o=new n;return i._events=o._events,i.emit=o.emit,i.on=o.on,i.once=o.once,i.off=o.off,i.listeners=o.listeners,i.addListener=o.addListener,i.removeListener=o.removeListener,i.removeAllListeners=o.removeAllListeners,{resolve:e,reject:r,eventEmitter:i}};i.resolve=function(t){var e=i(!0);return e.resolve(t),e.eventEmitter},t.exports=i},function(t,e,r){"use strict";var n=r(264);Object.defineProperty(e,"__esModule",{value:!0}),e.computeAddress=g,e.recoverAddress=w,e.serialize=function(t,e){(0,c.checkProperties)(t,v);var r=[];y.forEach((function(e){var n=t[e.name]||[],i={};e.numeric&&(i.hexPad="left"),n=(0,a.arrayify)((0,a.hexlify)(n,i)),e.length&&n.length!==e.length&&n.length>0&&p.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),e.maxLength&&(n=(0,a.stripZeros)(n)).length>e.maxLength&&p.throwArgumentError("invalid length for "+e.name,"transaction:"+e.name,n),r.push((0,a.hexlify)(n))}));var n=0;null!=t.chainId?"number"!=typeof(n=t.chainId)&&p.throwArgumentError("invalid transaction.chainId","transaction",t):e&&!(0,a.isBytesLike)(e)&&e.v>28&&(n=Math.floor((e.v-35)/2));0!==n&&(r.push((0,a.hexlify)(n)),r.push("0x"),r.push("0x"));if(!e)return f.encode(r);var i=(0,a.splitSignature)(e),o=27+i.recoveryParam;0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==o&&p.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e);return r.push((0,a.hexlify)(o)),r.push((0,a.stripZeros)((0,a.arrayify)(i.r))),r.push((0,a.stripZeros)((0,a.arrayify)(i.s))),f.encode(r)},e.parse=function(t){var e=f.decode(t);9!==e.length&&6!==e.length&&p.throwArgumentError("invalid raw transaction","rawTransaction",t);var r={nonce:b(e[0]).toNumber(),gasPrice:b(e[1]),gasLimit:b(e[2]),to:m(e[3]),value:b(e[4]),data:e[5],chainId:0};if(6===e.length)return r;try{r.v=o.BigNumber.from(e[6]).toNumber()}catch(t){return console.log(t),r}if(r.r=(0,a.hexZeroPad)(e[7],32),r.s=(0,a.hexZeroPad)(e[8],32),o.BigNumber.from(r.r).isZero()&&o.BigNumber.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=e.slice(0,6);0!==r.chainId&&(i.push((0,a.hexlify)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var s=(0,u.keccak256)(f.encode(i));try{r.from=w(s,{r:(0,a.hexlify)(r.r),s:(0,a.hexlify)(r.s),recoveryParam:n})}catch(t){console.log(t)}r.hash=(0,u.keccak256)(t)}return r};var i=r(42),o=r(20),a=r(14),s=r(62),u=r(30),c=r(23),f=n(r(134)),h=r(276),l=r(15),d=r(285),p=new l.Logger(d.version);function m(t){return"0x"===t?null:(0,i.getAddress)(t)}function b(t){return"0x"===t?s.Zero:o.BigNumber.from(t)}var y=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],v={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function g(t){var e=(0,h.computePublicKey)(t);return(0,i.getAddress)((0,a.hexDataSlice)((0,u.keccak256)((0,a.hexDataSlice)(e,1)),12))}function w(t,e){return g((0,h.recoverPublicKey)((0,a.arrayify)(t),e))}},function(t,e,r){"use strict";var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.isBigNumberish=function(t){return null!=t&&(p.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||(0,s.isHexString)(t)||"bigint"==typeof t||(0,s.isBytes)(t))},e._base36To16=function(t){return new f(t,36).toString(16)},e._base16To36=function(t){return new f(t,16).toString(36)},e.BigNumber=void 0;var i=n(r(5)),o=n(r(6)),a=n(r(7)),s=r(14),u=r(15),c=r(133),f=a.default.BN,h=new u.Logger(c.version),l={};var d=!1,p=function(){function t(e,r){(0,i.default)(this,t),h.checkNew(this instanceof t?this.constructor:void 0,t),e!==l&&h.throwError("cannot call constructor directly; use BigNumber.from",u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}return(0,o.default)(t,[{key:"fromTwos",value:function(t){return b(y(this).fromTwos(t))}},{key:"toTwos",value:function(t){return b(y(this).toTwos(t))}},{key:"abs",value:function(){return"-"===this._hex[0]?t.from(this._hex.substring(1)):this}},{key:"add",value:function(t){return b(y(this).add(y(t)))}},{key:"sub",value:function(t){return b(y(this).sub(y(t)))}},{key:"div",value:function(e){return t.from(e).isZero()&&v("division by zero","div"),b(y(this).div(y(e)))}},{key:"mul",value:function(t){return b(y(this).mul(y(t)))}},{key:"mod",value:function(t){var e=y(t);return e.isNeg()&&v("cannot modulo negative values","mod"),b(y(this).umod(e))}},{key:"pow",value:function(t){var e=y(t);return e.isNeg()&&v("cannot raise to negative values","pow"),b(y(this).pow(e))}},{key:"and",value:function(t){var e=y(t);return(this.isNegative()||e.isNeg())&&v("cannot 'and' negative values","and"),b(y(this).and(e))}},{key:"or",value:function(t){var e=y(t);return(this.isNegative()||e.isNeg())&&v("cannot 'or' negative values","or"),b(y(this).or(e))}},{key:"xor",value:function(t){var e=y(t);return(this.isNegative()||e.isNeg())&&v("cannot 'xor' negative values","xor"),b(y(this).xor(e))}},{key:"mask",value:function(t){return(this.isNegative()||t<0)&&v("cannot mask negative values","mask"),b(y(this).maskn(t))}},{key:"shl",value:function(t){return(this.isNegative()||t<0)&&v("cannot shift negative values","shl"),b(y(this).shln(t))}},{key:"shr",value:function(t){return(this.isNegative()||t<0)&&v("cannot shift negative values","shr"),b(y(this).shrn(t))}},{key:"eq",value:function(t){return y(this).eq(y(t))}},{key:"lt",value:function(t){return y(this).lt(y(t))}},{key:"lte",value:function(t){return y(this).lte(y(t))}},{key:"gt",value:function(t){return y(this).gt(y(t))}},{key:"gte",value:function(t){return y(this).gte(y(t))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return y(this).isZero()}},{key:"toNumber",value:function(){try{return y(this).toNumber()}catch(t){v("overflow","toNumber",this.toString())}return null}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?d||(d=!0,h.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?h.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",u.Logger.errors.UNEXPECTED_ARGUMENT,{}):h.throwError("BigNumber.toString does not accept parameters",u.Logger.errors.UNEXPECTED_ARGUMENT,{})),y(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(t){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(e){if(e instanceof t)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new t(l,m(e)):e.match(/^-?[0-9]+$/)?new t(l,m(new f(e))):h.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&v("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&v("overflow","BigNumber.from",e),t.from(String(e));var r=e;if("bigint"==typeof r)return t.from(r.toString());if((0,s.isBytes)(r))return t.from((0,s.hexlify)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return t.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&((0,s.isHexString)(i)||"-"===i[0]&&(0,s.isHexString)(i.substring(1))))return t.from(i)}return h.throwArgumentError("invalid BigNumber value","value",e)}},{key:"isBigNumber",value:function(t){return!(!t||!t._isBigNumber)}}]),t}();function m(t){if("string"!=typeof t)return m(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&h.throwArgumentError("invalid hex","value",t),"0x00"===(t=m(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function b(t){return p.from(m(t))}function y(t){var e=p.from(t).toHexString();return"-"===e[0]?new f("-"+e.substring(3),16):new f(e.substring(2),16)}function v(t,e,r){var n={fault:t,operation:e};return null!=r&&(n.value=r),h.throwError(t,u.Logger.errors.NUMERIC_FAULT,n)}e.BigNumber=p},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=void 0;e.version="bignumber/5.0.15"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encode=function(t){return(0,n.hexlify)(function t(e){if(Array.isArray(e)){var r=[];if(e.forEach((function(e){r=r.concat(t(e))})),r.length<=55)return r.unshift(192+r.length),r;var i=s(r.length);return i.unshift(247+i.length),i.concat(r)}(0,n.isBytesLike)(e)||a.throwArgumentError("RLP object must be BytesLike","object",e);var o=Array.prototype.slice.call((0,n.arrayify)(e));if(1===o.length&&o[0]<=127)return o;if(o.length<=55)return o.unshift(128+o.length),o;var u=s(o.length);return u.unshift(183+u.length),u.concat(o)}(t))},e.decode=function(t){var e=(0,n.arrayify)(t),r=f(e,0);r.consumed!==e.length&&a.throwArgumentError("invalid rlp data","data",t);return r.result};var n=r(14),i=r(15),o=r(269),a=new i.Logger(o.version);function s(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function u(t,e,r){for(var n=0,i=0;ie+1+n&&a.throwError("child data too short",i.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function f(t,e){if(0===t.length&&a.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),t[e]>=248){var r=t[e]-247;e+1+r>t.length&&a.throwError("data short segment too short",i.Logger.errors.BUFFER_OVERRUN,{});var o=u(t,e+1,r);return e+1+r+o>t.length&&a.throwError("data long segment too short",i.Logger.errors.BUFFER_OVERRUN,{}),c(t,e,e+1+r,r+o)}if(t[e]>=192){var s=t[e]-192;return e+1+s>t.length&&a.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),c(t,e,e+1,s)}if(t[e]>=184){var f=t[e]-183;e+1+f>t.length&&a.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{});var h=u(t,e+1,f);return e+1+f+h>t.length&&a.throwError("data array too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+f+h,result:(0,n.hexlify)(t.slice(e+1+f,e+1+f+h))}}if(t[e]>=128){var l=t[e]-128;return e+1+l>t.length&&a.throwError("data too short",i.Logger.errors.BUFFER_OVERRUN,{}),{consumed:1+l,result:(0,n.hexlify)(t.slice(e+1,e+1+l))}}return{consumed:1,result:(0,n.hexlify)(t[e])}}},function(t,e,r){"use strict";var n=r(27).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?a(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=a,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},function(t,e,r){"use strict";var n=r(27),i=r(48),o=r(135),a=r(21),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,h=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,b=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(v,b),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t){var e="";t=(t=(t=(t=(t=a.encode(t)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},isHex:v,isHexStrict:y,stripHexPrefix:function(t){return 0!==t&&v(t)?t.replace(/^(-)?0x/i,"$1"):t},leftPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},rightPad:function(t,e,r){var n=/^0x/i.test(t)||"number"==typeof t,i=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},toTwosComplement:function(t){return"0x"+h(t).toTwos(256).toString(16,64)},sha3:w,sha3Raw:function(t){return null===(t=w(t))?g:t}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n={messageId:0,toPayload:function(t,e){if(!t)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(e)+'"!');return n.messageId++,{jsonrpc:"2.0",id:n.messageId,method:t,params:e||[]}},isValidResponse:function(t){return Array.isArray(t)?t.every(e):e(t);function e(t){return!(!t||t.error||"2.0"!==t.jsonrpc||"number"!=typeof t.id&&"string"!=typeof t.id||void 0===t.result)}},toBatchPayload:function(t){return t.map((function(t){return n.toPayload(t.method,t.params)}))}};t.exports=n},function(t,e,r){"use strict";var n=r(0),i=n(r(41)),o=n(r(60)),a=r(9),s=r(17).errors,u=r(17).formatters,c=r(37),f=r(65),h=r(143).subscriptions,l=r(131),d=function(t){if(!t.call||!t.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter,this.transformPayload=t.transformPayload,this.extraFormatters=t.extraFormatters,this.abiCoder=t.abiCoder,this.requestManager=t.requestManager,this.accounts=t.accounts,this.defaultBlock=t.defaultBlock||"latest",this.defaultAccount=t.defaultAccount||null,this.transactionBlockTimeout=t.transactionBlockTimeout||50,this.transactionConfirmationBlocks=t.transactionConfirmationBlocks||24,this.transactionPollingTimeout=t.transactionPollingTimeout||750,this.defaultCommon=t.defaultCommon,this.defaultChain=t.defaultChain,this.defaultHardfork=t.defaultHardfork,this.handleRevert=t.handleRevert};d.prototype.setRequestManager=function(t,e){this.requestManager=t,e&&(this.accounts=e)},d.prototype.createFunction=function(t,e){var r=this.buildCall();return r.call=this.call,this.setRequestManager(t||this.requestManager,e||this.accounts),r},d.prototype.attachToObject=function(t){var e=this.buildCall();e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},d.prototype.getCall=function(t){return a.isFunction(this.call)?this.call(t):this.call},d.prototype.extractCallback=function(t){if(a.isFunction(t[t.length-1]))return t.pop()},d.prototype.validateArgs=function(t){if(t.length!==this.params)throw s.InvalidNumberOfParams(t.length,this.params,this.name)},d.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map((function(r,n){return r?r.call(e,t[n]):t[n]})):t},d.prototype.formatOutput=function(t){var e=this;return a.isArray(t)?t.map((function(t){return e.outputFormatter&&t?e.outputFormatter(t):t})):this.outputFormatter&&t?this.outputFormatter(t):t},d.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);this.validateArgs(n);var i={method:e,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},d.prototype._confirmTransaction=function(t,e,r){var n=this,p=!1,m=!0,b=0,y=0,v=null,g=null,w=a.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,_=a.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,k=_&&r.params[0].data.length>2,M=[new d({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[u.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:u.outputBlockFormatter}),new d({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:u.outputTransactionReceiptFormatter}),new d({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[u.inputAddressFormatter,u.inputDefaultBlockNumberFormatter]}),new d({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:u.outputTransactionFormatter}),new h({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:u.outputBlockFormatter}}})],S={};a.each(M,(function(t){t.attachToObject(S),t.requestManager=n.requestManager}));var A=function(a,h,d,M,A){if(!d)return A||(A={unsubscribe:function(){clearInterval(v)}}),(a?f.resolve(a):S.getTransactionReceipt(e)).catch((function(e){A.unsubscribe(),p=!0,c._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)})).then(function(){var e=(0,o.default)(i.default.mark((function e(r){var o,s,u;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&r.blockHash){e.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(n.extraFormatters&&n.extraFormatters.receiptFormatter&&(r=n.extraFormatters.receiptFormatter(r)),!(t.eventEmitter.listeners("confirmation").length>0)){e.next=28;break}if(void 0!==a&&0===y){e.next=25;break}return e.next=7,S.getBlockByNumber("latest");case 7:if(s=e.sent,u=s?s.hash:null,!h){e.next=24;break}if(!g){e.next=17;break}return e.next=13,S.getBlockByNumber(g.number+1);case 13:(o=e.sent)&&(g=o,t.eventEmitter.emit("confirmation",y,r,u)),e.next=22;break;case 17:return e.next=19,S.getBlockByNumber(r.blockNumber);case 19:o=e.sent,g=o,t.eventEmitter.emit("confirmation",y,r,u);case 22:e.next=25;break;case 24:t.eventEmitter.emit("confirmation",y,r,u);case 25:(h&&o||!h)&&y++,m=!1,y===n.transactionConfirmationBlocks+1&&(A.unsubscribe(),t.eventEmitter.removeAllListeners());case 28:return e.abrupt("return",r);case 29:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=(0,o.default)(i.default.mark((function e(r){var o;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_||p){e.next=19;break}if(r.contractAddress){e.next=5;break}return m&&(A.unsubscribe(),p=!0),c._fireError(s.NoContractAddressFoundError(r),t.eventEmitter,t.reject,null,r),e.abrupt("return");case 5:return e.prev=5,e.next=8,S.getCode(r.contractAddress);case 8:o=e.sent,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:if(o){e.next=15;break}return e.abrupt("return");case 15:!0===r.status&&k||o.length>2?(t.eventEmitter.emit("receipt",r),n.extraFormatters&&n.extraFormatters.contractDeployFormatter?t.resolve(n.extraFormatters.contractDeployFormatter(r)):t.resolve(r),m&&t.eventEmitter.removeAllListeners()):c._fireError(s.ContractCodeNotStoredError(r),t.eventEmitter,t.reject,null,r),m&&A.unsubscribe(),p=!0;case 19:return e.abrupt("return",r);case 20:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(t){return e.apply(this,arguments)}}()).then(function(){var e=(0,o.default)(i.default.mark((function e(o){var a,f,h,d;return i.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_||p){e.next=35;break}if(o.outOfGas||w&&w===o.gasUsed||!0!==o.status&&"0x1"!==o.status&&void 0!==o.status){e.next=7;break}t.eventEmitter.emit("receipt",o),t.resolve(o),m&&t.eventEmitter.removeAllListeners(),e.next=33;break;case 7:if(JSON.stringify(o,null,2),!1!==o.status&&"0x0"!==o.status){e.next=32;break}if(e.prev=9,a=null,!n.handleRevert||"eth_sendTransaction"!==n.call&&"eth_sendRawTransaction"!==n.call){e.next=24;break}return f=r.params[0],"eth_sendRawTransaction"===n.call&&(h=r.params[0],d=l.parse(h),f=u.inputTransactionFormatter({data:d.data,to:d.to,from:d.from,gas:d.gasLimit.toHexString(),gasPrice:d.gasPrice.toHexString(),value:d.value.toHexString()})),e.next=16,n.getRevertReason(f,o.blockNumber);case 16:if(!(a=e.sent)){e.next=21;break}c._fireError(s.TransactionRevertInstructionError(a.reason,a.signature,o),t.eventEmitter,t.reject,null,o),e.next=22;break;case 21:throw!1;case 22:e.next=25;break;case 24:throw!1;case 25:e.next=30;break;case 27:e.prev=27,e.t0=e.catch(9),c._fireError(s.TransactionRevertedWithoutReasonError(o),t.eventEmitter,t.reject,null,o);case 30:e.next=33;break;case 32:c._fireError(s.TransactionOutOfGasError(o),t.eventEmitter,t.reject,null,o);case 33:m&&A.unsubscribe(),p=!0;case 35:case"end":return e.stop()}}),e,null,[[9,27]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(){b++,h?b-1>=n.transactionPollingTimeout&&(A.unsubscribe(),p=!0,c._fireError(s.TransactionError("Transaction was not mined within "+n.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):b-1>=n.transactionBlockTimeout&&(A.unsubscribe(),p=!0,c._fireError(s.TransactionError("Transaction was not mined within "+n.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))}));A.unsubscribe(),p=!0,c._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:d},t.eventEmitter,t.reject)},x=function(t){var e=function(){v=setInterval(A.bind(null,t,!0),1e3)};this.requestManager.provider.on?S.subscribe("newBlockHeaders",(function(r,n,i){r||!n?e():A(t,!1,r,0,i)})):e()}.bind(this);S.getTransactionReceipt(e).then((function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&x(e),A(e,!1)):p||x()})).catch((function(){p||x()}))};var p=function(t,e){return a.isNumber(t)?e.wallet[t]:a.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};d.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r="eth_call"===t.call,n=function(){var n=f(!e),i=t.toPayload(Array.prototype.slice.call(arguments)),o=function(o,a){var u;if(t.handleRevert&&r&&t.abiCoder&&(!o&&t.isRevertReasonString(a)?u=a.substring(10):o&&o.data&&(u=o.data.substring(10)),u)){var f=t.abiCoder.decodeParameter("string","0x"+u);return void c._fireError(s.RevertInstructionError(f,"Error(String)"),n.eventEmitter,n.reject,i.callback,{reason:f,signature:"Error(String)"})}try{a=t.formatOutput(a)}catch(t){o=t}if(a instanceof Error&&(o=a),o)return o.error&&(o=o.error),c._fireError(o,n.eventEmitter,n.reject,i.callback);i.callback&&i.callback(null,a),e?(n.eventEmitter.emit("transactionHash",a),t._confirmTransaction(n,a,i)):o||n.resolve(a)},u=function(e){var r=a.extend({},i,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,o)},h=function(t,e){var r;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var i=t.params[0];if((r=p(a.isObject(i)?i.from:null,e.accounts))&&r.privateKey){var s=a.omit(i,"from");return e.defaultChain&&!s.chain&&(s.chain=e.defaultChain),e.defaultHardfork&&!s.hardfork&&(s.hardfork=e.defaultHardfork),e.defaultCommon&&!s.common&&(s.common=e.defaultCommon),void e.accounts.signTransaction(s,r.privateKey).then(u).catch((function(t){if(a.isFunction(n.eventEmitter.listeners)&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",t)}catch(t){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(t)}))}}else if("eth_sign"===t.method){var c=t.params[1];if((r=p(t.params[0],e.accounts))&&r.privateKey){var f=e.accounts.sign(c,r.privateKey);return t.callback&&t.callback(null,f.signature),void n.resolve(f.signature)}}return e.requestManager.send(t,o)};if(e&&a.isObject(i.params[0])&&void 0===i.params[0].gasPrice){var l=new d({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager);l((function(r,o){o&&(i.params[0].gasPrice=o),e&&setTimeout((function(){n.eventEmitter.emit("sending",i)}),0),h(i,t)}))}else e&&setTimeout((function(){n.eventEmitter.emit("sending",i)}),0),h(i,t);return e&&setTimeout((function(){n.eventEmitter.emit("sent",i)}),0),n.eventEmitter};return n.method=t,n.request=this.request.bind(this),n},d.prototype.getRevertReason=function(t,e){var r=this;return new Promise((function(n,i){new d({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(t,c.numberToHex(e)).then((function(){n(!1)})).catch((function(t){t.reason?n({reason:t.reason,signature:t.signature}):i(t)}))}))},d.prototype.isRevertReasonString=function(t){return a.isString(t)&&(t.length-2)/2%32==4&&"0x08c379a0"===t.substring(0,10)},d.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=d},function(t,e,r){"use strict";var n=r(305),i=function(t){this.name=t.name,this.type=t.type,this.subscriptions=t.subscriptions||{},this.requestManager=null};i.prototype.setRequestManager=function(t){this.requestManager=t},i.prototype.attachToObject=function(t){var e=this.buildCall(),r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},i.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new n({subscription:t.subscriptions[arguments[0]]||{},requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},t.exports={subscriptions:i,subscription:n}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return n.ConstructorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return n.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return n.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return n.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return n.FunctionFragment}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return n.ParamType}}),Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}});var n=r(82),i=r(147),o=r(319)},function(t,e,r){"use strict";function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,n(e,r)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.defaultAbiCoder=e.AbiCoder=void 0;var i=n(r(5)),o=n(r(6)),a=r(14),s=r(23),u=r(15),c=r(49),f=r(24),h=r(307),l=r(148),d=r(309),p=r(149),m=r(311),b=r(312),y=r(313),v=r(314),g=r(318),w=r(82),_=new u.Logger(c.version),k=new RegExp(/^bytes([0-9]*)$/),M=new RegExp(/^(u?int)([0-9]*)$/),S=function(){function t(e){(0,i.default)(this,t),_.checkNew(this instanceof t?this.constructor:void 0,t),(0,s.defineReadOnly)(this,"coerceFunc",e||null)}return(0,o.default)(t,[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new h.AddressCoder(t.name);case"bool":return new d.BooleanCoder(t.name);case"string":return new v.StringCoder(t.name);case"bytes":return new p.BytesCoder(t.name);case"array":return new l.ArrayCoder(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new g.TupleCoder((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new b.NullCoder(t.name)}var r=t.type.match(M);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&_.throwArgumentError("invalid "+r[1]+" bit length","param",t),new y.NumberCoder(n/8,"int"===r[1],t.name)}if(r=t.type.match(k)){var i=parseInt(r[1]);return(0===i||i>32)&&_.throwArgumentError("invalid bytes length","param",t),new m.FixedBytesCoder(i,t.name)}return _.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t,e){return new f.Reader(t,this._getWordSize(),this.coerceFunc,e)}},{key:"_getWriter",value:function(){return new f.Writer(this._getWordSize())}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&_.throwError("types/values length mismatch",u.Logger.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(w.ParamType.from(t))})),i=new g.TupleCoder(n,"_"),o=this._getWriter();return i.encode(o,e),o.data}},{key:"decode",value:function(t,e,r){var n=this,i=t.map((function(t){return n._getCoder(w.ParamType.from(t))}));return new g.TupleCoder(i,"_").decode(this._getReader((0,a.arrayify)(e),r))}}]),t}();e.AbiCoder=S;var A=new S;e.defaultAbiCoder=A},function(t,e,r){"use strict";var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.pack=b,e.unpack=y,e.ArrayCoder=void 0;var i=n(r(5)),o=n(r(6)),a=n(r(10)),s=n(r(11)),u=n(r(8)),c=n(r(2)),f=r(15),h=r(49),l=r(24),d=r(308);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,u.default)(t);if(e){var i=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,s.default)(this,r)}}var m=new f.Logger(h.version);function b(t,e,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===(0,c.default)(r)){var i={};n=e.map((function(t){var e=t.localName;return e||m.throwError("cannot encode object for signature with missing names",f.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]&&m.throwError("cannot encode object for signature with duplicate names",f.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),i[e]=!0,r[e]}))}else m.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&m.throwArgumentError("types/value length mismatch","tuple",r);var o=new l.Writer(t.wordSize),a=new l.Writer(t.wordSize),s=[];e.forEach((function(t,e){var r=n[e];if(t.dynamic){var i=a.length;t.encode(a,r);var u=o.writeUpdatableValue();s.push((function(t){u(t+i)}))}else t.encode(o,r)})),s.forEach((function(t){t(o.length)}));var u=t.appendWriter(o);return u+=t.appendWriter(a)}function y(t,e){var r=[],n=t.subReader(0);e.forEach((function(e){var i=null;if(e.dynamic){var o=t.readValue(),a=n.subReader(o.toNumber());try{i=e.decode(a)}catch(t){if(t.code===f.Logger.errors.BUFFER_OVERRUN)throw t;(i=t).baseType=e.name,i.name=e.localName,i.type=e.type}}else try{i=e.decode(t)}catch(t){if(t.code===f.Logger.errors.BUFFER_OVERRUN)throw t;(i=t).baseType=e.name,i.name=e.localName,i.type=e.type}null!=i&&r.push(i)}));var i=e.reduce((function(t,e){var r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t}),{});e.forEach((function(t,e){var n=t.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[e];o instanceof Error?Object.defineProperty(r,n,{get:function(){throw o}}):r[n]=o}}));for(var o=function(t){var e=r[t];e instanceof Error&&Object.defineProperty(r,t,{get:function(){throw e}})},a=0;a=0?n:"")+"]",u=-1===n||t.dynamic;return(a=e.call(this,"array",s,o,u)).coder=t,a.length=n,a}return(0,o.default)(r,[{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),m.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i=0;i--){var s=n(a[i]);r=n(new t(r+s,"hex"))}}return"0x"+r},e.normalize=o}).call(this,r(1).Buffer)},function(t,e,r){"use strict";(function(e){var n=r(51);function i(t){return parseInt(t.toString("hex"),16)}function o(t){var r=t.toString(16);return r.length%2==1&&(r="0"+r),e.from(r,"hex")}t.exports={numberToBuffer:o,bufferToNumber:i,varintBufferEncode:function(t){return e.from(n.encode(i(t)))},varintBufferDecode:function(t){return o(n.decode(t))},varintEncode:function(t){return e.from(n.encode(t))}}}).call(this,r(1).Buffer)},function(t,e,r){"use strict";var n=r(156);t.exports=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,r){"use strict";t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.multibaseName;if(this.string&&t===this.multibaseName)return this.string;var e=null;if(0===this.version){if("base58btc"!==t)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");e=s.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");e=u.encode(t,this.buffer).toString()}return t===this.multibaseName&&Object.defineProperty(this,"string",{value:e}),e}},{key:Symbol.for("nodejs.util.inspect.custom"),value:function(){return"CID("+this.toString()+")"}},{key:"toString",value:function(t){return this.toBaseEncodedString(t)}},{key:"toJSON",value:function(){return{codec:this.codec,version:this.version,hash:this.multihash}}},{key:"equals",value:function(t){return this.codec===t.codec&&this.version===t.version&&this.multihash.equals(t.multihash)}}],[{key:"validateCID",value:function(t){var e=h.checkCIDComponents(t);if(e)throw new Error(e)}}]),t}(),{className:"CID",symbolName:"@ipld/js-cid/CID"});l.codecs=f,t.exports=l},function(t,e,r){"use strict";var n=r(4).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r>>0,f=new Uint8Array(a);t[r];){var h=e[t.charCodeAt(r)];if(255===h)return;for(var l=0,d=a-1;(0!==h||l>>0,f[d]=h%256>>>0,h=h/256>>>0;if(0!==h)throw new Error("Non-zero carry");o=l,r++}if(" "!==t[r]){for(var p=a-o;p!==a&&0===f[p];)p++;var m=n.allocUnsafe(i+(a-p));m.fill(0,0,i);for(var b=i;p!==a;)m[b++]=f[p++];return m}}}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,a=e.length;o!==a&&0===e[o];)o++,r++;for(var c=(a-o)*f+1>>>0,h=new Uint8Array(c);o!==a;){for(var l=e[o],d=0,p=c-1;(0!==l||d>>0,h[p]=l%s>>>0,l=l/s>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,o++}for(var m=c-i;m!==c&&0===h[m];)m++;for(var b=u.repeat(r);m-1&&(e="tuple[]",t=t.slice(0,-2)),{type:e,name:t}},h.prototype.mapStructToCoderFormat=function(t){var e=this,r=[];return Object.keys(t).forEach((function(i){"object"!==(0,n.default)(t[i])?r.push({name:i,type:t[i]}):r.push(Object.assign(e.mapStructNameAndType(i),{components:e.mapStructToCoderFormat(t[i])}))})),r},h.prototype.formatParam=function(t,e){var r=this,n=new RegExp(/^bytes([0-9]*)$/),o=new RegExp(/^bytes([0-9]*)\[\]$/),s=new RegExp(/^(u?int)([0-9]*)$/),u=new RegExp(/^(u?int)([0-9]*)\[\]$/);if(a.isBN(e)||a.isBigNumber(e))return e.toString(10);if(t.match(o)||t.match(u))return e.map((function(e){return r.formatParam(t.replace("[]",""),e)}));var c=t.match(s);if(c){var f=parseInt(c[2]||"256");f/80&&(!e||"0x"===e||"0X"===e))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var r=c.decode(this.mapTypes(t),"0x"+e.replace(/0x/i,"")),n=new f;return n.__length__=0,t.forEach((function(t,e){var i=r[n.__length__];i="0x"===i?null:i,n[e]=i,o.isObject(t)&&t.name&&(n[t.name]=i),n.__length__++})),n},h.prototype.decodeLog=function(t,e,r){var n=this;r=o.isArray(r)?r:[r],e=e||"";var i=[],a=[],s=0;t.forEach((function(t,e){t.indexed?(a[e]=["bool","int","uint","address","fixed","ufixed"].find((function(e){return-1!==t.type.indexOf(e)}))?n.decodeParameter(t.type,r[s]):r[s],s++):i[e]=t}));var u=e,c=u?this.decodeParameters(i,u):[],h=new f;return h.__length__=0,t.forEach((function(t,e){h[e]="string"===t.type?"":null,void 0!==c[e]&&(h[e]=c[e]),void 0!==a[e]&&(h[e]=a[e]),t.name&&(h[t.name]=h[e]),h.__length__++})),h};var l=new h;t.exports=l},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return n.ConstructorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return n.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return n.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return n.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return n.FunctionFragment}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return n.ParamType}}),Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return o.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return o.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return o.LogDescription}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return o.TransactionDescription}});var n=r(85),i=r(163),o=r(375)},function(t,e,r){"use strict";var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.defaultAbiCoder=e.AbiCoder=void 0;var i=n(r(5)),o=n(r(6)),a=r(14),s=r(23),u=r(15),c=r(54),f=r(25),h=r(367),l=r(164),d=r(369),p=r(165),m=r(370),b=r(371),y=r(372),v=r(373),g=r(374),w=r(85),_=new u.Logger(c.version),k=new RegExp(/^bytes([0-9]*)$/),M=new RegExp(/^(u?int)([0-9]*)$/),S=function(){function t(e){(0,i.default)(this,t),_.checkNew(this instanceof t?this.constructor:void 0,t),(0,s.defineReadOnly)(this,"coerceFunc",e||null)}return(0,o.default)(t,[{key:"_getCoder",value:function(t){var e=this;switch(t.baseType){case"address":return new h.AddressCoder(t.name);case"bool":return new d.BooleanCoder(t.name);case"string":return new v.StringCoder(t.name);case"bytes":return new p.BytesCoder(t.name);case"array":return new l.ArrayCoder(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new g.TupleCoder((t.components||[]).map((function(t){return e._getCoder(t)})),t.name);case"":return new b.NullCoder(t.name)}var r=t.type.match(M);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&_.throwArgumentError("invalid "+r[1]+" bit length","param",t),new y.NumberCoder(n/8,"int"===r[1],t.name)}if(r=t.type.match(k)){var i=parseInt(r[1]);return(0===i||i>32)&&_.throwArgumentError("invalid bytes length","param",t),new m.FixedBytesCoder(i,t.name)}return _.throwArgumentError("invalid type","type",t.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(t){return new f.Reader(t,this._getWordSize(),this.coerceFunc)}},{key:"_getWriter",value:function(){return new f.Writer(this._getWordSize())}},{key:"encode",value:function(t,e){var r=this;t.length!==e.length&&_.throwError("types/values length mismatch",u.Logger.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var n=t.map((function(t){return r._getCoder(w.ParamType.from(t))})),i=new g.TupleCoder(n,"_"),o=this._getWriter();return i.encode(o,e),o.data}},{key:"decode",value:function(t,e){var r=this,n=t.map((function(t){return r._getCoder(w.ParamType.from(t))}));return new g.TupleCoder(n,"_").decode(this._getReader((0,a.arrayify)(e)))}}]),t}();e.AbiCoder=S;var A=new S;e.defaultAbiCoder=A},function(t,e,r){"use strict";var n=r(0);Object.defineProperty(e,"__esModule",{value:!0}),e.pack=b,e.unpack=y,e.ArrayCoder=void 0;var i=n(r(5)),o=n(r(6)),a=n(r(10)),s=n(r(11)),u=n(r(8)),c=n(r(2)),f=r(15),h=r(54),l=r(25),d=r(368);function p(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,u.default)(t);if(e){var i=(0,u.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,s.default)(this,r)}}var m=new f.Logger(h.version);function b(t,e,r){if(Array.isArray(r));else if(r&&"object"===(0,c.default)(r)){var n=[];e.forEach((function(t){n.push(r[t.localName])})),r=n}else m.throwArgumentError("invalid tuple value","tuple",r);e.length!==r.length&&m.throwArgumentError("types/value length mismatch","tuple",r);var i=new l.Writer(t.wordSize),o=new l.Writer(t.wordSize),a=[];e.forEach((function(t,e){var n=r[e];if(t.dynamic){var s=o.length;t.encode(o,n);var u=i.writeUpdatableValue();a.push((function(t){u(t+s)}))}else t.encode(i,n)})),a.forEach((function(t){t(i.length)}));var s=t.writeBytes(i.data);return s+=t.writeBytes(o.data)}function y(t,e){var r=[],n=t.subReader(0),i=0;e.forEach((function(e){var o=null;if(e.dynamic){var a=t.readValue(),s=n.subReader(a.toNumber());try{o=e.decode(s)}catch(t){if(t.code===f.Logger.errors.BUFFER_OVERRUN)throw t;(o=t).baseType=e.name,o.name=e.localName,o.type=e.type}i+=s.consumed}else try{o=e.decode(t)}catch(t){if(t.code===f.Logger.errors.BUFFER_OVERRUN)throw t;(o=t).baseType=e.name,o.name=e.localName,o.type=e.type}null!=o&&r.push(o)})),t.readBytes(i),e.forEach((function(t,e){var n=t.localName;if(n&&("length"===n&&(n="_length"),null==r[n])){var i=r[e];i instanceof Error?Object.defineProperty(r,n,{get:function(){throw i}}):r[n]=i}}));for(var o=function(t){var e=r[t];e instanceof Error&&Object.defineProperty(r,t,{get:function(){throw e}})},a=0;a=0?n:"")+"]",u=-1===n||t.dynamic;return(a=e.call(this,"array",s,o,u)).coder=t,a.length=n,a}return(0,o.default)(r,[{key:"encode",value:function(t,e){Array.isArray(e)||this._throwError("expected array value",e);var r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),m.checkArgumentCount(r,e.length,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(e=t.exports=r(168)).Stream=e,e.Readable=e,e.Writable=r(172),e.Duplex=r(45),e.Transform=r(173),e.PassThrough=r(389),e.finished=r(88),e.pipeline=r(390)},function(t,e,r){"use strict";(function(e,n){var i;t.exports=A,A.ReadableState=S;r(34).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(169),s=r(1).Buffer,u=e.Uint8Array||function(){};var c,f=r(384);c=f&&f.debuglog?f.debuglog("stream"):function(){};var h,l,d,p=r(385),m=r(170),b=r(171).getHighWaterMark,y=r(44).codes,v=y.ERR_INVALID_ARG_TYPE,g=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(3)(A,a);var k=m.errorOrDestroy,M=["error","close","destroy","pause","resume"];function S(t,e,n){i=i||r(45),t=t||{},"boolean"!=typeof n&&(n=e instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b(this,t,"readableHighWaterMark",n),this.buffer=new p,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&&(h||(h=r(35).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||r(45),!(this instanceof A))return new A(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function x(t,e,r,n,i){c("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;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?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,R(t)))}(t,a);else if(i||(o=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(a,e)),o)k(t,o);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)a.endEmitted?k(t,new _):E(t,a,e,!0);else if(a.ended)k(t,new g);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?E(t,a,e,!1):T(t,a)):E(t,a,e,!1)}else n||(a.reading=!1,T(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=1073741824?t=1073741824:(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 C(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,n.nextTick(R,t))}function R(t){var e=t._readableState;c("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,U(t)}function T(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(B,t,e))}function B(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function j(t){c("readable nexttick read 0"),t.read(0)}function I(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),U(t),e.flowing&&!e.reading&&t.read(0)}function U(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function N(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 L(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,n.nextTick(F,e,t))}function F(t,e){if(c("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 q(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):C(this),null;if(0===(t=O(t,e))&&e.ended)return 0===e.length&&L(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t0?N(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&&L(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){k(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var a=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?u:b;function s(e,n){c("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,c("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",l),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){c("onend"),t.end()}i.endEmitted?n.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,U(t))}}(r);t.on("drain",f);var h=!1;function l(e){c("ondata");var n=t.write(e);c("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==q(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function d(e){c("onerror",e),b(),t.removeListener("error",d),0===o(t,"error")&&k(t,e)}function p(){t.removeListener("finish",m),b()}function m(){c("onfinish"),t.removeListener("close",p),b()}function b(){c("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),i.flowing||(c("pipe resume"),r.resume()),t},A.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||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?C(this):i.reading||n.nextTick(j,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&n.nextTick(P,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(P,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick(I,t,e))}(this,t)),t.paused=!1,this},A.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._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i 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(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new m("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var i=this._writableState;return"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||function(t,e,r){e.ending=!0,T(t,e),r&&(e.finished?n.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=h.destroy,A.prototype._undestroy=h.undestroy,A.prototype._destroy=function(t,e){e(t)}}).call(this,r(12),r(13))},function(t,e,r){"use strict";t.exports=f;var n=r(44).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(45);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,b=0|this._h,y=0;y<16;++y)r[y]=t.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((e=r[y-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[y-7]+d(r[y-15])+r[y-16];for(var v=0;v<64;++v){var g=b+l(u)+c(u,p,m)+a[v]+r[v]|0,w=h(n)+f(n,i,o)|0;b=m,m=p,p=u,u=s+g|0,s=o,o=i,i=n,n=g+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){"use strict";var n=r(3),i=r(46),o=r(4).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function h(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function y(t,e){return t>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,g=0|this._hh,w=0|this._al,_=0|this._bl,k=0|this._cl,M=0|this._dl,S=0|this._el,A=0|this._fl,x=0|this._gl,E=0|this._hl,O=0;O<32;O+=2)e[O]=t.readInt32BE(4*O),e[O+1]=t.readInt32BE(4*O+4);for(;O<160;O+=2){var C=e[O-30],R=e[O-30+1],T=d(C,R),B=p(R,C),P=m(C=e[O-4],R=e[O-4+1]),j=b(R,C),I=e[O-14],U=e[O-14+1],N=e[O-32],L=e[O-32+1],F=B+U|0,q=T+I+y(F,B)|0;q=(q=q+P+y(F=F+j|0,j)|0)+N+y(F=F+L|0,L)|0,e[O]=q,e[O+1]=F}for(var D=0;D<160;D+=2){q=e[D],F=e[D+1];var z=f(r,n,i),H=f(w,_,k),K=h(r,w),W=h(w,r),V=l(s,S),Z=l(S,s),G=a[D],J=a[D+1],X=c(s,u,v),Y=c(S,A,x),$=E+Z|0,Q=g+V+y($,E)|0;Q=(Q=(Q=Q+X+y($=$+Y|0,Y)|0)+G+y($=$+J|0,J)|0)+q+y($=$+F|0,F)|0;var tt=W+H|0,et=K+z+y(tt,W)|0;g=v,E=x,v=u,x=A,u=s,A=S,s=o+Q+y(S=M+$|0,M)|0,o=i,M=k,i=n,k=_,n=r,_=w,r=Q+et+y(w=$+tt|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+k|0,this._dl=this._dl+M|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+x|0,this._hl=this._hl+E|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,_)|0,this._ch=this._ch+i+y(this._cl,k)|0,this._dh=this._dh+o+y(this._dl,M)|0,this._eh=this._eh+s+y(this._el,S)|0,this._fh=this._fh+u+y(this._fl,A)|0,this._gh=this._gh+v+y(this._gl,x)|0,this._hh=this._hh+g+y(this._hl,E)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";(function(e,n){var i=r(29);t.exports=g;var o,a=r(74);g.ReadableState=v;r(34).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(177),c=r(4).Buffer,f=e.Uint8Array||function(){};var h=Object.create(r(26));h.inherits=r(3);var l=r(395),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,m=r(396),b=r(178);h.inherits(g,u);var y=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var n=e instanceof(o=o||r(38));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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&&(p||(p=r(35).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function g(t){if(o=o||r(38),!(this instanceof g))return new g(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,n,i){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;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,M(t)}(t,a)):(i||(o=function(t,e){var r;n=e,c.isBuffer(n)||n instanceof f||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?_(t,a,e,!1):A(t,a)):_(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=8388608?t=8388608:(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 M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(S,t):S(t))}function S(t){d("emit readable"),t.emit("readable"),C(t)}function A(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(x,t,e))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=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 n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function T(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):M(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&T(this),null;var n,i=e.needReadable;return d("need readable",i),(0===e.length||e.length-t0?R(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&T(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var r=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,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==n.stdout&&t!==n.stderr?f:g;function c(e,n){d("onunpipe"),e===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),t.removeListener("close",y),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",b),t.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",g),r.removeListener("data",m),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function f(){d("onend"),t.end()}o.endEmitted?i.nextTick(u):r.once("end",u),t.on("unpipe",c);var h=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,C(t))}}(r);t.on("drain",h);var l=!1;var p=!1;function m(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==P(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function b(e){d("onerror",e),g(),t.removeListener("error",b),0===s(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",v),g()}function v(){d("onfinish"),t.removeListener("close",y),g()}function g(){d("unpipe"),r.unpipe(t)}return r.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",b),t.once("close",y),t.once("finish",v),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},g.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||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;or)?e=("rmd160"===t?new u:c(t)).update(e).digest():e.lengthn||e!=e)throw new TypeError("Bad key length")}},function(t,e,r){"use strict";(function(e){var r;if(e.browser)r="utf-8";else if(e.version){r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r}).call(this,r(13))},function(t,e,r){"use strict";var n=r(181),i=r(89),o=r(90),a=r(4).Buffer,s=r(184),u=r(185),c=r(187),f=a.alloc(128),h={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var s=function(t){function e(e){return o(t).update(e).digest()}return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=s(e):e.length>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(t>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(e>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>o[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,t.keys,a)}},u.prototype._update=function(t,e,r,n){var i=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,a=l}o.rip(s,a,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var a=r,s=e,u=t.keys.length-2;u>=0;u-=2){var c=t.keys[u],f=t.keys[u+1];o.expand(a,t.tmp,0),c^=t.tmp[0],f^=t.tmp[1];var h=o.substitute(c,f),l=a;a=(s^o.permute(h))>>>0,s=l}o.rip(a,s,n,i)}},function(t,e,r){"use strict";var n=r(55),i=r(4).Buffer,o=r(191);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var s=0;st;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(c))for(;r.mod(f).cmp(h);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(b(p=r.shrn(1))&&b(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},function(t,e,r){"use strict";var n=r(7),i=r(97);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var c=t.shrn(u),f=s.toRed(o);e>0;e--){var h=this._randrange(new n(2),s);r&&r(h);var l=h.toRed(o).redPow(c);if(0!==l.cmp(a)&&0!==l.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new n(2),a),h=t.gcd(f);if(0!==h.cmpn(1))return h;var l=f.toRed(i).redPow(u);if(0!==l.cmp(o)&&0!==l.cmp(c)){for(var d=1;d>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){"use strict";var n=e;n.base=r(71),n.short=r(430),n.mont=r(431),n.edwards=r(432)},function(t,e,r){"use strict";(function(t){var e=r(0)(r(2));!function(t,n){function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===(0,e.default)(t)?t.exports=a:(void 0).BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(441).Buffer}catch(t){}function u(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+t)}function c(t,e,r){var n=u(t,r);return r-1>=e&&(n|=u(t,r-1)<<4),n}function f(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,i(c>=0&&a0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,r,n){if("number"==typeof t)return this._initNumber(t,r,n);if("object"===(0,e.default)(t))return this._initArray(t,r,n);"hex"===r&&(r=16),i(r===(0|r)&&r>=2&&r<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=c(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){a.prototype.inspect=l}else a.prototype.inspect=l;function l(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?d[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=p[t],f=m[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var l=h.modrn(f).toString(t);r=(h=h.idivn(f)).isZero()?l+r:d[c-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function b(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,h=67108863&u,l=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=l;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&a}r.words[c]=0|h,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}a.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a