>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(x[t])return x[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new m;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return x[t]=e,e},y.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var h=this.pow(f,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,b=0;0!==m.cmp(s);b++)m=m.redSqr();n(b=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var h=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new g(t)},i(g,y),g.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},g.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},g.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},g.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},g.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"===typeof t||t,this)}).call(e,r(18)(t))},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){function n(t,e){for(var r in t)e[r]=t[r]}function i(t,e,r){return a(t,e,r)}var o=r(0),a=o.Buffer;a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=o:(n(o,e),e.Buffer=i),n(a,i),i.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return a(t,e,r)},i.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var n=a(t);return void 0!==e?"string"===typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},i.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return a(t)},i.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},function(t,e,r){var n=r(5),i=r(11),o=r(188),a=r(78),s=function(t){return n.isNumber(t)&&(t=Math.trunc(t)),new a(i.toTwosComplement(t).replace("0x",""))},u=function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!==0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');if(e.length>64)throw new Error('Given parameter bytes is too long: "'+t+'"');var r=Math.floor((e.length+63)/64);return e=i.padRight(e,64*r),new a(e)},c=function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!==0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');var r=e.length/2,n=Math.floor((e.length+63)/64);return e=i.padRight(e,64*n),new a(s(r).value+e)},f=function(t){var e=i.utf8ToHex(t).replace(/^0x/i,""),r=e.length/2,n=Math.floor((e.length+63)/64);return e=i.padRight(e,64*n),new a(s(r).value+e)},h=function(t){return new a("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},l=function(t){return"1"===new o(t.substr(0,1),16).toString(2).substr(0,1)},d=function(t){var e=t.staticPart()||"0";return l(e)?new o(e,16).fromTwos(256).toString(10):new o(e,16).toString(10)},p=function(t,e){var r=t.staticPart();if(!r&&t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return new o(r,16).toString(10)},m=function(t,e){var r=t.staticPart();if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return"0000000000000000000000000000000000000000000000000000000000000001"===r},b=function(t,e){var r=e.match(/^bytes([0-9]*)/),n=parseInt(r[1]);if(t.staticPart().slice(0,2*n).length!==2*n)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue+" The size doesn't match.");return"0x"+t.staticPart().slice(0,2*n)},v=function(t){var e=2*new o(t.dynamicPart().slice(0,64),16).toNumber();return"0x"+t.dynamicPart().substr(64,e)},y=function(t){var e=t.dynamicPart().slice(0,64);if(e){var r=2*new o(e,16).toNumber();return r?i.hexToUtf8("0x"+t.dynamicPart().substr(64,r).replace(/^0x/i,"")):""}throw new Error("ERROR: The returned value is not a convertible string:"+e)},g=function(t){var e=t.staticPart();return i.toChecksumAddress("0x"+e.slice(e.length-40,e.length))};t.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputString:f,formatInputBool:h,formatOutputInt:d,formatOutputUInt:p,formatOutputBool:m,formatOutputBytes:b,formatOutputDynamicBytes:v,formatOutputString:y,formatOutputAddress:g,toTwosComplement:i.toTwosComplement}},function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for(t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t,e){for(var r="",n=0;n>>0}return o}function f(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r}function h(t,e){return t>>>e|t<<32-e}function l(t,e){return t<>>32-e}function d(t,e){return t+e>>>0}function p(t,e,r){return t+e+r>>>0}function m(t,e,r,n){return t+e+r+n>>>0}function b(t,e,r,n,i){return t+e+r+n+i>>>0}function v(t,e,r,n){var i=t[e],o=t[e+1],a=n+o>>>0,s=(a>>0,t[e+1]=a}function y(t,e,r,n){return(e+n>>>0>>0}function g(t,e,r,n){return e+n>>>0}function _(t,e,r,n,i,o,a,s){var u=0,c=e;return c=c+n>>>0,u+=c>>0,u+=c>>0,u+=c>>0}function w(t,e,r,n,i,o,a,s){return e+n+o+s>>>0}function M(t,e,r,n,i,o,a,s,u,c){var f=0,h=e;return h=h+n>>>0,f+=h>>0,f+=h>>0,f+=h>>0,f+=h>>0}function k(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0}function E(t,e,r){return(e<<32-r|t>>>r)>>>0}function x(t,e,r){return(t<<32-r|e>>>r)>>>0}function S(t,e,r){return t>>>r}function A(t,e,r){return(t<<32-r|e>>>r)>>>0}var C=r(13),T=r(1);e.inherits=T,e.toArray=n,e.toHex=i,e.htonl=o,e.toHex32=a,e.zero2=s,e.zero8=u,e.join32=c,e.split32=f,e.rotr32=h,e.rotl32=l,e.sum32=d,e.sum32_3=p,e.sum32_4=m,e.sum32_5=b,e.sum64=v,e.sum64_hi=y,e.sum64_lo=g,e.sum64_4_hi=_,e.sum64_4_lo=w,e.sum64_5_hi=M,e.sum64_5_lo=k,e.rotr64_hi=E,e.rotr64_lo=x,e.shr64_hi=S,e.shr64_lo=A},function(t,e,r){"use strict";function n(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for(t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t,e){for(var r="",n=0;n>>0}return o}function f(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r}function h(t,e){return t>>>e|t<<32-e}function l(t,e){return t<>>32-e}function d(t,e){return t+e>>>0}function p(t,e,r){return t+e+r>>>0}function m(t,e,r,n){return t+e+r+n>>>0}function b(t,e,r,n,i){return t+e+r+n+i>>>0}function v(t,e,r,n){var i=t[e],o=t[e+1],a=n+o>>>0,s=(a>>0,t[e+1]=a}function y(t,e,r,n){return(e+n>>>0>>0}function g(t,e,r,n){return e+n>>>0}function _(t,e,r,n,i,o,a,s){var u=0,c=e;return c=c+n>>>0,u+=c>>0,u+=c>>0,u+=c>>0}function w(t,e,r,n,i,o,a,s){return e+n+o+s>>>0}function M(t,e,r,n,i,o,a,s,u,c){var f=0,h=e;return h=h+n>>>0,f+=h>>0,f+=h>>0,f+=h>>0,f+=h>>0}function k(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0}function E(t,e,r){return(e<<32-r|t>>>r)>>>0}function x(t,e,r){return(t<<32-r|e>>>r)>>>0}function S(t,e,r){return t>>>r}function A(t,e,r){return(t<<32-r|e>>>r)>>>0}var C=r(25),T=r(6);e.inherits=T,e.toArray=n,e.toHex=i,e.htonl=o,e.toHex32=a,e.zero2=s,e.zero8=u,e.join32=c,e.split32=f,e.rotr32=h,e.rotl32=l,e.sum32=d,e.sum32_3=p,e.sum32_4=m,e.sum32_5=b,e.sum64=v,e.sum64_hi=y,e.sum64_lo=g,e.sum64_4_hi=_,e.sum64_4_lo=w,e.sum64_5_hi=M,e.sum64_5_lo=k,e.rotr64_hi=E,e.rotr64_lo=x,e.shr64_hi=S,e.shr64_lo=A},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){function n(){i.call(this)}t.exports=n;var i=r(53).EventEmitter;r(1)(n,i),n.Readable=r(54),n.Writable=r(206),n.Duplex=r(207),n.Transform=r(208),n.PassThrough=r(209),n.Stream=n,n.prototype.pipe=function(t,e){function r(e){t.writable&&!1===t.write(e)&&c.pause&&c.pause()}function n(){c.readable&&c.resume&&c.resume()}function o(){f||(f=!0,t.end())}function a(){f||(f=!0,"function"===typeof t.destroy&&t.destroy())}function s(t){if(u(),0===i.listenerCount(this,"error"))throw t}function u(){c.removeListener("data",r),t.removeListener("drain",n),c.removeListener("end",o),c.removeListener("close",a),c.removeListener("error",s),t.removeListener("error",s),c.removeListener("end",u),c.removeListener("close",u),t.removeListener("close",u)}var c=this;c.on("data",r),t.on("drain",n),t._isStdio||e&&!1===e.end||(c.on("end",o),c.on("close",a));var f=!1;return c.on("error",s),t.on("error",s),c.on("end",u),c.on("close",u),t.on("close",u),t.emit("pipe",c),t}},function(t,e,r){function n(t){o.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var i=r(2).Buffer,o=r(19).Transform,a=r(42).StringDecoder;r(1)(n,o),n.prototype.update=function(t,e,r){"string"===typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},n.prototype.setAutoPadding=function(){},n.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},n.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},n.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},n.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},n.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},n.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},n.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new a(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=n},function(t,e,r){"use strict";var n=r(156),i=r(182);t.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=new n.Manager(e[0].currentProvider):(t._requestManager=new n.Manager,t._requestManager.setProvider(e[0],e[1])),t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.BatchRequest=n.BatchManager.bind(null,t._requestManager),t.extend=i(t)},addProviders:function(t){t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers}}},function(t,e,r){"use strict";var n=r(5),i=r(7).errors,o=r(7).formatters,a=r(11),s=r(74),u=r(39).subscriptions,c=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.requestManager=t.requestManager,this.accounts=t.accounts,this.defaultBlock=t.defaultBlock||"latest",this.defaultAccount=t.defaultAccount||null};c.prototype.setRequestManager=function(t,e){this.requestManager=t,e&&(this.accounts=e)},c.prototype.createFunction=function(t,e){var r=this.buildCall();return r.call=this.call,this.setRequestManager(t||this.requestManager,e||this.accounts),r},c.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},c.prototype.getCall=function(t){return n.isFunction(this.call)?this.call(t):this.call},c.prototype.extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},c.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams(t.length,this.params,this.name)},c.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},c.prototype.formatOutput=function(t){var e=this;return n.isArray(t)?t.map(function(t){return e.outputFormatter&&t?e.outputFormatter(t):t}):this.outputFormatter&&t?this.outputFormatter(t):t},c.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},c.prototype._confirmTransaction=function(t,e,r){var i=this,f=!1,h=!0,l=0,d=0,p=null,m=n.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,b=n.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,v=[new c({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new c({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new u({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],y={};n.each(v,function(t){t.attachToObject(y),t.requestManager=i.requestManager});var g=function(r,n,o,u){return r?(o.unsubscribe(),f=!0,a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:r},t.eventEmitter,t.reject)):(o||(o={unsubscribe:function(){clearInterval(p)}}),(u?s.resolve(u):y.getTransactionReceipt(e)).catch(function(e){o.unsubscribe(),f=!0,a._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)}).then(function(e){if(!e||!e.blockHash)throw new Error("Receipt missing or blockHash null");return i.extraFormatters&&i.extraFormatters.receiptFormatter&&(e=i.extraFormatters.receiptFormatter(e)),t.eventEmitter.listeners("confirmation").length>0&&(t.eventEmitter.emit("confirmation",d,e),h=!1,25===++d&&(o.unsubscribe(),t.eventEmitter.removeAllListeners())),e}).then(function(e){if(b&&!f){if(!e.contractAddress)return h&&(o.unsubscribe(),f=!0),a._fireError(new Error("The transaction receipt didn't contain a contract address."),t.eventEmitter,t.reject);y.getCode(e.contractAddress,function(r,n){n&&(n.length>2?(t.eventEmitter.emit("receipt",e),i.extraFormatters&&i.extraFormatters.contractDeployFormatter?t.resolve(i.extraFormatters.contractDeployFormatter(e)):t.resolve(e),h&&t.eventEmitter.removeAllListeners()):a._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),t.eventEmitter,t.reject),h&&o.unsubscribe(),f=!0)})}return e}).then(function(e){b||f||(e.outOfGas||m&&m===e.gasUsed?(e&&(e=JSON.stringify(e,null,2)),a._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+e),t.eventEmitter,t.reject)):(t.eventEmitter.emit("receipt",e),t.resolve(e),h&&t.eventEmitter.removeAllListeners()),h&&o.unsubscribe(),f=!0)}).catch(function(){if(++l-1>=50)return o.unsubscribe(),f=!0,a._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly send. Be aware that it might still be mined!"),t.eventEmitter,t.reject)}))},_=function(){n.isFunction(this.requestManager.provider.on)?y.subscribe("newBlockHeaders",g):p=setInterval(g,1e3)}.bind(this);y.getTransactionReceipt(e).then(function(e){if(e&&e.blockHash)return t.eventEmitter.listeners("confirmation").length>0&&setTimeout(function(){f||_()},1e3),g(null,0,null,e);f||_()}).catch(function(){f||_()})};var f=function(t,e){return n.isNumber(t)?e.wallet[t]:n.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};c.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r=function(){var r=s(!e),i=t.toPayload(Array.prototype.slice.call(arguments)),o=function(n,o){try{o=t.formatOutput(o)}catch(t){n=t}if(o instanceof Error&&(n=o),n)return n.error&&(n=n.error),a._fireError(n,r.eventEmitter,r.reject,i.callback);i.callback&&i.callback(null,o),e?(r.eventEmitter.emit("transactionHash",o),t._confirmTransaction(r,o,i)):n||r.resolve(o)},u=function(e){i.method="eth_sendRawTransaction",i.params=[e.rawTransaction],t.requestManager.send(i,o)},h=function(t,e){if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length){var i;if("eth_sendTransaction"===t.method){var a=t.params[0];if((i=f(n.isObject(a)?a.from:null,e.accounts))&&i.privateKey){delete a.from;var s=e.accounts.signTransaction(a,i.privateKey);return n.isFunction(s.then)?s.then(u):u(s)}}else if("eth_sign"===t.method){var c=t.params[1];if((i=f(t.params[0],e.accounts))&&i.privateKey){var h=e.accounts.sign(c,i.privateKey);return t.callback&&t.callback(null,h.signature),void r.resolve(h.signature)}}}return e.requestManager.send(t,o)};if(e&&n.isObject(i.params[0])&&!i.params[0].gasPrice){new c({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager)(function(e,r){r&&(i.params[0].gasPrice=r),h(i,t)})}else h(i,t);return r.eventEmitter};return r.method=t,r.request=this.request.bind(this),r},c.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=c},function(t,e,r){var n=r(15),i=r(78),o=function(t){this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};o.prototype.isType=function(t){throw"This method should be overwritten for type "+t},o.prototype.staticPartLength=function(t){return(this.nestedTypes(t)||["[1]"]).map(function(t){return parseInt(t.slice(1,-1),10)||1}).reduce(function(t,e){return t*e},32)},o.prototype.isDynamicArray=function(t){var e=this.nestedTypes(t);return!!e&&!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.isStaticArray=function(t){var e=this.nestedTypes(t);return!!e&&!!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.staticArrayLength=function(t){var e=this.nestedTypes(t);return e?parseInt(e[e.length-1].match(/[0-9]{1,}/g)||1):1},o.prototype.nestedName=function(t){var e=this.nestedTypes(t);return e?t.substr(0,t.length-e[e.length-1].length):t},o.prototype.isDynamicType=function(){return!1},o.prototype.nestedTypes=function(t){return t.match(/(\[[0-9]*\])/g)},o.prototype.encode=function(t,e){var r=this;return this.isDynamicArray(e)?function(){var i=t.length,o=r.nestedName(e),a=[];return a.push(n.formatInputInt(i).encode()),t.forEach(function(t){a.push(r.encode(t,o))}),a}():this.isStaticArray(e)?function(){for(var n=r.staticArrayLength(e),i=r.nestedName(e),o=[],a=0;a65536)throw new Error("requested too many random bytes");var i=new e.Uint8Array(t);t>0&&s.getRandomValues(i);var o=a.from(i.buffer);return"function"===typeof r?n.nextTick(function(){r(null,o)}):o}var a=r(2).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=o:t.exports=i}).call(e,r(4),r(8))},function(t,e,r){function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}var i=r(2).Buffer;n.prototype.update=function(t,e){"string"===typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=4294967295&r,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e,r){function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}var i=r(14).Buffer;n.prototype.update=function(t,e){"string"===typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=4294967295&r,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e,r){function n(t,e){this._id=t,this._clearFn=e}var i=Function.prototype.apply;e.setTimeout=function(){return new n(i.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new n(i.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},n.prototype.unref=n.prototype.ref=function(){},n.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(184),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,r){"use strict";(function(e){function n(t){c.call(this,"digest"),this._hash=t,this.buffers=[]}function i(t){c.call(this,"digest"),this._hash=t}var o=r(1),a=r(51),s=r(52),u=r(56),c=r(20);o(n,c),n.prototype._update=function(t){this.buffers.push(t)},n.prototype._final=function(){var t=e.concat(this.buffers),r=this._hash(t);return this.buffers=null,r},o(i,c),i.prototype._update=function(t){this._hash.update(t)},i.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return t=t.toLowerCase(),"md5"===t?new n(a):new i("rmd160"===t||"ripemd160"===t?new s:u(t))}}).call(e,r(0).Buffer)},function(t,e,r){(function(t){function r(t){return Array.isArray?Array.isArray(t):"[object Array]"===b(t)}function n(t){return"boolean"===typeof t}function i(t){return null===t}function o(t){return null==t}function a(t){return"number"===typeof t}function s(t){return"string"===typeof t}function u(t){return"symbol"===typeof t}function c(t){return void 0===t}function f(t){return"[object RegExp]"===b(t)}function h(t){return"object"===typeof t&&null!==t}function l(t){return"[object Date]"===b(t)}function d(t){return"[object Error]"===b(t)||t instanceof Error}function p(t){return"function"===typeof t}function m(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t}function b(t){return Object.prototype.toString.call(t)}e.isArray=r,e.isBoolean=n,e.isNull=i,e.isNullOrUndefined=o,e.isNumber=a,e.isString=s,e.isSymbol=u,e.isUndefined=c,e.isRegExp=f,e.isObject=h,e.isDate=l,e.isError=d,e.isFunction=p,e.isPrimitive=m,e.isBuffer=t.isBuffer}).call(e,r(0).Buffer)},function(t,e,r){(function(e){t.exports=function(t,r){for(var n=Math.min(t.length,r.length),i=new e(n),o=0;o=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o1?(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";var n=r(21),i=r(22),o=r(11),a=function(){var t=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:o.hexToNumber}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};n.addProviders(a),t.exports=a},function(t,e,r){"use strict";(function(e){function r(t,r,n,i){if("function"!==typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a>5===6?2:t>>4===14?3:t>>3===30?4:-1}function s(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0)}function u(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd".repeat(r);if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd".repeat(r+1);if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd".repeat(r+2)}}function c(t){var e=this.lastTotal-this.lastNeed,r=u(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function f(t,e){var r=s(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\ufffd".repeat(this.lastTotal-this.lastNeed):e}function l(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function d(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function p(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function m(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function b(t){return t.toString(this.encoding)}function v(t){return t&&t.length?this.write(t):""}var y=r(2).Buffer,g=y.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r0||n>0;){var f=new o;f.update(c),f.update(t),e&&f.update(e),c=f.digest();var h=0;if(a>0){var l=s.length-a;h=Math.min(a,c.length),c.copy(s,l,0,h),a-=h}if(h0){var d=u.length-n,p=Math.min(n,c.length-h);c.copy(u,d,h,h+p),n-=p}}return c.fill(0),{key:s,iv:u}}var i=r(2).Buffer,o=r(218);t.exports=n},function(t,e,r){function n(t){s.isBuffer(t)||(t=s.from(t));for(var e=t.length/4|0,r=new Array(e),n=0;n>>24]^f[p>>>16&255]^h[m>>>8&255]^l[255&b]^e[v++],a=c[p>>>24]^f[m>>>16&255]^h[b>>>8&255]^l[255&d]^e[v++],s=c[m>>>24]^f[b>>>16&255]^h[d>>>8&255]^l[255&p]^e[v++],u=c[b>>>24]^f[d>>>16&255]^h[p>>>8&255]^l[255&m]^e[v++],d=o,p=a,m=s,b=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&b])^e[v++],a=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[b>>>8&255]<<8|n[255&d])^e[v++],s=(n[m>>>24]<<24|n[b>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[v++],u=(n[b>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[v++],o>>>=0,a>>>=0,s>>>=0,u>>>=0,[o,a,s,u]}function a(t){this._key=n(t),this._reset()}var s=r(2).Buffer,u=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var f=t[a],h=t[f],l=t[h],d=257*t[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*l^65537*h^257*f^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=f^t[t[t[l^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();a.blockSize=16,a.keySize=32,a.prototype.blockSize=a.blockSize,a.prototype.keySize=a.keySize,a.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=u[o/e|0]<<24):e>6&&o%e===4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),i[o]=i[o-e]^a}for(var s=[],f=0;f>>24]]^c.INV_SUB_MIX[1][c.SBOX[l>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[l>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=s},a.prototype.encryptBlockRaw=function(t){return t=n(t),o(t,this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},a.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=s.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},a.prototype.decryptBlock=function(t){t=n(t);var e=t[1];t[1]=t[3],t[3]=e;var r=o(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),i=s.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},a.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=a},function(t,e,r){"use strict";var n=e;n.base=r(245),n.short=r(246),n.mont=r(247),n.edwards=r(248)},function(t,e,r){(function(e){function n(t){var r;"object"!==typeof t||e.isBuffer(t)||(r=t.passphrase,t=t.key),"string"===typeof t&&(t=new e(t));var n,a,u=s(t,r),c=u.tag,f=u.data;switch(c){case"CERTIFICATE":a=o.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(a||(a=o.PublicKey.decode(f,"der")),n=a.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return o.RSAPublicKey.decode(a.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return a.subjectPrivateKey=a.subjectPublicKey,{type:"ec",data:a};case"1.2.840.10040.4.1":return a.algorithm.params.pub_key=o.DSAparam.decode(a.subjectPublicKey.data,"der"),{type:"dsa",data:a.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+c);case"ENCRYPTED PRIVATE KEY":f=o.EncryptedPrivateKey.decode(f,"der"),f=i(f,r);case"PRIVATE KEY":switch(a=o.PrivateKey.decode(f,"der"),n=a.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return o.RSAPrivateKey.decode(a.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:a.algorithm.curve,privateKey:o.ECPrivateKey.decode(a.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return a.algorithm.params.priv_key=o.DSAparam.decode(a.subjectPrivateKey,"der"),{type:"dsa",params:a.algorithm.params};default:throw new Error("unknown key id "+n)}throw new Error("unknown key type "+c);case"RSA PUBLIC KEY":return o.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return o.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:o.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return f=o.ECPrivateKey.decode(f,"der"),{curve:f.parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+c)}}function i(t,r){var n=t.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=a[t.algorithm.decrypt.cipher.algo.join(".")],s=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,h=parseInt(o.split("-")[1],10)/8,l=c.pbkdf2Sync(r,n,i,h),d=u.createDecipheriv(o,l,s),p=[];return p.push(d.update(f)),p.push(d.final()),e.concat(p)}var o=r(264),a=r(276),s=r(277),u=r(57),c=r(87);t.exports=n,n.signature=o.signature}).call(e,r(0).Buffer)},function(t,e,r){"use strict";var n=e;n.base=r(288),n.short=r(289),n.mont=r(290),n.edwards=r(291)},function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,s,u=n(t),c=1;c>6|192);else{if(i>55295&&i<56320){if(++n==t.length)return null;var o=t.charCodeAt(n);if(o<56320||o>57343)return null;i=65536+((1023&i)<<10)+(1023&o),r+=e(i>>18|240),r+=e(i>>12&63|128)}else r+=e(i>>12|224);r+=e(i>>6&63|128)}r+=e(63&i|128)}}return r},k=function(t){for(var e="",r=0,i=o(t);r127){if(a>191&&a<224){if(r>=i)return null;a=(31&a)<<6|63&n(t,r)}else if(a>223&&a<240){if(r+1>=i)return null;a=(15&a)<<12|(63&n(t,r))<<6|63&n(t,++r)}else{if(!(a>239&&a<248))return null;if(r+2>=i)return null;a=(7&a)<<18|(63&n(t,r))<<12|(63&n(t,++r))<<6|63&n(t,++r)}++r}if(a<=65535)e+=String.fromCharCode(a);else{if(!(a<=1114111))return null;a-=65536,e+=String.fromCharCode(a>>10|55296),e+=String.fromCharCode(1023&a|56320)}}return e};t.exports={random:i,length:o,concat:v,flatten:a,slice:s,reverse:u,pad:c,padRight:f,fromAscii:_,toAscii:w,fromString:M,toString:k,fromNumber:m,toNumber:b,fromNat:y,toNat:g,fromArray:l,toArray:h,fromUint8Array:p,toUint8Array:d}},function(t,e,r){"use strict";function n(t,e){t[e>>5]|=128<>>9<<4)]=e;for(var r=1732584193,n=-271733879,i=-1732584194,f=271733878,h=0;h>16)+(e>>16)+(r>>16)<<16|65535&r}function f(t,e){return t<>>32-e}var h=r(200);t.exports=function(t){return h(t,n)}},function(t,e,r){"use strict";(function(e){function n(){h.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function i(t,e){return t<>>32-e}function o(t,e,r,n,o,a,s,u){return i(t+(e^r^n)+a+s|0,u)+o|0}function a(t,e,r,n,o,a,s,u){return i(t+(e&r|~e&n)+a+s|0,u)+o|0}function s(t,e,r,n,o,a,s,u){return i(t+((e|~r)^n)+a+s|0,u)+o|0}function u(t,e,r,n,o,a,s,u){return i(t+(e&n|r&~n)+a+s|0,u)+o|0}function c(t,e,r,n,o,a,s,u){return i(t+(e^(r|~n))+a+s|0,u)+o|0}var f=r(1),h=r(201);f(n,h),n.prototype._update=function(){for(var t=new Array(16),e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,f=this._c,h=this._d,l=this._e;r=o(r,n,f,h,l,t[0],0,11),f=i(f,10),l=o(l,r,n,f,h,t[1],0,14),n=i(n,10),h=o(h,l,r,n,f,t[2],0,15),r=i(r,10),f=o(f,h,l,r,n,t[3],0,12),l=i(l,10),n=o(n,f,h,l,r,t[4],0,5),h=i(h,10),r=o(r,n,f,h,l,t[5],0,8),f=i(f,10),l=o(l,r,n,f,h,t[6],0,7),n=i(n,10),h=o(h,l,r,n,f,t[7],0,9),r=i(r,10),f=o(f,h,l,r,n,t[8],0,11),l=i(l,10),n=o(n,f,h,l,r,t[9],0,13),h=i(h,10),r=o(r,n,f,h,l,t[10],0,14),f=i(f,10),l=o(l,r,n,f,h,t[11],0,15),n=i(n,10),h=o(h,l,r,n,f,t[12],0,6),r=i(r,10),f=o(f,h,l,r,n,t[13],0,7),l=i(l,10),n=o(n,f,h,l,r,t[14],0,9),h=i(h,10),r=o(r,n,f,h,l,t[15],0,8),f=i(f,10),l=a(l,r,n,f,h,t[7],1518500249,7),n=i(n,10),h=a(h,l,r,n,f,t[4],1518500249,6),r=i(r,10),f=a(f,h,l,r,n,t[13],1518500249,8),l=i(l,10),n=a(n,f,h,l,r,t[1],1518500249,13),h=i(h,10),r=a(r,n,f,h,l,t[10],1518500249,11),f=i(f,10),l=a(l,r,n,f,h,t[6],1518500249,9),n=i(n,10),h=a(h,l,r,n,f,t[15],1518500249,7),r=i(r,10),f=a(f,h,l,r,n,t[3],1518500249,15),l=i(l,10),n=a(n,f,h,l,r,t[12],1518500249,7),h=i(h,10),r=a(r,n,f,h,l,t[0],1518500249,12),f=i(f,10),l=a(l,r,n,f,h,t[9],1518500249,15),n=i(n,10),h=a(h,l,r,n,f,t[5],1518500249,9),r=i(r,10),f=a(f,h,l,r,n,t[2],1518500249,11),l=i(l,10),n=a(n,f,h,l,r,t[14],1518500249,7),h=i(h,10),r=a(r,n,f,h,l,t[11],1518500249,13),f=i(f,10),l=a(l,r,n,f,h,t[8],1518500249,12),n=i(n,10),h=s(h,l,r,n,f,t[3],1859775393,11),r=i(r,10),f=s(f,h,l,r,n,t[10],1859775393,13),l=i(l,10),n=s(n,f,h,l,r,t[14],1859775393,6),h=i(h,10),r=s(r,n,f,h,l,t[4],1859775393,7),f=i(f,10),l=s(l,r,n,f,h,t[9],1859775393,14),n=i(n,10),h=s(h,l,r,n,f,t[15],1859775393,9),r=i(r,10),f=s(f,h,l,r,n,t[8],1859775393,13),l=i(l,10),n=s(n,f,h,l,r,t[1],1859775393,15),h=i(h,10),r=s(r,n,f,h,l,t[2],1859775393,14),f=i(f,10),l=s(l,r,n,f,h,t[7],1859775393,8),n=i(n,10),h=s(h,l,r,n,f,t[0],1859775393,13),r=i(r,10),f=s(f,h,l,r,n,t[6],1859775393,6),l=i(l,10),n=s(n,f,h,l,r,t[13],1859775393,5),h=i(h,10),r=s(r,n,f,h,l,t[11],1859775393,12),f=i(f,10),l=s(l,r,n,f,h,t[5],1859775393,7),n=i(n,10),h=s(h,l,r,n,f,t[12],1859775393,5),r=i(r,10),f=u(f,h,l,r,n,t[1],2400959708,11),l=i(l,10),n=u(n,f,h,l,r,t[9],2400959708,12),h=i(h,10),r=u(r,n,f,h,l,t[11],2400959708,14),f=i(f,10),l=u(l,r,n,f,h,t[10],2400959708,15),n=i(n,10),h=u(h,l,r,n,f,t[0],2400959708,14),r=i(r,10),f=u(f,h,l,r,n,t[8],2400959708,15),l=i(l,10),n=u(n,f,h,l,r,t[12],2400959708,9),h=i(h,10),r=u(r,n,f,h,l,t[4],2400959708,8),f=i(f,10),l=u(l,r,n,f,h,t[13],2400959708,9),n=i(n,10),h=u(h,l,r,n,f,t[3],2400959708,14),r=i(r,10),f=u(f,h,l,r,n,t[7],2400959708,5),l=i(l,10),n=u(n,f,h,l,r,t[15],2400959708,6),h=i(h,10),r=u(r,n,f,h,l,t[14],2400959708,8),f=i(f,10),l=u(l,r,n,f,h,t[5],2400959708,6),n=i(n,10),h=u(h,l,r,n,f,t[6],2400959708,5),r=i(r,10),f=u(f,h,l,r,n,t[2],2400959708,12),l=i(l,10),n=c(n,f,h,l,r,t[4],2840853838,9),h=i(h,10),r=c(r,n,f,h,l,t[0],2840853838,15),f=i(f,10),l=c(l,r,n,f,h,t[5],2840853838,5),n=i(n,10),h=c(h,l,r,n,f,t[9],2840853838,11),r=i(r,10),f=c(f,h,l,r,n,t[7],2840853838,6),l=i(l,10),n=c(n,f,h,l,r,t[12],2840853838,8),h=i(h,10),r=c(r,n,f,h,l,t[2],2840853838,13),f=i(f,10),l=c(l,r,n,f,h,t[10],2840853838,12),n=i(n,10),h=c(h,l,r,n,f,t[14],2840853838,5),r=i(r,10),f=c(f,h,l,r,n,t[1],2840853838,12),l=i(l,10),n=c(n,f,h,l,r,t[3],2840853838,13),h=i(h,10),r=c(r,n,f,h,l,t[8],2840853838,14),f=i(f,10),l=c(l,r,n,f,h,t[11],2840853838,11),n=i(n,10),h=c(h,l,r,n,f,t[6],2840853838,8),r=i(r,10),f=c(f,h,l,r,n,t[15],2840853838,5),l=i(l,10),n=c(n,f,h,l,r,t[13],2840853838,6),h=i(h,10);var d=this._a,p=this._b,m=this._c,b=this._d,v=this._e;d=c(d,p,m,b,v,t[5],1352829926,8),m=i(m,10),v=c(v,d,p,m,b,t[14],1352829926,9),p=i(p,10),b=c(b,v,d,p,m,t[7],1352829926,9),d=i(d,10),m=c(m,b,v,d,p,t[0],1352829926,11),v=i(v,10),p=c(p,m,b,v,d,t[9],1352829926,13),b=i(b,10),d=c(d,p,m,b,v,t[2],1352829926,15),m=i(m,10),v=c(v,d,p,m,b,t[11],1352829926,15),p=i(p,10),b=c(b,v,d,p,m,t[4],1352829926,5),d=i(d,10),m=c(m,b,v,d,p,t[13],1352829926,7),v=i(v,10),p=c(p,m,b,v,d,t[6],1352829926,7),b=i(b,10),d=c(d,p,m,b,v,t[15],1352829926,8),m=i(m,10),v=c(v,d,p,m,b,t[8],1352829926,11),p=i(p,10),b=c(b,v,d,p,m,t[1],1352829926,14),d=i(d,10),m=c(m,b,v,d,p,t[10],1352829926,14),v=i(v,10),p=c(p,m,b,v,d,t[3],1352829926,12),b=i(b,10),d=c(d,p,m,b,v,t[12],1352829926,6),m=i(m,10),v=u(v,d,p,m,b,t[6],1548603684,9),p=i(p,10),b=u(b,v,d,p,m,t[11],1548603684,13),d=i(d,10),m=u(m,b,v,d,p,t[3],1548603684,15),v=i(v,10),p=u(p,m,b,v,d,t[7],1548603684,7),b=i(b,10),d=u(d,p,m,b,v,t[0],1548603684,12),m=i(m,10),v=u(v,d,p,m,b,t[13],1548603684,8),p=i(p,10),b=u(b,v,d,p,m,t[5],1548603684,9),d=i(d,10),m=u(m,b,v,d,p,t[10],1548603684,11),v=i(v,10),p=u(p,m,b,v,d,t[14],1548603684,7),b=i(b,10),d=u(d,p,m,b,v,t[15],1548603684,7),m=i(m,10),v=u(v,d,p,m,b,t[8],1548603684,12),p=i(p,10),b=u(b,v,d,p,m,t[12],1548603684,7),d=i(d,10),m=u(m,b,v,d,p,t[4],1548603684,6),v=i(v,10),p=u(p,m,b,v,d,t[9],1548603684,15),b=i(b,10),d=u(d,p,m,b,v,t[1],1548603684,13),m=i(m,10),v=u(v,d,p,m,b,t[2],1548603684,11),p=i(p,10),b=s(b,v,d,p,m,t[15],1836072691,9),d=i(d,10),m=s(m,b,v,d,p,t[5],1836072691,7),v=i(v,10),p=s(p,m,b,v,d,t[1],1836072691,15),b=i(b,10),d=s(d,p,m,b,v,t[3],1836072691,11),m=i(m,10),v=s(v,d,p,m,b,t[7],1836072691,8),p=i(p,10),b=s(b,v,d,p,m,t[14],1836072691,6),d=i(d,10),m=s(m,b,v,d,p,t[6],1836072691,6),v=i(v,10),p=s(p,m,b,v,d,t[9],1836072691,14),b=i(b,10),d=s(d,p,m,b,v,t[11],1836072691,12),m=i(m,10),v=s(v,d,p,m,b,t[8],1836072691,13),p=i(p,10),b=s(b,v,d,p,m,t[12],1836072691,5),d=i(d,10),m=s(m,b,v,d,p,t[2],1836072691,14),v=i(v,10),p=s(p,m,b,v,d,t[10],1836072691,13),b=i(b,10),d=s(d,p,m,b,v,t[0],1836072691,13),m=i(m,10),v=s(v,d,p,m,b,t[4],1836072691,7),p=i(p,10),b=s(b,v,d,p,m,t[13],1836072691,5),d=i(d,10),m=a(m,b,v,d,p,t[8],2053994217,15),v=i(v,10),p=a(p,m,b,v,d,t[6],2053994217,5),b=i(b,10),d=a(d,p,m,b,v,t[4],2053994217,8),m=i(m,10),v=a(v,d,p,m,b,t[1],2053994217,11),p=i(p,10),b=a(b,v,d,p,m,t[3],2053994217,14),d=i(d,10),m=a(m,b,v,d,p,t[11],2053994217,14),v=i(v,10),p=a(p,m,b,v,d,t[15],2053994217,6),b=i(b,10),d=a(d,p,m,b,v,t[0],2053994217,14),m=i(m,10),v=a(v,d,p,m,b,t[5],2053994217,6),p=i(p,10),b=a(b,v,d,p,m,t[12],2053994217,9),d=i(d,10),m=a(m,b,v,d,p,t[2],2053994217,12),v=i(v,10),p=a(p,m,b,v,d,t[13],2053994217,9),b=i(b,10),d=a(d,p,m,b,v,t[9],2053994217,12),m=i(m,10),v=a(v,d,p,m,b,t[7],2053994217,5),p=i(p,10),b=a(b,v,d,p,m,t[10],2053994217,15),d=i(d,10),m=a(m,b,v,d,p,t[14],2053994217,8),v=i(v,10),p=o(p,m,b,v,d,t[12],0,8),b=i(b,10),d=o(d,p,m,b,v,t[15],0,5),m=i(m,10),v=o(v,d,p,m,b,t[10],0,12),p=i(p,10),b=o(b,v,d,p,m,t[4],0,9),d=i(d,10),m=o(m,b,v,d,p,t[1],0,12),v=i(v,10),p=o(p,m,b,v,d,t[5],0,5),b=i(b,10),d=o(d,p,m,b,v,t[8],0,14),m=i(m,10),v=o(v,d,p,m,b,t[7],0,6),p=i(p,10),b=o(b,v,d,p,m,t[6],0,8),d=i(d,10),m=o(m,b,v,d,p,t[2],0,13),v=i(v,10),p=o(p,m,b,v,d,t[13],0,6),b=i(b,10),d=o(d,p,m,b,v,t[14],0,5),m=i(m,10),v=o(v,d,p,m,b,t[0],0,15),p=i(p,10),b=o(b,v,d,p,m,t[3],0,13),d=i(d,10),m=o(m,b,v,d,p,t[9],0,11),v=i(v,10),p=o(p,m,b,v,d,t[11],0,11),b=i(b,10);var y=this._b+f+b|0;this._b=this._c+h+v|0,this._c=this._d+l+d|0,this._d=this._e+r+p|0,this._e=this._a+n+m|0,this._a=y},n.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=new e(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=n}).call(e,r(0).Buffer)},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"===typeof t}function i(t){return"number"===typeof t}function o(t){return"object"===typeof t&&null!==t}function a(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,i,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(r=this._events[t],a(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(o(r))for(s=Array.prototype.slice.call(arguments,1),c=r.slice(),i=c.length,u=0;u0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"===typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,a,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){e=t.exports=r(79),e.Stream=e,e.Readable=e,e.Writable=r(55),e.Duplex=r(24),e.Transform=r(82),e.PassThrough=r(205)},function(t,e,r){"use strict";(function(e,n,i){function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){A(e,t)}}function a(t){return j.from(t)}function s(t){return j.isBuffer(t)||t instanceof N}function u(){}function c(t,e){T=T||r(24),t=t||{},this.objectMode=!!t.objectMode,e instanceof T&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i,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 a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){y(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 o(this)}function f(t){if(T=T||r(24),!L.call(f,this)&&!(this instanceof T))return new f(t);this._writableState=new c(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)),O.call(this)}function h(t,e){var r=new Error("write after end");t.emit("error",r),C(e,r)}function l(t,e,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),C(n,o),i=!1),i}function d(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=j.from(e,r)),e}function p(t,e,r,n,i,o){if(!r){var a=d(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?n:C;f.WritableState=c;var P=r(32);P.inherits=r(1);var R={deprecate:r(204)},O=r(80),j=r(2).Buffer,N=i.Uint8Array||function(){},B=r(81);P.inherits(f,O),c.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(c.prototype,"buffer",{get:R.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}();var L;"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(L=Function.prototype[Symbol.hasInstance],Object.defineProperty(f,Symbol.hasInstance,{value:function(t){return!!L.call(this,t)||t&&t._writableState instanceof c}})):L=function(t){return t instanceof this},f.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},f.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=s(t)&&!n.objectMode;return o&&!j.isBuffer(t)&&(t=a(t)),"function"===typeof e&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),"function"!==typeof r&&(r=u),n.ended?h(this,r):(o||l(this,n,t,r))&&(n.pendingcb++,i=p(this,n,o,t,e,r)),i},f.prototype.cork=function(){this._writableState.corked++},f.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},f.prototype.setDefaultEncoding=function(t){if("string"===typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},f.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},f.prototype._writev=null,f.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&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||S(this,n,r)},Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),f.prototype.destroy=B.destroy,f.prototype._undestroy=B.undestroy,f.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,r(8),r(30).setImmediate,r(4))},function(t,e,r){var e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};e.sha=r(210),e.sha1=r(211),e.sha224=r(212),e.sha256=r(83),e.sha384=r(213),e.sha512=r(84)},function(t,e,r){function n(){return Object.keys(a)}var i=r(220),o=r(228),a=r(93);e.createCipher=e.Cipher=i.createCipher,e.createCipheriv=e.Cipheriv=i.createCipheriv,e.createDecipher=e.Decipher=o.createDecipher,e.createDecipheriv=e.Decipheriv=o.createDecipheriv,e.listCiphers=e.getCiphers=n},function(t,e,r){var n={ECB:r(221),CBC:r(222),CFB:r(223),CFB8:r(224),CFB1:r(225),OFB:r(226),CTR:r(91),GCM:r(91)},i=r(93);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},function(t,e,r){"use strict";e.utils=r(230),e.Cipher=r(231),e.DES=r(232),e.CBC=r(233),e.EDE=r(234)},function(t,e,r){(function(e){function n(t){var e=o(t);return{blinder:e.toRed(a.mont(t.modulus)).redPow(new a(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}function i(t,r){var i=n(r),o=r.modulus.byteLength(),s=(a.mont(r.modulus),new a(t).mul(i.blinder).umod(r.modulus)),u=s.toRed(a.mont(r.prime1)),c=s.toRed(a.mont(r.prime2)),f=r.coefficient,h=r.prime1,l=r.prime2,d=u.redPow(r.exponent1),p=c.redPow(r.exponent2);d=d.fromRed(),p=p.fromRed();var m=d.isub(p).imul(f).umod(h);return m.imul(l),p.iadd(m),new e(p.imul(i.unblinder).umod(r.modulus).toArray(!1,o))}function o(t){for(var e=t.modulus.byteLength(),r=new a(s(e));r.cmp(t.modulus)>=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new a(s(e));return r}var a=r(3),s=r(27);t.exports=i,i.getr=o}).call(e,r(0).Buffer)},function(t,e,r){var n=e;n.utils=r(16),n.common=r(34),n.sha=r(250),n.ripemd=r(254),n.hmac=r(255),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){var n=e;n.utils=r(17),n.common=r(37),n.sha=r(293),n.ripemd=r(297),n.hmac=r(298),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(t,e,r){"use strict";function n(){}function i(t){try{return t.then}catch(t){return v=t,y}}function o(t,e){try{return t(e)}catch(t){return v=t,y}}function a(t,e,r){try{t(e,r)}catch(t){return v=t,y}}function s(t){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("Promise constructor's argument is not a function");this._75=0,this._83=0,this._18=null,this._38=null,t!==n&&m(t,this)}function u(t,e,r){return new t.constructor(function(i,o){var a=new s(n);a.then(i,o),c(t,new p(e,r,a))})}function c(t,e){for(;3===t._83;)t=t._18;if(s._47&&s._47(t),0===t._83)return 0===t._75?(t._75=1,void(t._38=e)):1===t._75?(t._75=2,void(t._38=[t._38,e])):void t._38.push(e);f(t,e)}function f(t,e){b(function(){var r=1===t._83?e.onFulfilled:e.onRejected;if(null===r)return void(1===t._83?h(e.promise,t._18):l(e.promise,t._18));var n=o(r,t._18);n===y?l(e.promise,v):h(e.promise,n)})}function h(t,e){if(e===t)return l(t,new TypeError("A promise cannot be resolved with itself."));if(e&&("object"===typeof e||"function"===typeof e)){var r=i(e);if(r===y)return l(t,v);if(r===t.then&&e instanceof s)return t._83=3,t._18=e,void d(t);if("function"===typeof r)return void m(r.bind(e),t)}t._83=1,t._18=e,d(t)}function l(t,e){t._83=2,t._18=e,s._71&&s._71(t,e),d(t)}function d(t){if(1===t._75&&(c(t,t._38),t._38=null),2===t._75){for(var e=0;e7&&t[r].toUpperCase()!==t[r]||parseInt(e[r],16)<=7&&t[r].toLowerCase()!==t[r])return!1;return!0},p=function(t,e,r){var n=/^0x/i.test(t)||"number"===typeof t;t=t.toString(16).replace(/^0x/i,"");var i=e-t.length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+t},m=function(t,e,r){var n=/^0x/i.test(t)||"number"===typeof t;t=t.toString(16).replace(/^0x/i,"");var i=e-t.length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")},b=function(t){t=a.encode(t);var e="";t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join(""),t=t.replace(/^(?:\u0000)*/,""),t=t.split("").reverse().join("");for(var r=0;r>>4).toString(16)),e.push((15&t[r]).toString(16));return"0x"+e.join("")},M=function(t){if(t=t.toString(16),!E(t))throw new Error('Given value "'+t+'" is not a valid hex string.');t=t.replace(/^0x/i,"");for(var e=[],r=0;r=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function s(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}function u(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}function c(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;i=0|t.words[p],o=0|e.words[d],a=i*o+h,f+=a/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()}function f(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0,i+=a>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}function h(t,e,r){return(new l).mulp(t,e,r)}function l(t,e){this.x=t,this.y=e}function d(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){d.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function m(){d.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){d.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function v(){d.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function y(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function g(t){y.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;var _;try{_=r(0).Buffer}catch(t){}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.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,u=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var w=["","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"],M=[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],k=[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];o.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215,r=0!==o||a!==this.length-1?w[6-u.length]+u+r:u+r,i+=2,i>=26&&(i-=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=M[t],f=k[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var l=h.modn(f).toString(t);h=h.idivn(f),r=h.isZero()?l+r:w[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}n(!1,"Base should be between 2 and 36")},o.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n("undefined"!==typeof _),this.toArrayLike(_,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=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},o.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},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.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)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.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)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"===typeof t&&t>=0);var r=t/26|0,i=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)},o.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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,b=0|a[2],v=8191&b,y=b>>>13,g=0|a[3],_=8191&g,w=g>>>13,M=0|a[4],k=8191&M,E=M>>>13,x=0|a[5],S=8191&x,A=x>>>13,C=0|a[6],T=8191&C,I=C>>>13,P=0|a[7],R=8191&P,O=P>>>13,j=0|a[8],N=8191&j,B=j>>>13,L=0|a[9],F=8191&L,D=L>>>13,U=0|s[0],q=8191&U,z=U>>>13,H=0|s[1],V=8191&H,K=H>>>13,Y=0|s[2],G=8191&Y,W=Y>>>13,Z=0|s[3],X=8191&Z,$=Z>>>13,Q=0|s[4],J=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],ht=8191&ft,lt=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19,n=Math.imul(h,q),i=Math.imul(h,z),i=i+Math.imul(l,q)|0,o=Math.imul(l,z);var bt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(p,q),i=Math.imul(p,z),i=i+Math.imul(m,q)|0,o=Math.imul(m,z),n=n+Math.imul(h,V)|0,i=i+Math.imul(h,K)|0,i=i+Math.imul(l,V)|0,o=o+Math.imul(l,K)|0;var vt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,q),i=Math.imul(v,z),i=i+Math.imul(y,q)|0,o=Math.imul(y,z),n=n+Math.imul(p,V)|0,i=i+Math.imul(p,K)|0,i=i+Math.imul(m,V)|0,o=o+Math.imul(m,K)|0,n=n+Math.imul(h,G)|0,i=i+Math.imul(h,W)|0,i=i+Math.imul(l,G)|0,o=o+Math.imul(l,W)|0;var yt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(_,q),i=Math.imul(_,z),i=i+Math.imul(w,q)|0,o=Math.imul(w,z),n=n+Math.imul(v,V)|0,i=i+Math.imul(v,K)|0,i=i+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,G)|0,i=i+Math.imul(p,W)|0,i=i+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(h,X)|0,i=i+Math.imul(h,$)|0,i=i+Math.imul(l,X)|0,o=o+Math.imul(l,$)|0;var gt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(k,q),i=Math.imul(k,z),i=i+Math.imul(E,q)|0,o=Math.imul(E,z),n=n+Math.imul(_,V)|0,i=i+Math.imul(_,K)|0,i=i+Math.imul(w,V)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(v,G)|0,i=i+Math.imul(v,W)|0,i=i+Math.imul(y,G)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,$)|0,i=i+Math.imul(m,X)|0,o=o+Math.imul(m,$)|0,n=n+Math.imul(h,J)|0,i=i+Math.imul(h,tt)|0,i=i+Math.imul(l,J)|0,o=o+Math.imul(l,tt)|0;var _t=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,q),i=Math.imul(S,z),i=i+Math.imul(A,q)|0,o=Math.imul(A,z),n=n+Math.imul(k,V)|0,i=i+Math.imul(k,K)|0,i=i+Math.imul(E,V)|0,o=o+Math.imul(E,K)|0,n=n+Math.imul(_,G)|0,i=i+Math.imul(_,W)|0,i=i+Math.imul(w,G)|0,o=o+Math.imul(w,W)|0,n=n+Math.imul(v,X)|0,i=i+Math.imul(v,$)|0,i=i+Math.imul(y,X)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,tt)|0,i=i+Math.imul(m,J)|0,o=o+Math.imul(m,tt)|0,n=n+Math.imul(h,rt)|0,i=i+Math.imul(h,nt)|0,i=i+Math.imul(l,rt)|0,o=o+Math.imul(l,nt)|0;var wt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(T,q),i=Math.imul(T,z),i=i+Math.imul(I,q)|0,o=Math.imul(I,z),n=n+Math.imul(S,V)|0,i=i+Math.imul(S,K)|0,i=i+Math.imul(A,V)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(k,G)|0,i=i+Math.imul(k,W)|0,i=i+Math.imul(E,G)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,X)|0,i=i+Math.imul(_,$)|0,i=i+Math.imul(w,X)|0,o=o+Math.imul(w,$)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,tt)|0,i=i+Math.imul(y,J)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=i+Math.imul(p,nt)|0,i=i+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0,n=n+Math.imul(h,ot)|0,i=i+Math.imul(h,at)|0,i=i+Math.imul(l,ot)|0,o=o+Math.imul(l,at)|0;var Mt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,q),i=Math.imul(R,z),i=i+Math.imul(O,q)|0,o=Math.imul(O,z),n=n+Math.imul(T,V)|0,i=i+Math.imul(T,K)|0,i=i+Math.imul(I,V)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(S,G)|0,i=i+Math.imul(S,W)|0,i=i+Math.imul(A,G)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,$)|0,i=i+Math.imul(E,X)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(_,J)|0,i=i+Math.imul(_,tt)|0,i=i+Math.imul(w,J)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(v,rt)|0,i=i+Math.imul(v,nt)|0,i=i+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=i+Math.imul(p,at)|0,i=i+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0,n=n+Math.imul(h,ut)|0,i=i+Math.imul(h,ct)|0,i=i+Math.imul(l,ut)|0,o=o+Math.imul(l,ct)|0;var kt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,q),i=Math.imul(N,z),i=i+Math.imul(B,q)|0,o=Math.imul(B,z),n=n+Math.imul(R,V)|0,i=i+Math.imul(R,K)|0,i=i+Math.imul(O,V)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(T,G)|0,i=i+Math.imul(T,W)|0,i=i+Math.imul(I,G)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(S,X)|0,i=i+Math.imul(S,$)|0,i=i+Math.imul(A,X)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,tt)|0,i=i+Math.imul(E,J)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=i+Math.imul(_,nt)|0,i=i+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(v,ot)|0,i=i+Math.imul(v,at)|0,i=i+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=i+Math.imul(p,ct)|0,i=i+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0,n=n+Math.imul(h,ht)|0,i=i+Math.imul(h,lt)|0,i=i+Math.imul(l,ht)|0,o=o+Math.imul(l,lt)|0;var Et=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(F,q),i=Math.imul(F,z),i=i+Math.imul(D,q)|0,o=Math.imul(D,z),n=n+Math.imul(N,V)|0,i=i+Math.imul(N,K)|0,i=i+Math.imul(B,V)|0,o=o+Math.imul(B,K)|0,n=n+Math.imul(R,G)|0,i=i+Math.imul(R,W)|0,i=i+Math.imul(O,G)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,X)|0,i=i+Math.imul(T,$)|0,i=i+Math.imul(I,X)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(S,J)|0,i=i+Math.imul(S,tt)|0,i=i+Math.imul(A,J)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(k,rt)|0,i=i+Math.imul(k,nt)|0,i=i+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=i+Math.imul(_,at)|0,i=i+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(v,ut)|0,i=i+Math.imul(v,ct)|0,i=i+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,ht)|0,i=i+Math.imul(p,lt)|0,i=i+Math.imul(m,ht)|0,o=o+Math.imul(m,lt)|0,n=n+Math.imul(h,pt)|0,i=i+Math.imul(h,mt)|0,i=i+Math.imul(l,pt)|0,o=o+Math.imul(l,mt)|0;var xt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,V),i=Math.imul(F,K),i=i+Math.imul(D,V)|0,o=Math.imul(D,K),n=n+Math.imul(N,G)|0,i=i+Math.imul(N,W)|0,i=i+Math.imul(B,G)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,$)|0,i=i+Math.imul(O,X)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(T,J)|0,i=i+Math.imul(T,tt)|0,i=i+Math.imul(I,J)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(S,rt)|0,i=i+Math.imul(S,nt)|0,i=i+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(k,ot)|0,i=i+Math.imul(k,at)|0,i=i+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(_,ut)|0,i=i+Math.imul(_,ct)|0,i=i+Math.imul(w,ut)|0,o=o+Math.imul(w,ct)|0,n=n+Math.imul(v,ht)|0,i=i+Math.imul(v,lt)|0,i=i+Math.imul(y,ht)|0,o=o+Math.imul(y,lt)|0,n=n+Math.imul(p,pt)|0,i=i+Math.imul(p,mt)|0,i=i+Math.imul(m,pt)|0,o=o+Math.imul(m,mt)|0;var St=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,G),i=Math.imul(F,W),i=i+Math.imul(D,G)|0,o=Math.imul(D,W),n=n+Math.imul(N,X)|0,i=i+Math.imul(N,$)|0,i=i+Math.imul(B,X)|0,o=o+Math.imul(B,$)|0,n=n+Math.imul(R,J)|0,i=i+Math.imul(R,tt)|0,i=i+Math.imul(O,J)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(T,rt)|0,i=i+Math.imul(T,nt)|0,i=i+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(S,ot)|0,i=i+Math.imul(S,at)|0,i=i+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(k,ut)|0,i=i+Math.imul(k,ct)|0,i=i+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(_,ht)|0,i=i+Math.imul(_,lt)|0,i=i+Math.imul(w,ht)|0,o=o+Math.imul(w,lt)|0,n=n+Math.imul(v,pt)|0,i=i+Math.imul(v,mt)|0,i=i+Math.imul(y,pt)|0,o=o+Math.imul(y,mt)|0;var At=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(F,X),i=Math.imul(F,$),i=i+Math.imul(D,X)|0,o=Math.imul(D,$),n=n+Math.imul(N,J)|0,i=i+Math.imul(N,tt)|0,i=i+Math.imul(B,J)|0,o=o+Math.imul(B,tt)|0,n=n+Math.imul(R,rt)|0,i=i+Math.imul(R,nt)|0,i=i+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(T,ot)|0,i=i+Math.imul(T,at)|0,i=i+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(S,ut)|0,i=i+Math.imul(S,ct)|0,i=i+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(k,ht)|0,i=i+Math.imul(k,lt)|0,i=i+Math.imul(E,ht)|0,o=o+Math.imul(E,lt)|0,n=n+Math.imul(_,pt)|0,i=i+Math.imul(_,mt)|0,i=i+Math.imul(w,pt)|0,o=o+Math.imul(w,mt)|0;var Ct=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(F,J),i=Math.imul(F,tt),i=i+Math.imul(D,J)|0,o=Math.imul(D,tt),n=n+Math.imul(N,rt)|0,i=i+Math.imul(N,nt)|0,i=i+Math.imul(B,rt)|0,o=o+Math.imul(B,nt)|0,n=n+Math.imul(R,ot)|0,i=i+Math.imul(R,at)|0,i=i+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(T,ut)|0,i=i+Math.imul(T,ct)|0,i=i+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(S,ht)|0,i=i+Math.imul(S,lt)|0,i=i+Math.imul(A,ht)|0,o=o+Math.imul(A,lt)|0,n=n+Math.imul(k,pt)|0,i=i+Math.imul(k,mt)|0,i=i+Math.imul(E,pt)|0,o=o+Math.imul(E,mt)|0;var Tt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,rt),i=Math.imul(F,nt),i=i+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(N,ot)|0,i=i+Math.imul(N,at)|0,i=i+Math.imul(B,ot)|0,o=o+Math.imul(B,at)|0,n=n+Math.imul(R,ut)|0,i=i+Math.imul(R,ct)|0,i=i+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(T,ht)|0,i=i+Math.imul(T,lt)|0,i=i+Math.imul(I,ht)|0,o=o+Math.imul(I,lt)|0,n=n+Math.imul(S,pt)|0,i=i+Math.imul(S,mt)|0,i=i+Math.imul(A,pt)|0,o=o+Math.imul(A,mt)|0;var It=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,ot),i=Math.imul(F,at),i=i+Math.imul(D,ot)|0,o=Math.imul(D,at),n=n+Math.imul(N,ut)|0,i=i+Math.imul(N,ct)|0,i=i+Math.imul(B,ut)|0,o=o+Math.imul(B,ct)|0,n=n+Math.imul(R,ht)|0,i=i+Math.imul(R,lt)|0,i=i+Math.imul(O,ht)|0,o=o+Math.imul(O,lt)|0,n=n+Math.imul(T,pt)|0,i=i+Math.imul(T,mt)|0,i=i+Math.imul(I,pt)|0,o=o+Math.imul(I,mt)|0;var Pt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,ut),i=Math.imul(F,ct),i=i+Math.imul(D,ut)|0,o=Math.imul(D,ct),n=n+Math.imul(N,ht)|0,i=i+Math.imul(N,lt)|0,i=i+Math.imul(B,ht)|0,o=o+Math.imul(B,lt)|0,n=n+Math.imul(R,pt)|0,i=i+Math.imul(R,mt)|0,i=i+Math.imul(O,pt)|0,o=o+Math.imul(O,mt)|0;var Rt=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(F,ht),i=Math.imul(F,lt),i=i+Math.imul(D,ht)|0,o=Math.imul(D,lt),n=n+Math.imul(N,pt)|0,i=i+Math.imul(N,mt)|0,i=i+Math.imul(B,pt)|0,o=o+Math.imul(B,mt)|0;var Ot=(c+n|0)+((8191&i)<<13)|0;c=(o+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,pt),i=Math.imul(F,mt),i=i+Math.imul(D,pt)|0,o=Math.imul(D,mt);var jt=(c+n|0)+((8191&i)<<13)|0;return c=(o+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=bt,u[1]=vt,u[2]=yt,u[3]=gt,u[4]=_t,u[5]=wt,u[6]=Mt,u[7]=kt,u[8]=Et,u[9]=xt,u[10]=St,u[11]=At,u[12]=Ct,u[13]=Tt,u[14]=It,u[15]=Pt,u[16]=Rt,u[17]=Ot,u[18]=jt,0!==c&&(u[19]=c,r.length++),r};Math.imul||(E=c),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?E(this,t,e):r<63?c(this,t,e):r<1024?f(this,t,e):h(this,t,e)},l.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},l.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=u(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0);var i;i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var h=0|this.words[c];this.words[c]=f<<26-o|h>>>o,f=h&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"===typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){s=new o(null),s.length=u+1,s.words=new Array(s.length);for(var c=0;c=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=l)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){if(n(!t.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var i,a,s;return 0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e)},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),h=e.clone();!e.isZero();){for(var l=0,d=1;0===(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(h)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(h)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,c=1;0===(e.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(e.iushrn(u);u-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var f=0,h=1;0===(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a)):(r.isub(e),a.isub(i))}var l;return l=0===e.cmpn(1)?i:a,l.cmpn(0)<0&&l.iadd(t),l},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"===typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new y(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var x={k256:null,p224:null,p192:null,p25519:null};d.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},d.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},d.prototype.split=function(t,e){t.iushrn(this.n,0,e)},d.prototype.imulK=function(t){return t.imul(this.k)},i(p,d),p.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(x[t])return x[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new m;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new v}return x[t]=e,e},y.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},y.prototype._verify2=function(t,e){n(0===(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},y.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},y.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},y.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},y.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},y.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},y.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},y.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},y.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},y.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},y.prototype.isqr=function(t){return this.imul(t,t.clone())},y.prototype.sqr=function(t){return this.mul(t,t)},y.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var h=this.pow(f,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,b=0;0!==m.cmp(s);b++)m=m.redSqr();n(b=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var h=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},y.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},y.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new g(t)},i(g,y),g.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},g.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},g.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},g.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},g.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"===typeof t||t,this)}).call(e,r(18)(t))},function(t,e){var r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=function(t){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:function(t){return[].concat(t,t,t,t,t)}([0,0,0,0,0,0,0,0,0,0])}},s=function(t,e){for(var o,a,s=e.length,c=t.blocks,f=t.blockCount<<2,h=t.blockCount,l=t.outputBlocks,d=t.s,p=0;p>2]|=e[p]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(c[o>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=f){for(t.start=o-f,t.block=c[h],o=0;o>2]|=n[3&o],t.lastByteIndex===f)for(c[0]=c[h],o=1;o>4&15]+r[15&m]+r[m>>12&15]+r[m>>8&15]+r[m>>20&15]+r[m>>16&15]+r[m>>28&15]+r[m>>24&15];v%h===0&&(u(d),o=0)}return"0x"+b},u=function(t){var e,r,n,i,a,s,u,c,f,h,l,d,p,m,b,v,y,g,_,w,M,k,E,x,S,A,C,T,I,P,R,O,j,N,B,L,F,D,U,q,z,H,V,K,Y,G,W,Z,X,$,Q,J,tt,et,rt,nt,it,ot,at,st,ut,ct,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],a=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],f=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=d^(s<<1|u>>>31),r=p^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(c<<1|f>>>31),r=a^(f<<1|c>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(h<<1|l>>>31),r=u^(l<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=c^(d<<1|p>>>31),r=f^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|a>>>31),r=l^(a<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],b=t[1],G=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,T=t[20]<<3|t[21]>>>29,I=t[21]<<3|t[20]>>>29,st=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,V=t[41]<<18|t[40]>>>14,N=t[2]<<1|t[3]>>>31,B=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,Z=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,L=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,Q=t[35]<<15|t[34]>>>17,O=t[45]<<29|t[44]>>>3,j=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,J=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,Y=t[9]<<27|t[8]>>>5,A=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,k=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=m^~v&g,t[1]=b^~y&_,t[10]=x^~A&T,t[11]=S^~C&I,t[20]=N^~L&D,t[21]=B^~F&U,t[30]=K^~G&Z,t[31]=Y^~W&X,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=v^~g&w,t[3]=y^~_&M,t[12]=A^~T&P,t[13]=C^~I&R,t[22]=L^~D&q,t[23]=F^~U&z,t[32]=G^~Z&$,t[33]=W^~X&Q,t[42]=nt^~ot&st,t[43]=it^~at&ut,t[4]=g^~w&k,t[5]=_^~M&E,t[14]=T^~P&O,t[15]=I^~R&j,t[24]=D^~q&H,t[25]=U^~z&V,t[34]=Z^~$&J,t[35]=X^~Q&tt,t[44]=ot^~st&ct,t[45]=at^~ut&ft,t[6]=w^~k&m,t[7]=M^~E&b,t[16]=P^~O&x,t[17]=R^~j&S,t[26]=q^~H&N,t[27]=z^~V&B,t[36]=$^~J&K,t[37]=Q^~tt&Y,t[46]=st^~ct&et,t[47]=ut^~ft&rt,t[8]=k^~m&v,t[9]=E^~b&y,t[18]=O^~x&A,t[19]=j^~S&C,t[28]=H^~N&L,t[29]=V^~B&F,t[38]=J^~K&G,t[39]=tt^~Y&W,t[48]=ct^~et&nt,t[49]=ft^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},c=function(t){return function(e){var r;if("0x"===e.slice(0,2)){r=[];for(var n=2,i=e.length;n=e&&n<=r?n-e+10:t}).join("")},s=function(t){for(var e,r=t;r.length>2;)e=r.slice(0,9),r=parseInt(e,10)%97+r.slice(e.length);return parseInt(r,10)%97},u=function(t){this._iban=t};u.toAddress=function(t){if(t=new u(t),!t.isDirect())throw new Error("IBAN is indirect and can't be converted");return t.toAddress()},u.toIban=function(t){return u.fromAddress(t).toString()},u.fromAddress=function(t){if(!n.isAddress(t))throw new Error("Provided address is not a valid address: "+t);t=t.replace("0x","").replace("0X","");var e=new i(t,16),r=e.toString(36),a=o(r,15);return u.fromBban(a.toUpperCase())},u.fromBban=function(t){var e=s(a("XE00"+t)),r=("0"+(98-e)).slice(-2);return new u("XE"+r+t)},u.createIndirect=function(t){return u.fromBban("ETH"+t.institution+t.identifier)},u.isValid=function(t){return new u(t).isValid()},u.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===s(a(this._iban))},u.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},u.prototype.isIndirect=function(){return 20===this._iban.length},u.prototype.checksum=function(){return this._iban.substr(2,2)},u.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},u.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},u.prototype.toAddress=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new i(t,36);return n.toChecksumAddress(e.toString(16,20))}return""},u.prototype.toString=function(){return this._iban},t.exports=u},function(t,e,r){"use strict";var n={messageId:0};n.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||[]}},n.isValidResponse=function(t){function e(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&("number"===typeof t.id||"string"===typeof t.id)&&void 0!==t.result}return Array.isArray(t)?t.every(e):e(t)},n.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(75),i=r(183),o=function(t){var e,r,o=new i(function(){e=arguments[0],r=arguments[1]});if(t)return{resolve:e,reject:r,eventEmitter:o};var a=new n;return o._events=a._events,o.emit=a.emit,o.on=a.on,o.once=a.once,o.off=a.off,o.listeners=a.listeners,o.addListener=a.addListener,o.removeListener=a.removeListener,o.removeAllListeners=a.removeAllListeners,{resolve:e,reject:r,eventEmitter:o}};o.resolve=function(t){var e=o(!0);return e.resolve(t),e.eventEmitter},t.exports=o},function(t,e,r){"use strict";function n(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(){}var o="function"!==typeof Object.create&&"~";i.prototype._events=void 0,i.prototype.listeners=function(t,e){var r=o?o+t:t,n=this._events&&this._events[r];if(e)return!!n;if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,s=new Array(a);i0?("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===L.prototype||(e=i(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):f(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?f(t,a,e,!1):y(t,a)):f(t,a,e,!1))):n||(a.reading=!1)}return l(a)}function f(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&b(t)),y(t,e)}function h(t,e){var r;return o(e)||"string"===typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(t){return!t.ended&&(t.needReadable||t.length=Y?t=Y:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function p(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=d(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function m(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,b(t)}}function b(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(q("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?R(v,t):v(t))}function v(t){q("emit readable"),t.emit("readable"),E(t)}function y(t,e){e.readingMore||(e.readingMore=!0,R(g,t,e))}function g(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=S(t,e.buffer,e.decoder),r}function S(t,e,r){var n;return 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}function C(t,e){var r=L.allocUnsafe(t),n=e.head,i=1;for(n.data.copy(r),t-=n.data.length;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}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,R(I,e,t))}function I(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 q("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?T(this):b(this),null;if(0===(t=p(t,e))&&e.ended)return 0===e.length&&T(this),null;var n=e.needReadable;q("need readable",n),(0===e.length||e.length-t