(self["webpackChunkANT_ETH"]=self["webpackChunkANT_ETH"]||[]).push([[540],{51223:function(e,t,a){var r=a(5112),n=a(70030),i=a(3070),c=r("unscopables"),f=Array.prototype;void 0==f[c]&&i.f(f,c,{configurable:!0,value:n(null)}),e.exports=function(e){f[c][e]=!0}},24019:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},90260:function(e,t,a){"use strict";var r,n,i,c=a(24019),f=a(19781),d=a(17854),o=a(60614),s=a(70111),b=a(92597),u=a(70648),h=a(66330),l=a(68880),p=a(31320),x=a(3070).f,m=a(47976),g=a(79518),v=a(27674),y=a(5112),w=a(69711),M=d.Int8Array,_=M&&M.prototype,k=d.Uint8ClampedArray,A=k&&k.prototype,S=M&&g(M),E=_&&g(_),B=Object.prototype,T=d.TypeError,P=y("toStringTag"),I=w("TYPED_ARRAY_TAG"),C=w("TYPED_ARRAY_CONSTRUCTOR"),R=c&&!!v&&"Opera"!==u(d.opera),O=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},L=function(e){if(!s(e))return!1;var t=u(e);return"DataView"===t||b(N,t)||b(U,t)},j=function(e){if(!s(e))return!1;var t=u(e);return b(N,t)||b(U,t)},q=function(e){if(j(e))return e;throw T("Target is not a typed array")},F=function(e){if(o(e)&&(!v||m(S,e)))return e;throw T(h(e)+" is not a typed array constructor")},D=function(e,t,a,r){if(f){if(a)for(var n in N){var i=d[n];if(i&&b(i.prototype,e))try{delete i.prototype[e]}catch(c){try{i.prototype[e]=t}catch(o){}}}E[e]&&!a||p(E,e,a?t:R&&_[e]||t,r)}},H=function(e,t,a){var r,n;if(f){if(v){if(a)for(r in N)if(n=d[r],n&&b(n,e))try{delete n[e]}catch(i){}if(S[e]&&!a)return;try{return p(S,e,a?t:R&&S[e]||t)}catch(i){}}for(r in N)n=d[r],!n||n[e]&&!a||p(n,e,t)}};for(r in N)n=d[r],i=n&&n.prototype,i?l(i,C,n):R=!1;for(r in U)n=d[r],i=n&&n.prototype,i&&l(i,C,n);if((!R||!o(S)||S===Function.prototype)&&(S=function(){throw T("Incorrect invocation")},R))for(r in N)d[r]&&v(d[r],S);if((!R||!E||E===B)&&(E=S.prototype,R))for(r in N)d[r]&&v(d[r].prototype,E);if(R&&g(A)!==E&&v(A,E),f&&!b(E,P))for(r in O=!0,x(E,P,{get:function(){return s(this)?this[I]:void 0}}),N)d[r]&&l(d[r],I,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:R,TYPED_ARRAY_CONSTRUCTOR:C,TYPED_ARRAY_TAG:O&&I,aTypedArray:q,aTypedArrayConstructor:F,exportTypedArrayMethod:D,exportTypedArrayStaticMethod:H,isView:L,isTypedArray:j,TypedArray:S,TypedArrayPrototype:E}},50206:function(e,t,a){var r=a(1702);e.exports=r([].slice)},49920:function(e,t,a){var r=a(47293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},6833:function(e,t,a){var r=a(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},35268:function(e,t,a){var r=a(84326),n=a(17854);e.exports="process"==r(n.process)},49974:function(e,t,a){var r=a(1702),n=a(19662),i=a(34374),c=r(r.bind);e.exports=function(e,t){return n(e),void 0===t?e:i?c(e,t):function(){return e.apply(t,arguments)}}},60490:function(e,t,a){var r=a(35005);e.exports=r("document","documentElement")},70030:function(e,t,a){var r,n=a(19670),i=a(36048),c=a(80748),f=a(3501),d=a(60490),o=a(80317),s=a(6200),b=">",u="<",h="prototype",l="script",p=s("IE_PROTO"),x=function(){},m=function(e){return u+l+b+e+u+"/"+l+b},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){var e,t=o("iframe"),a="java"+l+":";return t.style.display="none",d.appendChild(t),t.src=String(a),e=t.contentWindow.document,e.open(),e.write(m("document.F=Object")),e.close(),e.F},y=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}y="undefined"!=typeof document?document.domain&&r?g(r):v():g(r);var e=c.length;while(e--)delete y[h][c[e]];return y()};f[p]=!0,e.exports=Object.create||function(e,t){var a;return null!==e?(x[h]=n(e),a=new x,x[h]=null,a[p]=e):a=y(),void 0===t?a:i.f(a,t)}},36048:function(e,t,a){var r=a(19781),n=a(3353),i=a(3070),c=a(19670),f=a(45656),d=a(81956);t.f=r&&!n?Object.defineProperties:function(e,t){c(e);var a,r=f(t),n=d(t),o=n.length,s=0;while(o>s)i.f(e,a=n[s++],r[a]);return e}},79518:function(e,t,a){var r=a(17854),n=a(92597),i=a(60614),c=a(47908),f=a(6200),d=a(49920),o=f("IE_PROTO"),s=r.Object,b=s.prototype;e.exports=d?s.getPrototypeOf:function(e){var t=c(e);if(n(t,o))return t[o];var a=t.constructor;return i(a)&&t instanceof a?a.prototype:t instanceof s?b:null}},81956:function(e,t,a){var r=a(16324),n=a(80748);e.exports=Object.keys||function(e){return r(e,n)}},20261:function(e,t,a){var r,n,i,c,f=a(17854),d=a(22104),o=a(49974),s=a(60614),b=a(92597),u=a(47293),h=a(60490),l=a(50206),p=a(80317),x=a(48053),m=a(6833),g=a(35268),v=f.setImmediate,y=f.clearImmediate,w=f.process,M=f.Dispatch,_=f.Function,k=f.MessageChannel,A=f.String,S=0,E={},B="onreadystatechange";try{r=f.location}catch(R){}var T=function(e){if(b(E,e)){var t=E[e];delete E[e],t()}},P=function(e){return function(){T(e)}},I=function(e){T(e.data)},C=function(e){f.postMessage(A(e),r.protocol+"//"+r.host)};v&&y||(v=function(e){x(arguments.length,1);var t=s(e)?e:_(e),a=l(arguments,1);return E[++S]=function(){d(t,void 0,a)},n(S),S},y=function(e){delete E[e]},g?n=function(e){w.nextTick(P(e))}:M&&M.now?n=function(e){M.now(P(e))}:k&&!m?(i=new k,c=i.port2,i.port1.onmessage=I,n=o(c.postMessage,c)):f.addEventListener&&s(f.postMessage)&&!f.importScripts&&r&&"file:"!==r.protocol&&!u(C)?(n=C,f.addEventListener("message",I,!1)):n=B in p("script")?function(e){h.appendChild(p("script"))[B]=function(){h.removeChild(this),T(e)}}:function(e){setTimeout(P(e),0)}),e.exports={set:v,clear:y}},84590:function(e,t,a){var r=a(17854),n=a(73002),i=r.RangeError;e.exports=function(e,t){var a=n(e);if(a%t)throw i("Wrong offset");return a}},73002:function(e,t,a){var r=a(17854),n=a(19303),i=r.RangeError;e.exports=function(e){var t=n(e);if(t<0)throw i("The argument can't be less than 0");return t}},48053:function(e,t,a){var r=a(17854),n=r.TypeError;e.exports=function(e,t){if(e=0?r:a+r;return f<0||f>=a?void 0:t[f]}}),f("at")},24506:function(e,t,a){"use strict";var r=a(82109),n=a(1702),i=a(84488),c=a(19303),f=a(41340),d=a(47293),o=n("".charAt),s=d((function(){return"\ud842"!=="𠮷".at(-2)}));r({target:"String",proto:!0,forced:s},{at:function(e){var t=f(i(this)),a=t.length,r=c(e),n=r>=0?r:a+r;return n<0||n>=a?void 0:o(t,n)}})},48675:function(e,t,a){"use strict";var r=a(90260),n=a(26244),i=a(19303),c=r.aTypedArray,f=r.exportTypedArrayMethod;f("at",(function(e){var t=c(this),a=n(t),r=i(e),f=r>=0?r:a+r;return f<0||f>=a?void 0:t[f]}))},3462:function(e,t,a){"use strict";var r=a(17854),n=a(46916),i=a(90260),c=a(26244),f=a(84590),d=a(47908),o=a(47293),s=r.RangeError,b=r.Int8Array,u=b&&b.prototype,h=u&&u.set,l=i.aTypedArray,p=i.exportTypedArrayMethod,x=!o((function(){var e=new Uint8ClampedArray(2);return n(h,e,{length:1,0:3},1),3!==e[1]})),m=x&&i.NATIVE_ARRAY_BUFFER_VIEWS&&o((function(){var e=new b(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));p("set",(function(e){l(this);var t=f(arguments.length>1?arguments[1]:void 0,1),a=d(e);if(x)return n(h,this,a,t);var r=this.length,i=c(a),o=0;if(i+t>r)throw s("Wrong length");while(o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.chains=t._getInitializedChains=void 0;var i=n(a(87295)),c=n(a(31227)),f=n(a(40439)),d=n(a(37098)),o=n(a(17687)),s=n(a(49422));function b(e){var t,a,n={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli",11155111:"sepolia"},b={mainnet:i.default,ropsten:c.default,rinkeby:f.default,kovan:d.default,goerli:o.default,sepolia:s.default};if(e)try{for(var u=r(e),h=u.next();!h.done;h=u.next()){var l=h.value,p=l.name;n[l.chainId.toString()]=p,b[p]=l}}catch(x){t={error:x}}finally{try{h&&!h.done&&(a=u.return)&&a.call(u)}finally{if(t)throw t.error}}return b["names"]=n,b}t._getInitializedChains=b,t.chains=b()},38158:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1559:a(77523),2315:a(83339),2537:a(26769),2565:a(17897),2718:a(62170),2929:a(88436),2930:a(96213),3198:a(25491),3529:a(20070),3541:a(21871),3554:a(47225),3607:a(3968),3675:a(98571),3855:a(64551),4345:a(74818)}},86625:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",a(60114)],["homestead",a(62800)],["dao",a(7197)],["tangerineWhistle",a(22302)],["spuriousDragon",a(90716)],["byzantium",a(26985)],["constantinople",a(35993)],["petersburg",a(4064)],["istanbul",a(83166)],["muirGlacier",a(42946)],["berlin",a(20015)],["london",a(61250)],["shanghai",a(5553)],["arrowGlacier",a(51971)],["merge",a(88648)]]},82099:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__extends||function(){var e=function(t,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},e(t,a)};return function(t,a){if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function r(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(r.prototype=a.prototype,new r)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,a=1,r=arguments.length;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.ConsensusAlgorithm=t.ConsensusType=t.Hardfork=t.Chain=t.CustomChain=void 0;var f,d,o=a(43793),s=a(88913),b=a(64466),u=a(20455),h=a(86625),l=a(38158);(function(e){e["PolygonMainnet"]="polygon-mainnet",e["PolygonMumbai"]="polygon-mumbai",e["ArbitrumRinkebyTestnet"]="arbitrum-rinkeby-testnet",e["xDaiChain"]="x-dai-chain",e["OptimisticKovan"]="optimistic-kovan",e["OptimisticEthereum"]="optimistic-ethereum"})(f=t.CustomChain||(t.CustomChain={})),function(e){e[e["Mainnet"]=1]="Mainnet",e[e["Ropsten"]=3]="Ropsten",e[e["Rinkeby"]=4]="Rinkeby",e[e["Kovan"]=42]="Kovan",e[e["Goerli"]=5]="Goerli",e[e["Sepolia"]=11155111]="Sepolia"}(t.Chain||(t.Chain={})),function(e){e["Chainstart"]="chainstart",e["Homestead"]="homestead",e["Dao"]="dao",e["TangerineWhistle"]="tangerineWhistle",e["SpuriousDragon"]="spuriousDragon",e["Byzantium"]="byzantium",e["Constantinople"]="constantinople",e["Petersburg"]="petersburg",e["Istanbul"]="istanbul",e["MuirGlacier"]="muirGlacier",e["Berlin"]="berlin",e["London"]="london",e["ArrowGlacier"]="arrowGlacier",e["Shanghai"]="shanghai",e["Merge"]="merge"}(d=t.Hardfork||(t.Hardfork={})),function(e){e["ProofOfStake"]="pos",e["ProofOfWork"]="pow",e["ProofOfAuthority"]="poa"}(t.ConsensusType||(t.ConsensusType={})),function(e){e["Ethash"]="ethash",e["Clique"]="clique",e["Casper"]="casper"}(t.ConsensusAlgorithm||(t.ConsensusAlgorithm={}));var p=function(e){function t(t){var a,r,n,i,f=e.call(this)||this;f._supportedHardforks=[],f._eips=[],f._customChains=null!==(n=t.customChains)&&void 0!==n?n:[],f._chainParams=f.setChain(t.chain),f.DEFAULT_HARDFORK=null!==(i=f._chainParams.defaultHardfork)&&void 0!==i?i:d.Istanbul;try{for(var o=c(f._chainParams.hardforks),s=o.next();!s.done;s=o.next()){var b=s.value;b.forkHash||(b.forkHash=f._calcForkHash(b.name))}}catch(u){a={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return f._hardfork=f.DEFAULT_HARDFORK,t.supportedHardforks&&(f._supportedHardforks=t.supportedHardforks),t.hardfork&&f.setHardfork(t.hardfork),t.eips&&f.setEIPs(t.eips),f}return n(t,e),t.custom=function(e,a){var r;void 0===a&&(a={});var n=null!==(r=a.baseChain)&&void 0!==r?r:"mainnet",c=i({},t._getChainParams(n));if(c["name"]="custom-chain","string"!==typeof e)return new t(i({chain:i(i({},c),e)},a));if(e===f.PolygonMainnet)return t.custom({name:f.PolygonMainnet,chainId:137,networkId:137});if(e===f.PolygonMumbai)return t.custom({name:f.PolygonMumbai,chainId:80001,networkId:80001});if(e===f.ArbitrumRinkebyTestnet)return t.custom({name:f.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611});if(e===f.xDaiChain)return t.custom({name:f.xDaiChain,chainId:100,networkId:100});if(e===f.OptimisticKovan)return t.custom({name:f.OptimisticKovan,chainId:69,networkId:69},{hardfork:d.Berlin});if(e===f.OptimisticEthereum)return t.custom({name:f.OptimisticEthereum,chainId:10,networkId:10},{hardfork:d.Berlin});throw new Error("Custom chain ".concat(e," not supported"))},t.forCustomChain=function(e,a,r,n){var c=t._getChainParams(e);return new t({chain:i(i({},c),a),hardfork:r,supportedHardforks:n})},t.isSupportedChainId=function(e){var t=(0,u._getInitializedChains)();return Boolean(t["names"][e.toString()])},t._getChainParams=function(e,t){var a=(0,u._getInitializedChains)(t);if("number"===typeof e||b.BN.isBN(e)){if(e=e.toString(),a["names"][e]){var r=a["names"][e];return a[r]}throw new Error("Chain with ID ".concat(e," not supported"))}if(a[e])return a[e];throw new Error("Chain with name ".concat(e," not supported"))},t.prototype.setChain=function(e){var a,r;if("number"===typeof e||"string"===typeof e||b.BN.isBN(e)){var n=void 0;n=this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0])?this._customChains.map((function(e){return e[0]})):this._customChains,this._chainParams=t._getChainParams(e,n)}else{if("object"!==typeof e)throw new Error("Wrong input format");if(this._customChains.length>0)throw new Error("Chain must be a string, number, or BN when initialized with customChains passed in");var i=["networkId","genesis","hardforks","bootstrapNodes"];try{for(var f=c(i),d=f.next();!d.done;d=f.next()){var o=d.value;if(void 0===e[o])throw new Error("Missing required chain parameter: ".concat(o))}}catch(s){a={error:s}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(a)throw a.error}}this._chainParams=e}return this._chainParams},t.prototype.setHardfork=function(e){var t,a;if(!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"));var r=!1;try{for(var n=c(h.hardforks),i=n.next();!i.done;i=n.next()){var f=i.value;f[0]===e&&(this._hardfork!==e&&(this._hardfork=e,this.emit("hardforkChanged",e)),r=!0)}}catch(d){t={error:d}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(t)throw t.error}}if(!r)throw new Error("Hardfork with name ".concat(e," not supported"))},t.prototype.getHardforkByBlockNumber=function(e,t){var a,r;e=(0,b.toType)(e,b.TypeOutput.BN),t=(0,b.toType)(t,b.TypeOutput.BN);var n,i,f,o=d.Chainstart;try{for(var s=c(this.hardforks()),u=s.next();!u.done;u=s.next()){var h=u.value;if(null!==h.block)e.gte(new b.BN(h.block))&&(o=h.name),t&&h.td&&(t.gte(new b.BN(h.td))?n=h.name:i=f),f=h.name;else if(void 0!==t&&null!==t&&void 0!==h.td&&null!==h.td&&t.gte(new b.BN(h.td)))return h.name}}catch(x){a={error:x}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(a)throw a.error}}if(t){var l="block number: ".concat(e," (-> ").concat(o,"), ");if(n&&!this.hardforkGteHardfork(o,n)){var p="HF determined by block number is lower than the minimum total difficulty HF";throw l+="total difficulty: ".concat(t," (-> ").concat(n,")"),new Error("".concat(p,": ").concat(l))}if(i&&!this.hardforkGteHardfork(i,o)){p="Maximum HF determined by total difficulty is lower than the block number HF";throw l+="total difficulty: ".concat(t," (-> ").concat(i,")"),new Error("".concat(p,": ").concat(l))}}return o},t.prototype.setHardforkByBlockNumber=function(e,t){var a=this.getHardforkByBlockNumber(e,t);return this.setHardfork(a),a},t.prototype._chooseHardfork=function(e,t){if(void 0===t&&(t=!0),e){if(t&&!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"))}else e=this._hardfork;return e},t.prototype._getHardfork=function(e){var t,a,r=this.hardforks();try{for(var n=c(r),i=n.next();!i.done;i=n.next()){var f=i.value;if(f["name"]===e)return f}}catch(d){t={error:d}}finally{try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(t)throw t.error}}throw new Error("Hardfork ".concat(e," not defined for chain ").concat(this.chainName()))},t.prototype._isSupportedHardfork=function(e){var t,a;if(!(this._supportedHardforks.length>0))return!0;try{for(var r=c(this._supportedHardforks),n=r.next();!n.done;n=r.next()){var i=n.value;if(e===i)return!0}}catch(f){t={error:f}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}return!1},t.prototype.setEIPs=function(e){var t,a,r=this;void 0===e&&(e=[]);var n=function(t){if(!(t in l.EIPs))throw new Error("".concat(t," not supported"));var a=i.gteHardfork(l.EIPs[t]["minimumHardfork"]);if(!a)throw new Error("".concat(t," cannot be activated on hardfork ").concat(i.hardfork(),", minimumHardfork: ").concat(a));l.EIPs[t].requiredEIPs&&l.EIPs[t].requiredEIPs.forEach((function(a){if(!e.includes(a)&&!r.isActivatedEIP(a))throw new Error("".concat(t," requires EIP ").concat(a,", but is not included in the EIP list"))}))},i=this;try{for(var f=c(e),d=f.next();!d.done;d=f.next()){var o=d.value;n(o)}}catch(s){t={error:s}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(t)throw t.error}}this._eips=e},t.prototype.param=function(e,t){var a,r,n=null;try{for(var i=c(this._eips),f=i.next();!f.done;f=i.next()){var d=f.value;if(n=this.paramByEIP(e,t,d),null!==n)return n}}catch(o){a={error:o}}finally{try{f&&!f.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return this.paramByHardfork(e,t,this._hardfork)},t.prototype.paramByHardfork=function(e,t,a){var r,n,i,f;a=this._chooseHardfork(a);var d=null;try{for(var o=c(h.hardforks),s=o.next();!s.done;s=o.next()){var b=s.value;if("eips"in b[1]){var u=b[1]["eips"];try{for(var l=(i=void 0,c(u)),p=l.next();!p.done;p=l.next()){var x=p.value,m=this.paramByEIP(e,t,x);d=null!==m?m:d}}catch(g){i={error:g}}finally{try{p&&!p.done&&(f=l.return)&&f.call(l)}finally{if(i)throw i.error}}}else{if(!b[1][e])throw new Error("Topic ".concat(e," not defined"));void 0!==b[1][e][t]&&(d=b[1][e][t].v)}if(b[0]===a)break}}catch(v){r={error:v}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return d},t.prototype.paramByEIP=function(e,t,a){if(!(a in l.EIPs))throw new Error("".concat(a," not supported"));var r=l.EIPs[a];if(!(e in r))throw new Error("Topic ".concat(e," not defined"));if(void 0===r[e][t])return null;var n=r[e][t].v;return n},t.prototype.paramByBlock=function(e,t,a){var r=this.activeHardforks(a),n=r[r.length-1]["name"];return this.paramByHardfork(e,t,n)},t.prototype.isActivatedEIP=function(e){var t,a;if(this.eips().includes(e))return!0;try{for(var r=c(h.hardforks),n=r.next();!n.done;n=r.next()){var i=n.value,f=i[1];if(this.gteHardfork(f["name"])&&"eips"in f&&f["eips"].includes(e))return!0}}catch(d){t={error:d}}finally{try{n&&!n.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}return!1},t.prototype.hardforkIsActiveOnBlock=function(e,t,a){var r;void 0===a&&(a={}),t=(0,b.toType)(t,b.TypeOutput.BN);var n=null!==(r=a.onlySupported)&&void 0!==r&&r;e=this._chooseHardfork(e,n);var i=this.hardforkBlockBN(e);return!(!i||!t.gte(i))},t.prototype.activeOnBlock=function(e,t){return this.hardforkIsActiveOnBlock(null,e,t)},t.prototype.hardforkGteHardfork=function(e,t,a){var r,n;void 0===a&&(a={});var i,f=void 0!==a.onlyActive&&a.onlyActive;e=this._chooseHardfork(e,a.onlySupported),i=f?this.activeHardforks(null,a):this.hardforks();var d=-1,o=-1,s=0;try{for(var b=c(i),u=b.next();!u.done;u=b.next()){var h=u.value;h["name"]===e&&(d=s),h["name"]===t&&(o=s),s+=1}}catch(l){r={error:l}}finally{try{u&&!u.done&&(n=b.return)&&n.call(b)}finally{if(r)throw r.error}}return d>=o&&-1!==o},t.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},t.prototype.hardforkIsActiveOnChain=function(e,t){var a,r,n;void 0===t&&(t={});var i=null!==(n=t.onlySupported)&&void 0!==n&&n;e=this._chooseHardfork(e,i);try{for(var f=c(this.hardforks()),d=f.next();!d.done;d=f.next()){var o=d.value;if(o["name"]===e&&null!==o["block"])return!0}}catch(s){a={error:s}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(a)throw a.error}}return!1},t.prototype.activeHardforks=function(e,t){var a,r;void 0===t&&(t={});var n=[],i=this.hardforks();try{for(var f=c(i),d=f.next();!d.done;d=f.next()){var o=d.value;if(null!==o["block"]){if(void 0!==e&&null!==e&&e0)return a[a.length-1]["name"];throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return(0,b.toType)(t,b.TypeOutput.Number)},t.prototype.hardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e)["block"];return void 0===t||null===t?null:new b.BN(t)},t.prototype.hardforkTD=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e)["td"];return void 0===t||null===t?null:new b.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0,b.toType)(e,b.TypeOutput.BN),t=this._chooseHardfork(t,!1);var a=this.hardforkBlockBN(t);return!!a&&a.eq(e)},t.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return(0,b.toType)(t,b.TypeOutput.Number)},t.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);if(null===t)return null;var a=this.hardforks().reduce((function(e,a){var r=new b.BN(a.block);return r.gt(t)&&null===e?r:e}),null);return a},t.prototype.isNextHardforkBlock=function(e,t){e=(0,b.toType)(e,b.TypeOutput.BN),t=this._chooseHardfork(t,!1);var a=this.nextHardforkBlockBN(t);return null!==a&&a.eq(e)},t.prototype._calcForkHash=function(e){var t,a,n=r.from(this.genesis().hash.substr(2),"hex"),i=r.alloc(0),f=0;try{for(var d=c(this.hardforks()),o=d.next();!o.done;o=d.next()){var u=o.value,h=u.block;if(0!==h&&null!==h&&h!==f){var l=r.from(h.toString(16).padStart(16,"0"),"hex");i=r.concat([i,l])}if(u.name===e)break;null!==h&&(f=h)}}catch(m){t={error:m}}finally{try{o&&!o.done&&(a=d.return)&&a.call(d)}finally{if(t)throw t.error}}var p=r.concat([n,i]),x=(0,b.intToBuffer)((0,s.buf)(p)>>>0).toString("hex");return"0x".concat(x)},t.prototype.forkHash=function(e){e=this._chooseHardfork(e,!1);var t=this._getHardfork(e);if(null===t["block"]&&void 0===t["td"]){var a="No fork hash calculation possible for future hardfork";throw new Error(a)}return void 0!==t["forkHash"]?t["forkHash"]:this._calcForkHash(e)},t.prototype.hardforkForForkHash=function(e){var t=this.hardforks().filter((function(t){return t.forkHash===e}));return t.length>=1?t[t.length-1]:null},t.prototype.genesis=function(){return this._chainParams["genesis"]},t.prototype.genesisState=function(){var e,t;switch(this.chainName()){case"mainnet":return a(31617);case"ropsten":return a(53712);case"rinkeby":return a(3023);case"kovan":return a(28777);case"goerli":return a(15382);case"sepolia":return a(81847)}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var r=c(this._customChains),n=r.next();!n.done;n=r.next()){var i=n.value;if(i[0].name===this.chainName())return i[1]}}catch(f){e={error:f}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return{}},t.prototype.hardforks=function(){return this._chainParams["hardforks"]},t.prototype.bootstrapNodes=function(){return this._chainParams["bootstrapNodes"]},t.prototype.dnsNetworks=function(){return this._chainParams["dnsNetworks"]},t.prototype.hardfork=function(){return this._hardfork},t.prototype.chainId=function(){return(0,b.toType)(this.chainIdBN(),b.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new b.BN(this._chainParams["chainId"])},t.prototype.chainName=function(){return this._chainParams["name"]},t.prototype.networkId=function(){return(0,b.toType)(this.networkIdBN(),b.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new b.BN(this._chainParams["networkId"])},t.prototype.eips=function(){return this._eips},t.prototype.consensusType=function(){var e,t,a,r=this.hardfork();try{for(var n=c(h.hardforks),i=n.next();!i.done;i=n.next()){var f=i.value;if("consensus"in f[1]&&(a=f[1]["consensus"]["type"]),f[0]===r)break}}catch(d){e={error:d}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return a||this._chainParams["consensus"]["type"]},t.prototype.consensusAlgorithm=function(){var e,t,a,r=this.hardfork();try{for(var n=c(h.hardforks),i=n.next();!i.done;i=n.next()){var f=i.value;if("consensus"in f[1]&&(a=f[1]["consensus"]["algorithm"]),f[0]===r)break}}catch(d){e={error:d}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return a||this._chainParams["consensus"]["algorithm"]},t.prototype.consensusConfig=function(){var e,t,a,r=this.hardfork();try{for(var n=c(h.hardforks),i=n.next();!i.done;i=n.next()){var f=i.value;if("consensus"in f[1]&&(a=f[1]["consensus"][f[1]["consensus"]["algorithm"]]),f[0]===r)break}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}if(a)return a;var d=this.consensusAlgorithm();return this._chainParams["consensus"][d]},t.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},t}(o.EventEmitter);t["default"]=p},30302:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(62859).Buffer}catch(P){}function f(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},6151:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var c=i(a(57973)),f=a(36799),d=a(52010),o=a(16261),s=a(77002),b=a(80233),u=a(40032),h=a(26768),l=a(28651),p=function(){function e(e,t,a,r){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===a&&(a=s.KECCAK256_RLP),void 0===r&&(r=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=a,this.codeHash=r,this._validate()}return e.fromAccountData=function(t){var a=t.nonce,r=t.balance,n=t.stateRoot,i=t.codeHash;return new e(a?new f.BN((0,b.toBuffer)(a)):void 0,r?new f.BN((0,b.toBuffer)(r)):void 0,n?(0,b.toBuffer)(n):void 0,i?(0,b.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=f.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var a=n(t,4),r=a[0],i=a[1],c=a[2],d=a[3];return new e(new f.BN(r),new f.BN(i),c,d)},e.prototype._validate=function(){if(this.nonce.lt(new f.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new f.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return f.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(s.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(s.KECCAK256_NULL)},e}();t.Account=p;var x=function(e){try{(0,h.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.isValidAddress=x;var m=function(e,t){(0,h.assertIsHexString)(e);var a=(0,o.stripHexPrefix)(e).toLowerCase(),r="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);r=n.toString()+"0x"}for(var i=(0,u.keccakFromString)(r+a).toString("hex"),c="0x",f=0;f=8?c+=a[f].toUpperCase():c+=a[f];return c};t.toChecksumAddress=m;var g=function(e,a){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,a)===e};t.isValidChecksumAddress=g;var v=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var a=new f.BN(t);return a.isZero()?(0,u.rlphash)([e,null]).slice(-20):(0,u.rlphash)([e,r.from(a.toArray())]).slice(-20)};t.generateAddress=v;var y=function(e,t,a){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(a),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,u.keccak256)(r.concat([r.from("ff","hex"),e,t,(0,u.keccak256)(a)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,d.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,d.publicKeyVerify)(r.concat([r.from([4]),e])):!!t&&(0,d.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,u.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),r.from((0,d.publicKeyCreate)(e,!1)).slice(1)};t.privateToPublic=k;var A=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.privateToAddress=A;var S=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,b.zeros)(e);return(0,b.bufferToHex)(t)};t.zeroAddress=E;var B=function(e){try{(0,h.assertIsString)(e)}catch(r){return!1}var a=(0,t.zeroAddress)();return a===e};t.isZeroAddress=B},96607:function(e,t,a){"use strict";var r=a(15361)["Buffer"],n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=n(a(57973)),c=a(36799),f=a(80233),d=a(6151),o=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,f.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,d.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(r.isBuffer(t),"Public key should be Buffer");var a=(0,d.pubToAddress)(t);return new e(a)},e.fromPrivateKey=function(t){(0,i.default)(r.isBuffer(t),"Private key should be Buffer");var a=(0,d.privateToAddress)(t);return new e(a)},e.generate=function(t,a){return(0,i.default)(c.BN.isBN(a)),new e((0,d.generateAddress)(t.buf,a.toArrayLike(r)))},e.generate2=function(t,a,n){return(0,i.default)(r.isBuffer(a)),(0,i.default)(r.isBuffer(n)),new e((0,d.generateAddress2)(t.buf,a,n))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new c.BN(this.buf),t=new c.BN(0),a=new c.BN("ffff","hex");return e.gte(t)&&e.lte(a)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return r.from(this.buf)},e}();t.Address=o},80233:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),a(48675),a(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(36799),f=a(16261),d=a(26768),o=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToHex=o;var s=function(e){var a=(0,t.intToHex)(e);return r.from((0,f.padToEven)(a.slice(2)),"hex")};t.intToBuffer=s;var b=function(e){return r.allocUnsafe(e).fill(0)};t.zeros=b;var u=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,d.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,d.assertIsArray)(e),p(e)};t.unpadArray=m;var g=function(e){return(0,d.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=g;var v=function(e){if(null===e||void 0===e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"===typeof e){if(!(0,f.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,f.padToEven)((0,f.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=v;var y=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToInt=y;var w=function(e){return e=(0,t.toBuffer)(e),"0x"+e.toString("hex")};t.bufferToHex=w;var M=function(e){return new c.BN(e).fromTwos(256)};t.fromSigned=M;var _=function(e){return r.from(e.toTwos(256).toArray())};t.toUnsigned=_;var k=function(e){return"string"!==typeof e||(0,f.isHexPrefixed)(e)?e:"0x"+e};t.addHexPrefix=k;var A=function(e){var t=/^(00)+|(00)+$/g;if(e=(0,f.stripHexPrefix)(e),e.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");var a=r.from(e.replace(t,""),"hex");return a.toString("utf8")};t.toUtf8=A;var S=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===o[0])throw new Error("".concat(d," cannot have leading zeroes, received: ").concat(o.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}};function B(e){return Array.isArray(e)?e.map((function(e){return B(e)})):r.from(e)}function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=B,t.bufArrToArr=T},77002:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var r=a(15361),n=a(36799);t.MAX_UINT64=new n.BN("ffffffffffffffff",16),t.MAX_INTEGER=new n.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new n.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=r.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=r.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=r.Buffer.from(t.KECCAK256_RLP_S,"hex")},36799:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var f=c(a(30302));t.BN=f.default;var d=i(a(98217));t.rlp=d},40032:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(92802),i=a(65443),c=a(36799),f=a(80233),d=a(26768),o=function(e,t){switch(void 0===t&&(t=256),(0,d.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak=o;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var b=function(e,a){void 0===a&&(a=256),(0,d.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromString=b;var u=function(e,a){return void 0===a&&(a=256),(0,d.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromHexString=u;var h=function(e,a){return void 0===a&&(a=256),(0,d.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,d.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,d.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,d.assertIsArray)(e),l(e)};t.sha256FromArray=m;var g=function(e,t){e=(0,f.toBuffer)(e);var a=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(a,32):a},v=function(e,t){return(0,d.assertIsBuffer)(e),g(e,t)};t.ripemd160=v;var y=function(e,t){return(0,d.assertIsString)(e),g(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,d.assertIsArray)(e),g(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},26768:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(16261),i=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsHexString=i;var c=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=c;var f=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=f;var d=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=d},64466:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(a(77002),t),n(a(6151),t),n(a(96607),t),n(a(40032),t),n(a(43292),t),n(a(80233),t),n(a(2364),t),n(a(36799),t),n(a(28651),t);var i=a(16261);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},16261:function(e,t,a){"use strict";var r=a(15361)["Buffer"];function n(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;var i=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return n(e)?e.slice(2):e};function c(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}function f(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")}function d(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function o(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a=n.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===n.length||!t.length||(0,i.default)(t.length===n.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[a]=n}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:n,set:c}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:c,get:n})})),a)if("string"===typeof a&&(a=r.from((0,c.stripHexPrefix)(a),"hex")),r.isBuffer(a)&&(a=f.rlp.decode(a)),Array.isArray(a)){if(a.length>e._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(t,a){e[e._fields[a]]=(0,d.toBuffer)(t)}))}else{if("object"!==typeof a)throw new Error("invalid data");var n=Object.keys(a);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=a[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=a[t.alias])}))}};t.defineProperties=o},43292:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=a(52010),i=a(36799),c=a(80233),f=a(40032),d=a(26768),o=a(28651);function s(e,t,a){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,d=r.from(c.slice(0,32)),s=r.from(c.slice(32,64));if(!a||"number"===typeof a){if(a&&!Number.isSafeInteger(a))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var b=a?f+(2*a+35):f+27;return{r:d,s:s,v:b}}var u=(0,o.toType)(a,o.TypeOutput.BN),h=u.muln(2).addn(35).addn(f).toArrayLike(r);return{r:d,s:s,v:h}}function b(e,t){var a=(0,o.toType)(e,o.TypeOutput.BN);if(!t)return a.subn(27);var r=(0,o.toType)(t,o.TypeOutput.BN);return a.sub(r.muln(2).addn(35))}function u(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,a,i,f){var d=r.concat([(0,c.setLengthLeft)(a,32),(0,c.setLengthLeft)(i,32)],64),o=b(t,f);if(!u(o))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(d,o.toNumber(),e);return r.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(a,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");var f=(0,o.toType)(e,o.TypeOutput.Number),d=a;return(f>28&&f%2===1||1===f||28===f)&&(d=r.from(a),d[0]|=128),(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(d,32)]))};t.toCompactSig=p;var x=function(e){var t,a,r,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(32,33))>>7,a[0]&=127}return r<27&&(r+=27),{v:r,r:t,s:a}};t.fromRpcSig=x;var m=function(e,t,a,r,n){void 0===r&&(r=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==a.length)return!1;if(!u(b(e,n)))return!1;var d=new i.BN(t),o=new i.BN(a);return!(d.isZero()||d.gt(f)||o.isZero()||o.gt(f))&&(!r||1!==o.cmp(c))};t.isValidSignature=m;var g=function(e){(0,d.assertIsBuffer)(e);var t=r.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(r.concat([t,e]))};t.hashPersonalMessage=g},28651:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=a(36799),c=a(16261),f=a(80233);function d(e){return"0x".concat(e.toString(16))}function o(e){return(0,f.unpadBuffer)(e.toArrayLike(r))}function s(e){return o(e)}function b(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"===typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,f.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new i.BN(a);if(t===n.Number){var r=new i.BN(a),d=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(d))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}t.bnToHex=d,t.bnToUnpaddedBuffer=o,t.bnToRlp=s,function(e){e[e["Number"]=0]="Number",e[e["BN"]=1]="BN",e[e["Buffer"]=2]="Buffer",e[e["PrefixedHexString"]=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=b},78193:function(e,t,a){"use strict";a(21703);var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},f=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var d=i(a(82099)),o=a(25327),s=a(98829),b=function(){function e(e){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=d.Chain.Mainnet,this.DEFAULT_HARDFORK=d.Hardfork.Istanbul;var t=e.nonce,a=e.gasLimit,r=e.to,n=e.value,i=e.data,c=e.v,f=e.r,s=e.s,b=e.type;this._type=new o.BN((0,o.toBuffer)(b)).toNumber();var u=(0,o.toBuffer)(""===r?"0x":r),h=(0,o.toBuffer)(""===c?"0x":c),l=(0,o.toBuffer)(""===f?"0x":f),p=(0,o.toBuffer)(""===s?"0x":s);this.nonce=new o.BN((0,o.toBuffer)(""===t?"0x":t)),this.gasLimit=new o.BN((0,o.toBuffer)(""===a?"0x":a)),this.to=u.length>0?new o.Address(u):void 0,this.value=new o.BN((0,o.toBuffer)(""===n?"0x":n)),this.data=(0,o.toBuffer)(""===i?"0x":i),this.v=h.length>0?new o.BN(h):void 0,this.r=l.length>0?new o.BN(l):void 0,this.s=p.length>0?new o.BN(p):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0)}return Object.defineProperty(e.prototype,"transactionType",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),e.prototype.supports=function(e){return this.activeCapabilities.includes(e)},e.prototype.validate=function(e){void 0===e&&(e=!1);var t=[];return this.getBaseFee().gt(this.gasLimit)&&t.push("gasLimit is too low. given ".concat(this.gasLimit,", need at least ").concat(this.getBaseFee())),this.isSigned()&&!this.verifySignature()&&t.push("Invalid Signature"),e?t:0===t.length},e.prototype.getBaseFee=function(){var e=this.getDataFee().addn(this.common.param("gasPrices","tx"));return this.common.gteHardfork("homestead")&&this.toCreationAddress()&&e.iaddn(this.common.param("gasPrices","txCreation")),e},e.prototype.getDataFee=function(){for(var e=this.common.param("gasPrices","txDataZero"),t=this.common.param("gasPrices","txDataNonZero"),a=0,r=0;r-1&&this.activeCapabilities.splice(b,1)}return d},e.prototype._getCommon=function(e,t){var a;if(t){var r=new o.BN((0,o.toBuffer)(t));if(e){if(!e.chainIdBN().eq(r)){var n=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(n)}return e.copy()}return d.default.isSupportedChainId(r)?new d.default({chain:r,hardfork:this.DEFAULT_HARDFORK}):d.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:r,chainId:r},this.DEFAULT_HARDFORK)}return null!==(a=null===e||void 0===e?void 0:e.copy())&&void 0!==a?a:new d.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(e,t,a){var r,n;void 0===t&&(t=256),void 0===a&&(a=!1);try{for(var i=c(Object.entries(e)),d=i.next();!d.done;d=i.next()){var s=f(d.value,2),b=s[0],u=s[1];switch(t){case 64:if(a){if(null===u||void 0===u?void 0:u.gte(o.MAX_UINT64)){var h=this._errorMsg("".concat(b," cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(u));throw new Error(h)}}else if(null===u||void 0===u?void 0:u.gt(o.MAX_UINT64)){h=this._errorMsg("".concat(b," cannot exceed MAX_UINT64 (2^64-1), given ").concat(u));throw new Error(h)}break;case 256:if(a){if(null===u||void 0===u?void 0:u.gte(o.MAX_INTEGER)){h=this._errorMsg("".concat(b," cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(u));throw new Error(h)}}else if(null===u||void 0===u?void 0:u.gt(o.MAX_INTEGER)){h=this._errorMsg("".concat(b," cannot exceed MAX_INTEGER (2^256-1), given ").concat(u));throw new Error(h)}break;default:h=this._errorMsg("unimplemented bits value");throw new Error(h)}}}catch(l){r={error:l}}finally{try{d&&!d.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},e.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,o.bufferToHex)(this.hash()):"not available (unsigned)"}catch(n){e="error"}var t="";try{t=this.isSigned().toString()}catch(n){e="error"}var a="";try{a=this.common.hardfork()}catch(n){a="error"}var r="tx type=".concat(this.type," hash=").concat(e," nonce=").concat(this.nonce," value=").concat(this.value," ");return r+="signed=".concat(t," hf=").concat(a),r},e}();t.BaseTransaction=b},95887:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__extends||function(){var e=function(t,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},e(t,a)};return function(t,a){if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function r(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(r.prototype=a.prototype,new r)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0});var f=a(25327),d=a(78193),o=a(98829),s=a(56903),b=2,u=r.from(b.toString(16).padStart(2,"0"),"hex"),h=function(e){function t(t,a){var r,n;void 0===a&&(a={});var c=e.call(this,i(i({},t),{type:b}))||this;c.DEFAULT_HARDFORK="london";var d=t.chainId,u=t.accessList,h=t.maxFeePerGas,l=t.maxPriorityFeePerGas;if(c.common=c._getCommon(a.common,d),c.chainId=c.common.chainIdBN(),!c.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");c.activeCapabilities=c.activeCapabilities.concat([1559,2718,2930]);var p=s.AccessLists.getAccessListData(null!==u&&void 0!==u?u:[]);if(c.accessList=p.accessList,c.AccessListJSON=p.AccessListJSON,s.AccessLists.verifyAccessList(c.accessList),c.maxFeePerGas=new f.BN((0,f.toBuffer)(""===h?"0x":h)),c.maxPriorityFeePerGas=new f.BN((0,f.toBuffer)(""===l?"0x":l)),c._validateCannotExceedMaxInteger({maxFeePerGas:c.maxFeePerGas,maxPriorityFeePerGas:c.maxPriorityFeePerGas}),c.gasLimit.mul(c.maxFeePerGas).gt(f.MAX_INTEGER)){var x=c._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(x)}if(c.maxFeePerGas.lt(c.maxPriorityFeePerGas)){x=c._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(x)}if(c.v&&!c.v.eqn(0)&&!c.v.eqn(1)){x=c._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(x)}if(c.common.gteHardfork("homestead")&&(null===(r=c.s)||void 0===r?void 0:r.gt(o.N_DIV_2))){x=c._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(x)}var m=null===(n=null===a||void 0===a?void 0:a.freeze)||void 0===n||n;return m&&Object.freeze(c),c}return n(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,a){return void 0===a&&(a={}),new t(e,a)},t.fromSerializedTx=function(e,a){if(void 0===a&&(a={}),!e.slice(0,1).equals(u))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ".concat(b,", received: ").concat(e.slice(0,1).toString("hex")));var r=f.rlp.decode(e.slice(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(r,a)},t.fromRlpSerializedTx=function(e,a){return void 0===a&&(a={}),t.fromSerializedTx(e,a)},t.fromValuesArray=function(e,a){if(void 0===a&&(a={}),9!==e.length&&12!==e.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");var r=c(e,12),n=r[0],i=r[1],d=r[2],o=r[3],s=r[4],b=r[5],u=r[6],h=r[7],l=r[8],p=r[9],x=r[10],m=r[11];return(0,f.validateNoLeadingZeroes)({nonce:i,maxPriorityFeePerGas:d,maxFeePerGas:o,gasLimit:s,value:u,v:p,r:x,s:m}),new t({chainId:new f.BN(n),nonce:i,maxPriorityFeePerGas:d,maxFeePerGas:o,gasLimit:s,to:b,value:u,data:h,accessList:null!==l&&void 0!==l?l:[],v:void 0!==p?new f.BN(p):void 0,r:x,s:m},a)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(s.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(e){void 0===e&&(e=new f.BN(0));var t=f.BN.min(this.maxPriorityFeePerGas,this.maxFeePerGas.sub(e)),a=t.add(e);return this.gasLimit.mul(a).add(this.value)},t.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.chainId),(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,f.bnToUnpaddedBuffer)(this.maxFeePerGas),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:r.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):r.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):r.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):r.from([])]},t.prototype.serialize=function(){var e=this.raw();return r.concat([u,f.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),a=r.concat([u,f.rlp.encode(t)]);return e?(0,f.keccak256)(a):a},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,f.keccak256)(this.serialize())),this.cache.hash):(0,f.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var a=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(o.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var r=this,n=r.v,i=r.r,c=r.s;try{return(0,f.ecrecover)(a,n.addn(27),(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(c))}catch(d){t=this._errorMsg("Invalid Signature");throw new Error(t)}},t.prototype._processSignature=function(e,a,r){var n={common:this.common};return t.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new f.BN(e-27),r:new f.BN(a),s:new f.BN(r)},n)},t.prototype.toJSON=function(){var e=s.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,f.bnToHex)(this.chainId),nonce:(0,f.bnToHex)(this.nonce),maxPriorityFeePerGas:(0,f.bnToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,f.bnToHex)(this.maxFeePerGas),gasLimit:(0,f.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,f.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,f.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,f.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,f.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e=this._getSharedErrorPostfix();return e+=" maxFeePerGas=".concat(this.maxFeePerGas," maxPriorityFeePerGas=").concat(this.maxPriorityFeePerGas),e},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(d.BaseTransaction);t["default"]=h},17562:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__extends||function(){var e=function(t,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},e(t,a)};return function(t,a){if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function r(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(r.prototype=a.prototype,new r)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0});var f=a(25327),d=a(78193),o=a(98829),s=a(56903),b=1,u=r.from(b.toString(16).padStart(2,"0"),"hex"),h=function(e){function t(t,a){var r,n;void 0===a&&(a={});var c=e.call(this,i(i({},t),{type:b}))||this;c.DEFAULT_HARDFORK="berlin";var d=t.chainId,u=t.accessList,h=t.gasPrice;if(c.common=c._getCommon(a.common,d),c.chainId=c.common.chainIdBN(),!c.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");c.activeCapabilities=c.activeCapabilities.concat([2718,2930]);var l=s.AccessLists.getAccessListData(null!==u&&void 0!==u?u:[]);if(c.accessList=l.accessList,c.AccessListJSON=l.AccessListJSON,s.AccessLists.verifyAccessList(c.accessList),c.gasPrice=new f.BN((0,f.toBuffer)(""===h?"0x":h)),c._validateCannotExceedMaxInteger({gasPrice:c.gasPrice}),c.gasPrice.mul(c.gasLimit).gt(f.MAX_INTEGER)){var p=c._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(p)}if(c.v&&!c.v.eqn(0)&&!c.v.eqn(1)){p=c._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(p)}if(c.common.gteHardfork("homestead")&&(null===(r=c.s)||void 0===r?void 0:r.gt(o.N_DIV_2))){p=c._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(p)}var x=null===(n=null===a||void 0===a?void 0:a.freeze)||void 0===n||n;return x&&Object.freeze(c),c}return n(t,e),Object.defineProperty(t.prototype,"senderR",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"senderS",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yParity",{get:function(){return this.v},enumerable:!1,configurable:!0}),t.fromTxData=function(e,a){return void 0===a&&(a={}),new t(e,a)},t.fromSerializedTx=function(e,a){if(void 0===a&&(a={}),!e.slice(0,1).equals(u))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ".concat(b,", received: ").concat(e.slice(0,1).toString("hex")));var r=f.rlp.decode(e.slice(1));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(r,a)},t.fromRlpSerializedTx=function(e,a){return void 0===a&&(a={}),t.fromSerializedTx(e,a)},t.fromValuesArray=function(e,a){if(void 0===a&&(a={}),8!==e.length&&11!==e.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");var r=c(e,11),n=r[0],i=r[1],d=r[2],o=r[3],s=r[4],b=r[5],u=r[6],h=r[7],l=r[8],p=r[9],x=r[10];(0,f.validateNoLeadingZeroes)({nonce:i,gasPrice:d,gasLimit:o,value:b,v:l,r:p,s:x});var m=[];return new t({chainId:new f.BN(n),nonce:i,gasPrice:d,gasLimit:o,to:s,value:b,data:u,accessList:null!==h&&void 0!==h?h:m,v:void 0!==l?new f.BN(l):void 0,r:p,s:x},a)},t.prototype.getDataFee=function(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;var t=e.prototype.getDataFee.call(this);return t.iaddn(s.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.chainId),(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.gasPrice),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:r.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):r.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):r.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):r.from([])]},t.prototype.serialize=function(){var e=this.raw();return r.concat([u,f.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),a=r.concat([u,f.rlp.encode(t)]);return e?(0,f.keccak256)(a):a},t.prototype.hash=function(){if(!this.isSigned()){var e=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(e)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,f.keccak256)(this.serialize())),this.cache.hash):(0,f.keccak256)(this.serialize())},t.prototype.getMessageToVerifySignature=function(){return this.getMessageToSign()},t.prototype.getSenderPublicKey=function(){var e;if(!this.isSigned()){var t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}var a=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(o.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var r=this,n=r.yParity,i=r.r,c=r.s;try{return(0,f.ecrecover)(a,n.addn(27),(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(c))}catch(d){t=this._errorMsg("Invalid Signature");throw new Error(t)}},t.prototype._processSignature=function(e,a,r){var n={common:this.common};return t.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:new f.BN(e-27),r:new f.BN(a),s:new f.BN(r)},n)},t.prototype.toJSON=function(){var e=s.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,f.bnToHex)(this.chainId),nonce:(0,f.bnToHex)(this.nonce),gasPrice:(0,f.bnToHex)(this.gasPrice),gasLimit:(0,f.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,f.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:e,v:void 0!==this.v?(0,f.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,f.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,f.bnToHex)(this.s):void 0}},t.prototype.errorStr=function(){var e,t,a=this._getSharedErrorPostfix();return a+=" gasPrice=".concat(this.gasPrice," accessListCount=").concat(null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0),a},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(d.BaseTransaction);t["default"]=h},89883:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeeMarketEIP1559Transaction=t.TransactionFactory=t.AccessListEIP2930Transaction=t.Transaction=void 0;var c=a(69903);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return i(c).default}});var f=a(17562);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return i(f).default}});var d=a(62607);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return i(d).default}});var o=a(95887);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return i(o).default}}),n(a(98829),t)},69903:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__extends||function(){var e=function(t,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},e(t,a)};return function(t,a){if("function"!==typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function r(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(r.prototype=a.prototype,new r)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,a=1,r=arguments.length;a0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0});var f=a(25327),d=a(98829),o=a(78193),s=0,b=function(e){function t(t,a){var r;void 0===a&&(a={});var n=e.call(this,i(i({},t),{type:s}))||this;if(n.common=n._validateTxV(n.v,a.common),n.gasPrice=new f.BN((0,f.toBuffer)(""===t.gasPrice?"0x":t.gasPrice)),n.gasPrice.mul(n.gasLimit).gt(f.MAX_INTEGER)){var c=n._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(c)}if(n._validateCannotExceedMaxInteger({gasPrice:n.gasPrice}),n.common.gteHardfork("spuriousDragon"))if(n.isSigned()){var o=n.v,b=n.common.chainIdBN().muln(2);(o.eq(b.addn(35))||o.eq(b.addn(36)))&&n.activeCapabilities.push(d.Capability.EIP155ReplayProtection)}else n.activeCapabilities.push(d.Capability.EIP155ReplayProtection);var u=null===(r=null===a||void 0===a?void 0:a.freeze)||void 0===r||r;return u&&Object.freeze(n),n}return n(t,e),t.fromTxData=function(e,a){return void 0===a&&(a={}),new t(e,a)},t.fromSerializedTx=function(e,t){void 0===t&&(t={});var a=f.rlp.decode(e);if(!Array.isArray(a))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(a,t)},t.fromRlpSerializedTx=function(e,a){return void 0===a&&(a={}),t.fromSerializedTx(e,a)},t.fromValuesArray=function(e,a){if(void 0===a&&(a={}),6!==e.length&&9!==e.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");var r=c(e,9),n=r[0],i=r[1],d=r[2],o=r[3],s=r[4],b=r[5],u=r[6],h=r[7],l=r[8];return(0,f.validateNoLeadingZeroes)({nonce:n,gasPrice:i,gasLimit:d,value:s,v:u,r:h,s:l}),new t({nonce:n,gasPrice:i,gasLimit:d,to:o,value:s,data:b,v:u,r:h,s:l},a)},t.prototype.raw=function(){return[(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.gasPrice),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:r.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):r.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):r.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):r.from([])]},t.prototype.serialize=function(){return f.rlp.encode(this.raw())},t.prototype._getMessageToSign=function(){var e=[(0,f.bnToUnpaddedBuffer)(this.nonce),(0,f.bnToUnpaddedBuffer)(this.gasPrice),(0,f.bnToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:r.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(d.Capability.EIP155ReplayProtection)&&(e.push((0,f.toBuffer)(this.common.chainIdBN())),e.push((0,f.unpadBuffer)((0,f.toBuffer)(0))),e.push((0,f.unpadBuffer)((0,f.toBuffer)(0)))),e},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this._getMessageToSign();return e?(0,f.rlphash)(t):t},t.prototype.getDataFee=function(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:e.prototype.getDataFee.call(this),hardfork:this.common.hardfork()}),e.prototype.getDataFee.call(this))},t.prototype.getUpfrontCost=function(){return this.gasLimit.mul(this.gasPrice).add(this.value)},t.prototype.hash=function(){return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=(0,f.rlphash)(this.raw())),this.cache.hash):(0,f.rlphash)(this.raw())},t.prototype.getMessageToVerifySignature=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this._getMessageToSign();return(0,f.rlphash)(t)},t.prototype.getSenderPublicKey=function(){var e,t=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(d.N_DIV_2))){var a=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(a)}var r=this,n=r.v,i=r.r,c=r.s;try{return(0,f.ecrecover)(t,n,(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(c),this.supports(d.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(o){a=this._errorMsg("Invalid Signature");throw new Error(a)}},t.prototype._processSignature=function(e,a,r){var n=new f.BN(e);this.supports(d.Capability.EIP155ReplayProtection)&&n.iadd(this.common.chainIdBN().muln(2).addn(8));var i={common:this.common};return t.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:n,r:new f.BN(a),s:new f.BN(r)},i)},t.prototype.toJSON=function(){return{nonce:(0,f.bnToHex)(this.nonce),gasPrice:(0,f.bnToHex)(this.gasPrice),gasLimit:(0,f.bnToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,f.bnToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0,f.bnToHex)(this.v):void 0,r:void 0!==this.r?(0,f.bnToHex)(this.r):void 0,s:void 0!==this.s?(0,f.bnToHex)(this.s):void 0}},t.prototype._validateTxV=function(e,t){var a;if(void 0!==e&&!e.eqn(0)&&(!t||t.gteHardfork("spuriousDragon"))&&!e.eqn(27)&&!e.eqn(28))if(t){var r=t.chainIdBN().muln(2),n=e.eq(r.addn(35))||e.eq(r.addn(36));if(!n)throw new Error("Incompatible EIP155-based V ".concat(e," and chain id ").concat(t.chainIdBN(),". See the Common parameter of the Transaction constructor to set the chain id."))}else{var i=void 0;i=e.subn(35).isEven()?35:36,a=e.subn(i).divn(2)}return this._getCommon(t,a)},t.prototype._unsignedTxImplementsEIP155=function(){return this.common.gteHardfork("spuriousDragon")},t.prototype._signedTxImplementsEIP155=function(){if(!this.isSigned()){var e=this._errorMsg("This transaction is not signed");throw new Error(e)}var t=this.common.gteHardfork("spuriousDragon"),a=this.v,r=this.common.chainIdBN().muln(2),n=a.eq(r.addn(35))||a.eq(r.addn(36));return n&&t},t.prototype.errorStr=function(){var e=this._getSharedErrorPostfix();return e+=" gasPrice=".concat(this.gasPrice),e},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(o.BaseTransaction);t["default"]=b},62607:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0});var n=a(25327),i=a(89883),c=function(){function e(){}return e.fromTxData=function(e,t){if(void 0===t&&(t={}),"type"in e&&void 0!==e.type){var a=new n.BN((0,n.toBuffer)(e.type)).toNumber();if(0===a)return i.Transaction.fromTxData(e,t);if(1===a)return i.AccessListEIP2930Transaction.fromTxData(e,t);if(2===a)return i.FeeMarketEIP1559Transaction.fromTxData(e,t);throw new Error("Tx instantiation with type ".concat(a," not supported"))}return i.Transaction.fromTxData(e,t)},e.fromSerializedData=function(e,t){if(void 0===t&&(t={}),e[0]<=127){var a=void 0;switch(e[0]){case 1:a=2930;break;case 2:a=1559;break;default:throw new Error("TypedTransaction with ID ".concat(e[0]," unknown"))}return 1559===a?i.FeeMarketEIP1559Transaction.fromSerializedTx(e,t):i.AccessListEIP2930Transaction.fromSerializedTx(e,t)}return i.Transaction.fromSerializedTx(e,t)},e.fromBlockBodyData=function(e,t){if(void 0===t&&(t={}),r.isBuffer(e))return this.fromSerializedData(e,t);if(Array.isArray(e))return i.Transaction.fromValuesArray(e,t);throw new Error("Cannot decode transaction: unknown type input")},e.getTransactionClass=function(e,t){void 0===e&&(e=0);var a=0==e||e>=128&&e<=255;if(a)return i.Transaction;switch(e){case 1:return i.AccessListEIP2930Transaction;case 2:return i.FeeMarketEIP1559Transaction;default:throw new Error("TypedTransaction with ID ".concat(e," unknown"))}},e}();t["default"]=c},98829:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var r=a(25327);function n(e){if(0===e.length)return!0;var t=e[0];return!!Array.isArray(t)}function i(e){return!n(e)}(function(e){e[e["EIP155ReplayProtection"]=155]="EIP155ReplayProtection",e[e["EIP1559FeeMarket"]=1559]="EIP1559FeeMarket",e[e["EIP2718TypedTransaction"]=2718]="EIP2718TypedTransaction",e[e["EIP2930AccessLists"]=2930]="EIP2930AccessLists"})(t.Capability||(t.Capability={})),t.isAccessListBuffer=n,t.isAccessList=i,t.N_DIV_2=new r.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},56903:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.AccessLists=void 0;var r=a(25327),n=a(98829),i=function(){function e(){}return e.getAccessListData=function(e){var t,a;if(e&&(0,n.isAccessList)(e)){t=e;for(var i=[],c=0;c=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},68031:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var c=i(a(54185)),f=a(45928),d=a(52010),o=a(56019),s=a(48630),b=a(22025),u=a(9129),h=a(1397),l=a(52831),p=function(){function e(e,t,a,r){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===a&&(a=s.KECCAK256_RLP),void 0===r&&(r=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=a,this.codeHash=r,this._validate()}return e.fromAccountData=function(t){var a=t.nonce,r=t.balance,n=t.stateRoot,i=t.codeHash;return new e(a?new f.BN((0,b.toBuffer)(a)):void 0,r?new f.BN((0,b.toBuffer)(r)):void 0,n?(0,b.toBuffer)(n):void 0,i?(0,b.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=f.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var a=n(t,4),r=a[0],i=a[1],c=a[2],d=a[3];return new e(new f.BN(r),new f.BN(i),c,d)},e.prototype._validate=function(){if(this.nonce.lt(new f.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new f.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return f.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(s.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(s.KECCAK256_NULL)},e}();t.Account=p;var x=function(e){try{(0,h.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.isValidAddress=x;var m=function(e,t){(0,h.assertIsHexString)(e);var a=(0,o.stripHexPrefix)(e).toLowerCase(),r="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);r=n.toString()+"0x"}for(var i=(0,u.keccakFromString)(r+a).toString("hex"),c="0x",f=0;f=8?c+=a[f].toUpperCase():c+=a[f];return c};t.toChecksumAddress=m;var g=function(e,a){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,a)===e};t.isValidChecksumAddress=g;var v=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var a=new f.BN(t);return a.isZero()?(0,u.rlphash)([e,null]).slice(-20):(0,u.rlphash)([e,r.from(a.toArray())]).slice(-20)};t.generateAddress=v;var y=function(e,t,a){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(a),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,u.keccak256)(r.concat([r.from("ff","hex"),e,t,(0,u.keccak256)(a)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,d.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,d.publicKeyVerify)(r.concat([r.from([4]),e])):!!t&&(0,d.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,u.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),r.from((0,d.publicKeyCreate)(e,!1)).slice(1)};t.privateToPublic=k;var A=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.privateToAddress=A;var S=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,b.zeros)(e);return(0,b.bufferToHex)(t)};t.zeroAddress=E;var B=function(e){try{(0,h.assertIsString)(e)}catch(r){return!1}var a=(0,t.zeroAddress)();return a===e};t.isZeroAddress=B},99034:function(e,t,a){"use strict";var r=a(15361)["Buffer"],n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=n(a(54185)),c=a(45928),f=a(22025),d=a(68031),o=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,f.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,d.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(r.isBuffer(t),"Public key should be Buffer");var a=(0,d.pubToAddress)(t);return new e(a)},e.fromPrivateKey=function(t){(0,i.default)(r.isBuffer(t),"Private key should be Buffer");var a=(0,d.privateToAddress)(t);return new e(a)},e.generate=function(t,a){return(0,i.default)(c.BN.isBN(a)),new e((0,d.generateAddress)(t.buf,a.toArrayLike(r)))},e.generate2=function(t,a,n){return(0,i.default)(r.isBuffer(a)),(0,i.default)(r.isBuffer(n)),new e((0,d.generateAddress2)(t.buf,a,n))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new c.BN(this.buf),t=new c.BN(0),a=new c.BN("ffff","hex");return e.gte(t)&&e.lte(a)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return r.from(this.buf)},e}();t.Address=o},22025:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),a(48675),a(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(45928),f=a(56019),d=a(1397),o=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToHex=o;var s=function(e){var a=(0,t.intToHex)(e);return r.from((0,f.padToEven)(a.slice(2)),"hex")};t.intToBuffer=s;var b=function(e){return r.allocUnsafe(e).fill(0)};t.zeros=b;var u=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,d.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,d.assertIsArray)(e),p(e)};t.unpadArray=m;var g=function(e){return(0,d.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=g;var v=function(e){if(null===e||void 0===e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"===typeof e){if(!(0,f.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,f.padToEven)((0,f.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=v;var y=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToInt=y;var w=function(e){return e=(0,t.toBuffer)(e),"0x"+e.toString("hex")};t.bufferToHex=w;var M=function(e){return new c.BN(e).fromTwos(256)};t.fromSigned=M;var _=function(e){return r.from(e.toTwos(256).toArray())};t.toUnsigned=_;var k=function(e){return"string"!==typeof e||(0,f.isHexPrefixed)(e)?e:"0x"+e};t.addHexPrefix=k;var A=function(e){var t=/^(00)+|(00)+$/g;if(e=(0,f.stripHexPrefix)(e),e.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");var a=r.from(e.replace(t,""),"hex");return a.toString("utf8")};t.toUtf8=A;var S=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===o[0])throw new Error("".concat(d," cannot have leading zeroes, received: ").concat(o.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}};function B(e){return Array.isArray(e)?e.map((function(e){return B(e)})):r.from(e)}function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=B,t.bufArrToArr=T},48630:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var r=a(15361),n=a(45928);t.MAX_UINT64=new n.BN("ffffffffffffffff",16),t.MAX_INTEGER=new n.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new n.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=r.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=r.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=r.Buffer.from(t.KECCAK256_RLP_S,"hex")},45928:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var f=c(a(24660));t.BN=f.default;var d=i(a(98217));t.rlp=d},9129:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(92802),i=a(65443),c=a(45928),f=a(22025),d=a(1397),o=function(e,t){switch(void 0===t&&(t=256),(0,d.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak=o;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var b=function(e,a){void 0===a&&(a=256),(0,d.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromString=b;var u=function(e,a){return void 0===a&&(a=256),(0,d.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromHexString=u;var h=function(e,a){return void 0===a&&(a=256),(0,d.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,d.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,d.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,d.assertIsArray)(e),l(e)};t.sha256FromArray=m;var g=function(e,t){e=(0,f.toBuffer)(e);var a=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(a,32):a},v=function(e,t){return(0,d.assertIsBuffer)(e),g(e,t)};t.ripemd160=v;var y=function(e,t){return(0,d.assertIsString)(e),g(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,d.assertIsArray)(e),g(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},1397:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(56019),i=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsHexString=i;var c=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=c;var f=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=f;var d=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=d},25327:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(a(48630),t),n(a(68031),t),n(a(99034),t),n(a(9129),t),n(a(41596),t),n(a(22025),t),n(a(69161),t),n(a(45928),t),n(a(52831),t);var i=a(56019);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},56019:function(e,t,a){"use strict";var r=a(15361)["Buffer"];function n(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;var i=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return n(e)?e.slice(2):e};function c(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}function f(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")}function d(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function o(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a=n.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===n.length||!t.length||(0,i.default)(t.length===n.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[a]=n}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:n,set:c}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:c,get:n})})),a)if("string"===typeof a&&(a=r.from((0,c.stripHexPrefix)(a),"hex")),r.isBuffer(a)&&(a=f.rlp.decode(a)),Array.isArray(a)){if(a.length>e._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(t,a){e[e._fields[a]]=(0,d.toBuffer)(t)}))}else{if("object"!==typeof a)throw new Error("invalid data");var n=Object.keys(a);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=a[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=a[t.alias])}))}};t.defineProperties=o},41596:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=a(52010),i=a(45928),c=a(22025),f=a(9129),d=a(1397),o=a(52831);function s(e,t,a){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,d=r.from(c.slice(0,32)),s=r.from(c.slice(32,64));if(!a||"number"===typeof a){if(a&&!Number.isSafeInteger(a))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var b=a?f+(2*a+35):f+27;return{r:d,s:s,v:b}}var u=(0,o.toType)(a,o.TypeOutput.BN),h=u.muln(2).addn(35).addn(f).toArrayLike(r);return{r:d,s:s,v:h}}function b(e,t){var a=(0,o.toType)(e,o.TypeOutput.BN);if(!t)return a.subn(27);var r=(0,o.toType)(t,o.TypeOutput.BN);return a.sub(r.muln(2).addn(35))}function u(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,a,i,f){var d=r.concat([(0,c.setLengthLeft)(a,32),(0,c.setLengthLeft)(i,32)],64),o=b(t,f);if(!u(o))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(d,o.toNumber(),e);return r.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(a,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");var f=(0,o.toType)(e,o.TypeOutput.Number),d=a;return(f>28&&f%2===1||1===f||28===f)&&(d=r.from(a),d[0]|=128),(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(d,32)]))};t.toCompactSig=p;var x=function(e){var t,a,r,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(32,33))>>7,a[0]&=127}return r<27&&(r+=27),{v:r,r:t,s:a}};t.fromRpcSig=x;var m=function(e,t,a,r,n){void 0===r&&(r=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==a.length)return!1;if(!u(b(e,n)))return!1;var d=new i.BN(t),o=new i.BN(a);return!(d.isZero()||d.gt(f)||o.isZero()||o.gt(f))&&(!r||1!==o.cmp(c))};t.isValidSignature=m;var g=function(e){(0,d.assertIsBuffer)(e);var t=r.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(r.concat([t,e]))};t.hashPersonalMessage=g},52831:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=a(45928),c=a(56019),f=a(22025);function d(e){return"0x".concat(e.toString(16))}function o(e){return(0,f.unpadBuffer)(e.toArrayLike(r))}function s(e){return o(e)}function b(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"===typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,f.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new i.BN(a);if(t===n.Number){var r=new i.BN(a),d=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(d))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}t.bnToHex=d,t.bnToUnpaddedBuffer=o,t.bnToRlp=s,function(e){e[e["Number"]=0]="Number",e[e["BN"]=1]="BN",e[e["Buffer"]=2]="Buffer",e[e["PrefixedHexString"]=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=b},50534:function(e,t,a){"use strict";a.d(t,{RQ:function(){return ee},_R:function(){return p}});var r=a(72224),n=a(48737);const i="abi/5.0.7",c=new n.Yd(i),f={};let d={calldata:!0,memory:!0,storage:!0},o={calldata:!0,memory:!0};function s(e,t){if("bytes"===e||"string"===e){if(d[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&o[t])return!0;return(d[t]||"payable"===t)&&c.throwArgumentError("invalid modifier","name",t),!1}function b(e,t){let a=e;function r(t){c.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function n(e){let a={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(a.indexed=!1),a}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},f=i;for(let c=0;cJSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==h.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===h.full?", ":",")+")"):t+=this.type,e!==h.sighash&&(!0===this.indexed&&(t+=" indexed"),e===h.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"===typeof e?p.fromString(e,t):p.fromObject(e)}static fromObject(e){return p.isParamType(e)?e:new p(f,{name:e.name||null,type:x(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(p.fromObject):null})}static fromString(e,t){function a(e){return p.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}return a(b(e,!!t))}static isParamType(e){return!(null==e||!e._isParamType)}}function x(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var m=a(36482),g=(a(48675),a(3462),a(83966));const v=new n.Yd(i);class y{constructor(e,t,a,r){this.name=e,this.type=t,this.localName=a,this.dynamic=r}_throwError(e,t){v.throwArgumentError(e,this.localName,t)}}class w{constructor(e){(0,r.zG)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,m.xs)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,m.zo)(e._data))}writeBytes(e){let t=(0,m.lE)(e);const a=t.length%this.wordSize;return a&&(t=(0,m.zo)([t,this._padding.slice(a)])),this._writeData(t)}_getValue(e){let t=(0,m.lE)(g.O$.from(e));return t.length>this.wordSize&&v.throwError("value out-of-bounds",n.Yd.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,m.zo)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class M{constructor(e,t,a,n){(0,r.zG)(this,"_data",(0,m.lE)(e)),(0,r.zG)(this,"wordSize",t||32),(0,r.zG)(this,"_coerceFunc",a),(0,r.zG)(this,"allowLoose",n),this._offset=0}get data(){return(0,m.Dv)(this._data)}get consumed(){return this._offset}static coerce(e,t){let a=e.match("^u?int([0-9]+)$");return a&&parseInt(a[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):M.coerce(e,t)}_peekBytes(e,t,a){let r=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+r>this._data.length&&(this.allowLoose&&a&&this._offset+t<=this._data.length?r=t:v.throwError("data out-of-bounds",n.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+r})),this._data.slice(this._offset,this._offset+r)}subReader(e){return new M(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let a=this._peekBytes(0,e,!!t);return this._offset+=a.length,a.slice(0,e)}readValue(){return g.O$.from(this.readBytes(this.wordSize))}}var _=a(80594);class k extends y{constructor(e){super("address","address",e,!1)}encode(e,t){try{(0,_.Kn)(t)}catch(a){this._throwError(a.message,t)}return e.writeValue(t)}decode(e){return(0,_.Kn)((0,m.$m)(e.readValue().toHexString(),20))}}a(21703);class A extends y{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const S=new n.Yd(i);function E(e,t,a){let r=null;if(Array.isArray(a))r=a;else if(a&&"object"===typeof a){let e={};r=t.map((t=>{const r=t.localName;return r||S.throwError("cannot encode object for signature with missing names",n.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:a}),e[r]&&S.throwError("cannot encode object for signature with duplicate names",n.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:a}),e[r]=!0,a[r]}))}else S.throwArgumentError("invalid tuple value","tuple",a);t.length!==r.length&&S.throwArgumentError("types/value length mismatch","tuple",a);let i=new w(e.wordSize),c=new w(e.wordSize),f=[];t.forEach(((e,t)=>{let a=r[t];if(e.dynamic){let t=c.length;e.encode(c,a);let r=i.writeUpdatableValue();f.push((e=>{r(e+t)}))}else e.encode(i,a)})),f.forEach((e=>{e(i.length)}));let d=e.appendWriter(i);return d+=e.appendWriter(c),d}function B(e,t){let a=[],r=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let a=e.readValue(),f=r.subReader(a.toNumber());try{i=t.decode(f)}catch(c){if(c.code===n.Yd.errors.BUFFER_OVERRUN)throw c;i=c,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(c){if(c.code===n.Yd.errors.BUFFER_OVERRUN)throw c;i=c,i.baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&a.push(i)}));const i=t.reduce(((e,t)=>{const a=t.localName;return a&&(e[a]||(e[a]=0),e[a]++),e}),{});t.forEach(((e,t)=>{let r=e.localName;if(!r||1!==i[r])return;if("length"===r&&(r="_length"),null!=a[r])return;const n=a[t];n instanceof Error?Object.defineProperty(a,r,{get:()=>{throw n}}):a[r]=n}));for(let n=0;n{throw e}})}return Object.freeze(a)}class T extends y{constructor(e,t,a){const r=e.type+"["+(t>=0?t:"")+"]",n=-1===t||e.dynamic;super("array",r,a,n),this.coder=e,this.length=t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let a=this.length;-1===a&&(a=t.length,e.writeValue(t.length)),S.checkArgumentCount(t.length,a,"coder array"+(this.localName?" "+this.localName:""));let r=[];for(let n=0;n>6!==2)break;e++}return e}return e===F.OVERRUN?a.length-t-1:0}function z(e,t,a,r,n){return e===F.OVERLONG?(r.push(n),0):(r.push(65533),H(e,t,a,r,n))}(function(e){e["current"]="",e["NFC"]="NFC",e["NFD"]="NFD",e["NFKC"]="NFKC",e["NFKD"]="NFKD"})(q||(q={})),function(e){e["UNEXPECTED_CONTINUE"]="unexpected continuation byte",e["BAD_PREFIX"]="bad codepoint prefix",e["OVERRUN"]="string overrun",e["MISSING_CONTINUE"]="missing continuation byte",e["OUT_OF_RANGE"]="out of UTF-8 range",e["UTF16_SURROGATE"]="UTF-16 surrogate",e["OVERLONG"]="overlong representation"}(F||(F={}));const K=Object.freeze({error:D,ignore:H,replace:z});function Z(e,t){null==t&&(t=K.error),e=(0,m.lE)(e);const a=[];let r=0;while(r>7===0){a.push(n);continue}let i=null,c=null;if(192===(224&n))i=1,c=127;else if(224===(240&n))i=2,c=2047;else{if(240!==(248&n)){r+=t(128===(192&n)?F.UNEXPECTED_CONTINUE:F.BAD_PREFIX,r-1,e,a);continue}i=3,c=65535}if(r-1+i>=e.length){r+=t(F.OVERRUN,r-1,e,a);continue}let f=n&(1<<8-i-1)-1;for(let d=0;d1114111?r+=t(F.OUT_OF_RANGE,r-1-i,e,a,f):f>=55296&&f<=57343?r+=t(F.UTF16_SURROGATE,r-1-i,e,a,f):f<=c?r+=t(F.OVERLONG,r-1-i,e,a,f):a.push(f))}return a}function G(e,t=q.current){t!=q.current&&(j.checkNormalize(),e=e.normalize(t));let a=[];for(let r=0;r>6|192),a.push(63&t|128);else if(55296==(64512&t)){r++;const n=e.charCodeAt(r);if(r>=e.length||56320!==(64512&n))throw new Error("invalid utf-8 string");const i=65536+((1023&t)<<10)+(1023&n);a.push(i>>18|240),a.push(i>>12&63|128),a.push(i>>6&63|128),a.push(63&i|128)}else a.push(t>>12|224),a.push(t>>6&63|128),a.push(63&t|128)}return(0,m.lE)(a)}function V(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function W(e,t){return V(Z(e,t))}class J extends I{constructor(e){super("string",e)}encode(e,t){return super.encode(e,G(t))}decode(e){return W(super.decode(e))}}class X extends y{constructor(e,t){let a=!1;const r=[];e.forEach((e=>{e.dynamic&&(a=!0),r.push(e.type)}));const n="tuple("+r.join(",")+")";super("tuple",n,t,a),this.coders=e}encode(e,t){return E(e,this.coders,t)}decode(e){return e.coerce(this.name,B(e,this.coders))}}const Y=new n.Yd(i),Q=new RegExp(/^bytes([0-9]*)$/),$=new RegExp(/^(u?int)([0-9]*)$/);class ee{constructor(e){Y.checkNew(new.target,ee),(0,r.zG)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new k(e.name);case"bool":return new P(e.name);case"string":return new J(e.name);case"bytes":return new C(e.name);case"array":return new T(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new X((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new O(e.name)}let t=e.type.match($);if(t){let a=parseInt(t[2]||"256");return(0===a||a>256||a%8!==0)&&Y.throwArgumentError("invalid "+t[1]+" bit length","param",e),new U(a/8,"int"===t[1],e.name)}if(t=e.type.match(Q),t){let a=parseInt(t[1]);return(0===a||a>32)&&Y.throwArgumentError("invalid bytes length","param",e),new R(a,e.name)}return Y.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new M(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new w(this._getWordSize())}encode(e,t){e.length!==t.length&&Y.throwError("types/values length mismatch",n.Yd.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const a=e.map((e=>this._getCoder(p.from(e)))),r=new X(a,"_"),i=this._getWriter();return r.encode(i,t),i.data}decode(e,t,a){const r=e.map((e=>this._getCoder(p.from(e)))),n=new X(r,"_");return n.decode(this._getReader((0,m.lE)(t),a))}}new ee,new n.Yd(i)},80594:function(e,t,a){"use strict";a.d(t,{Kn:function(){return p}});a(48675),a(3462);var r=a(36482),n=a(83966),i=a(76502),c=a(48737);const f="address/5.6.0",d=new c.Yd(f);function o(e){(0,r.A7)(e,20)||d.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),a=new Uint8Array(40);for(let r=0;r<40;r++)a[r]=t[r].charCodeAt(0);const n=(0,r.lE)((0,i.w)(a));for(let r=0;r<40;r+=2)n[r>>1]>>4>=8&&(t[r]=t[r].toUpperCase()),(15&n[r>>1])>=8&&(t[r+1]=t[r+1].toUpperCase());return"0x"+t.join("")}const s=9007199254740991;function b(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const u={};for(let x=0;x<10;x++)u[String(x)]=String(x);for(let x=0;x<26;x++)u[String.fromCharCode(65+x)]=String(10+x);const h=Math.floor(b(s));function l(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map((e=>u[e])).join("");while(t.length>=h){let e=t.substring(0,h);t=parseInt(e,10)%97+t.substring(e.length)}let a=String(98-parseInt(t,10)%97);while(a.length<2)a="0"+a;return a}function p(e){let t=null;if("string"!==typeof e&&d.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=o(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&d.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){e.substring(2,4)!==l(e)&&d.throwArgumentError("bad icap checksum","address",e),t=(0,n.g$)(e.substring(4));while(t.length<40)t="0"+t;t=o("0x"+t)}else d.throwArgumentError("invalid address","address",e);return t}},83966:function(e,t,a){"use strict";a.d(t,{O$:function(){return h},g$:function(){return g}});var r=a(92024),n=a.n(r),i=a(36482),c=a(48737);const f="bignumber/5.6.0";var d=n().BN;const o=new c.Yd(f),s={},b=9007199254740991;let u=!1;class h{constructor(e,t){o.checkNew(new.target,h),e!==s&&o.throwError("cannot call constructor directly; use BigNumber.from",c.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return p(x(this).fromTwos(e))}toTwos(e){return p(x(this).toTwos(e))}abs(){return"-"===this._hex[0]?h.from(this._hex.substring(1)):this}add(e){return p(x(this).add(x(e)))}sub(e){return p(x(this).sub(x(e)))}div(e){const t=h.from(e);return t.isZero()&&m("division-by-zero","div"),p(x(this).div(x(e)))}mul(e){return p(x(this).mul(x(e)))}mod(e){const t=x(e);return t.isNeg()&&m("division-by-zero","mod"),p(x(this).umod(t))}pow(e){const t=x(e);return t.isNeg()&&m("negative-power","pow"),p(x(this).pow(t))}and(e){const t=x(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","and"),p(x(this).and(t))}or(e){const t=x(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","or"),p(x(this).or(t))}xor(e){const t=x(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","xor"),p(x(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&m("negative-width","mask"),p(x(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&m("negative-width","shl"),p(x(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&m("negative-width","shr"),p(x(this).shrn(e))}eq(e){return x(this).eq(x(e))}lt(e){return x(this).lt(x(e))}lte(e){return x(this).lte(x(e))}gt(e){return x(this).gt(x(e))}gte(e){return x(this).gte(x(e))}isNegative(){return"-"===this._hex[0]}isZero(){return x(this).isZero()}toNumber(){try{return x(this).toNumber()}catch(e){m("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return o.throwError("this platform does not support BigInt",c.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?u||(u=!0,o.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?o.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",c.Yd.errors.UNEXPECTED_ARGUMENT,{}):o.throwError("BigNumber.toString does not accept parameters",c.Yd.errors.UNEXPECTED_ARGUMENT,{})),x(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof h)return e;if("string"===typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new h(s,l(e)):e.match(/^-?[0-9]+$/)?new h(s,l(new d(e))):o.throwArgumentError("invalid BigNumber string","value",e);if("number"===typeof e)return e%1&&m("underflow","BigNumber.from",e),(e>=b||e<=-b)&&m("overflow","BigNumber.from",e),h.from(String(e));const t=e;if("bigint"===typeof t)return h.from(t.toString());if((0,i._t)(t))return h.from((0,i.Dv)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"===typeof e)return h.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"===typeof e&&((0,i.A7)(e)||"-"===e[0]&&(0,i.A7)(e.substring(1))))return h.from(e)}return o.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function l(e){if("string"!==typeof e)return l(e.toString(16));if("-"===e[0])return e=e.substring(1),"-"===e[0]&&o.throwArgumentError("invalid hex","value",e),e=l(e),"0x00"===e?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";e.length%2&&(e="0x0"+e.substring(2));while(e.length>4&&"0x00"===e.substring(0,4))e="0x"+e.substring(4);return e}function p(e){return h.from(l(e))}function x(e){const t=h.from(e).toHexString();return"-"===t[0]?new d("-"+t.substring(3),16):new d(t.substring(2),16)}function m(e,t,a){const r={fault:e,operation:t};return null!=a&&(r.value=a),o.throwError(e,c.Yd.errors.NUMERIC_FAULT,r)}function g(e){return new d(e,36).toString(16)}},92024:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(88677).Buffer}catch(E){}function f(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],b=[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],u=[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];function h(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function l(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?s[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=b[e],h=u[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:s[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function x(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function m(e,t,a){var r=new g;return r.mulp(e,t,a)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?p(this,e,t):r<63?l(this,e,t):r<1024?x(this,e,t):m(this,e,t),a},g.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(w,y),w.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return v[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},A.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},S.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},36482:function(e,t,a){"use strict";a.d(t,{lE:function(){return b},zo:function(){return u},xs:function(){return y},E1:function(){return g},p3:function(){return v},$m:function(){return w},Dv:function(){return m},_t:function(){return s},Zq:function(){return d},A7:function(){return p},N:function(){return M},G1:function(){return h}});a(48675),a(3462);var r=a(48737);const n="bytes/5.6.0",i=new r.Yd(n);function c(e){return!!e.toHexString}function f(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return f(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function d(e){return p(e)&&!(e.length%2)||s(e)}function o(e){return"number"===typeof e&&e==e&&e%1===0}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!o(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function b(e,t){if(t||(t={}),"number"===typeof e){i.checkSafeUint53(e,"invalid arrayify value");const t=[];while(e)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),f(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),c(e)&&(e=e.toHexString()),p(e)){let a=e.substring(2);a.length%2&&("left"===t.hexPad?a="0x0"+a.substring(2):"right"===t.hexPad?a+="0":i.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;eb(e))),a=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(a);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),f(r)}function h(e){let t=b(e);if(0===t.length)return t;let a=0;while(at&&i.throwArgumentError("value out of range","value",arguments[0]);const a=new Uint8Array(t);return a.set(e,t-e.length),f(a)}function p(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const x="0123456789abcdef";function m(e,t){if(t||(t={}),"number"===typeof e){i.checkSafeUint53(e,"invalid hexlify value");let t="";while(e)t=x[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"===typeof e)return e=e.toString(16),e.length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),c(e))return e.toHexString();if(p(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":i.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){let t="0x";for(let a=0;a>4]+x[15&r]}return t}return i.throwArgumentError("invalid hexlify value","value",e)}function g(e){if("string"!==typeof e)e=m(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function v(e,t,a){return"string"!==typeof e?e=m(e):(!p(e)||e.length%2)&&i.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=a?"0x"+e.substring(t,2+2*a):"0x"+e.substring(t)}function y(e){let t="0x";return e.forEach((e=>{t+=m(e).substring(2)})),t}function w(e,t){"string"!==typeof e?e=m(e):p(e)||i.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&i.throwArgumentError("value out of range","value",arguments[1]);while(e.length<2*t+2)e="0x0"+e.substring(2);return e}function M(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(d(e)){let a=b(e);64===a.length?(t.v=27+(a[32]>>7),a[32]&=127,t.r=m(a.slice(0,32)),t.s=m(a.slice(32,64))):65===a.length?(t.r=m(a.slice(0,32)),t.s=m(a.slice(32,64)),t.v=a[64]):i.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:i.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(a[32]|=128),t._vs=m(a.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const a=l(b(t._vs),32);t._vs=m(a);const r=a[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),a[0]&=127;const n=m(a);null==t.s?t.s=n:t.s!==n&&i.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?i.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const a=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==a&&i.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&p(t.r)?t.r=w(t.r,32):i.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&p(t.s)?t.s=w(t.s,32):i.throwArgumentError("signature missing or invalid s","signature",e);const a=b(t.s);a[0]>=128&&i.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(a[0]|=128);const r=m(a);t._vs&&(p(t._vs)||i.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&i.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}},5554:function(e,t,a){"use strict";a.d(t,{Bz:function(){return f},_Y:function(){return i},fh:function(){return c},tL:function(){return n}});var r=a(83966);const n=r.O$.from(-1),i=r.O$.from(0),c=r.O$.from(1),f=r.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},76502:function(e,t,a){"use strict";a.d(t,{w:function(){return c}});var r=a(69893),n=a.n(r),i=a(36482);function c(e){return"0x"+n().keccak_256((0,i.lE)(e))}},48737:function(e,t,a){"use strict";a.d(t,{Yd:function(){return l}});a(21703),a(48675),a(3462);const r="logger/5.6.0";let n=!1,i=!1;const c={debug:1,default:2,info:2,warning:3,error:4,off:5};let f=c["default"],d=null;function o(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(a){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}const s=o();var b,u;(function(e){e["DEBUG"]="DEBUG",e["INFO"]="INFO",e["WARNING"]="WARNING",e["ERROR"]="ERROR",e["OFF"]="OFF"})(b||(b={})),function(e){e["UNKNOWN_ERROR"]="UNKNOWN_ERROR",e["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED",e["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION",e["NETWORK_ERROR"]="NETWORK_ERROR",e["SERVER_ERROR"]="SERVER_ERROR",e["TIMEOUT"]="TIMEOUT",e["BUFFER_OVERRUN"]="BUFFER_OVERRUN",e["NUMERIC_FAULT"]="NUMERIC_FAULT",e["MISSING_NEW"]="MISSING_NEW",e["INVALID_ARGUMENT"]="INVALID_ARGUMENT",e["MISSING_ARGUMENT"]="MISSING_ARGUMENT",e["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT",e["CALL_EXCEPTION"]="CALL_EXCEPTION",e["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS",e["NONCE_EXPIRED"]="NONCE_EXPIRED",e["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED",e["UNPREDICTABLE_GAS_LIMIT"]="UNPREDICTABLE_GAS_LIMIT",e["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"}(u||(u={}));const h="0123456789abcdef";class l{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const a=e.toLowerCase();null==c[a]&&this.throwArgumentError("invalid log level name","logLevel",e),f>c[a]||console.log.apply(console,t)}debug(...e){this._log(l.levels.DEBUG,e)}info(...e){this._log(l.levels.INFO,e)}warn(...e){this._log(l.levels.WARNING,e)}makeError(e,t,a){if(i)return this.makeError("censored error",t,{});t||(t=l.errors.UNKNOWN_ERROR),a||(a={});const r=[];Object.keys(a).forEach((e=>{const t=a[e];try{if(t instanceof Uint8Array){let a="";for(let e=0;e>4],a+=h[15&t[e]];r.push(e+"=Uint8Array(0x"+a+")")}else r.push(e+"="+JSON.stringify(t))}catch(f){r.push(e+"="+JSON.stringify(a[e].toString()))}})),r.push(`code=${t}`),r.push(`version=${this.version}`);const n=e;let c="";switch(t){case u.NUMERIC_FAULT:{c="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":c+="-"+t;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case u.CALL_EXCEPTION:case u.INSUFFICIENT_FUNDS:case u.MISSING_NEW:case u.NONCE_EXPIRED:case u.REPLACEMENT_UNDERPRICED:case u.TRANSACTION_REPLACED:case u.UNPREDICTABLE_GAS_LIMIT:c=t;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),r.length&&(e+=" ("+r.join(", ")+")");const f=new Error(e);return f.reason=n,f.code=t,Object.keys(a).forEach((function(e){f[e]=a[e]})),f}throwError(e,t,a){throw this.makeError(e,t,a)}throwArgumentError(e,t,a){return this.throwError(e,l.errors.INVALID_ARGUMENT,{argument:t,value:a})}assert(e,t,a,r){e||this.throwError(t,a,r)}assertArgument(e,t,a,r){e||this.throwArgumentError(t,a,r)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),s&&this.throwError("platform missing String.prototype.normalize",l.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:s})}checkSafeUint53(e,t){"number"===typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,l.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,l.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,a){a=a?": "+a:"",et&&this.throwError("too many arguments"+a,l.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",l.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",l.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",l.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return d||(d=new l(r)),d}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",l.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",l.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!e,n=!!t}static setLogLevel(e){const t=c[e.toLowerCase()];null!=t?f=t:l.globalLogger().warn("invalid log level - "+e)}static from(e){return new l(e)}}l.errors=u,l.levels=b},72224:function(e,t,a){"use strict";a.d(t,{uj:function(){return f},zG:function(){return c}});var r=a(48737);const n="properties/5.6.0";const i=new r.Yd(n);function c(e,t,a){Object.defineProperty(e,t,{enumerable:!0,value:a,writable:!1})}function f(e,t){e&&"object"===typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((a=>{t[a]||i.throwArgumentError("invalid object key - "+a,"transaction:"+a,e)}))}},26407:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(62808).Buffer}catch(E){}function f(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],b=[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],u=[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];function h(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function l(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?s[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=b[e],h=u[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:s[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function x(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function m(e,t,a){var r=new g;return r.mulp(e,t,a)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?p(this,e,t):r<63?l(this,e,t):r<1024?x(this,e,t):m(this,e,t),a},g.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(w,y),w.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return v[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},A.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},S.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},68775:function(e,t,a){"use strict";a.r(t),a.d(t,{TransactionTypes:function(){return xe},accessListify:function(){return Ae},computeAddress:function(){return we},parse:function(){return Ne},recoverAddress:function(){return Me},serialize:function(){return Pe}});a(21703);var r=a(80594),n=a(83966),i=a(36482),c=a(5554),f=a(76502),d=a(72224),o=a(48737);const s="rlp/5.6.0",b=new o.Yd(s);function u(e){const t=[];while(e)t.unshift(255&e),e>>=8;return t}function h(e,t,a){let r=0;for(let n=0;nt+1+r&&b.throwError("child data too short",o.Yd.errors.BUFFER_OVERRUN,{})}return{consumed:1+r,result:n}}function m(e,t){if(0===e.length&&b.throwError("data too short",o.Yd.errors.BUFFER_OVERRUN,{}),e[t]>=248){const a=e[t]-247;t+1+a>e.length&&b.throwError("data short segment too short",o.Yd.errors.BUFFER_OVERRUN,{});const r=h(e,t+1,a);return t+1+a+r>e.length&&b.throwError("data long segment too short",o.Yd.errors.BUFFER_OVERRUN,{}),x(e,t,t+1+a,a+r)}if(e[t]>=192){const a=e[t]-192;return t+1+a>e.length&&b.throwError("data array too short",o.Yd.errors.BUFFER_OVERRUN,{}),x(e,t,t+1,a)}if(e[t]>=184){const a=e[t]-183;t+1+a>e.length&&b.throwError("data array too short",o.Yd.errors.BUFFER_OVERRUN,{});const r=h(e,t+1,a);t+1+a+r>e.length&&b.throwError("data array too short",o.Yd.errors.BUFFER_OVERRUN,{});const n=(0,i.Dv)(e.slice(t+1+a,t+1+a+r));return{consumed:1+a+r,result:n}}if(e[t]>=128){const a=e[t]-128;t+1+a>e.length&&b.throwError("data too short",o.Yd.errors.BUFFER_OVERRUN,{});const r=(0,i.Dv)(e.slice(t+1,t+1+a));return{consumed:1+a,result:r}}return{consumed:1,result:(0,i.Dv)(e[t])}}function g(e){const t=(0,i.lE)(e),a=m(t,0);return a.consumed!==t.length&&b.throwArgumentError("invalid rlp data","data",e),a.result}var v=a(26407),y=a.n(v),w=a(78730),M=a.n(w);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof a.g?a.g:"undefined"!==typeof self&&self;function _(e,t,a){return a={path:t,exports:{},require:function(e,t){return k(e,void 0===t||null===t?a.path:t)}},e(a,a.exports),a.exports}function k(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var A=S;function S(e,t){if(!e)throw new Error(t||"Assertion failed")}S.equal=function(e,t,a){if(e!=t)throw new Error(a||"Assertion failed: "+e+" != "+t)};var E=_((function(e,t){var a=t;function r(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"!==typeof e){for(var r=0;r>8,c=255&n;i?a.push(i,c):a.push(c)}return a}function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",a=0;a(n>>1)-1?(n>>1)-d:d,i.isubn(f)):f=0,r[c]=f,i.iushrn(1)}return r}function n(e,t){var a=[[],[]];e=e.clone(),t=t.clone();var r,n=0,i=0;while(e.cmpn(-n)>0||t.cmpn(-i)>0){var c,f,d=e.andln(3)+n&3,o=t.andln(3)+i&3;3===d&&(d=-1),3===o&&(o=-1),0===(1&d)?c=0:(r=e.andln(7)+n&7,c=3!==r&&5!==r||2!==o?d:-d),a[0].push(c),0===(1&o)?f=0:(r=t.andln(7)+i&7,f=3!==r&&5!==r||2!==d?o:-o),a[1].push(f),2*n===c+1&&(n=1-n),2*i===f+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return a}function i(e,t,a){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}}function c(e){return"string"===typeof e?a.toArray(e,"hex"):e}function f(e){return new(y())(e,"hex","le")}a.assert=A,a.toArray=E.toArray,a.zero2=E.zero2,a.toHex=E.toHex,a.encode=E.encode,a.getNAF=r,a.getJSF=n,a.cachedProperty=i,a.parseBytes=c,a.intFromLE=f})),T=B.getNAF,P=B.getJSF,I=B.assert;function C(e,t){this.type=e,this.p=new(y())(t.p,16),this.red=t.prime?y().red(t.prime):y().mont(this.p),this.zero=new(y())(0).toRed(this.red),this.one=new(y())(1).toRed(this.red),this.two=new(y())(2).toRed(this.red),this.n=t.n&&new(y())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var R=C;function O(e,t){this.curve=e,this.type=t,this.precomputed=null}C.prototype.point=function(){throw new Error("Not implemented")},C.prototype.validate=function(){throw new Error("Not implemented")},C.prototype._fixedNafMul=function(e,t){I(e.precomputed);var a=e._getDoubles(),r=T(t,1,this._bitLength),n=(1<=i;d--)c=(c<<1)+r[d];f.push(c)}for(var o=this.jpoint(null,null,null),s=this.jpoint(null,null,null),b=n;b>0;b--){for(i=0;i=0;f--){for(var d=0;f>=0&&0===i[f];f--)d++;if(f>=0&&d++,c=c.dblp(d),f<0)break;var o=i[f];I(0!==o),c="affine"===e.type?o>0?c.mixedAdd(n[o-1>>1]):c.mixedAdd(n[-o-1>>1].neg()):o>0?c.add(n[o-1>>1]):c.add(n[-o-1>>1].neg())}return"affine"===e.type?c.toP():c},C.prototype._wnafMulAdd=function(e,t,a,r,n){var i,c,f,d=this._wnafT1,o=this._wnafT2,s=this._wnafT3,b=0;for(i=0;i=1;i-=2){var h=i-1,l=i;if(1===d[h]&&1===d[l]){var p=[t[h],null,null,t[l]];0===t[h].y.cmp(t[l].y)?(p[1]=t[h].add(t[l]),p[2]=t[h].toJ().mixedAdd(t[l].neg())):0===t[h].y.cmp(t[l].y.redNeg())?(p[1]=t[h].toJ().mixedAdd(t[l]),p[2]=t[h].add(t[l].neg())):(p[1]=t[h].toJ().mixedAdd(t[l]),p[2]=t[h].toJ().mixedAdd(t[l].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],m=P(a[h],a[l]);for(b=Math.max(m[0].length,b),s[h]=new Array(b),s[l]=new Array(b),c=0;c=0;i--){var M=0;while(i>=0){var _=!0;for(c=0;c=0&&M++,y=y.dblp(M),i<0)break;for(c=0;c0?f=o[c][k-1>>1]:k<0&&(f=o[c][-k-1>>1].neg()),y="affine"===f.type?y.mixedAdd(f):y.add(f))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},O.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n=0&&(i=t,c=a),r.negative&&(r=r.neg(),n=n.neg()),i.negative&&(i=i.neg(),c=c.neg()),[{a:r,b:n},{a:i,b:c}]},L.prototype._endoSplit=function(e){var t=this.endo.basis,a=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),i=a.b.neg().mul(e).divRound(this.n),c=n.mul(a.a),f=i.mul(r.a),d=n.mul(a.b),o=i.mul(r.b),s=e.sub(c).sub(f),b=d.add(o).neg();return{k1:s,k2:b}},L.prototype.pointFromX=function(e,t){e=new(y())(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=a.redSqrt();if(0!==r.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var n=r.fromRed().isOdd();return(t&&!n||!t&&n)&&(r=r.redNeg()),this.point(e,r)},L.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,a=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===a.redSqr().redISub(n).cmpn(0)},L.prototype._endoWnafMulAdd=function(e,t,a){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},q.prototype.isInfinity=function(){return this.inf},q.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var a=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,r)},q.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,a=this.x.redSqr(),r=e.redInvm(),n=a.redAdd(a).redIAdd(a).redIAdd(t).redMul(r),i=n.redSqr().redISub(this.x.redAdd(this.x)),c=n.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,c)},q.prototype.getX=function(){return this.x.fromRed()},q.prototype.getY=function(){return this.y.fromRed()},q.prototype.mul=function(e){return e=new(y())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},q.prototype.mulAdd=function(e,t,a){var r=[this,t],n=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},q.prototype.jmulAdd=function(e,t,a){var r=[this,t],n=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},q.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},q.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var a=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(r)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(r)}}}return t},q.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},N(F,R.BasePoint),L.prototype.jpoint=function(e,t,a){return new F(this,e,t,a)},F.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),a=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(a,r)},F.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},F.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),a=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(a),i=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(a.redMul(this.z)),f=r.redSub(n),d=i.redSub(c);if(0===f.cmpn(0))return 0!==d.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=f.redSqr(),s=o.redMul(f),b=r.redMul(o),u=d.redSqr().redIAdd(s).redISub(b).redISub(b),h=d.redMul(b.redISub(u)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(u,h,l)},F.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),a=this.x,r=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),c=a.redSub(r),f=n.redSub(i);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=c.redSqr(),o=d.redMul(c),s=a.redMul(d),b=f.redSqr().redIAdd(o).redISub(s).redISub(s),u=f.redMul(s.redISub(b)).redISub(n.redMul(o)),h=this.z.redMul(c);return this.curve.jpoint(b,u,h)},F.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var a=this;for(t=0;t=0)return!1;if(a.redIAdd(n),0===this.x.cmp(a))return!0}},F.prototype.inspect=function(){return this.isInfinity()?"":""},F.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var D=_((function(e,t){var a=t;a.base=R,a.short=j,a.mont=null,a.edwards=null})),H=_((function(e,t){var a,r=t,n=B.assert;function i(e){"short"===e.type?this.curve=new D.short(e):"edwards"===e.type?this.curve=new D.edwards(e):this.curve=new D.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var a=new i(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:a}),a}})}r.PresetCurve=i,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:M().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:M().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:M().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:M().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:M().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:M().sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:M().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{a=null.crash()}catch(f){a=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:M().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})}));function z(e){if(!(this instanceof z))return new z(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=E.toArray(e.entropy,e.entropyEnc||"hex"),a=E.toArray(e.nonce,e.nonceEnc||"hex"),r=E.toArray(e.pers,e.persEnc||"hex");A(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,a,r)}var K=z;z.prototype._init=function(e,t,a){var r=e.concat(t).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(a||[])),this._reseed=1},z.prototype.generate=function(e,t,a,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=a,a=t,t=null),a&&(a=E.toArray(a,r||"hex"),this._update(a));var n=[];while(n.length"};var W=B.assert;function J(e,t){if(e instanceof J)return e;this._importDER(e,t)||(W(e.r&&e.s,"Signature without r or s"),this.r=new(y())(e.r,16),this.s=new(y())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var X=J;function Y(){this.place=0}function Q(e,t){var a=e[t.place++];if(!(128&a))return a;var r=15&a;if(0===r||r>4)return!1;for(var n=0,i=0,c=t.place;i>>=0;return!(n<=127)&&(t.place=c,n)}function $(e){var t=0,a=e.length-1;while(!e[t]&&!(128&e[t+1])&&t>>3);e.push(128|a);while(--a)e.push(t>>>(a<<3)&255);e.push(t)}}J.prototype._importDER=function(e,t){e=B.toArray(e,t);var a=new Y;if(48!==e[a.place++])return!1;var r=Q(e,a);if(!1===r)return!1;if(r+a.place!==e.length)return!1;if(2!==e[a.place++])return!1;var n=Q(e,a);if(!1===n)return!1;var i=e.slice(a.place,n+a.place);if(a.place+=n,2!==e[a.place++])return!1;var c=Q(e,a);if(!1===c)return!1;if(e.length!==c+a.place)return!1;var f=e.slice(a.place,c+a.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new(y())(i),this.s=new(y())(f),this.recoveryParam=null,!0},J.prototype.toDER=function(e){var t=this.r.toArray(),a=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&a[0]&&(a=[0].concat(a)),t=$(t),a=$(a);while(!a[0]&&!(128&a[1]))a=a.slice(1);var r=[2];ee(r,t.length),r=r.concat(t),r.push(2),ee(r,a.length);var n=r.concat(a),i=[48];return ee(i,n.length),i=i.concat(n),B.encode(i,e)};var te=function(){throw new Error("unsupported")},ae=B.assert;function re(e){if(!(this instanceof re))return new re(e);"string"===typeof e&&(ae(Object.prototype.hasOwnProperty.call(H,e),"Unknown curve "+e),e=H[e]),e instanceof H.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var ne=re;re.prototype.keyPair=function(e){return new V(this,e)},re.prototype.keyFromPrivate=function(e,t){return V.fromPrivate(this,e,t)},re.prototype.keyFromPublic=function(e,t){return V.fromPublic(this,e,t)},re.prototype.genKeyPair=function(e){e||(e={});for(var t=new K({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||te(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),r=this.n.sub(new(y())(2));;){var n=new(y())(t.generate(a));if(!(n.cmp(r)>0))return n.iaddn(1),this.keyFromPrivate(n)}},re.prototype._truncateToN=function(e,t){var a=8*e.byteLength()-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},re.prototype.sign=function(e,t,a,r){"object"===typeof a&&(r=a,a=null),r||(r={}),t=this.keyFromPrivate(t,a),e=this._truncateToN(new(y())(e,16));for(var n=this.n.byteLength(),i=t.getPrivate().toArray("be",n),c=e.toArray("be",n),f=new K({hash:this.hash,entropy:i,nonce:c,pers:r.pers,persEnc:r.persEnc||"utf8"}),d=this.n.sub(new(y())(1)),o=0;;o++){var s=r.k?r.k(o):new(y())(f.generate(this.n.byteLength()));if(s=this._truncateToN(s,!0),!(s.cmpn(1)<=0||s.cmp(d)>=0)){var b=this.g.mul(s);if(!b.isInfinity()){var u=b.getX(),h=u.umod(this.n);if(0!==h.cmpn(0)){var l=s.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(l=l.umod(this.n),0!==l.cmpn(0)){var p=(b.getY().isOdd()?1:0)|(0!==u.cmp(h)?2:0);return r.canonical&&l.cmp(this.nh)>0&&(l=this.n.sub(l),p^=1),new X({r:h,s:l,recoveryParam:p})}}}}}},re.prototype.verify=function(e,t,a,r){e=this._truncateToN(new(y())(e,16)),a=this.keyFromPublic(a,r),t=new X(t,"hex");var n=t.r,i=t.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var c,f=i.invm(this.n),d=f.mul(e).umod(this.n),o=f.mul(n).umod(this.n);return this.curve._maxwellTrick?(c=this.g.jmulAdd(d,a.getPublic(),o),!c.isInfinity()&&c.eqXToP(n)):(c=this.g.mulAdd(d,a.getPublic(),o),!c.isInfinity()&&0===c.getX().umod(this.n).cmp(n))},re.prototype.recoverPubKey=function(e,t,a,r){ae((3&a)===a,"The recovery param is more than two bits"),t=new X(t,r);var n=this.n,i=new(y())(e),c=t.r,f=t.s,d=1&a,o=a>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&o)throw new Error("Unable to find sencond key candinate");c=o?this.curve.pointFromX(c.add(this.curve.n),d):this.curve.pointFromX(c,d);var s=t.r.invm(n),b=n.sub(i).mul(s).umod(n),u=f.mul(s).umod(n);return this.g.mulAdd(b,c,u)},re.prototype.getKeyRecoveryParam=function(e,t,a,r){if(t=new X(t,r),null!==t.recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var i;try{i=this.recoverPubKey(e,t,n)}catch(e){continue}if(i.eq(a))return n}throw new Error("Unable to find valid recovery factor")};var ie=_((function(e,t){var a=t;a.version={version:"6.5.4"}.version,a.utils=B,a.rand=function(){throw new Error("unsupported")},a.curve=D,a.curves=H,a.ec=ne,a.eddsa=null})),ce=ie.ec;const fe="signing-key/5.6.0",de=new o.Yd(fe);let oe=null;function se(){return oe||(oe=new ce("secp256k1")),oe}class be{constructor(e){(0,d.zG)(this,"curve","secp256k1"),(0,d.zG)(this,"privateKey",(0,i.Dv)(e));const t=se().keyFromPrivate((0,i.lE)(this.privateKey));(0,d.zG)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,d.zG)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,d.zG)(this,"_isSigningKey",!0)}_addPoint(e){const t=se().keyFromPublic((0,i.lE)(this.publicKey)),a=se().keyFromPublic((0,i.lE)(e));return"0x"+t.pub.add(a.pub).encodeCompressed("hex")}signDigest(e){const t=se().keyFromPrivate((0,i.lE)(this.privateKey)),a=(0,i.lE)(e);32!==a.length&&de.throwArgumentError("bad digest length","digest",e);const r=t.sign(a,{canonical:!0});return(0,i.N)({recoveryParam:r.recoveryParam,r:(0,i.$m)("0x"+r.r.toString(16),32),s:(0,i.$m)("0x"+r.s.toString(16),32)})}computeSharedSecret(e){const t=se().keyFromPrivate((0,i.lE)(this.privateKey)),a=se().keyFromPublic((0,i.lE)(he(e)));return(0,i.$m)("0x"+t.derive(a.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function ue(e,t){const a=(0,i.N)(t),r={r:(0,i.lE)(a.r),s:(0,i.lE)(a.s)};return"0x"+se().recoverPubKey((0,i.lE)(e),r,a.recoveryParam).encode("hex",!1)}function he(e,t){const a=(0,i.lE)(e);if(32===a.length){const e=new be(a);return t?"0x"+se().keyFromPrivate(a).getPublic(!0,"hex"):e.publicKey}return 33===a.length?t?(0,i.Dv)(a):"0x"+se().keyFromPublic(a).getPublic(!1,"hex"):65===a.length?t?"0x"+se().keyFromPublic(a).getPublic(!0,"hex"):(0,i.Dv)(a):de.throwArgumentError("invalid public or private key","key","[REDACTED]")}const le="transactions/5.6.0",pe=new o.Yd(le);var xe;function me(e){return"0x"===e?null:(0,r.Kn)(e)}function ge(e){return"0x"===e?c._Y:n.O$.from(e)}(function(e){e[e["legacy"]=0]="legacy",e[e["eip2930"]=1]="eip2930",e[e["eip1559"]=2]="eip1559"})(xe||(xe={}));const ve=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],ye={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function we(e){const t=he(e);return(0,r.Kn)((0,i.p3)((0,f.w)((0,i.p3)(t,1)),12))}function Me(e,t){return we(ue((0,i.lE)(e),t))}function _e(e,t){const a=(0,i.G1)(n.O$.from(e).toHexString());return a.length>32&&pe.throwArgumentError("invalid length for "+t,"transaction:"+t,e),a}function ke(e,t){return{address:(0,r.Kn)(e),storageKeys:(t||[]).map(((t,a)=>(32!==(0,i.E1)(t)&&pe.throwArgumentError("invalid access list storageKey",`accessList[${e}:${a}]`,t),t.toLowerCase())))}}function Ae(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&pe.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),ke(e[0],e[1])):ke(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const a=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return ke(t,Object.keys(a).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Se(e){return Ae(e).map((e=>[e.address,e.storageKeys]))}function Ee(e,t){if(null!=e.gasPrice){const t=n.O$.from(e.gasPrice),a=n.O$.from(e.maxFeePerGas||0);t.eq(a)||pe.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:a})}const a=[_e(e.chainId||0,"chainId"),_e(e.nonce||0,"nonce"),_e(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),_e(e.maxFeePerGas||0,"maxFeePerGas"),_e(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.Kn)(e.to):"0x",_e(e.value||0,"value"),e.data||"0x",Se(e.accessList||[])];if(t){const e=(0,i.N)(t);a.push(_e(e.recoveryParam,"recoveryParam")),a.push((0,i.G1)(e.r)),a.push((0,i.G1)(e.s))}return(0,i.xs)(["0x02",p(a)])}function Be(e,t){const a=[_e(e.chainId||0,"chainId"),_e(e.nonce||0,"nonce"),_e(e.gasPrice||0,"gasPrice"),_e(e.gasLimit||0,"gasLimit"),null!=e.to?(0,r.Kn)(e.to):"0x",_e(e.value||0,"value"),e.data||"0x",Se(e.accessList||[])];if(t){const e=(0,i.N)(t);a.push(_e(e.recoveryParam,"recoveryParam")),a.push((0,i.G1)(e.r)),a.push((0,i.G1)(e.s))}return(0,i.xs)(["0x01",p(a)])}function Te(e,t){(0,d.uj)(e,ye);const a=[];ve.forEach((function(t){let r=e[t.name]||[];const n={};t.numeric&&(n.hexPad="left"),r=(0,i.lE)((0,i.Dv)(r,n)),t.length&&r.length!==t.length&&r.length>0&&pe.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r),t.maxLength&&(r=(0,i.G1)(r),r.length>t.maxLength&&pe.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,r)),a.push((0,i.Dv)(r))}));let r=0;if(null!=e.chainId?(r=e.chainId,"number"!==typeof r&&pe.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,i.Zq)(t)&&t.v>28&&(r=Math.floor((t.v-35)/2)),0!==r&&(a.push((0,i.Dv)(r)),a.push("0x"),a.push("0x")),!t)return p(a);const n=(0,i.N)(t);let c=27+n.recoveryParam;return 0!==r?(a.pop(),a.pop(),a.pop(),c+=2*r+8,n.v>28&&n.v!==c&&pe.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):n.v!==c&&pe.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),a.push((0,i.Dv)(c)),a.push((0,i.G1)((0,i.lE)(n.r))),a.push((0,i.G1)((0,i.lE)(n.s))),p(a)}function Pe(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&pe.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),Te(e,t);switch(e.type){case 1:return Be(e,t);case 2:return Ee(e,t);default:break}return pe.throwError(`unsupported transaction type: ${e.type}`,o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Ie(e,t,a){try{const a=ge(t[0]).toNumber();if(0!==a&&1!==a)throw new Error("bad recid");e.v=a}catch(r){pe.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,i.$m)(t[1],32),e.s=(0,i.$m)(t[2],32);try{const t=(0,f.w)(a(e));e.from=Me(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(r){console.log(r)}}function Ce(e){const t=g(e.slice(1));9!==t.length&&12!==t.length&&pe.throwArgumentError("invalid component count for transaction type: 2","payload",(0,i.Dv)(e));const a=ge(t[2]),r=ge(t[3]),n={type:2,chainId:ge(t[0]).toNumber(),nonce:ge(t[1]).toNumber(),maxPriorityFeePerGas:a,maxFeePerGas:r,gasPrice:null,gasLimit:ge(t[4]),to:me(t[5]),value:ge(t[6]),data:t[7],accessList:Ae(t[8])};return 9===t.length||(n.hash=(0,f.w)(e),Ie(n,t.slice(9),Ee)),n}function Re(e){const t=g(e.slice(1));8!==t.length&&11!==t.length&&pe.throwArgumentError("invalid component count for transaction type: 1","payload",(0,i.Dv)(e));const a={type:1,chainId:ge(t[0]).toNumber(),nonce:ge(t[1]).toNumber(),gasPrice:ge(t[2]),gasLimit:ge(t[3]),to:me(t[4]),value:ge(t[5]),data:t[6],accessList:Ae(t[7])};return 8===t.length||(a.hash=(0,f.w)(e),Ie(a,t.slice(8),Be)),a}function Oe(e){const t=g(e);9!==t.length&&6!==t.length&&pe.throwArgumentError("invalid raw transaction","rawTransaction",e);const a={nonce:ge(t[0]).toNumber(),gasPrice:ge(t[1]),gasLimit:ge(t[2]),to:me(t[3]),value:ge(t[4]),data:t[5],chainId:0};if(6===t.length)return a;try{a.v=n.O$.from(t[6]).toNumber()}catch(r){return console.log(r),a}if(a.r=(0,i.$m)(t[7],32),a.s=(0,i.$m)(t[8],32),n.O$.from(a.r).isZero()&&n.O$.from(a.s).isZero())a.chainId=a.v,a.v=0;else{a.chainId=Math.floor((a.v-35)/2),a.chainId<0&&(a.chainId=0);let n=a.v-27;const c=t.slice(0,6);0!==a.chainId&&(c.push((0,i.Dv)(a.chainId)),c.push("0x"),c.push("0x"),n-=2*a.chainId+8);const d=(0,f.w)(p(c));try{a.from=Me(d,{r:(0,i.Dv)(a.r),s:(0,i.Dv)(a.s),recoveryParam:n})}catch(r){console.log(r)}a.hash=(0,f.w)(e)}return a.type=null,a}function Ne(e){const t=(0,i.lE)(e);if(t[0]>127)return Oe(t);switch(t[0]){case 1:return Re(t);case 2:return Ce(t);default:break}return pe.throwError(`unsupported transaction type: ${t[0]}`,o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},73055:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0});const r=a(43793);function n(e,t,a){try{Reflect.apply(e,t,a)}catch(r){setTimeout((()=>{throw r}))}}function i(e){const t=e.length,a=new Array(t);for(let r=0;r0&&([e]=t),e instanceof Error)throw e;const a=new Error("Unhandled error."+(e?` (${e.message})`:""));throw a.context=e,a}const c=r[e];if(void 0===c)return!1;if("function"===typeof c)n(c,this,t);else{const e=c.length,a=i(c);for(let r=0;r1)}function E(){const e=k();return!!e&&(A()||S())}function B(){const e=_(),t=!(!e||!e.name)&&"node"===e.name.toLowerCase();return t}function T(){const e=!B()&&!!N();return e}const P=n.getFromWindow,I=n.getFromWindowOrThrow,C=n.getDocumentOrThrow,R=n.getDocument,O=n.getNavigatorOrThrow,N=n.getNavigator,U=n.getLocationOrThrow,L=n.getLocation,j=n.getCryptoOrThrow,q=n.getCrypto,F=n.getLocalStorageOrThrow,D=n.getLocalStorage;function H(){return r.D()}a(21703);function z(e){if("string"!==typeof e)throw new Error("Cannot safe json parse value of type "+typeof e);try{return JSON.parse(e)}catch(t){return e}}function K(e){return"string"===typeof e?e:JSON.stringify(e)}const Z=z,G=K;function V(e,t){const a=G(t),r=D();r&&r.setItem(e,a)}function W(e){let t=null,a=null;const r=D();return r&&(a=r.getItem(e)),t=a?Z(a):a,t}function J(e){const t=D();t&&t.removeItem(e)}const X="WALLETCONNECT_DEEPLINK_CHOICE";function Y(e,t){const a=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${a}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${a}`:""}function Q(e){const t=e.href.split("?")[0];V(X,Object.assign(Object.assign({},e),{href:t}))}function $(e,t){return e.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())))[0]}function ee(e,t){let a=e;return t&&(a=t.map((t=>$(e,t))).filter(Boolean)),a}const te="https://registry.walletconnect.com";function ae(){return te+"/api/v2/wallets"}function re(){return te+"/api/v2/dapps"}function ne(e,t="mobile"){var a;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:null!==(a=e.image_url.sm)&&void 0!==a?a:"",universalLink:e[t].universal||"",deepLink:e[t].native||""}}function ie(e,t="mobile"){return Object.values(e).filter((e=>!!e[t].universal||!!e[t].native)).map((e=>ne(e,t)))}},3896:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(48675),a(3462),a(21703);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.removeHexLeadingZeros=t.sanitizeHex=t.addHexPrefix=t.removeHexPrefix=t.padRight=t.padLeft=t.sanitizeBytes=t.swapHex=t.swapBytes=t.splitBytes=t.calcByteLength=t.trimRight=t.trimLeft=t.concatArrays=t.concatBuffers=t.getEncoding=t.getType=t.isArrayBuffer=t.isTypedArray=t.isBuffer=t.isHexString=t.isBinaryString=t.binaryToNumber=t.binaryToUtf8=t.binaryToHex=t.binaryToArray=t.binaryToBuffer=t.numberToBinary=t.numberToUtf8=t.numberToHex=t.numberToArray=t.numberToBuffer=t.utf8ToBinary=t.utf8ToNumber=t.utf8ToHex=t.utf8ToArray=t.utf8ToBuffer=t.hexToBinary=t.hexToNumber=t.hexToUtf8=t.hexToArray=t.hexToBuffer=t.arrayToBinary=t.arrayToNumber=t.arrayToUtf8=t.arrayToHex=t.arrayToBuffer=t.bufferToBinary=t.bufferToNumber=t.bufferToUtf8=t.bufferToHex=t.bufferToArray=void 0;const i=n(a(6513)),c=n(a(75519)),f="hex",d="utf8",o="binary",s="buffer",b="array",u="typed-array",h="array-buffer",l="0";function p(e){return new Uint8Array(e)}function x(e,t=!1){const a=e.toString(f);return t?se(a):a}function m(e){return e.toString(d)}function g(e){return e.readUIntBE(0,e.length)}function v(e){return k(p(e))}function y(e){return c.default(e)}function w(e,t=!1){return x(y(e),t)}function M(e){return m(y(e))}function _(e){return g(y(e))}function k(e){return Array.from(e).map(q).join("")}function A(e){return r.from(oe(e),f)}function S(e){return p(A(e))}function E(e){return m(A(e))}function B(e){return _(S(e))}function T(e){return k(S(e))}function P(e){return r.from(e,d)}function I(e){return p(P(e))}function C(e,t=!1){return x(P(e),t)}function R(e){const t=parseInt(e,10);return pe(le(t),"Number can only safely store up to 53 bits"),t}function O(e){return k(I(e))}function N(e){return F(q(e))}function U(e){return D(q(e))}function L(e,t){return H(q(e),t)}function j(e){return`${e}`}function q(e){const t=(e>>>0).toString(2);return ce(t)}function F(e){return y(D(e))}function D(e){return new Uint8Array(re(e).map((e=>parseInt(e,2))))}function H(e,t){return w(D(e),t)}function z(e){return M(D(e))}function K(e){return _(D(e))}function Z(e){return!("string"!==typeof e||!new RegExp(/^[01]+$/).test(e))&&e.length%8===0}function G(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function V(e){return r.isBuffer(e)}function W(e){return i.default.strict(e)&&!V(e)}function J(e){return!W(e)&&!V(e)&&"undefined"!==typeof e.byteLength}function X(e){return V(e)?s:W(e)?u:J(e)?h:Array.isArray(e)?b:typeof e}function Y(e){return Z(e)?o:G(e)?f:d}function Q(...e){const t=r.concat(e);return t}function $(...e){let t=[];return e.forEach((e=>t=t.concat(Array.from(e)))),new Uint8Array([...t])}function ee(e,t){const a=e.length-t;return a>0&&(e=e.slice(a)),e}function te(e,t){return e.slice(0,t)}function ae(e,t=8){const a=e%t;return a?(e-a)/t*t+t:e}function re(e,t=8){const a=ce(e).match(new RegExp(`.{${t}}`,"gi"));return Array.from(a||[])}function ne(e){return re(e).map(xe).join("")}function ie(e){return H(ne(T(e)))}function ce(e,t=8,a=l){return fe(e,ae(e.length,t),a)}function fe(e,t,a=l){return me(e,t,!0,a)}function de(e,t,a=l){return me(e,t,!1,a)}function oe(e){return e.replace(/^0x/,"")}function se(e){return e.startsWith("0x")?e:`0x${e}`}function be(e){return e=oe(e),e=ce(e,2),e&&(e=se(e)),e}function ue(e){const t=e.startsWith("0x");return e=oe(e),e=e.startsWith(l)?e.substring(1):e,t?se(e):e}function he(e){return"undefined"===typeof e}function le(e){return!he(e)}function pe(e,t){if(!e)throw new Error(t)}function xe(e){return e.split("").reverse().join("")}function me(e,t,a,r=l){const n=t-e.length;let i=e;if(n>0){const t=r.repeat(n);i=a?t+e:e+t}return i}t.bufferToArray=p,t.bufferToHex=x,t.bufferToUtf8=m,t.bufferToNumber=g,t.bufferToBinary=v,t.arrayToBuffer=y,t.arrayToHex=w,t.arrayToUtf8=M,t.arrayToNumber=_,t.arrayToBinary=k,t.hexToBuffer=A,t.hexToArray=S,t.hexToUtf8=E,t.hexToNumber=B,t.hexToBinary=T,t.utf8ToBuffer=P,t.utf8ToArray=I,t.utf8ToHex=C,t.utf8ToNumber=R,t.utf8ToBinary=O,t.numberToBuffer=N,t.numberToArray=U,t.numberToHex=L,t.numberToUtf8=j,t.numberToBinary=q,t.binaryToBuffer=F,t.binaryToArray=D,t.binaryToHex=H,t.binaryToUtf8=z,t.binaryToNumber=K,t.isBinaryString=Z,t.isHexString=G,t.isBuffer=V,t.isTypedArray=W,t.isArrayBuffer=J,t.getType=X,t.getEncoding=Y,t.concatBuffers=Q,t.concatArrays=$,t.trimLeft=ee,t.trimRight=te,t.calcByteLength=ae,t.splitBytes=re,t.swapBytes=ne,t.swapHex=ie,t.sanitizeBytes=ce,t.padLeft=fe,t.padRight=de,t.removeHexPrefix=oe,t.addHexPrefix=se,t.sanitizeHex=be,t.removeHexLeadingZeros=ue},46129:function(e,t,a){"use strict";function r(){return(null===a.g||void 0===a.g?void 0:a.g.crypto)||(null===a.g||void 0===a.g?void 0:a.g.msCrypto)||{}}function n(){const e=r();return e.subtle||e.webkitSubtle}function i(){return!!r()&&!!n()}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=r,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=i},46862:function(e,t,a){"use strict";var r=a(96027);function n(){return"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!==typeof r&&"undefined"!==typeof r.versions&&"undefined"!==typeof r.versions.node}function c(){return!n()&&!i()}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=n,t.isNode=i,t.isBrowser=c},29441:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||t.hasOwnProperty(a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(46129),t),n(a(46862),t)},83581:function(e,t,a){var r=a(96027);function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var i=a(61639),c=n(a(38385)),f=n(a(51945)),d=a(45626);function o(e){c.toString(e,{type:"terminal"}).then(console.log)}var s=':root {\n --animation-duration: 300ms;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.animated {\n animation-duration: var(--animation-duration);\n animation-fill-mode: both;\n}\n\n.fadeIn {\n animation-name: fadeIn;\n}\n\n.fadeOut {\n animation-name: fadeOut;\n}\n\n#walletconnect-wrapper {\n -webkit-user-select: none;\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n left: 0;\n pointer-events: none;\n position: fixed;\n top: 0;\n user-select: none;\n width: 100%;\n z-index: 99999999999999;\n}\n\n.walletconnect-modal__headerLogo {\n height: 21px;\n}\n\n.walletconnect-modal__header p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n align-items: flex-start;\n display: flex;\n flex: 1;\n margin-left: 5px;\n}\n\n.walletconnect-modal__close__wrapper {\n position: absolute;\n top: 0px;\n right: 0px;\n z-index: 10000;\n background: white;\n border-radius: 26px;\n padding: 6px;\n box-sizing: border-box;\n width: 26px;\n height: 26px;\n cursor: pointer;\n}\n\n.walletconnect-modal__close__icon {\n position: relative;\n top: 7px;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: rotate(45deg);\n}\n\n.walletconnect-modal__close__line1 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n}\n\n.walletconnect-modal__close__line2 {\n position: absolute;\n width: 100%;\n border: 1px solid rgb(48, 52, 59);\n transform: rotate(90deg);\n}\n\n.walletconnect-qrcode__base {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n background: rgba(37, 41, 46, 0.95);\n height: 100%;\n left: 0;\n pointer-events: auto;\n position: fixed;\n top: 0;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n width: 100%;\n will-change: opacity;\n padding: 40px;\n box-sizing: border-box;\n}\n\n.walletconnect-qrcode__text {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 10px 0 20px 0;\n text-align: center;\n width: 100%;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-qrcode__text {\n font-size: 4vw;\n }\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-qrcode__text {\n font-size: 14px;\n }\n}\n\n.walletconnect-qrcode__image {\n width: calc(100% - 30px);\n box-sizing: border-box;\n cursor: none;\n margin: 0 auto;\n}\n\n.walletconnect-qrcode__notification {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n font-size: 16px;\n padding: 16px 20px;\n border-radius: 16px;\n text-align: center;\n transition: all 0.1s ease-in-out;\n background: white;\n color: black;\n margin-bottom: -60px;\n opacity: 0;\n}\n\n.walletconnect-qrcode__notification.notification__show {\n opacity: 1;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__header {\n height: 130px;\n }\n .walletconnect-modal__base {\n overflow: auto;\n }\n}\n\n@media only screen and (min-device-width: 415px) and (max-width: 768px) {\n #content {\n max-width: 768px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 375px) and (max-width: 415px) {\n #content {\n max-width: 414px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (min-width: 320px) and (max-width: 375px) {\n #content {\n max-width: 375px;\n box-sizing: border-box;\n }\n}\n\n@media only screen and (max-width: 320px) {\n #content {\n max-width: 320px;\n box-sizing: border-box;\n }\n}\n\n.walletconnect-modal__base {\n -webkit-font-smoothing: antialiased;\n background: #ffffff;\n border-radius: 24px;\n box-shadow: 0 10px 50px 5px rgba(0, 0, 0, 0.4);\n font-family: ui-rounded, "SF Pro Rounded", "SF Pro Text", medium-content-sans-serif-font,\n -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,\n "Open Sans", "Helvetica Neue", sans-serif;\n margin-top: 41px;\n padding: 24px 24px 22px;\n pointer-events: auto;\n position: relative;\n text-align: center;\n transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);\n will-change: transform;\n overflow: visible;\n transform: translateY(-50%);\n top: 50%;\n max-width: 500px;\n margin: auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__base {\n padding: 24px 12px;\n }\n}\n\n.walletconnect-modal__base .hidden {\n transform: translateY(150%);\n transition: 0.125s cubic-bezier(0.4, 0, 1, 1);\n}\n\n.walletconnect-modal__header {\n align-items: center;\n display: flex;\n height: 26px;\n left: 0;\n justify-content: space-between;\n position: absolute;\n top: -42px;\n width: 100%;\n}\n\n.walletconnect-modal__base .wc-logo {\n align-items: center;\n display: flex;\n height: 26px;\n margin-top: 15px;\n padding-bottom: 15px;\n pointer-events: auto;\n}\n\n.walletconnect-modal__base .wc-logo div {\n background-color: #3399ff;\n height: 21px;\n margin-right: 5px;\n mask-image: url("images/wc-logo.svg") center no-repeat;\n width: 32px;\n}\n\n.walletconnect-modal__base .wc-logo p {\n color: #ffffff;\n font-size: 20px;\n font-weight: 600;\n margin: 0;\n}\n\n.walletconnect-modal__base h2 {\n color: rgba(60, 66, 82, 0.6);\n font-size: 16px;\n font-weight: 600;\n letter-spacing: 0;\n line-height: 1.1875em;\n margin: 0 0 19px 0;\n text-align: center;\n width: 100%;\n}\n\n.walletconnect-modal__base__row {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n align-items: center;\n border-radius: 20px;\n cursor: pointer;\n display: flex;\n height: 56px;\n justify-content: space-between;\n padding: 0 15px;\n position: relative;\n margin: 0px 0px 8px;\n text-align: left;\n transition: 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n will-change: transform;\n text-decoration: none;\n}\n\n.walletconnect-modal__base__row:hover {\n background: rgba(60, 66, 82, 0.06);\n}\n\n.walletconnect-modal__base__row:active {\n background: rgba(60, 66, 82, 0.06);\n transform: scale(0.975);\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n}\n\n.walletconnect-modal__base__row__h3 {\n color: #25292e;\n font-size: 20px;\n font-weight: 700;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.walletconnect-modal__base__row__right {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.walletconnect-modal__base__row__right__app-icon {\n border-radius: 8px;\n height: 34px;\n margin: 0 11px 2px 0;\n width: 34px;\n background-size: 100%;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-modal__base__row__right__caret {\n height: 18px;\n opacity: 0.3;\n transition: 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);\n width: 8px;\n will-change: opacity;\n}\n\n.walletconnect-modal__base__row:hover .caret,\n.walletconnect-modal__base__row:active .caret {\n opacity: 0.6;\n}\n\n.walletconnect-modal__mobile__toggle {\n width: 80%;\n display: flex;\n margin: 0 auto;\n position: relative;\n overflow: hidden;\n border-radius: 8px;\n margin-bottom: 18px;\n background: #d4d5d9;\n}\n\n.walletconnect-modal__single_wallet {\n display: flex;\n justify-content: center;\n margin-top: 7px;\n margin-bottom: 18px;\n}\n\n.walletconnect-modal__single_wallet a {\n cursor: pointer;\n color: rgb(64, 153, 255);\n font-size: 21px;\n font-weight: 800;\n text-decoration: none !important;\n margin: 0 auto;\n}\n\n.walletconnect-modal__mobile__toggle_selector {\n width: calc(50% - 8px);\n background: white;\n position: absolute;\n border-radius: 5px;\n height: calc(100% - 8px);\n top: 4px;\n transition: all 0.2s ease-in-out;\n transform: translate3d(4px, 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle.right__selected .walletconnect-modal__mobile__toggle_selector {\n transform: translate3d(calc(100% + 12px), 0, 0);\n}\n\n.walletconnect-modal__mobile__toggle a {\n font-size: 12px;\n width: 50%;\n text-align: center;\n padding: 8px;\n margin: 0;\n font-weight: 600;\n z-index: 1;\n}\n\n.walletconnect-modal__footer {\n display: flex;\n justify-content: center;\n margin-top: 20px;\n}\n\n@media only screen and (max-width: 768px) {\n .walletconnect-modal__footer {\n margin-top: 5vw;\n }\n}\n\n.walletconnect-modal__footer a {\n cursor: pointer;\n color: #898d97;\n font-size: 15px;\n margin: 0 auto;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-modal__footer a {\n font-size: 14px;\n }\n}\n\n.walletconnect-connect__buttons__wrapper {\n max-height: 44vh;\n}\n\n.walletconnect-connect__buttons__wrapper__android {\n margin: 50% 0;\n}\n\n.walletconnect-connect__buttons__wrapper__wrap {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n margin: 10px 0;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__buttons__wrapper__wrap {\n margin-top: 40px;\n }\n}\n\n.walletconnect-connect__button {\n background-color: rgb(64, 153, 255);\n padding: 12px;\n border-radius: 8px;\n text-decoration: none;\n color: rgb(255, 255, 255);\n font-weight: 500;\n}\n\n.walletconnect-connect__button__icon_anchor {\n cursor: pointer;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n margin: 8px;\n width: 42px;\n justify-self: center;\n flex-direction: column;\n text-decoration: none !important;\n}\n\n@media only screen and (max-width: 320px) {\n .walletconnect-connect__button__icon_anchor {\n margin: 4px;\n }\n}\n\n.walletconnect-connect__button__icon {\n border-radius: 10px;\n height: 42px;\n margin: 0;\n width: 42px;\n background-size: cover !important;\n box-shadow: 0 4px 12px 0 rgba(37, 41, 46, 0.25);\n}\n\n.walletconnect-connect__button__text {\n color: #424952;\n font-size: 2.7vw;\n text-decoration: none !important;\n padding: 0;\n margin-top: 1.8vw;\n font-weight: 600;\n}\n\n@media only screen and (min-width: 768px) {\n .walletconnect-connect__button__text {\n font-size: 16px;\n margin-top: 12px;\n }\n}\n\n.walletconnect-search__input {\n border: none;\n background: #d4d5d9;\n border-style: none;\n padding: 8px 16px;\n outline: none;\n font-style: normal;\n font-stretch: normal;\n font-size: 16px;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: left;\n border-radius: 8px;\n width: calc(100% - 16px);\n margin: 0;\n margin-bottom: 8px;\n}\n';"undefined"!==typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),"undefined"!==typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function b(e,t){try{var a=e()}catch(r){return t(r)}return a&&a.then?a.then(void 0,t):a}var u="data:image/svg+xml,%3Csvg height='185' viewBox='0 0 300 185' width='300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m61.4385429 36.2562612c48.9112241-47.8881663 128.2119871-47.8881663 177.1232091 0l5.886545 5.7634174c2.445561 2.3944081 2.445561 6.2765112 0 8.6709204l-20.136695 19.715503c-1.222781 1.1972051-3.2053 1.1972051-4.428081 0l-8.100584-7.9311479c-34.121692-33.4079817-89.443886-33.4079817-123.5655788 0l-8.6750562 8.4936051c-1.2227816 1.1972041-3.205301 1.1972041-4.4280806 0l-20.1366949-19.7155031c-2.4455612-2.3944092-2.4455612-6.2765122 0-8.6709204zm218.7677961 40.7737449 17.921697 17.546897c2.445549 2.3943969 2.445563 6.2764769.000031 8.6708899l-80.810171 79.121134c-2.445544 2.394426-6.410582 2.394453-8.85616.000062-.00001-.00001-.000022-.000022-.000032-.000032l-57.354143-56.154572c-.61139-.598602-1.60265-.598602-2.21404 0-.000004.000004-.000007.000008-.000011.000011l-57.3529212 56.154531c-2.4455368 2.394432-6.4105755 2.394472-8.8561612.000087-.0000143-.000014-.0000296-.000028-.0000449-.000044l-80.81241943-79.122185c-2.44556021-2.394408-2.44556021-6.2765115 0-8.6709197l17.92172963-17.5468673c2.4455602-2.3944082 6.4105989-2.3944082 8.8561602 0l57.3549775 56.155357c.6113908.598602 1.602649.598602 2.2140398 0 .0000092-.000009.0000174-.000017.0000265-.000024l57.3521031-56.155333c2.445505-2.3944633 6.410544-2.3945531 8.856161-.0002.000034.0000336.000068.0000673.000101.000101l57.354902 56.155432c.61139.598601 1.60265.598601 2.21404 0l57.353975-56.1543249c2.445561-2.3944092 6.410599-2.3944092 8.85616 0z' fill='%233b99fc'/%3E%3C/svg%3E",h="WalletConnect",l=300,p="rgb(64, 153, 255)",x="walletconnect-wrapper",m="walletconnect-style-sheet",g="walletconnect-qrcode-modal",v="walletconnect-qrcode-close",y="walletconnect-qrcode-text",w="walletconnect-connect-button";function M(e){return d.createElement("div",{className:"walletconnect-modal__header"},d.createElement("img",{src:u,className:"walletconnect-modal__headerLogo"}),d.createElement("p",null,h),d.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:e.onClose},d.createElement("div",{id:v,className:"walletconnect-modal__close__icon"},d.createElement("div",{className:"walletconnect-modal__close__line1"}),d.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function _(e){return d.createElement("a",{className:"walletconnect-connect__button",href:e.href,id:w+"-"+e.name,onClick:e.onClick,rel:"noopener noreferrer",style:{backgroundColor:e.color},target:"_blank"},e.name)}var k="data:image/svg+xml,%3Csvg fill='none' height='18' viewBox='0 0 8 18' width='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath clip-rule='evenodd' d='m.586301.213898c-.435947.33907-.5144813.967342-.175411 1.403292l4.87831 6.27212c.28087.36111.28087.86677 0 1.22788l-4.878311 6.27211c-.33907.436-.260536 1.0642.175412 1.4033.435949.3391 1.064219.2605 1.403289-.1754l4.87832-6.2721c.84259-1.08336.84259-2.60034 0-3.68367l-4.87832-6.27212c-.33907-.4359474-.96734-.514482-1.403289-.175412z' fill='%233c4252' fill-rule='evenodd'/%3E%3C/svg%3E";function A(e){var t=e.color,a=e.href,r=e.name,n=e.logo,i=e.onClick;return d.createElement("a",{className:"walletconnect-modal__base__row",href:a,onClick:i,rel:"noopener noreferrer",target:"_blank"},d.createElement("h3",{className:"walletconnect-modal__base__row__h3"},r),d.createElement("div",{className:"walletconnect-modal__base__row__right"},d.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+n+"') "+t,backgroundSize:"100%"}}),d.createElement("img",{src:k,className:"walletconnect-modal__base__row__right__caret"})))}function S(e){var t=e.color,a=e.href,r=e.name,n=e.logo,i=e.onClick,c=window.innerWidth<768?(r.length>8?2.5:2.7)+"vw":"inherit";return d.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:a,onClick:i,rel:"noopener noreferrer",target:"_blank"},d.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+n+"') "+t,backgroundSize:"100%"}}),d.createElement("div",{style:{fontSize:c},className:"walletconnect-connect__button__text"},r))}var E=5,B=12;function T(e){var t=i.isAndroid(),a=d.useState(""),r=a[0],n=a[1],c=d.useState(""),f=c[0],o=c[1],s=d.useState(1),b=s[0],u=s[1],h=f?e.links.filter((function(e){return e.name.toLowerCase().includes(f.toLowerCase())})):e.links,l=e.errorMessage,x=f||h.length>E,m=Math.ceil(h.length/B),g=[(b-1)*B+1,b*B],v=h.length?h.filter((function(e,t){return t+1>=g[0]&&t+1<=g[1]})):[],w=!(t||!(m>1)),M=void 0;function k(e){n(e.target.value),clearTimeout(M),e.target.value?M=setTimeout((function(){o(e.target.value),u(1)}),1e3):(n(""),o(""),u(1))}return d.createElement("div",null,d.createElement("p",{id:y,className:"walletconnect-qrcode__text"},t?e.text.connect_mobile_wallet:e.text.choose_preferred_wallet),!t&&d.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:r,onChange:k}),d.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?"__android":x&&h.length?"__wrap":"")},t?d.createElement(_,{name:e.text.connect,color:p,href:e.uri,onClick:d.useCallback((function(){i.saveMobileLinkInfo({name:"Unknown",href:e.uri})}),[])}):v.length?v.map((function(t){var a=t.color,r=t.name,n=t.shortName,c=t.logo,f=i.formatIOSMobile(e.uri,t),o=d.useCallback((function(){i.saveMobileLinkInfo({name:r,href:f})}),[v]);return x?d.createElement(S,{color:a,href:f,name:n||r,logo:c,onClick:o}):d.createElement(A,{color:a,href:f,name:r,logo:c,onClick:o})})):d.createElement(d.Fragment,null,d.createElement("p",null,l.length?e.errorMessage:e.links.length&&!h.length?e.text.no_wallets_found:e.text.loading))),w&&d.createElement("div",{className:"walletconnect-modal__footer"},Array(m).fill(0).map((function(e,t){var a=t+1,r=b===a;return d.createElement("a",{style:{margin:"auto 10px",fontWeight:r?"bold":"normal"},onClick:function(){return u(a)}},a)}))))}function P(e){var t=!!e.message.trim();return d.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}var I=function(e){try{var t="";return Promise.resolve(c.toString(e,{margin:0,type:"svg"})).then((function(e){return"string"===typeof e&&(t=e.replace("0||d.useEffect((function(){var n=function(){try{if(t)return Promise.resolve();f(!0);var n=b((function(){var t=e.qrcodeModalOptions&&e.qrcodeModalOptions.registryUrl?e.qrcodeModalOptions.registryUrl:i.getWalletRegistryUrl();return Promise.resolve(fetch(t)).then((function(t){return Promise.resolve(t.json()).then((function(t){var n=t.listings,c=a?"mobile":"desktop",d=i.getMobileLinkRegistry(i.formatMobileRegistry(n,c),r);f(!1),u(!0),I(d.length?"":e.text.no_supported_wallets),E(d);var o=1===d.length;o&&(y(i.formatIOSMobile(e.uri,d[0])),p(!0)),k(o)}))}))}),(function(t){f(!1),u(!0),I(e.text.something_went_wrong),console.error(t)}));return Promise.resolve(n&&n.then?n.then((function(){})):void 0)}catch(c){return Promise.reject(c)}};n()}))};R();var O=a?l:!l;return d.createElement("div",{id:g,className:"walletconnect-qrcode__base animated fadeIn"},d.createElement("div",{className:"walletconnect-modal__base"},d.createElement(M,{onClose:e.onClose}),_&&l?d.createElement("div",{className:"walletconnect-modal__single_wallet"},d.createElement("a",{onClick:function(){return i.saveMobileLinkInfo({name:S[0].name,href:v})},href:v,rel:"noopener noreferrer",target:"_blank"},e.text.connect_with+" "+(_?S[0].name:"")+" ›")):t||c||!c&&S.length?d.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(O?" right__selected":"")},d.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),a?d.createElement(d.Fragment,null,d.createElement("a",{onClick:function(){return p(!1),R()}},e.text.mobile),d.createElement("a",{onClick:function(){return p(!0)}},e.text.qrcode)):d.createElement(d.Fragment,null,d.createElement("a",{onClick:function(){return p(!0)}},e.text.qrcode),d.createElement("a",{onClick:function(){return p(!1),R()}},e.text.desktop))):null,d.createElement("div",null,l||!t&&!c&&!S.length?d.createElement(C,Object.assign({},x)):d.createElement(T,Object.assign({},x,{links:S,errorMessage:P})))))}var O={choose_preferred_wallet:"Wähle bevorzugte Wallet",connect_mobile_wallet:"Verbinde mit Mobile Wallet",scan_qrcode_with_wallet:"Scanne den QR-code mit einer WalletConnect kompatiblen Wallet",connect:"Verbinden",qrcode:"QR-Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"In die Zwischenablage kopieren",copied_to_clipboard:"In die Zwischenablage kopiert!",connect_with:"Verbinden mit Hilfe von",loading:"Laden...",something_went_wrong:"Etwas ist schief gelaufen",no_supported_wallets:"Es gibt noch keine unterstützten Wallet",no_wallets_found:"keine Wallet gefunden"},N={choose_preferred_wallet:"Choose your preferred wallet",connect_mobile_wallet:"Connect to Mobile Wallet",scan_qrcode_with_wallet:"Scan QR code with a WalletConnect-compatible wallet",connect:"Connect",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copy to clipboard",copied_to_clipboard:"Copied to clipboard!",connect_with:"Connect with",loading:"Loading...",something_went_wrong:"Something went wrong",no_supported_wallets:"There are no supported wallets yet",no_wallets_found:"No wallets found"},U={choose_preferred_wallet:"Elige tu billetera preferida",connect_mobile_wallet:"Conectar a billetera móvil",scan_qrcode_with_wallet:"Escanea el código QR con una billetera compatible con WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvil",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Conectar mediante",loading:"Cargando...",something_went_wrong:"Algo salió mal",no_supported_wallets:"Todavía no hay billeteras compatibles",no_wallets_found:"No se encontraron billeteras"},L={choose_preferred_wallet:"Choisissez votre portefeuille préféré",connect_mobile_wallet:"Se connecter au portefeuille mobile",scan_qrcode_with_wallet:"Scannez le QR code avec un portefeuille compatible WalletConnect",connect:"Se connecter",qrcode:"QR Code",mobile:"Mobile",desktop:"Desktop",copy_to_clipboard:"Copier",copied_to_clipboard:"Copié!",connect_with:"Connectez-vous à l'aide de",loading:"Chargement...",something_went_wrong:"Quelque chose a mal tourné",no_supported_wallets:"Il n'y a pas encore de portefeuilles pris en charge",no_wallets_found:"Aucun portefeuille trouvé"},j={choose_preferred_wallet:"원하는 지갑을 선택하세요",connect_mobile_wallet:"모바일 지갑과 연결",scan_qrcode_with_wallet:"WalletConnect 지원 지갑에서 QR코드를 스캔하세요",connect:"연결",qrcode:"QR 코드",mobile:"모바일",desktop:"데스크탑",copy_to_clipboard:"클립보드에 복사",copied_to_clipboard:"클립보드에 복사되었습니다!",connect_with:"와 연결하다",loading:"로드 중...",something_went_wrong:"문제가 발생했습니다.",no_supported_wallets:"아직 지원되는 지갑이 없습니다",no_wallets_found:"지갑을 찾을 수 없습니다"},q={choose_preferred_wallet:"Escolha sua carteira preferida",connect_mobile_wallet:"Conectar-se à carteira móvel",scan_qrcode_with_wallet:"Ler o código QR com uma carteira compatível com WalletConnect",connect:"Conectar",qrcode:"Código QR",mobile:"Móvel",desktop:"Desktop",copy_to_clipboard:"Copiar",copied_to_clipboard:"Copiado!",connect_with:"Ligar por meio de",loading:"Carregamento...",something_went_wrong:"Algo correu mal",no_supported_wallets:"Ainda não há carteiras suportadas",no_wallets_found:"Nenhuma carteira encontrada"},F={choose_preferred_wallet:"选择你的钱包",connect_mobile_wallet:"连接至移动端钱包",scan_qrcode_with_wallet:"使用兼容 WalletConnect 的钱包扫描二维码",connect:"连接",qrcode:"二维码",mobile:"移动",desktop:"桌面",copy_to_clipboard:"复制到剪贴板",copied_to_clipboard:"复制到剪贴板成功!",connect_with:"通过以下方式连接",loading:"正在加载...",something_went_wrong:"出了问题",no_supported_wallets:"目前还没有支持的钱包",no_wallets_found:"没有找到钱包"},D={choose_preferred_wallet:"کیف پول مورد نظر خود را انتخاب کنید",connect_mobile_wallet:"به کیف پول موبایل وصل شوید",scan_qrcode_with_wallet:"کد QR را با یک کیف پول سازگار با WalletConnect اسکن کنید",connect:"اتصال",qrcode:"کد QR",mobile:"سیار",desktop:"دسکتاپ",copy_to_clipboard:"کپی به کلیپ بورد",copied_to_clipboard:"در کلیپ بورد کپی شد!",connect_with:"ارتباط با",loading:"...بارگذاری",something_went_wrong:"مشکلی پیش آمد",no_supported_wallets:"هنوز هیچ کیف پول پشتیبانی شده ای وجود ندارد",no_wallets_found:"هیچ کیف پولی پیدا نشد"},H={de:O,en:N,es:U,fr:L,ko:j,pt:q,zh:F,fa:D};function z(){var e=i.getDocumentOrThrow(),t=e.getElementById(m);t&&e.head.removeChild(t);var a=e.createElement("style");a.setAttribute("id",m),a.innerText=s,e.head.appendChild(a)}function K(){var e=i.getDocumentOrThrow(),t=e.createElement("div");return t.setAttribute("id",x),e.body.appendChild(t),t}function Z(){var e=i.getDocumentOrThrow(),t=e.getElementById(g);t&&(t.className=t.className.replace("fadeIn","fadeOut"),setTimeout((function(){var t=e.getElementById(x);t&&e.body.removeChild(t)}),l))}function G(e){return function(){Z(),e&&e()}}function V(){var e=i.getNavigatorOrThrow().language.split("-")[0]||"en";return H[e]||H["en"]}function W(e,t,a){z();var r=K();d.render(d.createElement(R,{text:V(),uri:e,onClose:G(t),qrcodeModalOptions:a}),r)}function J(){Z()}var X=function(){return"undefined"!==typeof r&&"undefined"!==typeof r.versions&&"undefined"!==typeof r.versions.node};function Y(e,t,a){console.log(e),X()?o(e):W(e,t,a)}function Q(){X()||J()}var $={open:Y,close:Q};e.exports=$},90994:function(e,t,a){"use strict";a(21703),e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},23380:function(e,t,a){"use strict";function r(e){let t;return"undefined"!==typeof window&&"undefined"!==typeof window[e]&&(t=window[e]),t}function n(e){const t=r(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}function i(){return n("document")}function c(){return r("document")}function f(){return n("navigator")}function d(){return r("navigator")}function o(){return n("location")}function s(){return r("location")}function b(){return n("crypto")}function u(){return r("crypto")}function h(){return n("localStorage")}function l(){return r("localStorage")}a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=i,t.getDocument=c,t.getNavigatorOrThrow=f,t.getNavigator=d,t.getLocationOrThrow=o,t.getLocation=s,t.getCryptoOrThrow=b,t.getCrypto=u,t.getLocalStorageOrThrow=h,t.getLocalStorage=l},91342:function(e,t,a){"use strict";t.D=void 0;const r=a(23380);function n(){let e,t;try{e=r.getDocumentOrThrow(),t=r.getLocationOrThrow()}catch(u){return null}function a(){const a=e.getElementsByTagName("link"),r=[];for(let e=0;e-1){const e=n.getAttribute("href");if(e)if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let a=t.protocol+"//"+t.host;if(0===e.indexOf("/"))a+=e;else{const r=t.pathname.split("/");r.pop();const n=r.join("/");a+=n+"/"+e}r.push(a)}else if(0===e.indexOf("//")){const a=t.protocol+e;r.push(a)}else r.push(e)}}return r}function n(...t){const a=e.getElementsByTagName("meta");for(let e=0;er.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(n.length&&n){const e=r.getAttribute("content");if(e)return e}}return""}function i(){let t=n("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}function c(){const e=n("description","og:description","twitter:description","keywords");return e}const f=i(),d=c(),o=t.origin,s=a(),b={description:d,url:o,icons:s,name:f};return b}t.D=n},18625:function(e,t,a){"use strict";const r=t;r.bignum=a(2396),r.define=a(49542).define,r.base=a(51406),r.constants=a(84194),r.decoders=a(86410),r.encoders=a(19375)},49542:function(e,t,a){"use strict";const r=a(19375),n=a(86410),i=a(81923),c=t;function f(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}c.define=function(e,t){return new f(e,t)},f.prototype._createNamed=function(e){const t=this.name;function a(e){this._initNamed(e,t)}return i(a,e),a.prototype._initNamed=function(t,a){e.call(this,t,a)},new a(this)},f.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n[e])),this.decoders[e]},f.prototype.decode=function(e,t,a){return this._getDecoder(t).decode(e,a)},f.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(r[e])),this.encoders[e]},f.prototype.encode=function(e,t,a){return this._getEncoder(t).encode(e,a)}},42956:function(e,t,a){"use strict";const r=a(81923),n=a(5487).b,i=a(85330).Buffer;function c(e,t){n.call(this,t),i.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function f(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return f.isEncoderBuffer(e)||(e=new f(e,t)),this.length+=e.length,e}),this);else if("number"===typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"===typeof e)this.value=e,this.length=i.byteLength(e);else{if(!i.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}r(c,n),t.C=c,c.isDecoderBuffer=function(e){if(e instanceof c)return!0;const t="object"===typeof e&&i.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"===typeof e.offset&&"number"===typeof e.length&&"function"===typeof e.save&&"function"===typeof e.restore&&"function"===typeof e.isEmpty&&"function"===typeof e.readUInt8&&"function"===typeof e.skip&&"function"===typeof e.raw;return t},c.prototype.save=function(){return{offset:this.offset,reporter:n.prototype.save.call(this)}},c.prototype.restore=function(e){const t=new c(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,n.prototype.restore.call(this,e.reporter),t},c.prototype.isEmpty=function(){return this.offset===this.length},c.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},c.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const a=new c(this.base);return a._reporterState=this._reporterState,a.offset=this.offset,a.length=this.offset+e,this.offset+=e,a},c.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=f,f.isEncoderBuffer=function(e){if(e instanceof f)return!0;const t="object"===typeof e&&"EncoderBuffer"===e.constructor.name&&"number"===typeof e.length&&"function"===typeof e.join;return t},f.prototype.join=function(e,t){return e||(e=i.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(a){a.join(e,t),t+=a.length})):("number"===typeof this.value?e[t]=this.value:"string"===typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},51406:function(e,t,a){"use strict";const r=t;r.Reporter=a(5487).b,r.DecoderBuffer=a(42956).C,r.EncoderBuffer=a(42956).R,r.Node=a(92851)},92851:function(e,t,a){"use strict";a(21703);const r=a(5487).b,n=a(42956).R,i=a(42956).C,c=a(14961),f=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],d=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(f),o=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function s(e,t,a){const r={};this._baseState=r,r.name=a,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r["default"]=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}e.exports=s;const b=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];s.prototype.clone=function(){const e=this._baseState,t={};b.forEach((function(a){t[a]=e[a]}));const a=new this.constructor(t.parent);return a._baseState=t,a},s.prototype._wrap=function(){const e=this._baseState;d.forEach((function(t){this[t]=function(){const a=new this.constructor(this);return e.children.push(a),a[t].apply(a,arguments)}}),this)},s.prototype._init=function(e){const t=this._baseState;c(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),c.equal(t.children.length,1,"Root node can have only one child")},s.prototype._useArgs=function(e){const t=this._baseState,a=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==a.length&&(c(null===t.children),t.children=a,a.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(c(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!==typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(a){a==(0|a)&&(a|=0);const r=e[a];t[r]=a})),t})))},o.forEach((function(e){s.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),f.forEach((function(e){s.prototype[e]=function(){const t=this._baseState,a=Array.prototype.slice.call(arguments);return c(null===t.tag),t.tag=e,this._useArgs(a),this}})),s.prototype.use=function(e){c(e);const t=this._baseState;return c(null===t.use),t.use=e,this},s.prototype.optional=function(){const e=this._baseState;return e.optional=!0,this},s.prototype.def=function(e){const t=this._baseState;return c(null===t["default"]),t["default"]=e,t.optional=!0,this},s.prototype.explicit=function(e){const t=this._baseState;return c(null===t.explicit&&null===t.implicit),t.explicit=e,this},s.prototype.implicit=function(e){const t=this._baseState;return c(null===t.explicit&&null===t.implicit),t.implicit=e,this},s.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},s.prototype.key=function(e){const t=this._baseState;return c(null===t.key),t.key=e,this},s.prototype.any=function(){const e=this._baseState;return e.any=!0,this},s.prototype.choice=function(e){const t=this._baseState;return c(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},s.prototype.contains=function(e){const t=this._baseState;return c(null===t.use),t.contains=e,this},s.prototype._decode=function(e,t){const a=this._baseState;if(null===a.parent)return e.wrapResult(a.children[0]._decode(e,t));let r,n=a["default"],c=!0,f=null;if(null!==a.key&&(f=e.enterKey(a.key)),a.optional){let r=null;if(null!==a.explicit?r=a.explicit:null!==a.implicit?r=a.implicit:null!==a.tag&&(r=a.tag),null!==r||a.any){if(c=this._peekTag(e,r,a.any),e.isError(c))return c}else{const r=e.save();try{null===a.choice?this._decodeGeneric(a.tag,e,t):this._decodeChoice(e,t),c=!0}catch(d){c=!1}e.restore(r)}}if(a.obj&&c&&(r=e.enterObject()),c){if(null!==a.explicit){const t=this._decodeTag(e,a.explicit);if(e.isError(t))return t;e=t}const r=e.offset;if(null===a.use&&null===a.choice){let t;a.any&&(t=e.save());const r=this._decodeTag(e,null!==a.implicit?a.implicit:a.tag,a.any);if(e.isError(r))return r;a.any?n=e.raw(t):e=r}if(t&&t.track&&null!==a.tag&&t.track(e.path(),r,e.length,"tagged"),t&&t.track&&null!==a.tag&&t.track(e.path(),e.offset,e.length,"content"),a.any||(n=null===a.choice?this._decodeGeneric(a.tag,e,t):this._decodeChoice(e,t)),e.isError(n))return n;if(a.any||null!==a.choice||null===a.children||a.children.forEach((function(a){a._decode(e,t)})),a.contains&&("octstr"===a.tag||"bitstr"===a.tag)){const r=new i(n);n=this._getUse(a.contains,e._reporterState.obj)._decode(r,t)}}return a.obj&&c&&(n=e.leaveObject(r)),null===a.key||null===n&&!0!==c?null!==f&&e.exitKey(f):e.leaveKey(f,a.key,n),n},s.prototype._decodeGeneric=function(e,t,a){const r=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,r.args[0],a):/str$/.test(e)?this._decodeStr(t,e,a):"objid"===e&&r.args?this._decodeObjid(t,r.args[0],r.args[1],a):"objid"===e?this._decodeObjid(t,null,null,a):"gentime"===e||"utctime"===e?this._decodeTime(t,e,a):"null_"===e?this._decodeNull(t,a):"bool"===e?this._decodeBool(t,a):"objDesc"===e?this._decodeStr(t,e,a):"int"===e||"enum"===e?this._decodeInt(t,r.args&&r.args[0],a):null!==r.use?this._getUse(r.use,t._reporterState.obj)._decode(t,a):t.error("unknown tag: "+e)},s.prototype._getUse=function(e,t){const a=this._baseState;return a.useDecoder=this._use(e,t),c(null===a.useDecoder._baseState.parent),a.useDecoder=a.useDecoder._baseState.children[0],a.implicit!==a.useDecoder._baseState.implicit&&(a.useDecoder=a.useDecoder.clone(),a.useDecoder._baseState.implicit=a.implicit),a.useDecoder},s.prototype._decodeChoice=function(e,t){const a=this._baseState;let r=null,n=!1;return Object.keys(a.choice).some((function(i){const c=e.save(),f=a.choice[i];try{const a=f._decode(e,t);if(e.isError(a))return!1;r={type:i,value:a},n=!0}catch(d){return e.restore(c),!1}return!0}),this),n?r:e.error("Choice not matched")},s.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},s.prototype._encode=function(e,t,a){const r=this._baseState;if(null!==r["default"]&&r["default"]===e)return;const n=this._encodeValue(e,t,a);return void 0===n||this._skipDefault(n,t,a)?void 0:n},s.prototype._encodeValue=function(e,t,a){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new r);let i=null;if(this.reporter=t,n.optional&&void 0===e){if(null===n["default"])return;e=n["default"]}let c=null,f=!1;if(n.any)i=this._createEncoderBuffer(e);else if(n.choice)i=this._encodeChoice(e,t);else if(n.contains)c=this._getUse(n.contains,a)._encode(e,t),f=!0;else if(n.children)c=n.children.map((function(a){if("null_"===a._baseState.tag)return a._encode(null,t,e);if(null===a._baseState.key)return t.error("Child should have a key");const r=t.enterKey(a._baseState.key);if("object"!==typeof e)return t.error("Child expected, but input is not object");const n=a._encode(e[a._baseState.key],t,e);return t.leaveKey(r),n}),this).filter((function(e){return e})),c=this._createEncoderBuffer(c);else if("seqof"===n.tag||"setof"===n.tag){if(!n.args||1!==n.args.length)return t.error("Too many args for : "+n.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const a=this.clone();a._baseState.implicit=null,c=this._createEncoderBuffer(e.map((function(a){const r=this._baseState;return this._getUse(r.args[0],e)._encode(a,t)}),a))}else null!==n.use?i=this._getUse(n.use,a)._encode(e,t):(c=this._encodePrimitive(n.tag,e),f=!0);if(!n.any&&null===n.choice){const e=null!==n.implicit?n.implicit:n.tag,a=null===n.implicit?"universal":"context";null===e?null===n.use&&t.error("Tag could be omitted only for .use()"):null===n.use&&(i=this._encodeComposite(e,f,a,c))}return null!==n.explicit&&(i=this._encodeComposite(n.explicit,!1,"context",i)),i},s.prototype._encodeChoice=function(e,t){const a=this._baseState,r=a.choice[e.type];return r||c(!1,e.type+" not found in "+JSON.stringify(Object.keys(a.choice))),r._encode(e.value,t)},s.prototype._encodePrimitive=function(e,t){const a=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&a.args)return this._encodeObjid(t,a.reverseArgs[0],a.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,a.args&&a.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},s.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},s.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},5487:function(e,t,a){"use strict";a(21703);const r=a(81923);function n(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}t.b=n,n.prototype.isError=function(e){return e instanceof i},n.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},n.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},n.prototype.enterKey=function(e){return this._reporterState.path.push(e)},n.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},n.prototype.leaveKey=function(e,t,a){const r=this._reporterState;this.exitKey(e),null!==r.obj&&(r.obj[t]=a)},n.prototype.path=function(){return this._reporterState.path.join("/")},n.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},n.prototype.leaveObject=function(e){const t=this._reporterState,a=t.obj;return t.obj=e,a},n.prototype.error=function(e){let t;const a=this._reporterState,r=e instanceof i;if(t=r?e:new i(a.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!a.options.partial)throw t;return r||a.errors.push(t),t},n.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},r(i,Error),i.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},70607:function(e,t){"use strict";function a(e){const t={};return Object.keys(e).forEach((function(a){(0|a)==a&&(a|=0);const r=e[a];t[r]=a})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=a(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=a(t.tag)},84194:function(e,t,a){"use strict";const r=t;r._reverse=function(e){const t={};return Object.keys(e).forEach((function(a){(0|a)==a&&(a|=0);const r=e[a];t[r]=a})),t},r.der=a(70607)},96496:function(e,t,a){"use strict";const r=a(81923),n=a(2396),i=a(42956).C,c=a(92851),f=a(70607);function d(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new o,this.tree._init(e.body)}function o(e){c.call(this,"der",e)}function s(e,t){let a=e.readUInt8(t);if(e.isError(a))return a;const r=f.tagClass[a>>6],n=0===(32&a);if(31===(31&a)){let r=a;a=0;while(128===(128&r)){if(r=e.readUInt8(t),e.isError(r))return r;a<<=7,a|=127&r}}else a&=31;const i=f.tag[a];return{cls:r,primitive:n,tag:a,tagStr:i}}function b(e,t,a){let r=e.readUInt8(a);if(e.isError(r))return r;if(!t&&128===r)return null;if(0===(128&r))return r;const n=127&r;if(n>4)return e.error("length octect is too long");r=0;for(let i=0;i=31?r.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=c.tagClassByName[a||"universal"]<<6,n)}e.exports=f,f.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(d,i),d.prototype._encodeComposite=function(e,t,a,r){const i=s(e,t,a,this.reporter);if(r.length<128){const e=n.alloc(2);return e[0]=i,e[1]=r.length,this._createEncoderBuffer([e,r])}let c=1;for(let n=r.length;n>=256;n>>=8)c++;const f=n.alloc(2+c);f[0]=i,f[1]=128|c;for(let n=1+c,d=r.length;d>0;n--,d>>=8)f[n]=255&d;return this._createEncoderBuffer([f,r])},d.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=n.alloc(2*e.length);for(let a=0;a=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let r=0;for(let n=0;n=128;t>>=7)r++}const i=n.alloc(r);let c=i.length-1;for(let n=e.length-1;n>=0;n--){let t=e[n];i[c--]=127&t;while((t>>=7)>0)i[c--]=128|127&t}return this._createEncoderBuffer(i)},d.prototype._encodeTime=function(e,t){let a;const r=new Date(e);return"gentime"===t?a=[o(r.getUTCFullYear()),o(r.getUTCMonth()+1),o(r.getUTCDate()),o(r.getUTCHours()),o(r.getUTCMinutes()),o(r.getUTCSeconds()),"Z"].join(""):"utctime"===t?a=[o(r.getUTCFullYear()%100),o(r.getUTCMonth()+1),o(r.getUTCDate()),o(r.getUTCHours()),o(r.getUTCMinutes()),o(r.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(a,"octstr")},d.prototype._encodeNull=function(){return this._createEncoderBuffer("")},d.prototype._encodeInt=function(e,t){if("string"===typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!==typeof e&&!n.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=n.from(t)}if(n.isBuffer(e)){let t=e.length;0===e.length&&t++;const a=n.alloc(t);return e.copy(a),0===e.length&&(a[0]=0),this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let a=1;for(let n=e;n>=256;n>>=8)a++;const r=new Array(a);for(let n=r.length-1;n>=0;n--)r[n]=255&e,e>>=8;return 128&r[0]&&r.unshift(0),this._createEncoderBuffer(n.from(r))},d.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},d.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},d.prototype._skipDefault=function(e,t,a){const r=this._baseState;let n;if(null===r["default"])return!1;const i=e.join();if(void 0===r.defaultBuffer&&(r.defaultBuffer=this._encodeValue(r["default"],t,a).join()),i.length!==r.defaultBuffer.length)return!1;for(n=0;n1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},e.prototype._dispatch=function(){var e=this,t=this._queue.shift();if(t){var a=!1;this._currentReleaser=function(){a||(a=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();t["default"]=n},41704:function(e,t,a){"use strict";t.WU=void 0;var r=a(14059);Object.defineProperty(t,"WU",{enumerable:!0,get:function(){return r.default}});var n=a(66846);var i=a(419)},419:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=void 0;var r=a(62900);function n(e,t,a){var n=this;return void 0===a&&(a=new Error("timeout")),{acquire:function(){return new Promise((function(i,c){return r.__awaiter(n,void 0,void 0,(function(){var n,f,d;return r.__generator(this,(function(r){switch(r.label){case 0:return n=!1,setTimeout((function(){n=!0,c(a)}),t),[4,e.acquire()];case 1:return f=r.sent(),n?(d=Array.isArray(f)?f[1]:f,d()):i(f),[2]}}))}))}))},runExclusive:function(e){return r.__awaiter(this,void 0,void 0,(function(){var t,a;return r.__generator(this,(function(r){switch(r.label){case 0:t=function(){},r.label=1;case 1:return r.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=r.sent(),Array.isArray(a)?(t=a[1],[4,e(a[0])]):[3,4];case 3:return[2,r.sent()];case 4:return t=a,[4,e()];case 5:return[2,r.sent()];case 6:return[3,8];case 7:return t(),[7];case 8:return[2]}}))}))},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}t.withTimeout=n},24890:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s;var r=a(70150),n=o(r),i=a(17467),c=o(i),f=a(28498),d=o(f);function o(e){return e&&e.__esModule?e:{default:e}}function s(e){return(0,c.default)((function(t,a){var r;try{r=e.apply(this,t)}catch(i){return a(i)}(0,n.default)(r)&&"function"===typeof r.then?r.then((function(e){b(a,null,e)}),(function(e){b(a,e.message?e:new Error(e))})):a(null,r)}))}function b(e,t,a){try{e(t,a)}catch(r){(0,d.default)(u,r)}}function u(e){throw e}e.exports=t["default"]},91718:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s;var r=a(95906),n=o(r),i=a(22988),c=o(i),f=a(67279),d=o(f);function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t,a,r){(0,n.default)(t)(e,(0,c.default)((0,d.default)(a)),r)}e.exports=t["default"]},63068:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t,a){var r=(0,n.default)(e)?y:w;r(e,(0,g.default)(t),a)};var r=a(45372),n=v(r),i=a(32294),c=v(i),f=a(60336),d=v(f),o=a(18855),s=v(o),b=a(98869),u=v(b),h=a(4934),l=v(h),p=a(55621),x=v(p),m=a(67279),g=v(m);function v(e){return e&&e.__esModule?e:{default:e}}function y(e,t,a){a=(0,l.default)(a||u.default);var r=0,n=0,i=e.length;function f(e,t){e?a(e):++n!==i&&t!==c.default||a(null)}for(0===i&&a(null);r2&&(n=(0,d.default)(arguments,1)),r[t]=n,a(e)}))}),(function(e){a(e,r)}))}e.exports=t["default"]},28498:function(e,t,a){"use strict";var r=a(96027);a(84633),Object.defineProperty(t,"__esModule",{value:!0}),t.hasNextTick=t.hasSetImmediate=void 0,t.fallback=s,t.wrap=b;var n=a(14195),i=c(n);function c(e){return e&&e.__esModule?e:{default:e}}var f,d=t.hasSetImmediate="function"===typeof setImmediate&&setImmediate,o=t.hasNextTick="object"===typeof r&&"function"===typeof r.nextTick;function s(e){setTimeout(e,0)}function b(e){return function(t){var a=(0,i.default)(arguments,1);e((function(){t.apply(null,a)}))}}f=d?setImmediate:o?r.nextTick:s,t["default"]=b(f)},14195:function(e,t){"use strict";function a(e,t){t|=0;for(var a=Math.max(e.length-t,0),r=Array(a),n=0;n=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),a=0;a>>0,b=new Uint8Array(o);while(i!==c){for(var u=t[i],h=0,l=o-1;(0!==u||h>>0,b[l]=u%f>>>0,u=u/f>>>0;if(0!==u)throw new Error("Non-zero carry");n=h,i++}var p=o-n;while(p!==o&&0===b[p])p++;for(var x=d.repeat(a);p>>0,s=new Uint8Array(c);while(e[a]){var b=t[e.charCodeAt(a)];if(255===b)return;for(var u=0,h=c-1;(0!==b||u>>0,s[h]=b%256>>>0,b=b/256>>>0;if(0!==b)throw new Error("Non-zero carry");i=u,a++}var l=c-i;while(l!==c&&0===s[l])l++;var p=r.allocUnsafe(n+(c-l));p.fill(0,0,n);var x=n;while(l!==c)p[x++]=s[l++];return p}function h(e){var t=u(e);if(t)return t;throw new Error("Non-base"+f+" character")}return{encode:b,decodeUnsafe:u,decode:h}}e.exports=n},61271:function(e,t,a){"use strict";a(48675),a(3462),a(21703),t.byteLength=s,t.toByteArray=u,t.fromByteArray=p;for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=c.length;f0)throw new Error("Invalid string. Length must be a multiple of 4");var a=e.indexOf("=");-1===a&&(a=t);var r=a===t?0:4-a%4;return[a,r]}function s(e){var t=o(e),a=t[0],r=t[1];return 3*(a+r)/4-r}function b(e,t,a){return 3*(t+a)/4-a}function u(e){var t,a,r=o(e),c=r[0],f=r[1],d=new i(b(e,c,f)),s=0,u=f>0?c-4:c;for(a=0;a>16&255,d[s++]=t>>8&255,d[s++]=255&t;return 2===f&&(t=n[e.charCodeAt(a)]<<2|n[e.charCodeAt(a+1)]>>4,d[s++]=255&t),1===f&&(t=n[e.charCodeAt(a)]<<10|n[e.charCodeAt(a+1)]<<4|n[e.charCodeAt(a+2)]>>2,d[s++]=t>>8&255,d[s++]=255&t),d}function h(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function l(e,t,a){for(var r,n=[],i=t;id?d:f+c));return 1===n?(t=e[a-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[a-2]<<8)+e[a-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2396:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c=a(46601).Buffer}catch(S){}function f(e,t,a){for(var r=0,n=Math.min(e.length,a),i=t;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function d(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===a&&this._initArray(this.toArray(),t,a)},i.prototype._initNumber=function(e,t,a){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===a&&this._initArray(this.toArray(),t,a)},i.prototype._initArray=function(e,t,a){if(r("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=6)n=f(e,a,a+6),this.words[r]|=n<>>26-i&4194303,i+=24,i>=26&&(i-=26,r++);a+6!==t&&(n=f(e,t,a+6),this.words[r]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,o=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],b=[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];function u(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function h(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?o[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var u=s[e],h=b[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:o[u-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function p(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function x(e,t,a){var r=new m;return r.mulp(e,t,a)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?p(this,e,t):x(this,e,t),a},m.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},m.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=u(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):a.strip(),a},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},k.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},n(A,k),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},31482:function(e,t,a){var r;function n(e){this.rand=e}if(a(48675),a(3462),a(21703),e.exports=function(e){return r||(r=new n(null)),r.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),a=0;a>>24]^s[l>>>16&255]^b[p>>>8&255]^u[255&x]^t[m++],c=o[l>>>24]^s[p>>>16&255]^b[x>>>8&255]^u[255&h]^t[m++],f=o[p>>>24]^s[x>>>16&255]^b[h>>>8&255]^u[255&l]^t[m++],d=o[x>>>24]^s[h>>>16&255]^b[l>>>8&255]^u[255&p]^t[m++],h=i,l=c,p=f,x=d;return i=(r[h>>>24]<<24|r[l>>>16&255]<<16|r[p>>>8&255]<<8|r[255&x])^t[m++],c=(r[l>>>24]<<24|r[p>>>16&255]<<16|r[x>>>8&255]<<8|r[255&h])^t[m++],f=(r[p>>>24]<<24|r[x>>>16&255]<<16|r[h>>>8&255]<<8|r[255&l])^t[m++],d=(r[x>>>24]<<24|r[h>>>16&255]<<16|r[l>>>8&255]<<8|r[255&p])^t[m++],i>>>=0,c>>>=0,f>>>=0,d>>>=0,[i,c,f,d]}var f=[0,1,2,4,8,16,32,64,128,27,54],d=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var a=[],r=[],n=[[],[],[],[]],i=[[],[],[],[]],c=0,f=0,d=0;d<256;++d){var o=f^f<<1^f<<2^f<<3^f<<4;o=o>>>8^255&o^99,a[c]=o,r[o]=c;var s=e[c],b=e[s],u=e[b],h=257*e[o]^16843008*o;n[0][c]=h<<24|h>>>8,n[1][c]=h<<16|h>>>16,n[2][c]=h<<8|h>>>24,n[3][c]=h,h=16843009*u^65537*b^257*s^16843008*c,i[0][o]=h<<24|h>>>8,i[1][o]=h<<16|h>>>16,i[2][o]=h<<8|h>>>24,i[3][o]=h,0===c?c=f=1:(c=s^e[e[e[u^s]]],f^=e[e[f]])}return{SBOX:a,INV_SBOX:r,SUB_MIX:n,INV_SUB_MIX:i}}();function o(e){this._key=n(e),this._reset()}o.blockSize=16,o.keySize=32,o.prototype.blockSize=o.blockSize,o.prototype.keySize=o.keySize,o.prototype._reset=function(){for(var e=this._key,t=e.length,a=t+6,r=4*(a+1),n=[],i=0;i>>24,c=d.SBOX[c>>>24]<<24|d.SBOX[c>>>16&255]<<16|d.SBOX[c>>>8&255]<<8|d.SBOX[255&c],c^=f[i/t|0]<<24):t>6&&i%t===4&&(c=d.SBOX[c>>>24]<<24|d.SBOX[c>>>16&255]<<16|d.SBOX[c>>>8&255]<<8|d.SBOX[255&c]),n[i]=n[i-t]^c}for(var o=[],s=0;s>>24]]^d.INV_SUB_MIX[1][d.SBOX[u>>>16&255]]^d.INV_SUB_MIX[2][d.SBOX[u>>>8&255]]^d.INV_SUB_MIX[3][d.SBOX[255&u]]}this._nRounds=a,this._keySchedule=n,this._invKeySchedule=o},o.prototype.encryptBlockRaw=function(e){return e=n(e),c(e,this._keySchedule,d.SUB_MIX,d.SBOX,this._nRounds)},o.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),a=r.allocUnsafe(16);return a.writeUInt32BE(t[0],0),a.writeUInt32BE(t[1],4),a.writeUInt32BE(t[2],8),a.writeUInt32BE(t[3],12),a},o.prototype.decryptBlock=function(e){e=n(e);var t=e[1];e[1]=e[3],e[3]=t;var a=c(e,this._invKeySchedule,d.INV_SUB_MIX,d.INV_SBOX,this._nRounds),i=r.allocUnsafe(16);return i.writeUInt32BE(a[0],0),i.writeUInt32BE(a[3],4),i.writeUInt32BE(a[2],8),i.writeUInt32BE(a[1],12),i},o.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=o},89043:function(e,t,a){a(21703);var r=a(88970),n=a(6779).Buffer,i=a(11414),c=a(81923),f=a(92789),d=a(96662),o=a(40306);function s(e,t){var a=0;e.length!==t.length&&a++;for(var r=Math.min(e.length,t.length),n=0;n16)throw new Error("unable to decrypt data");var a=-1;while(++a16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},u.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=p,t.createDecipheriv=l},74213:function(e,t,a){a(21703);var r=a(65612),n=a(89043),i=a(6779).Buffer,c=a(25248),f=a(11414),d=a(88970),o=a(13692),s=a(81923);function b(e,t,a){f.call(this),this._cache=new h,this._cipher=new d.AES(t),this._prev=i.from(a),this._mode=e,this._autopadding=!0}s(b,f),b.prototype._update=function(e){var t,a;this._cache.add(e);var r=[];while(t=this._cache.get())a=this._mode.encrypt(this,t),r.push(a);return i.concat(r)};var u=i.alloc(16,16);function h(){this.cache=i.allocUnsafe(0)}function l(e,t,a){var f=r[e.toLowerCase()];if(!f)throw new TypeError("invalid suite type");if("string"===typeof t&&(t=i.from(t)),t.length!==f.key/8)throw new TypeError("invalid key length "+t.length);if("string"===typeof a&&(a=i.from(a)),"GCM"!==f.mode&&a.length!==f.iv)throw new TypeError("invalid iv length "+a.length);return"stream"===f.type?new c(f.module,t,a):"auth"===f.type?new n(f.module,t,a):new b(f.module,t,a)}function p(e,t){var a=r[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");var n=o(t,!1,a.key,a.iv);return l(e,n.key,n.iv)}b.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(u))throw this._cipher.scrub(),new Error("data not multiple of block length")},b.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=i.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){var e=16-this.cache.length,t=i.allocUnsafe(e),a=-1;while(++a>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function f(e){this.h=e,this.state=r.alloc(16,0),this.cache=r.allocUnsafe(0)}f.prototype.ghash=function(e){var t=-1;while(++t0;e--)r[e]=r[e]>>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,a&&(r[0]=r[0]^225<<24)}this.state=c(n)},f.prototype.update=function(e){var t;this.cache=r.concat([this.cache,e]);while(this.cache.length>=16)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},f.prototype.final=function(e,t){return this.cache.length&&this.ghash(r.concat([this.cache,n],16)),this.ghash(c([0,e,0,t])),this.state},e.exports=f},40306:function(e){function t(e){var t,a=e.length;while(a--){if(t=e.readUInt8(a),255!==t){t++,e.writeUInt8(t,a);break}e.writeUInt8(0,a)}}e.exports=t},66151:function(e,t,a){var r=a(96662);t.encrypt=function(e,t){var a=r(t,e._prev);return e._prev=e._cipher.encryptBlock(a),e._prev},t.decrypt=function(e,t){var a=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return r(n,a)}},36557:function(e,t,a){var r=a(6779).Buffer,n=a(96662);function i(e,t,a){var i=t.length,c=n(t,e._cache);return e._cache=e._cache.slice(i),e._prev=r.concat([e._prev,a?t:c]),c}t.encrypt=function(e,t,a){var n,c=r.allocUnsafe(0);while(t.length){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=r.allocUnsafe(0)),!(e._cache.length<=t.length)){c=r.concat([c,i(e,t,a)]);break}n=e._cache.length,c=r.concat([c,i(e,t.slice(0,n),a)]),t=t.slice(n)}return c}},12610:function(e,t,a){var r=a(6779).Buffer;function n(e,t,a){var r,n,c,f=-1,d=8,o=0;while(++f>f%8,e._prev=i(e._prev,a?n:c);return o}function i(e,t){var a=e.length,n=-1,i=r.allocUnsafe(e.length);e=r.concat([e,r.from([t])]);while(++n>7;return i}t.encrypt=function(e,t,a){var i=t.length,c=r.allocUnsafe(i),f=-1;while(++f=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function d(e,t){var a=c(t),i=t.modulus.byteLength(),f=new n(e).mul(a.blinder).umod(t.modulus),d=f.toRed(n.mont(t.prime1)),o=f.toRed(n.mont(t.prime2)),s=t.coefficient,b=t.prime1,u=t.prime2,h=d.redPow(t.exponent1).fromRed(),l=o.redPow(t.exponent2).fromRed(),p=h.isub(l).imul(s).umod(b).imul(u);return l.iadd(p).imul(a.unblinder).umod(t.modulus).toArrayLike(r,"be",i)}d.getr=f,e.exports=d},58509:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(71922).Buffer}catch(P){}function f(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},12481:function(e,t,a){e.exports=a(75207)},68130:function(e,t,a){a(21703);var r=a(29882).Buffer,n=a(65443),i=a(98141),c=a(81923),f=a(36528),d=a(72170),o=a(75207);function s(e){i.Writable.call(this);var t=o[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function b(e){i.Writable.call(this);var t=o[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){return new s(e)}function h(e){return new b(e)}Object.keys(o).forEach((function(e){o[e].id=r.from(o[e].id,"hex"),o[e.toLowerCase()]=o[e]})),c(s,i.Writable),s.prototype._write=function(e,t,a){this._hash.update(e),a()},s.prototype.update=function(e,t){return"string"===typeof e&&(e=r.from(e,t)),this._hash.update(e),this},s.prototype.sign=function(e,t){this.end();var a=this._hash.digest(),r=f(a,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},c(b,i.Writable),b.prototype._write=function(e,t,a){this._hash.update(e),a()},b.prototype.update=function(e,t){return"string"===typeof e&&(e=r.from(e,t)),this._hash.update(e),this},b.prototype.verify=function(e,t,a){"string"===typeof t&&(t=r.from(t,a)),this.end();var n=this._hash.digest();return d(t,n,e,this._signType,this._tag)},e.exports={Sign:u,Verify:h,createSign:u,createVerify:h}},36528:function(e,t,a){a(21703);var r=a(29882).Buffer,n=a(54868),i=a(28593),c=a(32127).ec,f=a(79194),d=a(2616),o=a(1308);function s(e,t,a,n,c){var f=d(t);if(f.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return b(e,f)}if("dsa"===f.type){if("dsa"!==n)throw new Error("wrong private key type");return u(e,f,a)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");e=r.concat([c,e]);var o=f.modulus.byteLength(),s=[0,1];while(e.length+s.length+10&&a.ishrn(r),a}function x(e,t){e=p(e,t),e=e.mod(t);var a=r.from(e.toArray());if(a.length=t)throw new Error("invalid sig")}e.exports=d},79194:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(2363).Buffer}catch(P){}function f(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},29882:function(e,t,a){a(21703); /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var r=a(15361),n=r.Buffer;function i(e,t){for(var a in e)t[a]=e[a]}function c(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=c),c.prototype=Object.create(n.prototype),i(n,c),c.from=function(e,t,a){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},c.alloc=function(e,t,a){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"===typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},c.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},c.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},96662:function(e,t,a){var r=a(15361)["Buffer"];e.exports=function(e,t){for(var a=Math.min(e.length,t.length),n=new r(a),i=0;i * @license MIT */a(48675),a(3462),a(21703);var r=a(61271),n=a(27055),i="function"===typeof Symbol&&"function"===typeof Symbol["for"]?Symbol["for"]("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=y,t.INSPECT_MAX_BYTES=50;var c=2147483647;function f(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(a){return!1}}function d(e){if(e>c)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,a){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return s(e,t,a)}function s(e,t,a){if("string"===typeof e)return l(e,t);if(ArrayBuffer.isView(e))return x(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return m(e,t,a);if("undefined"!==typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return m(e,t,a);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,a);var n=g(e);if(n)return n;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function b(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e,t,a){return b(e),e<=0?d(e):void 0!==t?"string"===typeof a?d(e).fill(t,a):d(e).fill(t):d(e)}function h(e){return b(e),d(e<0?0:0|v(e))}function l(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var a=0|w(e,t),r=d(a),n=r.write(e,t);return n!==a&&(r=r.slice(0,n)),r}function p(e){for(var t=e.length<0?0:0|v(e.length),a=d(t),r=0;r=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return 0|e}function y(e){return+e!=e&&(e=0),o.alloc(+e)}function w(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var a=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===a)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return J(e).length;default:if(n)return r?-1:G(e).length;t=(""+t).toLowerCase(),n=!0}}function M(e,t,a){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if(a>>>=0,t>>>=0,a<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return L(this,t,a);case"utf8":case"utf-8":return C(this,t,a);case"ascii":return N(this,t,a);case"latin1":case"binary":return U(this,t,a);case"base64":return I(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,a);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function _(e,t,a){var r=e[t];e[t]=e[a],e[a]=r}function k(e,t,a,r,n){if(0===e.length)return-1;if("string"===typeof a?(r=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,Q(a)&&(a=n?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(n)return-1;a=e.length-1}else if(a<0){if(!n)return-1;a=0}if("string"===typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:A(e,t,a,r,n);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):A(e,[t],a,r,n);throw new TypeError("val must be string, number or Buffer")}function A(e,t,a,r,n){var i,c=1,f=e.length,d=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;c=2,f/=2,d/=2,a/=2}function o(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(n){var s=-1;for(i=a;if&&(a=f-d),i=a;i>=0;i--){for(var b=!0,u=0;un&&(r=n)):r=n;var i=t.length;r>i/2&&(r=i/2);for(var c=0;c239?4:o>223?3:o>191?2:1;if(n+b<=a)switch(b){case 1:o<128&&(s=o);break;case 2:i=e[n+1],128===(192&i)&&(d=(31&o)<<6|63&i,d>127&&(s=d));break;case 3:i=e[n+1],c=e[n+2],128===(192&i)&&128===(192&c)&&(d=(15&o)<<12|(63&i)<<6|63&c,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:i=e[n+1],c=e[n+2],f=e[n+3],128===(192&i)&&128===(192&c)&&128===(192&f)&&(d=(15&o)<<18|(63&i)<<12|(63&c)<<6|63&f,d>65535&&d<1114112&&(s=d))}null===s?(s=65533,b=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),n+=b}return O(r)}t.kMaxLength=c,o.TYPED_ARRAY_SUPPORT=f(),o.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,a){return s(e,t,a)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,a){return u(e,t,a)},o.allocUnsafe=function(e){return h(e)},o.allocUnsafeSlow=function(e){return h(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(Y(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var a=e.length,r=t.length,n=0,i=Math.min(a,r);nr.length?o.from(i).copy(r,n):Uint8Array.prototype.set.call(r,i,n);else{if(!o.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n)}n+=i.length}return r},o.byteLength=w,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;ta&&(e+=" ... "),""},i&&(o.prototype[i]=o.prototype.inspect),o.prototype.compare=function(e,t,a,r,n){if(Y(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||a>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=a)return 0;if(r>=n)return-1;if(t>=a)return 1;if(t>>>=0,a>>>=0,r>>>=0,n>>>=0,this===e)return 0;for(var i=n-r,c=a-t,f=Math.min(i,c),d=this.slice(r,n),s=e.slice(t,a),b=0;b>>=0,isFinite(a)?(a>>>=0,void 0===r&&(r="utf8")):(r=a,a=void 0)}var n=this.length-t;if((void 0===a||a>n)&&(a=n),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return S(this,e,t,a);case"utf8":case"utf-8":return E(this,e,t,a);case"ascii":case"latin1":case"binary":return B(this,e,t,a);case"base64":return T(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,t,a);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function O(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);var a="",r=0;while(rr)&&(a=r);for(var n="",i=t;ia)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,a,r,n,i){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function D(e,t,a,r,n,i){if(a+r>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function H(e,t,a,r,i){return t=+t,a>>>=0,i||D(e,t,a,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,a,r,23,4),a+4}function z(e,t,a,r,i){return t=+t,a>>>=0,i||D(e,t,a,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,a,r,52,8),a+8}o.prototype.slice=function(e,t){var a=this.length;e=~~e,t=void 0===t?a:~~t,e<0?(e+=a,e<0&&(e=0)):e>a&&(e=a),t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a),t>>=0,t>>>=0,a||q(e,t,this.length);var r=this[e],n=1,i=0;while(++i>>=0,t>>>=0,a||q(e,t,this.length);var r=this[e+--t],n=1;while(t>0&&(n*=256))r+=this[e+--t]*n;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||q(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||q(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||q(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||q(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,a){e>>>=0,t>>>=0,a||q(e,t,this.length);var r=this[e],n=1,i=0;while(++i=n&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,a){e>>>=0,t>>>=0,a||q(e,t,this.length);var r=t,n=1,i=this[e+--r];while(r>0&&(n*=256))i+=this[e+--r]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return e>>>=0,t||q(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||q(e,2,this.length);var a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},o.prototype.readInt16BE=function(e,t){e>>>=0,t||q(e,2,this.length);var a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||q(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||q(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||q(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||q(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,a,r){if(e=+e,t>>>=0,a>>>=0,!r){var n=Math.pow(2,8*a)-1;F(this,e,t,a,n,0)}var i=1,c=0;this[t]=255&e;while(++c>>=0,a>>>=0,!r){var n=Math.pow(2,8*a)-1;F(this,e,t,a,n,0)}var i=a-1,c=1;this[t+i]=255&e;while(--i>=0&&(c*=256))this[t+i]=e/c&255;return t+a},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);F(this,e,t,a,n-1,-n)}var i=0,c=1,f=0;this[t]=255&e;while(++i>0)-f&255;return t+a},o.prototype.writeIntBE=function(e,t,a,r){if(e=+e,t>>>=0,!r){var n=Math.pow(2,8*a-1);F(this,e,t,a,n-1,-n)}var i=a-1,c=1,f=0;this[t+i]=255&e;while(--i>=0&&(c*=256))e<0&&0===f&&0!==this[t+i+1]&&(f=1),this[t+i]=(e/c>>0)-f&255;return t+a},o.prototype.writeInt8=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,a){return e=+e,t>>>=0,a||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,a){return H(this,e,t,!0,a)},o.prototype.writeFloatBE=function(e,t,a){return H(this,e,t,!1,a)},o.prototype.writeDoubleLE=function(e,t,a){return z(this,e,t,!0,a)},o.prototype.writeDoubleBE=function(e,t,a){return z(this,e,t,!1,a)},o.prototype.copy=function(e,t,a,r){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"===typeof e)for(i=t;i55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&i.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&i.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;i.push(a)}else if(a<2048){if((t-=2)<0)break;i.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;i.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return i}function V(e){for(var t=[],a=0;a>8,n=a%256,i.push(n),i.push(r)}return i}function J(e){return r.toByteArray(Z(e))}function X(e,t,a,r){for(var n=0;n=t.length||n>=e.length)break;t[n+a]=e[n]}return n}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!==e}var $=function(){for(var e="0123456789abcdef",t=new Array(256),a=0;a<16;++a)for(var r=16*a,n=0;n<16;++n)t[r+n]=e[a]+e[n];return t}()},15477:function(e,t,a){"use strict";var r=a(8692),n=a(81542),i=n(r("String.prototype.indexOf"));e.exports=function(e,t){var a=r(e,!!t);return"function"===typeof a&&i(e,".prototype.")>-1?n(a):a}},81542:function(e,t,a){"use strict";var r=a(49148),n=a(8692),i=n("%Function.prototype.apply%"),c=n("%Function.prototype.call%"),f=n("%Reflect.apply%",!0)||r.call(c,i),d=n("%Object.getOwnPropertyDescriptor%",!0),o=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(o)try{o({},"a",{value:1})}catch(u){o=null}e.exports=function(e){var t=f(r,c,arguments);if(d&&o){var a=d(t,"length");a.configurable&&o(t,"length",{value:1+s(0,e.length-(arguments.length-1))})}return t};var b=function(){return f(r,i,arguments)};o?o(e.exports,"apply",{value:b}):e.exports.apply=b},68754:function(e,t,a){"use strict";const r=a(83630),n={};for(const[i,c]of Object.entries(r))n[i.toUpperCase().replace(/-/g,"_")]=c;e.exports=Object.freeze(n)},68018:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361),n=a(42611),i=a(48681),c=a(63459),f=a(94718);t=e.exports,t.addPrefix=(e,t)=>{let a;if(r.isBuffer(e))a=f.varintBufferEncode(e);else{if(!c[e])throw new Error("multicodec not recognized");a=c[e]}return r.concat([a,t])},t.rmPrefix=e=>(n.decode(e),e.slice(n.decode.bytes)),t.getCodec=e=>{const t=n.decode(e),a=i.get(t);if(void 0===a)throw new Error(`Code ${t} not found`);return a},t.getName=e=>i.get(e),t.getNumber=e=>{const t=c[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return f.varintBufferDecode(t)[0]},t.getCode=e=>n.decode(e),t.getCodeVarint=e=>{const t=c[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return t},t.getVarint=e=>n.encode(e);const d=a(68754);Object.assign(t,d),t.print=a(86347)},48681:function(e,t,a){"use strict";const r=a(83630),n=new Map;for(const i in r){const e=r[i];n.set(e,i)}e.exports=Object.freeze(n)},86347:function(e,t,a){"use strict";const r=a(83630),n={};for(const[i,c]of Object.entries(r))void 0===n[c]&&(n[c]=i);e.exports=Object.freeze(n)},94718:function(e,t,a){"use strict";const r=a(42611),{Buffer:n}=a(15361);function i(e){return parseInt(e.toString("hex"),16)}function c(e){let t=e.toString(16);return t.length%2===1&&(t="0"+t),n.from(t,"hex")}function f(e){return n.from(r.encode(i(e)))}function d(e){return c(r.decode(e))}function o(e){return n.from(r.encode(e))}e.exports={numberToBuffer:c,bufferToNumber:i,varintBufferEncode:f,varintBufferDecode:d,varintEncode:o}},63459:function(e,t,a){"use strict";const r=a(83630),n=a(94718).varintEncode,i={};for(const c in r){const e=r[c];i[c]=n(e)}e.exports=Object.freeze(i)},8702:function(e,t,a){"use strict";const r=a(21272),{Buffer:n}=a(15361);var i={checkCIDComponents:function(e){if(null==e)return"null values are not valid CIDs";if(0!==e.version&&1!==e.version)return"Invalid version, must be a number equal to 1 or 0";if("string"!==typeof e.codec)return"codec must be string";if(0===e.version){if("dag-pb"!==e.codec)return"codec must be 'dag-pb' for CIDv0";if("base58btc"!==e.multibaseName)return"multibaseName must be 'base58btc' for CIDv0"}if(!n.isBuffer(e.multihash))return"multihash must be a Buffer";try{r.validate(e.multihash)}catch(t){let e=t.message;return e||(e="Multihash validation failed"),e}}};e.exports=i},4821:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361),n=a(21272),i=a(64869),c=a(68018),f=a(83630),d=a(8702),o=a(67151);class s{constructor(e,t,a,f){if(b.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=r.from(t.multihash),void(this.multibaseName=t.multibaseName||(0===t.version?"base58btc":"base32"))}if("string"===typeof e){const t=i.isEncoded(e);if(t){const a=i.decode(e);this.version=parseInt(a.slice(0,1).toString("hex"),16),this.codec=c.getCodec(a.slice(1)),this.multihash=c.rmPrefix(a.slice(1)),this.multibaseName=t}else this.version=0,this.codec="dag-pb",this.multihash=n.fromB58String(e),this.multibaseName="base58btc";return s.validateCID(this),void Object.defineProperty(this,"string",{value:e})}if(r.isBuffer(e)){const t=e.slice(0,1),a=parseInt(t.toString("hex"),16);if(1===a){const t=e;this.version=a,this.codec=c.getCodec(t.slice(1)),this.multihash=c.rmPrefix(t.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";s.validateCID(this)}else this.version=e,this.codec=t,this.multihash=a,this.multibaseName=f||(0===e?"base58btc":"base32"),s.validateCID(this)}get buffer(){let e=this._buffer;if(!e){if(0===this.version)e=this.multihash;else{if(1!==this.version)throw new Error("unsupported version");e=r.concat([r.from("01","hex"),c.getCodeVarint(this.codec),this.multihash])}Object.defineProperty(this,"_buffer",{value:e})}return e}get prefix(){return r.concat([r.from(`0${this.version}`,"hex"),c.getCodeVarint(this.codec),n.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");const{name:e,length:t}=n.decode(this.multihash);if("sha2-256"!==e)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(32!==t)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new b(0,this.codec,this.multihash)}toV1(){return new b(1,this.codec,this.multihash)}toBaseEncodedString(e=this.multibaseName){if(this.string&&e===this.multibaseName)return this.string;let t=null;if(0===this.version){if("base58btc"!==e)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");t=n.toB58String(this.multihash)}else{if(1!==this.version)throw new Error("unsupported version");t=i.encode(e,this.buffer).toString()}return e===this.multibaseName&&Object.defineProperty(this,"string",{value:t}),t}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&this.multihash.equals(e.multihash)}static validateCID(e){const t=d.checkCIDComponents(e);if(t)throw new Error(t)}}const b=o(s,{className:"CID",symbolName:"@ipld/js-cid/CID"});b.codecs=f,e.exports=b},11414:function(e,t,a){a(21703);var r=a(6779).Buffer,n=a(22263).Transform,i=a(25605).s,c=a(81923);function f(e){n.call(this),this.hashMode="string"===typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}c(f,n),f.prototype.update=function(e,t,a){"string"===typeof e&&(e=r.from(e,t));var n=this._update(e);return this.hashMode?this:(a&&(n=this._toString(n,a)),n)},f.prototype.setAutoPadding=function(){},f.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},f.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},f.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},f.prototype._transform=function(e,t,a){var r;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(n){r=n}finally{a(r)}},f.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(a){t=a}e(t)},f.prototype._finalOrDigest=function(e){var t=this.__final()||r.alloc(0);return e&&(t=this._toString(t,e,!0)),t},f.prototype._toString=function(e,t,a){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var r=this._decoder.write(e);return a&&(r+=this._decoder.end()),r},e.exports=f},67151:function(e){"use strict";function t(e,{className:t,symbolName:a}){const r=Symbol.for(a),n={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,r,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return n[`is${t}`]=e=>!(!e||!e[r]),n}function a(e,{className:t,symbolName:a,withoutNew:r}){const n=Symbol.for(a),i={[t]:function(...t){if(r&&!(this instanceof i))return new i(...t);const a=e.call(this,...t)||this;return a&&!a[n]&&Object.defineProperty(a,n,{value:!0}),a}}[t];return i.prototype=Object.create(e.prototype),i.prototype.constructor=i,Object.defineProperty(i.prototype,Symbol.toStringTag,{get(){return t}}),i[`is${t}`]=e=>!(!e||!e[n]),i}e.exports=t,e.exports.proto=a},18134:function(e,t,a){a(21703), /*! * clipboard.js v2.0.10 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ function(t,a){e.exports=a()}(0,(function(){return function(){var e={686:function(e,t,a){"use strict";a.d(t,{default:function(){return I}});var r=a(279),n=a.n(r),i=a(370),c=a.n(i),f=a(817),d=a.n(f);function o(e){try{return document.execCommand(e)}catch(t){return!1}}var s=function(e){var t=d()(e);return o("cut"),t},b=s;function u(e){var t="rtl"===document.documentElement.getAttribute("dir"),a=document.createElement("textarea");a.style.fontSize="12pt",a.style.border="0",a.style.padding="0",a.style.margin="0",a.style.position="absolute",a.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return a.style.top="".concat(r,"px"),a.setAttribute("readonly",""),a.value=e,a}var h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},a="";if("string"===typeof e){var r=u(e);t.container.appendChild(r),a=d()(r),o("copy"),r.remove()}else a=d()(e),o("copy");return a},l=h;function p(e){return p="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,a=void 0===t?"copy":t,r=e.container,n=e.target,i=e.text;if("copy"!==a&&"cut"!==a)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==n){if(!n||"object"!==p(n)||1!==n.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===a&&n.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===a&&(n.hasAttribute("readonly")||n.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?l(i,{container:r}):n?"cut"===a?b(n):l(n,{container:r}):void 0},m=x;function g(e){return g="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function y(e,t){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"===typeof e.action?e.action:this.defaultAction,this.target="function"===typeof e.target?e.target:this.defaultTarget,this.text="function"===typeof e.text?e.text:this.defaultText,this.container="object"===g(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=c()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,a=this.action(t)||"copy",r=m({action:a,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:a,text:r,trigger:t,clearSelection:function(){t&&t.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return T("action",e)}},{key:"defaultTarget",value:function(e){var t=T("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return T("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return l(e,t)}},{key:"cut",value:function(e){return b(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"===typeof e?[e]:e,a=!!document.queryCommandSupported;return t.forEach((function(e){a=a&&!!document.queryCommandSupported(e)})),a}}]),a}(n()),I=P},828:function(e){var t=9;if("undefined"!==typeof Element&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}function r(e,a){while(e&&e.nodeType!==t){if("function"===typeof e.matches&&e.matches(a))return e;e=e.parentNode}}e.exports=r},438:function(e,t,a){var r=a(828);function n(e,t,a,r,n){var i=c.apply(this,arguments);return e.addEventListener(a,i,n),{destroy:function(){e.removeEventListener(a,i,n)}}}function i(e,t,a,r,i){return"function"===typeof e.addEventListener?n.apply(null,arguments):"function"===typeof a?n.bind(null,document).apply(null,arguments):("string"===typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return n(e,t,a,r,i)})))}function c(e,t,a,n){return function(a){a.delegateTarget=r(a.target,t),a.delegateTarget&&n.call(e,a)}}e.exports=i},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var a=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===a||"[object HTMLCollection]"===a)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"===typeof e||e instanceof String},t.fn=function(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t}},370:function(e,t,a){var r=a(879),n=a(438);function i(e,t,a){if(!e&&!t&&!a)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(a))throw new TypeError("Third argument must be a Function");if(r.node(e))return c(e,t,a);if(r.nodeList(e))return f(e,t,a);if(r.string(e))return d(e,t,a);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(e,t,a){return e.addEventListener(t,a),{destroy:function(){e.removeEventListener(t,a)}}}function f(e,t,a){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,a)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,a)}))}}}function d(e,t,a){return n(document.body,e,t,a)}e.exports=i},817:function(e){function t(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var a=e.hasAttribute("readonly");a||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),a||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),n=document.createRange();n.selectNodeContents(e),r.removeAllRanges(),r.addRange(n),t=r.toString()}return t}e.exports=t},279:function(e){function t(){}t.prototype={on:function(e,t,a){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:a}),this},once:function(e,t,a){var r=this;function n(){r.off(e,n),t.apply(a,arguments)}return n._=t,this.on(e,n,a)},emit:function(e){var t=[].slice.call(arguments,1),a=((this.e||(this.e={}))[e]||[]).slice(),r=0,n=a.length;for(r;r{let t=new r(e);return 0===t.version&&(t=t.toV1()),t.toString("base32")};t.cidV0ToV1Base32=n},72624:function(e,t,a){const r=a(58429),{hexStringToBuffer:n,profiles:i}=a(11970),{cidV0ToV1Base32:c}=a(45201);e.exports={helpers:{cidV0ToV1Base32:c},decode:function(e){const t=n(e),a=r.getCodec(t),c=r.rmPrefix(t);let f=i[a];return f||(f=i["default"]),f.decode(c)},fromIpfs:function(e){return this.encode("ipfs-ns",e)},fromSwarm:function(e){return this.encode("swarm-ns",e)},encode:function(e,t){let a=i[e];a||(a=i["default"]);const n=a.encode(t);return r.addPrefix(e,n).toString("hex")},getCodec:function(e){let t=n(e);return r.getCodec(t)}}},11970:function(e,t,a){var r=a(15361)["Buffer"];const n=a(4821),i=a(21272),c=e=>{let t=e.slice(0,2),a=e.slice(2),r="";return r="0x"===t?a:e,i.fromHexString(r)},f={swarm:e=>{const t=i.encode(c(e),"keccak-256");return new n(1,"swarm-manifest",t).buffer},ipfs:e=>{const t=i.fromB58String(e);return new n(1,"dag-pb",t).buffer},utf8:e=>r.from(e,"utf8")},d={hexMultiHash:e=>{const t=new n(e);return i.decode(t.multihash).digest.toString("hex")},b58MultiHash:e=>{const t=new n(e);return i.toB58String(t.multihash)},utf8:e=>e.toString("utf8")},o={"swarm-ns":{encode:f.swarm,decode:d.hexMultiHash},"ipfs-ns":{encode:f.ipfs,decode:d.b58MultiHash},"ipns-ns":{encode:f.ipfs,decode:d.b58MultiHash},default:{encode:f.utf8,decode:d.utf8}};t.hexStringToBuffer=c,t.profiles=o},15292:function(e,t){(function(){"use strict";function e(t,a,r,n){return this instanceof e?(this.domain=t||void 0,this.path=a||"/",this.secure=!!r,this.script=!!n,this):new e(t,a,r,n)}function a(e,t,r){return e instanceof a?e:this instanceof a?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=t||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,t,r),this):new a(e,t,r)}e.All=Object.freeze(Object.create(null)),t.CookieAccessInfo=e,t.Cookie=a,a.prototype.toString=function(){var e=[this.name+"="+this.value];return this.expiration_date!==1/0&&e.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&e.push("domain="+this.domain),this.path&&e.push("path="+this.path),this.secure&&e.push("secure"),this.noscript&&e.push("httponly"),e.join("; ")},a.prototype.toValueString=function(){return this.name+"="+this.value};var r=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function n(){var e,t,r;return this instanceof n?(e=Object.create(null),this.setCookie=function(n,i,c){var f,d;if(n=new a(n,i,c),f=n.expiration_date<=Date.now(),void 0!==e[n.name]){for(t=e[n.name],d=0;d>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,e=1&e?-306674912^e>>>1:e>>>1,t[a]=e;return"undefined"!==typeof Int32Array?new Int32Array(t):t}e.version="1.2.1";var a=t();function r(e){var t=0,a=0,r=0,n="undefined"!==typeof Int32Array?new Int32Array(4096):new Array(4096);for(r=0;256!=r;++r)n[r]=e[r];for(r=0;256!=r;++r)for(a=e[r],t=256+r;t<4096;t+=256)a=n[t]=a>>>8^e[255&a];var i=[];for(r=1;16!=r;++r)i[r-1]="undefined"!==typeof Int32Array?n.subarray(256*r,256*r+256):n.slice(256*r,256*r+256);return i}var n=r(a),i=n[0],c=n[1],f=n[2],d=n[3],o=n[4],s=n[5],b=n[6],u=n[7],h=n[8],l=n[9],p=n[10],x=n[11],m=n[12],g=n[13],v=n[14];function y(e,t){for(var r=-1^t,n=0,i=e.length;n>>8^a[255&(r^e.charCodeAt(n++))];return~r}function w(e,t){for(var r=-1^t,n=e.length-15,y=0;y>8&255]^m[e[y++]^r>>16&255]^x[e[y++]^r>>>24]^p[e[y++]]^l[e[y++]]^h[e[y++]]^u[e[y++]]^b[e[y++]]^s[e[y++]]^o[e[y++]]^d[e[y++]]^f[e[y++]]^c[e[y++]]^i[e[y++]]^a[e[y++]];n+=15;while(y>>8^a[255&(r^e[y++])];return~r}function M(e,t){for(var r=-1^t,n=0,i=e.length,c=0,f=0;n>>8^a[255&(r^c)]:c<2048?(r=r>>>8^a[255&(r^(192|c>>6&31))],r=r>>>8^a[255&(r^(128|63&c))]):c>=55296&&c<57344?(c=64+(1023&c),f=1023&e.charCodeAt(n++),r=r>>>8^a[255&(r^(240|c>>8&7))],r=r>>>8^a[255&(r^(128|c>>2&63))],r=r>>>8^a[255&(r^(128|f>>6&15|(3&c)<<4))],r=r>>>8^a[255&(r^(128|63&f))]):(r=r>>>8^a[255&(r^(224|c>>12&15))],r=r>>>8^a[255&(r^(128|c>>6&63))],r=r>>>8^a[255&(r^(128|63&c))]);return~r}e.table=a,e.bstr=y,e.buf=w,e.str=M}))},49907:function(e,t,a){var r=a(15361)["Buffer"],n=a(32127),i=a(2396);e.exports=function(e){return new f(e)};var c={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function f(e){this.curveType=c[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function d(e,t,a){Array.isArray(e)||(e=e.toArray());var n=new r(e);if(a&&n.lengtha){var r="rmd160"===e?new d:o(e);t=r.update(t).digest()}else t.lengthf?t=e(t):t.length0;r--)t+=this._buffer(e,t),a+=this._flushBuffer(n,a);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t,a;return e&&(t=this.update(e)),a="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(a):a},n.prototype._pad=function(e,t){if(0===t)return!1;while(t>>1];a=i.r28shl(a,f),n=i.r28shl(n,f),i.pc2(a,n,e.keys,c)}},d.prototype._update=function(e,t,a,r){var n=this._desState,c=i.readUInt32BE(e,t),f=i.readUInt32BE(e,t+4);i.ip(c,f,n.tmp,0),c=n.tmp[0],f=n.tmp[1],"encrypt"===this.type?this._encrypt(n,c,f,n.tmp,0):this._decrypt(n,c,f,n.tmp,0),c=n.tmp[0],f=n.tmp[1],i.writeUInt32BE(a,c,r),i.writeUInt32BE(a,f,r+4)},d.prototype._pad=function(e,t){for(var a=e.length-t,r=t;r>>0,c=h}i.rip(f,c,r,n)},d.prototype._decrypt=function(e,t,a,r,n){for(var c=a,f=t,d=e.keys.length-2;d>=0;d-=2){var o=e.keys[d],s=e.keys[d+1];i.expand(c,e.tmp,0),o^=e.tmp[0],s^=e.tmp[1];var b=i.substitute(o,s),u=i.permute(b),h=c;c=(f^u)>>>0,f=h}i.rip(c,f,r,n)}},33040:function(e,t,a){"use strict";var r=a(14961),n=a(81923),i=a(76224),c=a(27853);function f(e,t){r.equal(t.length,24,"Invalid key length");var a=t.slice(0,8),n=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[c.create({type:"encrypt",key:a}),c.create({type:"decrypt",key:n}),c.create({type:"encrypt",key:i})]:[c.create({type:"decrypt",key:i}),c.create({type:"encrypt",key:n}),c.create({type:"decrypt",key:a})]}function d(e){i.call(this,e);var t=new f(this.type,this.options.key);this._edeState=t}n(d,i),e.exports=d,d.create=function(e){return new d(e)},d.prototype._update=function(e,t,a,r){var n=this._edeState;n.ciphers[0]._update(e,t,a,r),n.ciphers[1]._update(a,r,a,r),n.ciphers[2]._update(a,r,a,r)},d.prototype._pad=c.prototype._pad,d.prototype._unpad=c.prototype._unpad},99379:function(e,t){"use strict";t.readUInt32BE=function(e,t){var a=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return a>>>0},t.writeUInt32BE=function(e,t,a){e[0+a]=t>>>24,e[1+a]=t>>>16&255,e[2+a]=t>>>8&255,e[3+a]=255&t},t.ip=function(e,t,a,r){for(var n=0,i=0,c=6;c>=0;c-=2){for(var f=0;f<=24;f+=8)n<<=1,n|=t>>>f+c&1;for(f=0;f<=24;f+=8)n<<=1,n|=e>>>f+c&1}for(c=6;c>=0;c-=2){for(f=1;f<=25;f+=8)i<<=1,i|=t>>>f+c&1;for(f=1;f<=25;f+=8)i<<=1,i|=e>>>f+c&1}a[r+0]=n>>>0,a[r+1]=i>>>0},t.rip=function(e,t,a,r){for(var n=0,i=0,c=0;c<4;c++)for(var f=24;f>=0;f-=8)n<<=1,n|=t>>>f+c&1,n<<=1,n|=e>>>f+c&1;for(c=4;c<8;c++)for(f=24;f>=0;f-=8)i<<=1,i|=t>>>f+c&1,i<<=1,i|=e>>>f+c&1;a[r+0]=n>>>0,a[r+1]=i>>>0},t.pc1=function(e,t,a,r){for(var n=0,i=0,c=7;c>=5;c--){for(var f=0;f<=24;f+=8)n<<=1,n|=t>>f+c&1;for(f=0;f<=24;f+=8)n<<=1,n|=e>>f+c&1}for(f=0;f<=24;f+=8)n<<=1,n|=t>>f+c&1;for(c=1;c<=3;c++){for(f=0;f<=24;f+=8)i<<=1,i|=t>>f+c&1;for(f=0;f<=24;f+=8)i<<=1,i|=e>>f+c&1}for(f=0;f<=24;f+=8)i<<=1,i|=e>>f+c&1;a[r+0]=n>>>0,a[r+1]=i>>>0},t.r28shl=function(e,t){return e<>>28-t};var a=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,n){for(var i=0,c=0,f=a.length>>>1,d=0;d>>a[d]&1;for(d=f;d>>a[d]&1;r[n+0]=i>>>0,r[n+1]=c>>>0},t.expand=function(e,t,a){var r=0,n=0;r=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)r<<=6,r|=e>>>i&63;for(i=11;i>=3;i-=4)n|=e>>>i&63,n<<=6;n|=(31&e)<<1|e>>>31,t[a+0]=r>>>0,t[a+1]=n>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var a=0,n=0;n<4;n++){var i=e>>>18-6*n&63,c=r[64*n+i];a<<=4,a|=c}for(n=0;n<4;n++){i=t>>>18-6*n&63,c=r[256+64*n+i];a<<=4,a|=c}return a>>>0};var n=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,a=0;a>>n[a]&1;return t>>>0},t.padSplit=function(e,t,a){var r=e.toString(2);while(r.lengthe)a.ishrn(1);if(a.isEven()&&a.iadd(d),a.testn(1)||a.iadd(o),t.cmp(o)){if(!t.cmp(s))while(a.mod(b).cmp(u))a.iadd(l)}else while(a.mod(i).cmp(h))a.iadd(l);if(c=a.shrn(1),m(c)&&m(a)&&g(c)&&g(a)&&f.test(c)&&f.test(a))return a}}},98716:function(e,t,a){"use strict";a(21703);var r={single_source_shortest_paths:function(e,t,a){var n={},i={};i[t]=0;var c,f,d,o,s,b,u,h,l,p=r.PriorityQueue.make();p.push(t,0);while(!p.empty())for(d in c=p.pop(),f=c.value,o=c.cost,s=e[f]||{},s)s.hasOwnProperty(d)&&(b=s[d],u=o+b,h=i[d],l="undefined"===typeof i[d],(l||h>u)&&(i[d]=u,p.push(d,u),n[d]=f));if("undefined"!==typeof a&&"undefined"===typeof i[a]){var x=["Could not find a path from ",t," to ",a,"."].join("");throw new Error(x)}return n},extract_shortest_path_from_predecessor_list:function(e,t){var a=[],r=t;while(r)a.push(r),e[r],r=e[r];return a.reverse(),a},find_path:function(e,t,a){var n=r.single_source_shortest_paths(e,t,a);return r.extract_shortest_path_from_predecessor_list(n,a)},PriorityQueue:{make:function(e){var t,a=r.PriorityQueue,n={};for(t in e=e||{},a)a.hasOwnProperty(t)&&(n[t]=a[t]);return n.queue=[],n.sorter=e.sorter||a.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var a={value:e,cost:t};this.queue.push(a),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=r},32127:function(e,t,a){"use strict";var r=t;r.version=a(18597).i8,r.utils=a(87913),r.rand=a(31482),r.curve=a(11626),r.curves=a(69474),r.ec=a(98082),r.eddsa=a(39322)},57661:function(e,t,a){"use strict";a(21703);var r=a(21646),n=a(87913),i=n.getNAF,c=n.getJSF,f=n.assert;function d(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function o(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(e,t){f(e.precomputed);var a=e._getDoubles(),r=i(t,1,this._bitLength),n=(1<=c;s--)d=(d<<1)+r[s];o.push(d)}for(var b=this.jpoint(null,null,null),u=this.jpoint(null,null,null),h=n;h>0;h--){for(c=0;c=0;o--){for(var s=0;o>=0&&0===c[o];o--)s++;if(o>=0&&s++,d=d.dblp(s),o<0)break;var b=c[o];f(0!==b),d="affine"===e.type?b>0?d.mixedAdd(n[b-1>>1]):d.mixedAdd(n[-b-1>>1].neg()):b>0?d.add(n[b-1>>1]):d.add(n[-b-1>>1].neg())}return"affine"===e.type?d.toP():d},d.prototype._wnafMulAdd=function(e,t,a,r,n){var f,d,o,s=this._wnafT1,b=this._wnafT2,u=this._wnafT3,h=0;for(f=0;f=1;f-=2){var p=f-1,x=f;if(1===s[p]&&1===s[x]){var m=[t[p],null,null,t[x]];0===t[p].y.cmp(t[x].y)?(m[1]=t[p].add(t[x]),m[2]=t[p].toJ().mixedAdd(t[x].neg())):0===t[p].y.cmp(t[x].y.redNeg())?(m[1]=t[p].toJ().mixedAdd(t[x]),m[2]=t[p].add(t[x].neg())):(m[1]=t[p].toJ().mixedAdd(t[x]),m[2]=t[p].toJ().mixedAdd(t[x].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=c(a[p],a[x]);for(h=Math.max(v[0].length,h),u[p]=new Array(h),u[x]=new Array(h),d=0;d=0;f--){var k=0;while(f>=0){var A=!0;for(d=0;d=0&&k++,M=M.dblp(k),f<0)break;for(d=0;d0?o=b[d][S-1>>1]:S<0&&(o=b[d][-S-1>>1].neg()),M="affine"===o.type?M.mixedAdd(o):M.add(o))}}for(f=0;f=Math.ceil((e.bitLength()+1)/t.step)},o.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],r=this,n=0;n":""},o.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},o.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),a=this.z.redSqr();a=a.redIAdd(a);var r=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=r.redAdd(t),c=i.redSub(a),f=r.redSub(t),d=n.redMul(c),o=i.redMul(f),s=n.redMul(f),b=c.redMul(i);return this.curve.point(d,o,b,s)},o.prototype._projDbl=function(){var e,t,a,r,n,i,c=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){r=this.curve._mulA(f);var o=r.redAdd(d);this.zOne?(e=c.redSub(f).redSub(d).redMul(o.redSub(this.curve.two)),t=o.redMul(r.redSub(d)),a=o.redSqr().redSub(o).redSub(o)):(n=this.z.redSqr(),i=o.redSub(n).redISub(n),e=c.redSub(f).redISub(d).redMul(i),t=o.redMul(r.redSub(d)),a=o.redMul(i))}else r=f.redAdd(d),n=this.curve._mulC(this.z).redSqr(),i=r.redSub(n).redSub(n),e=this.curve._mulC(c.redISub(r)).redMul(i),t=this.curve._mulC(r).redMul(f.redISub(d)),a=r.redMul(i);return this.curve.point(e,t,a)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},o.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),a=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),r=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),i=a.redSub(t),c=n.redSub(r),f=n.redAdd(r),d=a.redAdd(t),o=i.redMul(c),s=f.redMul(d),b=i.redMul(d),u=c.redMul(f);return this.curve.point(o,s,u,b)},o.prototype._projAdd=function(e){var t,a,r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),c=this.y.redMul(e.y),f=this.curve.d.redMul(i).redMul(c),d=n.redSub(f),o=n.redAdd(f),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(c),b=r.redMul(d).redMul(s);return this.curve.twisted?(t=r.redMul(o).redMul(c.redSub(this.curve._mulA(i))),a=d.redMul(o)):(t=r.redMul(o).redMul(c.redSub(i)),a=this.curve._mulC(d).redMul(o)),this.curve.point(b,t,a)},o.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},o.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},o.prototype.mulAdd=function(e,t,a){return this.curve._wnafMulAdd(1,[this,t],[e,a],2,!1)},o.prototype.jmulAdd=function(e,t,a){return this.curve._wnafMulAdd(1,[this,t],[e,a],2,!0)},o.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},o.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},o.prototype.getY=function(){return this.normalize(),this.y.fromRed()},o.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},o.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var a=e.clone(),r=this.curve.redN.redMul(this.z);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(r),0===this.x.cmp(t))return!0}},o.prototype.toP=o.prototype.normalize,o.prototype.mixedAdd=o.prototype.add},11626:function(e,t,a){"use strict";var r=t;r.base=a(57661),r.short=a(78441),r.mont=a(96433),r.edwards=a(51727)},96433:function(e,t,a){"use strict";a(21703);var r=a(21646),n=a(81923),i=a(57661),c=a(87913);function f(e){i.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function d(e,t,a){i.BasePoint.call(this,e,"projective"),null===t&&null===a?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(f,i),e.exports=f,f.prototype.validate=function(e){var t=e.normalize().x,a=t.redSqr(),r=a.redMul(t).redAdd(a.redMul(this.a)).redAdd(t),n=r.redSqrt();return 0===n.redSqr().cmp(r)},n(d,i.BasePoint),f.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},f.prototype.point=function(e,t){return new d(this,e,t)},f.prototype.pointFromJSON=function(e){return d.fromJSON(this,e)},d.prototype.precompute=function(){},d.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},d.fromJSON=function(e,t){return new d(e,t[0],t[1]||e.one)},d.prototype.inspect=function(){return this.isInfinity()?"":""},d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},d.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),a=this.x.redSub(this.z),r=a.redSqr(),n=t.redSub(r),i=t.redMul(r),c=n.redMul(r.redAdd(this.curve.a24.redMul(n)));return this.curve.point(i,c)},d.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},d.prototype.diffAdd=function(e,t){var a=this.x.redAdd(this.z),r=this.x.redSub(this.z),n=e.x.redAdd(e.z),i=e.x.redSub(e.z),c=i.redMul(a),f=n.redMul(r),d=t.z.redMul(c.redAdd(f).redSqr()),o=t.x.redMul(c.redISub(f).redSqr());return this.curve.point(d,o)},d.prototype.mul=function(e){for(var t=e.clone(),a=this,r=this.curve.point(null,null),n=this,i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var c=i.length-1;c>=0;c--)0===i[c]?(a=a.diffAdd(r,n),r=r.dbl()):(r=a.diffAdd(r,n),a=a.dbl());return r},d.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},d.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},d.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},d.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},78441:function(e,t,a){"use strict";a(21703);var r=a(87913),n=a(21646),i=a(81923),c=a(57661),f=r.assert;function d(e){c.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function o(e,t,a,r){c.BasePoint.call(this,e,"affine"),null===t&&null===a?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(a,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function s(e,t,a,r){c.BasePoint.call(this,e,"jacobian"),null===t&&null===a&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(a,16),this.z=new n(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(d,c),e.exports=d,d.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,a,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=i[0].cmp(i[1])<0?i[0]:i[1],t=t.toRed(this.red)}if(e.lambda)a=new n(e.lambda,16);else{var c=this._getEndoRoots(this.n);0===this.g.mul(c[0]).x.cmp(this.g.x.redMul(t))?a=c[0]:(a=c[1],f(0===this.g.mul(a).x.cmp(this.g.x.redMul(t))))}return r=e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(a),{beta:t,lambda:a,basis:r}}},d.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),a=new n(2).toRed(t).redInvm(),r=a.redNeg(),i=new n(3).toRed(t).redNeg().redSqrt().redMul(a),c=r.redAdd(i).fromRed(),f=r.redSub(i).fromRed();return[c,f]},d.prototype._getEndoBasis=function(e){var t,a,r,i,c,f,d,o,s,b=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=e,h=this.n.clone(),l=new n(1),p=new n(0),x=new n(0),m=new n(1),g=0;while(0!==u.cmpn(0)){var v=h.div(u);o=h.sub(v.mul(u)),s=x.sub(v.mul(l));var y=m.sub(v.mul(p));if(!r&&o.cmp(b)<0)t=d.neg(),a=l,r=o.neg(),i=s;else if(r&&2===++g)break;d=o,h=u,u=o,x=l,l=s,m=p,p=y}c=o.neg(),f=s;var w=r.sqr().add(i.sqr()),M=c.sqr().add(f.sqr());return M.cmp(w)>=0&&(c=t,f=a),r.negative&&(r=r.neg(),i=i.neg()),c.negative&&(c=c.neg(),f=f.neg()),[{a:r,b:i},{a:c,b:f}]},d.prototype._endoSplit=function(e){var t=this.endo.basis,a=t[0],r=t[1],n=r.b.mul(e).divRound(this.n),i=a.b.neg().mul(e).divRound(this.n),c=n.mul(a.a),f=i.mul(r.a),d=n.mul(a.b),o=i.mul(r.b),s=e.sub(c).sub(f),b=d.add(o).neg();return{k1:s,k2:b}},d.prototype.pointFromX=function(e,t){e=new n(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),r=a.redSqrt();if(0!==r.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var i=r.fromRed().isOdd();return(t&&!i||!t&&i)&&(r=r.redNeg()),this.point(e,r)},d.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,a=e.y,r=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return 0===a.redSqr().redISub(n).cmpn(0)},d.prototype._endoWnafMulAdd=function(e,t,a){for(var r=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},o.prototype.isInfinity=function(){return this.inf},o.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var a=t.redSqr().redISub(this.x).redISub(e.x),r=t.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,r)},o.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,a=this.x.redSqr(),r=e.redInvm(),n=a.redAdd(a).redIAdd(a).redIAdd(t).redMul(r),i=n.redSqr().redISub(this.x.redAdd(this.x)),c=n.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,c)},o.prototype.getX=function(){return this.x.fromRed()},o.prototype.getY=function(){return this.y.fromRed()},o.prototype.mul=function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},o.prototype.mulAdd=function(e,t,a){var r=[this,t],n=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(r,n):this.curve._wnafMulAdd(1,r,n,2)},o.prototype.jmulAdd=function(e,t,a){var r=[this,t],n=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(r,n,!0):this.curve._wnafMulAdd(1,r,n,2,!0)},o.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},o.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var a=this.precomputed,r=function(e){return e.neg()};t.precomputed={naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(r)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(r)}}}return t},o.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e},i(s,c.BasePoint),d.prototype.jpoint=function(e,t,a){return new s(this,e,t,a)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),a=this.x.redMul(t),r=this.y.redMul(t).redMul(e);return this.curve.point(a,r)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),a=this.z.redSqr(),r=this.x.redMul(t),n=e.x.redMul(a),i=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(a.redMul(this.z)),f=r.redSub(n),d=i.redSub(c);if(0===f.cmpn(0))return 0!==d.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=f.redSqr(),s=o.redMul(f),b=r.redMul(o),u=d.redSqr().redIAdd(s).redISub(b).redISub(b),h=d.redMul(b.redISub(u)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(u,h,l)},s.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),a=this.x,r=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),c=a.redSub(r),f=n.redSub(i);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=c.redSqr(),o=d.redMul(c),s=a.redMul(d),b=f.redSqr().redIAdd(o).redISub(s).redISub(s),u=f.redMul(s.redISub(b)).redISub(n.redMul(o)),h=this.z.redMul(c);return this.curve.jpoint(b,u,h)},s.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var a=this;for(t=0;t=0)return!1;if(a.redIAdd(n),0===this.x.cmp(a))return!0}},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},69474:function(e,t,a){"use strict";var r,n=t,i=a(78730),c=a(11626),f=a(87913),d=f.assert;function o(e){"short"===e.type?this.curve=new c.short(e):"edwards"===e.type?this.curve=new c.edwards(e):this.curve=new c.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,d(this.g.validate(),"Invalid curve"),d(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var a=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:a}),a}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=a(36027)}catch(b){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},98082:function(e,t,a){"use strict";a(21703);var r=a(21646),n=a(72570),i=a(87913),c=a(69474),f=a(31482),d=i.assert,o=a(96964),s=a(4958);function b(e){if(!(this instanceof b))return new b(e);"string"===typeof e&&(d(Object.prototype.hasOwnProperty.call(c,e),"Unknown curve "+e),e=c[e]),e instanceof c.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=b,b.prototype.keyPair=function(e){return new o(this,e)},b.prototype.keyFromPrivate=function(e,t){return o.fromPrivate(this,e,t)},b.prototype.keyFromPublic=function(e,t){return o.fromPublic(this,e,t)},b.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||f(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),i=this.n.sub(new r(2));;){var c=new r(t.generate(a));if(!(c.cmp(i)>0))return c.iaddn(1),this.keyFromPrivate(c)}},b.prototype._truncateToN=function(e,t){var a=8*e.byteLength()-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},b.prototype.sign=function(e,t,a,i){"object"===typeof a&&(i=a,a=null),i||(i={}),t=this.keyFromPrivate(t,a),e=this._truncateToN(new r(e,16));for(var c=this.n.byteLength(),f=t.getPrivate().toArray("be",c),d=e.toArray("be",c),o=new n({hash:this.hash,entropy:f,nonce:d,pers:i.pers,persEnc:i.persEnc||"utf8"}),b=this.n.sub(new r(1)),u=0;;u++){var h=i.k?i.k(u):new r(o.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(b)>=0)){var l=this.g.mul(h);if(!l.isInfinity()){var p=l.getX(),x=p.umod(this.n);if(0!==x.cmpn(0)){var m=h.invm(this.n).mul(x.mul(t.getPrivate()).iadd(e));if(m=m.umod(this.n),0!==m.cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==p.cmp(x)?2:0);return i.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new s({r:x,s:m,recoveryParam:g})}}}}}},b.prototype.verify=function(e,t,a,n){e=this._truncateToN(new r(e,16)),a=this.keyFromPublic(a,n),t=new s(t,"hex");var i=t.r,c=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var f,d=c.invm(this.n),o=d.mul(e).umod(this.n),b=d.mul(i).umod(this.n);return this.curve._maxwellTrick?(f=this.g.jmulAdd(o,a.getPublic(),b),!f.isInfinity()&&f.eqXToP(i)):(f=this.g.mulAdd(o,a.getPublic(),b),!f.isInfinity()&&0===f.getX().umod(this.n).cmp(i))},b.prototype.recoverPubKey=function(e,t,a,n){d((3&a)===a,"The recovery param is more than two bits"),t=new s(t,n);var i=this.n,c=new r(e),f=t.r,o=t.s,b=1&a,u=a>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");f=u?this.curve.pointFromX(f.add(this.curve.n),b):this.curve.pointFromX(f,b);var h=t.r.invm(i),l=i.sub(c).mul(h).umod(i),p=o.mul(h).umod(i);return this.g.mulAdd(l,f,p)},b.prototype.getKeyRecoveryParam=function(e,t,a,r){if(t=new s(t,r),null!==t.recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var i;try{i=this.recoverPubKey(e,t,n)}catch(e){continue}if(i.eq(a))return n}throw new Error("Unable to find valid recovery factor")}},96964:function(e,t,a){"use strict";var r=a(21646),n=a(87913),i=n.assert;function c(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=c,c.fromPublic=function(e,t,a){return t instanceof c?t:new c(e,{pub:t,pubEnc:a})},c.fromPrivate=function(e,t,a){return t instanceof c?t:new c(e,{priv:t,privEnc:a})},c.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},c.prototype.getPublic=function(e,t){return"string"===typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},c.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},c.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},c.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},c.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},c.prototype.sign=function(e,t,a){return this.ec.sign(e,this,t,a)},c.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},c.prototype.inspect=function(){return""}},4958:function(e,t,a){"use strict";var r=a(21646),n=a(87913),i=n.assert;function c(e,t){if(e instanceof c)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function f(){this.place=0}function d(e,t){var a=e[t.place++];if(!(128&a))return a;var r=15&a;if(0===r||r>4)return!1;for(var n=0,i=0,c=t.place;i>>=0;return!(n<=127)&&(t.place=c,n)}function o(e){var t=0,a=e.length-1;while(!e[t]&&!(128&e[t+1])&&t>>3);e.push(128|a);while(--a)e.push(t>>>(a<<3)&255);e.push(t)}}e.exports=c,c.prototype._importDER=function(e,t){e=n.toArray(e,t);var a=new f;if(48!==e[a.place++])return!1;var i=d(e,a);if(!1===i)return!1;if(i+a.place!==e.length)return!1;if(2!==e[a.place++])return!1;var c=d(e,a);if(!1===c)return!1;var o=e.slice(a.place,c+a.place);if(a.place+=c,2!==e[a.place++])return!1;var s=d(e,a);if(!1===s)return!1;if(e.length!==s+a.place)return!1;var b=e.slice(a.place,s+a.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===b[0]){if(!(128&b[1]))return!1;b=b.slice(1)}return this.r=new r(o),this.s=new r(b),this.recoveryParam=null,!0},c.prototype.toDER=function(e){var t=this.r.toArray(),a=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&a[0]&&(a=[0].concat(a)),t=o(t),a=o(a);while(!a[0]&&!(128&a[1]))a=a.slice(1);var r=[2];s(r,t.length),r=r.concat(t),r.push(2),s(r,a.length);var i=r.concat(a),c=[48];return s(c,i.length),c=c.concat(i),n.encode(c,e)}},39322:function(e,t,a){"use strict";var r=a(78730),n=a(69474),i=a(87913),c=i.assert,f=i.parseBytes,d=a(64586),o=a(96717);function s(e){if(c("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof s))return new s(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}e.exports=s,s.prototype.sign=function(e,t){e=f(e);var a=this.keyFromSecret(t),r=this.hashInt(a.messagePrefix(),e),n=this.g.mul(r),i=this.encodePoint(n),c=this.hashInt(i,a.pubBytes(),e).mul(a.priv()),d=r.add(c).umod(this.curve.n);return this.makeSignature({R:n,S:d,Rencoded:i})},s.prototype.verify=function(e,t,a){e=f(e),t=this.makeSignature(t);var r=this.keyFromPublic(a),n=this.hashInt(t.Rencoded(),r.pubBytes(),e),i=this.g.mul(t.S()),c=t.R().add(r.pub().mul(n));return c.eq(i)},s.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(n>>1)-1?(n>>1)-d:d,i.isubn(f)):f=0,r[c]=f,i.iushrn(1)}return r}function d(e,t){var a=[[],[]];e=e.clone(),t=t.clone();var r,n=0,i=0;while(e.cmpn(-n)>0||t.cmpn(-i)>0){var c,f,d=e.andln(3)+n&3,o=t.andln(3)+i&3;3===d&&(d=-1),3===o&&(o=-1),0===(1&d)?c=0:(r=e.andln(7)+n&7,c=3!==r&&5!==r||2!==o?d:-d),a[0].push(c),0===(1&o)?f=0:(r=t.andln(7)+i&7,f=3!==r&&5!==r||2!==d?o:-o),a[1].push(f),2*n===c+1&&(n=1-n),2*i===f+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return a}function o(e,t,a){var r="_"+t;e.prototype[t]=function(){return void 0!==this[r]?this[r]:this[r]=a.call(this)}}function s(e){return"string"===typeof e?r.toArray(e,"hex"):e}function b(e){return new n(e,"hex","le")}r.assert=i,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=f,r.getJSF=d,r.cachedProperty=o,r.parseBytes=s,r.intFromLE=b},21646:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(85568).Buffer}catch(E){}function f(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],b=[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],u=[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];function h(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function l(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?s[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=b[e],h=u[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:s[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function x(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function m(e,t,a){var r=new g;return r.mulp(e,t,a)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?p(this,e,t):r<63?l(this,e,t):r<1024?x(this,e,t):m(this,e,t),a},g.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(w,y),w.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return v[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},A.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},S.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},7179:function(e,t,a){a(21703);var r=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"===typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},94890:function(e,t,a){a(50402),a(33018);const r=a(43353),n=1e3,i=(e,t)=>e+t,c=["sync","latest"];class f extends r{constructor(e={}){super(),this._blockResetDuration=e.blockResetDuration||20*n,this._blockResetTimeout,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){if(this._currentBlock)return this._currentBlock;const e=await new Promise((e=>this.once("latest",e)));return e}removeAllListeners(e){e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener()}_start(){}_end(){}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e,t){c.includes(e)&&this._maybeStart()}_onRemoveListener(e,t){this._getBlockTrackerEventCount()>0||this._maybeEnd()}_maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),this._start())}_maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),this._end())}_getBlockTrackerEventCount(){return c.map((e=>this.listenerCount(e))).reduce(i)}_newPotentialLatest(e){const t=this._currentBlock;t&&d(e)<=d(t)||this._setCurrentBlock(e)}_setCurrentBlock(e){const t=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:t,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}function d(e){return Number.parseInt(e,16)}e.exports=f},97965:function(e,t,a){a(21703);const r=a(33018),n=a(94890),i=1e3;class c extends n{constructor(e={}){if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");const t=e.pollingInterval||20*i,a=e.retryTimeout||t/10,r=void 0===e.keepEventLoopActive||e.keepEventLoopActive,n=e.setSkipCacheFlag||!1;super(Object.assign({blockResetDuration:t},e)),this._provider=e.provider,this._pollingInterval=t,this._retryTimeout=a,this._keepEventLoopActive=r,this._setSkipCacheFlag=n}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}_start(){this._performSync().catch((e=>this.emit("error",e)))}async _performSync(){while(this._isRunning)try{await this._updateLatestBlock(),await f(this._pollingInterval,!this._keepEventLoopActive)}catch(e){const a=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${e.stack}`);try{this.emit("error",a)}catch(t){console.error(a)}await f(this._retryTimeout,!this._keepEventLoopActive)}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:1,method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0);const t=await r((t=>this._provider.sendAsync(e,t)))();if(t.error)throw new Error(`PollingBlockTracker - encountered error fetching block:\n${t.error}`);return t.result}}function f(e,t){return new Promise((a=>{const r=setTimeout(a,e);r.unref&&t&&r.unref()}))}e.exports=c},20591:function(e,t,a){var r=a(15361)["Buffer"],n=a(4046).keccak_256,i=a(88612);function c(e){for(var t="",a=0;a<32;a++)t+="00";if(name=f(e),name){var i=name.split(".");for(a=i.length-1;a>=0;a--){var c=n(i[a]);t=n(new r(t+c,"hex"))}}return"0x"+t}function f(e){return e?i.toUnicode(e,{useStd3ASCII:!0,transitional:!1}):e}t.hash=c,t.normalize=f},4046:function(e,t,a){var r=a(96027);a(48675),a(3462), /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.5.7 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ function(){"use strict";var t="object"===typeof window?window:{},n=!t.JS_SHA3_NO_NODE_JS&&"object"===typeof r&&r.versions&&r.versions.node;n&&(t=a.g);for(var i=!t.JS_SHA3_NO_COMMON_JS&&e.exports,c="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],d=[1,256,65536,16777216],o=[6,1536,393216,100663296],s=[0,8,16,24],b=[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],u=[224,256,384,512],h=[128,256],l=["hex","buffer","arrayBuffer","array"],p=function(e,t,a){return function(r){return new E(e,t,e).update(r)[a]()}},x=function(e,t,a){return function(r,n){return new E(e,t,n).update(r)[a]()}},m=function(e,t){var a=p(e,t,"hex");a.create=function(){return new E(e,t,e)},a.update=function(e){return a.create().update(e)};for(var r=0;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=a>>5,this.extraBytes=(31&a)>>3;for(var r=0;r<50;++r)this.s[r]=0}E.prototype.update=function(e){var t="string"!==typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));var a,r,n=e.length,i=this.blocks,c=this.byteCount,f=this.blockCount,d=0,o=this.s;while(d>2]|=e[d]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(i[a>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=c){for(this.start=a-c,this.block=i[f],a=0;a>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[a],t=1;t>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15];f%t===0&&(B(a),i=0)}return n&&(e=a[i],n>0&&(d+=c[e>>4&15]+c[15&e]),n>1&&(d+=c[e>>12&15]+c[e>>8&15]),n>2&&(d+=c[e>>20&15]+c[e>>16&15])),d},E.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,a=this.s,r=this.outputBlocks,n=this.extraBytes,i=0,c=0,f=this.outputBits>>3;e=n?new ArrayBuffer(r+1<<2):new ArrayBuffer(f);var d=new Uint32Array(e);while(c>8&255,d[e+2]=t>>16&255,d[e+3]=t>>24&255;f%a===0&&B(r)}return i&&(e=f<<2,t=r[c],i>0&&(d[e]=255&t),i>1&&(d[e+1]=t>>8&255),i>2&&(d[e+2]=t>>16&255)),d};var B=function(e){var t,a,r,n,i,c,f,d,o,s,u,h,l,p,x,m,g,v,y,w,M,_,k,A,S,E,B,T,P,I,C,R,O,N,U,L,j,q,F,D,H,z,K,Z,G,V,W,J,X,Y,Q,$,ee,te,ae,re,ne,ie,ce,fe,de,oe,se;for(r=0;r<48;r+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],c=e[2]^e[12]^e[22]^e[32]^e[42],f=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],s=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],l=e[9]^e[19]^e[29]^e[39]^e[49],t=h^(c<<1|f>>>31),a=l^(f<<1|c>>>31),e[0]^=t,e[1]^=a,e[10]^=t,e[11]^=a,e[20]^=t,e[21]^=a,e[30]^=t,e[31]^=a,e[40]^=t,e[41]^=a,t=n^(d<<1|o>>>31),a=i^(o<<1|d>>>31),e[2]^=t,e[3]^=a,e[12]^=t,e[13]^=a,e[22]^=t,e[23]^=a,e[32]^=t,e[33]^=a,e[42]^=t,e[43]^=a,t=c^(s<<1|u>>>31),a=f^(u<<1|s>>>31),e[4]^=t,e[5]^=a,e[14]^=t,e[15]^=a,e[24]^=t,e[25]^=a,e[34]^=t,e[35]^=a,e[44]^=t,e[45]^=a,t=d^(h<<1|l>>>31),a=o^(l<<1|h>>>31),e[6]^=t,e[7]^=a,e[16]^=t,e[17]^=a,e[26]^=t,e[27]^=a,e[36]^=t,e[37]^=a,e[46]^=t,e[47]^=a,t=s^(n<<1|i>>>31),a=u^(i<<1|n>>>31),e[8]^=t,e[9]^=a,e[18]^=t,e[19]^=a,e[28]^=t,e[29]^=a,e[38]^=t,e[39]^=a,e[48]^=t,e[49]^=a,p=e[0],x=e[1],V=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,T=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,de=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,oe=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ae=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,Z=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~m&v,e[1]=x^~g&y,e[10]=A^~E&T,e[11]=S^~B&P,e[20]=N^~L&q,e[21]=U^~j&F,e[30]=Z^~V&J,e[31]=G^~W&X,e[40]=te^~re&ie,e[41]=ae^~ne&ce,e[2]=m^~v&w,e[3]=g^~y&M,e[12]=E^~T&I,e[13]=B^~P&C,e[22]=L^~q&D,e[23]=j^~F&H,e[32]=V^~J&Y,e[33]=W^~X&Q,e[42]=re^~ie&fe,e[43]=ne^~ce&de,e[4]=v^~w&_,e[5]=y^~M&k,e[14]=T^~I&R,e[15]=P^~C&O,e[24]=q^~D&z,e[25]=F^~H&K,e[34]=J^~Y&$,e[35]=X^~Q&ee,e[44]=ie^~fe&oe,e[45]=ce^~de&se,e[6]=w^~_&p,e[7]=M^~k&x,e[16]=I^~R&A,e[17]=C^~O&S,e[26]=D^~z&N,e[27]=H^~K&U,e[36]=Y^~$&Z,e[37]=Q^~ee&G,e[46]=fe^~oe&te,e[47]=de^~se&ae,e[8]=_^~p&m,e[9]=k^~x&g,e[18]=R^~A&E,e[19]=O^~S&B,e[28]=z^~N&L,e[29]=K^~U&j,e[38]=$^~Z&V,e[39]=ee^~G&W,e[48]=oe^~te&re,e[49]=se^~ae&ne,e[0]^=b[r],e[1]^=b[r+1]};if(i)e.exports=y;else for(M=0;Mthis.emit("update",e)))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}}e.exports=n},26587:function(e,t,a){const r=a(71287),n=a(58829),{incrementHexInt:i}=a(85181);class c extends r{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){const a=t,r=i(e),c=await n({provider:this.provider,fromBlock:r,toBlock:a}),f=c.map((e=>e.hash));this.addResults(f)}}e.exports=c},58829:function(e){async function t({provider:e,fromBlock:t,toBlock:i}){t||(t=i);const c=a(t),f=a(i),d=f-c+1,o=Array(d).fill().map(((e,t)=>c+t)).map(r),s=await Promise.all(o.map((t=>n(e,"eth_getBlockByNumber",[t,!1]))));return s}function a(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function r(e){if(void 0===e||null===e)return e;const t=e.toString(16);return"0x"+t}function n(e,t,a){return new Promise(((r,n)=>{e.sendAsync({id:1,jsonrpc:"2.0",method:t,params:a},((e,t)=>{if(e)return n(e);r(t.result)}))}))}e.exports=t},85181:function(e){function t(...e){const t=r(e);return t[0]}function a(...e){const t=r(e);return t[t.length-1]}function r(e){return e.sort(((e,t)=>"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:c(e)-c(t)))}function n(e){return"0x"+e.toString(16)}function i(e){return e&&!["earliest","latest","pending"].includes(e)}function c(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function f(e){if(void 0===e||null===e)return e;const t=c(e);return d(t+1)}function d(e){if(void 0===e||null===e)return e;let t=e.toString(16);const a=t.length%2;return a&&(t="0"+t),"0x"+t}function o(e){let t="0x";for(let a=0;a{if(0===n.length)return;const a=await b.acquire();try{await Promise.all(p(n).map((async a=>{try{await a.update({oldBlock:e,newBlock:t})}catch(r){console.error(r)}})))}catch(r){console.error(r)}a()};return m.newLogFilter=v,m.newBlockFilter=y,m.newPendingTransactionFilter=w,m.uninstallFilter=k,m.getFilterChanges=M,m.getFilterLogs=_,m.destroy=()=>{E()},m;async function v(e){const a=new c({provider:t,params:e});await A(a);return a}async function y(){const e=new f({provider:t});await A(e);return e}async function w(){const e=new d({provider:t});await A(e);return e}async function M(e){const t=s(e),a=n[t];if(!a)throw new Error(`No filter for index "${t}"`);const r=a.getChangesAndClear();return r}async function _(e){const t=s(e),a=n[t];if(!a)throw new Error(`No filter for index "${t}"`);return"log"===a.type?results=a.getAllResults():results=[],results}async function k(e){const t=s(e),a=n[t],r=Boolean(a);return r&&await S(t),r}async function A(t){const r=p(n).length,i=await e.getLatestBlock();await t.initialize({currentBlock:i}),a++,n[a]=t,t.id=a,t.idHex=o(a);const c=p(n).length;return B({prevFilterCount:r,newFilterCount:c}),a}async function S(e){const t=p(n).length;delete n[e];const a=p(n).length;B({prevFilterCount:t,newFilterCount:a})}async function E(){const e=p(n).length;n={},B({prevFilterCount:e,newFilterCount:0})}function B({prevFilterCount:t,newFilterCount:a}){0===t&&a>0?e.on("sync",g):t>0&&0===a&&e.removeListener("sync",g)}}function u(e){return h((async(...t)=>{const a=await e(...t),r=o(a.id);return r}))}function h(e){return n((async(t,a)=>{const r=await e.apply(null,t.params);a.result=r}))}function l({mutex:e}){return t=>async(a,r,n,i)=>{const c=await e.acquire();c(),t(a,r,n,i)}}function p(e,t){const a=[];for(let r in e)a.push(e[r]);return a}e.exports=b},19121:function(e,t,a){const r=a(50402),n=a(98490),i=a(8706),{bnToHex:c,hexToInt:f,incrementHexInt:d,minBlockRef:o,blockRefIsNumber:s}=a(85181);class b extends i{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new r(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},t),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map((e=>e.toLowerCase())))}async initialize({currentBlock:e}){let t=this.params.fromBlock;["latest","pending"].includes(t)&&(t=e),"earliest"===t&&(t="0x0"),this.params.fromBlock=t;const a=o(this.params.toBlock,e),r=Object.assign({},this.params,{toBlock:a}),n=await this._fetchLogs(r);this.addInitialResults(n)}async update({oldBlock:e,newBlock:t}){const a=t;let r;r=e?d(e):t;const n=Object.assign({},this.params,{fromBlock:r,toBlock:a}),i=await this._fetchLogs(n),c=i.filter((e=>this.matchLog(e)));this.addResults(c)}async _fetchLogs(e){const t=await n((t=>this.ethQuery.getLogs(e,t)))();return t}matchLog(e){if(f(this.params.fromBlock)>=f(e.blockNumber))return!1;if(s(this.params.toBlock)&&f(this.params.toBlock)<=f(e.blockNumber))return!1;const t=e.address&&e.address.toLowerCase();if(this.params.address&&t&&!this.params.address.includes(t))return!1;const a=this.params.topics.every(((t,a)=>{let r=e.topics[a];if(!r)return!1;r=r.toLowerCase();let n=Array.isArray(t)?t:[t];const i=n.includes(null);if(i)return!0;n=n.map((e=>e.toLowerCase()));const c=n.includes(r);return c}));return a}}e.exports=b},98490:function(e,t,a){"use strict";a(21703);const r=(e,t,a,r)=>function(...n){const i=t.promiseModule;return new i(((i,c)=>{t.multiArgs?n.push(((...e)=>{t.errorFirst?e[0]?c(e):(e.shift(),i(e)):i(e)})):t.errorFirst?n.push(((e,t)=>{e?c(e):i(t)})):n.push(i);const f=this===a?r:this;Reflect.apply(e,f,n)}))},n=new WeakMap;e.exports=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const a=typeof e;if(null===e||"object"!==a&&"function"!==a)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":a}\``);const i=(e,a)=>{let r=n.get(e);if(r||(r={},n.set(e,r)),a in r)return r[a];const i=e=>"string"===typeof e||"symbol"===typeof a?a===e:e.test(a),c=Reflect.getOwnPropertyDescriptor(e,a),f=void 0===c||c.writable||c.configurable,d=t.include?t.include.some(i):!t.exclude.some(i),o=d&&f;return r[a]=o,o},c=new WeakMap,f=new Proxy(e,{apply(e,a,n){const i=c.get(e);if(i)return Reflect.apply(i,a,n);const d=t.excludeMain?e:r(e,t,f,e);return c.set(e,d),Reflect.apply(d,a,n)},get(e,a){const n=e[a];if(!i(e,a)||n===Function.prototype[a])return n;const d=c.get(n);if(d)return d;if("function"===typeof n){const a=r(n,t,f,e);return c.set(n,a),a}return n}});return f}},67234:function(e,t,a){a(21703);const r=a(73055)["default"],n=a(62506),{createAsyncMiddleware:i}=a(2482),c=a(56615),{unsafeRandomBytes:f,incrementHexInt:d}=a(85181),o=a(58829);function s({blockTracker:e,provider:t}){const a={},s=c({blockTracker:e,provider:t});let u=!1;const h=new r,l=n({eth_subscribe:i(p),eth_unsubscribe:i(x)});return l.destroy=g,{events:h,middleware:l};async function p(r,n){if(u)throw new Error("SubscriptionManager - attempting to use after destroying");const i=r.params[0],c=f(16);let h;switch(i){case"newHeads":h=l({subId:c});break;case"logs":const e=r.params[1],t=await s.newLogFilter(e);h=p({subId:c,filter:t});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${i}"`)}return a[c]=h,void(n.result=c);function l({subId:a}){const r={type:i,destroy:async()=>{e.removeListener("sync",r.update)},update:async({oldBlock:e,newBlock:r})=>{const n=r,i=d(e),c=await o({provider:t,fromBlock:i,toBlock:n}),f=c.map(b);f.forEach((e=>{m(a,e)}))}};return e.on("sync",r.update),r}function p({subId:e,filter:t}){t.on("update",(t=>m(e,t)));const a={type:i,destroy:async()=>await s.uninstallFilter(t.idHex)};return a}}async function x(e,t){if(u)throw new Error("SubscriptionManager - attempting to use after destroying");const r=e.params[0],n=a[r];n?(delete a[r],await n.destroy(),t.result=!0):t.result=!1}function m(e,t){h.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:e,result:t}})}function g(){h.removeAllListeners();for(const e in a)a[e].destroy(),delete a[e];u=!0}}function b(e){return{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}e.exports=s},93893:function(e,t,a){const r=a(71287),n=a(58829),{incrementHexInt:i}=a(85181);class c extends r{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const t=e,a=i(e),r=await n({provider:this.provider,fromBlock:a,toBlock:t}),c=[];for(const n of r)c.push(...n.transactions);this.addResults(c)}}e.exports=c},47322:function(e,t,a){a(21703);const r=a(61014),n=a(40534),i=[void 0,null,""];function c(e={}){const{blockTracker:t}=e;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");const a=new f,i={perma:a,block:a,fork:a};return n((async(e,n,c)=>{if(e.skipCache)return c();const f=r.cacheTypeForPayload(e),d=i[f];if(!d)return c();if(!d.canCacheRequest(e))return c();let o,s=r.blockTagForPayload(e);if(s||(s="latest"),"earliest"===s)o="0x00";else if("latest"===s){const e=await t.getLatestBlock();a.clearBefore(e),o=e}else o=s;const b=await d.get(e,o);void 0===b?(await c(),await d.set(e,o,n.result)):n.result=b}))}e.exports=c;class f{constructor(){this.cache={}}getBlockCacheForPayload(e,t){const a=Number.parseInt(t,16);let r=this.cache[a];if(!r){const e={};this.cache[a]=e,r=e}return r}async get(e,t){const a=this.getBlockCacheForPayload(e,t);if(!a)return;const n=r.cacheIdentifierForPayload(e,!0),i=a[n];return i}async set(e,t,a){const n=this.canCacheResult(e,a);if(!n)return;const i=this.getBlockCacheForPayload(e,t),c=r.cacheIdentifierForPayload(e,!0);i[c]=a}canCacheRequest(e){if(!r.canCache(e))return!1;const t=r.blockTagForPayload(e);return"pending"!==t}canCacheResult(e,t){if(!i.includes(t))return!!(!["eth_getTransactionByHash","eth_getTransactionReceipt"].includes(e.method)||t&&t.blockHash&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==t.blockHash)}clearBefore(e){const t=this,a=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter((e=>edelete t.cache[e]))}}},61014:function(e,t,a){const r=a(40391);function n(e,t){const a=t?f(e):e.params;return i(e)?e.method+":"+r(a):null}function i(e){return"never"!==o(e)}function c(e){let t=d(e);return t>=e.params.length?null:e.params[t]}function f(e){const t=d(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function d(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":return 1;case"eth_getBlockByNumber":return 0;default:return}}function o(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":case"test_permaCache":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":case"test_forkCache":return"fork";case"eth_gasPrice":case"eth_blockNumber":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"test_blockCache":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":case"test_neverCache":return"never"}}e.exports={cacheIdentifierForPayload:n,canCache:i,blockTagForPayload:c,paramsWithoutBlockTag:f,blockTagParamIndex:d,cacheTypeForPayload:o}},40534:function(e){e.exports=function(e){return(t,a,r,n)=>{let i;const c=new Promise((e=>{i=e}));let f,d;const o=async()=>{d=!0,r((e=>{f=e,i()})),await c};e(t,a,o).then((async()=>{d?(await c,f(null)):n(null)})).catch((e=>{f?f(e):n(e)}))}}},38249:function(e){e.exports=function(e){return(t,a,r,n)=>{const i=e[t.method];return void 0===i?r():"function"===typeof i?i(t,a,r,n):(a.result=i,n())}}},62506:function(e,t,a){e.exports=a(38249)},53895:function(e){var t=function(e,t){for(var a=[],r=0;r>6|192);else{if(n>55295&&n<56320){if(++r==e.length)return null;var i=e.charCodeAt(r);if(i<56320||i>57343)return null;n=65536+((1023&n)<<10)+(1023&i),a+=t(n>>18|240),a+=t(n>>12&63|128)}else a+=t(n>>12|224);a+=t(n>>6&63|128)}a+=t(63&n|128)}}return a},_=function(e){var t="",a=0,n=i(e);while(a127){if(c>191&&c<224){if(a>=n)return null;c=(31&c)<<6|63&r(e,a)}else if(c>223&&c<240){if(a+1>=n)return null;c=(15&c)<<12|(63&r(e,a))<<6|63&r(e,++a)}else{if(!(c>239&&c<248))return null;if(a+2>=n)return null;c=(7&c)<<18|(63&r(e,a))<<12|(63&r(e,++a))<<6|63&r(e,++a)}++a}if(c<=65535)t+=String.fromCharCode(c);else{if(!(c<=1114111))return null;c-=65536,t+=String.fromCharCode(c>>10|55296),t+=String.fromCharCode(1023&c|56320)}}return t};e.exports={random:n,length:i,concat:m,flatten:c,slice:f,reverse:d,pad:o,padRight:s,fromAscii:y,toAscii:w,fromString:M,toString:_,fromNumber:p,toNumber:x,fromNat:g,toNat:v,fromArray:u,toArray:b,fromUint8Array:l,toUint8Array:h}},50849:function(e){var t="0123456789abcdef".split(""),a=[1,256,65536,16777216],r=[0,8,16,24],n=[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],i=function(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:function(e){return[].concat(e,e,e,e,e)}([0,0,0,0,0,0,0,0,0,0])}},c=function(e,n){var i,c=n.length,d=e.blocks,o=e.blockCount<<2,s=e.blockCount,b=e.outputBlocks,u=e.s,h=0;while(h>2]|=n[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(d[x>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=o){for(e.start=x-o,e.block=d[s],x=0;x>2]|=a[3&x],e.lastByteIndex===o)for(d[0]=d[s],x=1;x>4&15]+t[15&l]+t[l>>12&15]+t[l>>8&15]+t[l>>20&15]+t[l>>16&15]+t[l>>28&15]+t[l>>24&15];m%s===0&&(f(u),x=0)}return"0x"+p},f=function(e){var t,a,r,i,c,f,d,o,s,b,u,h,l,p,x,m,g,v,y,w,M,_,k,A,S,E,B,T,P,I,C,R,O,N,U,L,j,q,F,D,H,z,K,Z,G,V,W,J,X,Y,Q,$,ee,te,ae,re,ne,ie,ce,fe,de,oe,se;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],c=e[1]^e[11]^e[21]^e[31]^e[41],f=e[2]^e[12]^e[22]^e[32]^e[42],d=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],b=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],l=e[9]^e[19]^e[29]^e[39]^e[49],t=h^(f<<1|d>>>31),a=l^(d<<1|f>>>31),e[0]^=t,e[1]^=a,e[10]^=t,e[11]^=a,e[20]^=t,e[21]^=a,e[30]^=t,e[31]^=a,e[40]^=t,e[41]^=a,t=i^(o<<1|s>>>31),a=c^(s<<1|o>>>31),e[2]^=t,e[3]^=a,e[12]^=t,e[13]^=a,e[22]^=t,e[23]^=a,e[32]^=t,e[33]^=a,e[42]^=t,e[43]^=a,t=f^(b<<1|u>>>31),a=d^(u<<1|b>>>31),e[4]^=t,e[5]^=a,e[14]^=t,e[15]^=a,e[24]^=t,e[25]^=a,e[34]^=t,e[35]^=a,e[44]^=t,e[45]^=a,t=o^(h<<1|l>>>31),a=s^(l<<1|h>>>31),e[6]^=t,e[7]^=a,e[16]^=t,e[17]^=a,e[26]^=t,e[27]^=a,e[36]^=t,e[37]^=a,e[46]^=t,e[47]^=a,t=b^(i<<1|c>>>31),a=u^(c<<1|i>>>31),e[8]^=t,e[9]^=a,e[18]^=t,e[19]^=a,e[28]^=t,e[29]^=a,e[38]^=t,e[39]^=a,e[48]^=t,e[49]^=a,p=e[0],x=e[1],V=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,T=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,de=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,oe=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ae=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,Z=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~m&v,e[1]=x^~g&y,e[10]=A^~E&T,e[11]=S^~B&P,e[20]=N^~L&q,e[21]=U^~j&F,e[30]=Z^~V&J,e[31]=G^~W&X,e[40]=te^~re&ie,e[41]=ae^~ne&ce,e[2]=m^~v&w,e[3]=g^~y&M,e[12]=E^~T&I,e[13]=B^~P&C,e[22]=L^~q&D,e[23]=j^~F&H,e[32]=V^~J&Y,e[33]=W^~X&Q,e[42]=re^~ie&fe,e[43]=ne^~ce&de,e[4]=v^~w&_,e[5]=y^~M&k,e[14]=T^~I&R,e[15]=P^~C&O,e[24]=q^~D&z,e[25]=F^~H&K,e[34]=J^~Y&$,e[35]=X^~Q&ee,e[44]=ie^~fe&oe,e[45]=ce^~de&se,e[6]=w^~_&p,e[7]=M^~k&x,e[16]=I^~R&A,e[17]=C^~O&S,e[26]=D^~z&N,e[27]=H^~K&U,e[36]=Y^~$&Z,e[37]=Q^~ee&G,e[46]=fe^~oe&te,e[47]=de^~se&ae,e[8]=_^~p&m,e[9]=k^~x&g,e[18]=R^~A&E,e[19]=O^~S&B,e[28]=z^~N&L,e[29]=K^~U&j,e[38]=$^~Z&V,e[39]=ee^~G&W,e[48]=oe^~te&re,e[49]=se^~ae&ne,e[0]^=n[r],e[1]^=n[r+1]},d=function(e){return function(t){var a;if("0x"===t.slice(0,2)){a=[];for(var r=2,n=t.length;r=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error("invalid bloom")}function f(e,t){if(!n(e))throw new Error("Invalid bloom given");if(!b(t))throw new Error(`Invalid ethereum address given: "${t}"`);const a=r.padLeft(t,64);return i(e,a)}function d(e,t){if(!n(e))throw new Error("Invalid bloom given");if(!b(t))throw new Error(`Invalid contract address given: "${t}"`);return i(e,t)}function o(e,t){if(!n(e))throw new Error("Invalid bloom given");if(!s(t))throw new Error("Invalid topic");return i(e,t)}function s(e){return"string"===typeof e&&(!!/^(0x)?[0-9a-f]{64}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e)))}function b(e){return"string"===typeof e&&(!!e.match(/^(0x)?[0-9a-fA-F]{40}$/)||!!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=n,t.isInBloom=i,t.isUserEthereumAddressInBloom=f,t.isContractAddressInBloom=d,t.isTopicInBloom=o,t.isTopic=s,t.isAddress=b},16773:function(e,t,a){"use strict";a(21703),a(48675),a(3462),Object.defineProperty(t,"__esModule",{value:!0});const r=a(69893);function n(e){return"0x"+r.keccak_256(c(e))}function i(e){const t=[];for(let a=0;a>>4).toString(16)),t.push((15&e[a]).toString(16));return`0x${t.join("").replace(/^0+/,"")}`}function c(e){if(null==e)throw new Error("cannot convert null value to array");if("string"===typeof e){const t=e.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");e=e.substring(2),e.length%2&&(e="0"+e);const a=[];for(let r=0;r=256||parseInt(String(a))!=a)return!1}return!0}function d(e){return void 0!==e.slice||(e.slice=()=>{const t=Array.prototype.slice.call(arguments);return d(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}t.keccak256=n,t.padLeft=(e,t)=>{const a=/^0x/i.test(e)||"number"===typeof e;e=e.toString().replace(/^0x/i,"");const r=t-e.length+1>=0?t-e.length+1:0;return(a?"0x":"")+new Array(r).join("0")+e},t.bytesToHex=i,t.toByteArray=c},30952:function(e,t,a){"use strict";var r=a(15361)["Buffer"];function n(e){return function(t){var a=e();return a.update(t),r.from(a.digest())}}Object.defineProperty(t,"__esModule",{value:!0}),t.createHashFunction=n},92802:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(30952),n=a(70574);t.keccak224=r.createHashFunction((function(){return n("keccak224")})),t.keccak256=r.createHashFunction((function(){return n("keccak256")})),t.keccak384=r.createHashFunction((function(){return n("keccak384")})),t.keccak512=r.createHashFunction((function(){return n("keccak512")}))},71418:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(67602);function n(e){return new Promise((function(t,a){r(e,(function(e,r){e?a(e):t(r)}))}))}function i(e){return r(e)}t.getRandomBytes=n,t.getRandomBytesSync=i},52010:function(e,t,a){"use strict";a(21703);var r=this&&this.__awaiter||function(e,t,a,r){function n(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,i){function c(e){try{d(r.next(e))}catch(t){i(t)}}function f(e){try{d(r["throw"](e))}catch(t){i(t)}}function d(e){e.done?a(e.value):n(e.value).then(c,f)}d((r=r.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var a,r,n,i,c={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function f(e){return function(t){return d([e,t])}}function d(i){if(a)throw new TypeError("Generator is already executing.");while(c)try{if(a=1,r&&(n=2&i[0]?r["return"]:i[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(n=c.trys,!(n=n.length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]a)throw new Error("Elements exceed array size: "+a);for(u in f=[],e=e.slice(0,e.lastIndexOf("[")),"string"===typeof t&&(t=JSON.parse(t)),t)f.push(h(e,t[u]));if("dynamic"===a){var l=h("uint256",t.length);f.unshift(l)}return r.concat(f)}if("bytes"===e)return t=r.from(t),f=r.concat([h("uint256",t.length),t]),t.length%32!==0&&(f=r.concat([f,n.zeros(32-t.length%32)])),f;if(e.startsWith("bytes")){if(a=d(e),a<1||a>32)throw new Error("Invalid bytes width: "+a);return n.setLengthRight(t,32)}if(e.startsWith("uint")){if(a=d(e),a%8||a<8||a>256)throw new Error("Invalid uint width: "+a);if(c=b(t),c.bitLength()>a)throw new Error("Supplied uint exceeds width: "+a+" vs "+c.bitLength());if(c<0)throw new Error("Supplied uint is negative");return c.toArrayLike(r,"be",32)}if(e.startsWith("int")){if(a=d(e),a%8||a<8||a>256)throw new Error("Invalid int width: "+a);if(c=b(t),c.bitLength()>a)throw new Error("Supplied int exceeds width: "+a+" vs "+c.bitLength());return c.toTwos(256).toArrayLike(r,"be",32)}if(e.startsWith("ufixed")){if(a=o(e),c=b(t),c<0)throw new Error("Supplied ufixed is negative");return h("uint256",c.mul(new i(2).pow(new i(a[1]))))}if(e.startsWith("fixed"))return a=o(e),h("int256",b(t).mul(new i(2).pow(new i(a[1]))));throw new Error("Unsupported or invalid type: "+e)}function l(e,t,a){var n,c,f,d;if("string"===typeof e&&(e=p(e)),"address"===e.name)return l(e.rawType,t,a).toArrayLike(r,"be",20).toString("hex");if("bool"===e.name)return l(e.rawType,t,a).toString()===new i(1).toString();if("string"===e.name){var o=l(e.rawType,t,a);return r.from(o,"utf8").toString()}if(e.isArray){for(f=[],n=e.size,"dynamic"===e.size&&(a=l("uint256",t,a).toNumber(),n=l("uint256",t,a).toNumber(),a+=32),d=0;de.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+c.bitLength());return c}if(e.name.startsWith("int")){if(c=new i(t.slice(a,a+32),16,"be").fromTwos(256),c.bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+c.bitLength());return c}if(e.name.startsWith("ufixed")){if(n=new i(2).pow(new i(e.size[1])),c=l("uint256",t,a),!c.mod(n).isZero())throw new Error("Decimals not supported yet");return c.div(n)}if(e.name.startsWith("fixed")){if(n=new i(2).pow(new i(e.size[1])),c=l("int256",t,a),!c.mod(n).isZero())throw new Error("Decimals not supported yet");return c.div(n)}throw new Error("Unsupported or invalid type: "+e.name)}function p(e){var t,a,r;if(m(e)){t=s(e);var n=e.slice(0,e.lastIndexOf("["));return n=p(n),a={isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:n.memoryUsage*t,subArray:n},a}switch(e){case"address":r="uint160";break;case"bool":r="uint8";break;case"string":r="bytes";break}if(a={rawType:r,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?a.size=d(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(a.size=o(e)),e.startsWith("bytes")&&"bytes"!==e&&(a.size<1||a.size>32))throw new Error("Invalid bytes width: "+a.size);if((e.startsWith("uint")||e.startsWith("int"))&&(a.size%8||a.size<8||a.size>256))throw new Error("Invalid int/uint width: "+a.size);return a}function x(e){return"string"===e||"bytes"===e||"dynamic"===s(e)}function m(e){return e.lastIndexOf("]")===e.length-1}function g(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}function v(e){return e>="0"&&e<="9"}c.eventID=function(e,t){var a=e+"("+t.map(f).join(",")+")";return n.keccak256(r.from(a))},c.methodID=function(e,t){return c.eventID(e,t).slice(0,4)},c.rawEncode=function(e,t){var a=[],n=[],i=0;e.forEach((function(e){if(m(e)){var t=s(e);i+="dynamic"!==t?32*t:32}else i+=32}));for(var c=0;cu)throw new Error("Elements exceed array size: "+u)}var h=t.map((function(e){return c.solidityHexValue(o,e,256)}));return r.concat(h)}if("bytes"===e)return t;if("string"===e)return r.from(t,"utf8");if("bool"===e){a=a||8;var l=Array(a/4).join("0");return r.from(t?l+"1":l+"0","hex")}if("address"===e){var p=20;return a&&(p=a/8),n.setLengthLeft(t,p)}if(e.startsWith("bytes")){if(i=d(e),i<1||i>32)throw new Error("Invalid bytes width: "+i);return n.setLengthRight(t,i)}if(e.startsWith("uint")){if(i=d(e),i%8||i<8||i>256)throw new Error("Invalid uint width: "+i);if(f=b(t),f.bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+f.bitLength());return a=a||i,f.toArrayLike(r,"be",a/8)}if(e.startsWith("int")){if(i=d(e),i%8||i<8||i>256)throw new Error("Invalid int width: "+i);if(f=b(t),f.bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+f.bitLength());return a=a||i,f.toTwos(i).toArrayLike(r,"be",a/8)}throw new Error("Unsupported or invalid type: "+e)},c.solidityPack=function(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var a=[],n=0;n=8?n+=e[c].toUpperCase():n+=e[c];return n},t.isValidChecksumAddress=function(e,a){return t.isValidAddress(e)&&t.toChecksumAddress(e,a)===e},t.generateAddress=function(e,t){e=d.toBuffer(e);var a=new f(t);return a.isZero()?o.rlphash([e,null]).slice(-20):o.rlphash([e,r.from(a.toArray())]).slice(-20)},t.generateAddress2=function(e,t,a){var i=d.toBuffer(e),c=d.toBuffer(t),f=d.toBuffer(a);n(20===i.length),n(32===c.length);var s=o.keccak256(r.concat([r.from("ff","hex"),i,c,o.keccak256(f)]));return s.slice(-20)},t.isPrecompiled=function(e){var t=d.unpad(e);return 1===t.length&&t[0]>=1&&t[0]<=8},t.isValidPrivate=function(e){return c.privateKeyVerify(e)},t.isValidPublic=function(e,t){return void 0===t&&(t=!1),64===e.length?c.publicKeyVerify(r.concat([r.from([4]),e])):!!t&&c.publicKeyVerify(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),e=d.toBuffer(e),t&&64!==e.length&&(e=c.publicKeyConvert(e,!1).slice(1)),n(64===e.length),o.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.privateToPublic=function(e){return e=d.toBuffer(e),c.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return e=d.toBuffer(e),64!==e.length&&(e=c.publicKeyConvert(e,!1).slice(1)),e}},47833:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.baToJSON=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.stripZeros=t.unpad=t.setLengthRight=t.setLength=t.setLengthLeft=t.zeros=void 0;var n=a(43898),i=a(2396);t.zeros=function(e){return r.allocUnsafe(e).fill(0)},t.setLengthLeft=function(e,a,r){void 0===r&&(r=!1);var n=t.zeros(a);return e=t.toBuffer(e),r?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!r.isBuffer(e))if(Array.isArray(e))e=r.from(e);else if("string"===typeof e){if(!n.isHexString(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+e);e=r.from(n.padToEven(n.stripHexPrefix(e)),"hex")}else if("number"===typeof e)e=n.intToBuffer(e);else if(null===e||void 0===e)e=r.allocUnsafe(0);else if(i.isBN(e))e=e.toArrayLike(r);else{if(!e.toArray)throw new Error("invalid type");e=r.from(e.toArray())}return e},t.bufferToInt=function(e){return new i(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new i(e).fromTwos(256)},t.toUnsigned=function(e){return r.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!==typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(e){if(r.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var a=[],n=0;n=i.length,"The field "+t.name+" must not have more "+t.length+" bytes")):t.allowZero&&0===i.length||!t.length||n(t.length===i.length,"The field "+t.name+" must have byte length of "+t.length),e.raw[a]=i}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:i,set:c}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:c,get:i})})),a)if("string"===typeof a&&(a=r.from(i.stripHexPrefix(a),"hex")),r.isBuffer(a)&&(a=c.decode(a)),Array.isArray(a)){if(a.length>e._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(t,a){e[e._fields[a]]=f.toBuffer(t)}))}else{if("object"!==typeof a)throw new Error("invalid data");var d=Object.keys(a);t.forEach((function(t){-1!==d.indexOf(t.name)&&(e[t.name]=a[t.name]),-1!==d.indexOf(t.alias)&&(e[t.alias]=a[t.alias])}))}}},93161:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(48675),a(3462),a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.ecdhUnsafe=t.ecdh=t.recover=t.verify=t.sign=t.signatureImportLax=t.signatureImport=t.signatureExport=t.signatureNormalize=t.publicKeyCombine=t.publicKeyTweakMul=t.publicKeyTweakAdd=t.publicKeyVerify=t.publicKeyConvert=t.publicKeyCreate=t.privateKeyTweakMul=t.privateKeyTweakAdd=t.privateKeyModInverse=t.privateKeyNegate=t.privateKeyImport=t.privateKeyExport=t.privateKeyVerify=void 0;var n=a(52010),i=a(69080),c=a(21236);t.privateKeyVerify=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},t.privateKeyExport=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var a=i.privateKeyExport(e,t);return c.privateKeyExport(e,a,t)},t.privateKeyImport=function(e){if(e=c.privateKeyImport(e),null!==e&&32===e.length&&t.privateKeyVerify(e))return e;throw new Error("couldn't import from DER format")},t.privateKeyNegate=function(e){return r.from(n.privateKeyNegate(Uint8Array.from(e)))},t.privateKeyModInverse=function(e){if(32!==e.length)throw new Error("private key length is invalid");return r.from(i.privateKeyModInverse(Uint8Array.from(e)))},t.privateKeyTweakAdd=function(e,t){return r.from(n.privateKeyTweakAdd(Uint8Array.from(e),t))},t.privateKeyTweakMul=function(e,t){return r.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},t.publicKeyCreate=function(e,t){return r.from(n.publicKeyCreate(Uint8Array.from(e),t))},t.publicKeyConvert=function(e,t){return r.from(n.publicKeyConvert(Uint8Array.from(e),t))},t.publicKeyVerify=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},t.publicKeyTweakAdd=function(e,t,a){return r.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),a))},t.publicKeyTweakMul=function(e,t,a){return r.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),a))},t.publicKeyCombine=function(e,t){var a=[];return e.forEach((function(e){a.push(Uint8Array.from(e))})),r.from(n.publicKeyCombine(a,t))},t.signatureNormalize=function(e){return r.from(n.signatureNormalize(Uint8Array.from(e)))},t.signatureExport=function(e){return r.from(n.signatureExport(Uint8Array.from(e)))},t.signatureImport=function(e){return r.from(n.signatureImport(Uint8Array.from(e)))},t.signatureImportLax=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=c.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return i.signatureImport(t)},t.sign=function(e,t,a){if(null===a)throw new TypeError("options should be an Object");var i=void 0;if(a){if(i={},null===a.data)throw new TypeError("options.data should be a Buffer");if(a.data){if(32!=a.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(a.data)}if(null===a.noncefn)throw new TypeError("options.noncefn should be a Function");a.noncefn&&(i.noncefn=function(e,t,n,i,c){var f=null!=n?r.from(n):null,d=null!=i?r.from(i):null,o=r.from("");return a.noncefn&&(o=a.noncefn(r.from(e),r.from(t),f,d,c)),new Uint8Array(o)})}var c=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),i);return{signature:r.from(c.signature),recovery:c.recid}},t.verify=function(e,t,a){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),a)},t.recover=function(e,t,a,i){return r.from(n.ecdsaRecover(Uint8Array.from(t),a,Uint8Array.from(e),i))},t.ecdh=function(e,t){return r.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},t.ecdhUnsafe=function(e,t,a){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==t.length)throw new RangeError("private key length is invalid");return r.from(i.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),a))}},21236:function(e,t,a){"use strict";var r=a(15361)["Buffer"];Object.defineProperty(t,"__esModule",{value:!0});var n=r.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),i=r.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,a){void 0===a&&(a=!0);var c=r.from(a?n:i);return e.copy(c,a?8:9),t.copy(c,a?181:214),c},t.privateKeyImport=function(e){var t=e.length,a=0;if(t2)return null;if(t1?e[a+r-2]<<8:0);return a+=r,t32||tn))return null;if(2!==e[i++])return null;var f=e[i++];if(128&f){if(c=f-128,i+c>n)return null;for(;c>0&&0===e[i];i+=1,c-=1);for(f=0;c>0;i+=1,c-=1)f=(f<<8)+e[i]}if(f>n-i)return null;var d=i;if(i+=f,2!==e[i++])return null;var o=e[i++];if(128&o){if(c=o-128,i+c>n)return null;for(;c>0&&0===e[i];i+=1,c-=1);for(o=0;c>0;i+=1,c-=1)o=(o<<8)+e[i]}if(o>n-i)return null;var s=i;for(i+=o;f>0&&0===e[d];f-=1,d+=1);if(f>32)return null;var b=e.slice(d,d+f);for(b.copy(t,32-b.length);o>0&&0===e[s];o-=1,s+=1);if(o>32)return null;var u=e.slice(s,s+o);return u.copy(a,32-u.length),{r:t,s:a}}},69080:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0});var n=a(2396),i=a(32127).ec,c=new i("secp256k1"),f=c.curve;t.privateKeyExport=function(e,t){void 0===t&&(t=!0);var a=new n(e);if(a.ucmp(f.n)>=0)throw new Error("couldn't export to DER format");var r=c.g.mul(a);return d(r.getX(),r.getY(),t)},t.privateKeyModInverse=function(e){var t=new n(e);if(t.ucmp(f.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(f.n).toArrayLike(r,"be",32)},t.signatureImport=function(e){var t=new n(e.r);t.ucmp(f.n)>=0&&(t=new n(0));var a=new n(e.s);return a.ucmp(f.n)>=0&&(a=new n(0)),r.concat([t.toArrayLike(r,"be",32),a.toArrayLike(r,"be",32)])},t.ecdhUnsafe=function(e,t,a){void 0===a&&(a=!0);var r=c.keyFromPublic(e),i=new n(t);if(i.ucmp(f.n)>=0||i.isZero())throw new Error("scalar was invalid (zero or overflow)");var o=r.pub.mul(i);return d(o.getX(),o.getY(),a)};var d=function(e,t,a){var n;return a?(n=r.alloc(33),n[0]=t.isOdd()?3:2,e.toArrayLike(r,"be",32).copy(n,1)):(n=r.alloc(65),n[0]=4,e.toArrayLike(r,"be",32).copy(n,1),t.toArrayLike(r,"be",32).copy(n,33)),n}},29847:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=a(93161),i=a(2396),c=a(47833),f=a(12338);function d(e,t){return t?e-(2*t+35):e-27}function o(e){return 0===e||1===e}t.ecsign=function(e,t,a){var r=n.sign(e,t),i=r.recovery,c={r:r.signature.slice(0,32),s:r.signature.slice(32,64),v:a?i+(2*a+35):i+27};return c},t.ecrecover=function(e,t,a,i,f){var s=r.concat([c.setLength(a,32),c.setLength(i,32)],64),b=d(t,f);if(!o(b))throw new Error("Invalid signature v value");var u=n.recover(e,s,b);return n.publicKeyConvert(u,!1).slice(1)},t.toRpcSig=function(e,t,a,n){var i=d(e,n);if(!o(i))throw new Error("Invalid signature v value");return c.bufferToHex(r.concat([c.setLengthLeft(t,32),c.setLengthLeft(a,32),c.toBuffer(e)]))},t.fromRpcSig=function(e){var t=c.toBuffer(e);if(65!==t.length)throw new Error("Invalid signature length");var a=t[64];return a<27&&(a+=27),{v:a,r:t.slice(0,32),s:t.slice(32,64)}},t.isValidSignature=function(e,t,a,r,n){void 0===r&&(r=!0);var c=new i("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==a.length)return!1;if(!o(d(e,n)))return!1;var s=new i(t),b=new i(a);return!(s.isZero()||s.gt(f)||b.isZero()||b.gt(f))&&(!r||1!==b.cmp(c))},t.hashPersonalMessage=function(e){var t=r.from("Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return f.keccak(r.concat([t,e]))}},60253:function(e,t,a){"use strict";var r=a(15361)["Buffer"];function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}a(21703);var i=a(60345),c=a(42696),f=i.BN,d=new f("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),o=function(){function e(t){n(this,e),t=t||{};var a=[{name:"nonce",length:32,allowLess:!0,default:new r([])},{name:"gasPrice",length:32,allowLess:!0,default:new r([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new r([])},{name:"to",allowZero:!0,length:20,default:new r([])},{name:"value",length:32,allowLess:!0,default:new r([])},{name:"data",alias:"input",allowZero:!0,default:new r([])},{name:"v",allowZero:!0,default:new r([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new r([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new r([])}];i.defineProperties(this,a,t),Object.defineProperty(this,"from",{enumerable:!0,configurable:!0,get:this.getSenderAddress.bind(this)});var c=i.bufferToInt(this.v),f=Math.floor((c-35)/2);f<0&&(f=0),this._chainId=f||t.chainId||0,this._homestead=!0}return e.prototype.toCreationAddress=function(){return""===this.to.toString("hex")},e.prototype.hash=function(e){void 0===e&&(e=!0);var t=void 0;if(e)t=this.raw;else if(this._chainId>0){var a=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=a}else t=this.raw.slice(0,6);return i.rlphash(t)},e.prototype.getChainId=function(){return this._chainId},e.prototype.getSenderAddress=function(){if(this._from)return this._from;var e=this.getSenderPublicKey();return this._from=i.publicToAddress(e),this._from},e.prototype.getSenderPublicKey=function(){if((!this._senderPubKey||!this._senderPubKey.length)&&!this.verifySignature())throw new Error("Invalid Signature");return this._senderPubKey},e.prototype.verifySignature=function(){var e=this.hash(!1);if(this._homestead&&1===new f(this.s).cmp(d))return!1;try{var t=i.bufferToInt(this.v);this._chainId>0&&(t-=2*this._chainId+8),this._senderPubKey=i.ecrecover(e,t,this.r,this.s)}catch(a){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),a=i.ecsign(t,e);this._chainId>0&&(a.v+=2*this._chainId+8),Object.assign(this,a)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new f(0),a=0;a0&&t.push(["gas limit is too low. Need at least "+this.getBaseFee()]),void 0===e||!1===e?0===t.length:t.join(" ")},e}();e.exports=o},60345:function(e,t,a){"use strict";a(21703);var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=a(92802),i=n.keccak224,c=n.keccak384,f=n.keccak256,d=n.keccak512,o=a(69262),s=a(16978),b=a(98217),u=a(2396),h=a(65443),l=a(6779).Buffer;Object.assign(t,a(43898)),t.MAX_INTEGER=new u("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new u("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.SHA3_NULL_S=t.KECCAK256_NULL_S,t.KECCAK256_NULL=l.from(t.KECCAK256_NULL_S,"hex"),t.SHA3_NULL=t.KECCAK256_NULL,t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.SHA3_RLP_ARRAY_S=t.KECCAK256_RLP_ARRAY_S,t.KECCAK256_RLP_ARRAY=l.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.SHA3_RLP_ARRAY=t.KECCAK256_RLP_ARRAY,t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.SHA3_RLP_S=t.KECCAK256_RLP_S,t.KECCAK256_RLP=l.from(t.KECCAK256_RLP_S,"hex"),t.SHA3_RLP=t.KECCAK256_RLP,t.BN=u,t.rlp=b,t.secp256k1=o,t.zeros=function(e){return l.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=20,a=t.zeros(e);return t.bufferToHex(a)},t.setLengthLeft=t.setLength=function(e,a,r){var n=t.zeros(a);return e=t.toBuffer(e),r?e.length0&&"0"===a.toString())e=e.slice(1),a=e[0];return e},t.toBuffer=function(e){if(!l.isBuffer(e))if(Array.isArray(e))e=l.from(e);else if("string"===typeof e)e=t.isHexString(e)?l.from(t.padToEven(t.stripHexPrefix(e)),"hex"):l.from(e);else if("number"===typeof e)e=t.intToBuffer(e);else if(null===e||void 0===e)e=l.allocUnsafe(0);else if(u.isBN(e))e=e.toArrayLike(l);else{if(!e.toArray)throw new Error("invalid type");e=l.from(e.toArray())}return e},t.bufferToInt=function(e){return new u(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new u(e).fromTwos(256)},t.toUnsigned=function(e){return l.from(e.toTwos(256).toArray())},t.keccak=function(e,a){switch(e=t.toBuffer(e),a||(a=256),a){case 224:return i(e);case 256:return f(e);case 384:return c(e);case 512:return d(e);default:throw new Error("Invald algorithm: keccak"+a)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),h("sha256").update(e).digest()},t.ripemd160=function(e,a){e=t.toBuffer(e);var r=h("rmd160").update(e).digest();return!0===a?t.setLength(r,32):r},t.rlphash=function(e){return t.keccak(b.encode(e))},t.isValidPrivate=function(e){return o.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?o.publicKeyVerify(l.concat([l.from([4]),e])):!!t&&o.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,a){return e=t.toBuffer(e),a&&64!==e.length&&(e=o.publicKeyConvert(e,!1).slice(1)),s(64===e.length),t.keccak(e).slice(-20)};var p=t.privateToPublic=function(e){return e=t.toBuffer(e),o.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return e=t.toBuffer(e),64!==e.length&&(e=o.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var a=o.sign(e,t),r={};return r.r=a.signature.slice(0,32),r.s=a.signature.slice(32,64),r.v=a.recovery+27,r},t.hashPersonalMessage=function(e){var a=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(l.concat([a,e]))},t.ecrecover=function(e,a,r,n){var i=l.concat([t.setLength(r,32),t.setLength(n,32)],64),c=a-27;if(0!==c&&1!==c)throw new Error("Invalid signature v value");var f=o.recover(e,i,c);return o.publicKeyConvert(f,!1).slice(1)},t.toRpcSig=function(e,a,r){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(l.concat([t.setLengthLeft(a,32),t.setLengthLeft(r,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(e=t.toBuffer(e),65!==e.length)throw new Error("Invalid signature length");var a=e[64];return a<27&&(a+=27),{v:a,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(p(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){var a=t.zeroAddress();return a===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var a=t.keccak(e).toString("hex"),r="0x",n=0;n=8?r+=e[n].toUpperCase():r+=e[n];return r},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,a){return e=t.toBuffer(e),a=new u(a),a=a.isZero()?null:l.from(a.toArray()),t.rlphash([e,a]).slice(-20)},t.isPrecompiled=function(e){var a=t.unpad(e);return 1===a.length&&a[0]>=1&&a[0]<=8},t.addHexPrefix=function(e){return"string"!==typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,a,r){var n=new u("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new u("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===a.length&&((27===e||28===e)&&(t=new u(t),a=new u(a),!(t.isZero()||t.gt(i)||a.isZero()||a.gt(i))&&(!1!==r||1!==new u(a).cmp(n))))},t.baToJSON=function(e){if(l.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var a=[],r=0;r=n.length,"The field "+a.name+" must not have more "+a.length+" bytes")):a.allowZero&&0===n.length||!a.length||s(a.length===n.length,"The field "+a.name+" must have byte length of "+a.length),e.raw[r]=n}e._fields.push(a.name),Object.defineProperty(e,a.name,{enumerable:!0,configurable:!0,get:n,set:i}),a.default&&(e[a.name]=a.default),a.alias&&Object.defineProperty(e,a.alias,{enumerable:!1,configurable:!0,set:i,get:n})})),n)if("string"===typeof n&&(n=l.from(t.stripHexPrefix(n),"hex")),l.isBuffer(n)&&(n=b.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(a,r){e[e._fields[r]]=t.toBuffer(a)}))}else{if("object"!==("undefined"===typeof n?"undefined":r(n)))throw new Error("invalid data");var i=Object.keys(n);a.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},69262:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(48675),a(3462),a(21703);var n=a(52010),i=a(11126),c=a(2031),f=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},d=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var a=i.privateKeyExport(e,t);return c.privateKeyExport(e,a,t)},o=function(e){if(e=c.privateKeyImport(e),null!==e&&32===e.length&&f(e))return e;throw new Error("couldn't import from DER format")},s=function(e){return r.from(n.privateKeyNegate(Uint8Array.from(e)))},b=function(e){if(32!==e.length)throw new Error("private key length is invalid");return r.from(i.privateKeyModInverse(Uint8Array.from(e)))},u=function(e,t){return r.from(n.privateKeyTweakAdd(Uint8Array.from(e),t))},h=function(e,t){return r.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},l=function(e,t){return r.from(n.publicKeyCreate(Uint8Array.from(e),t))},p=function(e,t){return r.from(n.publicKeyConvert(Uint8Array.from(e),t))},x=function(e){return(33===e.length||65===e.length)&&n.publicKeyVerify(Uint8Array.from(e))},m=function(e,t,a){return r.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),a))},g=function(e,t,a){return r.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),a))},v=function(e,t){var a=[];return e.forEach((function(e){a.push(Uint8Array.from(e))})),r.from(n.publicKeyCombine(a,t))},y=function(e){return r.from(n.signatureNormalize(Uint8Array.from(e)))},w=function(e){return r.from(n.signatureExport(Uint8Array.from(e)))},M=function(e){return r.from(n.signatureImport(Uint8Array.from(e)))},_=function(e){if(0===e.length)throw new RangeError("signature length is invalid");var t=c.signatureImportLax(e);if(null===t)throw new Error("couldn't parse DER signature");return i.signatureImport(t)},k=function(e,t,a){if(null===a)throw new TypeError("options should be an Object");var i=void 0;if(a){if(i={},null===a.data)throw new TypeError("options.data should be a Buffer");if(a.data){if(32!==a.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(a.data)}if(null===a.noncefn)throw new TypeError("options.noncefn should be a Function");a.noncefn&&(i.noncefn=function(e,t,n,i,c){var f=null!=n?r.from(n):null,d=null!=i?r.from(i):null,o=r.from("");return a.noncefn&&(o=a.noncefn(r.from(e),r.from(t),f,d,c)),Uint8Array.from(o)})}var c=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),i);return{signature:r.from(c.signature),recovery:c.recid}},A=function(e,t,a){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),a)},S=function(e,t,a,i){return r.from(n.ecdsaRecover(Uint8Array.from(t),a,Uint8Array.from(e),i))},E=function(e,t){return r.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},B=function(e,t,a){if(33!==e.length&&65!==e.length)throw new RangeError("public key length is invalid");if(32!==t.length)throw new RangeError("private key length is invalid");return r.from(i.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),a))};e.exports={privateKeyVerify:f,privateKeyExport:d,privateKeyImport:o,privateKeyNegate:s,privateKeyModInverse:b,privateKeyTweakAdd:u,privateKeyTweakMul:h,publicKeyCreate:l,publicKeyConvert:p,publicKeyVerify:x,publicKeyTweakAdd:m,publicKeyTweakMul:g,publicKeyCombine:v,signatureNormalize:y,signatureExport:w,signatureImport:M,signatureImportLax:_,sign:k,verify:A,recover:S,ecdh:E,ecdhUnsafe:B}},2031:function(e,t,a){"use strict";var r=a(15361)["Buffer"],n=r.from([48,129,211,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,133,48,129,130,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,33,2,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,36,3,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),i=r.from([48,130,1,19,2,1,1,4,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,129,165,48,129,162,2,1,1,48,44,6,7,42,134,72,206,61,1,1,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,255,255,252,47,48,6,4,1,0,4,1,7,4,65,4,121,190,102,126,249,220,187,172,85,160,98,149,206,135,11,7,2,155,252,219,45,206,40,217,89,242,129,91,22,248,23,152,72,58,218,119,38,163,196,101,93,164,251,252,14,17,8,168,253,23,180,72,166,133,84,25,156,71,208,143,251,16,212,184,2,33,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,254,186,174,220,230,175,72,160,59,191,210,94,140,208,54,65,65,2,1,1,161,68,3,66,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);t.privateKeyExport=function(e,t,a){var c=r.from(a?n:i);return e.copy(c,a?8:9),t.copy(c,a?181:214),c},t.privateKeyImport=function(e){var t=e.length,a=0;if(t2)return null;if(t1?e[a+r-2]<<8:0);return a+=r,t32||tn))return null;if(2!==e[i++])return null;var f=e[i++];if(128&f){if(c=f-128,i+c>n)return null;for(;c>0&&0===e[i];i+=1,c-=1);for(f=0;c>0;i+=1,c-=1)f=(f<<8)+e[i]}if(f>n-i)return null;var d=i;if(i+=f,2!==e[i++])return null;var o=e[i++];if(128&o){if(c=o-128,i+c>n)return null;for(;c>0&&0===e[i];i+=1,c-=1);for(o=0;c>0;i+=1,c-=1)o=(o<<8)+e[i]}if(o>n-i)return null;var s=i;for(i+=o;f>0&&0===e[d];f-=1,d+=1);if(f>32)return null;var b=e.slice(d,d+f);for(b.copy(t,32-b.length);o>0&&0===e[s];o-=1,s+=1);if(o>32)return null;var u=e.slice(s,s+o);return u.copy(a,32-u.length),{r:t,s:a}}},11126:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=a(2396),i=a(32127).ec,c=new i("secp256k1"),f=c.curve;t.privateKeyExport=function(e,t){var a=new n(e);if(a.ucmp(f.n)>=0)throw new Error("couldn't export to DER format");var r=c.g.mul(a);return d(r.getX(),r.getY(),t)},t.privateKeyModInverse=function(e){var t=new n(e);if(t.ucmp(f.n)>=0||t.isZero())throw new Error("private key range is invalid");return t.invm(f.n).toArrayLike(r,"be",32)},t.signatureImport=function(e){var t=new n(e.r);t.ucmp(f.n)>=0&&(t=new n(0));var a=new n(e.s);return a.ucmp(f.n)>=0&&(a=new n(0)),r.concat([t.toArrayLike(r,"be",32),a.toArrayLike(r,"be",32)])},t.ecdhUnsafe=function(e,t,a){var r=c.keyFromPublic(e),i=new n(t);if(i.ucmp(f.n)>=0||i.isZero())throw new Error("scalar was invalid (zero or overflow)");var o=r.pub.mul(i);return d(o.getX(),o.getY(),a)};var d=function(e,t,a){var n=void 0;return a?(n=r.alloc(33),n[0]=t.isOdd()?3:2,e.toArrayLike(r,"be",32).copy(n,1)):(n=r.alloc(65),n[0]=4,e.toArrayLike(r,"be",32).copy(n,1),t.toArrayLike(r,"be",32).copy(n,33)),n}},59426:function(e,t,a){"use strict";a(21703);var r=a(9642),n=a(70594),i=new r(0),c=new r(-1),f={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function d(e){var t=e?e.toLowerCase():"ether",a=f[t];if("string"!==typeof a)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(f,null,2));return new r(a,10)}function o(e){if("string"===typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"===typeof e)return String(e);if("object"===typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}function s(e,t,a){var r=n(e),o=r.lt(i),s=d(t),b=f[t].length-1||1,u=a||{};o&&(r=r.mul(c));var h=r.mod(s).toString(10);while(h.length2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var u=b[0],h=b[1];if(u||(u="0"),h||(h="0"),h.length>i)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");while(h.length=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function d(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===a&&this._initArray(this.toArray(),t,a)},i.prototype._initNumber=function(e,t,a){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===a&&this._initArray(this.toArray(),t,a)},i.prototype._initArray=function(e,t,a){if(r("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=6)n=f(e,a,a+6),this.words[r]|=n<>>26-i&4194303,i+=24,i>=26&&(i-=26,r++);a+6!==t&&(n=f(e,t,a+6),this.words[r]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,o=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],b=[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];function u(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function h(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?o[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var u=s[e],h=b[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:o[u-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function p(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function x(e,t,a){var r=new m;return r.mulp(e,t,a)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?p(this,e,t):x(this,e,t),a},m.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},m.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=u(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):a.strip(),a},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},k.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},n(A,k),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},43898:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=a(44866),i=a(99468);function c(e){var t=e;if("string"!==typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+typeof t+", while padToEven.");return t.length%2&&(t="0"+t),t}function f(e){var t=e.toString(16);return"0x"+t}function d(e){var t=f(e);return new r(c(t.slice(2)),"hex")}function o(e){if("string"!==typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+typeof e+"'.");return r.byteLength(e,"utf8")}function s(e,t,a){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+typeof e+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+typeof t+"'");return t[Boolean(a)?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function b(e){var t=new r(c(i(e).replace(/^0+|0+$/g,"")),"hex");return t.toString("utf8")}function u(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a0&&f.length>n&&!f.warned){f.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=f.length,c(d)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,a){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:a},n=h.bind(r);return n.listener=a,r.wrapFn=n,n}function p(e,t,a){var r=e._events;if(void 0===r)return[];var n=r[t];return void 0===n?[]:"function"===typeof n?a?[n.listener||n]:[n]:a?v(n):m(n,n.length)}function x(e){var t=this._events;if(void 0!==t){var a=t[e];if("function"===typeof a)return 1;if(void 0!==a)return a.length}return 0}function m(e,t){for(var a=new Array(t),r=0;r0&&(c=t[0]),c instanceof Error)throw c;var f=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw f.context=c,f}var d=n[e];if(void 0===d)return!1;if("function"===typeof d)i(d,this,t);else{var o=d.length,s=m(d,o);for(a=0;a=0;i--)if(a[i]===t||a[i].listener===t){c=a[i].listener,n=i;break}if(n<0)return this;0===n?a.shift():g(a,n),1===a.length&&(r[e]=a[0]),void 0!==r.removeListener&&this.emit("removeListener",e,c||t)}return this},d.prototype.off=d.prototype.removeListener,d.prototype.removeAllListeners=function(e){var t,a,r;if(a=this._events,void 0===a)return this;if(void 0===a.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==a[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete a[e]),this;if(0===arguments.length){var n,i=Object.keys(a);for(r=0;r=0;r--)this.removeListener(e,t[r]);return this},d.prototype.listeners=function(e){return p(this,e,!0)},d.prototype.rawListeners=function(e){return p(this,e,!1)},d.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):x.call(e,t)},d.prototype.listenerCount=x,d.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},13692:function(e,t,a){a(21703);var r=a(6779).Buffer,n=a(74993);function i(e,t,a,i){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");var c=a/8,f=r.alloc(c),d=r.alloc(i||0),o=r.alloc(0);while(c>0||i>0){var s=new n;s.update(o),s.update(e),t&&s.update(t),o=s.digest();var b=0;if(c>0){var u=f.length-c;b=Math.min(c,o.length),o.copy(f,u,0,b),c-=b}if(b0){var h=d.length-i,l=Math.min(i,o.length-b);o.copy(d,h,b,b+l),i-=l}}return o.fill(0),{key:f,iv:d}}e.exports=i},25383:function(e){e.exports=c,c.default=c,c.stable=s,c.stableStringify=s;var t="[...]",a="[Circular]",r=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function c(e,t,a,c){var f;"undefined"===typeof c&&(c=i()),d(e,"",0,[],void 0,0,c);try{f=0===n.length?JSON.stringify(e,t,a):JSON.stringify(e,u(t),a)}catch(s){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(0!==r.length){var o=r.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return f}function f(e,t,a,i){var c=Object.getOwnPropertyDescriptor(i,a);void 0!==c.get?c.configurable?(Object.defineProperty(i,a,{value:e}),r.push([i,a,t,c])):n.push([t,a,e]):(i[a]=e,r.push([i,a,t]))}function d(e,r,n,i,c,o,s){var b;if(o+=1,"object"===typeof e&&null!==e){for(b=0;bs.depthLimit)return void f(t,e,r,c);if("undefined"!==typeof s.edgesLimit&&n+1>s.edgesLimit)return void f(t,e,r,c);if(i.push(e),Array.isArray(e))for(b=0;bt?1:0}function s(e,t,a,c){"undefined"===typeof c&&(c=i());var f,d=b(e,"",0,[],void 0,0,c)||e;try{f=0===n.length?JSON.stringify(d,t,a):JSON.stringify(d,u(t),a)}catch(s){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(0!==r.length){var o=r.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return f}function b(e,n,i,c,d,s,u){var h;if(s+=1,"object"===typeof e&&null!==e){for(h=0;hu.depthLimit)return void f(t,e,n,d);if("undefined"!==typeof u.edgesLimit&&i+1>u.edgesLimit)return void f(t,e,n,d);if(c.push(e),Array.isArray(e))for(h=0;h0)for(var r=0;r1&&"boolean"!==typeof t)throw new c('"allowMissing" argument must be a boolean');var a=S(e),r=a.length>0?a[0]:"",i=E("%"+r+"%",t),f=i.name,o=i.value,s=!1,b=i.alias;b&&(r=b[0],w(a,y([0,1],b)));for(var u=1,h=!0;u=a.length){var g=d(o,l);h=!!g,o=h&&"get"in g&&!("originalValue"in g.get)?g.get:o[l]}else h=v(o,l),o=o[l];h&&!s&&(p[f]=o)}}return o}},15743:function(e,t,a){var r;r="undefined"!==typeof window?window:"undefined"!==typeof a.g?a.g:"undefined"!==typeof self?self:{},e.exports=r},82763:function(e,t,a){"use strict";var r="undefined"!==typeof Symbol&&Symbol,n=a(33994);e.exports=function(){return"function"===typeof r&&("function"===typeof Symbol&&("symbol"===typeof r("foo")&&("symbol"===typeof Symbol("bar")&&n())))}},33994:function(e){"use strict";e.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),a=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(a))return!1;var r=42;for(t in e[t]=r,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(i.value!==r||!0!==i.enumerable)return!1}return!0}},92582:function(e,t,a){"use strict";var r=a(33994);e.exports=function(){return r()&&!!Symbol.toStringTag}},5769:function(e,t,a){"use strict";var r=a(49148);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},10761:function(e,t,a){"use strict";a(21703);var r=a(17662).Buffer,n=a(98141).Transform,i=a(81923);function c(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}function f(e){n.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}i(f,n),f.prototype._transform=function(e,t,a){var r=null;try{this.update(e,t)}catch(n){r=n}a(r)},f.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(a){t=a}e(t)},f.prototype.update=function(e,t){if(c(e,"Data"),this._finalized)throw new Error("Digest already called");r.isBuffer(e)||(e=r.from(e,t));var a=this._block,n=0;while(this._blockOffset+e.length-n>=this._blockSize){for(var i=this._blockOffset;i0;++f)this._length[f]+=d,d=this._length[f]/4294967296|0,d>0&&(this._length[f]-=4294967296*d);return this},f.prototype._update=function(){throw new Error("_update is not implemented")},f.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var a=0;a<4;++a)this._length[a]=0;return t},f.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=f},17662:function(e,t,a){a(21703); /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var r=a(15361),n=r.Buffer;function i(e,t){for(var a in e)t[a]=e[a]}function c(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=c),c.prototype=Object.create(n.prototype),i(n,c),c.from=function(e,t,a){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},c.alloc=function(e,t,a){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"===typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},c.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},c.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},78730:function(e,t,a){var r=t;r.utils=a(13610),r.common=a(79291),r.sha=a(52762),r.ripemd=a(97),r.hmac=a(4133),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},79291:function(e,t,a){"use strict";var r=a(13610),n=a(14961);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var a=e.length%this._delta8;this.pending=e.slice(e.length-a,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-a,this.endian);for(var n=0;n>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e}else for(r[n++]=255&e,r[n++]=e>>>8&255,r[n++]=e>>>16&255,r[n++]=e>>>24&255,r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=0,i=8;ithis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3}function u(e){return n(e,17)^n(e,19)^e>>>10}t.ft_1=i,t.ch32=c,t.maj32=f,t.p32=d,t.s0_256=o,t.s1_256=s,t.g0_256=b,t.g1_256=u},13610:function(e,t,a){"use strict";var r=a(14961),n=a(81923);function i(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function c(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var a=[];if("string"===typeof e)if(t){if("hex"===t)for(e=e.replace(/[^a-z0-9]+/gi,""),e.length%2!==0&&(e="0"+e),n=0;n>6|192,a[r++]=63&c|128):i(e,n)?(c=65536+((1023&c)<<10)+(1023&e.charCodeAt(++n)),a[r++]=c>>18|240,a[r++]=c>>12&63|128,a[r++]=c>>6&63|128,a[r++]=63&c|128):(a[r++]=c>>12|224,a[r++]=c>>6&63|128,a[r++]=63&c|128)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24;return t>>>0}function o(e,t){for(var a="",r=0;r>>0}return c}function h(e,t){for(var a=new Array(4*e.length),r=0,n=0;r>>24,a[n+1]=i>>>16&255,a[n+2]=i>>>8&255,a[n+3]=255&i):(a[n+3]=i>>>24,a[n+2]=i>>>16&255,a[n+1]=i>>>8&255,a[n]=255&i)}return a}function l(e,t){return e>>>t|e<<32-t}function p(e,t){return e<>>32-t}function x(e,t){return e+t>>>0}function m(e,t,a){return e+t+a>>>0}function g(e,t,a,r){return e+t+a+r>>>0}function v(e,t,a,r,n){return e+t+a+r+n>>>0}function y(e,t,a,r){var n=e[t],i=e[t+1],c=r+i>>>0,f=(c>>0,e[t+1]=c}function w(e,t,a,r){var n=t+r>>>0,i=(n>>0}function M(e,t,a,r){var n=t+r;return n>>>0}function _(e,t,a,r,n,i,c,f){var d=0,o=t;o=o+r>>>0,d+=o>>0,d+=o>>0,d+=o>>0}function k(e,t,a,r,n,i,c,f){var d=t+r+i+f;return d>>>0}function A(e,t,a,r,n,i,c,f,d,o){var s=0,b=t;b=b+r>>>0,s+=b>>0,s+=b>>0,s+=b>>0,s+=b>>0}function S(e,t,a,r,n,i,c,f,d,o){var s=t+r+i+f+o;return s>>>0}function E(e,t,a){var r=t<<32-a|e>>>a;return r>>>0}function B(e,t,a){var r=e<<32-a|t>>>a;return r>>>0}function T(e,t,a){return e>>>a}function P(e,t,a){var r=e<<32-a|t>>>a;return r>>>0}t.inherits=n,t.toArray=c,t.toHex=f,t.htonl=d,t.toHex32=o,t.zero2=s,t.zero8=b,t.join32=u,t.split32=h,t.rotr32=l,t.rotl32=p,t.sum32=x,t.sum32_3=m,t.sum32_4=g,t.sum32_5=v,t.sum64=y,t.sum64_hi=w,t.sum64_lo=M,t.sum64_4_hi=_,t.sum64_4_lo=k,t.sum64_5_hi=A,t.sum64_5_lo=S,t.rotr64_hi=E,t.rotr64_lo=B,t.shr64_hi=T,t.shr64_lo=P},72570:function(e,t,a){"use strict";a(21703);var r=a(78730),n=a(26605),i=a(14961);function c(e){if(!(this instanceof c))return new c(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),a=n.toArray(e.nonce,e.nonceEnc||"hex"),r=n.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,a,r)}e.exports=c,c.prototype._init=function(e,t,a){var r=e.concat(t).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(a||[])),this._reseed=1},c.prototype.generate=function(e,t,a,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(r=a,a=t,t=null),a&&(a=n.toArray(a,r||"hex"),this._update(a));var i=[];while(i.length=196608?a>=917760&&a<=917999?18874368:0:e[t[a>>4]][15&a]}return{mapStr:a,mapChar:r}}))},63304:function(e,t,a){"use strict";a(21703);const r=2147483647,n=36,i=1,c=26,f=38,d=700,o=72,s=128,b="-",u=/^xn--/,h=/[^\0-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=n-i,m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(p[e])}function y(e,t){const a=[];let r=e.length;while(r--)a[r]=t(e[r]);return a}function w(e,t){const a=e.split("@");let r="";a.length>1&&(r=a[0]+"@",e=a[1]),e=e.replace(l,".");const n=e.split("."),i=y(n,t).join(".");return r+i}function M(e){const t=[];let a=0;const r=e.length;while(a=55296&&n<=56319&&aString.fromCodePoint(...e),k=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:n},A=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},S=function(e,t,a){let r=0;for(e=a?m(e/d):e>>1,e+=m(e/t);e>x*c>>1;r+=n)e=m(e/x);return m(r+(x+1)*e/(e+f))},E=function(e){const t=[],a=e.length;let f=0,d=s,u=o,h=e.lastIndexOf(b);h<0&&(h=0);for(let r=0;r=128&&v("not-basic"),t.push(e.charCodeAt(r));for(let o=h>0?h+1:0;o=a&&v("invalid-input");const s=k(e.charCodeAt(o++));(s>=n||s>m((r-f)/t))&&v("overflow"),f+=s*t;const b=d<=u?i:d>=u+c?c:d-u;if(sm(r/h)&&v("overflow"),t*=h}const b=t.length+1;u=S(f-s,b,0==s),m(f/b)>r-d&&v("overflow"),d+=m(f/b),f%=b,t.splice(f++,0,d)}return String.fromCodePoint(...t)},B=function(e){const t=[];e=M(e);let a=e.length,f=s,d=0,u=o;for(const r of e)r<128&&t.push(g(r));let h=t.length,l=h;h&&t.push(b);while(l=f&&tm((r-d)/o)&&v("overflow"),d+=(a-f)*o,f=a;for(const s of e)if(sr&&v("overflow"),s==f){let e=d;for(let a=n;;a+=n){const r=a<=u?i:a>=u+c?c:a-u;if(e>23,u=s>>21&3,h=s>>5&65535,l=31&s,p=t.mapStr.substr(h,l);if(0===u||r&&1&b)throw new Error("Illegal char "+o);1===u?i.push(p):2===u?i.push(n?p:o):3===u&&i.push(o)}var x=i.join("").normalize("NFC");return x}function r(t,r,i){void 0===i&&(i=!1);var c=a(t,i,r),f=c.split(".");return f=f.map((function(t){return t.startsWith("xn--")?(t=e.decode(t.substring(4)),n(t,i,!1)):n(t,i,r),t})),f.join(".")}function n(e,r,n){if("-"===e[2]&&"-"===e[3])throw new Error("Failed to validate "+e);if(e.startsWith("-")||e.endsWith("-"))throw new Error("Failed to validate "+e);if(e.includes("."))throw new Error("Failed to validate "+e);if(a(e,r,n)!==e)throw new Error("Failed to validate "+e);var i=e.codePointAt(0);if(t.mapChar(i)&2<<23)throw new Error("Label contains illegal character: "+i)}function i(t,a){void 0===a&&(a={});var n,i=!("transitional"in a)||a.transitional,c="useStd3ASCII"in a&&a.useStd3ASCII,f="verifyDnsLength"in a&&a.verifyDnsLength,d=r(t,i,c).split("."),o=d.map(e.toASCII),s=o.join(".");if(f){if(s.length<1||s.length>253)throw new Error("DNS name has wrong length: "+s);for(n=0;n63)throw new Error("DNS label has wrong length: "+b)}}return s}function c(e,t){void 0===t&&(t={});var a="useStd3ASCII"in t&&t.useStd3ASCII;return r(e,!1,a)}return{toUnicode:c,toAscii:i}}))},27055:function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,a,r,n){var i,c,f=8*n-r-1,d=(1<>1,s=-7,b=a?n-1:0,u=a?-1:1,h=e[t+b];for(b+=u,i=h&(1<<-s)-1,h>>=-s,s+=f;s>0;i=256*i+e[t+b],b+=u,s-=8);for(c=i&(1<<-s)-1,i>>=-s,s+=r;s>0;c=256*c+e[t+b],b+=u,s-=8);if(0===i)i=1-o;else{if(i===d)return c?NaN:1/0*(h?-1:1);c+=Math.pow(2,r),i-=o}return(h?-1:1)*c*Math.pow(2,i-r)},t.write=function(e,t,a,r,n,i){var c,f,d,o=8*i-n-1,s=(1<>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,l=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,c=s):(c=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-c))<1&&(c--,d*=2),t+=c+b>=1?u/d:u*Math.pow(2,1-b),t*d>=2&&(c++,d/=2),c+b>=s?(f=0,c=s):c+b>=1?(f=(t*d-1)*Math.pow(2,n),c+=b):(f=t*Math.pow(2,b-1)*Math.pow(2,n),c=0));n>=8;e[a+h]=255&f,h+=l,f/=256,n-=8);for(c=c<0;e[a+h]=255&c,h+=l,c/=256,o-=8);e[a+h-l]|=128*p}},81923:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}}},32773:function(e,t,a){"use strict";var r=a(92582)(),n=a(15477),i=n("Object.prototype.toString"),c=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},f=function(e){return!!c(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},d=function(){return c(arguments)}();c.isLegacyArguments=f,e.exports=d?c:f},43940:function(e){e.exports=a;var t=Object.prototype.toString;function a(e){if(!e)return!1;var a=t.call(e);return"[object Function]"===a||"function"===typeof e&&"[object RegExp]"!==a||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}},84784:function(e,t,a){"use strict";var r,n=Object.prototype.toString,i=Function.prototype.toString,c=/^\s*(?:function)?\*/,f=a(92582)(),d=Object.getPrototypeOf,o=function(){if(!f)return!1;try{return Function("return function*() {}")()}catch(e){}};e.exports=function(e){if("function"!==typeof e)return!1;if(c.test(i.call(e)))return!0;if(!f){var t=n.call(e);return"[object GeneratorFunction]"===t}if(!d)return!1;if("undefined"===typeof r){var a=o();r=!!a&&d(a)}return d(e)===r}},44866:function(e,t,a){a(21703),e.exports=function(e){if("string"!==typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},18300:function(e,t,a){"use strict";var r=a(98625),n=a(24647),i=a(15477),c=i("Object.prototype.toString"),f=a(92582)(),d="undefined"===typeof globalThis?a.g:globalThis,o=n(),s=i("Array.prototype.indexOf",!0)||function(e,t){for(var a=0;a-1}return!!h&&p(e)}},6513:function(e,t,a){a(48675),a(3462),e.exports=i,i.strict=c,i.loose=f;var r=Object.prototype.toString,n={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function i(e){return c(e)||f(e)}function c(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function f(e){return n[r.call(e)]}},69893:function(e,t,a){var r,n=a(96027);a(21703),a(48675),a(3462), /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */ function(){"use strict";var i="input is invalid type",c="finalize already called",f="object"===typeof window,d=f?window:{};d.JS_SHA3_NO_WINDOW&&(f=!1);var o=!f&&"object"===typeof self,s=!d.JS_SHA3_NO_NODE_JS&&"object"===typeof n&&n.versions&&n.versions.node;s?d=a.g:o&&(d=self);var b=!d.JS_SHA3_NO_COMMON_JS&&e.exports,u=a.amdO,h=!d.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[31,7936,2031616,520093696],x=[4,1024,262144,67108864],m=[1,256,65536,16777216],g=[6,1536,393216,100663296],v=[0,8,16,24],y=[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],w=[224,256,384,512],M=[128,256],_=["hex","buffer","arrayBuffer","array","digest"],k={128:168,256:136};!d.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!d.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var A=function(e,t,a){return function(r){return new z(e,t,e).update(r)[a]()}},S=function(e,t,a){return function(r,n){return new z(e,t,n).update(r)[a]()}},E=function(e,t,a){return function(t,r,n,i){return N["cshake"+e].update(t,r,n,i)[a]()}},B=function(e,t,a){return function(t,r,n,i){return N["kmac"+e].update(t,r,n,i)[a]()}},T=function(e,t,a,r){for(var n=0;n<_.length;++n){var i=_[n];e[i]=t(a,r,i)}return e},P=function(e,t){var a=A(e,t,"hex");return a.create=function(){return new z(e,t,e)},a.update=function(e){return a.create().update(e)},T(a,A,e,t)},I=function(e,t){var a=S(e,t,"hex");return a.create=function(a){return new z(e,t,a)},a.update=function(e,t){return a.create(t).update(e)},T(a,S,e,t)},C=function(e,t){var a=k[e],r=E(e,t,"hex");return r.create=function(r,n,i){return n||i?new z(e,t,r).bytepad([n,i],a):N["shake"+e].create(r)},r.update=function(e,t,a,n){return r.create(t,a,n).update(e)},T(r,E,e,t)},R=function(e,t){var a=k[e],r=B(e,t,"hex");return r.create=function(r,n,i){return new K(e,t,n).bytepad(["KMAC",i],a).bytepad([r],a)},r.update=function(e,t,a,n){return r.create(e,a,n).update(t)},T(r,B,e,t)},O=[{name:"keccak",padding:m,bits:w,createMethod:P},{name:"sha3",padding:g,bits:w,createMethod:P},{name:"shake",padding:p,bits:M,createMethod:I},{name:"cshake",padding:x,bits:M,createMethod:C},{name:"kmac",padding:x,bits:M,createMethod:R}],N={},U=[],L=0;L>5,this.byteCount=this.blockCount<<2,this.outputBlocks=a>>5,this.extraBytes=(31&a)>>3;for(var r=0;r<50;++r)this.s[r]=0}function K(e,t,a){z.call(this,e,t,a)}z.prototype.update=function(e){if(this.finalized)throw new Error(c);var t,a=typeof e;if("string"!==a){if("object"!==a)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var r,n,f=this.blocks,d=this.byteCount,o=e.length,s=this.blockCount,b=0,u=this.s;while(b>2]|=e[b]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(f[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=d){for(this.start=r-d,this.block=f[s],r=0;r>=8,a=255&e;while(a>0)n.unshift(a),e>>=8,a=255&e,++r;return t?n.push(r):n.unshift(r),this.update(n),n.length},z.prototype.encodeString=function(e){var t,a=typeof e;if("string"!==a){if("object"!==a)throw new Error(i);if(null===e)throw new Error(i);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!h||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var r=0,n=e.length;if(t)r=n;else for(var c=0;c=57344?r+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++c)),r+=4)}return r+=this.encode(8*r),this.update(e),r},z.prototype.bytepad=function(e,t){for(var a=this.encode(t),r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[a],t=1;t>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15];c%t===0&&(Z(a),i=0)}return n&&(e=a[i],f+=l[e>>4&15]+l[15&e],n>1&&(f+=l[e>>12&15]+l[e>>8&15]),n>2&&(f+=l[e>>20&15]+l[e>>16&15])),f},z.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,a=this.s,r=this.outputBlocks,n=this.extraBytes,i=0,c=0,f=this.outputBits>>3;e=n?new ArrayBuffer(r+1<<2):new ArrayBuffer(f);var d=new Uint32Array(e);while(c>8&255,d[e+2]=t>>16&255,d[e+3]=t>>24&255;f%a===0&&Z(r)}return i&&(e=f<<2,t=r[c],d[e]=255&t,i>1&&(d[e+1]=t>>8&255),i>2&&(d[e+2]=t>>16&255)),d},K.prototype=new z,K.prototype.finalize=function(){return this.encode(this.outputBits,!0),z.prototype.finalize.call(this)};var Z=function(e){var t,a,r,n,i,c,f,d,o,s,b,u,h,l,p,x,m,g,v,w,M,_,k,A,S,E,B,T,P,I,C,R,O,N,U,L,j,q,F,D,H,z,K,Z,G,V,W,J,X,Y,Q,$,ee,te,ae,re,ne,ie,ce,fe,de,oe,se;for(r=0;r<48;r+=2)n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],c=e[2]^e[12]^e[22]^e[32]^e[42],f=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],o=e[5]^e[15]^e[25]^e[35]^e[45],s=e[6]^e[16]^e[26]^e[36]^e[46],b=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49],t=u^(c<<1|f>>>31),a=h^(f<<1|c>>>31),e[0]^=t,e[1]^=a,e[10]^=t,e[11]^=a,e[20]^=t,e[21]^=a,e[30]^=t,e[31]^=a,e[40]^=t,e[41]^=a,t=n^(d<<1|o>>>31),a=i^(o<<1|d>>>31),e[2]^=t,e[3]^=a,e[12]^=t,e[13]^=a,e[22]^=t,e[23]^=a,e[32]^=t,e[33]^=a,e[42]^=t,e[43]^=a,t=c^(s<<1|b>>>31),a=f^(b<<1|s>>>31),e[4]^=t,e[5]^=a,e[14]^=t,e[15]^=a,e[24]^=t,e[25]^=a,e[34]^=t,e[35]^=a,e[44]^=t,e[45]^=a,t=d^(u<<1|h>>>31),a=o^(h<<1|u>>>31),e[6]^=t,e[7]^=a,e[16]^=t,e[17]^=a,e[26]^=t,e[27]^=a,e[36]^=t,e[37]^=a,e[46]^=t,e[47]^=a,t=s^(n<<1|i>>>31),a=b^(i<<1|n>>>31),e[8]^=t,e[9]^=a,e[18]^=t,e[19]^=a,e[28]^=t,e[29]^=a,e[38]^=t,e[39]^=a,e[48]^=t,e[49]^=a,l=e[0],p=e[1],V=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,T=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,de=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,x=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,oe=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ae=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,v=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,Z=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=l^~x&g,e[1]=p^~m&v,e[10]=A^~E&T,e[11]=S^~B&P,e[20]=N^~L&q,e[21]=U^~j&F,e[30]=Z^~V&J,e[31]=G^~W&X,e[40]=te^~re&ie,e[41]=ae^~ne&ce,e[2]=x^~g&w,e[3]=m^~v&M,e[12]=E^~T&I,e[13]=B^~P&C,e[22]=L^~q&D,e[23]=j^~F&H,e[32]=V^~J&Y,e[33]=W^~X&Q,e[42]=re^~ie&fe,e[43]=ne^~ce&de,e[4]=g^~w&_,e[5]=v^~M&k,e[14]=T^~I&R,e[15]=P^~C&O,e[24]=q^~D&z,e[25]=F^~H&K,e[34]=J^~Y&$,e[35]=X^~Q&ee,e[44]=ie^~fe&oe,e[45]=ce^~de&se,e[6]=w^~_&l,e[7]=M^~k&p,e[16]=I^~R&A,e[17]=C^~O&S,e[26]=D^~z&N,e[27]=H^~K&U,e[36]=Y^~$&Z,e[37]=Q^~ee&G,e[46]=fe^~oe&te,e[47]=de^~se&ae,e[8]=_^~l&x,e[9]=k^~p&m,e[18]=R^~A&E,e[19]=O^~S&B,e[28]=z^~N&L,e[29]=K^~U&j,e[38]=$^~Z&V,e[39]=ee^~G&W,e[48]=oe^~te&re,e[49]=se^~ae&ne,e[0]^=y[r],e[1]^=y[r+1]};if(b)e.exports=N;else{for(L=0;L{try{const[n,i,f]=await c._runAllMiddleware(e,t,this._middleware);return i?(await c._runReturnHandlers(f),r(n)):a((async e=>{try{await c._runReturnHandlers(f)}catch(t){return e(t)}return e()}))}catch(n){return r(n)}}}async _handleBatch(e,t){try{const a=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,a):a}catch(a){if(t)return t(a);throw a}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,a)=>{t(a)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!==typeof e){const a=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(a,{id:void 0,jsonrpc:"2.0",error:a})}if("string"!==typeof e.method){const a=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(a,{id:e.id,jsonrpc:"2.0",error:a})}const a=Object.assign({},e),r={id:a.id,jsonrpc:a.jsonrpc};let n=null;try{await this._processRequest(a,r)}catch(c){n=c}return n&&(delete r.result,r.error||(r.error=i.serializeError(n))),t(n,r)}async _processRequest(e,t){const[a,r,n]=await c._runAllMiddleware(e,t,this._middleware);if(c._checkForCompletion(e,t,r),await c._runReturnHandlers(n),a)throw a}static async _runAllMiddleware(e,t,a){const r=[];let n=null,i=!1;for(const f of a)if([n,i]=await c._runMiddleware(e,t,f,r),i)break;return[n,i,r.reverse()]}static _runMiddleware(e,t,a,r){return new Promise((n=>{const c=e=>{const a=e||t.error;a&&(t.error=i.serializeError(a)),n([a,!0])},d=a=>{t.error?c(t.error):(a&&("function"!==typeof a&&c(new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof a}" for request:\n${f(e)}`,{request:e})),r.push(a)),n([null,!1]))};try{a(e,t,d,c)}catch(o){c(o)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,a)=>{t((t=>t?a(t):e()))}))}static _checkForCompletion(e,t,a){if(!("result"in t)&&!("error"in t))throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:\n${f(e)}`,{request:e});if(!a)throw new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:\n${f(e)}`,{request:e})}}function f(e){return JSON.stringify(e,null,2)}t.JsonRpcEngine=c},26993:function(e,t){"use strict";function a(e){return async(t,a,r,n)=>{let i;const c=new Promise((e=>{i=e}));let f=null,d=!1;const o=async()=>{d=!0,r((e=>{f=e,i()})),await c};try{await e(t,a,o),d?(await c,f(null)):n(null)}catch(s){f?f(s):n(s)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.createAsyncMiddleware=void 0,t.createAsyncMiddleware=a},79430:function(e,t){"use strict";function a(e){return(t,a,r,n)=>{const i=e[t.method];return void 0===i?r():"function"===typeof i?i(t,a,r,n):(a.result=i,n())}}Object.defineProperty(t,"__esModule",{value:!0}),t.createScaffoldMiddleware=void 0,t.createScaffoldMiddleware=a},80321:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;const a=4294967295;let r=Math.floor(Math.random()*a);function n(){return r=(r+1)%a,r}t.getUniqueId=n},71298:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdRemapMiddleware=void 0;const r=a(80321);function n(){return(e,t,a,n)=>{const i=e.id,c=r.getUniqueId();e.id=c,t.id=c,a((a=>{e.id=i,t.id=i,a()}))}}t.createIdRemapMiddleware=n},2482:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),n(a(71298),t),n(a(26993),t),n(a(79430),t),n(a(80321),t),n(a(71222),t),n(a(33848),t)},33848:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMiddleware=void 0;const r=a(71222);function n(e){const t=new r.JsonRpcEngine;return e.forEach((e=>t.push(e))),t.asMiddleware()}t.mergeMiddleware=n},29648:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const r=a(25383);class n extends Error{constructor(e,t,a){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!==typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==a&&(this.data=a)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return r.default(this.serialize(),f,2)}}t.EthereumRpcError=n;class i extends n{constructor(e,t,a){if(!c(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,a)}}function c(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function f(e,t){if("[Circular]"!==t)return t}t.EthereumProviderError=i},14668:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},43791:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const r=a(29648),n=a(10696),i=a(14668);function c(e,t){const[a,i]=d(t);return new r.EthereumRpcError(e,a||n.getMessageFromCode(e),i)}function f(e,t){const[a,i]=d(t);return new r.EthereumProviderError(e,a||n.getMessageFromCode(e),i)}function d(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){const{message:t,data:a}=e;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,a]}}return[]}t.ethErrors={rpc:{parse:e=>c(i.errorCodes.rpc.parse,e),invalidRequest:e=>c(i.errorCodes.rpc.invalidRequest,e),invalidParams:e=>c(i.errorCodes.rpc.invalidParams,e),methodNotFound:e=>c(i.errorCodes.rpc.methodNotFound,e),internal:e=>c(i.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return c(t,e)},invalidInput:e=>c(i.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>c(i.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>c(i.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>c(i.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>c(i.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>c(i.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>f(i.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>f(i.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>f(i.errorCodes.provider.unsupportedMethod,e),disconnected:e=>f(i.errorCodes.provider.disconnected,e),chainDisconnected:e=>f(i.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!==typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:a,data:n}=e;if(!a||"string"!==typeof a)throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(t,a,n)}}}},86901:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const r=a(29648);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return r.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return r.EthereumProviderError}});const n=a(10696);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const i=a(43791);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return i.ethErrors}});const c=a(14668);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return c.errorCodes}})},10696:function(e,t,a){"use strict";a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const r=a(14668),n=a(29648),i=r.errorCodes.rpc.internal,c="Unspecified error message. This is a bug, please report it.",f={code:i,message:d(i)};function d(e,a=c){if(Number.isInteger(e)){const a=e.toString();if(h(r.errorValues,a))return r.errorValues[a].message;if(b(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return a}function o(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!r.errorValues[t]||!!b(e)}function s(e,{fallbackError:t=f,shouldIncludeStack:a=!1}={}){var r,i;if(!t||!Number.isInteger(t.code)||"string"!==typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof n.EthereumRpcError)return e.serialize();const c={};if(e&&"object"===typeof e&&!Array.isArray(e)&&h(e,"code")&&o(e.code)){const t=e;c.code=t.code,t.message&&"string"===typeof t.message?(c.message=t.message,h(t,"data")&&(c.data=t.data)):(c.message=d(c.code),c.data={originalError:u(e)})}else{c.code=t.code;const a=null===(r=e)||void 0===r?void 0:r.message;c.message=a&&"string"===typeof a?a:t.message,c.data={originalError:u(e)}}const s=null===(i=e)||void 0===i?void 0:i.stack;return a&&e&&s&&"string"===typeof s&&(c.stack=s),c}function b(e){return e>=-32099&&e<=-32e3}function u(e){return e&&"object"===typeof e&&!Array.isArray(e)?Object.assign({},e):e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=d,t.isValidCode=o,t.serializeError=s},21770:function(e){function t(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,a="undefined"!==typeof e.start?e.start:Math.floor(Math.random()*t);return function(){return a%=t,a++}}e.exports=t},40391:function(e,t,a){a(21703);var r="undefined"!==typeof JSON?JSON:a(34286);e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var a=t.space||"";"number"===typeof a&&(a=Array(a+1).join(" "));var c="boolean"===typeof t.cycles&&t.cycles,f=t.replacer||function(e,t){return t},d=t.cmp&&function(e){return function(t){return function(a,r){var n={key:a,value:t[a]},i={key:r,value:t[r]};return e(n,i)}}}(t.cmp),o=[];return function e(t,s,b,u){var h=a?"\n"+new Array(u+1).join(a):"",l=a?": ":":";if(b&&b.toJSON&&"function"===typeof b.toJSON&&(b=b.toJSON()),b=f.call(t,s,b),void 0!==b){if("object"!==typeof b||null===b)return r.stringify(b);if(n(b)){for(var p=[],x=0;x="0"&&a<="9")t+=a,f();if("."===a){t+=".";while(f()&&a>="0"&&a<="9")t+=a}if("e"===a||"E"===a){t+=a,f(),"-"!==a&&"+"!==a||(t+=a,f());while(a>="0"&&a<="9")t+=a,f()}if(e=+t,isFinite(e))return e;c("Bad number")},o=function(){var e,t,r,n="";if('"'===a)while(f()){if('"'===a)return f(),n;if("\\"===a)if(f(),"u"===a){for(r=0,t=0;t<4;t+=1){if(e=parseInt(f(),16),!isFinite(e))break;r=16*r+e}n+=String.fromCharCode(r)}else{if("string"!==typeof i[a])break;n+=i[a]}else n+=a}c("Bad string")},s=function(){while(a&&a<=" ")f()},b=function(){switch(a){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}c("Unexpected '"+a+"'")},u=function(){var e=[];if("["===a){if(f("["),s(),"]"===a)return f("]"),e;while(a){if(e.push(n()),s(),"]"===a)return f("]"),e;f(","),s()}}c("Bad array")},h=function(){var e,t={};if("{"===a){if(f("{"),s(),"}"===a)return f("}"),t;while(a){if(e=o(),s(),f(":"),Object.hasOwnProperty.call(t,e)&&c('Duplicate key "'+e+'"'),t[e]=n(),s(),"}"===a)return f("}"),t;f(","),s()}}c("Bad object")};n=function(){switch(s(),a){case"{":return h();case"[":return u();case'"':return o();case"-":return d();default:return a>="0"&&a<="9"?d():b()}},e.exports=function(e,i){var f;return r=e,t=0,a=" ",f=n(),s(),a&&c("Syntax error"),"function"===typeof i?function e(t,a){var r,n,c=t[a];if(c&&"object"===typeof c)for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(n=e(c,r),void 0!==n?c[r]=n:delete c[r]);return i.call(t,a,c)}({"":f},""):f}},69185:function(e,t,a){a(21703);var r,n,i,c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function d(e){return c.lastIndex=0,c.test(e)?'"'+e.replace(c,(function(e){var t=f[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function o(e,t){var a,c,f,s,b,u=r,h=t[e];switch(h&&"object"===typeof h&&"function"===typeof h.toJSON&&(h=h.toJSON(e)),"function"===typeof i&&(h=i.call(t,e,h)),typeof h){case"string":return d(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(r+=n,b=[],"[object Array]"===Object.prototype.toString.apply(h)){for(s=h.length,a=0;aclass t extends n{constructor(t,a,r,n,i){super(i),this._rate=t,this._capacity=a,this._delimitedSuffix=r,this._hashBitLength=n,this._options=i,this._state=new e,this._state.initialize(t,a),this._finalized=!1}_transform(e,t,a){let r=null;try{this.update(e,t)}catch(n){r=n}a(r)}_flush(e){let t=null;try{this.push(this.digest())}catch(a){t=a}e(t)}update(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return r.isBuffer(e)||(e=r.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},66627:function(e,t,a){var r=a(15361)["Buffer"];a(21703);const{Transform:n}=a(98141);e.exports=e=>class t extends n{constructor(t,a,r,n){super(n),this._rate=t,this._capacity=a,this._delimitedSuffix=r,this._options=n,this._state=new e,this._state.initialize(t,a),this._finalized=!1}_transform(e,t,a){let r=null;try{this.update(e,t)}catch(n){r=n}a(r)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!r.isBuffer(e)&&"string"!==typeof e)throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return r.isBuffer(e)||(e=r.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let a=this._state.squeeze(e);return void 0!==t&&(a=a.toString(t)),a}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},27269:function(e,t){const a=[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];t.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],c=e[3]^e[13]^e[23]^e[33]^e[43],f=e[4]^e[14]^e[24]^e[34]^e[44],d=e[5]^e[15]^e[25]^e[35]^e[45],o=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],b=e[8]^e[18]^e[28]^e[38]^e[48],u=e[9]^e[19]^e[29]^e[39]^e[49];let h=b^(i<<1|c>>>31),l=u^(c<<1|i>>>31);const p=e[0]^h,x=e[1]^l,m=e[10]^h,g=e[11]^l,v=e[20]^h,y=e[21]^l,w=e[30]^h,M=e[31]^l,_=e[40]^h,k=e[41]^l;h=r^(f<<1|d>>>31),l=n^(d<<1|f>>>31);const A=e[2]^h,S=e[3]^l,E=e[12]^h,B=e[13]^l,T=e[22]^h,P=e[23]^l,I=e[32]^h,C=e[33]^l,R=e[42]^h,O=e[43]^l;h=i^(o<<1|s>>>31),l=c^(s<<1|o>>>31);const N=e[4]^h,U=e[5]^l,L=e[14]^h,j=e[15]^l,q=e[24]^h,F=e[25]^l,D=e[34]^h,H=e[35]^l,z=e[44]^h,K=e[45]^l;h=f^(b<<1|u>>>31),l=d^(u<<1|b>>>31);const Z=e[6]^h,G=e[7]^l,V=e[16]^h,W=e[17]^l,J=e[26]^h,X=e[27]^l,Y=e[36]^h,Q=e[37]^l,$=e[46]^h,ee=e[47]^l;h=o^(r<<1|n>>>31),l=s^(n<<1|r>>>31);const te=e[8]^h,ae=e[9]^l,re=e[18]^h,ne=e[19]^l,ie=e[28]^h,ce=e[29]^l,fe=e[38]^h,de=e[39]^l,oe=e[48]^h,se=e[49]^l,be=p,ue=x,he=g<<4|m>>>28,le=m<<4|g>>>28,pe=v<<3|y>>>29,xe=y<<3|v>>>29,me=M<<9|w>>>23,ge=w<<9|M>>>23,ve=_<<18|k>>>14,ye=k<<18|_>>>14,we=A<<1|S>>>31,Me=S<<1|A>>>31,_e=B<<12|E>>>20,ke=E<<12|B>>>20,Ae=T<<10|P>>>22,Se=P<<10|T>>>22,Ee=C<<13|I>>>19,Be=I<<13|C>>>19,Te=R<<2|O>>>30,Pe=O<<2|R>>>30,Ie=U<<30|N>>>2,Ce=N<<30|U>>>2,Re=L<<6|j>>>26,Oe=j<<6|L>>>26,Ne=F<<11|q>>>21,Ue=q<<11|F>>>21,Le=D<<15|H>>>17,je=H<<15|D>>>17,qe=K<<29|z>>>3,Fe=z<<29|K>>>3,De=Z<<28|G>>>4,He=G<<28|Z>>>4,ze=W<<23|V>>>9,Ke=V<<23|W>>>9,Ze=J<<25|X>>>7,Ge=X<<25|J>>>7,Ve=Y<<21|Q>>>11,We=Q<<21|Y>>>11,Je=ee<<24|$>>>8,Xe=$<<24|ee>>>8,Ye=te<<27|ae>>>5,Qe=ae<<27|te>>>5,$e=re<<20|ne>>>12,et=ne<<20|re>>>12,tt=ce<<7|ie>>>25,at=ie<<7|ce>>>25,rt=fe<<8|de>>>24,nt=de<<8|fe>>>24,it=oe<<14|se>>>18,ct=se<<14|oe>>>18;e[0]=be^~_e&Ne,e[1]=ue^~ke&Ue,e[10]=De^~$e&pe,e[11]=He^~et&xe,e[20]=we^~Re&Ze,e[21]=Me^~Oe&Ge,e[30]=Ye^~he&Ae,e[31]=Qe^~le&Se,e[40]=Ie^~ze&tt,e[41]=Ce^~Ke&at,e[2]=_e^~Ne&Ve,e[3]=ke^~Ue&We,e[12]=$e^~pe&Ee,e[13]=et^~xe&Be,e[22]=Re^~Ze&rt,e[23]=Oe^~Ge&nt,e[32]=he^~Ae&Le,e[33]=le^~Se&je,e[42]=ze^~tt&me,e[43]=Ke^~at&ge,e[4]=Ne^~Ve&it,e[5]=Ue^~We&ct,e[14]=pe^~Ee&qe,e[15]=xe^~Be&Fe,e[24]=Ze^~rt&ve,e[25]=Ge^~nt&ye,e[34]=Ae^~Le&Je,e[35]=Se^~je&Xe,e[44]=tt^~me&Te,e[45]=at^~ge&Pe,e[6]=Ve^~it&be,e[7]=We^~ct&ue,e[16]=Ee^~qe&De,e[17]=Be^~Fe&He,e[26]=rt^~ve&we,e[27]=nt^~ye&Me,e[36]=Le^~Je&Ye,e[37]=je^~Xe&Qe,e[46]=me^~Te&Ie,e[47]=ge^~Pe&Ce,e[8]=it^~be&_e,e[9]=ct^~ue&ke,e[18]=qe^~De&$e,e[19]=Fe^~He&et,e[28]=ve^~we&Re,e[29]=ye^~Me&Oe,e[38]=Je^~Ye&he,e[39]=Xe^~Qe&le,e[48]=Te^~Ie&ze,e[49]=Pe^~Ce&Ke,e[0]^=a[2*t],e[1]^=a[2*t+1]}}},79464:function(e,t,a){var r=a(15361)["Buffer"];const n=a(27269);function i(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}i.prototype.initialize=function(e,t){for(let a=0;a<50;++a)this.state[a]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},i.prototype.absorb=function(e){for(let t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return t},i.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=i},99016:function(e,t,a){var r=a(69159),n=r.Symbol;e.exports=n},7498:function(e,t,a){var r=a(52802),n=a(68804),i=a(26602),c=a(21976),f=a(38286),d=a(56965),o=Object.prototype,s=o.hasOwnProperty;function b(e,t){var a=i(e),o=!a&&n(e),b=!a&&!o&&c(e),u=!a&&!o&&!b&&d(e),h=a||o||b||u,l=h?r(e.length,String):[],p=l.length;for(var x in e)!t&&!s.call(e,x)||h&&("length"==x||b&&("offset"==x||"parent"==x)||u&&("buffer"==x||"byteLength"==x||"byteOffset"==x)||f(x,p))||l.push(x);return l}e.exports=b},96423:function(e,t,a){var r=a(99016),n=a(52366),i=a(52886),c="[object Null]",f="[object Undefined]",d=r?r.toStringTag:void 0;function o(e){return null==e?void 0===e?f:c:d&&d in Object(e)?n(e):i(e)}e.exports=o},29986:function(e,t,a){var r=a(96423),n=a(74430),i="[object Arguments]";function c(e){return n(e)&&r(e)==i}e.exports=c},86930:function(e,t,a){var r=a(96423),n=a(84629),i=a(74430),c="[object Arguments]",f="[object Array]",d="[object Boolean]",o="[object Date]",s="[object Error]",b="[object Function]",u="[object Map]",h="[object Number]",l="[object Object]",p="[object RegExp]",x="[object Set]",m="[object String]",g="[object WeakMap]",v="[object ArrayBuffer]",y="[object DataView]",w="[object Float32Array]",M="[object Float64Array]",_="[object Int8Array]",k="[object Int16Array]",A="[object Int32Array]",S="[object Uint8Array]",E="[object Uint8ClampedArray]",B="[object Uint16Array]",T="[object Uint32Array]",P={};function I(e){return i(e)&&n(e.length)&&!!P[r(e)]}P[w]=P[M]=P[_]=P[k]=P[A]=P[S]=P[E]=P[B]=P[T]=!0,P[c]=P[f]=P[v]=P[d]=P[y]=P[o]=P[s]=P[b]=P[u]=P[h]=P[l]=P[p]=P[x]=P[m]=P[g]=!1,e.exports=I},841:function(e,t,a){var r=a(9192),n=a(47348),i=Object.prototype,c=i.hasOwnProperty;function f(e){if(!r(e))return n(e);var t=[];for(var a in Object(e))c.call(e,a)&&"constructor"!=a&&t.push(a);return t}e.exports=f},52802:function(e){function t(e,t){var a=-1,r=Array(e);while(++a-1&&e%1==0&&e-1&&e%1==0&&e<=t}e.exports=a},70150:function(e){function t(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=t},74430:function(e){function t(e){return null!=e&&"object"==typeof e}e.exports=t},56965:function(e,t,a){var r=a(86930),n=a(87362),i=a(71330),c=i&&i.isTypedArray,f=c?n(c):r;e.exports=f},24337:function(e,t,a){var r=a(7498),n=a(841),i=a(45372);function c(e){return i(e)?r(e):n(e)}e.exports=c},98869:function(e){function t(){}e.exports=t},22225:function(e){function t(){return!1}e.exports=t},74993:function(e,t,a){"use strict";var r=a(81923),n=a(10761),i=a(6779).Buffer,c=new Array(16);function f(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function d(e,t){return e<>>32-t}function o(e,t,a,r,n,i,c){return d(e+(t&a|~t&r)+n+i|0,c)+t|0}function s(e,t,a,r,n,i,c){return d(e+(t&r|a&~r)+n+i|0,c)+t|0}function b(e,t,a,r,n,i,c){return d(e+(t^a^r)+n+i|0,c)+t|0}function u(e,t,a,r,n,i,c){return d(e+(a^(t|~r))+n+i|0,c)+t|0}r(f,n),f.prototype._update=function(){for(var e=c,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var a=this._a,r=this._b,n=this._c,i=this._d;a=o(a,r,n,i,e[0],3614090360,7),i=o(i,a,r,n,e[1],3905402710,12),n=o(n,i,a,r,e[2],606105819,17),r=o(r,n,i,a,e[3],3250441966,22),a=o(a,r,n,i,e[4],4118548399,7),i=o(i,a,r,n,e[5],1200080426,12),n=o(n,i,a,r,e[6],2821735955,17),r=o(r,n,i,a,e[7],4249261313,22),a=o(a,r,n,i,e[8],1770035416,7),i=o(i,a,r,n,e[9],2336552879,12),n=o(n,i,a,r,e[10],4294925233,17),r=o(r,n,i,a,e[11],2304563134,22),a=o(a,r,n,i,e[12],1804603682,7),i=o(i,a,r,n,e[13],4254626195,12),n=o(n,i,a,r,e[14],2792965006,17),r=o(r,n,i,a,e[15],1236535329,22),a=s(a,r,n,i,e[1],4129170786,5),i=s(i,a,r,n,e[6],3225465664,9),n=s(n,i,a,r,e[11],643717713,14),r=s(r,n,i,a,e[0],3921069994,20),a=s(a,r,n,i,e[5],3593408605,5),i=s(i,a,r,n,e[10],38016083,9),n=s(n,i,a,r,e[15],3634488961,14),r=s(r,n,i,a,e[4],3889429448,20),a=s(a,r,n,i,e[9],568446438,5),i=s(i,a,r,n,e[14],3275163606,9),n=s(n,i,a,r,e[3],4107603335,14),r=s(r,n,i,a,e[8],1163531501,20),a=s(a,r,n,i,e[13],2850285829,5),i=s(i,a,r,n,e[2],4243563512,9),n=s(n,i,a,r,e[7],1735328473,14),r=s(r,n,i,a,e[12],2368359562,20),a=b(a,r,n,i,e[5],4294588738,4),i=b(i,a,r,n,e[8],2272392833,11),n=b(n,i,a,r,e[11],1839030562,16),r=b(r,n,i,a,e[14],4259657740,23),a=b(a,r,n,i,e[1],2763975236,4),i=b(i,a,r,n,e[4],1272893353,11),n=b(n,i,a,r,e[7],4139469664,16),r=b(r,n,i,a,e[10],3200236656,23),a=b(a,r,n,i,e[13],681279174,4),i=b(i,a,r,n,e[0],3936430074,11),n=b(n,i,a,r,e[3],3572445317,16),r=b(r,n,i,a,e[6],76029189,23),a=b(a,r,n,i,e[9],3654602809,4),i=b(i,a,r,n,e[12],3873151461,11),n=b(n,i,a,r,e[15],530742520,16),r=b(r,n,i,a,e[2],3299628645,23),a=u(a,r,n,i,e[0],4096336452,6),i=u(i,a,r,n,e[7],1126891415,10),n=u(n,i,a,r,e[14],2878612391,15),r=u(r,n,i,a,e[5],4237533241,21),a=u(a,r,n,i,e[12],1700485571,6),i=u(i,a,r,n,e[3],2399980690,10),n=u(n,i,a,r,e[10],4293915773,15),r=u(r,n,i,a,e[1],2240044497,21),a=u(a,r,n,i,e[8],1873313359,6),i=u(i,a,r,n,e[15],4264355552,10),n=u(n,i,a,r,e[6],2734768916,15),r=u(r,n,i,a,e[13],1309151649,21),a=u(a,r,n,i,e[4],4149444226,6),i=u(i,a,r,n,e[11],3174756917,10),n=u(n,i,a,r,e[2],718787259,15),r=u(r,n,i,a,e[9],3951481745,21),this._a=this._a+a|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+i|0},f.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 e=i.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=f},68529:function(e,t,a){var r=a(2396),n=a(31482);function i(e){this.rand=e||new n.Rand}e.exports=i,i.create=function(e){return new i(e)},i.prototype._randbelow=function(e){var t=e.bitLength(),a=Math.ceil(t/8);do{var n=new r(this.rand.generate(a))}while(n.cmp(e)>=0);return n},i.prototype._randrange=function(e,t){var a=t.sub(e);return e.add(this._randbelow(a))},i.prototype.test=function(e,t,a){var n=e.bitLength(),i=r.mont(e),c=new r(1).toRed(i);t||(t=Math.max(1,n/48|0));for(var f=e.subn(1),d=0;!f.testn(d);d++);for(var o=e.shrn(d),s=f.toRed(i),b=!0;t>0;t--){var u=this._randrange(new r(2),f);a&&a(u);var h=u.toRed(i).redPow(o);if(0!==h.cmp(c)&&0!==h.cmp(s)){for(var l=1;l0;t--){var s=this._randrange(new r(2),c),b=e.gcd(s);if(0!==b.cmpn(1))return b;var u=s.toRed(n).redPow(d);if(0!==u.cmp(i)&&0!==u.cmp(o)){for(var h=1;h>8,c=255&n;i?a.push(i,c):a.push(c)}return a}function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",a=0;a=8&&(c[i++]=n>>>r-8&255,r-=8);return c.buffer}function n(e,t){const a=e.byteLength,r=new Uint8Array(e),n=t.indexOf("=")===t.length-1;n&&(t=t.substring(0,t.length-1));let i=0,c=0,f="";for(let d=0;d=5)f+=t[c>>>i-5&31],i-=5}if(i>0&&(f+=t[c<<5-i&31]),n)while(f.length%8!==0)f+="=";return f}a(48675),a(3462),a(21703),e.exports=function(e){return{encode(t){return n("string"===typeof t?Uint8Array.from(t):t,e)},decode(t){for(const a of t)if(e.indexOf(a)<0)throw new Error("invalid base32 character");return r(t,e)}}}},68627:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361);e.exports=function(e){const t=e.indexOf("=")>-1,a=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode(e){let n="";n="string"===typeof e?r.from(e).toString("base64"):e.toString("base64"),a&&(n=n.replace(/\+/g,"-").replace(/\//g,"_"));const i=n.indexOf("=");return i>0&&!t&&(n=n.substring(0,i)),n},decode(t){for(const a of t)if(e.indexOf(a)<0)throw new Error("invalid base64 character");return r.from(t,"base64")}}}},21985:function(e,t,a){"use strict";const r=a(91654),n=a(12516),i=a(69488),c=a(36359),f=a(68627),d=[["base1","1","","1"],["base2","0",n,"01"],["base8","7",n,"01234567"],["base10","9",n,"0123456789"],["base16","f",i,"0123456789abcdef"],["base32","b",c,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",c,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",c,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",c,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",c,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],o=d.reduce(((e,t)=>(e[t[0]]=new r(t[0],t[1],t[2],t[3]),e)),{}),s=d.reduce(((e,t)=>(e[t[1]]=o[t[0]],e)),{});e.exports={names:o,codes:s}},64869:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361),n=a(21985);t=e.exports=c,t.encode=f,t.decode=d,t.isEncoded=o,t.names=Object.freeze(Object.keys(n.names)),t.codes=Object.freeze(Object.keys(n.codes));const i=new Error("Unsupported encoding");function c(e,t){if(!t)throw new Error("requires an encoded buffer");const a=b(e),n=r.from(a.code),i=a.name;return s(i,t),r.concat([n,t])}function f(e,t){const a=b(e),n=a.name;return c(n,r.from(a.encode(t)))}function d(e){r.isBuffer(e)&&(e=e.toString());const t=e.substring(0,1);e=e.substring(1,e.length),"string"===typeof e&&(e=r.from(e));const a=b(t);return r.from(a.decode(e.toString()))}function o(e){if(r.isBuffer(e)&&(e=e.toString()),"[object String]"!==Object.prototype.toString.call(e))return!1;const t=e.substring(0,1);try{const e=b(t);return e.name}catch(a){return!1}}function s(e,t){const a=b(e);a.decode(t.toString())}function b(e){let t;if(n.names[e])t=n.names[e];else{if(!n.codes[e])throw i;t=n.codes[e]}if(!t.isImplemented())throw new Error("Base "+e+" is not implemented yet");return t}},42177:function(e,t,a){"use strict";const r=a(24070),n={};for(const[i,c]of Object.entries(r))n[i.toUpperCase().replace(/-/g,"_")]=c;e.exports=Object.freeze(n)},58429:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);const n=a(42611),i=a(84644),c=a(20032),f=a(23036);t=e.exports,t.addPrefix=(e,t)=>{let a;if(r.isBuffer(e))a=f.varintBufferEncode(e);else{if(!c[e])throw new Error("multicodec not recognized");a=c[e]}return r.concat([a,t])},t.rmPrefix=e=>(n.decode(e),e.slice(n.decode.bytes)),t.getCodec=e=>{const t=n.decode(e),a=i.get(t);if(void 0===a)throw new Error(`Code ${t} not found`);return a},t.getName=e=>i.get(e),t.getNumber=e=>{const t=c[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return f.varintBufferDecode(t)[0]},t.getCode=e=>n.decode(e),t.getCodeVarint=e=>{const t=c[e];if(void 0===t)throw new Error("Codec `"+e+"` not found");return t},t.getVarint=e=>n.encode(e);const d=a(42177);Object.assign(t,d),t.print=a(96376)},84644:function(e,t,a){"use strict";const r=a(24070),n=new Map;for(const i in r){const e=r[i];n.set(e,i)}e.exports=Object.freeze(n)},96376:function(e,t,a){"use strict";const r=a(24070),n={};for(const[i,c]of Object.entries(r))void 0===n[c]&&(n[c]=i);e.exports=Object.freeze(n)},23036:function(e,t,a){"use strict";var r=a(15361)["Buffer"];const n=a(42611);function i(e){return parseInt(e.toString("hex"),16)}function c(e){let t=e.toString(16);return t.length%2===1&&(t="0"+t),r.from(t,"hex")}function f(e){return r.from(n.encode(i(e)))}function d(e){return c(n.decode(e))}function o(e){return r.from(n.encode(e))}e.exports={numberToBuffer:c,bufferToNumber:i,varintBufferEncode:f,varintBufferDecode:d,varintEncode:o}},20032:function(e,t,a){"use strict";const r=a(24070),n=a(23036).varintEncode,i={};for(const c in r){const e=r[c];i[c]=n(e)}e.exports=Object.freeze(i)},42786:function(e){"use strict";class t{constructor(e,t,a,r){this.name=e,this.code=t,this.alphabet=r,a&&r&&(this.engine=a(r))}encode(e){return this.engine.encode(e)}decode(e){return this.engine.decode(e)}isImplemented(){return this.engine}}e.exports=t},32133:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361);e.exports=function(e){return{encode(e){return"string"===typeof e?r.from(e).toString("hex"):e.toString("hex")},decode(t){for(const a of t)if(e.indexOf(a)<0)throw new Error("invalid base16 character");return r.from(t,"hex")}}}},22059:function(e,t,a){"use strict";function r(e,t){e=e.replace(new RegExp("=","g"),"");const a=e.length;let r=0,n=0,i=0;const c=new Uint8Array(5*a/8|0);for(let f=0;f=8&&(c[i++]=n>>>r-8&255,r-=8);return c.buffer}function n(e,t){const a=e.byteLength,r=new Uint8Array(e),n=t.indexOf("=")===t.length-1;n&&(t=t.substring(0,t.length-1));let i=0,c=0,f="";for(let d=0;d=5)f+=t[c>>>i-5&31],i-=5}if(i>0&&(f+=t[c<<5-i&31]),n)while(f.length%8!==0)f+="=";return f}a(48675),a(3462),a(21703),e.exports=function(e){return{encode(t){return n("string"===typeof t?Uint8Array.from(t):t,e)},decode(t){for(const a of t)if(e.indexOf(a)<0)throw new Error("invalid base32 character");return r(t,e)}}}},67557:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361);e.exports=function(e){const t=e.indexOf("=")>-1,a=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode(e){let n="";n="string"===typeof e?r.from(e).toString("base64"):e.toString("base64"),a&&(n=n.replace(/\+/g,"-").replace(/\//g,"_"));const i=n.indexOf("=");return i>0&&!t&&(n=n.substring(0,i)),n},decode(t){for(const a of t)if(e.indexOf(a)<0)throw new Error("invalid base64 character");return r.from(t,"base64")}}}},9005:function(e,t,a){"use strict";const r=a(42786),n=a(12516),i=a(32133),c=a(22059),f=a(67557),d=[["base1","1","","1"],["base2","0",n,"01"],["base8","7",n,"01234567"],["base10","9",n,"0123456789"],["base16","f",i,"0123456789abcdef"],["base32","b",c,"abcdefghijklmnopqrstuvwxyz234567"],["base32pad","c",c,"abcdefghijklmnopqrstuvwxyz234567="],["base32hex","v",c,"0123456789abcdefghijklmnopqrstuv"],["base32hexpad","t",c,"0123456789abcdefghijklmnopqrstuv="],["base32z","h",c,"ybndrfg8ejkmcpqxot1uwisza345h769"],["base58flickr","Z",n,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base58btc","z",n,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base64","m",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",f,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],o=d.reduce(((e,t)=>(e[t[0]]=new r(t[0],t[1],t[2],t[3]),e)),{}),s=d.reduce(((e,t)=>(e[t[1]]=o[t[0]],e)),{});e.exports={names:o,codes:s}},74482:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361),n=a(9005);function i(e,t){if(!t)throw new Error("requires an encoded buffer");const a=s(e),n=r.from(a.code),i=a.name;return o(i,t),r.concat([n,t])}function c(e,t){const a=s(e),n=a.name;return i(n,r.from(a.encode(t)))}function f(e){r.isBuffer(e)&&(e=e.toString());const t=e.substring(0,1);e=e.substring(1,e.length),"string"===typeof e&&(e=r.from(e));const a=s(t);return r.from(a.decode(e.toString()))}function d(e){if(r.isBuffer(e)&&(e=e.toString()),"[object String]"!==Object.prototype.toString.call(e))return!1;const t=e.substring(0,1);try{const e=s(t);return e.name}catch(a){return!1}}function o(e,t){const a=s(e);a.decode(t.toString())}function s(e){let t;if(n.names[e])t=n.names[e];else{if(!n.codes[e])throw new Error("Unsupported encoding");t=n.codes[e]}if(!t.isImplemented())throw new Error("Base "+e+" is not implemented yet");return t}t=e.exports=i,t.encode=c,t.decode=f,t.isEncoded=d,t.names=Object.freeze(Object.keys(n.names)),t.codes=Object.freeze(Object.keys(n.codes))},46742:function(e,t){"use strict";t.names=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"dbl-sha2-256":86,"sha3-224":23,"sha3-256":22,"sha3-384":21,"sha3-512":20,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,"murmur3-128":34,"murmur3-32":35,md4:212,md5:213,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"Skein256-8":45825,"Skein256-16":45826,"Skein256-24":45827,"Skein256-32":45828,"Skein256-40":45829,"Skein256-48":45830,"Skein256-56":45831,"Skein256-64":45832,"Skein256-72":45833,"Skein256-80":45834,"Skein256-88":45835,"Skein256-96":45836,"Skein256-104":45837,"Skein256-112":45838,"Skein256-120":45839,"Skein256-128":45840,"Skein256-136":45841,"Skein256-144":45842,"Skein256-152":45843,"Skein256-160":45844,"Skein256-168":45845,"Skein256-176":45846,"Skein256-184":45847,"Skein256-192":45848,"Skein256-200":45849,"Skein256-208":45850,"Skein256-216":45851,"Skein256-224":45852,"Skein256-232":45853,"Skein256-240":45854,"Skein256-248":45855,"Skein256-256":45856,"Skein512-8":45857,"Skein512-16":45858,"Skein512-24":45859,"Skein512-32":45860,"Skein512-40":45861,"Skein512-48":45862,"Skein512-56":45863,"Skein512-64":45864,"Skein512-72":45865,"Skein512-80":45866,"Skein512-88":45867,"Skein512-96":45868,"Skein512-104":45869,"Skein512-112":45870,"Skein512-120":45871,"Skein512-128":45872,"Skein512-136":45873,"Skein512-144":45874,"Skein512-152":45875,"Skein512-160":45876,"Skein512-168":45877,"Skein512-176":45878,"Skein512-184":45879,"Skein512-192":45880,"Skein512-200":45881,"Skein512-208":45882,"Skein512-216":45883,"Skein512-224":45884,"Skein512-232":45885,"Skein512-240":45886,"Skein512-248":45887,"Skein512-256":45888,"Skein512-264":45889,"Skein512-272":45890,"Skein512-280":45891,"Skein512-288":45892,"Skein512-296":45893,"Skein512-304":45894,"Skein512-312":45895,"Skein512-320":45896,"Skein512-328":45897,"Skein512-336":45898,"Skein512-344":45899,"Skein512-352":45900,"Skein512-360":45901,"Skein512-368":45902,"Skein512-376":45903,"Skein512-384":45904,"Skein512-392":45905,"Skein512-400":45906,"Skein512-408":45907,"Skein512-416":45908,"Skein512-424":45909,"Skein512-432":45910,"Skein512-440":45911,"Skein512-448":45912,"Skein512-456":45913,"Skein512-464":45914,"Skein512-472":45915,"Skein512-480":45916,"Skein512-488":45917,"Skein512-496":45918,"Skein512-504":45919,"Skein512-512":45920,"Skein1024-8":45921,"Skein1024-16":45922,"Skein1024-24":45923,"Skein1024-32":45924,"Skein1024-40":45925,"Skein1024-48":45926,"Skein1024-56":45927,"Skein1024-64":45928,"Skein1024-72":45929,"Skein1024-80":45930,"Skein1024-88":45931,"Skein1024-96":45932,"Skein1024-104":45933,"Skein1024-112":45934,"Skein1024-120":45935,"Skein1024-128":45936,"Skein1024-136":45937,"Skein1024-144":45938,"Skein1024-152":45939,"Skein1024-160":45940,"Skein1024-168":45941,"Skein1024-176":45942,"Skein1024-184":45943,"Skein1024-192":45944,"Skein1024-200":45945,"Skein1024-208":45946,"Skein1024-216":45947,"Skein1024-224":45948,"Skein1024-232":45949,"Skein1024-240":45950,"Skein1024-248":45951,"Skein1024-256":45952,"Skein1024-264":45953,"Skein1024-272":45954,"Skein1024-280":45955,"Skein1024-288":45956,"Skein1024-296":45957,"Skein1024-304":45958,"Skein1024-312":45959,"Skein1024-320":45960,"Skein1024-328":45961,"Skein1024-336":45962,"Skein1024-344":45963,"Skein1024-352":45964,"Skein1024-360":45965,"Skein1024-368":45966,"Skein1024-376":45967,"Skein1024-384":45968,"Skein1024-392":45969,"Skein1024-400":45970,"Skein1024-408":45971,"Skein1024-416":45972,"Skein1024-424":45973,"Skein1024-432":45974,"Skein1024-440":45975,"Skein1024-448":45976,"Skein1024-456":45977,"Skein1024-464":45978,"Skein1024-472":45979,"Skein1024-480":45980,"Skein1024-488":45981,"Skein1024-496":45982,"Skein1024-504":45983,"Skein1024-512":45984,"Skein1024-520":45985,"Skein1024-528":45986,"Skein1024-536":45987,"Skein1024-544":45988,"Skein1024-552":45989,"Skein1024-560":45990,"Skein1024-568":45991,"Skein1024-576":45992,"Skein1024-584":45993,"Skein1024-592":45994,"Skein1024-600":45995,"Skein1024-608":45996,"Skein1024-616":45997,"Skein1024-624":45998,"Skein1024-632":45999,"Skein1024-640":46e3,"Skein1024-648":46001,"Skein1024-656":46002,"Skein1024-664":46003,"Skein1024-672":46004,"Skein1024-680":46005,"Skein1024-688":46006,"Skein1024-696":46007,"Skein1024-704":46008,"Skein1024-712":46009,"Skein1024-720":46010,"Skein1024-728":46011,"Skein1024-736":46012,"Skein1024-744":46013,"Skein1024-752":46014,"Skein1024-760":46015,"Skein1024-768":46016,"Skein1024-776":46017,"Skein1024-784":46018,"Skein1024-792":46019,"Skein1024-800":46020,"Skein1024-808":46021,"Skein1024-816":46022,"Skein1024-824":46023,"Skein1024-832":46024,"Skein1024-840":46025,"Skein1024-848":46026,"Skein1024-856":46027,"Skein1024-864":46028,"Skein1024-872":46029,"Skein1024-880":46030,"Skein1024-888":46031,"Skein1024-896":46032,"Skein1024-904":46033,"Skein1024-912":46034,"Skein1024-920":46035,"Skein1024-928":46036,"Skein1024-936":46037,"Skein1024-944":46038,"Skein1024-952":46039,"Skein1024-960":46040,"Skein1024-968":46041,"Skein1024-976":46042,"Skein1024-984":46043,"Skein1024-992":46044,"Skein1024-1000":46045,"Skein1024-1008":46046,"Skein1024-1016":46047,"Skein1024-1024":46048}),t.codes=Object.freeze({0:"identity",17:"sha1",18:"sha2-256",19:"sha2-512",86:"dbl-sha2-256",23:"sha3-224",22:"sha3-256",21:"sha3-384",20:"sha3-512",24:"shake-128",25:"shake-256",26:"keccak-224",27:"keccak-256",28:"keccak-384",29:"keccak-512",34:"murmur3-128",35:"murmur3-32",212:"md4",213:"md5",45569:"blake2b-8",45570:"blake2b-16",45571:"blake2b-24",45572:"blake2b-32",45573:"blake2b-40",45574:"blake2b-48",45575:"blake2b-56",45576:"blake2b-64",45577:"blake2b-72",45578:"blake2b-80",45579:"blake2b-88",45580:"blake2b-96",45581:"blake2b-104",45582:"blake2b-112",45583:"blake2b-120",45584:"blake2b-128",45585:"blake2b-136",45586:"blake2b-144",45587:"blake2b-152",45588:"blake2b-160",45589:"blake2b-168",45590:"blake2b-176",45591:"blake2b-184",45592:"blake2b-192",45593:"blake2b-200",45594:"blake2b-208",45595:"blake2b-216",45596:"blake2b-224",45597:"blake2b-232",45598:"blake2b-240",45599:"blake2b-248",45600:"blake2b-256",45601:"blake2b-264",45602:"blake2b-272",45603:"blake2b-280",45604:"blake2b-288",45605:"blake2b-296",45606:"blake2b-304",45607:"blake2b-312",45608:"blake2b-320",45609:"blake2b-328",45610:"blake2b-336",45611:"blake2b-344",45612:"blake2b-352",45613:"blake2b-360",45614:"blake2b-368",45615:"blake2b-376",45616:"blake2b-384",45617:"blake2b-392",45618:"blake2b-400",45619:"blake2b-408",45620:"blake2b-416",45621:"blake2b-424",45622:"blake2b-432",45623:"blake2b-440",45624:"blake2b-448",45625:"blake2b-456",45626:"blake2b-464",45627:"blake2b-472",45628:"blake2b-480",45629:"blake2b-488",45630:"blake2b-496",45631:"blake2b-504",45632:"blake2b-512",45633:"blake2s-8",45634:"blake2s-16",45635:"blake2s-24",45636:"blake2s-32",45637:"blake2s-40",45638:"blake2s-48",45639:"blake2s-56",45640:"blake2s-64",45641:"blake2s-72",45642:"blake2s-80",45643:"blake2s-88",45644:"blake2s-96",45645:"blake2s-104",45646:"blake2s-112",45647:"blake2s-120",45648:"blake2s-128",45649:"blake2s-136",45650:"blake2s-144",45651:"blake2s-152",45652:"blake2s-160",45653:"blake2s-168",45654:"blake2s-176",45655:"blake2s-184",45656:"blake2s-192",45657:"blake2s-200",45658:"blake2s-208",45659:"blake2s-216",45660:"blake2s-224",45661:"blake2s-232",45662:"blake2s-240",45663:"blake2s-248",45664:"blake2s-256",45825:"Skein256-8",45826:"Skein256-16",45827:"Skein256-24",45828:"Skein256-32",45829:"Skein256-40",45830:"Skein256-48",45831:"Skein256-56",45832:"Skein256-64",45833:"Skein256-72",45834:"Skein256-80",45835:"Skein256-88",45836:"Skein256-96",45837:"Skein256-104",45838:"Skein256-112",45839:"Skein256-120",45840:"Skein256-128",45841:"Skein256-136",45842:"Skein256-144",45843:"Skein256-152",45844:"Skein256-160",45845:"Skein256-168",45846:"Skein256-176",45847:"Skein256-184",45848:"Skein256-192",45849:"Skein256-200",45850:"Skein256-208",45851:"Skein256-216",45852:"Skein256-224",45853:"Skein256-232",45854:"Skein256-240",45855:"Skein256-248",45856:"Skein256-256",45857:"Skein512-8",45858:"Skein512-16",45859:"Skein512-24",45860:"Skein512-32",45861:"Skein512-40",45862:"Skein512-48",45863:"Skein512-56",45864:"Skein512-64",45865:"Skein512-72",45866:"Skein512-80",45867:"Skein512-88",45868:"Skein512-96",45869:"Skein512-104",45870:"Skein512-112",45871:"Skein512-120",45872:"Skein512-128",45873:"Skein512-136",45874:"Skein512-144",45875:"Skein512-152",45876:"Skein512-160",45877:"Skein512-168",45878:"Skein512-176",45879:"Skein512-184",45880:"Skein512-192",45881:"Skein512-200",45882:"Skein512-208",45883:"Skein512-216",45884:"Skein512-224",45885:"Skein512-232",45886:"Skein512-240",45887:"Skein512-248",45888:"Skein512-256",45889:"Skein512-264",45890:"Skein512-272",45891:"Skein512-280",45892:"Skein512-288",45893:"Skein512-296",45894:"Skein512-304",45895:"Skein512-312",45896:"Skein512-320",45897:"Skein512-328",45898:"Skein512-336",45899:"Skein512-344",45900:"Skein512-352",45901:"Skein512-360",45902:"Skein512-368",45903:"Skein512-376",45904:"Skein512-384",45905:"Skein512-392",45906:"Skein512-400",45907:"Skein512-408",45908:"Skein512-416",45909:"Skein512-424",45910:"Skein512-432",45911:"Skein512-440",45912:"Skein512-448",45913:"Skein512-456",45914:"Skein512-464",45915:"Skein512-472",45916:"Skein512-480",45917:"Skein512-488",45918:"Skein512-496",45919:"Skein512-504",45920:"Skein512-512",45921:"Skein1024-8",45922:"Skein1024-16",45923:"Skein1024-24",45924:"Skein1024-32",45925:"Skein1024-40",45926:"Skein1024-48",45927:"Skein1024-56",45928:"Skein1024-64",45929:"Skein1024-72",45930:"Skein1024-80",45931:"Skein1024-88",45932:"Skein1024-96",45933:"Skein1024-104",45934:"Skein1024-112",45935:"Skein1024-120",45936:"Skein1024-128",45937:"Skein1024-136",45938:"Skein1024-144",45939:"Skein1024-152",45940:"Skein1024-160",45941:"Skein1024-168",45942:"Skein1024-176",45943:"Skein1024-184",45944:"Skein1024-192",45945:"Skein1024-200",45946:"Skein1024-208",45947:"Skein1024-216",45948:"Skein1024-224",45949:"Skein1024-232",45950:"Skein1024-240",45951:"Skein1024-248",45952:"Skein1024-256",45953:"Skein1024-264",45954:"Skein1024-272",45955:"Skein1024-280",45956:"Skein1024-288",45957:"Skein1024-296",45958:"Skein1024-304",45959:"Skein1024-312",45960:"Skein1024-320",45961:"Skein1024-328",45962:"Skein1024-336",45963:"Skein1024-344",45964:"Skein1024-352",45965:"Skein1024-360",45966:"Skein1024-368",45967:"Skein1024-376",45968:"Skein1024-384",45969:"Skein1024-392",45970:"Skein1024-400",45971:"Skein1024-408",45972:"Skein1024-416",45973:"Skein1024-424",45974:"Skein1024-432",45975:"Skein1024-440",45976:"Skein1024-448",45977:"Skein1024-456",45978:"Skein1024-464",45979:"Skein1024-472",45980:"Skein1024-480",45981:"Skein1024-488",45982:"Skein1024-496",45983:"Skein1024-504",45984:"Skein1024-512",45985:"Skein1024-520",45986:"Skein1024-528",45987:"Skein1024-536",45988:"Skein1024-544",45989:"Skein1024-552",45990:"Skein1024-560",45991:"Skein1024-568",45992:"Skein1024-576",45993:"Skein1024-584",45994:"Skein1024-592",45995:"Skein1024-600",45996:"Skein1024-608",45997:"Skein1024-616",45998:"Skein1024-624",45999:"Skein1024-632",46e3:"Skein1024-640",46001:"Skein1024-648",46002:"Skein1024-656",46003:"Skein1024-664",46004:"Skein1024-672",46005:"Skein1024-680",46006:"Skein1024-688",46007:"Skein1024-696",46008:"Skein1024-704",46009:"Skein1024-712",46010:"Skein1024-720",46011:"Skein1024-728",46012:"Skein1024-736",46013:"Skein1024-744",46014:"Skein1024-752",46015:"Skein1024-760",46016:"Skein1024-768",46017:"Skein1024-776",46018:"Skein1024-784",46019:"Skein1024-792",46020:"Skein1024-800",46021:"Skein1024-808",46022:"Skein1024-816",46023:"Skein1024-824",46024:"Skein1024-832",46025:"Skein1024-840",46026:"Skein1024-848",46027:"Skein1024-856",46028:"Skein1024-864",46029:"Skein1024-872",46030:"Skein1024-880",46031:"Skein1024-888",46032:"Skein1024-896",46033:"Skein1024-904",46034:"Skein1024-912",46035:"Skein1024-920",46036:"Skein1024-928",46037:"Skein1024-936",46038:"Skein1024-944",46039:"Skein1024-952",46040:"Skein1024-960",46041:"Skein1024-968",46042:"Skein1024-976",46043:"Skein1024-984",46044:"Skein1024-992",46045:"Skein1024-1000",46046:"Skein1024-1008",46047:"Skein1024-1016",46048:"Skein1024-1024"}),t.defaultLengths=Object.freeze({17:20,18:32,19:64,86:32,23:28,22:32,21:48,20:64,24:32,25:64,26:28,27:32,28:48,29:64,34:32,45569:1,45570:2,45571:3,45572:4,45573:5,45574:6,45575:7,45576:8,45577:9,45578:10,45579:11,45580:12,45581:13,45582:14,45583:15,45584:16,45585:17,45586:18,45587:19,45588:20,45589:21,45590:22,45591:23,45592:24,45593:25,45594:26,45595:27,45596:28,45597:29,45598:30,45599:31,45600:32,45601:33,45602:34,45603:35,45604:36,45605:37,45606:38,45607:39,45608:40,45609:41,45610:42,45611:43,45612:44,45613:45,45614:46,45615:47,45616:48,45617:49,45618:50,45619:51,45620:52,45621:53,45622:54,45623:55,45624:56,45625:57,45626:58,45627:59,45628:60,45629:61,45630:62,45631:63,45632:64,45633:1,45634:2,45635:3,45636:4,45637:5,45638:6,45639:7,45640:8,45641:9,45642:10,45643:11,45644:12,45645:13,45646:14,45647:15,45648:16,45649:17,45650:18,45651:19,45652:20,45653:21,45654:22,45655:23,45656:24,45657:25,45658:26,45659:27,45660:28,45661:29,45662:30,45663:31,45664:32,45825:1,45826:2,45827:3,45828:4,45829:5,45830:6,45831:7,45832:8,45833:9,45834:10,45835:11,45836:12,45837:13,45838:14,45839:15,45840:16,45841:17,45842:18,45843:19,45844:20,45845:21,45846:22,45847:23,45848:24,45849:25,45850:26,45851:27,45852:28,45853:29,45854:30,45855:31,45856:32,45857:1,45858:2,45859:3,45860:4,45861:5,45862:6,45863:7,45864:8,45865:9,45866:10,45867:11,45868:12,45869:13,45870:14,45871:15,45872:16,45873:17,45874:18,45875:19,45876:20,45877:21,45878:22,45879:23,45880:24,45881:25,45882:26,45883:27,45884:28,45885:29,45886:30,45887:31,45888:32,45889:33,45890:34,45891:35,45892:36,45893:37,45894:38,45895:39,45896:40,45897:41,45898:42,45899:43,45900:44,45901:45,45902:46,45903:47,45904:48,45905:49,45906:50,45907:51,45908:52,45909:53,45910:54,45911:55,45912:56,45913:57,45914:58,45915:59,45916:60,45917:61,45918:62,45919:63,45920:64,45921:1,45922:2,45923:3,45924:4,45925:5,45926:6,45927:7,45928:8,45929:9,45930:10,45931:11,45932:12,45933:13,45934:14,45935:15,45936:16,45937:17,45938:18,45939:19,45940:20,45941:21,45942:22,45943:23,45944:24,45945:25,45946:26,45947:27,45948:28,45949:29,45950:30,45951:31,45952:32,45953:33,45954:34,45955:35,45956:36,45957:37,45958:38,45959:39,45960:40,45961:41,45962:42,45963:43,45964:44,45965:45,45966:46,45967:47,45968:48,45969:49,45970:50,45971:51,45972:52,45973:53,45974:54,45975:55,45976:56,45977:57,45978:58,45979:59,45980:60,45981:61,45982:62,45983:63,45984:64,45985:65,45986:66,45987:67,45988:68,45989:69,45990:70,45991:71,45992:72,45993:73,45994:74,45995:75,45996:76,45997:77,45998:78,45999:79,46e3:80,46001:81,46002:82,46003:83,46004:84,46005:85,46006:86,46007:87,46008:88,46009:89,46010:90,46011:91,46012:92,46013:93,46014:94,46015:95,46016:96,46017:97,46018:98,46019:99,46020:100,46021:101,46022:102,46023:103,46024:104,46025:105,46026:106,46027:107,46028:108,46029:109,46030:110,46031:111,46032:112,46033:113,46034:114,46035:115,46036:116,46037:117,46038:118,46039:119,46040:120,46041:121,46042:122,46043:123,46044:124,46045:125,46046:126,46047:127,46048:128})},21272:function(e,t,a){"use strict";a(21703);const{Buffer:r}=a(15361),n=a(74482),i=a(42611),c=a(46742);function f(e){t.decode(e)}t.names=c.names,t.codes=c.codes,t.defaultLengths=c.defaultLengths,t.toHexString=function(e){if(!r.isBuffer(e))throw new Error("must be passed a buffer");return e.toString("hex")},t.fromHexString=function(e){return r.from(e,"hex")},t.toB58String=function(e){if(!r.isBuffer(e))throw new Error("must be passed a buffer");return n.encode("base58btc",e).toString().slice(1)},t.fromB58String=function(e){let t=e;return r.isBuffer(e)&&(t=e.toString()),n.decode("z"+t)},t.decode=function(e){if(!r.isBuffer(e))throw new Error("multihash must be a Buffer");if(e.length<2)throw new Error("multihash too short. must be > 2 bytes.");const a=i.decode(e);if(!t.isValidCode(a))throw new Error(`multihash unknown function code: 0x${a.toString(16)}`);e=e.slice(i.decode.bytes);const n=i.decode(e);if(n<0)throw new Error(`multihash invalid length: ${n}`);if(e=e.slice(i.decode.bytes),e.length!==n)throw new Error(`multihash length inconsistent: 0x${e.toString("hex")}`);return{code:a,name:c.codes[a],length:n,digest:e}},t.encode=function(e,a,n){if(!e||void 0===a)throw new Error("multihash encode requires at least two args: digest, code");const c=t.coerceCode(a);if(!r.isBuffer(e))throw new Error("digest should be a Buffer");if(null==n&&(n=e.length),n&&e.length!==n)throw new Error("digest length should be equal to specified length.");return r.concat([r.from(i.encode(c)),r.from(i.encode(n)),e])},t.coerceCode=function(e){let a=e;if("string"===typeof e){if(void 0===c.names[e])throw new Error(`Unrecognized hash function named: ${e}`);a=c.names[e]}if("number"!==typeof a)throw new Error(`Hash function code should be a number. Got: ${a}`);if(void 0===c.codes[a]&&!t.isAppCode(a))throw new Error(`Unrecognized function code: ${a}`);return a},t.isAppCode=function(e){return e>0&&e<16},t.isValidCode=function(e){return!!t.isAppCode(e)||!!c.codes[e]},t.validate=f,t.prefix=function(e){return f(e),e.slice(0,2)}},5460:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c=a(15361).Buffer}catch(S){}function f(e,t,a){for(var r=0,n=Math.min(e.length,a),i=t;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return r}function d(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&n++,16===t?this._parseHex(e,n):this._parseBase(e,t,n),"-"===e[0]&&(this.negative=1),this.strip(),"le"===a&&this._initArray(this.toArray(),t,a)},i.prototype._initNumber=function(e,t,a){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===a&&this._initArray(this.toArray(),t,a)},i.prototype._initArray=function(e,t,a){if(r("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=6)n=f(e,a,a+6),this.words[r]|=n<>>26-i&4194303,i+=24,i>=26&&(i-=26,r++);a+6!==t&&(n=f(e,t,a+6),this.words[r]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,o=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var o=["","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"],s=[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],b=[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];function u(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function h(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?o[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var u=s[e],h=b[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:o[u-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function p(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function x(e,t,a){var r=new m;return r.mulp(e,t,a)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?p(this,e,t):x(this,e,t),a},m.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},m.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=u(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new k(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):a.strip(),a},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new w;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return g[e]=t,t},k.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},k.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new A(e)},n(A,k),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},A.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},70594:function(e,t,a){a(21703);var r=a(5460),n=a(99468);e.exports=function(e){if("string"===typeof e||"number"===typeof e){var t=new r(1),a=String(e).toLowerCase().trim(),i="0x"===a.substr(0,2)||"-0x"===a.substr(0,3),c=n(a);if("-"===c.substr(0,1)&&(c=n(c.slice(1)),t=new r(-1,10)),c=""===c?"0":c,!c.match(/^-?[0-9]+$/)&&c.match(/^[0-9A-Fa-f]+$/)||c.match(/^[a-fA-F]+$/)||!0===i&&c.match(/^[0-9A-Fa-f]+$/))return new r(c,16).mul(t);if((c.match(/^-?[0-9]+$/)||""===c)&&!1===i)return new r(c,10).mul(t)}else if("object"===typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new r(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},67293:function(e,t,a){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */a(21703);var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function c(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function f(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},a=0;a<10;a++)t["_"+String.fromCharCode(a)]=a;var r=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==r.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}e.exports=f()?Object.assign:function(e,t){for(var a,f,d=c(e),o=1;os&&(V("Max buffer length exceeded: textNode"),e=Math.max(e,i.length)),N.length>s&&(V("Max buffer length exceeded: numberNode"),e=Math.max(e,N.length)),O=s-e+z}function V(e){void 0!==i&&(f(i),d(),i=void 0),t=Error(e+"\nLn: "+Z+"\nCol: "+K+"\nChr: "+a),o(Object(r["o"])(void 0,void 0,t))}function W(){if(j===h)return f({}),d(),void(L=!0);j===l&&0===H||V("Unexpected end"),void 0!==i&&(f(i),d(),i=void 0),L=!0}function J(e){return"\r"===e||"\n"===e||" "===e||"\t"===e}function X(e){if(!t){if(L)return V("Cannot write after close");var r=0;a=e[0];while(a){if(r>0&&(n=a),a=e[r++],!a)break;switch(z++,"\n"===a?(Z++,K=0):K++,j){case h:if("{"===a)j=p;else if("["===a)j=m;else if(!J(a))return V("Non-whitespace before {[.");continue;case y:case p:if(J(a))continue;if(j===y)q.push(w);else{if("}"===a){f({}),d(),j=q.pop()||l;continue}q.push(x)}if('"'!==a)return V('Malformed object key should start with " ');j=v;continue;case w:case x:if(J(a))continue;if(":"===a)j===x?(q.push(x),void 0!==i&&(f({}),c(i),i=void 0),H++):void 0!==i&&(c(i),i=void 0),j=l;else if("}"===a)void 0!==i&&(f(i),d(),i=void 0),d(),H--,j=q.pop()||l;else{if(","!==a)return V("Bad object");j===x&&q.push(x),void 0!==i&&(f(i),d(),i=void 0),j=y}continue;case m:case l:if(J(a))continue;if(j===m){if(f([]),H++,j=l,"]"===a){d(),H--,j=q.pop()||l;continue}q.push(g)}if('"'===a)j=v;else if("{"===a)j=p;else if("["===a)j=m;else if("t"===a)j=M;else if("f"===a)j=A;else if("n"===a)j=T;else if("-"===a)N+=a;else if("0"===a)N+=a,j=R;else{if(-1==="123456789".indexOf(a))return V("Bad value");N+=a,j=R}continue;case g:if(","===a)q.push(g),void 0!==i&&(f(i),d(),i=void 0),j=l;else{if("]"!==a){if(J(a))continue;return V("Bad array")}void 0!==i&&(f(i),d(),i=void 0),d(),H--,j=q.pop()||l}continue;case v:void 0===i&&(i="");var o=r-1;e:while(1){while(D>0)if(F+=a,a=e.charAt(r++),4===D?(i+=String.fromCharCode(parseInt(F,16)),D=0,o=r-1):D++,!a)break e;if('"'===a&&!U){j=q.pop()||l,i+=e.substring(o,r-1);break}if("\\"===a&&!U&&(U=!0,i+=e.substring(o,r-1),a=e.charAt(r++),!a))break;if(U){if(U=!1,"n"===a?i+="\n":"r"===a?i+="\r":"t"===a?i+="\t":"f"===a?i+="\f":"b"===a?i+="\b":"u"===a?(D=1,F=""):i+=a,a=e.charAt(r++),o=r-1,a)continue;break}b.lastIndex=r;var s=b.exec(e);if(!s){r=e.length+1,i+=e.substring(o,r-1);break}if(r=s.index+1,a=e.charAt(s.index),!a){i+=e.substring(o,r-1);break}}continue;case M:if(!a)continue;if("r"!==a)return V("Invalid true started with t"+a);j=_;continue;case _:if(!a)continue;if("u"!==a)return V("Invalid true started with tr"+a);j=k;continue;case k:if(!a)continue;if("e"!==a)return V("Invalid true started with tru"+a);f(!0),d(),j=q.pop()||l;continue;case A:if(!a)continue;if("a"!==a)return V("Invalid false started with f"+a);j=S;continue;case S:if(!a)continue;if("l"!==a)return V("Invalid false started with fa"+a);j=E;continue;case E:if(!a)continue;if("s"!==a)return V("Invalid false started with fal"+a);j=B;continue;case B:if(!a)continue;if("e"!==a)return V("Invalid false started with fals"+a);f(!1),d(),j=q.pop()||l;continue;case T:if(!a)continue;if("u"!==a)return V("Invalid null started with n"+a);j=P;continue;case P:if(!a)continue;if("l"!==a)return V("Invalid null started with nu"+a);j=I;continue;case I:if(!a)continue;if("l"!==a)return V("Invalid null started with nul"+a);f(null),d(),j=q.pop()||l;continue;case C:if("."!==a)return V("Leading zero not followed by .");N+=a,j=R;continue;case R:if(-1!=="0123456789".indexOf(a))N+=a;else if("."===a){if(-1!==N.indexOf("."))return V("Invalid number has two dots");N+=a}else if("e"===a||"E"===a){if(-1!==N.indexOf("e")||-1!==N.indexOf("E"))return V("Invalid number has two exponential");N+=a}else if("+"===a||"-"===a){if("e"!==n&&"E"!==n)return V("Invalid symbol in number");N+=a}else N&&(f(parseFloat(N)),d(),N=""),r--,j=q.pop()||l;continue;default:return V("Unknown state: "+j)}}z>=O&&G()}}e(r["m"]).on(X),e(r["n"]).on(W)}},function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return o}));var r=a(19),n=a(3),i=a(2),c=a(20),f=a(0);function d(){return new XMLHttpRequest}function o(e,t,a,d,o,s,b){var u=e(n["m"]).emit,h=e(n["b"]).emit,l=0,p=!0;function x(){if("2"===String(t.status)[0]){var e=t.responseText,a=(" "+e.substr(l)).substr(1);a&&u(a),l=Object(i["e"])(e)}}function m(t){try{p&&e(n["c"]).emit(t.status,Object(c["a"])(t.getAllResponseHeaders())),p=!1}catch(a){}}e(n["a"]).on((function(){t.onreadystatechange=null,t.abort()})),"onprogress"in t&&(t.onprogress=x),t.onreadystatechange=function(){switch(t.readyState){case 2:case 3:return m(t);case 4:m(t);var a="2"===String(t.status)[0];a?(x(),e(n["n"]).emit()):h(Object(n["o"])(t.status,t.responseText))}};try{for(var g in t.open(a,d,!0),s)t.setRequestHeader(g,s[g]);Object(r["a"])(window.location,Object(r["b"])(d))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=b,t.send(o)}catch(v){window.setTimeout(Object(f["j"])(h,Object(n["o"])(void 0,void 0,v)),0)}}},function(e,t,a){"use strict";function r(e,t){function a(e){return{"http:":80,"https:":443}[e]}function r(t){return String(t.port||a(t.protocol||e.protocol))}return!!(t.protocol&&t.protocol!==e.protocol||t.host&&t.host!==e.host||t.host&&r(t)!==r(e))}function n(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,a=t.exec(e)||[];return{protocol:a[1]||"",host:a[2]||"",port:a[3]||""}}a.d(t,"a",(function(){return r})),a.d(t,"b",(function(){return n}))},function(e,t,a){"use strict";function r(e){var t={};return e&&e.split("\r\n").forEach((function(e){var a=e.indexOf(": ");t[e.substring(0,a)]=e.substring(a+2)})),t}a.d(t,"a",(function(){return r}))}])["default"]}))},15678:function(e,t,a){"use strict";var r=a(18625);t.certificate=a(89866);var n=r.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=n;var i=r.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=i;var c=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(f),this.key("subjectPublicKey").bitstr())}));t.PublicKey=c;var f=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),d=r.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(f),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=d;var o=r.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=o;var s=r.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=s,t.DSAparam=r.define("DSAparam",(function(){this.int()}));var b=r.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(u),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=b;var u=r.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=r.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},89866:function(e,t,a){"use strict";var r=a(18625),n=r.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),i=r.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),c=r.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),f=r.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(c),this.key("subjectPublicKey").bitstr())})),d=r.define("RelativeDistinguishedName",(function(){this.setof(i)})),o=r.define("RDNSequence",(function(){this.seqof(d)})),s=r.define("Name",(function(){this.choice({rdnSequence:this.use(o)})})),b=r.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),u=r.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),h=r.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(c),this.key("issuer").use(s),this.key("validity").use(b),this.key("subject").use(s),this.key("subjectPublicKeyInfo").use(f),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(u).optional())})),l=r.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(c),this.key("signatureValue").bitstr())}));e.exports=l},83311:function(e,t,a){var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,c=a(13692),f=a(24699),d=a(6779).Buffer;e.exports=function(e,t){var a,o=e.toString(),s=o.match(r);if(s){var b="aes"+s[1],u=d.from(s[2],"hex"),h=d.from(s[3].replace(/[\r\n]/g,""),"base64"),l=c(t,u.slice(0,8),parseInt(s[1],10)).key,p=[],x=f.createDecipheriv(b,l,u);p.push(x.update(h)),p.push(x.final()),a=d.concat(p)}else{var m=o.match(i);a=d.from(m[2].replace(/[\r\n]/g,""),"base64")}var g=o.match(n)[1];return{tag:g,data:a}}},2616:function(e,t,a){a(21703);var r=a(15678),n=a(22562),i=a(83311),c=a(24699),f=a(15043),d=a(6779).Buffer;function o(e){var t;"object"!==typeof e||d.isBuffer(e)||(t=e.passphrase,e=e.key),"string"===typeof e&&(e=d.from(e));var a,n,c=i(e,t),f=c.tag,o=c.data;switch(f){case"CERTIFICATE":n=r.certificate.decode(o,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(n||(n=r.PublicKey.decode(o,"der")),a=n.algorithm.algorithm.join("."),a){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(n.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return n.subjectPrivateKey=n.subjectPublicKey,{type:"ec",data:n};case"1.2.840.10040.4.1":return n.algorithm.params.pub_key=r.DSAparam.decode(n.subjectPublicKey.data,"der"),{type:"dsa",data:n.algorithm.params};default:throw new Error("unknown key id "+a)}case"ENCRYPTED PRIVATE KEY":o=r.EncryptedPrivateKey.decode(o,"der"),o=s(o,t);case"PRIVATE KEY":switch(n=r.PrivateKey.decode(o,"der"),a=n.algorithm.algorithm.join("."),a){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(n.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:n.algorithm.curve,privateKey:r.ECPrivateKey.decode(n.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return n.algorithm.params.priv_key=r.DSAparam.decode(n.subjectPrivateKey,"der"),{type:"dsa",params:n.algorithm.params};default:throw new Error("unknown key id "+a)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(o,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(o,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(o,"der")};case"EC PRIVATE KEY":return o=r.ECPrivateKey.decode(o,"der"),{curve:o.parameters.value,privateKey:o.privateKey};default:throw new Error("unknown key type "+f)}}function s(e,t){var a=e.algorithm.decrypt.kde.kdeparams.salt,r=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=n[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,s=e.subjectPrivateKey,b=parseInt(i.split("-")[1],10)/8,u=f.pbkdf2Sync(t,a,r,b,"sha1"),h=c.createDecipheriv(i,u,o),l=[];return l.push(h.update(s)),l.push(h.final()),d.concat(l)}e.exports=o,o.signature=r.signature},65177:function(e){var t=function(e){return e.replace(/^\s+|\s+$/g,"")},a=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};for(var r={},n=t(e).split("\n"),i=0;i=6?"utf-8":"binary"}else r="utf-8";e.exports=r},88369:function(e,t,a){a(21703);var r=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!==typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!==typeof t)throw new TypeError("Key length not a number");if(t<0||t>r||t!==t)throw new TypeError("Bad key length")}},26560:function(e,t,a){var r=a(56515),n=a(3128),i=a(61720),c=a(6779).Buffer,f=a(88369),d=a(53677),o=a(56816),s=c.alloc(128),b={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function u(e,t,a){var r=h(e),n="sha512"===e||"sha384"===e?128:64;t.length>n?t=r(t):t.lengthfunction(){const a=t.promiseModule,r=new Array(arguments.length);for(let e=0;e{t.errorFirst?r.push((function(e,r){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e{a=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},a);const r=e=>{const t=t=>"string"===typeof t?e===t:t.test(e);return a.include?a.include.some(t):!a.exclude.some(t)};let n;n="function"===typeof e?function(){return a.excludeMain?e.apply(this,arguments):t(e,a).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const i in e){const c=e[i];n[i]="function"===typeof c&&r(i)?t(c,a):c}return n}},45626:function(e,t,a){"use strict";a.r(t),a.d(t,{Children:function(){return ve},Component:function(){return v},Fragment:function(){return g},PureComponent:function(){return le},Suspense:function(){return Me},SuspenseList:function(){return Ae},cloneElement:function(){return De},createContext:function(){return q},createElement:function(){return p},createFactory:function(){return qe},createPortal:function(){return Te},createRef:function(){return m},default:function(){return Ze},findDOMNode:function(){return ze},forwardRef:function(){return me},hydrate:function(){return Re},isValidElement:function(){return Fe},lazy:function(){return ke},memo:function(){return pe},render:function(){return Ce},unmountComponentAtNode:function(){return He},unstable_batchedUpdates:function(){return Ke},useCallback:function(){return re},useContext:function(){return ne},useDebugValue:function(){return ie},useEffect:function(){return Q},useErrorBoundary:function(){return ce},useImperativeHandle:function(){return te},useLayoutEffect:function(){return $},useMemo:function(){return ae},useReducer:function(){return Y},useRef:function(){return ee},useState:function(){return X},version:function(){return je}});a(21703);var r,n,i,c,f,d,o,s={},b=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function h(e,t){for(var a in t)e[a]=t[a];return e}function l(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,a){var r,n=arguments,i={};for(r in t)"key"!==r&&"ref"!==r&&(i[r]=t[r]);if(arguments.length>3)for(a=[a],r=3;r2&&(t.children=b.slice.call(arguments,2)),a={},t)"key"!==r&&"ref"!==r&&(a[r]=t[r]);return x(e.type,a,t.key||e.key,t.ref||e.ref,null)}function q(e){var t={},a={__c:"__cC"+o++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n=this;return this.getChildContext||(r=[],this.getChildContext=function(){return t[a.__c]=n,t},this.shouldComponentUpdate=function(e){n.props.value!==e.value&&r.some((function(t){t.context=e.value,M(t)}))},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return a.Consumer.contextType=a,a.Provider.__=a,a}r={__e:function(e,t){for(var a,r;t=t.__;)if((a=t.__c)&&!a.__)try{if(a.constructor&&null!=a.constructor.getDerivedStateFromError&&(r=!0,a.setState(a.constructor.getDerivedStateFromError(e))),null!=a.componentDidCatch&&(r=!0,a.componentDidCatch(e)),r)return M(a.__E=a)}catch(t){e=t}throw e}},v.prototype.setState=function(e,t){var a;a=this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(a,this.props)),e&&h(a,e),null!=e&&this.__v&&(t&&this.__h.push(t),M(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},v.prototype.render=g,n=[],i=0,c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=s,o=0;var F,D,H,z=0,K=[],Z=r.__r,G=r.diffed,V=r.__c,W=r.unmount;function J(e,t){r.__h&&r.__h(D,e,z||t),z=0;var a=D.__H||(D.__H={__:[],__h:[]});return e>=a.__.length&&a.__.push({}),a.__[e]}function X(e){return z=1,Y(be,e)}function Y(e,t,a){var r=J(F++,2);return r.__c||(r.__c=D,r.__=[a?a(t):be(void 0,t),function(t){var a=e(r.__[0],t);r.__[0]!==a&&(r.__[0]=a,r.__c.setState({}))}]),r.__}function Q(e,t){var a=J(F++,3);!r.__s&&se(a.__H,t)&&(a.__=e,a.__H=t,D.__H.__h.push(a))}function $(e,t){var a=J(F++,4);!r.__s&&se(a.__H,t)&&(a.__=e,a.__H=t,D.__h.push(a))}function ee(e){return z=5,ae((function(){return{current:e}}),[])}function te(e,t,a){z=6,$((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==a?a:a.concat(e))}function ae(e,t){var a=J(F++,7);return se(a.__H,t)?(a.__H=t,a.__h=e,a.__=e()):a.__}function re(e,t){return z=8,ae((function(){return e}),t)}function ne(e){var t=D.context[e.__c],a=J(F++,9);return a.__c=e,t?(null==a.__&&(a.__=!0,t.sub(D)),t.props.value):e.__}function ie(e,t){r.useDebugValue&&r.useDebugValue(t?t(e):e)}function ce(e){var t=J(F++,10),a=X();return t.__=e,D.componentDidCatch||(D.componentDidCatch=function(e){t.__&&t.__(e),a[1](e)}),[a[0],function(){a[1](void 0)}]}function fe(){K.some((function(e){if(e.__P)try{e.__H.__h.forEach(de),e.__H.__h.forEach(oe),e.__H.__h=[]}catch(n){return e.__H.__h=[],r.__e(n,e.__v),!0}})),K=[]}function de(e){e.t&&e.t()}function oe(e){var t=e.__();"function"==typeof t&&(e.t=t)}function se(e,t){return!e||t.some((function(t,a){return t!==e[a]}))}function be(e,t){return"function"==typeof t?t(e):t}function ue(e,t){for(var a in t)e[a]=t[a];return e}function he(e,t){for(var a in e)if("__source"!==a&&!(a in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}r.__r=function(e){Z&&Z(e),F=0,(D=e.__c).__H&&(D.__H.__h.forEach(de),D.__H.__h.forEach(oe),D.__H.__h=[])},r.diffed=function(e){G&&G(e);var t=e.__c;if(t){var a=t.__H;a&&a.__h.length&&(1!==K.push(t)&&H===r.requestAnimationFrame||((H=r.requestAnimationFrame)||function(e){var t,a=function(){clearTimeout(r),cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(a,100);"undefined"!=typeof window&&(t=requestAnimationFrame(a))})(fe))}},r.__c=function(e,t){t.some((function(e){try{e.__h.forEach(de),e.__h=e.__h.filter((function(e){return!e.__||oe(e)}))}catch(f){t.some((function(e){e.__h&&(e.__h=[])})),t=[],r.__e(f,e.__v)}})),V&&V(e,t)},r.unmount=function(e){W&&W(e);var t=e.__c;if(t){var a=t.__H;if(a)try{a.__.forEach((function(e){return e.t&&e.t()}))}catch(e){r.__e(e,t.__v)}}};var le=function(e){var t,a;function r(t){var a;return(a=e.call(this,t)||this).isPureReactComponent=!0,a}return a=e,(t=r).prototype=Object.create(a.prototype),t.prototype.constructor=t,t.__proto__=a,r.prototype.shouldComponentUpdate=function(e,t){return he(this.props,e)||he(this.state,t)},r}(v);function pe(e,t){function a(e){var a=this.props.ref,r=a==e.ref;return!r&&a&&(a.call?a(null):a.current=null),t?!t(this.props,e)||!r:he(this.props,e)}function r(t){return this.shouldComponentUpdate=a,p(e,ue({},t))}return r.prototype.isReactComponent=!0,r.displayName="Memo("+(e.displayName||e.name)+")",r.t=!0,r}var xe=r.__b;function me(e){function t(t){var a=ue({},t);return delete a.ref,e(a,t.ref)}return t.prototype.isReactComponent=t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}r.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),xe&&xe(e)};var ge=function(e,t){return e?A(e).reduce((function(e,a,r){return e.concat(t(a,r))}),[]):null},ve={map:ge,forEach:ge,count:function(e){return e?A(e).length:0},only:function(e){if(1!==(e=A(e)).length)throw new Error("Children.only() expects only one child.");return e[0]},toArray:A},ye=r.__e;function we(e){return e&&((e=ue({},e)).__c=null,e.__k=e.__k&&e.__k.map(we)),e}function Me(){this.__u=0,this.o=null,this.__b=null}function _e(e){var t=e.__.__c;return t&&t.u&&t.u(e)}function ke(e){var t,a,r;function n(n){if(t||(t=e()).then((function(e){a=e.default||e}),(function(e){r=e})),r)throw r;if(!a)throw t;return p(a,n)}return n.displayName="Lazy",n.t=!0,n}function Ae(){this.i=null,this.l=null}r.__e=function(e,t,a){if(e.then)for(var r,n=t;n=n.__;)if((r=n.__c)&&r.__c)return r.__c(e,t.__c);ye(e,t,a)},(Me.prototype=new v).__c=function(e,t){var a=this;null==a.o&&(a.o=[]),a.o.push(t);var r=_e(a.__v),n=!1,i=function(){n||(n=!0,r?r(c):c())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){i(),t.__c&&t.__c()};var c=function(){var e;if(!--a.__u)for(a.__v.__k[0]=a.state.u,a.setState({u:a.__b=null});e=a.o.pop();)e.forceUpdate()};a.__u++||a.setState({u:a.__b=a.__v.__k[0]}),e.then(i,i)},Me.prototype.render=function(e,t){return this.__b&&(this.__v.__k[0]=we(this.__b),this.__b=null),[p(v,null,t.u?null:e.children),t.u&&e.fallback]};var Se=function(e,t,a){if(++a[1]===a[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(a=e.i;a;){for(;a.length>3;)a.pop()();if(a[1]=t.length){i++;break}var c=t.slice(2,n-1);if(("0002"!==r.toString("hex")&&!a||"0001"!==r.toString("hex")&&a)&&i++,c.length<8&&i++,i)throw new Error("decryption error");return t.slice(n)}function h(e,t){e=s.from(e),t=s.from(t);var a=0,r=e.length;e.length!==t.length&&(a++,r=Math.min(e.length,t.length));var n=-1;while(++nh||new c(t).cmp(d.modulus)>=0)throw new Error("decryption error");i=a?o(new c(t),d):f(t,d);var l=s.alloc(h-i.length);if(i=s.concat([l,i],h),4===n)return b(d,i);if(1===n)return u(d,i,a);if(3===n)return i;throw new Error("unknown padding")}},48936:function(e,t,a){a(21703);var r=a(2616),n=a(67602),i=a(65443),c=a(96884),f=a(98479),d=a(2396),o=a(74466),s=a(28593),b=a(6779).Buffer;function u(e,t){var a=e.modulus.byteLength(),r=t.length,o=i("sha1").update(b.alloc(0)).digest(),s=o.length,u=2*s;if(r>a-u-2)throw new Error("message too long");var h=b.alloc(a-r-u-2),l=a-s-1,p=n(s),x=f(b.concat([o,h,b.alloc(1,1),t],l),c(p,l)),m=f(p,c(x,s));return new d(b.concat([b.alloc(1),m,x],a))}function h(e,t,a){var r,n=t.length,i=e.modulus.byteLength();if(n>i-11)throw new Error("message too long");return r=a?b.alloc(i-n-3,255):l(i-n-3),new d(b.concat([b.from([0,a?1:2]),r,b.alloc(1),t],i))}function l(e){var t,a=b.allocUnsafe(e),r=0,i=n(2*e),c=0;while(r=0)throw new Error("data too long for modulus")}return a?s(i,c):o(i,c)}},74466:function(e,t,a){var r=a(2396),n=a(6779).Buffer;function i(e,t){return n.from(e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed().toArray())}e.exports=i},98479:function(e){e.exports=function(e,t){var a=e.length,r=-1;while(++r>>7-e%8&1)},put:function(e,t){for(var a=0;a>>t-a-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},83880:function(e,t,a){a(21703);var r=a(73385);function n(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=r.alloc(e*e),this.reservedBit=r.alloc(e*e)}n.prototype.set=function(e,t,a,r){var n=e*this.size+t;this.data[n]=a,r&&(this.reservedBit[n]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,a){this.data[e*this.size+t]^=a},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=n},7591:function(e,t,a){var r=a(73385),n=a(15461);function i(e){this.mode=n.BYTE,this.data=r.from(e)}i.getBitsLength=function(e){return 8*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){for(var t=0,a=this.data.length;t=0&&e.bit<4},t.from=function(e,a){if(t.isValid(e))return e;try{return r(e)}catch(n){return a}}},13375:function(e,t,a){var r=a(14288).getSymbolSize,n=7;t.getPositions=function(e){var t=r(e);return[[0,0],[t-n,0],[0,t-n]]}},57874:function(e,t,a){var r=a(14288),n=1335,i=21522,c=r.getBCHDigit(n);t.getEncodedBits=function(e,t){var a=e.bit<<3|t,f=a<<10;while(r.getBCHDigit(f)-c>=0)f^=n<=33088&&a<=40956)a-=33088;else{if(!(a>=57408&&a<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");a-=49472}a=192*(a>>>8&255)+(255&a),e.put(a,13)}},e.exports=i},1840:function(e,t,a){a(21703),t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var r={N1:3,N2:3,N3:40,N4:10};function n(e,a,r){switch(e){case t.Patterns.PATTERN000:return(a+r)%2===0;case t.Patterns.PATTERN001:return a%2===0;case t.Patterns.PATTERN010:return r%3===0;case t.Patterns.PATTERN011:return(a+r)%3===0;case t.Patterns.PATTERN100:return(Math.floor(a/2)+Math.floor(r/3))%2===0;case t.Patterns.PATTERN101:return a*r%2+a*r%3===0;case t.Patterns.PATTERN110:return(a*r%2+a*r%3)%2===0;case t.Patterns.PATTERN111:return(a*r%3+(a+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){for(var t=e.size,a=0,n=0,i=0,c=null,f=null,d=0;d=5&&(a+=r.N1+(n-5)),c=s,n=1),s=e.get(o,d),s===f?i++:(i>=5&&(a+=r.N1+(i-5)),f=s,i=1)}n>=5&&(a+=r.N1+(n-5)),i>=5&&(a+=r.N1+(i-5))}return a},t.getPenaltyN2=function(e){for(var t=e.size,a=0,n=0;n=10&&(1488===n||93===n)&&a++,i=i<<1&2047|e.get(f,c),f>=10&&(1488===i||93===i)&&a++}return a*r.N3},t.getPenaltyN4=function(e){for(var t=0,a=e.data.length,n=0;n=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,a){if(t.isValid(e))return e;try{return i(e)}catch(r){return a}}},39186:function(e,t,a){var r=a(15461);function n(e){this.mode=r.NUMERIC,this.data=e.toString()}n.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){var t,a,r;for(t=0;t+3<=this.data.length;t+=3)a=this.data.substr(t,3),r=parseInt(a,10),e.put(r,10);var n=this.data.length-t;n>0&&(a=this.data.substr(t),r=parseInt(a,10),e.put(r,3*n+1))},e.exports=n},30823:function(e,t,a){var r=a(73385),n=a(17512);t.mul=function(e,t){for(var a=r.alloc(e.length+t.length-1),i=0;i=0){for(var i=a[0],c=0;c=0&&f<=6&&(0===d||6===d)||d>=0&&d<=6&&(0===f||6===f)||f>=2&&f<=4&&d>=2&&d<=4?e.set(i+f,c+d,!0,!0):e.set(i+f,c+d,!1,!0))}function v(e){for(var t=e.size,a=8;a>f&1),e.set(a,r,n,!0),e.set(r,a,n,!0)}function M(e,t,a){var r,n,i=e.size,c=l.getEncodedBits(t,a);for(r=0;r<15;r++)n=1===(c>>r&1),r<6?e.set(r,8,n,!0):r<8?e.set(r+1,8,n,!0):e.set(i-15+r,8,n,!0),r<8?e.set(8,i-r-1,n,!0):r<9?e.set(8,15-r-1+1,n,!0):e.set(8,15-r-1,n,!0);e.set(i-8,8,1,!0)}function _(e,t){for(var a=e.size,r=-1,n=a-1,i=7,c=0,f=a-1;f>0;f-=2){6===f&&f--;while(1){for(var d=0;d<2;d++)if(!e.isReserved(n,f-d)){var o=!1;c>>i&1)),e.set(n,f-d,o),i--,-1===i&&(c++,i=7)}if(n+=r,n<0||a<=n){n-=r,r=-r;break}}}}function k(e,t,a){var r=new c;a.forEach((function(t){r.put(t.mode.bit,4),r.put(t.getLength(),p.getCharCountIndicator(t.mode,e)),t.write(r)}));var i=n.getSymbolTotalCodewords(e),f=b.getTotalCodewordsCount(e,t),d=8*(i-f);r.getLengthInBits()+4<=d&&r.put(0,4);while(r.getLengthInBits()%8!==0)r.putBit(0);for(var o=(d-r.getLengthInBits())/8,s=0;s=7&&w(l,t),_(l,b),isNaN(r)&&(r=s.getBestMask(l,M.bind(null,l,a))),s.applyMask(r,l),M(l,a,r),{modules:l,version:t,errorCorrectionLevel:a,maskPattern:r,segments:i}}t.create=function(e,t){if("undefined"===typeof e||""===e)throw new Error("No input text");var a,r,c=i.M;return"undefined"!==typeof t&&(c=i.from(t.errorCorrectionLevel,i.M),a=h.from(t.version),r=s.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),S(e,a,c,r)}},14365:function(e,t,a){a(21703);var r=a(73385),n=a(30823),i=a(15361).Buffer;function c(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}c.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},c.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=r.alloc(this.degree),a=i.concat([e,t],e.length+this.degree),c=n.mod(a,this.genPoly),f=this.degree-c.length;if(f>0){var d=r.alloc(this.degree);return c.copy(d,f),d}return c},e.exports=c},3555:function(e,t){var a="[0-9]+",r="[A-Z $%*+\\-./:]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");var i="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";t.KANJI=new RegExp(n,"g"),t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=new RegExp(i,"g"),t.NUMERIC=new RegExp(a,"g"),t.ALPHANUMERIC=new RegExp(r,"g");var c=new RegExp("^"+n+"$"),f=new RegExp("^"+a+"$"),d=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return c.test(e)},t.testNumeric=function(e){return f.test(e)},t.testAlphanumeric=function(e){return d.test(e)}},58439:function(e,t,a){a(21703);var r=a(15461),n=a(39186),i=a(6355),c=a(7591),f=a(59176),d=a(3555),o=a(14288),s=a(98716);function b(e){return unescape(encodeURIComponent(e)).length}function u(e,t,a){var r,n=[];while(null!==(r=e.exec(a)))n.push({data:r[0],index:r.index,mode:t,length:r[0].length});return n}function h(e){var t,a,n=u(d.NUMERIC,r.NUMERIC,e),i=u(d.ALPHANUMERIC,r.ALPHANUMERIC,e);o.isKanjiModeEnabled()?(t=u(d.BYTE,r.BYTE,e),a=u(d.KANJI,r.KANJI,e)):(t=u(d.BYTE_KANJI,r.BYTE,e),a=[]);var c=n.concat(i,t,a);return c.sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function l(e,t){switch(t){case r.NUMERIC:return n.getBitsLength(e);case r.ALPHANUMERIC:return i.getBitsLength(e);case r.KANJI:return f.getBitsLength(e);case r.BYTE:return c.getBitsLength(e)}}function p(e){return e.reduce((function(e,t){var a=e.length-1>=0?e[e.length-1]:null;return a&&a.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}function x(e){for(var t=[],a=0;a40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){var t=0;while(0!==e)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!==typeof e)throw new Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return"undefined"!==typeof r},t.toSJIS=function(e){return r(e)}},25057:function(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},49693:function(e,t,a){a(21703);var r=a(14288),n=a(49757),i=a(72839),c=a(15461),f=a(25057),d=a(35267),o=7973,s=r.getBCHDigit(o);function b(e,a,r){for(var n=1;n<=40;n++)if(a<=t.getCapacity(n,r,e))return n}function u(e,t){return c.getCharCountIndicator(e,t)+4}function h(e,t){var a=0;return e.forEach((function(e){var r=u(e.mode,t);a+=r+e.getBitsLength()})),a}function l(e,a){for(var r=1;r<=40;r++){var n=h(e,r);if(n<=t.getCapacity(r,a,c.MIXED))return r}}t.from=function(e,t){return f.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,a){if(!f.isValid(e))throw new Error("Invalid QR Code version");"undefined"===typeof a&&(a=c.BYTE);var i=r.getSymbolTotalCodewords(e),d=n.getTotalCodewordsCount(e,t),o=8*(i-d);if(a===c.MIXED)return o;var s=o-u(a,e);switch(a){case c.NUMERIC:return Math.floor(s/10*3);case c.ALPHANUMERIC:return Math.floor(s/11*2);case c.KANJI:return Math.floor(s/13);case c.BYTE:default:return Math.floor(s/8)}},t.getBestVersionForData=function(e,t){var a,r=i.from(t,i.M);if(d(e)){if(e.length>1)return l(e,r);if(0===e.length)return 1;a=e[0]}else a=e;return b(a.mode,a.getLength(),r)},t.getEncodedBits=function(e){if(!f.isValid(e)||e<7)throw new Error("Invalid QR Code version");var t=e<<12;while(r.getBCHDigit(t)-s>=0)t^=o<0&&o>0&&e[d-1]||(r+=c?i("M",o+a,.5+s+a):i("m",n,0),n=0,c=!1),o+1':"",b="',u='viewBox="0 0 '+o+" "+o+'"',h=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",l=''+s+b+"\n";return"function"===typeof a&&a(null,l),l}},28920:function(e,t,a){function r(e){if("number"===typeof e&&(e=e.toString()),"string"!==typeof e)throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");var a=parseInt(t.join(""),16);return{r:a>>24&255,g:a>>16&255,b:a>>8&255,a:255&a,hex:"#"+t.slice(0,6).join("")}}a(21703),t.getOptions=function(e){e||(e={}),e.color||(e.color={});var t="undefined"===typeof e.margin||null===e.margin||e.margin<0?4:e.margin,a=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:a,scale:a?4:n,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,a){var r=t.getScale(e,a);return Math.floor((e+2*a.margin)*r)},t.qrToImageData=function(e,a,r){for(var n=a.modules.size,i=a.modules.data,c=t.getScale(n,r),f=Math.floor((n+2*r.margin)*c),d=r.margin*c,o=[r.color.light,r.color.dark],s=0;s=d&&b>=d&&s=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e){return e!==e}function o(e,t){var a;return c.TYPED_ARRAY_SUPPORT?(a=new Uint8Array(t),a.__proto__=c.prototype):(a=e,null===a&&(a=new c(t)),a.length=t),a}function s(e,t){var a=o(e,t<0?0:0|f(t));if(!c.TYPED_ARRAY_SUPPORT)for(var r=0;r55295&&a<57344){if(!n){if(a>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&i.push(239,191,189);continue}n=a;continue}if(a<56320){(t-=3)>-1&&i.push(239,191,189),n=a;continue}a=65536+(n-55296<<10|a-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,a<128){if((t-=1)<0)break;i.push(a)}else if(a<2048){if((t-=2)<0)break;i.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;i.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return i}function x(e){if(c.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var t=e.length;return 0===t?0:p(e).length}function m(e,t,a,r){for(var n=0;n=t.length||n>=e.length)break;t[n+a]=e[n]}return n}function g(e,t,a,r){return m(p(t,e.length-a),e,a,r)}function v(e,t,a,r){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?h(e,t,a,r):"string"===typeof t?b(e,t,a):l(e,t)}c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),c.prototype.write=function(e,t,a){void 0===t||void 0===a&&"string"===typeof t?(a=this.length,t=0):isFinite(t)&&(t|=0,isFinite(a)?a|=0:a=void 0);var r=this.length-t;if((void 0===a||a>r)&&(a=r),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return g(this,e,t,a)},c.prototype.slice=function(e,t){var a,r=this.length;if(e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--n)e[n+t]=this[n+a];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"===typeof e)for(n=t;nnull===e||void 0===e;function f(e){switch(e.arrayFormat){case"index":return t=>(a,r)=>{const n=a.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?a:null===r?[...a,[s(t,e),"[",n,"]"].join("")]:[...a,[s(t,e),"[",s(n,e),"]=",s(r,e)].join("")]};case"bracket":return t=>(a,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?a:null===r?[...a,[s(t,e),"[]"].join("")]:[...a,[s(t,e),"[]=",s(r,e)].join("")];case"comma":case"separator":return t=>(a,r)=>null===r||void 0===r||0===r.length?a:0===a.length?[[s(t,e),"=",s(r,e)].join("")]:[[a,s(r,e)].join(e.arrayFormatSeparator)];default:return t=>(a,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?a:null===r?[...a,s(t,e)]:[...a,[s(t,e),"=",s(r,e)].join("")]}}function d(e){let t;switch(e.arrayFormat){case"index":return(e,a,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=a):r[e]=a};case"bracket":return(e,a,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],a):r[e]=[a]:r[e]=a};case"comma":case"separator":return(t,a,r)=>{const n="string"===typeof a&&a.split("").indexOf(e.arrayFormatSeparator)>-1,i=n?a.split(e.arrayFormatSeparator).map((t=>b(t,e))):null===a?a:b(a,e);r[t]=i};default:return(e,t,a)=>{void 0!==a[e]?a[e]=[].concat(a[e],t):a[e]=t}}}function o(e){if("string"!==typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function b(e,t){return t.decode?n(e):e}function u(e){return Array.isArray(e)?e.sort():"object"===typeof e?u(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function h(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function l(e){let t="";const a=e.indexOf("#");return-1!==a&&(t=e.slice(a)),t}function p(e){e=h(e);const t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function x(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"===typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t),o(t.arrayFormatSeparator);const a=d(t),r=Object.create(null);if("string"!==typeof e)return r;if(e=e.trim().replace(/^[?#&]/,""),!e)return r;for(const n of e.split("&")){let[e,c]=i(t.decode?n.replace(/\+/g," "):n,"=");c=void 0===c?null:["comma","separator"].includes(t.arrayFormat)?c:b(c,t),a(b(e,t),c,r)}for(const n of Object.keys(r)){const e=r[n];if("object"===typeof e&&null!==e)for(const a of Object.keys(e))e[a]=x(e[a],t);else r[n]=x(e,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const a=r[t];return Boolean(a)&&"object"===typeof a&&!Array.isArray(a)?e[t]=u(a):e[t]=a,e}),Object.create(null))}t.extract=p,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t),o(t.arrayFormatSeparator);const a=a=>t.skipNull&&c(e[a])||t.skipEmptyString&&""===e[a],r=f(t),n={};for(const c of Object.keys(e))a(c)||(n[c]=e[c]);const i=Object.keys(n);return!1!==t.sort&&i.sort(t.sort),i.map((a=>{const n=e[a];return void 0===n?"":null===n?s(a,t):Array.isArray(n)?n.reduce(r(a),[]).join("&"):s(a,t)+"="+s(n,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[a,r]=i(e,"#");return Object.assign({url:a.split("?")[0]||"",query:m(p(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:b(r,t)}:{})},t.stringifyUrl=(e,a)=>{a=Object.assign({encode:!0,strict:!0},a);const r=h(e.url).split("?")[0]||"",n=t.extract(e.url),i=t.parse(n,{sort:!1}),c=Object.assign(i,e.query);let f=t.stringify(c,a);f&&(f=`?${f}`);let d=l(e.url);return e.fragmentIdentifier&&(d=`#${s(e.fragmentIdentifier,a)}`),`${r}${f}${d}`}},67602:function(e,t,a){"use strict";var r=a(96027);a(21703);var n=65536,i=4294967295;function c(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}var f=a(6779).Buffer,d=a.g.crypto||a.g.msCrypto;function o(e,t){if(e>i)throw new RangeError("requested too many random bytes");var a=f.allocUnsafe(e);if(e>0)if(e>n)for(var c=0;cs||e<0)throw new TypeError("offset must be a uint32");if(e>d||e>t)throw new RangeError("offset out of range")}function u(e,t,a){if("number"!==typeof e||e!==e)throw new TypeError("size must be a number");if(e>s||e<0)throw new TypeError("size must be a uint32");if(e+t>a||e>d)throw new RangeError("buffer too small")}function h(e,t,r,n){if(!f.isBuffer(e)&&!(e instanceof a.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof t)n=t,t=0,r=e.length;else if("function"===typeof r)n=r,r=e.length-t;else if("function"!==typeof n)throw new TypeError('"cb" argument must be a function');return b(t,e.length),u(r,t,e.length),l(e,t,r,n)}function l(e,t,a,n){if(r.browser){var i=e.buffer,f=new Uint8Array(i,t,a);return o.getRandomValues(f),n?void r.nextTick((function(){n(null,e)})):e}if(!n){var d=c(a);return d.copy(e,t),e}c(a,(function(a,r){if(a)return n(a);r.copy(e,t),n(null,e)}))}function p(e,t,r){if("undefined"===typeof t&&(t=0),!f.isBuffer(e)&&!(e instanceof a.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return b(t,e.length),void 0===r&&(r=e.length-t),u(r,t,e.length),l(e,t,r)}o&&o.getRandomValues||!r.browser?(t.randomFill=h,t.randomFillSync=p):(t.randomFill=n,t.randomFillSync=n)},55314:function(e,t,a){"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}a(21703);var n={};function i(e,t,a){function i(e,a,r){return"string"===typeof t?t:t(e,a,r)}a||(a=Error);var c=function(e){function t(t,a,r){return e.call(this,i(t,a,r))||this}return r(t,e),t}(a);c.prototype.name=a.name,c.prototype.code=e,n[e]=c}function c(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function f(e,t,a){return e.substr(!a||a<0?0:+a,t.length)===t}function d(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}function o(e,t,a){return"number"!==typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,n;if("string"===typeof t&&f(t,"not ")?(r="must not be",t=t.replace(/^not /,"")):r="must be",d(e," argument"))n="The ".concat(e," ").concat(r," ").concat(c(t,"type"));else{var i=o(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(i," ").concat(r," ").concat(c(t,"type"))}return n+=". Received type ".concat(typeof a),n}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=n},31418:function(e,t,a){"use strict";var r=a(96027),n=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=s;var i=a(50187),c=a(69621);a(81923)(s,i);for(var f=n(c.prototype),d=0;d0)if("string"===typeof t||c.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=o(t)),r)c.endEmitted?A(e,new k):I(e,c,t,!0);else if(c.ended)A(e,new M);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!a?(t=c.decoder.write(t),c.objectMode||0!==t.length?I(e,c,t,!1):q(e,c)):I(e,c,t,!1)}else r||(c.reading=!1,q(e,c));return!c.ended&&(c.length=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function N(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=O(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function U(e,t){if(b("onEofChunk"),!t.ended){if(t.decoder){var a=t.decoder.end();a&&a.length&&(t.buffer.push(a),t.length+=t.objectMode?1:a.length)}t.ended=!0,t.sync?L(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}}function L(e){var t=e._readableState;b("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(b("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(j,e))}function j(e){var t=e._readableState;b("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,G(e)}function q(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(F,e,t))}function F(e,t){while(!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){b("readable nexttick read 0"),e.read(0)}function K(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(Z,e,t))}function Z(e,t){b("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),G(e),t.flowing&&!t.reading&&e.read(0)}function G(e){var t=e._readableState;b("flow",t.flowing);while(t.flowing&&null!==e.read());}function V(e,t){return 0===t.length?null:(t.objectMode?a=t.buffer.shift():!e||e>=t.length?(a=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):a=t.buffer.consume(e,t.decoder),a);var a}function W(e){var t=e._readableState;b("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(J,t,e))}function J(e,t){if(b("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var a=t._writableState;(!a||a.autoDestroy&&a.finished)&&t.destroy()}}function X(e,t){for(var a=0,r=e.length;a=t.highWaterMark:t.length>0)||t.ended))return b("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?W(this):L(this),null;if(e=N(e,t),0===e&&t.ended)return 0===t.length&&W(this),null;var r,n=t.needReadable;return b("need readable",n),(0===t.length||t.length-e0?V(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),a!==e&&t.ended&&W(this)),null!==r&&this.emit("data",r),r},T.prototype._read=function(e){A(this,new _("_read()"))},T.prototype.pipe=function(e,t){var a=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e);break}r.pipesCount+=1,b("pipe count=%d opts=%j",r.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,f=c?o:g;function d(e,t){b("onunpipe"),e===a&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function o(){b("onend"),e.end()}r.endEmitted?n.nextTick(f):a.once("end",f),e.on("unpipe",d);var s=D(a);e.on("drain",s);var u=!1;function h(){b("cleanup"),e.removeListener("close",x),e.removeListener("finish",m),e.removeListener("drain",s),e.removeListener("error",p),e.removeListener("unpipe",d),a.removeListener("end",o),a.removeListener("end",g),a.removeListener("data",l),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}function l(t){b("ondata");var n=e.write(t);b("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==X(r.pipes,e))&&!u&&(b("false write response, pause",r.awaitDrain),r.awaitDrain++),a.pause())}function p(t){b("onerror",t),g(),e.removeListener("error",p),0===i(e,"error")&&A(e,t)}function x(){e.removeListener("finish",m),g()}function m(){b("onfinish"),e.removeListener("close",x),g()}function g(){b("unpipe"),a.unpipe(e)}return a.on("data",l),E(e,"error",p),e.once("close",x),e.once("finish",m),e.emit("pipe",a),r.flowing||(b("pipe resume"),a.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,a={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,a)),this;if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,b("on readable",r.length,r.reading),r.length?L(this):r.reading||n.nextTick(z,this))),a},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var a=c.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(H,this),a},T.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(H,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(b("resume"),e.flowing=!e.readableListening,K(this,e)),e.paused=!1,this},T.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,a=this._readableState,r=!1;for(var n in e.on("end",(function(){if(b("wrapped end"),a.decoder&&!a.ended){var e=a.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){if(b("wrapped data"),a.decoder&&(n=a.decoder.write(n)),(!a.objectMode||null!==n&&void 0!==n)&&(a.objectMode||n&&n.length)){var i=t.push(n);i||(r=!0,e.pause())}})),e)void 0===this[n]&&"function"===typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),B.prototype._write=function(e,t,a){a(new g("_write()"))},B.prototype._writev=null,B.prototype.end=function(e,t,a){var r=this._writableState;return"function"===typeof e?(a=e,e=null,t=null):"function"===typeof t&&(a=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||K(this,r,a),this},Object.defineProperty(B.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(B.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),B.prototype.destroy=h.destroy,B.prototype._undestroy=h.undestroy,B.prototype._destroy=function(e,t){t(e)}},9637:function(e,t,a){"use strict";var r,n=a(96027);function i(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var c=a(83210),f=Symbol("lastResolve"),d=Symbol("lastReject"),o=Symbol("error"),s=Symbol("ended"),b=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function p(e){var t=e[f];if(null!==t){var a=e[h].read();null!==a&&(e[b]=null,e[f]=null,e[d]=null,t(l(a,!1)))}}function x(e){n.nextTick(p,e)}function m(e,t){return function(a,r){e.then((function(){t[s]?a(l(void 0,!0)):t[u](a,r)}),r)}}var g=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((r={get stream(){return this[h]},next:function(){var e=this,t=this[o];if(null!==t)return Promise.reject(t);if(this[s])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(t,a){n.nextTick((function(){e[o]?a(e[o]):t(l(void 0,!0))}))}));var a,r=this[b];if(r)a=new Promise(m(r,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(l(i,!1));a=new Promise(this[u])}return this[b]=a,a}},i(r,Symbol.asyncIterator,(function(){return this})),i(r,"return",(function(){var e=this;return new Promise((function(t,a){e[h].destroy(null,(function(e){e?a(e):t(l(void 0,!0))}))}))})),r),g),y=function(e){var t,a=Object.create(v,(t={},i(t,h,{value:e,writable:!0}),i(t,f,{value:null,writable:!0}),i(t,d,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:e._readableState.endEmitted,writable:!0}),i(t,u,{value:function(e,t){var r=a[h].read();r?(a[b]=null,a[f]=null,a[d]=null,e(l(r,!1))):(a[f]=e,a[d]=t)},writable:!0}),t));return a[b]=null,c(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=a[d];return null!==t&&(a[b]=null,a[f]=null,a[d]=null,t(e)),void(a[o]=e)}var r=a[f];null!==r&&(a[b]=null,a[f]=null,a[d]=null,r(l(void 0,!0))),a[s]=!0})),e.on("readable",x.bind(null,a)),a};e.exports=y},98947:function(e,t,a){"use strict";function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function n(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";var t=this.head,a=""+t.data;while(t=t.next)a+=e+t.data;return a}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);var t=s.allocUnsafe(e>>>0),a=this.head,r=0;while(a)l(a.data,t,r),r+=a.data.length,a=a.next;return t}},{key:"consume",value:function(e,t){var a;return en.length?n.length:e;if(i===n.length?r+=n:r+=n.slice(0,e),e-=i,0===e){i===n.length?(++a,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++a}return this.length-=a,r}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),a=this.head,r=1;a.data.copy(t),e-=a.data.length;while(a=a.next){var n=a.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),e-=i,0===e){i===n.length?(++r,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=n.slice(i));break}++r}return this.length-=r,t}},{key:h,value:function(e,t){return u(this,n({},t,{depth:0,customInspect:!1}))}}]),e}()},47508:function(e,t,a){"use strict";var r=a(96027);function n(e,t){var a=this,n=this._readableState&&this._readableState.destroyed,f=this._writableState&&this._writableState.destroyed;return n||f?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(d,this,e)):r.nextTick(d,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?a._writableState?a._writableState.errorEmitted?r.nextTick(c,a):(a._writableState.errorEmitted=!0,r.nextTick(i,a,e)):r.nextTick(i,a,e):t?(r.nextTick(c,a),t(e)):r.nextTick(c,a)})),this)}function i(e,t){d(e,t),c(e)}function c(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function f(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function d(e,t){e.emit("error",t)}function o(e,t){var a=e._readableState,r=e._writableState;a&&a.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:n,undestroy:f,errorOrDestroy:o}},83210:function(e,t,a){"use strict";var r=a(55314).q.ERR_STREAM_PREMATURE_CLOSE;function n(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,r=new Array(a),n=0;n0;return s(e,c,f,(function(e){r||(r=e),e&&i.forEach(b),c||(i.forEach(b),n(r))}))}));return t.reduce(u)}e.exports=l},21938:function(e,t,a){"use strict";var r=a(55314).q.ERR_INVALID_OPT_VALUE;function n(e,t,a){return null!=e.highWaterMark?e.highWaterMark:t?e[a]:null}function i(e,t,a,i){var c=n(t,i,a);if(null!=c){if(!isFinite(c)||Math.floor(c)!==c||c<0){var f=i?a:"highWaterMark";throw new r(f,c)}return Math.floor(c)}return e.objectMode?16:16384}e.exports={getHighWaterMark:i}},13066:function(e,t,a){e.exports=a(43793).EventEmitter},98141:function(e,t,a){t=e.exports=a(50187),t.Stream=t,t.Readable=t,t.Writable=a(69621),t.Duplex=a(31418),t.Transform=a(87825),t.PassThrough=a(80214),t.finished=a(83210),t.pipeline=a(26708)},3128:function(e,t,a){"use strict";var r=a(15361).Buffer,n=a(81923),i=a(10761),c=new Array(16),f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],d=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],o=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],s=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],b=[0,1518500249,1859775393,2400959708,2840853838],u=[1352829926,1548603684,1836072691,2053994217,0];function h(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function l(e,t){return e<>>32-t}function p(e,t,a,r,n,i,c,f){return l(e+(t^a^r)+i+c|0,f)+n|0}function x(e,t,a,r,n,i,c,f){return l(e+(t&a|~t&r)+i+c|0,f)+n|0}function m(e,t,a,r,n,i,c,f){return l(e+((t|~a)^r)+i+c|0,f)+n|0}function g(e,t,a,r,n,i,c,f){return l(e+(t&r|a&~r)+i+c|0,f)+n|0}function v(e,t,a,r,n,i,c,f){return l(e+(t^(a|~r))+i+c|0,f)+n|0}n(h,i),h.prototype._update=function(){for(var e=c,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var a=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,h=0|this._e,y=0|this._a,w=0|this._b,M=0|this._c,_=0|this._d,k=0|this._e,A=0;A<80;A+=1){var S,E;A<16?(S=p(a,r,n,i,h,e[f[A]],b[0],o[A]),E=v(y,w,M,_,k,e[d[A]],u[0],s[A])):A<32?(S=x(a,r,n,i,h,e[f[A]],b[1],o[A]),E=g(y,w,M,_,k,e[d[A]],u[1],s[A])):A<48?(S=m(a,r,n,i,h,e[f[A]],b[2],o[A]),E=m(y,w,M,_,k,e[d[A]],u[2],s[A])):A<64?(S=g(a,r,n,i,h,e[f[A]],b[3],o[A]),E=x(y,w,M,_,k,e[d[A]],u[3],s[A])):(S=v(a,r,n,i,h,e[f[A]],b[4],o[A]),E=p(y,w,M,_,k,e[d[A]],u[4],s[A])),a=h,h=i,i=l(n,10),n=r,r=S,y=k,k=_,_=l(M,10),M=w,w=E}var B=this._b+n+_|0;this._b=this._c+i+k|0,this._c=this._d+h+y|0,this._d=this._e+a+w|0,this._e=this._a+r+M|0,this._a=B},h.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 e=r.alloc?r.alloc(20):new r(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},98217:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),a(48675),a(3462);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getLength=t.decode=t.encode=void 0;var i=n(a(63250));function c(e){if(Array.isArray(e)){for(var t=[],a=0;ae.length)throw new Error("invalid rlp: total length is larger than the data");if(i=e.slice(a,s),0===i.length)throw new Error("invalid rlp, List has a invalid length");while(i.length)c=b(i),d.push(c.data),i=c.remainder;return{data:d,remainder:e.slice(s)}}function u(e){return"0x"===e.slice(0,2)}function h(e){return"string"!==typeof e?e:u(e)?e.slice(2):e}function l(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");var t=e.toString(16);return t.length%2?"0"+t:t}function p(e){return e.length%2?"0"+e:e}function x(e){var t=l(e);return r.from(t,"hex")}function m(e){if(!r.isBuffer(e)){if("string"===typeof e)return u(e)?r.from(p(h(e)),"hex"):r.from(e);if("number"===typeof e||"bigint"===typeof e)return e?x(e):r.from([]);if(null===e||void 0===e)return r.from([]);if(e instanceof Uint8Array)return r.from(e);if(i.default.isBN(e))return r.from(e.toArray());throw new Error("invalid type")}return e}t.encode=c,t.decode=o,t.getLength=s},63250:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(6567).Buffer}catch(P){}function f(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},6779:function(e,t,a){a(21703);var r=a(15361),n=r.Buffer;function i(e,t){for(var a in e)t[a]=e[a]}function c(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=c),i(n,c),c.from=function(e,t,a){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},c.alloc=function(e,t,a){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"===typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},c.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},c.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},43353:function(e,t,a){a(21703);const r=a(9242),n=a(43793);var i="object"===typeof Reflect?Reflect:null,c=i&&"function"===typeof i.apply?i.apply:function(e,t,a){return Function.prototype.apply.call(e,t,a)};function f(){n.call(this)}function d(e,t,a){try{c(e,t,a)}catch(r){setTimeout((()=>{throw r}))}}function o(e,t){for(var a=new Array(t),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=n[e];if(void 0===f)return!1;if("function"===typeof f)d(f,this,t);else{var s=f.length,b=o(f,s);for(a=0;a=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=c(e);return t&&0!==t.length?"string"===typeof a?r.fill(t,a):r.fill(t):r.fill(0),r}),!f.kStringMaxLength)try{f.kStringMaxLength=r.binding("buffer").kStringMaxLength}catch(o){}f.constants||(f.constants={MAX_LENGTH:f.kMaxLength},f.kStringMaxLength&&(f.constants.MAX_STRING_LENGTH=f.kStringMaxLength)),e.exports=f},80014:function(e,t,a){"use strict";a(48675),a(3462),a(21703),a(84633),function(t){const a=2147483647;function r(e){const t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let a=1779033703,r=3144134277,n=1013904242,i=2773480762,c=1359893119,f=2600822924,d=528734635,o=1541459225;const s=new Uint32Array(64);function b(e){let b=0,u=e.length;while(u>=64){let h,l,p,x,m,g=a,v=r,y=n,w=i,M=c,_=f,k=d,A=o;for(l=0;l<16;l++)p=b+4*l,s[l]=(255&e[p])<<24|(255&e[p+1])<<16|(255&e[p+2])<<8|255&e[p+3];for(l=16;l<64;l++)h=s[l-2],x=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=s[l-15],m=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,s[l]=(x+s[l-7]|0)+(m+s[l-16]|0)|0;for(l=0;l<64;l++)x=(((M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7))+(M&_^~M&k)|0)+(A+(t[l]+s[l]|0)|0)|0,m=((g>>>2|g<<30)^(g>>>13|g<<19)^(g>>>22|g<<10))+(g&v^g&y^v&y)|0,A=k,k=_,_=M,M=w+x|0,w=y,y=v,v=g,g=x+m|0;a=a+g|0,r=r+v|0,n=n+y|0,i=i+w|0,c=c+M|0,f=f+_|0,d=d+k|0,o=o+A|0,b+=64,u-=64}}b(e);let u,h=e.length%64,l=e.length/536870912|0,p=e.length<<3,x=h<56?56:120,m=e.slice(e.length-h,e.length);for(m.push(128),u=h+1;u>>24&255),m.push(l>>>16&255),m.push(l>>>8&255),m.push(l>>>0&255),m.push(p>>>24&255),m.push(p>>>16&255),m.push(p>>>8&255),m.push(p>>>0&255),b(m),[a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255]}function n(e,t,a){e=e.length<=64?e:r(e);const n=64+t.length+4,i=new Array(n),c=new Array(64);let f,d=[];for(f=0;f<64;f++)i[f]=54;for(f=0;f=n-4;e--){if(i[e]++,i[e]<=255)return;i[e]=0}}while(a>=32)o(),d=d.concat(r(c.concat(r(i)))),a-=32;return a>0&&(o(),d=d.concat(r(c.concat(r(i))).slice(0,a))),d}function i(e,t,a,r,n){let i;for(o(e,16*(2*a-1),n,0,16),i=0;i<2*a;i++)d(e,16*i,n,16),f(n,r),o(n,0,e,t+16*i,16);for(i=0;i>>32-t}function f(e,t){o(e,0,t,0,16);for(let a=8;a>0;a-=2)t[4]^=c(t[0]+t[12],7),t[8]^=c(t[4]+t[0],9),t[12]^=c(t[8]+t[4],13),t[0]^=c(t[12]+t[8],18),t[9]^=c(t[5]+t[1],7),t[13]^=c(t[9]+t[5],9),t[1]^=c(t[13]+t[9],13),t[5]^=c(t[1]+t[13],18),t[14]^=c(t[10]+t[6],7),t[2]^=c(t[14]+t[10],9),t[6]^=c(t[2]+t[14],13),t[10]^=c(t[6]+t[2],18),t[3]^=c(t[15]+t[11],7),t[7]^=c(t[3]+t[15],9),t[11]^=c(t[7]+t[3],13),t[15]^=c(t[11]+t[7],18),t[1]^=c(t[0]+t[3],7),t[2]^=c(t[1]+t[0],9),t[3]^=c(t[2]+t[1],13),t[0]^=c(t[3]+t[2],18),t[6]^=c(t[5]+t[4],7),t[7]^=c(t[6]+t[5],9),t[4]^=c(t[7]+t[6],13),t[5]^=c(t[4]+t[7],18),t[11]^=c(t[10]+t[9],7),t[8]^=c(t[11]+t[10],9),t[9]^=c(t[8]+t[11],13),t[10]^=c(t[9]+t[8],18),t[12]^=c(t[15]+t[14],7),t[13]^=c(t[12]+t[15],9),t[14]^=c(t[13]+t[12],13),t[15]^=c(t[14]+t[13],18);for(let a=0;a<16;++a)e[a]+=t[a]}function d(e,t,a,r){for(let n=0;n=256)return!1}return!0}function b(e,t){if("number"!==typeof e||e%1)throw new Error("invalid "+t);return e}function u(e,t,r,c,f,u,h){if(r=b(r,"N"),c=b(c,"r"),f=b(f,"p"),u=b(u,"dkLen"),0===r||0!==(r&r-1))throw new Error("N must be power of 2");if(r>a/128/c)throw new Error("N too large");if(c>a/128/f)throw new Error("r too large");if(!s(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!s(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let l=n(e,t,128*f*c);const p=new Uint32Array(32*f*c);for(let a=0;aT&&(t=T);for(let e=0;eT&&(t=T);for(let e=0;e>0&255),l.push(p[e]>>8&255),l.push(p[e]>>16&255),l.push(p[e]>>24&255);const a=n(e,l,u);return h&&h(null,1,a),a}h&&P(I)};if(!h)while(1){const e=I();if(void 0!=e)return e}I()}const h={scrypt:function(e,t,a,r,n,i,c){return new Promise((function(f,d){let o=0;c&&c(0),u(e,t,a,r,n,i,(function(e,t,a){if(e)d(e);else if(a)c&&1!==o&&c(1),f(new Uint8Array(a));else if(c&&t!==o)return o=t,c(t)}))}))},syncScrypt:function(e,t,a,r,n,i){return new Uint8Array(u(e,t,a,r,n,i))}};e.exports=h}()},55899:function(e,t,a){e.exports=a(49338)(a(26951))},26951:function(e,t,a){a(48675),a(3462),a(21703);const r=a(32127).ec,n=new r("secp256k1"),i=n.curve,c=i.n.constructor;function f(e,t){let a=new c(t);if(a.cmp(i.p)>=0)return null;a=a.toRed(i.red);let r=a.redSqr().redIMul(a).redIAdd(i.b).redSqrt();return 3===e!==r.isOdd()&&(r=r.redNeg()),n.keyPair({pub:{x:a,y:r}})}function d(e,t,a){let r=new c(t),f=new c(a);if(r.cmp(i.p)>=0||f.cmp(i.p)>=0)return null;if(r=r.toRed(i.red),f=f.toRed(i.red),(6===e||7===e)&&f.isOdd()!==(7===e))return null;const d=r.redSqr().redIMul(r);return f.redSqr().redISub(d.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:r,y:f}}):null}function o(e){const t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:f(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:d(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function s(e,t){const a=t.encode(null,33===e.length);for(let r=0;r=0)return 1;if(a.iadd(new c(e)),a.cmp(i.n)>=0&&a.isub(i.n),a.isZero())return 1;const r=a.toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakMul(e,t){let a=new c(t);if(a.cmp(i.n)>=0||a.isZero())return 1;a.imul(new c(e)),a.cmp(i.n)>=0&&(a=a.umod(i.n));const r=a.toArrayLike(Uint8Array,"be",32);return e.set(r),0},publicKeyVerify(e){const t=o(e);return null===t?1:0},publicKeyCreate(e,t){const a=new c(t);if(a.cmp(i.n)>=0||a.isZero())return 1;const r=n.keyFromPrivate(t).getPublic();return s(e,r),0},publicKeyConvert(e,t){const a=o(t);if(null===a)return 1;const r=a.getPublic();return s(e,r),0},publicKeyNegate(e,t){const a=o(t);if(null===a)return 1;const r=a.getPublic();return r.y=r.y.redNeg(),s(e,r),0},publicKeyCombine(e,t){const a=new Array(t.length);for(let n=0;n=0)return 2;const n=r.getPublic().add(i.g.mul(a));return n.isInfinity()?2:(s(e,n),0)},publicKeyTweakMul(e,t,a){const r=o(t);if(null===r)return 1;if(a=new c(a),a.cmp(i.n)>=0||a.isZero())return 2;const n=r.getPublic().mul(a);return s(e,n),0},signatureNormalize(e){const t=new c(e.subarray(0,32)),a=new c(e.subarray(32,64));return t.cmp(i.n)>=0||a.cmp(i.n)>=0?1:(1===a.cmp(n.nh)&&e.set(i.n.sub(a).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const a=t.subarray(0,32),r=t.subarray(32,64);if(new c(a).cmp(i.n)>=0)return 1;if(new c(r).cmp(i.n)>=0)return 1;const{output:n}=e;let f=n.subarray(4,37);f[0]=0,f.set(a,1);let d=33,o=0;for(;d>1&&0===f[o]&&!(128&f[o+1]);--d,++o);if(f=f.subarray(o),128&f[0])return 1;if(d>1&&0===f[0]&&!(128&f[1]))return 1;let s=n.subarray(39,72);s[0]=0,s.set(r,1);let b=33,u=0;for(;b>1&&0===s[u]&&!(128&s[u+1]);--b,++u);return s=s.subarray(u),128&s[0]||b>1&&0===s[0]&&!(128&s[1])?1:(e.outputlen=6+d+b,n[0]=48,n[1]=e.outputlen-2,n[2]=2,n[3]=f.length,n.set(f,4),n[4+d]=2,n[5+d]=s.length,n.set(s,6+d),0)},signatureImport(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;const a=t[3];if(0===a)return 1;if(5+a>=t.length)return 1;if(2!==t[4+a])return 1;const r=t[5+a];if(0===r)return 1;if(6+a+r!==t.length)return 1;if(128&t[4])return 1;if(a>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[a+6])return 1;if(r>1&&0===t[a+6]&&!(128&t[a+7]))return 1;let n=t.subarray(4,4+a);if(33===n.length&&0===n[0]&&(n=n.subarray(1)),n.length>32)return 1;let f=t.subarray(6+a);if(33===f.length&&0===f[0]&&(f=f.slice(1)),f.length>32)throw new Error("S length is too long");let d=new c(n);d.cmp(i.n)>=0&&(d=new c(0));let o=new c(t.subarray(6+a));return o.cmp(i.n)>=0&&(o=new c(0)),e.set(d.toArrayLike(Uint8Array,"be",32),0),e.set(o.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,a,r,f){if(f){const e=f;f=n=>{const i=e(t,a,null,r,n),f=i instanceof Uint8Array&&32===i.length;if(!f)throw new Error("This is the way");return new c(i)}}const d=new c(a);if(d.cmp(i.n)>=0||d.isZero())return 1;let o;try{o=n.sign(t,a,{canonical:!0,k:f,pers:r})}catch(s){return 1}return e.signature.set(o.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(o.s.toArrayLike(Uint8Array,"be",32),32),e.recid=o.recoveryParam,0},ecdsaVerify(e,t,a){const r={r:e.subarray(0,32),s:e.subarray(32,64)},f=new c(r.r),d=new c(r.s);if(f.cmp(i.n)>=0||d.cmp(i.n)>=0)return 1;if(1===d.cmp(n.nh)||f.isZero()||d.isZero())return 3;const s=o(a);if(null===s)return 2;const b=s.getPublic(),u=n.verify(t,r,b);return u?0:3},ecdsaRecover(e,t,a,r){const f={r:t.slice(0,32),s:t.slice(32,64)},d=new c(f.r),o=new c(f.s);if(d.cmp(i.n)>=0||o.cmp(i.n)>=0)return 1;if(d.isZero()||o.isZero())return 2;let b;try{b=n.recoverPubKey(r,f,a)}catch(u){return 2}return s(e,b),0},ecdh(e,t,a,r,f,d,s){const b=o(t);if(null===b)return 1;const u=new c(a);if(u.cmp(i.n)>=0||u.isZero())return 2;const h=b.getPublic().mul(u);if(void 0===f){const t=h.encode(null,!0),a=n.hash().update(t).digest();for(let r=0;r<32;++r)e[r]=a[r]}else{d||(d=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)d[e]=t[e];s||(s=new Uint8Array(32));const a=h.getY().toArray("be",32);for(let e=0;e<32;++e)s[e]=a[e];const n=f(d,s,r),i=n instanceof Uint8Array&&n.length===e.length;if(!i)return 2;e.set(n)}return 0}}},49338:function(e,t,a){a(21703),a(48675),a(3462);const r={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invalid",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function n(e,t){if(!e)throw new Error(t)}function i(e,t,a){if(n(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==a)if(Array.isArray(a)){const r=a.join(", "),i=`Expected ${e} to be an Uint8Array with length [${r}]`;n(a.includes(t.length),i)}else{const r=`Expected ${e} to be an Uint8Array with length ${a}`;n(t.length===a,r)}}function c(e){n("Boolean"===d(e),"Expected compressed to be a Boolean")}function f(e=(e=>new Uint8Array(e)),t){return"function"===typeof e&&(e=e(t)),i("output",e,t),e}function d(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(t){switch(n(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&i("seed",t,32),e.contextRandomize(t)){case 1:throw new Error(r.CONTEXT_RANDOMIZE_UNKNOW)}},privateKeyVerify(t){return i("private key",t,32),0===e.privateKeyVerify(t)},privateKeyNegate(t){switch(i("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(r.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(t,a){switch(i("private key",t,32),i("tweak",a,32),e.privateKeyTweakAdd(t,a)){case 0:return t;case 1:throw new Error(r.TWEAK_ADD)}},privateKeyTweakMul(t,a){switch(i("private key",t,32),i("tweak",a,32),e.privateKeyTweakMul(t,a)){case 0:return t;case 1:throw new Error(r.TWEAK_MUL)}},publicKeyVerify(t){return i("public key",t,[33,65]),0===e.publicKeyVerify(t)},publicKeyCreate(t,a=!0,n){switch(i("private key",t,32),c(a),n=f(n,a?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(r.SECKEY_INVALID);case 2:throw new Error(r.PUBKEY_SERIALIZE)}},publicKeyConvert(t,a=!0,n){switch(i("public key",t,[33,65]),c(a),n=f(n,a?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(r.PUBKEY_PARSE);case 2:throw new Error(r.PUBKEY_SERIALIZE)}},publicKeyNegate(t,a=!0,n){switch(i("public key",t,[33,65]),c(a),n=f(n,a?33:65),e.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(r.PUBKEY_PARSE);case 2:throw new Error(r.IMPOSSIBLE_CASE);case 3:throw new Error(r.PUBKEY_SERIALIZE)}},publicKeyCombine(t,a=!0,d){n(Array.isArray(t),"Expected public keys to be an Array"),n(t.length>0,"Expected public keys array will have more than zero items");for(const e of t)i("public key",e,[33,65]);switch(c(a),d=f(d,a?33:65),e.publicKeyCombine(d,t)){case 0:return d;case 1:throw new Error(r.PUBKEY_PARSE);case 2:throw new Error(r.PUBKEY_COMBINE);case 3:throw new Error(r.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(t,a,n=!0,d){switch(i("public key",t,[33,65]),i("tweak",a,32),c(n),d=f(d,n?33:65),e.publicKeyTweakAdd(d,t,a)){case 0:return d;case 1:throw new Error(r.PUBKEY_PARSE);case 2:throw new Error(r.TWEAK_ADD)}},publicKeyTweakMul(t,a,n=!0,d){switch(i("public key",t,[33,65]),i("tweak",a,32),c(n),d=f(d,n?33:65),e.publicKeyTweakMul(d,t,a)){case 0:return d;case 1:throw new Error(r.PUBKEY_PARSE);case 2:throw new Error(r.TWEAK_MUL)}},signatureNormalize(t){switch(i("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(r.SIG_PARSE)}},signatureExport(t,a){i("signature",t,64),a=f(a,72);const n={output:a,outputlen:72};switch(e.signatureExport(n,t)){case 0:return a.slice(0,n.outputlen);case 1:throw new Error(r.SIG_PARSE);case 2:throw new Error(r.IMPOSSIBLE_CASE)}},signatureImport(t,a){switch(i("signature",t),a=f(a,64),e.signatureImport(a,t)){case 0:return a;case 1:throw new Error(r.SIG_PARSE);case 2:throw new Error(r.IMPOSSIBLE_CASE)}},ecdsaSign(t,a,c={},o){i("message",t,32),i("private key",a,32),n("Object"===d(c),"Expected options to be an Object"),void 0!==c.data&&i("options.data",c.data),void 0!==c.noncefn&&n("Function"===d(c.noncefn),"Expected options.noncefn to be a Function"),o=f(o,64);const s={signature:o,recid:null};switch(e.ecdsaSign(s,t,a,c.data,c.noncefn)){case 0:return s;case 1:throw new Error(r.SIGN);case 2:throw new Error(r.IMPOSSIBLE_CASE)}},ecdsaVerify(t,a,n){switch(i("signature",t,64),i("message",a,32),i("public key",n,[33,65]),e.ecdsaVerify(t,a,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(r.SIG_PARSE);case 2:throw new Error(r.PUBKEY_PARSE)}},ecdsaRecover(t,a,o,s=!0,b){switch(i("signature",t,64),n("Number"===d(a)&&a>=0&&a<=3,"Expected recovery id to be a Number within interval [0, 3]"),i("message",o,32),c(s),b=f(b,s?33:65),e.ecdsaRecover(b,t,a,o)){case 0:return b;case 1:throw new Error(r.SIG_PARSE);case 2:throw new Error(r.RECOVER);case 3:throw new Error(r.IMPOSSIBLE_CASE)}},ecdh(t,a,c={},o){switch(i("public key",t,[33,65]),i("private key",a,32),n("Object"===d(c),"Expected options to be an Object"),void 0!==c.data&&i("options.data",c.data),void 0!==c.hashfn?(n("Function"===d(c.hashfn),"Expected options.hashfn to be a Function"),void 0!==c.xbuf&&i("options.xbuf",c.xbuf,32),void 0!==c.ybuf&&i("options.ybuf",c.ybuf,32),i("output",o)):o=f(o,32),e.ecdh(o,t,a,c.data,c.hashfn,c.xbuf,c.ybuf)){case 0:return o;case 1:throw new Error(r.PUBKEY_PARSE);case 2:throw new Error(r.ECDH)}}})},46941:function(e,t,a){var r=a(96027);a(21703),function(t){"use strict";var a=function(e){setTimeout(e,0)};function n(e){var t={capacity:e||1,current:0,queue:[],firstHere:!1,take:function(){if(!1===t.firstHere){t.current++,t.firstHere=!0;var e=1}else e=0;var a={n:1};"function"==typeof arguments[0]?a.task=arguments[0]:a.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?a.task=arguments[1]:a.n=arguments[1]);var r=a.task;if(a.task=function(){r(t.leave)},t.current+a.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(a);t.current+=a.n-e,a.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var r=t.queue[0];r.n+t.current>t.capacity||(t.queue.shift(),t.current+=r.n,a(r.task))}else if(t.current<0)throw new Error("leave called too many times.")},available:function(e){return e=e||1,t.current+e<=t.capacity}};return t}"undefined"!=typeof r&&r&&"function"==typeof r.nextTick&&(a=r.nextTick),e.exports=n}()},37833:function(e,t,a){a(21703);var r=a(6779).Buffer;function n(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}n.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=r.from(e,t));for(var a=this._block,n=this._blockSize,i=e.length,c=this._len,f=0;f=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var r=(4294967295&a)>>>0,n=(a-r)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=n},61720:function(e,t,a){a(21703);var r=e.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};r.sha=a(96664),r.sha1=a(18272),r.sha224=a(52935),r.sha256=a(872),r.sha384=a(6461),r.sha512=a(82522)},96664:function(e,t,a){var r=a(81923),n=a(37833),i=a(6779).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function d(){this.init(),this._w=f,n.call(this,64,56)}function o(e){return e<<5|e>>>27}function s(e){return e<<30|e>>>2}function b(e,t,a,r){return 0===e?t&a|~t&r:2===e?t&a|t&r|a&r:t^a^r}r(d,n),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(e){for(var t=this._w,a=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,f=0|this._e,d=0;d<16;++d)t[d]=e.readInt32BE(4*d);for(;d<80;++d)t[d]=t[d-3]^t[d-8]^t[d-14]^t[d-16];for(var u=0;u<80;++u){var h=~~(u/20),l=o(a)+b(h,r,n,i)+f+t[u]+c[h]|0;f=i,i=n,n=s(r),r=a,a=l}this._a=a+this._a|0,this._b=r+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=f+this._e|0},d.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=d},18272:function(e,t,a){var r=a(81923),n=a(37833),i=a(6779).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function d(){this.init(),this._w=f,n.call(this,64,56)}function o(e){return e<<1|e>>>31}function s(e){return e<<5|e>>>27}function b(e){return e<<30|e>>>2}function u(e,t,a,r){return 0===e?t&a|~t&r:2===e?t&a|t&r|a&r:t^a^r}r(d,n),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(e){for(var t=this._w,a=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,f=0|this._e,d=0;d<16;++d)t[d]=e.readInt32BE(4*d);for(;d<80;++d)t[d]=o(t[d-3]^t[d-8]^t[d-14]^t[d-16]);for(var h=0;h<80;++h){var l=~~(h/20),p=s(a)+u(l,r,n,i)+f+t[h]+c[l]|0;f=i,i=n,n=b(r),r=a,a=p}this._a=a+this._a|0,this._b=r+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=f+this._e|0},d.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=d},52935:function(e,t,a){var r=a(81923),n=a(872),i=a(37833),c=a(6779).Buffer,f=new Array(64);function d(){this.init(),this._w=f,i.call(this,64,56)}r(d,n),d.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},d.prototype._hash=function(){var e=c.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=d},872:function(e,t,a){var r=a(81923),n=a(37833),i=a(6779).Buffer,c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],f=new Array(64);function d(){this.init(),this._w=f,n.call(this,64,56)}function o(e,t,a){return a^e&(t^a)}function s(e,t,a){return e&t|a&(e|t)}function b(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function u(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function l(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}r(d,n),d.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},d.prototype._update=function(e){for(var t=this._w,a=0|this._a,r=0|this._b,n=0|this._c,i=0|this._d,f=0|this._e,d=0|this._f,p=0|this._g,x=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=l(t[m-2])+t[m-7]+h(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var v=x+u(f)+o(f,d,p)+c[g]+t[g]|0,y=b(a)+s(a,r,n)|0;x=p,p=d,d=f,f=i+v|0,i=n,n=r,r=a,a=v+y|0}this._a=a+this._a|0,this._b=r+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=f+this._e|0,this._f=d+this._f|0,this._g=p+this._g|0,this._h=x+this._h|0},d.prototype._hash=function(){var e=i.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=d},6461:function(e,t,a){var r=a(81923),n=a(82522),i=a(37833),c=a(6779).Buffer,f=new Array(160);function d(){this.init(),this._w=f,i.call(this,128,112)}r(d,n),d.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},d.prototype._hash=function(){var e=c.allocUnsafe(48);function t(t,a,r){e.writeInt32BE(t,r),e.writeInt32BE(a,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=d},82522:function(e,t,a){var r=a(81923),n=a(37833),i=a(6779).Buffer,c=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],f=new Array(160);function d(){this.init(),this._w=f,n.call(this,128,112)}function o(e,t,a){return a^e&(t^a)}function s(e,t,a){return e&t|a&(e|t)}function b(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function u(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function x(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0>>0?1:0}r(d,n),d.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},d.prototype._update=function(e){for(var t=this._w,a=0|this._ah,r=0|this._bh,n=0|this._ch,i=0|this._dh,f=0|this._eh,d=0|this._fh,g=0|this._gh,v=0|this._hh,y=0|this._al,w=0|this._bl,M=0|this._cl,_=0|this._dl,k=0|this._el,A=0|this._fl,S=0|this._gl,E=0|this._hl,B=0;B<32;B+=2)t[B]=e.readInt32BE(4*B),t[B+1]=e.readInt32BE(4*B+4);for(;B<160;B+=2){var T=t[B-30],P=t[B-30+1],I=h(T,P),C=l(P,T);T=t[B-4],P=t[B-4+1];var R=p(T,P),O=x(P,T),N=t[B-14],U=t[B-14+1],L=t[B-32],j=t[B-32+1],q=C+U|0,F=I+N+m(q,C)|0;q=q+O|0,F=F+R+m(q,O)|0,q=q+j|0,F=F+L+m(q,j)|0,t[B]=F,t[B+1]=q}for(var D=0;D<160;D+=2){F=t[D],q=t[D+1];var H=s(a,r,n),z=s(y,w,M),K=b(a,y),Z=b(y,a),G=u(f,k),V=u(k,f),W=c[D],J=c[D+1],X=o(f,d,g),Y=o(k,A,S),Q=E+V|0,$=v+G+m(Q,E)|0;Q=Q+Y|0,$=$+X+m(Q,Y)|0,Q=Q+J|0,$=$+W+m(Q,J)|0,Q=Q+q|0,$=$+F+m(Q,q)|0;var ee=Z+z|0,te=K+H+m(ee,Z)|0;v=g,E=S,g=d,S=A,d=f,A=k,k=_+Q|0,f=i+$+m(k,_)|0,i=n,_=M,n=r,M=w,r=a,w=y,y=Q+ee|0,a=$+te+m(y,Q)|0}this._al=this._al+y|0,this._bl=this._bl+w|0,this._cl=this._cl+M|0,this._dl=this._dl+_|0,this._el=this._el+k|0,this._fl=this._fl+A|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+a+m(this._al,y)|0,this._bh=this._bh+r+m(this._bl,w)|0,this._ch=this._ch+n+m(this._cl,M)|0,this._dh=this._dh+i+m(this._dl,_)|0,this._eh=this._eh+f+m(this._el,k)|0,this._fh=this._fh+d+m(this._fl,A)|0,this._gh=this._gh+g+m(this._gl,S)|0,this._hh=this._hh+v+m(this._hl,E)|0},d.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,a,r){e.writeInt32BE(t,r),e.writeInt32BE(a,r+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=d},36189:function(e,t,a){"use strict";a(21703),e.exports=(e,t)=>{if("string"!==typeof e||"string"!==typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const a=e.indexOf(t);return-1===a?[e]:[e.slice(0,a),e.slice(a+t.length)]}},19069:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},25605:function(e,t,a){"use strict";a(21703);var r=a(54304).Buffer,n=r.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){if(!e)return"utf8";var t;while(1)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function c(e){var t=i(e);if("string"!==typeof t&&(r.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}function f(e){var t;switch(this.encoding=c(e),this.encoding){case"utf16le":this.text=l,this.end=p,t=4;break;case"utf8":this.fillLast=b,t=4;break;case"base64":this.text=x,this.end=m,t=3;break;default:return this.write=g,void(this.end=v)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function d(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function o(e,t,a){var r=t.length-1;if(r=0?(n>0&&(e.lastNeed=n-1),n):--r=0?(n>0&&(e.lastNeed=n-2),n):--r=0?(n>0&&(2===n?n=0:e.lastNeed=n-3),n):0))}function s(e,t,a){if(128!==(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"�"}}function b(e){var t=this.lastTotal-this.lastNeed,a=s(this,e,t);return void 0!==a?a:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){var a=o(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=a;var r=e.length-(a-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function l(e,t){if((e.length-t)%2===0){var a=e.toString("utf16le",t);if(a){var r=a.charCodeAt(a.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],a.slice(0,-1)}return a}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,a)}return t}function x(e,t){var a=(e.length-t)%3;return 0===a?e.toString("base64",t):(this.lastNeed=3-a,this.lastTotal=3,1===a?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-a))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}t.s=f,f.prototype.write=function(e){if(0===e.length)return"";var t,a;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";a=this.lastNeed,this.lastNeed=0}else a=0;return a */ var r=a(15361),n=r.Buffer;function i(e,t){for(var a in e)t[a]=e[a]}function c(e,t,a){return n(e,t,a)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=c),c.prototype=Object.create(n.prototype),i(n,c),c.from=function(e,t,a){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,a)},c.alloc=function(e,t,a){if("number"!==typeof e)throw new TypeError("Argument must be a number");var r=n(e);return void 0!==t?"string"===typeof a?r.fill(t,a):r.fill(t):r.fill(0),r},c.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},c.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},99468:function(e,t,a){var r=a(44866);e.exports=function(e){return"string"!==typeof e?e:r(e)?e.slice(2):e}},81776:function(e,t,a){var r=function(){throw"This swarm.js function isn't available on the browser."},n={readFile:r},i={download:r,safeDownloadArchived:r,directoryTree:r},c={platform:r,arch:r},f={join:r,slice:r},d={spawn:r},o={lookup:r},s={},b=null,u=a(13123),h=a(33239),l=a(9193),p=a(77166),x=a(1717);e.exports=x({fs:n,files:i,os:c,path:f,child_process:d,defaultArchives:s,mimetype:o,request:u,downloadUrl:b,bytes:h,hash:l,pick:p})},77166:function(e,t,a){a(48675),a(3462);var r=function(e){return function(){return new Promise((function(t,a){var r,n=function(a){var r={},n=a.target.files.length,i=0;[].map.call(a.target.files,(function(a){var c=new FileReader;c.onload=function(c){var f=new Uint8Array(c.target.result);if("directory"===e){var d=a.webkitRelativePath;r[d.slice(d.indexOf("/")+1)]={type:"text/plain",data:f},++i===n&&t(r)}else if("file"===e){var o=a.webkitRelativePath;t({type:mimetype.lookup(o),data:f})}else t(f)},c.readAsArrayBuffer(a)}))};"directory"===e?(r=document.createElement("input"),r.addEventListener("change",n),r.type="file",r.webkitdirectory=!0,r.mozdirectory=!0,r.msdirectory=!0,r.odirectory=!0,r.directory=!0):(r=document.createElement("input"),r.addEventListener("change",n),r.type="file");var i=document.createEvent("MouseEvents");i.initEvent("click",!0,!1),r.dispatchEvent(i)}))}};e.exports={data:r("data"),file:r("file"),directory:r("directory")}},9193:function(e,t,a){var r=a(50849).keccak256,n=a(33239),i=function(e,t){var a=n.reverse(n.pad(6,n.fromNumber(e))),i=n.flatten([a,"0x0000",t]);return r(i).slice(2)},c=function e(t){"string"===typeof t&&"0x"!==t.slice(0,2)?t=n.fromString(t):"string"!==typeof t&&void 0!==t.length&&(t=n.fromUint8Array(t));var a=n.length(t);if(a<=4096)return i(a,t);var r=4096;while(128*r=400?r(new Error("Error ".concat(n.statusCode,"."))):a(new Uint8Array(t))}))}))}},g=function(e){return function(t){var a=function t(a){return function(r){return function(n){var i=function(e){return{type:e.contentType,hash:e.hash}},c=function(e){return void 0===e.path?Promise.resolve():"application/bzz-manifest+json"===e.contentType?t(e.hash)(r+e.path)(n):Promise.resolve(h(r+e.path)(i(e))(n))};return m(e)(a).then((function(e){return JSON.parse(q(e)).entries})).then((function(e){return Promise.all(e.map(c))})).then((function(){return n}))}}};return a(t)("")({})}},v=function(e){return function(t){return g(e)(t).then((function(e){return l(Object.keys(e))(Object.keys(e).map((function(t){return e[t].hash})))}))}},y=function(e){return function(t){return g(e)(t).then((function(t){var a=Object.keys(t),r=a.map((function(e){return t[e].hash})),n=a.map((function(e){return t[e].type})),i=r.map(m(e)),c=function(e){return e.map((function(e,t){return{type:n[t],data:e}}))};return Promise.all(i).then((function(e){return l(a)(c(e))}))}))}},w=function(e){return function(t){return function(r){return a.download(x(e)(t))(r)}}},M=function(e){return function(t){return function(a){return v(e)(t).then((function(t){var r=[];for(var i in t)if(i.length>0){var c=n.join(a,i);r.push(w(e)(t[i])(c))}return Promise.all(r).then((function(){return a}))}))}}},_=function(e){return function(t){return new Promise((function(a,r){var n={body:"string"===typeof t?F(t):t,method:"POST"};d("".concat(e,"/bzz-raw:/"),n,(function(e,t){return e?r(e):a(t)}))}))}},k=function(e){return function(t){return function(a){return function(r){var n=function n(i){var c="/"===a[0]?a:"/"+a,f="".concat(e,"/bzz:/").concat(t).concat(c),o={method:"PUT",headers:{"Content-Type":r.type},body:r.data};return new Promise((function(e,t){d(f,o,(function(a,r){return a?t(a):-1!==r.indexOf("error")?t(r):e(r)}))}))["catch"]((function(e){return i>0&&n(i-1)}))};return n(3)}}}},A=function(e){return function(t){return E(e)({"":t})}},S=function(e){return function(a){return t.readFile(a).then((function(t){return A(e)({type:c.lookup(a),data:t})}))}},E=function(e){return function(t){return _(e)("{}").then((function(a){var r=function(a){return function(r){return k(e)(r)(a)(t[a])}},n=function(e,t){return e.then(r(t))};return Object.keys(t).reduce(n,Promise.resolve(a))}))}},B=function(e){return function(a){return t.readFile(a).then(_(e))}},T=function(e){return function(r){return function(n){return a.directoryTree(n).then((function(e){return Promise.all(e.map((function(e){return t.readFile(e)}))).then((function(t){var a=e.map((function(e){return e.slice(n.length)})),r=e.map((function(e){return c.lookup(e)||"text/plain"}));return l(a)(t.map((function(e,t){return{type:r[t],data:e}})))}))})).then((function(e){return p(r?{"":e[r]}:{})(e)})).then(E(e))}}},P=function(e){return function(t){if("data"===t.pick)return u.data().then(_(e));if("file"===t.pick)return u.file().then(A(e));if("directory"===t.pick)return u.directory().then(E(e));if(t.path)switch(t.kind){case"data":return B(e)(t.path);case"file":return S(e)(t.path);case"directory":return T(e)(t.defaultFile)(t.path)}else{if(t.length||"string"===typeof t)return _(e)(t);if(t instanceof Object)return E(e)(t)}return Promise.reject(new Error("Bad arguments"))}},I=function(e){return function(t){return function(a){return L(e)(t).then((function(r){return r?a?M(e)(t)(a):y(e)(t):a?w(e)(t)(a):m(e)(t)}))}}},C=function(e,t){var n=r.platform().replace("win32","windows")+"-"+("x64"===r.arch()?"amd64":"386"),i=(t||f)[n],c=o+i.archive+".tar.gz",d=i.archiveMD5,s=i.binaryMD5;return a.safeDownloadArchived(c)(d)(s)(e)},R=function(e){return new Promise((function(t,a){var r=i.spawn,n=function(e){return function(t){return-1!==(""+t).indexOf(e)}},c=e.account,f=e.password,d=e.dataDir,o=e.ensApi,s=e.privateKey,b=0,u=1,h=2,l="Passphrase",p="Swarm http proxy started",x=b,m=r(e.binPath,["--bzzaccount",c||s,"--datadir",d,"--ens-api",o]),g=function(e){x===b&&n(l)(e)?setTimeout((function(){x=u,m.stdin.write(f+"\n")}),500):n(p)(e)&&(x=h,clearTimeout(y),t(m))};m.stdout.on("data",g),m.stderr.on("data",g);var v=function(){return a(new Error("Couldn't start swarm process."))},y=setTimeout(v,2e4)}))},O=function(e){return new Promise((function(t,a){e.stderr.removeAllListeners("data"),e.stdout.removeAllListeners("data"),e.stdin.removeAllListeners("error"),e.removeAllListeners("error"),e.removeAllListeners("exit"),e.kill("SIGINT");var r=setTimeout((function(){return e.kill("SIGKILL")}),8e3);e.once("close",(function(){clearTimeout(r),t()}))}))},N=function(e){return function(t){return U("http://localhost:8500").then((function(a){return a?t(D("http://localhost:8500")).then((function(){})):C(e.binPath,e.archives).onData((function(t){return(e.onProgress||function(){})(t.length)})).then((function(){return R(e)})).then((function(e){return t(D("http://localhost:8500")).then((function(){return e}))})).then(O)}))}},U=function(e){var t="test",a="c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7";return _(e)(t).then((function(e){return e===a}))["catch"]((function(){return!1}))},L=function(e){return function(t){return m(e)(t).then((function(e){try{return!!JSON.parse(q(e)).entries}catch(t){return!1}}))}},j=function(e){return function(t,a,r,n,i){var c;return"undefined"!==typeof t&&(c=e(t)),"undefined"!==typeof a&&(c=e(a)),"undefined"!==typeof r&&(c=e(r)),"undefined"!==typeof n&&(c=e(n)),"undefined"!==typeof i&&(c=e(i)),c}},q=function(e){return s.toString(s.fromUint8Array(e))},F=function(e){return s.toUint8Array(s.fromString(e))},D=function(e){return{download:function(t,a){return I(e)(t)(a)},downloadData:j(m(e)),downloadDataToDisk:j(w(e)),downloadDirectory:j(y(e)),downloadDirectoryToDisk:j(M(e)),downloadEntries:j(g(e)),downloadRoutes:j(v(e)),isAvailable:function(){return U(e)},upload:function(t){return P(e)(t)},uploadData:j(_(e)),uploadFile:j(A(e)),uploadFileFromDisk:j(A(e)),uploadDataFromDisk:j(B(e)),uploadDirectory:j(E(e)),uploadDirectoryFromDisk:j(T(e)),uploadToManifest:j(k(e)),pick:u,hash:b,fromString:F,toString:q}};return{at:D,local:N,download:I,downloadBinary:C,downloadData:m,downloadDataToDisk:w,downloadDirectory:y,downloadDirectoryToDisk:M,downloadEntries:g,downloadRoutes:v,isAvailable:U,startProcess:R,stopProcess:O,upload:P,uploadData:_,uploadDataFromDisk:B,uploadFile:A,uploadFileFromDisk:S,uploadDirectory:E,uploadDirectoryFromDisk:T,uploadToManifest:k,pick:u,hash:b,fromString:F,toString:q}}},83545:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,a=[],r=0;r=0;f--)(n=e[f])&&(c=(i<3?n(c):i>3?n(t,a,c):n(t,a))||c);return i>3&&c&&Object.defineProperty(t,a,c),c}function d(e,t){return function(a,r){t(a,r,e)}}function o(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function s(e,t,a,r){function n(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,i){function c(e){try{d(r.next(e))}catch(t){i(t)}}function f(e){try{d(r["throw"](e))}catch(t){i(t)}}function d(e){e.done?a(e.value):n(e.value).then(c,f)}d((r=r.apply(e,t||[])).next())}))}function b(e,t){var a,r,n,i,c={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:f(0),throw:f(1),return:f(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function f(e){return function(t){return d([e,t])}}function d(i){if(a)throw new TypeError("Generator is already executing.");while(c)try{if(a=1,r&&(n=2&i[0]?r["return"]:i[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,i[1])).done)return n;switch(r=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(n=c.trys,!(n=n.length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c}function x(){for(var e=[],t=0;t1||f(e,t)}))})}function f(e,t){try{d(n[e](t))}catch(a){b(i[0][3],a)}}function d(e){e.value instanceof v?Promise.resolve(e.value.v).then(o,s):b(i[0][2],e)}function o(e){f("next",e)}function s(e){f("throw",e)}function b(e,t){e(t),i.shift(),i.length&&f(i[0][0],i[0][1])}}function w(e){var t,a;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,n){t[r]=e[r]?function(t){return(a=!a)?{value:v(e[r](t)),done:"return"===r}:n?n(t):t}:n}}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,a=e[Symbol.asyncIterator];return a?a.call(e):(e="function"===typeof l?l(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(a){t[a]=e[a]&&function(t){return new Promise((function(r,i){t=e[a](t),n(r,i,t.done,t.value)}))}}function n(e,t,a,r){Promise.resolve(r).then((function(t){e({value:t,done:a})}),t)}}function _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var k=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t};function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&u(t,e,a);return k(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function E(e,t,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(e):r?r.value:t.get(e)}function B(e,t,a,r,n){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"===typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?n.call(e,a):n?n.value=a:t.set(e,a),a}},75519:function(e,t,a){var r=a(15361)["Buffer"],n=a(6513).strict;e.exports=function(e){if(n(e)){var t=r.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return r.from(e)}},27285:function(e){function t(e,t){if(t){t=t.trim().replace(/^(\?|#|&)/,""),t=t?"?"+t:t;var a=e.split(/[\?\#]/),r=a[0];t&&/\:\/\/[^\/]*$/.test(r)&&(r+="/");var n=e.match(/(\#.*)$/);e=r+t,n&&(e+=n[0])}return e}e.exports=t},62059:function(e,t,a){a(21703),function(e){var t,a,r,n=String.fromCharCode;function i(e){var t,a,r=[],n=0,i=e.length;while(n=55296&&t<=56319&&n65535&&(t-=65536,i+=n(t>>>10&1023|55296),t=56320|1023&t),i+=n(t);return i}function f(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function d(e,t){return n(e>>t&63|128)}function o(e){if(0==(4294967168&e))return n(e);var t="";return 0==(4294965248&e)?t=n(e>>6&31|192):0==(4294901760&e)?(f(e),t=n(e>>12&15|224),t+=d(e,6)):0==(4292870144&e)&&(t=n(e>>18&7|240),t+=d(e,12),t+=d(e,6)),t+=n(63&e|128),t}function s(e){var t,a=i(e),r=a.length,n=-1,c="";while(++n=a)throw Error("Invalid byte index");var e=255&t[r];if(r++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function u(){var e,n,i,c,d;if(r>a)throw Error("Invalid byte index");if(r==a)return!1;if(e=255&t[r],r++,0==(128&e))return e;if(192==(224&e)){if(n=b(),d=(31&e)<<6|n,d>=128)return d;throw Error("Invalid continuation byte")}if(224==(240&e)){if(n=b(),i=b(),d=(15&e)<<12|n<<6|i,d>=2048)return f(d),d;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=b(),i=b(),c=b(),d=(7&e)<<18|n<<12|i<<6|c,d>=65536&&d<=1114111))return d;throw Error("Invalid UTF-8 detected")}function h(e){t=i(e),a=t.length,r=0;var n,f=[];while(!1!==(n=u()))f.push(n);return c(f)}e.version="3.0.0",e.encode=s,e.decode=h}(t)},74633:function(e,t,a){function r(e,t){if(n("noDeprecation"))return e;var a=!1;function r(){if(!a){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),a=!0}return e.apply(this,arguments)}return r}function n(e){try{if(!a.g.localStorage)return!1}catch(r){return!1}var t=a.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}a(21703),e.exports=r},42051:function(e){e.exports=function(e){return e&&"object"===typeof e&&"function"===typeof e.copy&&"function"===typeof e.fill&&"function"===typeof e.readUInt8}},85716:function(e,t,a){"use strict";a(48675),a(3462),a(21703);var r=a(32773),n=a(84784),i=a(12591),c=a(18300);function f(e){return e.call.bind(e)}var d="undefined"!==typeof BigInt,o="undefined"!==typeof Symbol,s=f(Object.prototype.toString),b=f(Number.prototype.valueOf),u=f(String.prototype.valueOf),h=f(Boolean.prototype.valueOf);if(d)var l=f(BigInt.prototype.valueOf);if(o)var p=f(Symbol.prototype.valueOf);function x(e,t){if("object"!==typeof e)return!1;try{return t(e),!0}catch(a){return!1}}function m(e){return"undefined"!==typeof Promise&&e instanceof Promise||null!==e&&"object"===typeof e&&"function"===typeof e.then&&"function"===typeof e.catch}function g(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):c(e)||D(e)}function v(e){return"Uint8Array"===i(e)}function y(e){return"Uint8ClampedArray"===i(e)}function w(e){return"Uint16Array"===i(e)}function M(e){return"Uint32Array"===i(e)}function _(e){return"Int8Array"===i(e)}function k(e){return"Int16Array"===i(e)}function A(e){return"Int32Array"===i(e)}function S(e){return"Float32Array"===i(e)}function E(e){return"Float64Array"===i(e)}function B(e){return"BigInt64Array"===i(e)}function T(e){return"BigUint64Array"===i(e)}function P(e){return"[object Map]"===s(e)}function I(e){return"undefined"!==typeof Map&&(P.working?P(e):e instanceof Map)}function C(e){return"[object Set]"===s(e)}function R(e){return"undefined"!==typeof Set&&(C.working?C(e):e instanceof Set)}function O(e){return"[object WeakMap]"===s(e)}function N(e){return"undefined"!==typeof WeakMap&&(O.working?O(e):e instanceof WeakMap)}function U(e){return"[object WeakSet]"===s(e)}function L(e){return U(e)}function j(e){return"[object ArrayBuffer]"===s(e)}function q(e){return"undefined"!==typeof ArrayBuffer&&(j.working?j(e):e instanceof ArrayBuffer)}function F(e){return"[object DataView]"===s(e)}function D(e){return"undefined"!==typeof DataView&&(F.working?F(e):e instanceof DataView)}t.isArgumentsObject=r,t.isGeneratorFunction=n,t.isTypedArray=c,t.isPromise=m,t.isArrayBufferView=g,t.isUint8Array=v,t.isUint8ClampedArray=y,t.isUint16Array=w,t.isUint32Array=M,t.isInt8Array=_,t.isInt16Array=k,t.isInt32Array=A,t.isFloat32Array=S,t.isFloat64Array=E,t.isBigInt64Array=B,t.isBigUint64Array=T,P.working="undefined"!==typeof Map&&P(new Map),t.isMap=I,C.working="undefined"!==typeof Set&&C(new Set),t.isSet=R,O.working="undefined"!==typeof WeakMap&&O(new WeakMap),t.isWeakMap=N,U.working="undefined"!==typeof WeakSet&&U(new WeakSet),t.isWeakSet=L,j.working="undefined"!==typeof ArrayBuffer&&j(new ArrayBuffer),t.isArrayBuffer=q,F.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&F(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=D;var H="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function z(e){return"[object SharedArrayBuffer]"===s(e)}function K(e){return"undefined"!==typeof H&&("undefined"===typeof z.working&&(z.working=z(new H)),z.working?z(e):e instanceof H)}function Z(e){return"[object AsyncFunction]"===s(e)}function G(e){return"[object Map Iterator]"===s(e)}function V(e){return"[object Set Iterator]"===s(e)}function W(e){return"[object Generator]"===s(e)}function J(e){return"[object WebAssembly.Module]"===s(e)}function X(e){return x(e,b)}function Y(e){return x(e,u)}function Q(e){return x(e,h)}function $(e){return d&&x(e,l)}function ee(e){return o&&x(e,p)}function te(e){return X(e)||Y(e)||Q(e)||$(e)||ee(e)}function ae(e){return"undefined"!==typeof Uint8Array&&(q(e)||K(e))}t.isSharedArrayBuffer=K,t.isAsyncFunction=Z,t.isMapIterator=G,t.isSetIterator=V,t.isGeneratorObject=W,t.isWebAssemblyCompiledModule=J,t.isNumberObject=X,t.isStringObject=Y,t.isBooleanObject=Q,t.isBigIntObject=$,t.isSymbolObject=ee,t.isBoxedPrimitive=te,t.isAnyArrayBuffer=ae,["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9242:function(e,t,a){var r=a(96027);a(21703);var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),a={},r=0;r=n)return e;switch(e){case"%s":return String(r[a++]);case"%d":return Number(r[a++]);case"%j":try{return JSON.stringify(r[a++])}catch(t){return"[Circular]"}default:return e}})),f=r[a];a=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(a)?r.showHidden=a:a&&t._extend(r,a),S(r.showHidden)&&(r.showHidden=!1),S(r.depth)&&(r.depth=2),S(r.colors)&&(r.colors=!1),S(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),h(r,e,r.depth)}function s(e,t){var a=o.styles[t];return a?"["+o.colors[a][0]+"m"+e+"["+o.colors[a][1]+"m":e}function b(e,t){return e}function u(e){var t={};return e.forEach((function(e,a){t[e]=!0})),t}function h(e,a,r){if(e.customInspect&&a&&I(a.inspect)&&a.inspect!==t.inspect&&(!a.constructor||a.constructor.prototype!==a)){var n=a.inspect(r,e);return k(n)||(n=h(e,n,r)),n}var i=l(e,a);if(i)return i;var c=Object.keys(a),f=u(c);if(e.showHidden&&(c=Object.getOwnPropertyNames(a)),P(a)&&(c.indexOf("message")>=0||c.indexOf("description")>=0))return p(a);if(0===c.length){if(I(a)){var d=a.name?": "+a.name:"";return e.stylize("[Function"+d+"]","special")}if(E(a))return e.stylize(RegExp.prototype.toString.call(a),"regexp");if(T(a))return e.stylize(Date.prototype.toString.call(a),"date");if(P(a))return p(a)}var o,s="",b=!1,y=["{","}"];if(v(a)&&(b=!0,y=["[","]"]),I(a)){var w=a.name?": "+a.name:"";s=" [Function"+w+"]"}return E(a)&&(s=" "+RegExp.prototype.toString.call(a)),T(a)&&(s=" "+Date.prototype.toUTCString.call(a)),P(a)&&(s=" "+p(a)),0!==c.length||b&&0!=a.length?r<0?E(a)?e.stylize(RegExp.prototype.toString.call(a),"regexp"):e.stylize("[Object]","special"):(e.seen.push(a),o=b?x(e,a,r,f,c):c.map((function(t){return m(e,a,r,f,t,b)})),e.seen.pop(),g(o,s,y)):y[0]+s+y[1]}function l(e,t){if(S(t))return e.stylize("undefined","undefined");if(k(t)){var a="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(a,"string")}return _(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):w(t)?e.stylize("null","null"):void 0}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function x(e,t,a,r,n){for(var i=[],c=0,f=t.length;c-1&&(f=i?f.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+f.split("\n").map((function(e){return" "+e})).join("\n"))):f=e.stylize("[Circular]","special")),S(c)){if(i&&n.match(/^\d+$/))return f;c=JSON.stringify(""+n),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+f}function g(e,t,a){var r=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return r>60?a[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+a[1]:a[0]+t+" "+e.join(", ")+" "+a[1]}function v(e){return Array.isArray(e)}function y(e){return"boolean"===typeof e}function w(e){return null===e}function M(e){return null==e}function _(e){return"number"===typeof e}function k(e){return"string"===typeof e}function A(e){return"symbol"===typeof e}function S(e){return void 0===e}function E(e){return B(e)&&"[object RegExp]"===R(e)}function B(e){return"object"===typeof e&&null!==e}function T(e){return B(e)&&"[object Date]"===R(e)}function P(e){return B(e)&&("[object Error]"===R(e)||e instanceof Error)}function I(e){return"function"===typeof e}function C(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e}function R(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!c[e])if(f.test(e)){var a=r.pid;c[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,a,r)}}else c[e]=function(){};return c[e]},t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=a(85716),t.isArray=v,t.isBoolean=y,t.isNull=w,t.isNullOrUndefined=M,t.isNumber=_,t.isString=k,t.isSymbol=A,t.isUndefined=S,t.isRegExp=E,t.types.isRegExp=E,t.isObject=B,t.isDate=T,t.types.isDate=T,t.isError=P,t.types.isNativeError=P,t.isFunction=I,t.isPrimitive=C,t.isBuffer=a(42051);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function U(){var e=new Date,t=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",U(),t.format.apply(t,arguments))},t.inherits=a(81923),t._extend=function(e,t){if(!t||!B(t))return e;var a=Object.keys(t),r=a.length;while(r--)e[a[r]]=t[a[r]];return e};var j="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function q(e,t){if(!e){var a=new Error("Promise was rejected with a falsy value");a.reason=e,e=a}return t(e)}function F(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],a=0;a=o)throw i.bytes=0,new RangeError("Could not decode varint");a=e[d++],c+=f<28?(a&n)<=r);return i.bytes=d-t,c}},30799:function(e){e.exports=i;var t=128,a=127,r=~a,n=Math.pow(2,31);function i(e,a,c){a=a||[],c=c||0;var f=c;while(e>=n)a[c++]=255&e|t,e/=128;while(e&r)a[c++]=255&e|t,e>>>=7;return a[c]=0|e,i.bytes=c-f+1,a}},42611:function(e,t,a){e.exports={encode:a(30799),decode:a(12706),encodingLength:a(63303)}},63303:function(e){var t=Math.pow(2,7),a=Math.pow(2,14),r=Math.pow(2,21),n=Math.pow(2,28),i=Math.pow(2,35),c=Math.pow(2,42),f=Math.pow(2,49),d=Math.pow(2,56),o=Math.pow(2,63);e.exports=function(e){return e1?(e[a[0]]=e[a[0]]||{},e[a[0]][a[1]]=t):e[a[0]]=t},o.prototype.getCall=function(e){return"function"===typeof this.call?this.call(e):this.call},o.prototype.extractCallback=function(e){if("function"===typeof e[e.length-1])return e.pop()},o.prototype.validateArgs=function(e){if(e.length!==this.params)throw r.InvalidNumberOfParams(e.length,this.params,this.name)},o.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(a,r){return a?a.call(t,e[r]):e[r]})):e},o.prototype.formatOutput=function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.outputFormatter&&e?t.outputFormatter(e):e})):this.outputFormatter&&e?this.outputFormatter(e):e},o.prototype.toPayload=function(e){var t=this.getCall(e),a=this.extractCallback(e),r=this.formatInput(e);this.validateArgs(r);var n={method:t,params:r,callback:a};return this.transformPayload&&(n=this.transformPayload(n)),n},o.prototype._confirmTransaction=function(e,t,a){var s=this,b=!1,u=!0,h=0,l=0,p=null,x=null,m=null,g=a.params[0]&&"object"===typeof a.params[0]&&a.params[0].gas?a.params[0].gas:null,v=!!a.params[0]&&"object"===typeof a.params[0]&&a.params[0].data&&a.params[0].from&&!a.params[0].to,y=v&&a.params[0].data.length>2,w=[new o({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[n.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:n.outputBlockFormatter}),new o({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:n.outputTransactionReceiptFormatter}),new o({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[n.inputAddressFormatter,n.inputDefaultBlockNumberFormatter]}),new o({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:n.outputTransactionFormatter}),new f({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:n.outputBlockFormatter}}})],M={};w.forEach((e=>{e.attachToObject(M),e.requestManager=s.requestManager}));var _=function(f,o,w,_,k){if(!w)return k||(k={unsubscribe:function(){clearInterval(p),clearTimeout(x)}}),(f?c.resolve(f):M.getTransactionReceipt(t)).catch((function(t){k.unsubscribe(),b=!0,i._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)})).then((async function(t){if(!t||!t.blockHash)throw new Error("Receipt missing or blockHash null");if(s.extraFormatters&&s.extraFormatters.receiptFormatter&&(t=s.extraFormatters.receiptFormatter(t)),e.eventEmitter.listeners("confirmation").length>0){var a;if(void 0===f||0!==l){var r=await M.getBlockByNumber("latest"),n=r?r.hash:null;o?m?(a=await M.getBlockByNumber(m.number+1),a&&(m=a,e.eventEmitter.emit("confirmation",l,t,n))):(a=await M.getBlockByNumber(t.blockNumber),m=a,e.eventEmitter.emit("confirmation",l,t,n)):e.eventEmitter.emit("confirmation",l,t,n)}(o&&a||!o)&&l++,u=!1,l===s.transactionConfirmationBlocks+1&&(k.unsubscribe(),e.eventEmitter.removeAllListeners())}return t})).then((async function(t){if(v&&!b){if(!t.contractAddress)return u&&(k.unsubscribe(),b=!0),void i._fireError(r.NoContractAddressFoundError(t),e.eventEmitter,e.reject,null,t);var a;try{a=await M.getCode(t.contractAddress)}catch(w){}if(!a)return;var n=!0===t.status&&y;n||a.length>2?(e.eventEmitter.emit("receipt",t),s.extraFormatters&&s.extraFormatters.contractDeployFormatter?e.resolve(s.extraFormatters.contractDeployFormatter(t)):e.resolve(t),u&&e.eventEmitter.removeAllListeners()):i._fireError(r.ContractCodeNotStoredError(t),e.eventEmitter,e.reject,null,t),u&&k.unsubscribe(),b=!0}return t})).then((async function(t){if(!v&&!b){if(t.outOfGas||g&&g===t.gasUsed||!0!==t.status&&"0x1"!==t.status&&"undefined"!==typeof t.status)if(JSON.stringify(t,null,2),!1===t.status||"0x0"===t.status)try{var c=null;if(!s.handleRevert||"eth_sendTransaction"!==s.call&&"eth_sendRawTransaction"!==s.call)throw!1;var f=a.params[0];if("eth_sendRawTransaction"===s.call){var o=a.params[0],h=d.parse(o);f=n.inputTransactionFormatter({data:h.data,to:h.to,from:h.from,gas:h.gasLimit.toHexString(),gasPrice:h.gasPrice.toHexString(),value:h.value.toHexString()})}if(c=await s.getRevertReason(f,t.blockNumber),!c)throw!1;i._fireError(r.TransactionRevertInstructionError(c.reason,c.signature,t),e.eventEmitter,e.reject,null,t)}catch(l){i._fireError(r.TransactionRevertedWithoutReasonError(t),e.eventEmitter,e.reject,null,t)}else i._fireError(r.TransactionOutOfGasError(t),e.eventEmitter,e.reject,null,t);else e.eventEmitter.emit("receipt",t),e.resolve(t),u&&e.eventEmitter.removeAllListeners();u&&k.unsubscribe(),b=!0}})).catch((function(){h++,o?h-1>=s.transactionPollingTimeout&&(k.unsubscribe(),b=!0,i._fireError(r.TransactionError("Transaction was not mined within "+s.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):h-1>=s.transactionBlockTimeout&&(k.unsubscribe(),b=!0,i._fireError(r.TransactionError("Transaction was not mined within "+s.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))}));k.unsubscribe(),b=!0,i._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:w},e.eventEmitter,e.reject)},k=function(e){let t=!1;const a=()=>{p=setInterval(_.bind(null,e,!0),s.transactionPollingInterval)};if(!this.requestManager.provider.on)return a();M.subscribe("newBlockHeaders",(function(r,n,i){if(t=!0,r||!n)return a();_(e,!1,r,n,i)})),x=setTimeout((()=>{t||a()}),1e3*this.blockHeaderTimeout)}.bind(this);M.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&k(t),_(t,!1)):b||k()})).catch((function(){b||k()}))};var s=function(e,t){var a=null;return a="number"===typeof e?t.wallet[e]:e&&"object"===typeof e&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()],a};function b(e,t){return new Promise(((a,r)=>{try{var n=new o({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?i.toHex(e):"latest"},function(){return!1}]}).createFunction(e.requestManager),c=new o({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);Promise.all([n(),c()]).then((e=>{const[r,n]=e;if(("0x2"===t.type||void 0===t.type)&&r&&r.baseFeePerGas){let e,n;t.gasPrice?(e=t.gasPrice,n=t.gasPrice,delete t.gasPrice):(e=t.maxPriorityFeePerGas||"0x9502F900",n=t.maxFeePerGas||i.toHex(i.toBN(r.baseFeePerGas).mul(i.toBN(2)).add(i.toBN(e)))),a({maxFeePerGas:n,maxPriorityFeePerGas:e})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");a({gasPrice:n})}}))}catch(f){r(f)}}))}o.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,a="eth_call"===e.call,n=function(){var n=c(!t),f=e.toPayload(Array.prototype.slice.call(arguments)),d=function(c,d){var o;if(e.handleRevert&&a&&e.abiCoder&&(!c&&e.isRevertReasonString(d)?o=d.substring(10):c&&c.data&&(o=c.data.substring(10)),o)){var s=e.abiCoder.decodeParameter("string","0x"+o),b="Error(String)";return void i._fireError(r.RevertInstructionError(s,b),n.eventEmitter,n.reject,f.callback,{reason:s,signature:b})}try{d=e.formatOutput(d)}catch(u){c=u}if(d instanceof Error&&(c=d),c)return c.error&&(c=c.error),i._fireError(c,n.eventEmitter,n.reject,f.callback);f.callback&&f.callback(null,d),t?(n.eventEmitter.emit("transactionHash",d),e._confirmTransaction(n,d,f)):c||n.resolve(d)},o=function(t){var a={...f,method:"eth_sendRawTransaction",params:[t.rawTransaction]};e.requestManager.send(a,d)},u=function(e,t){var a;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var r=e.params[0];if(a=s(r&&"object"===typeof r?r.from:null,t.accounts),a&&a.privateKey){r=JSON.parse(JSON.stringify(r));return delete r.from,t.defaultChain&&!r.chain&&(r.chain=t.defaultChain),t.defaultHardfork&&!r.hardfork&&(r.hardfork=t.defaultHardfork),t.defaultCommon&&!r.common&&(r.common=t.defaultCommon),void t.accounts.signTransaction(r,a.privateKey).then(o).catch((function(e){if("function"===typeof n.eventEmitter.listeners&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",e)}catch(e){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(e)}))}}else if("eth_sign"===e.method){var i=e.params[1];if(a=s(e.params[0],t.accounts),a&&a.privateKey){var c=t.accounts.sign(i,a.privateKey);return e.callback&&e.callback(null,c.signature),void n.resolve(c.signature)}}return t.requestManager.send(e,d)};return t&&f.params[0]&&"object"===typeof f.params[0]&&"undefined"===typeof f.params[0].gasPrice&&("undefined"===typeof f.params[0].maxPriorityFeePerGas||"undefined"===typeof f.params[0].maxFeePerGas)?b(e,f.params[0]).then((a=>{void 0!==a.gasPrice?f.params[0].gasPrice=a.gasPrice:void 0!==a.maxPriorityFeePerGas&&void 0!==a.maxFeePerGas&&(f.params[0].maxPriorityFeePerGas=a.maxPriorityFeePerGas,f.params[0].maxFeePerGas=a.maxFeePerGas),t&&setTimeout((()=>{n.eventEmitter.emit("sending",f)}),0),u(f,e)})):(t&&setTimeout((()=>{n.eventEmitter.emit("sending",f)}),0),u(f,e)),t&&setTimeout((()=>{n.eventEmitter.emit("sent",f)}),0),n.eventEmitter};return n.method=e,n.request=this.request.bind(this),n},o.prototype.getRevertReason=function(e,t){var a=this;return new Promise((function(r,n){new o({name:"call",call:"eth_call",params:2,abiCoder:a.abiCoder,handleRevert:!0}).createFunction(a.requestManager)(e,i.numberToHex(t)).then((function(){r(!1)})).catch((function(e){e.reason?r({reason:e.reason,signature:e.signature}):n(e)}))}))},o.prototype.isRevertReasonString=function(e){return"string"===typeof e&&(e.length-2)/2%32===4&&"0x08c379a0"===e.substring(0,10)},o.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=o},80165:function(e,t,a){"use strict";var r=a(35669),n=function(e){var t,a,n=new Promise((function(){t=arguments[0],a=arguments[1]}));if(e)return{resolve:t,reject:a,eventEmitter:n};var i=new r;return n._events=i._events,n.emit=i.emit,n.on=i.on,n.once=i.once,n.off=i.off,n.listeners=i.listeners,n.addListener=i.addListener,n.removeListener=i.removeListener,n.removeAllListeners=i.removeAllListeners,{resolve:t,reject:a,eventEmitter:n}};n.resolve=function(e){var t=n(!0);return t.resolve(e),t.eventEmitter},e.exports=n},35669:function(e,t,a){"use strict";a(21703);var r=Object.prototype.hasOwnProperty,n="~";function i(){}function c(e,t,a){this.fn=e,this.context=t,this.once=a||!1}function f(e,t,a,r,i){if("function"!==typeof a)throw new TypeError("The listener must be a function");var f=new c(a,r||e,i),d=n?n+t:t;return e._events[d]?e._events[d].fn?e._events[d]=[e._events[d],f]:e._events[d].push(f):(e._events[d]=f,e._eventsCount++),e}function d(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,t,a=[];if(0===this._eventsCount)return a;for(t in e=this._events)r.call(e,t)&&a.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=n?n+e:e,a=this._events[t];if(!a)return[];if(a.fn)return[a.fn];for(var r=0,i=a.length,c=new Array(i);re.id-t.id))},e.exports=i},6863:function(e,t,a){"use strict";a(21703);var r=null,n="object"===typeof globalThis?globalThis:void 0;if(!n)try{n=Function("return this")()}catch(i){n=self}"undefined"!==typeof n.ethereum?r=n.ethereum:"undefined"!==typeof n.web3&&n.web3.currentProvider&&(n.web3.currentProvider.sendAsync&&(n.web3.currentProvider.send=n.web3.currentProvider.sendAsync,delete n.web3.currentProvider.sendAsync),!n.web3.currentProvider.on&&n.web3.currentProvider.connection&&"ipcProviderWrapper"===n.web3.currentProvider.connection.constructor.name&&(n.web3.currentProvider.on=function(e,t){if("function"!==typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.connection.on("data",(function(e){var a="";e=e.toString();try{a=JSON.parse(e)}catch(i){return t(new Error("Couldn't parse response data"+e))}a.id||-1===a.method.indexOf("_subscription")||t(null,a)}));break;default:this.connection.on(e,t);break}}),r=n.web3.currentProvider),e.exports=r},37073:function(e,t,a){"use strict";a(21703);const{callbackify:r}=a(9242);var n=a(11205).errors,i=a(65675),c=a(11494),f=a(6863),d=function e(t,a){this.provider=null,this.providers=e.providers,this.setProvider(t,a),this.subscriptions=new Map};d.givenProvider=f,d.providers={WebsocketProvider:a(62990),HttpProvider:a(78170),IpcProvider:a(9510)},d.prototype.setProvider=function(e,t){var a=this;if(e&&"string"===typeof e&&this.providers)if(/^http(s)?:\/\//i.test(e))e=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))e=new this.providers.WebsocketProvider(e);else if(e&&"object"===typeof t&&"function"===typeof t.connect)e=new this.providers.IpcProvider(e,t);else if(e)throw new Error("Can't autodetect provider for \""+e+'"');if(this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=e||null,this.provider&&this.provider.on){"function"===typeof e.request?this.provider.on("message",(function(e){if(e&&"eth_subscription"===e.type&&e.data){const t=e.data;t.subscription&&a.subscriptions.has(t.subscription)&&a.subscriptions.get(t.subscription).callback(null,t.result)}})):this.provider.on("data",(function(e,t){e=e||t,e.method&&e.params&&e.params.subscription&&a.subscriptions.has(e.params.subscription)&&a.subscriptions.get(e.params.subscription).callback(null,e.params.result)})),this.provider.on("connect",(function(){a.subscriptions.forEach((function(e){e.subscription.resubscribe()}))})),this.provider.on("error",(function(e){a.subscriptions.forEach((function(t){t.callback(e)}))}));const t=function(e){a._isCleanCloseEvent(e)&&!a._isIpcCloseError(e)||(a.subscriptions.forEach((function(t){t.callback(n.ConnectionCloseError(e)),a.subscriptions.delete(t.subscription.id)})),a.provider&&a.provider.emit&&a.provider.emit("error",n.ConnectionCloseError(e))),a.provider&&a.provider.emit&&a.provider.emit("end",e)};this.provider.on("close",t),this.provider.on("disconnect",t)}},d.prototype.send=function(e,t){if(t=t||function(){},!this.provider)return t(n.InvalidProvider());const{method:a,params:c}=e,f=i.toPayload(a,c),d=this._jsonrpcResultCallback(t,f);if(this.provider.request){const e=r(this.provider.request.bind(this.provider)),n={method:a,params:c};e(n,t)}else if(this.provider.sendAsync)this.provider.sendAsync(f,d);else{if(!this.provider.send)throw new Error("Provider does not have a request or send method to use.");this.provider.send(f,d)}},d.prototype.sendBatch=function(e,t){if(!this.provider)return t(n.InvalidProvider());var a=i.toBatchPayload(e);this.provider[this.provider.sendAsync?"sendAsync":"send"](a,(function(e,a){return e?t(e):Array.isArray(a)?void t(null,a):t(n.InvalidResponse(a))}))},d.prototype.addSubscription=function(e,t){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions.set(e.id,{callback:t,subscription:e})},d.prototype.removeSubscription=function(e,t){if(this.subscriptions.has(e)){var a=this.subscriptions.get(e).subscription.options.type;return this.subscriptions.delete(e),void this.send({method:a+"_unsubscribe",params:[e]},t)}"function"===typeof t&&t(null)},d.prototype.clearSubscriptions=function(e){try{var t=this;return this.subscriptions.size>0&&this.subscriptions.forEach((function(a,r){e&&"syncing"===a.name||t.removeSubscription(r)})),this.provider.reset&&this.provider.reset(),!0}catch(a){throw new Error(`Error while clearing subscriptions: ${a}`)}},d.prototype._isCleanCloseEvent=function(e){return"object"===typeof e&&([1e3].includes(e.code)||!0===e.wasClean)},d.prototype._isIpcCloseError=function(e){return"boolean"===typeof e&&e},d.prototype._jsonrpcResultCallback=function(e,t){return function(a,r){return r&&r.id&&t.id!==r.id?e(new Error(`Wrong response id ${r.id} (expected: ${t.id}) in ${JSON.stringify(t)}`)):a?e(a):r&&r.error?e(n.ErrorResponse(r)):i.isValidResponse(r)?void e(null,r.result):e(n.InvalidResponse(r))}},e.exports={Manager:d,BatchManager:c}},65675:function(e,t,a){"use strict";a(21703);var r={messageId:0,toPayload:function(e,t){if(!e)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(t)+'"!');return r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:e,params:t||[]}},isValidResponse:function(e){return Array.isArray(e)?e.every(t):t(e);function t(e){return!!e&&!e.error&&"2.0"===e.jsonrpc&&("number"===typeof e.id||"string"===typeof e.id)&&void 0!==e.result}},toBatchPayload:function(e){return e.map((function(e){return r.toPayload(e.method,e.params)}))}};e.exports=r},84598:function(e,t,a){"use strict";var r=a(1123),n=function(e){this.name=e.name,this.type=e.type,this.subscriptions=e.subscriptions||{},this.requestManager=null};n.prototype.setRequestManager=function(e){this.requestManager=e},n.prototype.attachToObject=function(e){var t=this.buildCall(),a=this.name.split(".");a.length>1?(e[a[0]]=e[a[0]]||{},e[a[0]][a[1]]=t):e[a[0]]=t},n.prototype.buildCall=function(){var e=this;return function(){e.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var t=new r({subscription:e.subscriptions[arguments[0]]||{},requestManager:e.requestManager,type:e.type});return t.subscribe.apply(t,arguments)}},e.exports={subscriptions:n,subscription:r}},1123:function(e,t,a){"use strict";a(21703);var r=a(11205).errors,n=a(85592),i=a(11205).formatters;function c(e){return e}function f(e){n.call(this),this.id=null,this.callback=c,this.arguments=null,this.lastBlock=null,this.options={subscription:e.subscription,type:e.type,requestManager:e.requestManager}}f.prototype=Object.create(n.prototype),f.prototype.constructor=f,f.prototype._extractCallback=function(e){if("function"===typeof e[e.length-1])return e.pop()},f.prototype._validateArgs=function(e){var t=this.options.subscription;if(t||(t={}),t.params||(t.params=0),e.length!==t.params)throw r.InvalidNumberOfParams(e.length,t.params,t.subscriptionName)},f.prototype._formatInput=function(e){var t=this.options.subscription;if(!t)return e;if(!t.inputFormatter)return e;var a=t.inputFormatter.map((function(t,a){return t?t(e[a]):e[a]}));return a},f.prototype._formatOutput=function(e){var t=this.options.subscription;return t&&t.outputFormatter&&e?t.outputFormatter(e):e},f.prototype._toPayload=function(e){var t=[];if(this.callback=this._extractCallback(e)||c,this.subscriptionMethod||(this.subscriptionMethod=e.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(e),this._validateArgs(this.arguments),e=[]),t.push(this.subscriptionMethod),t=t.concat(this.arguments),e.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:t}},f.prototype.unsubscribe=function(e){this.options.requestManager.removeSubscription(this.id,e),this.id=null,this.lastBlock=null,this.removeAllListeners()},f.prototype.subscribe=function(){var e=this,t=Array.prototype.slice.call(arguments),a=this._toPayload(t);if(!a)return this;if(!this.options.requestManager.provider)return setTimeout((function(){var t=new Error("No provider set.");e.callback(t,null,e),e.emit("error",t)}),0),this;if(!this.options.requestManager.provider.on)return setTimeout((function(){var t=new Error("The current provider doesn't support subscriptions: "+e.options.requestManager.provider.constructor.name);e.callback(t,null,e),e.emit("error",t)}),0),this;if(this.lastBlock&&this.options.params&&"object"===typeof this.options.params&&(a.params[1]=this.options.params,a.params[1].fromBlock=i.inputBlockNumberFormatter(this.lastBlock+1)),this.id&&this.unsubscribe(),this.options.params=a.params[1],"logs"===a.params[0]&&a.params[1]&&"object"===typeof a.params[1]&&a.params[1].hasOwnProperty("fromBlock")&&isFinite(a.params[1].fromBlock)){var r=Object.assign({},a.params[1]);this.options.requestManager.send({method:"eth_getLogs",params:[r]},(function(t,a){t?setTimeout((function(){e.callback(t,null,e),e.emit("error",t)}),0):a.forEach((function(t){var a=e._formatOutput(t);e.callback(null,a,e),e.emit("data",a)}))}))}return"object"===typeof a.params[1]&&delete a.params[1].fromBlock,this.options.requestManager.send(a,(function(t,r){!t&&r?(e.id=r,e.method=a.params[0],e.options.requestManager.addSubscription(e,(function(t,a){t?(e.callback(t,!1,e),e.emit("error",t)):(Array.isArray(a)||(a=[a]),a.forEach((function(t){var a=e._formatOutput(t);if(e.lastBlock=a&&"object"===typeof a?a.blockNumber:null,"function"===typeof e.options.subscription.subscriptionHandler)return e.options.subscription.subscriptionHandler.call(e,a);e.emit("data",a),e.callback(null,a,e)})))})),e.emit("connected",r)):setTimeout((function(){e.callback(t,!1,e),e.emit("error",t)}),0)})),this},f.prototype.resubscribe=function(){this.options.requestManager.removeSubscription(this.id),this.id=null,this.subscribe(this.callback)},e.exports=f},85592:function(e,t,a){"use strict";a(21703);var r=Object.prototype.hasOwnProperty,n="~";function i(){}function c(e,t,a){this.fn=e,this.context=t,this.once=a||!1}function f(e,t,a,r,i){if("function"!==typeof a)throw new TypeError("The listener must be a function");var f=new c(a,r||e,i),d=n?n+t:t;return e._events[d]?e._events[d].fn?e._events[d]=[e._events[d],f]:e._events[d].push(f):(e._events[d]=f,e._eventsCount++),e}function d(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,t,a=[];if(0===this._eventsCount)return a;for(t in e=this._events)r.call(e,t)&&a.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=n?n+e:e,a=this._events[t];if(!a)return[];if(a.fn)return[a.fn];for(var r=0,i=a.length,c=new Array(i);r{if(t=Array.prototype.slice.call(t),!e)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(e,"currentProvider",{get:()=>e._provider,set:t=>e.setProvider(t),enumerable:!0,configurable:!0}),t[0]&&t[0]._requestManager?e._requestManager=t[0]._requestManager:e._requestManager=new r.Manager(t[0],t[1]),e.givenProvider=r.Manager.givenProvider,e.providers=r.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=(t,a)=>(e._requestManager.setProvider(t,a),e._provider=e._requestManager.provider,!0)),e.setRequestManager=t=>{e._requestManager=t,e._provider=t.provider},e.BatchRequest=r.BatchManager.bind(null,e._requestManager),e.extend=n(e)},c=e=>{e.givenProvider=r.Manager.givenProvider,e.providers=r.Manager.providers};e.exports={packageInit:i,addProviders:c}},90056:function(e,t,a){a(21703);var r=a(15361).Buffer,n=a(77802),i=a(50534).RQ,c=a(50534)._R,f=new i((function(e,t){return!e.match(/^u?int/)||Array.isArray(t)||t&&"object"===typeof t&&"BN"===t.constructor.name?t:t.toString()}));function d(){}var o=function(){};o.prototype.encodeFunctionSignature=function(e){return("function"===typeof e||"object"===typeof e&&e)&&(e=n._jsonInterfaceMethodToString(e)),n.sha3(e).slice(0,10)},o.prototype.encodeEventSignature=function(e){return("function"===typeof e||"object"===typeof e&&e)&&(e=n._jsonInterfaceMethodToString(e)),n.sha3(e)},o.prototype.encodeParameter=function(e,t){return this.encodeParameters([e],[t])},o.prototype.encodeParameters=function(e,t){var a=this;return e=a.mapTypes(e),t=t.map((function(t,r){let n=e[r];if("object"===typeof n&&n.type&&(n=n.type),t=a.formatParam(n,t),"string"===typeof n&&n.includes("tuple")){const e=f._getCoder(c.from(n)),r=(e,t)=>{if("array"===e.name)return t.map((t=>r(f._getCoder(c.from(e.type.replace("[]",""))),t)));e.coders.forEach(((e,n)=>{"tuple"===e.name?r(e,t[n]):t[n]=a.formatParam(e.name,t[n])}))};r(e,t)}return t})),f.encode(e,t)},o.prototype.mapTypes=function(e){var t=this,a=[];return e.forEach((function(e){if("object"===typeof e&&"function"===e.type&&(e=Object.assign({},e,{type:"bytes24"})),t.isSimplifiedStructFormat(e)){var r=Object.keys(e)[0];a.push(Object.assign(t.mapStructNameAndType(r),{components:t.mapStructToCoderFormat(e[r])}))}else a.push(e)})),a},o.prototype.isSimplifiedStructFormat=function(e){return"object"===typeof e&&"undefined"===typeof e.components&&"undefined"===typeof e.name},o.prototype.mapStructNameAndType=function(e){var t="tuple";return e.indexOf("[]")>-1&&(t="tuple[]",e=e.slice(0,-2)),{type:t,name:e}},o.prototype.mapStructToCoderFormat=function(e){var t=this,a=[];return Object.keys(e).forEach((function(r){"object"!==typeof e[r]?a.push({name:r,type:e[r]}):a.push(Object.assign(t.mapStructNameAndType(r),{components:t.mapStructToCoderFormat(e[r])}))})),a},o.prototype.formatParam=function(e,t){const a=new RegExp(/^bytes([0-9]*)$/),i=new RegExp(/^bytes([0-9]*)\[\]$/),c=new RegExp(/^(u?int)([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)\[\]$/);if(n.isBN(t)||n.isBigNumber(t))return t.toString(10);if(e.match(i)||e.match(f))return t.map((t=>this.formatParam(e.replace("[]",""),t)));let d=e.match(c);if(d){let e=parseInt(d[2]||"256");e/80&&(!t||"0x"===t||"0X"===t))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var r=f.decode(this.mapTypes(e),"0x"+t.replace(/0x/i,""),a),n=new d;return n.__length__=0,e.forEach((function(e,t){var a=r[n.__length__];const i="object"===typeof e&&e.type&&"string"===e.type,c="string"===typeof e&&"string"===e;a="0x"!==a||i||c?a:null,n[t]=a,("function"===typeof e||e&&"object"===typeof e)&&e.name&&(n[e.name]=a),n.__length__++})),n},o.prototype.decodeLog=function(e,t,a){var r=this;a=Array.isArray(a)?a:[a],t=t||"";var n=[],i=[],c=0;e.forEach((function(e,t){e.indexed?(i[t]=["bool","int","uint","address","fixed","ufixed"].find((function(t){return-1!==e.type.indexOf(t)}))?r.decodeParameter(e.type,a[c]):a[c],c++):n[t]=e}));var f=t,o=f?this.decodeParametersWith(n,f,!0):[],s=new d;return s.__length__=0,e.forEach((function(e,t){s[t]="string"===e.type?"":null,"undefined"!==typeof o[t]&&(s[t]=o[t]),"undefined"!==typeof i[t]&&(s[t]=i[t]),e.name&&(s[e.name]=s[t]),s.__length__++})),s};var s=new o;e.exports=s},73519:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=a(36603),i=a(79021),c=a(33053),f="undefined"===typeof a.g?a(59821):a(11875),d=a(80014),o=a(48109),s=a(77802),b=a(11205),{TransactionFactory:u}=a(89883),h=a(82099)["default"],l=a(82099).Hardfork,p=a(96380),x=function(e){return"undefined"===typeof e||null===e},m=function(e){return"undefined"!==typeof e&&null!==e},g=function(){var e=this;n.packageInit(this,arguments),delete this.BatchRequest,delete this.extend;var t=[new i({name:"getNetworkId",call:"net_version",params:0,outputFormatter:parseInt}),new i({name:"getChainId",call:"eth_chainId",params:0,outputFormatter:s.hexToNumber}),new i({name:"getGasPrice",call:"eth_gasPrice",params:0}),new i({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[function(e){if(s.isAddress(e))return e;throw new Error("Address "+e+' is not a valid address to get the "transactionCount".')},function(){return"latest"}]}),new i({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?s.toHex(e):"latest"},function(){return!1}]})];this._ethereumCall={},t.forEach((t=>{t.attachToObject(e._ethereumCall),t.setRequestManager(e._requestManager)})),this.wallet=new M(this)};function v(e){if(e.common&&e.chain&&e.hardfork)return new Error("Please provide the @ethereumjs/common object or the chain and hardfork property but not all together.");if(e.chain&&!e.hardfork||e.hardfork&&!e.chain)return new Error('When specifying chain and hardfork, both values must be defined. Received "chain": '+e.chain+', "hardfork": '+e.hardfork);if(!e.gas&&!e.gasLimit&&!e.maxPriorityFeePerGas&&!e.maxFeePerGas)return new Error('"gas" is missing');if(e.gas&&e.gasPrice){if(e.gas<0||e.gasPrice<0)return new Error("Gas or gasPrice is lower than 0")}else if(e.maxPriorityFeePerGas<0||e.maxFeePerGas<0)return new Error("maxPriorityFeePerGas or maxFeePerGas is lower than 0");return e.nonce<0||e.chainId<0?new Error("Nonce or chainId is lower than 0"):void 0}function y(e){const t=void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas;let a;if(void 0!==e.type?a=s.toHex(e.type):void 0===e.type&&t&&(a="0x2"),void 0!==e.gasPrice&&("0x2"===a||t))throw Error("eip-1559 transactions don't support gasPrice");if(("0x1"===a||"0x0"===a)&&t)throw Error("pre-eip-1559 transaction don't support maxFeePerGas/maxPriorityFeePerGas");return t||e.common&&e.common.hardfork&&e.common.hardfork.toLowerCase()===l.London||e.hardfork&&e.hardfork.toLowerCase()===l.London?a="0x2":(e.accessList||e.common&&e.common.hardfork&&e.common.hardfork.toLowerCase()===l.Berlin||e.hardfork&&e.hardfork.toLowerCase()===l.Berlin)&&(a="0x1"),a}function w(e,t){return new Promise(((a,r)=>{try{(void 0===t.type||t.type<"0x2")&&void 0!==t.gasPrice?a({gasPrice:t.gasPrice}):Promise.all([e._ethereumCall.getBlockByNumber(),e._ethereumCall.getGasPrice()]).then((e=>{const[r,n]=e;if("0x2"===t.type&&r&&r.baseFeePerGas){let e,n;t.gasPrice?(e=t.gasPrice,n=t.gasPrice,delete t.gasPrice):(e=t.maxPriorityFeePerGas||"0x9502F900",n=t.maxFeePerGas||s.toHex(s.toBN(r.baseFeePerGas).mul(s.toBN(2)).add(s.toBN(e)))),a({maxFeePerGas:n,maxPriorityFeePerGas:e})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");a({gasPrice:n})}}))}catch(n){r(n)}}))}function M(e){this._accounts=e,this.length=0,this.defaultKeyName="web3js_wallet"}function _(e){var t;try{t=self[e];var a="__storage_test__";return t.setItem(a,a),t.removeItem(a),!0}catch(r){return r&&(22===r.code||1014===r.code||"QuotaExceededError"===r.name||"NS_ERROR_DOM_QUOTA_REACHED"===r.name)&&t&&0!==t.length}}g.prototype._addAccountFunctions=function(e){var t=this;return e.signTransaction=function(a,r){return t.signTransaction(a,e.privateKey,r)},e.sign=function(a){return t.sign(a,e.privateKey)},e.encrypt=function(a,r){return t.encrypt(e.privateKey,a,r)},e},g.prototype.create=function(e){return this._addAccountFunctions(c.create(e||s.randomHex(32)))},g.prototype.privateKeyToAccount=function(e,t){if(e.startsWith("0x")||(e="0x"+e),!t&&66!==e.length)throw new Error("Private key must be 32 bytes long");return this._addAccountFunctions(c.fromPrivate(e))},g.prototype.signTransaction=function(e,t,a){var n=this,i=!1,c={},f=!(!e||!(e.chain&&e.hardfork||e.common));if(a=a||function(){},!e)return i=new Error("No transaction object given!"),a(i),Promise.reject(i);if(m(e.common)&&x(e.common.customChain))return i=new Error("If tx.common is provided it must have tx.common.customChain"),a(i),Promise.reject(i);if(m(e.common)&&x(e.common.customChain.chainId))return i=new Error("If tx.common is provided it must have tx.common.customChain and tx.common.customChain.chainId"),a(i),Promise.reject(i);if(m(e.common)&&m(e.common.customChain.chainId)&&m(e.chainId)&&e.chainId!==e.common.customChain.chainId)return i=new Error("Chain Id doesnt match in tx.chainId tx.common.customChain.chainId"),a(i),Promise.reject(i);function d(e){const n=v(e);if(n)return a(n),Promise.reject(n);try{var i=b.formatters.inputCallFormatter(Object.assign({},e));i.data=i.data||"0x",i.value=i.value||"0x",i.gasLimit=i.gasLimit||i.gas,"0x1"===i.type&&void 0===i.accessList&&(i.accessList=[]),f?(i.common&&(c.common=h.forCustomChain(i.common.baseChain||"mainnet",{name:i.common.customChain.name||"custom-network",networkId:i.common.customChain.networkId,chainId:i.common.customChain.chainId},i.common.hardfork||l.London),delete i.common),i.chain&&(c.chain=i.chain,delete i.chain),i.hardfork&&(c.hardfork=i.hardfork,delete i.hardfork)):(c.common=h.forCustomChain("mainnet",{name:"custom-network",networkId:i.networkId,chainId:i.chainId},i.hardfork||l.London),delete i.networkId),t.startsWith("0x")&&(t=t.substring(2));var d=u.fromTxData(i,c),o=d.sign(r.from(t,"hex")),p=o.validate(!0);if(p.length>0){let e="Signer Error: ";for(const t of p)e+=`${e} ${t}.`;throw new Error(e)}var x=o.serialize().toString("hex"),m="0x"+x,g=s.keccak256(m),y={messageHash:"0x"+r.from(o.getMessageToSign(!0)).toString("hex"),v:"0x"+o.v.toString("hex"),r:"0x"+o.r.toString("hex"),s:"0x"+o.s.toString("hex"),rawTransaction:m,transactionHash:g};return a(null,y),y}catch(w){return a(w),Promise.reject(w)}}return e.type=y(e),void 0!==e.nonce&&void 0!==e.chainId&&(void 0!==e.gasPrice||void 0!==e.maxFeePerGas&&void 0!==e.maxPriorityFeePerGas)&&f?Promise.resolve(d(e)):Promise.all([x(e.common)||x(e.common.customChain.chainId)?x(e.chainId)?n._ethereumCall.getChainId():e.chainId:void 0,x(e.nonce)?n._ethereumCall.getTransactionCount(n.privateKeyToAccount(t).address):e.nonce,x(f)?n._ethereumCall.getNetworkId():1,w(n,e)]).then((function(t){const[a,r,n,i]=t;if(x(a)&&x(e.common)&&x(e.common.customChain.chainId)||x(r)||x(n)||x(i))throw new Error('One of the values "chainId", "networkId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(t));return d({...e,...x(e.common)||x(e.common.customChain.chainId)?{chainId:a}:{},nonce:r,networkId:n,...i})}))},g.prototype.recoverTransaction=function(e,t={}){const a=r.from(e.slice(2),"hex"),n=u.fromSerializedData(a);return s.toChecksumAddress(n.getSenderAddress().toString("hex"))},g.prototype.hashMessage=function(e){var t=s.isHexStrict(e)?e:s.utf8ToHex(e),a=s.hexToBytes(t),n=r.from(a),i="Ethereum Signed Message:\n"+a.length,c=r.from(i),f=r.concat([c,n]);return p.bufferToHex(p.keccak256(f))},g.prototype.sign=function(e,t){if(t.startsWith("0x")||(t="0x"+t),66!==t.length)throw new Error("Private key must be 32 bytes long");var a=this.hashMessage(e),r=c.sign(a,t),n=c.decodeSignature(r);return{message:e,messageHash:a,v:n[0],r:n[1],s:n[2],signature:r}},g.prototype.recover=function(e,t,a){var r=[].slice.apply(arguments);return e&&"object"===typeof e?this.recover(e.messageHash,c.encodeSignature([e.v,e.r,e.s]),!0):(a||(e=this.hashMessage(e)),r.length>=4?(a=r.slice(-1)[0],a="boolean"===typeof a&&!!a,this.recover(e,c.encodeSignature(r.slice(1,4)),a)):c.recover(e,t))},g.prototype.decrypt=function(e,t,a){if("string"!==typeof t)throw new Error("No password given.");var n,i,c=e&&"object"===typeof e?e:JSON.parse(a?e.toLowerCase():e);if(3!==c.version)throw new Error("Not a valid V3 wallet");if("scrypt"===c.crypto.kdf)i=c.crypto.kdfparams,n=d.syncScrypt(r.from(t),r.from(i.salt,"hex"),i.n,i.r,i.p,i.dklen);else{if("pbkdf2"!==c.crypto.kdf)throw new Error("Unsupported key derivation scheme");if(i=c.crypto.kdfparams,"hmac-sha256"!==i.prf)throw new Error("Unsupported parameters to PBKDF2");n=f.pbkdf2Sync(r.from(t),r.from(i.salt,"hex"),i.c,i.dklen,"sha256")}var o=r.from(c.crypto.ciphertext,"hex"),b=s.sha3(r.from([...n.slice(16,32),...o])).replace("0x","");if(b!==c.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var u=f.createDecipheriv(c.crypto.cipher,n.slice(0,16),r.from(c.crypto.cipherparams.iv,"hex")),h="0x"+r.from([...u.update(o),...u.final()]).toString("hex");return this.privateKeyToAccount(h,!0)},g.prototype.encrypt=function(e,t,a){var n=this.privateKeyToAccount(e,!0);a=a||{};var i,c=a.salt||f.randomBytes(32),b=a.iv||f.randomBytes(16),u=a.kdf||"scrypt",h={dklen:a.dklen||32,salt:c.toString("hex")};if("pbkdf2"===u)h.c=a.c||262144,h.prf="hmac-sha256",i=f.pbkdf2Sync(r.from(t),r.from(h.salt,"hex"),h.c,h.dklen,"sha256");else{if("scrypt"!==u)throw new Error("Unsupported kdf");h.n=a.n||8192,h.r=a.r||8,h.p=a.p||1,i=d.syncScrypt(r.from(t),r.from(h.salt,"hex"),h.n,h.r,h.p,h.dklen)}var l=f.createCipheriv(a.cipher||"aes-128-ctr",i.slice(0,16),b);if(!l)throw new Error("Unsupported cipher");var p=r.from([...l.update(r.from(n.privateKey.replace("0x",""),"hex")),...l.final()]),x=s.sha3(r.from([...i.slice(16,32),...p])).replace("0x","");return{version:3,id:o.v4({random:a.uuid||f.randomBytes(16)}),address:n.address.toLowerCase().replace("0x",""),crypto:{ciphertext:p.toString("hex"),cipherparams:{iv:b.toString("hex")},cipher:a.cipher||"aes-128-ctr",kdf:u,kdfparams:h,mac:x.toString("hex")}}},M.prototype._findSafeIndex=function(e){return e=e||0,this.hasOwnProperty(e)?this._findSafeIndex(e+1):e},M.prototype._currentIndexes=function(){var e=Object.keys(this),t=e.map((function(e){return parseInt(e)})).filter((function(e){return e<9e20}));return t},M.prototype.create=function(e,t){for(var a=0;a{const t=d(n.concat(n.random(32),e||n.random(32))),a=n.concat(n.concat(n.random(32),t),n.random(32)),r=d(a);return u(r)},b=e=>{const t=o(e.slice(2));let a="0x";for(let r=0;r<40;r++)a+=parseInt(t[r+2],16)>7?e[r+2].toUpperCase():e[r+2];return a},u=e=>{const t=new r(e.slice(2),"hex"),a=f.keyFromPrivate(t),n="0x"+a.getPublic(!1,"hex").slice(2),i=d(n),c=b("0x"+i.slice(-40));return{address:c,privateKey:e}},h=([e,t,a])=>n.flatten([t,a,e]),l=e=>[n.slice(64,n.length(e),e),n.slice(0,32,e),n.slice(32,64,e)],p=e=>(t,a)=>{const c=f.keyFromPrivate(new r(a.slice(2),"hex")).sign(new r(t.slice(2),"hex"),{canonical:!0});return h([i.fromString(n.fromNumber(e+c.recoveryParam)),n.pad(32,n.fromNat("0x"+c.r.toString(16))),n.pad(32,n.fromNat("0x"+c.s.toString(16)))])},x=p(27),m=(e,t)=>{const a=l(t),i={v:n.toNumber(a[0]),r:a[1].slice(2),s:a[2].slice(2)},c=f.recoverPubKey(new r(e.slice(2),"hex"),i,i.v<2?i.v:1-i.v%2),o="0x"+c.encode("hex",!1).slice(2),s=d(o),u=b("0x"+s.slice(-40));return u};e.exports={create:s,toChecksum:b,fromPrivate:u,sign:x,makeSigner:p,recover:m,encodeSignature:h,decodeSignature:l}},94187:function(e){const t=(e,t)=>{let a=[];for(var r=0;rt(e,(()=>a)),r=(e,t)=>e.concat(t),n=e=>{let t=[];for(let a=0,r=e.length;a{let a=[];for(let r=0,n=t.length;rparseInt(e.slice(2*t+2,2*t+4),16),n=e=>{let t;t="undefined"!==typeof window&&window.crypto&&window.crypto.getRandomValues?window.crypto.getRandomValues(new Uint8Array(e)):a(12449).randomBytes(e);let r="0x";for(let a=0;a(e.length-2)/2,c=e=>"0x"+e.reduce(((e,t)=>e+t.slice(2)),""),f=(e,t,a)=>"0x"+a.slice(2*e+2,2*t+2),d=e=>{let t="0x";for(let a=0,r=i(e);at.length===2*e+2?t:o(e,"0x0"+t.slice(2)),s=(e,t)=>t.length===2*e+2?t:s(e,t+"0"),b=e=>{let t=[];for(let a=2,r=e.length;a{let t="0x";for(let a=0,r=e.length;anew Uint8Array(b(e)),l=e=>u([].slice.call(e,0)),p=e=>{let t=e.toString(16);return t.length%2===0?"0x"+t:"0x0"+t},x=e=>parseInt(e.slice(2),16),m=(e,t)=>e.concat(t.slice(2)),g=e=>"0x0"===e?"0x":e.length%2===0?e:"0x0"+e.slice(2),v=e=>"0"===e[2]?"0x"+e.slice(3):e,y=e=>{let t="0x";for(let a=0;a{let t="";for(let a=2;a{const t=e=>{const t=e.toString(16);return t.length<2?"0"+t:t};let a="0x";for(let r=0;r!=e.length;r++){let n=e.charCodeAt(r);if(n<128)a+=t(n);else{if(n<2048)a+=t(n>>6|192);else{if(n>55295&&n<56320){if(++r==e.length)return null;let i=e.charCodeAt(r);if(i<56320||i>57343)return null;n=65536+((1023&n)<<10)+(1023&i),a+=t(n>>18|240),a+=t(n>>12&63|128)}else a+=t(n>>12|224);a+=t(n>>6&63|128)}a+=t(63&n|128)}}return a},_=e=>{let t="",a=0,n=i(e);while(a127){if(i>191&&i<224){if(a>=n)return null;i=(31&i)<<6|63&r(e,a)}else if(i>223&&i<240){if(a+1>=n)return null;i=(15&i)<<12|(63&r(e,a))<<6|63&r(e,++a)}else{if(!(i>239&&i<248))return null;if(a+2>=n)return null;i=(7&i)<<18|(63&r(e,a))<<12|(63&r(e,++a))<<6|63&r(e,++a)}++a}if(i<=65535)t+=String.fromCharCode(i);else{if(!(i<=1114111))return null;i-=65536,t+=String.fromCharCode(i>>10|55296),t+=String.fromCharCode(1023&i|56320)}}return t};e.exports={random:n,length:i,concat:m,flatten:c,slice:f,reverse:d,pad:o,padRight:s,fromAscii:y,toAscii:w,fromString:M,toString:_,fromNumber:p,toNumber:x,fromNat:g,toNat:v,fromArray:u,toArray:b,fromUint8Array:l,toUint8Array:h}},15844:function(e){const t="0123456789abcdef".split(""),a=[1,256,65536,16777216],r=[0,8,16,24],n=[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],i=e=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}),c=(e,n)=>{var i,c=n.length,d=e.blocks,o=e.blockCount<<2,s=e.blockCount,b=e.outputBlocks,u=e.s,h=0;while(h>2]|=n[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(d[x>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=o){for(e.start=x-o,e.block=d[s],x=0;x>2]|=a[3&x],e.lastByteIndex===o)for(d[0]=d[s],x=1;x>4&15]+t[15&l]+t[l>>12&15]+t[l>>8&15]+t[l>>20&15]+t[l>>16&15]+t[l>>28&15]+t[l>>24&15];m%s===0&&(f(u),x=0)}return"0x"+p},f=e=>{var t,a,r,i,c,f,d,o,s,b,u,h,l,p,x,m,g,v,y,w,M,_,k,A,S,E,B,T,P,I,C,R,O,N,U,L,j,q,F,D,H,z,K,Z,G,V,W,J,X,Y,Q,$,ee,te,ae,re,ne,ie,ce,fe,de,oe,se;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],c=e[1]^e[11]^e[21]^e[31]^e[41],f=e[2]^e[12]^e[22]^e[32]^e[42],d=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],b=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],l=e[9]^e[19]^e[29]^e[39]^e[49],t=h^(f<<1|d>>>31),a=l^(d<<1|f>>>31),e[0]^=t,e[1]^=a,e[10]^=t,e[11]^=a,e[20]^=t,e[21]^=a,e[30]^=t,e[31]^=a,e[40]^=t,e[41]^=a,t=i^(o<<1|s>>>31),a=c^(s<<1|o>>>31),e[2]^=t,e[3]^=a,e[12]^=t,e[13]^=a,e[22]^=t,e[23]^=a,e[32]^=t,e[33]^=a,e[42]^=t,e[43]^=a,t=f^(b<<1|u>>>31),a=d^(u<<1|b>>>31),e[4]^=t,e[5]^=a,e[14]^=t,e[15]^=a,e[24]^=t,e[25]^=a,e[34]^=t,e[35]^=a,e[44]^=t,e[45]^=a,t=o^(h<<1|l>>>31),a=s^(l<<1|h>>>31),e[6]^=t,e[7]^=a,e[16]^=t,e[17]^=a,e[26]^=t,e[27]^=a,e[36]^=t,e[37]^=a,e[46]^=t,e[47]^=a,t=b^(i<<1|c>>>31),a=u^(c<<1|i>>>31),e[8]^=t,e[9]^=a,e[18]^=t,e[19]^=a,e[28]^=t,e[29]^=a,e[38]^=t,e[39]^=a,e[48]^=t,e[49]^=a,p=e[0],x=e[1],V=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,T=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,de=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,U=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,X=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,oe=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ae=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,Z=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,D=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~m&v,e[1]=x^~g&y,e[10]=A^~E&T,e[11]=S^~B&P,e[20]=N^~L&q,e[21]=U^~j&F,e[30]=Z^~V&J,e[31]=G^~W&X,e[40]=te^~re&ie,e[41]=ae^~ne&ce,e[2]=m^~v&w,e[3]=g^~y&M,e[12]=E^~T&I,e[13]=B^~P&C,e[22]=L^~q&D,e[23]=j^~F&H,e[32]=V^~J&Y,e[33]=W^~X&Q,e[42]=re^~ie&fe,e[43]=ne^~ce&de,e[4]=v^~w&_,e[5]=y^~M&k,e[14]=T^~I&R,e[15]=P^~C&O,e[24]=q^~D&z,e[25]=F^~H&K,e[34]=J^~Y&$,e[35]=X^~Q&ee,e[44]=ie^~fe&oe,e[45]=ce^~de&se,e[6]=w^~_&p,e[7]=M^~k&x,e[16]=I^~R&A,e[17]=C^~O&S,e[26]=D^~z&N,e[27]=H^~K&U,e[36]=Y^~$&Z,e[37]=Q^~ee&G,e[46]=fe^~oe&te,e[47]=de^~se&ae,e[8]=_^~p&m,e[9]=k^~x&g,e[18]=R^~A&E,e[19]=O^~S&B,e[28]=z^~N&L,e[29]=K^~U&j,e[38]=$^~Z&V,e[39]=ee^~G&W,e[48]=oe^~te&re,e[49]=se^~ae&ne,e[0]^=n[r],e[1]^=n[r+1]},d=e=>t=>{var a;if("0x"===t.slice(0,2)){a=[];for(var r=2,n=t.length;r"0x"+e.toString("hex"),c=e=>new r(e.slice(2),16),f=e=>{const t="0x"+("0x"===e.slice(0,2)?new r(e.slice(2),16):new r(e,10)).toString("hex");return"0x0"===t?"0x":t},d=e=>u(m(e,f("10000000000")))/1e8,o=e=>x(b(Math.floor(1e8*e)),f("10000000000")),s=e=>c(e).toString(10),b=e=>"string"===typeof e?/^0x/.test(e)?e:"0x"+e:"0x"+new r(e).toString("hex"),u=e=>c(e).toNumber(),h=e=>n.pad(32,e),l=e=>(t,a)=>i(c(t)[e](c(a))),p=l("add"),x=l("mul"),m=l("div"),g=l("sub");e.exports={toString:s,fromString:f,toNumber:u,fromNumber:b,toEther:d,fromEther:o,toUint256:h,add:p,mul:x,div:m,sub:g}},29724:function(e){const t=e=>{const t=e=>e.length%2===0?e:"0"+e,a=e=>t(e.toString(16)),r=(e,t)=>e<56?a(t+e):a(t+a(e).length/2+55)+a(e),n=e=>{if("string"===typeof e){const t=e.slice(2),a=2!=t.length||t>="80"?r(t.length/2,128):"";return a+t}{const t=e.map(n).join(""),a=r(t.length/2,192);return a+t}};return"0x"+n(e)},a=e=>{let t=2;const a=()=>{if(t>=e.length)throw"";const a=e.slice(t,t+2);return a<"80"?(t+=2,"0x"+a):a<"c0"?n():i()},r=()=>{const a=parseInt(e.slice(t,t+=2),16)%64;return a<56?a:parseInt(e.slice(t,t+=2*(a-55)),16)},n=()=>{const a=r();return"0x"+e.slice(t,t+=2*a)},i=()=>{const e=2*r()+t;let n=[];while(t0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var c=i(a(83941)),f=a(31131),d=a(52010),o=a(24199),s=a(2674),b=a(44965),u=a(13726),h=a(33823),l=a(91384),p=function(){function e(e,t,a,r){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===a&&(a=s.KECCAK256_RLP),void 0===r&&(r=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=a,this.codeHash=r,this._validate()}return e.fromAccountData=function(t){var a=t.nonce,r=t.balance,n=t.stateRoot,i=t.codeHash;return new e(a?new f.BN((0,b.toBuffer)(a)):void 0,r?new f.BN((0,b.toBuffer)(r)):void 0,n?(0,b.toBuffer)(n):void 0,i?(0,b.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=f.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var a=n(t,4),r=a[0],i=a[1],c=a[2],d=a[3];return new e(new f.BN(r),new f.BN(i),c,d)},e.prototype._validate=function(){if(this.nonce.lt(new f.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new f.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return f.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(s.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(s.KECCAK256_NULL)},e}();t.Account=p;var x=function(e){try{(0,h.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.isValidAddress=x;var m=function(e,t){(0,h.assertIsHexString)(e);var a=(0,o.stripHexPrefix)(e).toLowerCase(),r="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);r=n.toString()+"0x"}for(var i=(0,u.keccakFromString)(r+a).toString("hex"),c="0x",f=0;f=8?c+=a[f].toUpperCase():c+=a[f];return c};t.toChecksumAddress=m;var g=function(e,a){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,a)===e};t.isValidChecksumAddress=g;var v=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var a=new f.BN(t);return a.isZero()?(0,u.rlphash)([e,null]).slice(-20):(0,u.rlphash)([e,r.from(a.toArray())]).slice(-20)};t.generateAddress=v;var y=function(e,t,a){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(a),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,u.keccak256)(r.concat([r.from("ff","hex"),e,t,(0,u.keccak256)(a)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,d.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,d.publicKeyVerify)(r.concat([r.from([4]),e])):!!t&&(0,d.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,u.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),r.from((0,d.publicKeyCreate)(e,!1)).slice(1)};t.privateToPublic=k;var A=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.privateToAddress=A;var S=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,b.zeros)(e);return(0,b.bufferToHex)(t)};t.zeroAddress=E;var B=function(e){try{(0,h.assertIsString)(e)}catch(r){return!1}var a=(0,t.zeroAddress)();return a===e};t.isZeroAddress=B},56878:function(e,t,a){"use strict";var r=a(15361)["Buffer"],n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=n(a(83941)),c=a(31131),f=a(44965),d=a(63867),o=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,f.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,d.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(r.isBuffer(t),"Public key should be Buffer");var a=(0,d.pubToAddress)(t);return new e(a)},e.fromPrivateKey=function(t){(0,i.default)(r.isBuffer(t),"Private key should be Buffer");var a=(0,d.privateToAddress)(t);return new e(a)},e.generate=function(t,a){return(0,i.default)(c.BN.isBN(a)),new e((0,d.generateAddress)(t.buf,a.toArrayLike(r)))},e.generate2=function(t,a,n){return(0,i.default)(r.isBuffer(a)),(0,i.default)(r.isBuffer(n)),new e((0,d.generateAddress2)(t.buf,a,n))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new c.BN(this.buf),t=new c.BN(0),a=new c.BN("ffff","hex");return e.gte(t)&&e.lte(a)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return r.from(this.buf)},e}();t.Address=o},44965:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),a(48675),a(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(31131),f=a(24199),d=a(33823),o=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToHex=o;var s=function(e){var a=(0,t.intToHex)(e);return r.from((0,f.padToEven)(a.slice(2)),"hex")};t.intToBuffer=s;var b=function(e){return r.allocUnsafe(e).fill(0)};t.zeros=b;var u=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,d.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,d.assertIsArray)(e),p(e)};t.unpadArray=m;var g=function(e){return(0,d.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=g;var v=function(e){if(null===e||void 0===e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"===typeof e){if(!(0,f.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,f.padToEven)((0,f.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=v;var y=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToInt=y;var w=function(e){return e=(0,t.toBuffer)(e),"0x"+e.toString("hex")};t.bufferToHex=w;var M=function(e){return new c.BN(e).fromTwos(256)};t.fromSigned=M;var _=function(e){return r.from(e.toTwos(256).toArray())};t.toUnsigned=_;var k=function(e){return"string"!==typeof e||(0,f.isHexPrefixed)(e)?e:"0x"+e};t.addHexPrefix=k;var A=function(e){var t=/^(00)+|(00)+$/g;if(e=(0,f.stripHexPrefix)(e),e.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");var a=r.from(e.replace(t,""),"hex");return a.toString("utf8")};t.toUtf8=A;var S=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===o[0])throw new Error("".concat(d," cannot have leading zeroes, received: ").concat(o.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}};function B(e){return Array.isArray(e)?e.map((function(e){return B(e)})):r.from(e)}function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=B,t.bufArrToArr=T},2674:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var r=a(15361),n=a(31131);t.MAX_UINT64=new n.BN("ffffffffffffffff",16),t.MAX_INTEGER=new n.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new n.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=r.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=r.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=r.Buffer.from(t.KECCAK256_RLP_S,"hex")},31131:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var f=c(a(56956));t.BN=f.default;var d=i(a(98217));t.rlp=d},13726:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(92802),i=a(65443),c=a(31131),f=a(44965),d=a(33823),o=function(e,t){switch(void 0===t&&(t=256),(0,d.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak=o;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var b=function(e,a){void 0===a&&(a=256),(0,d.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromString=b;var u=function(e,a){return void 0===a&&(a=256),(0,d.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromHexString=u;var h=function(e,a){return void 0===a&&(a=256),(0,d.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,d.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,d.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,d.assertIsArray)(e),l(e)};t.sha256FromArray=m;var g=function(e,t){e=(0,f.toBuffer)(e);var a=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(a,32):a},v=function(e,t){return(0,d.assertIsBuffer)(e),g(e,t)};t.ripemd160=v;var y=function(e,t){return(0,d.assertIsString)(e),g(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,d.assertIsArray)(e),g(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},33823:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(24199),i=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsHexString=i;var c=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=c;var f=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=f;var d=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=d},96380:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(a(2674),t),n(a(63867),t),n(a(56878),t),n(a(13726),t),n(a(86779),t),n(a(44965),t),n(a(56936),t),n(a(31131),t),n(a(91384),t);var i=a(24199);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},24199:function(e,t,a){"use strict";var r=a(15361)["Buffer"];function n(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;var i=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return n(e)?e.slice(2):e};function c(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}function f(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")}function d(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function o(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a=n.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===n.length||!t.length||(0,i.default)(t.length===n.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[a]=n}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:n,set:c}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:c,get:n})})),a)if("string"===typeof a&&(a=r.from((0,c.stripHexPrefix)(a),"hex")),r.isBuffer(a)&&(a=f.rlp.decode(a)),Array.isArray(a)){if(a.length>e._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(t,a){e[e._fields[a]]=(0,d.toBuffer)(t)}))}else{if("object"!==typeof a)throw new Error("invalid data");var n=Object.keys(a);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=a[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=a[t.alias])}))}};t.defineProperties=o},86779:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=a(52010),i=a(31131),c=a(44965),f=a(13726),d=a(33823),o=a(91384);function s(e,t,a){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,d=r.from(c.slice(0,32)),s=r.from(c.slice(32,64));if(!a||"number"===typeof a){if(a&&!Number.isSafeInteger(a))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var b=a?f+(2*a+35):f+27;return{r:d,s:s,v:b}}var u=(0,o.toType)(a,o.TypeOutput.BN),h=u.muln(2).addn(35).addn(f).toArrayLike(r);return{r:d,s:s,v:h}}function b(e,t){var a=(0,o.toType)(e,o.TypeOutput.BN);if(!t)return a.subn(27);var r=(0,o.toType)(t,o.TypeOutput.BN);return a.sub(r.muln(2).addn(35))}function u(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,a,i,f){var d=r.concat([(0,c.setLengthLeft)(a,32),(0,c.setLengthLeft)(i,32)],64),o=b(t,f);if(!u(o))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(d,o.toNumber(),e);return r.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(a,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");var f=(0,o.toType)(e,o.TypeOutput.Number),d=a;return(f>28&&f%2===1||1===f||28===f)&&(d=r.from(a),d[0]|=128),(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(d,32)]))};t.toCompactSig=p;var x=function(e){var t,a,r,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(32,33))>>7,a[0]&=127}return r<27&&(r+=27),{v:r,r:t,s:a}};t.fromRpcSig=x;var m=function(e,t,a,r,n){void 0===r&&(r=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==a.length)return!1;if(!u(b(e,n)))return!1;var d=new i.BN(t),o=new i.BN(a);return!(d.isZero()||d.gt(f)||o.isZero()||o.gt(f))&&(!r||1!==o.cmp(c))};t.isValidSignature=m;var g=function(e){(0,d.assertIsBuffer)(e);var t=r.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(r.concat([t,e]))};t.hashPersonalMessage=g},91384:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=a(31131),c=a(24199),f=a(44965);function d(e){return"0x".concat(e.toString(16))}function o(e){return(0,f.unpadBuffer)(e.toArrayLike(r))}function s(e){return o(e)}function b(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"===typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,f.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new i.BN(a);if(t===n.Number){var r=new i.BN(a),d=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(d))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}t.bnToHex=d,t.bnToUnpaddedBuffer=o,t.bnToRlp=s,function(e){e[e["Number"]=0]="Number",e[e["BN"]=1]="BN",e[e["Buffer"]=2]="Buffer",e[e["PrefixedHexString"]=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=b},56956:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(56773).Buffer}catch(P){}function f(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},48109:function(e,t,a){var r=a(26368),n=a(95358),i=n;i.v1=r,i.v4=n,e.exports=i},14385:function(e){for(var t=[],a=0;a<256;++a)t[a]=(a+256).toString(16).substr(1);function r(e,a){var r=a||0,n=t;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")}e.exports=r},80624:function(e,t,a){a(48675),a(3462);var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},26368:function(e,t,a){a(21703);var r,n,i=a(80624),c=a(14385),f=0,d=0;function o(e,t,a){var o=t&&a||0,s=t||[];e=e||{};var b=e.node||r,u=void 0!==e.clockseq?e.clockseq:n;if(null==b||null==u){var h=i();null==b&&(b=r=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==u&&(u=n=16383&(h[6]<<8|h[7]))}var l=void 0!==e.msecs?e.msecs:(new Date).getTime(),p=void 0!==e.nsecs?e.nsecs:d+1,x=l-f+(p-d)/1e4;if(x<0&&void 0===e.clockseq&&(u=u+1&16383),(x<0||l>f)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");f=l,d=p,n=u,l+=122192928e5;var m=(1e4*(268435455&l)+p)%4294967296;s[o++]=m>>>24&255,s[o++]=m>>>16&255,s[o++]=m>>>8&255,s[o++]=255&m;var g=l/4294967296*1e4&268435455;s[o++]=g>>>8&255,s[o++]=255&g,s[o++]=g>>>24&15|16,s[o++]=g>>>16&255,s[o++]=u>>>8|128,s[o++]=255&u;for(var v=0;v<6;++v)s[o+v]=b[v];return t||c(s)}e.exports=o},95358:function(e,t,a){var r=a(80624),n=a(14385);function i(e,t,a){var i=t&&a||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var c=e.random||(e.rng||r)();if(c[6]=15&c[6]|64,c[8]=63&c[8]|128,t)for(var f=0;f<16;++f)t[i+f]=c[f];return t||n(c)}e.exports=i},93135:function(e,t,a){"use strict";a(21703);var r=a(36603),n=a(79021),i=a(77802),c=a(84598).subscription,f=a(11205).formatters,d=a(11205).errors,o=a(80165),s=a(90056),b=function e(t,a,n){var c=this,o=Array.prototype.slice.call(arguments);if(!(this instanceof e))throw new Error('Please use the "new" keyword to instantiate a web3.eth.Contract() object!');if(this.setProvider=function(){r.packageInit(c,arguments),c.clearSubscriptions=c._requestManager.clearSubscriptions},r.packageInit(this,[this.constructor]),this.clearSubscriptions=this._requestManager.clearSubscriptions,!t||!Array.isArray(t))throw d.ContractMissingABIError();this.options={};var b=o[o.length-1];b&&"object"===typeof b&&!Array.isArray(b)&&(n=b,this.options={...this.options,...this._getOrSetDefaultOptions(n)},a&&"object"===typeof a&&(a=null)),Object.defineProperty(this.options,"address",{set:function(e){e&&(c._address=i.toChecksumAddress(f.inputAddressFormatter(e)))},get:function(){return c._address},enumerable:!0}),Object.defineProperty(this.options,"jsonInterface",{set:function(e){return c.methods={},c.events={},c._jsonInterface=e.map((function(e){var t,a;if(e.constant="view"===e.stateMutability||"pure"===e.stateMutability||e.constant,e.payable="payable"===e.stateMutability||e.payable,e.name&&(a=i._jsonInterfaceMethodToString(e)),"function"===e.type){if(e.signature=s.encodeFunctionSignature(a),t=c._createTxObject.bind({method:e,parent:c}),c.methods[e.name]){var r=c._createTxObject.bind({method:e,parent:c,nextMethod:c.methods[e.name]});c.methods[e.name]=r}else c.methods[e.name]=t;c.methods[e.signature]=t,c.methods[a]=t}else if("event"===e.type){e.signature=s.encodeEventSignature(a);var n=c._on.bind(c,e.signature);c.events[e.name]&&"bound "!==c.events[e.name].name||(c.events[e.name]=n),c.events[e.signature]=n,c.events[a]=n}return e})),c.events.allEvents=c._on.bind(c,"allevents"),c._jsonInterface},get:function(){return c._jsonInterface},enumerable:!0});var u=this.constructor.defaultAccount,h=this.constructor.defaultBlock||"latest";Object.defineProperty(this,"handleRevert",{get:function(){return!1===c.options.handleRevert||!0===c.options.handleRevert?c.options.handleRevert:this.constructor.handleRevert},set:function(e){c.options.handleRevert=e},enumerable:!0}),Object.defineProperty(this,"defaultCommon",{get:function(){return c.options.common||this.constructor.defaultCommon},set:function(e){c.options.common=e},enumerable:!0}),Object.defineProperty(this,"defaultHardfork",{get:function(){return c.options.hardfork||this.constructor.defaultHardfork},set:function(e){c.options.hardfork=e},enumerable:!0}),Object.defineProperty(this,"defaultChain",{get:function(){return c.options.chain||this.constructor.defaultChain},set:function(e){c.options.chain=e},enumerable:!0}),Object.defineProperty(this,"transactionPollingTimeout",{get:function(){return 0===c.options.transactionPollingTimeout?c.options.transactionPollingTimeout:c.options.transactionPollingTimeout||this.constructor.transactionPollingTimeout},set:function(e){c.options.transactionPollingTimeout=e},enumerable:!0}),Object.defineProperty(this,"transactionPollingInterval",{get:function(){return 0===c.options.transactionPollingInterval?c.options.transactionPollingInterval:c.options.transactionPollingInterval||this.constructor.transactionPollingInterval},set:function(e){c.options.transactionPollingInterval=e},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return 0===c.options.transactionConfirmationBlocks?c.options.transactionConfirmationBlocks:c.options.transactionConfirmationBlocks||this.constructor.transactionConfirmationBlocks},set:function(e){c.options.transactionConfirmationBlocks=e},enumerable:!0}),Object.defineProperty(this,"transactionBlockTimeout",{get:function(){return 0===c.options.transactionBlockTimeout?c.options.transactionBlockTimeout:c.options.transactionBlockTimeout||this.constructor.transactionBlockTimeout},set:function(e){c.options.transactionBlockTimeout=e},enumerable:!0}),Object.defineProperty(this,"blockHeaderTimeout",{get:function(){return 0===c.options.blockHeaderTimeout?c.options.blockHeaderTimeout:c.options.blockHeaderTimeout||this.constructor.blockHeaderTimeout},set:function(e){c.options.blockHeaderTimeout=e},enumerable:!0}),Object.defineProperty(this,"defaultAccount",{get:function(){return u},set:function(e){return e&&(u=i.toChecksumAddress(f.inputAddressFormatter(e))),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return h},set:function(e){return h=e,e},enumerable:!0}),this.methods={},this.events={},this._address=null,this._jsonInterface=[],this.options.address=a,this.options.jsonInterface=t};b.setProvider=function(e,t){r.packageInit(this,[e]),this._ethAccounts=t},b.prototype._getCallback=function(e){if(e&&e[e.length-1]&&"function"===typeof e[e.length-1])return e.pop()},b.prototype._checkListener=function(e,t){if(t===e)throw d.ContractReservedEventError(e)},b.prototype._getOrSetDefaultOptions=function(e){var t=e.gasPrice?String(e.gasPrice):null,a=e.from?i.toChecksumAddress(f.inputAddressFormatter(e.from)):null;return e.data=e.data||this.options.data,e.from=a||this.options.from,e.gasPrice=t||this.options.gasPrice,e.gas=e.gas||e.gasLimit||this.options.gas,delete e.gasLimit,e},b.prototype._encodeEventABI=function(e,t){t=t||{};var a=t.filter||{},r={};if(["fromBlock","toBlock"].filter((function(e){return void 0!==t[e]})).forEach((function(e){r[e]=f.inputBlockNumberFormatter(t[e])})),Array.isArray(t.topics))r.topics=t.topics;else{if(r.topics=[],e&&!e.anonymous&&"ALLEVENTS"!==e.name&&r.topics.push(e.signature),"ALLEVENTS"!==e.name){var n=e.inputs.filter((function(e){return!0===e.indexed})).map((function(e){var t=a[e.name];return t?Array.isArray(t)?t.map((function(t){return s.encodeParameter(e.type,t)})):s.encodeParameter(e.type,t):null}));r.topics=r.topics.concat(n)}r.topics.length||delete r.topics}return this.options.address&&(r.address=this.options.address.toLowerCase()),r},b.prototype._decodeEventABI=function(e){var t=this;e.data=e.data||"",e.topics=e.topics||[];var a=f.outputLogFormatter(e);if("ALLEVENTS"===t.name&&(t=t.jsonInterface.find((function(t){return t.signature===e.topics[0]}))||{anonymous:!0}),t.inputs=t.inputs||[],!t.anonymous){let a=0;t.inputs.forEach((e=>e.indexed?a++:null)),a>0&&e.topics.length!==a+1&&(t={anonymous:!0,inputs:[]})}var r=t.anonymous?e.topics:e.topics.slice(1);return a.returnValues=s.decodeLog(t.inputs,e.data,r),delete a.returnValues.__length__,a.event=t.name,a.signature=t.anonymous||!e.topics[0]?null:e.topics[0],a.raw={data:a.data,topics:a.topics},delete a.data,delete a.topics,a},b.prototype._encodeMethodABI=function(){var e=this._method.signature,t=this.arguments||[],a=!1,r=this._parent.options.jsonInterface.filter((function(t){return"constructor"===e&&t.type===e||(t.signature===e||t.signature===e.replace("0x","")||t.name===e)&&"function"===t.type})).map((function(e){var r=Array.isArray(e.inputs)?e.inputs.length:0;if(r!==t.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+r+" arguments.");return"function"===e.type&&(a=e.signature),Array.isArray(e.inputs)?e.inputs:[]})).map((function(e){return s.encodeParameters(e,t).replace("0x","")}))[0]||"";if("constructor"===e){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData.startsWith("0x")||(this._deployData="0x"+this._deployData),this._deployData+r}var n=a?a+r:r;if(!n)throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".');return n},b.prototype._decodeMethodReturn=function(e,t){if(!t)return null;t=t.length>=2?t.slice(2):t;var a=s.decodeParameters(e,t);return 1===a.__length__?a[0]:(delete a.__length__,a)},b.prototype.deploy=function(e,t){if(e=e||{},e.arguments=e.arguments||[],e=this._getOrSetDefaultOptions(e),!e.data){if("function"===typeof t)return t(d.ContractMissingDeployDataError());throw d.ContractMissingDeployDataError()}var a=this.options.jsonInterface.find((e=>"constructor"===e.type))||{};return a.signature="constructor",this._createTxObject.apply({method:a,parent:this,deployData:e.data,_ethAccounts:this.constructor._ethAccounts},e.arguments)},b.prototype._generateEventOptions=function(){var e=Array.prototype.slice.call(arguments),t=this._getCallback(e),a="object"===(!!e[e.length-1]&&typeof e[e.length-1])?e.pop():{},r="string"===typeof e[0]?e[0]:"allevents",n="allevents"===r.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(e){return"event"===e.type&&(e.name===r||e.signature==="0x"+r.replace("0x",""))}));if(!n)throw d.ContractEventDoesNotExistError(r);if(!i.isAddress(this.options.address))throw d.ContractNoAddressDefinedError();return{params:this._encodeEventABI(n,a),event:n,callback:t}},b.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},b.prototype.once=function(e,t,a){var r=Array.prototype.slice.call(arguments);if(a=this._getCallback(r),!a)throw d.ContractOnceRequiresCallbackError();t&&delete t.fromBlock,this._on(e,t,(function(e,t,r){r.unsubscribe(),"function"===typeof a&&a(e,t,r)}))},b.prototype._on=function(){var e=this._generateEventOptions.apply(this,arguments);e.params&&e.params.toBlock&&(delete e.params.toBlock,console.warn("Invalid option: toBlock. Use getPastEvents for specific range.")),this._checkListener("newListener",e.event.name),this._checkListener("removeListener",e.event.name);var t=new c({subscription:{params:1,inputFormatter:[f.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event),subscriptionHandler:function(e){e.removed?this.emit("changed",e):this.emit("data",e),"function"===typeof this.callback&&this.callback(null,e,this)}},type:"eth",requestManager:this._requestManager});return t.subscribe("logs",e.params,e.callback||function(){}),t},b.prototype.getPastEvents=function(){var e=this._generateEventOptions.apply(this,arguments),t=new n({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[f.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);var a=t.buildCall();return t=null,a(e.params,e.callback)},b.prototype._createTxObject=function(){var e=Array.prototype.slice.call(arguments),t={};if("function"===this.method.type&&(t.call=this.parent._executeMethod.bind(t,"call"),t.call.request=this.parent._executeMethod.bind(t,"call",!0)),t.send=this.parent._executeMethod.bind(t,"send"),t.send.request=this.parent._executeMethod.bind(t,"send",!0),t.encodeABI=this.parent._encodeMethodABI.bind(t),t.estimateGas=this.parent._executeMethod.bind(t,"estimate"),t.createAccessList=this.parent._executeMethod.bind(t,"createAccessList"),e&&this.method.inputs&&e.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,e);throw d.InvalidNumberOfParams(e.length,this.method.inputs.length,this.method.name)}return t.arguments=e||[],t._method=this.method,t._parent=this.parent,t._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(t._deployData=this.deployData),t},b.prototype._processExecuteArguments=function(e,t){var a={};if(a.type=e.shift(),a.callback=this._parent._getCallback(e),"call"!==a.type||!0===e[e.length-1]||"string"!==typeof e[e.length-1]&&!isFinite(e[e.length-1])||(a.defaultBlock=e.pop()),a.options="object"===(!!e[e.length-1]&&typeof e[e.length-1])?e.pop():{},a.generateRequest=!0===e[e.length-1]&&e.pop(),a.options=this._parent._getOrSetDefaultOptions(a.options),a.options.data=this.encodeABI(),!this._deployData&&!i.isAddress(this._parent.options.address))throw d.ContractNoAddressDefinedError();return this._deployData||(a.options.to=this._parent.options.address),a.options.data?a:i._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),t.eventEmitter,t.reject,a.callback)},b.prototype._executeMethod=function(){var e=this,t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),a),a=o("send"!==t.type),r=e.constructor._ethAccounts||e._ethAccounts;if(t.generateRequest){var c={params:[f.inputCallFormatter.call(this._parent,t.options)],callback:t.callback};return"call"===t.type?(c.params.push(f.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),c.method="eth_call",c.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):c.method="eth_sendTransaction",c}switch(t.type){case"createAccessList":if(!i.isAddress(t.options.from))return i._fireError(d.ContractNoFromAddressDefinedError(),a.eventEmitter,a.reject,t.callback);var b=new n({name:"createAccessList",call:"eth_createAccessList",params:2,inputFormatter:[f.inputTransactionFormatter,f.inputDefaultBlockNumberFormatter],requestManager:e._parent._requestManager,accounts:r,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return b(t.options,t.callback);case"estimate":var u=new n({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[f.inputCallFormatter],outputFormatter:i.hexToNumber,requestManager:e._parent._requestManager,accounts:r,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return u(t.options,t.callback);case"call":var h=new n({name:"call",call:"eth_call",params:2,inputFormatter:[f.inputCallFormatter,f.inputDefaultBlockNumberFormatter],outputFormatter:function(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:r,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,handleRevert:e._parent.handleRevert,abiCoder:s}).createFunction();return h(t.options,t.defaultBlock,t.callback);case"send":if(!i.isAddress(t.options.from))return i._fireError(d.ContractNoFromAddressDefinedError(),a.eventEmitter,a.reject,t.callback);if("boolean"===typeof this._method.payable&&!this._method.payable&&t.options.value&&t.options.value>0)return i._fireError(new Error("Can not send value to non-payable contract method or constructor"),a.eventEmitter,a.reject,t.callback);var l={receiptFormatter:function(t){if(Array.isArray(t.logs)){var a=t.logs.map((t=>e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)));t.events={};var r=0;a.forEach((function(e){e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[r]=e,r++)})),delete t.logs}return t},contractDeployFormatter:function(t){var a=e._parent.clone();return a.options.address=t.contractAddress,a}},p=new n({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[f.inputTransactionFormatter],requestManager:e._parent._requestManager,accounts:e.constructor._ethAccounts||e._ethAccounts,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,transactionBlockTimeout:e._parent.transactionBlockTimeout,transactionConfirmationBlocks:e._parent.transactionConfirmationBlocks,transactionPollingTimeout:e._parent.transactionPollingTimeout,transactionPollingInterval:e._parent.transactionPollingInterval,defaultCommon:e._parent.defaultCommon,defaultChain:e._parent.defaultChain,defaultHardfork:e._parent.defaultHardfork,handleRevert:e._parent.handleRevert,extraFormatters:l,abiCoder:s}).createFunction();return p(t.options,t.callback);default:throw new Error('Method "'+t.type+'" not implemented.')}},e.exports=b},99996:function(e,t,a){"use strict";a(21703);var r=a(36130),n=a(11205).formatters,i=a(77802),c=a(10162),f=a(38771),d=a(53913);function o(e){this.eth=e;var t=null;this._detectedAddress=null,this._lastSyncCheck=null,Object.defineProperty(this,"registry",{get:function(){return new c(this)},enumerable:!0}),Object.defineProperty(this,"resolverMethodHandler",{get:function(){return new f(this.registry)},enumerable:!0}),Object.defineProperty(this,"registryAddress",{get:function(){return t},set:function(e){t=null!==e?n.inputAddressFormatter(e):e},enumerable:!0})}o.prototype.supportsInterface=function(e,t,a){return this.getResolver(e).then((function(e){return i.isHexStrict(t)||(t=i.sha3(t).slice(0,10)),e.methods.supportsInterface(t).call(a)})).catch((function(e){if("function"!==typeof a)throw e;a(e,null)}))},o.prototype.resolver=function(e,t){return this.registry.resolver(e,t)},o.prototype.getResolver=function(e,t){return this.registry.getResolver(e,t)},o.prototype.setResolver=function(e,t,a,r){return this.registry.setResolver(e,t,a,r)},o.prototype.setRecord=function(e,t,a,r,n,i){return this.registry.setRecord(e,t,a,r,n,i)},o.prototype.setSubnodeRecord=function(e,t,a,r,n,i,c){return this.registry.setSubnodeRecord(e,t,a,r,n,i,c)},o.prototype.setApprovalForAll=function(e,t,a,r){return this.registry.setApprovalForAll(e,t,a,r)},o.prototype.isApprovedForAll=function(e,t,a){return this.registry.isApprovedForAll(e,t,a)},o.prototype.recordExists=function(e,t){return this.registry.recordExists(e,t)},o.prototype.setSubnodeOwner=function(e,t,a,r,n){return this.registry.setSubnodeOwner(e,t,a,r,n)},o.prototype.getTTL=function(e,t){return this.registry.getTTL(e,t)},o.prototype.setTTL=function(e,t,a,r){return this.registry.setTTL(e,t,a,r)},o.prototype.getOwner=function(e,t){return this.registry.getOwner(e,t)},o.prototype.setOwner=function(e,t,a,r){return this.registry.setOwner(e,t,a,r)},o.prototype.getAddress=function(e,t){return this.resolverMethodHandler.method(e,"addr",[]).call(t)},o.prototype.setAddress=function(e,t,a,r){return this.resolverMethodHandler.method(e,"setAddr",[t]).send(a,r)},o.prototype.getPubkey=function(e,t){return this.resolverMethodHandler.method(e,"pubkey",[],null,t).call(t)},o.prototype.setPubkey=function(e,t,a,r,n){return this.resolverMethodHandler.method(e,"setPubkey",[t,a]).send(r,n)},o.prototype.getContent=function(e,t){return this.resolverMethodHandler.method(e,"content",[]).call(t)},o.prototype.setContent=function(e,t,a,r){return this.resolverMethodHandler.method(e,"setContent",[t]).send(a,r)},o.prototype.getContenthash=function(e,t){return this.resolverMethodHandler.method(e,"contenthash",[],d.decode).call(t)},o.prototype.setContenthash=function(e,t,a,r){var n;try{n=d.encode(t)}catch(c){var i=new Error("Could not encode "+t+". See docs for supported hash protocols.");if("function"===typeof r)return void r(i,null);throw i}return this.resolverMethodHandler.method(e,"setContenthash",[n]).send(a,r)},o.prototype.getMultihash=function(e,t){return this.resolverMethodHandler.method(e,"multihash",[]).call(t)},o.prototype.setMultihash=function(e,t,a,r){return this.resolverMethodHandler.method(e,"multihash",[t]).send(a,r)},o.prototype.checkNetwork=async function(){var e=new Date/1e3;if(!this._lastSyncCheck||e-this._lastSyncCheck>3600){var t=await this.eth.getBlock("latest"),a=e-t.timestamp;if(a>3600)throw new Error("Network not synced; last block was "+a+" seconds ago");this._lastSyncCheck=e}if(this.registryAddress)return this.registryAddress;if(!this._detectedAddress){var n=await this.eth.net.getNetworkType(),i=r.addresses[n];if("undefined"===typeof i)throw new Error("ENS is not supported on network "+n);return this._detectedAddress=i,this._detectedAddress}return this._detectedAddress},e.exports=o},36130:function(e){"use strict";var t={addresses:{main:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",ropsten:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",rinkeby:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",goerli:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},interfaceIds:{addr:"0x3b3b57de",setAddr:"0x3b3b57de",pubkey:"0xc8690233",setPubkey:"0xc8690233",contenthash:"0xbc1c58d1",setContenthash:"0xbc1c58d1",content:"0xd8389dc5",setContent:"0xd8389dc5"}};e.exports=t},10162:function(e,t,a){"use strict";var r=a(93135),n=a(20591),i=a(80165),c=a(11205).formatters,f=a(77802),d=a(28178),o=a(73589);function s(e){var t=this;this.ens=e,this.contract=e.checkNetwork().then((function(e){var a=new r(d,e);return a.setProvider(t.ens.eth.currentProvider),a}))}s.prototype.owner=function(e,t){return console.warn('Deprecated: Please use the "getOwner" method instead of "owner".'),this.getOwner(e,t)},s.prototype.getOwner=function(e,t){var a=new i(!0);return this.contract.then((function(t){return t.methods.owner(n.hash(e)).call()})).then((function(e){"function"!==typeof t?a.resolve(e):t(e,e)})).catch((function(e){"function"!==typeof t?a.reject(e):t(e,null)})),a.eventEmitter},s.prototype.setOwner=function(e,t,a,r){var f=new i(!0);return this.contract.then((function(r){return r.methods.setOwner(n.hash(e),c.inputAddressFormatter(t)).send(a)})).then((function(e){"function"!==typeof r?f.resolve(e):r(e,e)})).catch((function(e){"function"!==typeof r?f.reject(e):r(e,null)})),f.eventEmitter},s.prototype.getTTL=function(e,t){var a=new i(!0);return this.contract.then((function(t){return t.methods.ttl(n.hash(e)).call()})).then((function(e){"function"!==typeof t?a.resolve(e):t(e,e)})).catch((function(e){"function"!==typeof t?a.reject(e):t(e,null)})),a.eventEmitter},s.prototype.setTTL=function(e,t,a,r){var c=new i(!0);return this.contract.then((function(r){return r.methods.setTTL(n.hash(e),t).send(a)})).then((function(e){"function"!==typeof r?c.resolve(e):r(e,e)})).catch((function(e){"function"!==typeof r?c.reject(e):r(e,null)})),c.eventEmitter},s.prototype.setSubnodeOwner=function(e,t,a,r,d){var o=new i(!0);return f.isHexStrict(t)||(t=f.sha3(t)),this.contract.then((function(i){return i.methods.setSubnodeOwner(n.hash(e),t,c.inputAddressFormatter(a)).send(r)})).then((function(e){"function"!==typeof d?o.resolve(e):d(e,e)})).catch((function(e){"function"!==typeof d?o.reject(e):d(e,null)})),o.eventEmitter},s.prototype.setRecord=function(e,t,a,r,f,d){var o=new i(!0);return this.contract.then((function(i){return i.methods.setRecord(n.hash(e),c.inputAddressFormatter(t),c.inputAddressFormatter(a),r).send(f)})).then((function(e){"function"!==typeof d?o.resolve(e):d(e,e)})).catch((function(e){"function"!==typeof d?o.reject(e):d(e,null)})),o.eventEmitter},s.prototype.setSubnodeRecord=function(e,t,a,r,d,o,s){var b=new i(!0);return f.isHexStrict(t)||(t=f.sha3(t)),this.contract.then((function(i){return i.methods.setSubnodeRecord(n.hash(e),t,c.inputAddressFormatter(a),c.inputAddressFormatter(r),d).send(o)})).then((function(e){"function"!==typeof s?b.resolve(e):s(e,e)})).catch((function(e){"function"!==typeof s?b.reject(e):s(e,null)})),b.eventEmitter},s.prototype.setApprovalForAll=function(e,t,a,r){var n=new i(!0);return this.contract.then((function(r){return r.methods.setApprovalForAll(c.inputAddressFormatter(e),t).send(a)})).then((function(e){"function"!==typeof r?n.resolve(e):r(e,e)})).catch((function(e){"function"!==typeof r?n.reject(e):r(e,null)})),n.eventEmitter},s.prototype.isApprovedForAll=function(e,t,a){var r=new i(!0);return this.contract.then((function(a){return a.methods.isApprovedForAll(c.inputAddressFormatter(e),c.inputAddressFormatter(t)).call()})).then((function(e){"function"!==typeof a?r.resolve(e):a(e,e)})).catch((function(e){"function"!==typeof a?r.reject(e):a(e,null)})),r.eventEmitter},s.prototype.recordExists=function(e,t){var a=new i(!0);return this.contract.then((function(t){return t.methods.recordExists(n.hash(e)).call()})).then((function(e){"function"!==typeof t?a.resolve(e):t(e,e)})).catch((function(e){"function"!==typeof t?a.reject(e):t(e,null)})),a.eventEmitter},s.prototype.resolver=function(e,t){return console.warn('Deprecated: Please use the "getResolver" method instead of "resolver".'),this.getResolver(e,t)},s.prototype.getResolver=function(e,t){var a=this;return this.contract.then((function(t){return t.methods.resolver(n.hash(e)).call()})).then((function(e){var n=new r(o,e);if(n.setProvider(a.ens.eth.currentProvider),"function"!==typeof t)return n;t(n,n)})).catch((function(e){if("function"!==typeof t)throw e;t(e,null)}))},s.prototype.setResolver=function(e,t,a,r){var f=new i(!0);return this.contract.then((function(r){return r.methods.setResolver(n.hash(e),c.inputAddressFormatter(t)).send(a)})).then((function(e){"function"!==typeof r?f.resolve(e):r(e,e)})).catch((function(e){"function"!==typeof r?f.reject(e):r(e,null)})),f.eventEmitter},e.exports=s},65303:function(e,t,a){"use strict";var r=a(99996);e.exports=r},38771:function(e,t,a){"use strict";var r=a(80165),n=a(20591),i=a(11205).errors,c=a(36130).interfaceIds;function f(e){this.registry=e}f.prototype.method=function(e,t,a,r,n){return{call:this.call.bind({ensName:e,methodName:t,methodArguments:a,callback:n,parent:this,outputFormatter:r}),send:this.send.bind({ensName:e,methodName:t,methodArguments:a,callback:n,parent:this})}},f.prototype.call=function(e){var t=this,a=new r,n=this.parent.prepareArguments(this.ensName,this.methodArguments),i=this.outputFormatter||null;return this.parent.registry.getResolver(this.ensName).then((async function(r){await t.parent.checkInterfaceSupport(r,t.methodName),t.parent.handleCall(a,r.methods[t.methodName],n,i,e)})).catch((function(t){"function"!==typeof e?a.reject(t):e(t,null)})),a.eventEmitter},f.prototype.send=function(e,t){var a=this,n=new r,i=this.parent.prepareArguments(this.ensName,this.methodArguments);return this.parent.registry.getResolver(this.ensName).then((async function(r){await a.parent.checkInterfaceSupport(r,a.methodName),a.parent.handleSend(n,r.methods[a.methodName],i,e,t)})).catch((function(e){"function"!==typeof t?n.reject(e):t(e,null)})),n.eventEmitter},f.prototype.handleCall=function(e,t,a,r,n){return t.apply(this,a).call().then((function(t){r&&(t=r(t)),"function"!==typeof n?e.resolve(t):n(t,t)})).catch((function(t){"function"!==typeof n?e.reject(t):n(t,null)})),e},f.prototype.handleSend=function(e,t,a,r,n){return t.apply(this,a).send(r).on("sending",(function(){e.eventEmitter.emit("sending")})).on("sent",(function(){e.eventEmitter.emit("sent")})).on("transactionHash",(function(t){e.eventEmitter.emit("transactionHash",t)})).on("confirmation",(function(t,a){e.eventEmitter.emit("confirmation",t,a)})).on("receipt",(function(t){e.eventEmitter.emit("receipt",t),e.resolve(t),"function"===typeof n&&n(t,t)})).on("error",(function(t){e.eventEmitter.emit("error",t),"function"!==typeof n?e.reject(t):n(t,null)})),e},f.prototype.prepareArguments=function(e,t){var a=n.hash(e);return t.length>0?(t.unshift(a),t):[a]},f.prototype.checkInterfaceSupport=async function(e,t){if(c[t]){var a=!1;try{a=await e.methods.supportsInterface(c[t]).call()}catch(r){console.warn('Could not verify interface of resolver contract at "'+e.options.address+'". ')}if(!a)throw i.ResolverMethodMissingError(e.options.address,t)}},e.exports=f},53913:function(e,t,a){a(21703);var r=a(72624);function n(e){var t=null,a=null,n=null;if(e&&e.error)return{protocolType:null,decoded:e.error};if(e)try{t=r.decode(e);var i=r.getCodec(e);"ipfs-ns"===i?a="ipfs":"swarm-ns"===i?a="bzz":"onion"===i?a="onion":"onion3"===i?a="onion3":t=e}catch(c){n=c.message}return{protocolType:a,decoded:t,error:n}}function i(e){var t,a,n=!1;if(e){var i=e.match(/^(ipfs|bzz|onion|onion3):\/\/(.*)/)||e.match(/\/(ipfs)\/(.*)/);i&&(a=i[1],t=i[2]);try{if("ipfs"===a)t.length>=4&&(n="0x"+r.fromIpfs(t));else if("bzz"===a)t.length>=4&&(n="0x"+r.fromSwarm(t));else if("onion"===a)16===t.length&&(n="0x"+r.encode("onion",t));else{if("onion3"!==a)throw new Error("Could not encode content hash: unsupported content type");56===t.length&&(n="0x"+r.encode("onion3",t))}}catch(c){throw c}}return n}e.exports={decode:n,encode:i}},28178:function(e){"use strict";var t=[{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"resolver",outputs:[{name:"",type:"address"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"label",type:"bytes32"},{name:"owner",type:"address"}],name:"setSubnodeOwner",outputs:[],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"ttl",type:"uint64"}],name:"setTTL",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"ttl",outputs:[{name:"",type:"uint64"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"resolver",type:"address"}],name:"setResolver",outputs:[],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"owner",type:"address"}],name:"setOwner",outputs:[],payable:!1,type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"owner",type:"address"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!0,name:"label",type:"bytes32"},{indexed:!1,name:"owner",type:"address"}],name:"NewOwner",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"resolver",type:"address"}],name:"NewResolver",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"ttl",type:"uint64"}],name:"NewTTL",type:"event"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"}],name:"recordExists",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"},{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"resolver",type:"address"},{internalType:"uint64",name:"ttl",type:"uint64"}],name:"setSubnodeRecord",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}];e.exports=t},73589:function(e){"use strict";var t=[{constant:!0,inputs:[{name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",type:"bool"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"},{name:"contentTypes",type:"uint256"}],name:"ABI",outputs:[{name:"contentType",type:"uint256"},{name:"data",type:"bytes"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"hash",type:"bytes"}],name:"setMultihash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"multihash",outputs:[{name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],name:"setPubkey",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"content",outputs:[{name:"ret",type:"bytes32"}],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"addr",outputs:[{name:"ret",type:"address"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"contentType",type:"uint256"},{name:"data",type:"bytes"}],name:"setABI",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"name",outputs:[{name:"ret",type:"string"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"name",type:"string"}],name:"setName",outputs:[],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"hash",type:"bytes32"}],name:"setContent",outputs:[],payable:!1,type:"function"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"pubkey",outputs:[{name:"x",type:"bytes32"},{name:"y",type:"bytes32"}],payable:!1,type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"addr",type:"address"}],name:"setAddr",outputs:[],payable:!1,type:"function"},{inputs:[{name:"ensAddr",type:"address"}],payable:!1,type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"a",type:"address"}],name:"AddrChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"hash",type:"bytes32"}],name:"ContentChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"name",type:"string"}],name:"NameChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!0,name:"contentType",type:"uint256"}],name:"ABIChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"x",type:"bytes32"},{indexed:!1,name:"y",type:"bytes32"}],name:"PubkeyChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"node",type:"bytes32"},{indexed:!1,name:"hash",type:"bytes"}],name:"ContenthashChanged",type:"event"},{constant:!0,inputs:[{name:"node",type:"bytes32"}],name:"contenthash",outputs:[{name:"",type:"bytes"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"node",type:"bytes32"},{name:"hash",type:"bytes"}],name:"setContenthash",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}];e.exports=t},80188:function(e,t,a){"use strict";a(21703);const r=a(77802),n=a(83239),i=function(e,t){let a=e;while(a.length<2*t)a="0"+a;return a},c=function(e){const t="A".charCodeAt(0),a="Z".charCodeAt(0);return e=e.toUpperCase(),e=e.substr(4)+e.substr(0,4),e.split("").map((function(e){const r=e.charCodeAt(0);return r>=t&&r<=a?r-t+10:e})).join("")},f=function(e){let t,a=e;while(a.length>2)t=a.slice(0,9),a=parseInt(t,10)%97+a.slice(t.length);return parseInt(a,10)%97};class d{constructor(e){this._iban=e}static toAddress(e){if(e=new d(e),!e.isDirect())throw new Error("IBAN is indirect and can't be converted");return e.toAddress()}static toIban(e){return d.fromAddress(e).toString()}static fromAddress(e){if(!r.isAddress(e))throw new Error("Provided address is not a valid address: "+e);e=e.replace("0x","").replace("0X","");const t=new n(e,16),a=t.toString(36),c=i(a,15);return d.fromBban(c.toUpperCase())}static fromBban(e){const t="XE",a=f(c(t+"00"+e)),r=("0"+(98-a)).slice(-2);return new d(t+r+e)}static createIndirect(e){return d.fromBban("ETH"+e.institution+e.identifier)}static isValid(e){const t=new d(e);return t.isValid()}isValid(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===f(c(this._iban))}isDirect(){return 34===this._iban.length||35===this._iban.length}isIndirect(){return 20===this._iban.length}checksum(){return this._iban.substr(2,2)}institution(){return this.isIndirect()?this._iban.substr(7,4):""}client(){return this.isIndirect()?this._iban.substr(11):""}toAddress(){if(this.isDirect()){const e=this._iban.substr(4),t=new n(e,36);return r.toChecksumAddress(t.toString(16,20))}return""}toString(){return this._iban}}e.exports=d},83239:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(55896).Buffer}catch(E){}function f(e,t){var a=e.charCodeAt(t);return a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],b=[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],u=[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];function h(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function l(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?s[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=b[e],h=u[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:s[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function x(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function m(e,t,a){var r=new g;return r.mulp(e,t,a)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?p(this,e,t):r<63?l(this,e,t):r<1024?x(this,e,t):m(this,e,t),a},g.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(w,y),w.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return v[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},A.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},S.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},98662:function(e,t,a){"use strict";var r=a(36603),n=a(79021),i=a(77802),c=a(329),f=a(11205).formatters,d=function(){var e=this;r.packageInit(this,arguments),this.net=new c(this);var t=null,a="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return t},set:function(e){return e&&(t=i.toChecksumAddress(f.inputAddressFormatter(e))),d.forEach((function(e){e.defaultAccount=t})),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return a},set:function(e){return a=e,d.forEach((function(e){e.defaultBlock=a})),e},enumerable:!0});var d=[new n({name:"getAccounts",call:"personal_listAccounts",params:0,outputFormatter:i.toChecksumAddress}),new n({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null],outputFormatter:i.toChecksumAddress}),new n({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[f.inputAddressFormatter,null,null]}),new n({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[f.inputAddressFormatter]}),new n({name:"importRawKey",call:"personal_importRawKey",params:2}),new n({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[f.inputTransactionFormatter,null]}),new n({name:"signTransaction",call:"personal_signTransaction",params:2,inputFormatter:[f.inputTransactionFormatter,null]}),new n({name:"sign",call:"personal_sign",params:3,inputFormatter:[f.inputSignFormatter,f.inputAddressFormatter,null]}),new n({name:"ecRecover",call:"personal_ecRecover",params:2,inputFormatter:[f.inputSignFormatter,null]})];d.forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount}))};r.addProviders(d),e.exports=d},7663:function(e){"use strict";var t=function(e){var t,a=this;return this.net.getId().then((function(e){return t=e,a.getBlock(0)})).then((function(a){var r="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===a.hash&&1===t&&(r="main"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===a.hash&&3===t&&(r="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===a.hash&&4===t&&(r="rinkeby"),"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a"===a.hash&&5===t&&(r="goerli"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===a.hash&&42===t&&(r="kovan"),"function"===typeof e&&e(null,r),r})).catch((function(t){if("function"!==typeof e)throw t;e(t)}))};e.exports=t},50170:function(e,t,a){"use strict";var r=a(36603),n=a(11205),i=a(84598).subscriptions,c=a(79021),f=a(77802),d=a(329),o=a(65303),s=a(98662),b=a(93135),u=a(80188),h=a(73519),l=a(90056),p=a(7663),x=n.formatters,m=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},g=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},v=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},y=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},w=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"},M=function(){var e=this;r.packageInit(this,arguments);var t=this.setRequestManager;this.setRequestManager=function(a){return t(a),e.net.setRequestManager(a),e.personal.setRequestManager(a),e.accounts.setRequestManager(a),e.Contract._requestManager=e._requestManager,e.Contract.currentProvider=e._provider,!0};var a=this.setProvider;this.setProvider=function(){a.apply(e,arguments),e.setRequestManager(e._requestManager),e.ens._detectedAddress=null,e.ens._lastSyncCheck=null};var n,M,_,k=!1,A=null,S="latest",E=50,B=24,T=750,P=1e3,I=10,C=100;Object.defineProperty(this,"handleRevert",{get:function(){return k},set:function(t){k=t,e.Contract.handleRevert=k,N.forEach((function(e){e.handleRevert=k}))},enumerable:!0}),Object.defineProperty(this,"defaultCommon",{get:function(){return _},set:function(t){_=t,e.Contract.defaultCommon=_,N.forEach((function(e){e.defaultCommon=_}))},enumerable:!0}),Object.defineProperty(this,"defaultHardfork",{get:function(){return M},set:function(t){M=t,e.Contract.defaultHardfork=M,N.forEach((function(e){e.defaultHardfork=M}))},enumerable:!0}),Object.defineProperty(this,"defaultChain",{get:function(){return n},set:function(t){n=t,e.Contract.defaultChain=n,N.forEach((function(e){e.defaultChain=n}))},enumerable:!0}),Object.defineProperty(this,"transactionPollingTimeout",{get:function(){return T},set:function(t){T=t,e.Contract.transactionPollingTimeout=T,N.forEach((function(e){e.transactionPollingTimeout=T}))},enumerable:!0}),Object.defineProperty(this,"transactionPollingInterval",{get:function(){return P},set:function(t){P=t,e.Contract.transactionPollingInterval=P,N.forEach((function(e){e.transactionPollingInterval=P}))},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return B},set:function(t){B=t,e.Contract.transactionConfirmationBlocks=B,N.forEach((function(e){e.transactionConfirmationBlocks=B}))},enumerable:!0}),Object.defineProperty(this,"transactionBlockTimeout",{get:function(){return E},set:function(t){E=t,e.Contract.transactionBlockTimeout=E,N.forEach((function(e){e.transactionBlockTimeout=E}))},enumerable:!0}),Object.defineProperty(this,"blockHeaderTimeout",{get:function(){return I},set:function(t){I=t,e.Contract.blockHeaderTimeout=I,N.forEach((function(e){e.blockHeaderTimeout=I}))},enumerable:!0}),Object.defineProperty(this,"defaultAccount",{get:function(){return A},set:function(t){return t&&(A=f.toChecksumAddress(x.inputAddressFormatter(t))),e.Contract.defaultAccount=A,e.personal.defaultAccount=A,N.forEach((function(e){e.defaultAccount=A})),t},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return S},set:function(t){return S=t,e.Contract.defaultBlock=S,e.personal.defaultBlock=S,N.forEach((function(e){e.defaultBlock=S})),t},enumerable:!0}),Object.defineProperty(this,"maxListenersWarningThreshold",{get:function(){return C},set:function(t){e.currentProvider&&e.currentProvider.setMaxListeners&&(C=t,e.currentProvider.setMaxListeners(t))},enumerable:!0}),this.clearSubscriptions=e._requestManager.clearSubscriptions.bind(e._requestManager),this.removeSubscriptionById=e._requestManager.removeSubscription.bind(e._requestManager),this.net=new d(this),this.net.getNetworkType=p.bind(this),this.accounts=new h(this),this.personal=new s(this),this.personal.defaultAccount=this.defaultAccount,this.maxListenersWarningThreshold=C;var R=this,O=function(){b.apply(this,arguments);var e=this,t=R.setProvider;R.setProvider=function(){t.apply(R,arguments),r.packageInit(e,[R])}};O.setProvider=function(){b.setProvider.apply(this,arguments)},O.prototype=Object.create(b.prototype),O.prototype.constructor=O,this.Contract=O,this.Contract.defaultAccount=this.defaultAccount,this.Contract.defaultBlock=this.defaultBlock,this.Contract.transactionBlockTimeout=this.transactionBlockTimeout,this.Contract.transactionConfirmationBlocks=this.transactionConfirmationBlocks,this.Contract.transactionPollingTimeout=this.transactionPollingTimeout,this.Contract.transactionPollingInterval=this.transactionPollingInterval,this.Contract.blockHeaderTimeout=this.blockHeaderTimeout,this.Contract.handleRevert=this.handleRevert,this.Contract._requestManager=this._requestManager,this.Contract._ethAccounts=this.accounts,this.Contract.currentProvider=this._requestManager.provider,this.Iban=u,this.abi=l,this.ens=new o(this);var N=[new c({name:"getNodeInfo",call:"web3_clientVersion"}),new c({name:"getProtocolVersion",call:"eth_protocolVersion",params:0}),new c({name:"getCoinbase",call:"eth_coinbase",params:0}),new c({name:"isMining",call:"eth_mining",params:0}),new c({name:"getHashrate",call:"eth_hashrate",params:0,outputFormatter:f.hexToNumber}),new c({name:"isSyncing",call:"eth_syncing",params:0,outputFormatter:x.outputSyncingFormatter}),new c({name:"getGasPrice",call:"eth_gasPrice",params:0,outputFormatter:x.outputBigNumberFormatter}),new c({name:"getFeeHistory",call:"eth_feeHistory",params:3,inputFormatter:[f.numberToHex,x.inputBlockNumberFormatter,null]}),new c({name:"getAccounts",call:"eth_accounts",params:0,outputFormatter:f.toChecksumAddress}),new c({name:"getBlockNumber",call:"eth_blockNumber",params:0,outputFormatter:f.hexToNumber}),new c({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[x.inputAddressFormatter,x.inputDefaultBlockNumberFormatter],outputFormatter:x.outputBigNumberFormatter}),new c({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[x.inputAddressFormatter,f.numberToHex,x.inputDefaultBlockNumberFormatter]}),new c({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[x.inputAddressFormatter,x.inputDefaultBlockNumberFormatter]}),new c({name:"getBlock",call:m,params:2,inputFormatter:[x.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:x.outputBlockFormatter}),new c({name:"getUncle",call:v,params:2,inputFormatter:[x.inputBlockNumberFormatter,f.numberToHex],outputFormatter:x.outputBlockFormatter}),new c({name:"getBlockTransactionCount",call:y,params:1,inputFormatter:[x.inputBlockNumberFormatter],outputFormatter:f.hexToNumber}),new c({name:"getBlockUncleCount",call:w,params:1,inputFormatter:[x.inputBlockNumberFormatter],outputFormatter:f.hexToNumber}),new c({name:"getTransaction",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:x.outputTransactionFormatter}),new c({name:"getTransactionFromBlock",call:g,params:2,inputFormatter:[x.inputBlockNumberFormatter,f.numberToHex],outputFormatter:x.outputTransactionFormatter}),new c({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:x.outputTransactionReceiptFormatter}),new c({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[x.inputAddressFormatter,x.inputDefaultBlockNumberFormatter],outputFormatter:f.hexToNumber}),new c({name:"sendSignedTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null],abiCoder:l}),new c({name:"signTransaction",call:"eth_signTransaction",params:1,inputFormatter:[x.inputTransactionFormatter]}),new c({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[x.inputTransactionFormatter],abiCoder:l}),new c({name:"sign",call:"eth_sign",params:2,inputFormatter:[x.inputSignFormatter,x.inputAddressFormatter],transformPayload:function(e){return e.params.reverse(),e}}),new c({name:"call",call:"eth_call",params:2,inputFormatter:[x.inputCallFormatter,x.inputDefaultBlockNumberFormatter],abiCoder:l}),new c({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[x.inputCallFormatter],outputFormatter:f.hexToNumber}),new c({name:"submitWork",call:"eth_submitWork",params:3}),new c({name:"getWork",call:"eth_getWork",params:0}),new c({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[x.inputLogFormatter],outputFormatter:x.outputLogFormatter}),new c({name:"getChainId",call:"eth_chainId",params:0,outputFormatter:f.hexToNumber}),new c({name:"requestAccounts",call:"eth_requestAccounts",params:0,outputFormatter:f.toChecksumAddress}),new c({name:"getProof",call:"eth_getProof",params:3,inputFormatter:[x.inputAddressFormatter,x.inputStorageKeysFormatter,x.inputDefaultBlockNumberFormatter],outputFormatter:x.outputProofFormatter}),new c({name:"getPendingTransactions",call:"eth_pendingTransactions",params:0,outputFormatter:x.outputTransactionFormatter}),new c({name:"createAccessList",call:"eth_createAccessList",params:2,inputFormatter:[x.inputTransactionFormatter,x.inputDefaultBlockNumberFormatter]}),new i({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:x.outputBlockFormatter},pendingTransactions:{subscriptionName:"newPendingTransactions",params:0},logs:{params:1,inputFormatter:[x.inputLogFormatter],outputFormatter:x.outputLogFormatter,subscriptionHandler:function(e){e.removed?this.emit("changed",e):this.emit("data",e),"function"===typeof this.callback&&this.callback(null,e,this)}},syncing:{params:0,outputFormatter:x.outputSyncingFormatter,subscriptionHandler:function(e){var t=this;!0!==this._isSyncing?(this._isSyncing=!0,this.emit("changed",t._isSyncing),"function"===typeof this.callback&&this.callback(null,t._isSyncing,this),setTimeout((function(){t.emit("data",e),"function"===typeof t.callback&&t.callback(null,e,t)}),0)):(this.emit("data",e),"function"===typeof t.callback&&this.callback(null,e,this),clearTimeout(this._isSyncingTimeout),this._isSyncingTimeout=setTimeout((function(){e.currentBlock>e.highestBlock-200&&(t._isSyncing=!1,t.emit("changed",t._isSyncing),"function"===typeof t.callback&&t.callback(null,t._isSyncing,t))}),500))}}}})];N.forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager,e.accounts),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount,t.transactionBlockTimeout=e.transactionBlockTimeout,t.transactionConfirmationBlocks=e.transactionConfirmationBlocks,t.transactionPollingTimeout=e.transactionPollingTimeout,t.transactionPollingInterval=e.transactionPollingInterval,t.handleRevert=e.handleRevert}))};r.addProviders(M),e.exports=M},329:function(e,t,a){"use strict";var r=a(36603),n=a(79021),i=a(77802),c=function(){var e=this;r.packageInit(this,arguments),[new n({name:"getId",call:"net_version",params:0,outputFormatter:parseInt}),new n({name:"isListening",call:"net_listening",params:0}),new n({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:i.hexToNumber})].forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}))};r.addProviders(c),e.exports=c},79948:function(e,t,a){a(21703);const r=a(43793).EventEmitter,n=a(9242).inherits,i=a(60345),c=a(97965),f=a(26458),d=a(48981),o=a(4208),s=(a(67046),a(72070)),b=function(){};function u(e){const t=this;r.call(t),t.setMaxListeners(30),e=e||{};const a={sendAsync:t._handleAsync.bind(t)},n=e.blockTrackerProvider||a;t._blockTracker=e.blockTracker||new c({provider:n,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:!0}),t._ready=new o,t.currentBlock=null,t._providers=[]}function h(e){return{number:i.toBuffer(e.number),hash:i.toBuffer(e.hash),parentHash:i.toBuffer(e.parentHash),nonce:i.toBuffer(e.nonce),mixHash:i.toBuffer(e.mixHash),sha3Uncles:i.toBuffer(e.sha3Uncles),logsBloom:i.toBuffer(e.logsBloom),transactionsRoot:i.toBuffer(e.transactionsRoot),stateRoot:i.toBuffer(e.stateRoot),receiptsRoot:i.toBuffer(e.receiptRoot||e.receiptsRoot),miner:i.toBuffer(e.miner),difficulty:i.toBuffer(e.difficulty),totalDifficulty:i.toBuffer(e.totalDifficulty),size:i.toBuffer(e.size),extraData:i.toBuffer(e.extraData),gasLimit:i.toBuffer(e.gasLimit),gasUsed:i.toBuffer(e.gasUsed),timestamp:i.toBuffer(e.timestamp),transactions:e.transactions}}e.exports=u,n(u,r),u.prototype.start=function(e=b){const t=this;t._ready.go(),t._blockTracker.on("latest",(e=>{t._getBlockByNumberWithRetry(e,((e,a)=>{if(e)return void this.emit("error",e);if(!a)return console.log(a),void this.emit("error",new Error("Could not find block"));const r=h(a);t._setCurrentBlock(r),t.emit("rawBlock",a),t.emit("latest",a)}))})),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")},u.prototype.stop=function(){const e=this;e._blockTracker.removeAllListeners(),e._running=!1,e.emit("stop")},u.prototype.isRunning=function(){const e=this;return e._running},u.prototype.addProvider=function(e,t){const a=this;"number"===typeof t?a._providers.splice(t,0,e):a._providers.push(e),e.setEngine(this)},u.prototype.removeProvider=function(e){const t=this,a=t._providers.indexOf(e);if(a<0)throw new Error("Provider not found.");t._providers.splice(a,1)},u.prototype.send=function(e){throw new Error("Web3ProviderEngine does not support synchronous requests.")},u.prototype.sendAsync=function(e,t){const a=this;a._ready.await((function(){Array.isArray(e)?f(e,a._handleAsync.bind(a),t):a._handleAsync(e,t)}))},u.prototype._getBlockByNumberWithRetry=function(e,t){const a=this;let r=5;return void n();function n(){a._getBlockByNumber(e,i)}function i(e,a){return e?t(e):a?void t(null,a):r>0?(r--,void setTimeout((function(){n()}),1e3)):void t(null,null)}},u.prototype._getBlockByNumber=function(e,t){const a=s({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(a,((e,a)=>e?t(e):t(null,a.result)))},u.prototype._handleAsync=function(e,t){var a=this,r=-1,n=null,i=null,c=[];function f(t){if(r+=1,c.unshift(t),r>=a._providers.length)o(new Error('Request for method "'+e.method+'" not handled by any subprovider. Please check your subprovider configuration to ensure this method is handled.'));else try{var n=a._providers[r];n.handleRequest(e,f,o)}catch(i){o(i)}}function o(a,r){i=a,n=r,d(c,(function(e,t){e?e(i,n,t):t()}),(function(){var a={id:e.id,jsonrpc:e.jsonrpc,result:n};null!=i?(a.error={message:i.stack||i.message||i,code:-32e3},t(i,a)):t(null,a)}))}f()},u.prototype._setCurrentBlock=function(e){const t=this;t.currentBlock=e,t.emit("block",e)}},91501:function(e,t,a){const r=a(8569),n=a(47322);class i extends r{constructor(e){super((({blockTracker:t})=>n(Object.assign({blockTracker:t},e))))}}e.exports=i},23220:function(e,t,a){const r=a(8569),n=a(56615);class i extends r{constructor(){super((({blockTracker:e,provider:t,engine:a})=>n({blockTracker:e,provider:t})))}}e.exports=i},51080:function(e,t,a){const r=a(9242).inherits,n=a(5484);function i(e){const t=this;e=e||{},t.staticResponses=e}e.exports=i,r(i,n),i.prototype.handleRequest=function(e,t,a){const r=this;var n=r.staticResponses[e.method];"function"===typeof n?n(e,t,a):void 0!==n?setTimeout((()=>a(null,n))):t()}},49537:function(e,t,a){a(21703);const r=a(93344),n=a(92172),i=a(9242).inherits,c=a(60345),f=a(98013),d=a(57636),o=a(46941),s=a(5484),b=a(84084),u=/^[0-9A-Fa-f]+$/g;function h(e){const t=this;t.nonceLock=o(1),e.getAccounts&&(t.getAccounts=e.getAccounts),e.processTransaction&&(t.processTransaction=e.processTransaction),e.processMessage&&(t.processMessage=e.processMessage),e.processPersonalMessage&&(t.processPersonalMessage=e.processPersonalMessage),e.processTypedMessage&&(t.processTypedMessage=e.processTypedMessage),t.approveTransaction=e.approveTransaction||t.autoApprove,t.approveMessage=e.approveMessage||t.autoApprove,t.approvePersonalMessage=e.approvePersonalMessage||t.autoApprove,t.approveDecryptMessage=e.approveDecryptMessage||t.autoApprove,t.approveEncryptionPublicKey=e.approveEncryptionPublicKey||t.autoApprove,t.approveTypedMessage=e.approveTypedMessage||t.autoApprove,e.signTransaction&&(t.signTransaction=e.signTransaction||v("signTransaction")),e.signMessage&&(t.signMessage=e.signMessage||v("signMessage")),e.signPersonalMessage&&(t.signPersonalMessage=e.signPersonalMessage||v("signPersonalMessage")),e.decryptMessage&&(t.decryptMessage=e.decryptMessage||v("decryptMessage")),e.encryptionPublicKey&&(t.encryptionPublicKey=e.encryptionPublicKey||v("encryptionPublicKey")),e.signTypedMessage&&(t.signTypedMessage=e.signTypedMessage||v("signTypedMessage")),e.recoverPersonalSignature&&(t.recoverPersonalSignature=e.recoverPersonalSignature),e.publishTransaction&&(t.publishTransaction=e.publishTransaction),t.estimateGas=e.estimateGas||t.estimateGas,t.getGasPrice=e.getGasPrice||t.getGasPrice}function l(e){return{from:e.from,to:e.to,value:e.value,data:e.data,gas:e.gas,gasPrice:e.gasPrice,nonce:e.nonce}}function p(e){return e.toLowerCase()}function x(e){const t=c.addHexPrefix(e),a=c.isValidAddress(t);return a}function m(e){const t=c.addHexPrefix(e),a=c.isValidAddress(t);return!a&&g(e)}function g(e){const t="string"===typeof e;if(!t)return!1;const a="0x"===e.slice(0,2);if(!a)return!1;const r=e.slice(2),n=r.match(u);return n}function v(e){return function(t,a){a(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}e.exports=h,i(h,s),h.prototype.handleRequest=function(e,t,a){const n=this;let i,c,f,o,s;switch(n._parityRequests={},n._parityRequestCount=0,e.method){case"eth_coinbase":return void n.getAccounts((function(e,t){if(e)return a(e);let r=t[0]||null;a(null,r)}));case"eth_accounts":return void n.getAccounts((function(e,t){if(e)return a(e);a(null,t)}));case"eth_sendTransaction":return i=e.params[0],void r([e=>n.validateTransaction(i,e),e=>n.processTransaction(i,e)],a);case"eth_signTransaction":return i=e.params[0],void r([e=>n.validateTransaction(i,e),e=>n.processSignTransaction(i,e)],a);case"eth_sign":return s=e.params[0],o=e.params[1],f=e.params[2]||{},c=d(f,{from:s,data:o}),void r([e=>n.validateMessage(c,e),e=>n.processMessage(c,e)],a);case"personal_sign":return function(){const t=e.params[0],i=e.params[1];if(m(i)&&x(t)){let t="The eth_personalSign method requires params ordered ";t+="[message, address]. This was previously handled incorrectly, ",t+="and has been corrected automatically. ",t+="Please switch this param order for smooth behavior in the future.",console.warn(t),s=e.params[0],o=e.params[1]}else o=e.params[0],s=e.params[1];f=e.params[2]||{},c=d(f,{from:s,data:o}),r([e=>n.validatePersonalMessage(c,e),e=>n.processPersonalMessage(c,e)],a)}();case"eth_decryptMessage":return function(){const t=e.params[0],i=e.params[1];if(m(i)&&x(t)){let t="The eth_decryptMessage method requires params ordered ";t+="[message, address]. This was previously handled incorrectly, ",t+="and has been corrected automatically. ",t+="Please switch this param order for smooth behavior in the future.",console.warn(t),s=e.params[0],o=e.params[1]}else o=e.params[0],s=e.params[1];f=e.params[2]||{},c=d(f,{from:s,data:o}),r([e=>n.validateDecryptMessage(c,e),e=>n.processDecryptMessage(c,e)],a)}();case"encryption_public_key":return function(){const t=e.params[0];r([e=>n.validateEncryptionPublicKey(t,e),e=>n.processEncryptionPublicKey(t,e)],a)}();case"personal_ecRecover":return function(){o=e.params[0];let t=e.params[1];f=e.params[2]||{},c=d(f,{sig:t,data:o}),n.recoverPersonalSignature(c,a)}();case"eth_signTypedData":case"eth_signTypedData_v3":case"eth_signTypedData_v4":return function(){const t=e.params[0],i=e.params[1];x(t)?(s=t,o=i):(o=t,s=i),f=e.params[2]||{},c=d(f,{from:s,data:o}),r([e=>n.validateTypedMessage(c,e),e=>n.processTypedMessage(c,e)],a)}();case"parity_postTransaction":return i=e.params[0],void n.parityPostTransaction(i,a);case"parity_postSign":return s=e.params[0],o=e.params[1],void n.parityPostSign(s,o,a);case"parity_checkRequest":return function(){const t=e.params[0];n.parityCheckRequest(t,a)}();case"parity_defaultAccount":return void n.getAccounts((function(e,t){if(e)return a(e);const r=t[0]||null;a(null,r)}));default:return void t()}},h.prototype.getAccounts=function(e){e(null,[])},h.prototype.processTransaction=function(e,t){const a=this;r([t=>a.approveTransaction(e,t),(e,t)=>a.checkApproval("transaction",e,t),t=>a.finalizeAndSubmitTx(e,t)],t)},h.prototype.processSignTransaction=function(e,t){const a=this;r([t=>a.approveTransaction(e,t),(e,t)=>a.checkApproval("transaction",e,t),t=>a.finalizeTx(e,t)],t)},h.prototype.processMessage=function(e,t){const a=this;r([t=>a.approveMessage(e,t),(e,t)=>a.checkApproval("message",e,t),t=>a.signMessage(e,t)],t)},h.prototype.processPersonalMessage=function(e,t){const a=this;r([t=>a.approvePersonalMessage(e,t),(e,t)=>a.checkApproval("message",e,t),t=>a.signPersonalMessage(e,t)],t)},h.prototype.processDecryptMessage=function(e,t){const a=this;r([t=>a.approveDecryptMessage(e,t),(e,t)=>a.checkApproval("decryptMessage",e,t),t=>a.decryptMessage(e,t)],t)},h.prototype.processEncryptionPublicKey=function(e,t){const a=this;r([t=>a.approveEncryptionPublicKey(e,t),(e,t)=>a.checkApproval("encryptionPublicKey",e,t),t=>a.encryptionPublicKey(e,t)],t)},h.prototype.processTypedMessage=function(e,t){const a=this;r([t=>a.approveTypedMessage(e,t),(e,t)=>a.checkApproval("message",e,t),t=>a.signTypedMessage(e,t)],t)},h.prototype.autoApprove=function(e,t){t(null,!0)},h.prototype.checkApproval=function(e,t,a){a(t?null:new Error("User denied "+e+" signature."))},h.prototype.parityPostTransaction=function(e,t){const a=this,r=a._parityRequestCount,n=`0x${r.toString(16)}`;a._parityRequestCount++,a.emitPayload({method:"eth_sendTransaction",params:[e]},(function(e,t){if(e)return void(a._parityRequests[n]={error:e});const r=t.result;a._parityRequests[n]=r})),t(null,n)},h.prototype.parityPostSign=function(e,t,a){const r=this,n=r._parityRequestCount,i=`0x${n.toString(16)}`;r._parityRequestCount++,r.emitPayload({method:"eth_sign",params:[e,t]},(function(e,t){if(e)return void(r._parityRequests[i]={error:e});const a=t.result;r._parityRequests[i]=a})),a(null,i)},h.prototype.parityCheckRequest=function(e,t){const a=this,r=a._parityRequests[e]||null;return r?r.error?t(r.error):void t(null,r):t(null,null)},h.prototype.recoverPersonalSignature=function(e,t){let a;try{a=f.recoverPersonalSignature(e)}catch(r){return t(r)}t(null,a)},h.prototype.validateTransaction=function(e,t){const a=this;if(void 0===e.from)return t(new Error("Undefined address - from address required to sign transaction."));a.validateSender(e.from,(function(a,r){return a?t(a):r?void t():t(new Error(`Unknown address - unable to sign transaction for this address: "${e.from}"`))}))},h.prototype.validateMessage=function(e,t){const a=this;if(void 0===e.from)return t(new Error("Undefined address - from address required to sign message."));a.validateSender(e.from,(function(a,r){return a?t(a):r?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))}))},h.prototype.validatePersonalMessage=function(e,t){const a=this;return void 0===e.from?t(new Error("Undefined address - from address required to sign personal message.")):void 0===e.data?t(new Error("Undefined message - message required to sign personal message.")):g(e.data)?void a.validateSender(e.from,(function(a,r){return a?t(a):r?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))})):t(new Error("HookedWalletSubprovider - validateMessage - message was not encoded as hex."))},h.prototype.validateDecryptMessage=function(e,t){const a=this;return void 0===e.from?t(new Error("Undefined address - from address required to decrypt message.")):void 0===e.data?t(new Error("Undefined message - message required to decrypt message.")):g(e.data)?void a.validateSender(e.from,(function(a,r){return a?t(a):r?void t():t(new Error(`Unknown address - unable to decrypt message for this address: "${e.from}"`))})):t(new Error("HookedWalletSubprovider - validateDecryptMessage - message was not encoded as hex."))},h.prototype.validateEncryptionPublicKey=function(e,t){const a=this;a.validateSender(e,(function(a,r){return a?t(a):r?void t():t(new Error(`Unknown address - unable to obtain encryption public key for this address: "${e}"`))}))},h.prototype.validateTypedMessage=function(e,t){return void 0===e.from?t(new Error("Undefined address - from address required to sign typed data.")):void 0===e.data?t(new Error("Undefined data - message required to sign typed data.")):void this.validateSender(e.from,(function(a,r){return a?t(a):r?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))}))},h.prototype.validateSender=function(e,t){const a=this;if(!e)return t(null,!1);a.getAccounts((function(a,r){if(a)return t(a);const n=-1!==r.map(p).indexOf(e.toLowerCase());t(null,n)}))},h.prototype.finalizeAndSubmitTx=function(e,t){const a=this;a.nonceLock.take((function(){r([a.fillInTxExtras.bind(a,e),a.signTransaction.bind(a),a.publishTransaction.bind(a)],(function(e,r){if(a.nonceLock.leave(),e)return t(e);t(null,r)}))}))},h.prototype.finalizeTx=function(e,t){const a=this;a.nonceLock.take((function(){r([a.fillInTxExtras.bind(a,e),a.signTransaction.bind(a)],(function(r,n){if(a.nonceLock.leave(),r)return t(r);t(null,{raw:n,tx:e})}))}))},h.prototype.publishTransaction=function(e,t){const a=this;a.emitPayload({method:"eth_sendRawTransaction",params:[e]},(function(e,a){if(e)return t(e);t(null,a.result)}))},h.prototype.estimateGas=function(e,t){const a=this;b(a.engine,e,t)},h.prototype.getGasPrice=function(e){const t=this;t.emitPayload({method:"eth_gasPrice",params:[]},(function(t,a){if(t)return e(t);e(null,a.result)}))},h.prototype.fillInTxExtras=function(e,t){const a=this,r=e.from,i={};void 0===e.gasPrice&&(i.gasPrice=a.getGasPrice.bind(a)),void 0===e.nonce&&(i.nonce=a.emitPayload.bind(a,{method:"eth_getTransactionCount",params:[r,"pending"]})),void 0===e.gas&&(i.gas=a.estimateGas.bind(a,l(e))),n(i,(function(a,r){if(a)return t(a);const n={};r.gasPrice&&(n.gasPrice=r.gasPrice),r.nonce&&(n.nonce=r.nonce.result),r.gas&&(n.gas=r.gas),t(null,d(e,n))}))}},8569:function(e,t,a){a(21703);const r=a(5484);class n extends r{constructor(e){if(super(),!e)throw new Error("JsonRpcEngineMiddlewareSubprovider - no constructorFn specified");this._constructorFn=e}setEngine(e){if(this.middleware)throw new Error("JsonRpcEngineMiddlewareSubprovider - subprovider added to engine twice");const t=e._blockTracker,a=this._constructorFn({engine:e,provider:e,blockTracker:t});if(!a)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!==typeof a)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=a}handleRequest(e,t,a){const r={id:e.id};function n(e){t(((t,a,n)=>{t?(delete r.result,r.error={message:t.message||t}):r.result=a,e?e(n):n()}))}function i(e){if(e)return a(e);a(null,r.result)}this.middleware(e,r,n,i)}}e.exports=n},50822:function(e,t,a){var r=a(15361)["Buffer"];const n=a(9242).inherits,i=a(60253),c=a(60345),f=a(5484),d=a(67046).blockTagForPayload;function o(e){const t=this;t.nonceCache={}}e.exports=o,n(o,f),o.prototype.handleRequest=function(e,t,a){const n=this;switch(e.method){case"eth_getTransactionCount":var f=d(e),o=e.params[0].toLowerCase(),s=n.nonceCache[o];return void("pending"===f?s?a(null,s):t((function(e,t,a){if(e)return a();void 0===n.nonceCache[o]&&(n.nonceCache[o]=t),a()})):t());case"eth_sendRawTransaction":return void t((function(t,a,f){if(t)return f();var d=e.params[0],o=(c.stripHexPrefix(d),r.from(c.stripHexPrefix(d),"hex"),new i(r.from(c.stripHexPrefix(d),"hex"))),s="0x"+o.getSenderAddress().toString("hex").toLowerCase(),b=c.bufferToInt(o.nonce);b++;var u=b.toString(16);u.length%2&&(u="0"+u),u="0x"+u,n.nonceCache[s]=u,f()}));case"evm_revert":return n.nonceCache={},void t();default:return void t()}}},5484:function(e,t,a){a(21703);const r=a(72070);function n(){}e.exports=n,n.prototype.setEngine=function(e){const t=this;t.engine||(t.engine=e,e.on("block",(function(e){t.currentBlock=e})),e.on("start",(function(){t.start()})),e.on("stop",(function(){t.stop()})))},n.prototype.handleRequest=function(e,t,a){throw new Error("Subproviders should override `handleRequest`.")},n.prototype.emitPayload=function(e,t){const a=this;a.engine.sendAsync(r(e),t)},n.prototype.stop=function(){},n.prototype.start=function(){}},95905:function(e,t,a){const r=a(8569),n=a(67234);class i extends r{constructor(){super((({blockTracker:e,provider:t,engine:a})=>{const{events:r,middleware:i}=n({blockTracker:e,provider:t});return r.on("notification",(e=>a.emit("data",null,e))),i}))}}e.exports=i},72070:function(e,t,a){const r=a(75482),n=a(57636);function i(e){return n({id:r(),jsonrpc:"2.0",params:[]},e)}e.exports=i},84084:function(e,t,a){const r=a(72070);function n(e,t,a){e.sendAsync(r({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?a(null,"0xcf08"):a(e);a(null,t.result)}))}e.exports=n},75482:function(e){function t(){return Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}e.exports=t},67046:function(e,t,a){const r=a(40391);function n(e,t={}){if(!i(e))return null;const{includeBlockRef:a}=t,n=a?e.params:f(e);return e.method+":"+r(n)}function i(e){return"never"!==o(e)}function c(e){var t=d(e);return t>=e.params.length?null:e.params[t]}function f(e){var t=d(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function d(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function o(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:n,canCache:i,blockTagForPayload:c,paramsWithoutBlockTag:f,blockTagParamIndex:d,cacheTypeForPayload:o}},4208:function(e,t,a){const r=a(43793).EventEmitter,n=a(9242).inherits;function i(){const e=this;r.call(e),e.isLocked=!0}e.exports=i,n(i,r),i.prototype.go=function(){const e=this;e.isLocked=!1,e.emit("unlock")},i.prototype.stop=function(){const e=this;e.isLocked=!0,e.emit("lock")},i.prototype.await=function(e){const t=this;t.isLocked?t.once("unlock",e):setTimeout(e)}},78170:function(e,t,a){var r=a(11205).errors,n=a(51283).XMLHttpRequest,i=a(57463),c=a(23424),f=function(e,t){t=t||{},this.withCredentials=t.withCredentials||!1,this.timeout=t.timeout||0,this.headers=t.headers,this.agent=t.agent,this.connected=!1;const a=!1!==t.keepAlive;this.host=e||"http://localhost:8545",this.agent||("https"===this.host.substring(0,5)?this.httpsAgent=new c.Agent({keepAlive:a}):this.httpAgent=new i.Agent({keepAlive:a}))};f.prototype._prepareRequest=function(){var e;if("undefined"!==typeof XMLHttpRequest)e=new XMLHttpRequest;else{e=new n;var t={httpsAgent:this.httpsAgent,httpAgent:this.httpAgent,baseUrl:this.baseUrl};this.agent&&(t.httpsAgent=this.agent.https,t.httpAgent=this.agent.http,t.baseUrl=this.agent.baseUrl),e.nodejsSet(t)}return e.open("POST",this.host,!0),e.setRequestHeader("Content-Type","application/json"),e.timeout=this.timeout,e.withCredentials=this.withCredentials,this.headers&&this.headers.forEach((function(t){e.setRequestHeader(t.name,t.value)})),e},f.prototype.send=function(e,t){var a=this,n=this._prepareRequest();n.onreadystatechange=function(){if(4===n.readyState&&1!==n.timeout){var e=n.responseText,i=null;try{e=JSON.parse(e)}catch(c){i=r.InvalidResponse(n.responseText)}a.connected=!0,t(i,e)}},n.ontimeout=function(){a.connected=!1,t(r.ConnectionTimeout(this.timeout))};try{n.send(JSON.stringify(e))}catch(i){this.connected=!1,t(r.InvalidConnection(this.host))}},f.prototype.disconnect=function(){},f.prototype.supportsSubscriptions=function(){return!1},e.exports=f},9510:function(e,t,a){"use strict";a(21703);var r=a(11205).errors,n=a(43373),i=function(e,t){var a=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=e,this.connected=!1,this.connection=t.connect({path:this.path}),this.addDefaultEvents();var r=function(e){var t=null;Array.isArray(e)?e.forEach((function(e){a.responseCallbacks[e.id]&&(t=e.id)})):t=e.id,t||-1===e.method.indexOf("_subscription")?a.responseCallbacks[t]&&(a.responseCallbacks[t](null,e),delete a.responseCallbacks[t]):a.notificationCallbacks.forEach((function(t){"function"===typeof t&&t(e)}))};"Socket"===t.constructor.name?n(this.connection).done(r):this.connection.on("data",(function(e){a._parseResponse(e.toString()).forEach(r)}))};i.prototype.addDefaultEvents=function(){var e=this;this.connection.on("connect",(function(){e.connected=!0})),this.connection.on("close",(function(){e.connected=!1})),this.connection.on("error",(function(){e._timeout()})),this.connection.on("end",(function(){e._timeout()})),this.connection.on("timeout",(function(){e._timeout()}))},i.prototype._parseResponse=function(e){var t=this,a=[],n=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return n.forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);var n=null;try{n=JSON.parse(e)}catch(i){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout((function(){throw t._timeout(),r.InvalidResponse(e)}),15e3))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&a.push(n)})),a},i.prototype._addResponseCallback=function(e,t){var a=e.id||e[0].id,r=e.method||e[0].method;this.responseCallbacks[a]=t,this.responseCallbacks[a].method=r},i.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](r.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},i.prototype.reconnect=function(){this.connection.connect({path:this.path})},i.prototype.send=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},i.prototype.on=function(e,t){if("function"!==typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.notificationCallbacks.push(t);break;default:this.connection.on(e,t);break}},i.prototype.once=function(e,t){if("function"!==typeof t)throw new Error("The second parameter callback must be a function.");this.connection.once(e,t)},i.prototype.removeListener=function(e,t){var a=this;switch(e){case"data":this.notificationCallbacks.forEach((function(e,r){e===t&&a.notificationCallbacks.splice(r,1)}));break;default:this.connection.removeListener(e,t);break}},i.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(e);break}},i.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},i.prototype.supportsSubscriptions=function(){return!0},e.exports=i},7503:function(e,t,a){var r=a(96027),n=a(15361)["Buffer"];a(82801);var i="[object process]"===Object.prototype.toString.call("undefined"!==typeof r?r:0),c="undefined"!==typeof navigator&&"ReactNative"===navigator.product,f=null,d=null;if(i||c){f=function(e){return n.from(e).toString("base64")};var o=a(8185);if(o.URL){var s=o.URL;d=function(e){return new s(e)}}else d=a(8185).parse}else f=btoa.bind("object"===typeof globalThis?globalThis:self),d=function(e){return new URL(e)};e.exports={parseURL:d,btoa:f}},62990:function(e,t,a){"use strict";var r=a(96266),n=a(7503),i=a(11205).errors,c=a(13977).w3cwebsocket,f=function(e,t){r.call(this),t=t||{},this.url=e,this._customTimeout=t.timeout||15e3,this.headers=t.headers||{},this.protocol=t.protocol||void 0,this.reconnectOptions=Object.assign({auto:!1,delay:5e3,maxAttempts:!1,onTimeout:!1},t.reconnect),this.clientConfig=t.clientConfig||void 0,this.requestOptions=t.requestOptions||void 0,this.DATA="data",this.CLOSE="close",this.ERROR="error",this.CONNECT="connect",this.RECONNECT="reconnect",this.connection=null,this.requestQueue=new Map,this.responseQueue=new Map,this.reconnectAttempts=0,this.reconnecting=!1;var a=n.parseURL(e);a.username&&a.password&&(this.headers.authorization="Basic "+n.btoa(a.username+":"+a.password)),a.auth&&(this.headers.authorization="Basic "+n.btoa(a.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};f.prototype=Object.create(r.prototype),f.prototype.constructor=f,f.prototype.connect=function(){this.connection=new c(this.url,this.protocol,void 0,this.headers,this.requestOptions,this.clientConfig),this._addSocketListeners()},f.prototype._onMessage=function(e){var t=this;this._parseResponse("string"===typeof e.data?e.data:"").forEach((function(e){if(e.method&&-1!==e.method.indexOf("_subscription"))t.emit(t.DATA,e);else{var a=e.id;Array.isArray(e)&&(a=e[0].id),t.responseQueue.has(a)&&(void 0!==t.responseQueue.get(a).callback&&t.responseQueue.get(a).callback(!1,e),t.responseQueue.delete(a))}}))},f.prototype._onConnect=function(){if(this.emit(this.CONNECT),this.reconnectAttempts=0,this.reconnecting=!1,this.requestQueue.size>0){var e=this;this.requestQueue.forEach((function(t,a){e.send(t.payload,t.callback),e.requestQueue.delete(a)}))}},f.prototype._onClose=function(e){var t=this;!this.reconnectOptions.auto||[1e3,1001].includes(e.code)&&!1!==e.wasClean?(this.emit(this.CLOSE,e),this.requestQueue.size>0&&this.requestQueue.forEach((function(a,r){a.callback(i.ConnectionNotOpenError(e)),t.requestQueue.delete(r)})),this.responseQueue.size>0&&this.responseQueue.forEach((function(a,r){a.callback(i.InvalidConnection("on WS",e)),t.responseQueue.delete(r)})),this._removeSocketListeners(),this.removeAllListeners()):this.reconnect()},f.prototype._addSocketListeners=function(){this.connection.addEventListener("message",this._onMessage.bind(this)),this.connection.addEventListener("open",this._onConnect.bind(this)),this.connection.addEventListener("close",this._onClose.bind(this))},f.prototype._removeSocketListeners=function(){this.connection.removeEventListener("message",this._onMessage),this.connection.removeEventListener("open",this._onConnect),this.connection.removeEventListener("close",this._onClose)},f.prototype._parseResponse=function(e){var t=this,a=[],r=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return r.forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);var r=null;try{r=JSON.parse(e)}catch(n){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout((function(){t.reconnectOptions.auto&&t.reconnectOptions.onTimeout?t.reconnect():(t.emit(t.ERROR,i.ConnectionTimeout(t._customTimeout)),t.requestQueue.size>0&&t.requestQueue.forEach((function(e,a){e.callback(i.ConnectionTimeout(t._customTimeout)),t.requestQueue.delete(a)})))}),t._customTimeout))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,r&&a.push(r)})),a},f.prototype.send=function(e,t){var a=this,r=e.id,n={payload:e,callback:t};if(Array.isArray(e)&&(r=e[0].id),this.connection.readyState===this.connection.CONNECTING||this.reconnecting)this.requestQueue.set(r,n);else{if(this.connection.readyState!==this.connection.OPEN)return this.requestQueue.delete(r),this.emit(this.ERROR,i.ConnectionNotOpenError()),void n.callback(i.ConnectionNotOpenError());this.responseQueue.set(r,n),this.requestQueue.delete(r);try{this.connection.send(JSON.stringify(n.payload))}catch(c){n.callback(c),a.responseQueue.delete(r)}}},f.prototype.reset=function(){this.responseQueue.clear(),this.requestQueue.clear(),this.removeAllListeners(),this._removeSocketListeners(),this._addSocketListeners()},f.prototype.disconnect=function(e,t){this._removeSocketListeners(),this.connection.close(e||1e3,t)},f.prototype.supportsSubscriptions=function(){return!0},f.prototype.reconnect=function(){var e=this;this.reconnecting=!0,this.responseQueue.size>0&&this.responseQueue.forEach((function(t,a){t.callback(i.PendingRequestsOnReconnectingError()),e.responseQueue.delete(a)})),!this.reconnectOptions.maxAttempts||this.reconnectAttempts0&&this.requestQueue.forEach((function(t,a){t.callback(i.MaxAttemptsReachedOnReconnectingError()),e.requestQueue.delete(a)})))},e.exports=f},96266:function(e,t,a){"use strict";a(21703);var r=Object.prototype.hasOwnProperty,n="~";function i(){}function c(e,t,a){this.fn=e,this.context=t,this.once=a||!1}function f(e,t,a,r,i){if("function"!==typeof a)throw new TypeError("The listener must be a function");var f=new c(a,r||e,i),d=n?n+t:t;return e._events[d]?e._events[d].fn?e._events[d]=[e._events[d],f]:e._events[d].push(f):(e._events[d]=f,e._eventsCount++),e}function d(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,t,a=[];if(0===this._eventsCount)return a;for(t in e=this._events)r.call(e,t)&&a.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=n?n+e:e,a=this._events[t];if(!a)return[];if(a.fn)return[a.fn];for(var r=0,i=a.length,c=new Array(i);r=0&&(r=t.type.substring(n));var i=s(e,t.components);Array.isArray(i)&&e?a.push("tuple("+i.join(",")+")"+r):e?a.push("("+i+")"):a.push("("+i.join(",")+")"+r)}else a.push(t.type)})),a},b=function(e){return"0x"+c(e).toString("hex")},u=function(e){if(!n.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a7?a+=e[r].toUpperCase():a+=e[r];return a},g=function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;{let a=new f(e),r=new f(t);return a.lt(r)?-1:a.eq(r)?0:1}}return 0};e.exports={_fireError:d,_jsonInterfaceMethodToString:o,_flattenTypes:s,randomHex:b,BN:n.BN,isBN:n.isBN,isBigNumber:n.isBigNumber,isHex:n.isHex,isHexStrict:n.isHexStrict,sha3:n.sha3,sha3Raw:n.sha3Raw,keccak256:n.sha3,soliditySha3:i.soliditySha3,soliditySha3Raw:i.soliditySha3Raw,encodePacked:i.encodePacked,isAddress:n.isAddress,checkAddressChecksum:n.checkAddressChecksum,toChecksumAddress:m,toHex:n.toHex,toBN:n.toBN,bytesToHex:n.bytesToHex,hexToBytes:n.hexToBytes,hexToNumberString:n.hexToNumberString,hexToNumber:n.hexToNumber,toDecimal:n.hexToNumber,numberToHex:n.numberToHex,fromDecimal:n.numberToHex,hexToUtf8:n.hexToUtf8,hexToString:n.hexToUtf8,toUtf8:n.hexToUtf8,stripHexPrefix:n.stripHexPrefix,utf8ToHex:n.utf8ToHex,stringToHex:n.utf8ToHex,fromUtf8:n.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:h,fromAscii:h,unitMap:r.unitMap,toWei:x,fromWei:p,padLeft:n.leftPad,leftPad:n.leftPad,padRight:n.rightPad,rightPad:n.rightPad,toTwosComplement:n.toTwosComplement,isBloom:n.isBloom,isUserEthereumAddressInBloom:n.isUserEthereumAddressInBloom,isContractAddressInBloom:n.isContractAddressInBloom,isTopic:n.isTopic,isTopicInBloom:n.isTopicInBloom,isInBloom:n.isInBloom,compareBlockNumbers:g,toNumber:n.toNumber}},49884:function(e,t,a){a(21703);var r=a(36854),n=a(87785),i=function(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e},c=function(e){var t=/^\D+(\d+).*$/.exec(e);return t?parseInt(t[1],10):null},f=function(e){var t=/^\D+\d*\[(\d+)\]$/.exec(e);return t?parseInt(t[1],10):null},d=function(e){var t=typeof e;if("string"===t)return n.isHexStrict(e)?new r(e.replace(/0x/i,""),16):new r(e,10);if("number"===t)return new r(e);if(n.isBigNumber(e))return new r(e.toString(10));if(n.isBN(e))return e;throw new Error(e+" is not a number")},o=function(e,t,a){var f,o;if(e=i(e),"bytes"===e){if(t.replace(/^0x/i,"").length%2!==0)throw new Error("Invalid bytes characters "+t.length);return t}if("string"===e)return n.utf8ToHex(t);if("bool"===e)return t?"01":"00";if(e.startsWith("address")){if(f=a?64:40,!n.isAddress(t))throw new Error(t+" is not a valid address, or the checksum is invalid.");return n.leftPad(t.toLowerCase(),f)}if(f=c(e),e.startsWith("bytes")){if(!f)throw new Error("bytes[] not yet supported in solidity");if(a&&(f=32),f<1||f>32||f256)throw new Error("Invalid uint"+f+" size");if(o=d(t),o.bitLength()>f)throw new Error("Supplied uint exceeds width: "+f+" vs "+o.bitLength());if(o.lt(new r(0)))throw new Error("Supplied uint "+o.toString()+" is negative");return f?n.leftPad(o.toString("hex"),f/8*2):o}if(e.startsWith("int")){if(f%8||f<8||f>256)throw new Error("Invalid int"+f+" size");if(o=d(t),o.bitLength()>f)throw new Error("Supplied int exceeds width: "+f+" vs "+o.bitLength());return o.lt(new r(0))?o.toTwos(f).toString("hex"):f?n.leftPad(o.toString("hex"),f/8*2):o}throw new Error("Unsupported or invalid type: "+e)},s=function(e){if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");var t,a,i,c="";if(e&&"object"===typeof e&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(t=e.hasOwnProperty("t")?e.t:e.type,c=e.hasOwnProperty("v")?e.v:e.value):(t=n.toHex(e,!0),c=n.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!==typeof c||/^(-)?0x/i.test(c)||(c=new r(c)),Array.isArray(c)){if(i=f(t),i&&c.length!==i)throw new Error(t+" is not matching the given array "+JSON.stringify(c));i=c.length}return Array.isArray(c)?(a=c.map((function(e){return o(t,e,i).toString("hex").replace("0x","")})),a.join("")):(a=o(t,c,i),a.toString("hex").replace("0x",""))},b=function(){var e=Array.prototype.slice.call(arguments),t=e.map(s);return n.sha3("0x"+t.join(""))},u=function(){return n.sha3Raw("0x"+Array.prototype.slice.call(arguments).map(s).join(""))},h=function(){var e=Array.prototype.slice.call(arguments),t=e.map(s);return"0x"+t.join("").toLowerCase()};e.exports={soliditySha3:b,soliditySha3Raw:u,encodePacked:h}},87785:function(e,t,a){var r=a(15361)["Buffer"];a(21703);var n=a(36854),i=a(70594),c=a(62059),f=a(48859),d=a(16101),o=function(e){return n.isBN(e)},s=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},b=function(e){try{return i.apply(null,arguments)}catch(t){throw new Error(t+' Given value: "'+e+'"')}},u=function(e){return"0x"+b(e).toTwos(256).toString(16,64)},h=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(e)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(e))||l(e))},l=function(e){e=e.replace(/^0x/i,"");for(var t=N(e.toLowerCase()).replace(/^0x/i,""),a=0;a<40;a++)if(parseInt(t[a],16)>7&&e[a].toUpperCase()!==e[a]||parseInt(t[a],16)<=7&&e[a].toLowerCase()!==e[a])return!1;return!0},p=function(e,t,a){var r=/^0x/i.test(e)||"number"===typeof e;e=e.toString(16).replace(/^0x/i,"");var n=t-e.length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(n).join(a||"0")+e},x=function(e,t,a){var r=/^0x/i.test(e)||"number"===typeof e;e=e.toString(16).replace(/^0x/i,"");var n=t-e.length+1>=0?t-e.length+1:0;return(r?"0x":"")+e+new Array(n).join(a||"0")},m=function(e){e=c.encode(e);var t="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(var a=0;a>>4).toString(16)),t.push((15&e[a]).toString(16));return"0x"+t.join("")},_=function(e){if(e=e.toString(16),!A(e))throw new Error('Given value "'+e+'" is not a valid hex string.');e=e.replace(/^0x/i,"");for(var t=[],a=0;a=65&&a<=70?a-55:a>=97&&a<=102?a-87:a-48&15}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,r){for(var n=0,i=Math.min(e.length,a),c=t;c=49?f-49+10:f>=17?f-17+10:f}return n}i.isBN=function(e){return e instanceof i||null!==e&&"object"===typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var s=["","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"],b=[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],u=[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];function h(e){for(var t=new Array(e.bitLength()),a=0;a>>n}return t}function l(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a.strip()}i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?s[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=b[e],h=u[e];a="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),a=l.isZero()?p+a:s[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r("undefined"!==typeof c),this.toArrayLike(c,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,a){var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0"),this.strip();var c,f,d="le"===t,o=new e(i),s=this.clone();if(d){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),o[f]=c;for(;f=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function x(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a.strip()}function m(e,t,a){var r=new g;return r.mulp(e,t,a)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?p(this,e,t):r<63?l(this,e,t):r<1024?x(this,e,t):m(this,e,t),a},g.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},g.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[a]=67108863&i}return 0!==t&&(this.words[a]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=h(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this.strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d.strip(),r.strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,a=0,n=this.length-1;n>=0;n--)a=(t*a+(0|this.words[n]))%e;return a},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,a=this.length-1;a>=0;a--){var n=(0|this.words[a])+67108864*t;this.words[a]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this.strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}y.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},n(w,y),w.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new M;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return v[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},A.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},S.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},7907:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703);var n=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var c=i(a(89455)),f=a(10211),d=a(52010),o=a(60660),s=a(54703),b=a(54796),u=a(66117),h=a(91914),l=a(49003),p=function(){function e(e,t,a,r){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===a&&(a=s.KECCAK256_RLP),void 0===r&&(r=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=a,this.codeHash=r,this._validate()}return e.fromAccountData=function(t){var a=t.nonce,r=t.balance,n=t.stateRoot,i=t.codeHash;return new e(a?new f.BN((0,b.toBuffer)(a)):void 0,r?new f.BN((0,b.toBuffer)(r)):void 0,n?(0,b.toBuffer)(n):void 0,i?(0,b.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=f.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var a=n(t,4),r=a[0],i=a[1],c=a[2],d=a[3];return new e(new f.BN(r),new f.BN(i),c,d)},e.prototype._validate=function(){if(this.nonce.lt(new f.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new f.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,l.bnToUnpaddedBuffer)(this.nonce),(0,l.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return f.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(s.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(s.KECCAK256_NULL)},e}();t.Account=p;var x=function(e){try{(0,h.assertIsString)(e)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.isValidAddress=x;var m=function(e,t){(0,h.assertIsHexString)(e);var a=(0,o.stripHexPrefix)(e).toLowerCase(),r="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);r=n.toString()+"0x"}for(var i=(0,u.keccakFromString)(r+a).toString("hex"),c="0x",f=0;f=8?c+=a[f].toUpperCase():c+=a[f];return c};t.toChecksumAddress=m;var g=function(e,a){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,a)===e};t.isValidChecksumAddress=g;var v=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var a=new f.BN(t);return a.isZero()?(0,u.rlphash)([e,null]).slice(-20):(0,u.rlphash)([e,r.from(a.toArray())]).slice(-20)};t.generateAddress=v;var y=function(e,t,a){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(a),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,u.keccak256)(r.concat([r.from("ff","hex"),e,t,(0,u.keccak256)(a)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,d.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,d.publicKeyVerify)(r.concat([r.from([4]),e])):!!t&&(0,d.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,u.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),r.from((0,d.publicKeyCreate)(e,!1)).slice(1)};t.privateToPublic=k;var A=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.privateToAddress=A;var S=function(e){return(0,h.assertIsBuffer)(e),64!==e.length&&(e=r.from((0,d.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,b.zeros)(e);return(0,b.bufferToHex)(t)};t.zeroAddress=E;var B=function(e){try{(0,h.assertIsString)(e)}catch(r){return!1}var a=(0,t.zeroAddress)();return a===e};t.isZeroAddress=B},69194:function(e,t,a){"use strict";var r=a(15361)["Buffer"],n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Address=void 0;var i=n(a(89455)),c=a(10211),f=a(54796),d=a(7907),o=function(){function e(e){(0,i.default)(20===e.length,"Invalid address length"),this.buf=e}return e.zero=function(){return new e((0,f.zeros)(20))},e.fromString=function(t){return(0,i.default)((0,d.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(r.isBuffer(t),"Public key should be Buffer");var a=(0,d.pubToAddress)(t);return new e(a)},e.fromPrivateKey=function(t){(0,i.default)(r.isBuffer(t),"Private key should be Buffer");var a=(0,d.privateToAddress)(t);return new e(a)},e.generate=function(t,a){return(0,i.default)(c.BN.isBN(a)),new e((0,d.generateAddress)(t.buf,a.toArrayLike(r)))},e.generate2=function(t,a,n){return(0,i.default)(r.isBuffer(a)),(0,i.default)(r.isBuffer(n)),new e((0,d.generateAddress2)(t.buf,a,n))},e.prototype.equals=function(e){return this.buf.equals(e.buf)},e.prototype.isZero=function(){return this.equals(e.zero())},e.prototype.isPrecompileOrSystemAddress=function(){var e=new c.BN(this.buf),t=new c.BN(0),a=new c.BN("ffff","hex");return e.gte(t)&&e.lte(a)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return r.from(this.buf)},e}();t.Address=o},54796:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),a(48675),a(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,a=t&&e[t],r=0;if(a)return a.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var a="function"===typeof Symbol&&e[Symbol.iterator];if(!a)return e;var r,n,i=a.call(e),c=[];try{while((void 0===t||t-- >0)&&!(r=i.next()).done)c.push(r.value)}catch(f){n={error:f}}finally{try{r&&!r.done&&(a=i["return"])&&a.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var c=a(10211),f=a(60660),d=a(91914),o=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToHex=o;var s=function(e){var a=(0,t.intToHex)(e);return r.from((0,f.padToEven)(a.slice(2)),"hex")};t.intToBuffer=s;var b=function(e){return r.allocUnsafe(e).fill(0)};t.zeros=b;var u=function(e,a,r){var n=(0,t.zeros)(a);return r?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,d.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,d.assertIsArray)(e),p(e)};t.unpadArray=m;var g=function(e){return(0,d.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=g;var v=function(e){if(null===e||void 0===e)return r.allocUnsafe(0);if(r.isBuffer(e))return r.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return r.from(e);if("string"===typeof e){if(!(0,f.isHexString)(e))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(e));return r.from((0,f.padToEven)((0,f.stripHexPrefix)(e)),"hex")}if("number"===typeof e)return(0,t.intToBuffer)(e);if(c.BN.isBN(e)){if(e.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(e));return e.toArrayLike(r)}if(e.toArray)return r.from(e.toArray());if(e.toBuffer)return r.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=v;var y=function(e){return new c.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToInt=y;var w=function(e){return e=(0,t.toBuffer)(e),"0x"+e.toString("hex")};t.bufferToHex=w;var M=function(e){return new c.BN(e).fromTwos(256)};t.fromSigned=M;var _=function(e){return r.from(e.toTwos(256).toArray())};t.toUnsigned=_;var k=function(e){return"string"!==typeof e||(0,f.isHexPrefixed)(e)?e:"0x"+e};t.addHexPrefix=k;var A=function(e){var t=/^(00)+|(00)+$/g;if(e=(0,f.stripHexPrefix)(e),e.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");var a=r.from(e.replace(t,""),"hex");return a.toString("utf8")};t.toUtf8=A;var S=function(e){if(r.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var a=[],n=0;n0&&0===o[0])throw new Error("".concat(d," cannot have leading zeroes, received: ").concat(o.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(a=r.return)&&a.call(r)}finally{if(t)throw t.error}}};function B(e){return Array.isArray(e)?e.map((function(e){return B(e)})):r.from(e)}function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=B,t.bufArrToArr=T},54703:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var r=a(15361),n=a(10211);t.MAX_UINT64=new n.BN("ffffffffffffffff",16),t.MAX_INTEGER=new n.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new n.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=r.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=r.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=r.Buffer.from(t.KECCAK256_RLP_S,"hex")},10211:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var f=c(a(59149));t.BN=f.default;var d=i(a(98217));t.rlp=d},66117:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.rlphash=t.ripemd160FromArray=t.ripemd160FromString=t.ripemd160=t.sha256FromArray=t.sha256FromString=t.sha256=t.keccakFromArray=t.keccakFromHexString=t.keccakFromString=t.keccak256=t.keccak=void 0;var n=a(92802),i=a(65443),c=a(10211),f=a(54796),d=a(91914),o=function(e,t){switch(void 0===t&&(t=256),(0,d.assertIsBuffer)(e),t){case 224:return(0,n.keccak224)(e);case 256:return(0,n.keccak256)(e);case 384:return(0,n.keccak384)(e);case 512:return(0,n.keccak512)(e);default:throw new Error("Invald algorithm: keccak".concat(t))}};t.keccak=o;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var b=function(e,a){void 0===a&&(a=256),(0,d.assertIsString)(e);var n=r.from(e,"utf8");return(0,t.keccak)(n,a)};t.keccakFromString=b;var u=function(e,a){return void 0===a&&(a=256),(0,d.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromHexString=u;var h=function(e,a){return void 0===a&&(a=256),(0,d.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),a)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,d.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,d.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,d.assertIsArray)(e),l(e)};t.sha256FromArray=m;var g=function(e,t){e=(0,f.toBuffer)(e);var a=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(a,32):a},v=function(e,t){return(0,d.assertIsBuffer)(e),g(e,t)};t.ripemd160=v;var y=function(e,t){return(0,d.assertIsString)(e),g(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,d.assertIsArray)(e),g(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},91914:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=a(60660),i=function(e){if(!(0,n.isHexString)(e)){var t="This method only supports 0x-prefixed hex strings but input was: ".concat(e);throw new Error(t)}};t.assertIsHexString=i;var c=function(e){if(!r.isBuffer(e)){var t="This method only supports Buffer but input was: ".concat(e);throw new Error(t)}};t.assertIsBuffer=c;var f=function(e){if(!Array.isArray(e)){var t="This method only supports number arrays but input was: ".concat(e);throw new Error(t)}};t.assertIsArray=f;var d=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=d},48859:function(e,t,a){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,a,r){void 0===r&&(r=a),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[a]}})}:function(e,t,a,r){void 0===r&&(r=a),e[r]=t[a]}),n=this&&this.__exportStar||function(e,t){for(var a in e)"default"===a||Object.prototype.hasOwnProperty.call(t,a)||r(t,e,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,n(a(54703),t),n(a(7907),t),n(a(69194),t),n(a(66117),t),n(a(81069),t),n(a(54796),t),n(a(64581),t),n(a(10211),t),n(a(49003),t);var i=a(60660);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},60660:function(e,t,a){"use strict";var r=a(15361)["Buffer"];function n(e){if("string"!==typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(typeof e));return"0"===e[0]&&"x"===e[1]}a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;var i=function(e){if("string"!==typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(typeof e));return n(e)?e.slice(2):e};function c(e){var t=e;if("string"!==typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(typeof t));return t.length%2&&(t="0".concat(t)),t}function f(e){if("string"!==typeof e)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(typeof e));return r.byteLength(e,"utf8")}function d(e,t,a){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(typeof e,"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(typeof t,"'"));return t[a?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function o(e){var t="",a=0,r=e.length;for("0x"===e.substring(0,2)&&(a=2);a=n.length,"The field ".concat(t.name," must not have more ").concat(t.length," bytes"))):t.allowZero&&0===n.length||!t.length||(0,i.default)(t.length===n.length,"The field ".concat(t.name," must have byte length of ").concat(t.length)),e.raw[a]=n}e._fields.push(t.name),Object.defineProperty(e,t.name,{enumerable:!0,configurable:!0,get:n,set:c}),t.default&&(e[t.name]=t.default),t.alias&&Object.defineProperty(e,t.alias,{enumerable:!1,configurable:!0,set:c,get:n})})),a)if("string"===typeof a&&(a=r.from((0,c.stripHexPrefix)(a),"hex")),r.isBuffer(a)&&(a=f.rlp.decode(a)),Array.isArray(a)){if(a.length>e._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(t,a){e[e._fields[a]]=(0,d.toBuffer)(t)}))}else{if("object"!==typeof a)throw new Error("invalid data");var n=Object.keys(a);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=a[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=a[t.alias])}))}};t.defineProperties=o},81069:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toCompactSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=a(52010),i=a(10211),c=a(54796),f=a(66117),d=a(91914),o=a(49003);function s(e,t,a){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,d=r.from(c.slice(0,32)),s=r.from(c.slice(32,64));if(!a||"number"===typeof a){if(a&&!Number.isSafeInteger(a))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var b=a?f+(2*a+35):f+27;return{r:d,s:s,v:b}}var u=(0,o.toType)(a,o.TypeOutput.BN),h=u.muln(2).addn(35).addn(f).toArrayLike(r);return{r:d,s:s,v:h}}function b(e,t){var a=(0,o.toType)(e,o.TypeOutput.BN);if(!t)return a.subn(27);var r=(0,o.toType)(t,o.TypeOutput.BN);return a.sub(r.muln(2).addn(35))}function u(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,a,i,f){var d=r.concat([(0,c.setLengthLeft)(a,32),(0,c.setLengthLeft)(i,32)],64),o=b(t,f);if(!u(o))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(d,o.toNumber(),e);return r.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(a,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,a,n){var i=b(e,n);if(!u(i))throw new Error("Invalid signature v value");var f=(0,o.toType)(e,o.TypeOutput.Number),d=a;return(f>28&&f%2===1||1===f||28===f)&&(d=r.from(a),d[0]|=128),(0,c.bufferToHex)(r.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(d,32)]))};t.toCompactSig=p;var x=function(e){var t,a,r,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),a=n.slice(32,64),r=(0,c.bufferToInt)(n.slice(32,33))>>7,a[0]&=127}return r<27&&(r+=27),{v:r,r:t,s:a}};t.fromRpcSig=x;var m=function(e,t,a,r,n){void 0===r&&(r=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==a.length)return!1;if(!u(b(e,n)))return!1;var d=new i.BN(t),o=new i.BN(a);return!(d.isZero()||d.gt(f)||o.isZero()||o.gt(f))&&(!r||1!==o.cmp(c))};t.isValidSignature=m;var g=function(e){(0,d.assertIsBuffer)(e);var t=r.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(r.concat([t,e]))};t.hashPersonalMessage=g},49003:function(e,t,a){"use strict";var r=a(15361)["Buffer"];a(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=a(10211),c=a(60660),f=a(54796);function d(e){return"0x".concat(e.toString(16))}function o(e){return(0,f.unpadBuffer)(e.toArrayLike(r))}function s(e){return o(e)}function b(e,t){if(null===e)return null;if(void 0!==e){if("string"===typeof e&&!(0,c.isHexString)(e))throw new Error("A string must be provided with a 0x-prefix, given: ".concat(e));if("number"===typeof e&&!Number.isSafeInteger(e))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var a=(0,f.toBuffer)(e);if(t===n.Buffer)return a;if(t===n.BN)return new i.BN(a);if(t===n.Number){var r=new i.BN(a),d=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(r.gt(d))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return r.toNumber()}return"0x".concat(a.toString("hex"))}}t.bnToHex=d,t.bnToUnpaddedBuffer=o,t.bnToRlp=s,function(e){e[e["Number"]=0]="Number",e[e["BN"]=1]="BN",e[e["Buffer"]=2]="Buffer",e[e["PrefixedHexString"]=3]="PrefixedHexString"}(n=t.TypeOutput||(t.TypeOutput={})),t.toType=b},59149:function(e,t,a){e=a.nmd(e),a(21703),function(e,t){"use strict";function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}function i(e,t,a){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(a=t,t=10),this._init(e||0,t||10,a||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:a(33557).Buffer}catch(P){}function f(e,t){var a=e.charCodeAt(t);return a>=48&&a<=57?a-48:a>=65&&a<=70?a-55:a>=97&&a<=102?a-87:void r(!1,"Invalid character in "+e)}function d(e,t,a){var r=f(e,a);return a-1>=t&&(r|=f(e,a-1)<<4),r}function o(e,t,a,n){for(var i=0,c=0,f=Math.min(e.length,a),d=t;d=49?o-49+10:o>=17?o-17+10:o,r(o>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,a){if("number"===typeof e)return this._initNumber(e,t,a);if("object"===typeof e)return this._initArray(e,t,a);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36),e=e.toString().replace(/\s+/g,"");var n=0;"-"===e[0]&&(n++,this.negative=1),n=0;n-=3)c=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=c<>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);else if("le"===a)for(n=0,i=0;n>>26-f&67108863,f+=24,f>=26&&(f-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,a){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=2)n=d(e,t,r)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(r=f%2===0?t+1:t;r=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,a){this.words=[0],this.length=1;for(var r=0,n=1;n<=67108863;n*=t)r++;r--,n=n/t|0;for(var i=e.length-a,c=i%r,f=Math.min(i,i-c)+a,d=0,s=a;s1&&0===this.words[this.length-1])this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(P){i.prototype.inspect=b}else i.prototype.inspect=b;function b(){return(this.red?""}var u=["","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"],h=[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],l=[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];i.prototype.toString=function(e,t){var a;if(e=e||10,t=0|t||1,16===e||"hex"===e){a="";for(var n=0,i=0,c=0;c>>24-n&16777215,a=0!==i||c!==this.length-1?u[6-d.length]+d+a:d+a,n+=2,n>=26&&(n-=26,c--)}0!==i&&(a=i.toString(16)+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}if(e===(0|e)&&e>=2&&e<=36){var o=h[e],s=l[e];a="";var b=this.clone();b.negative=0;while(!b.isZero()){var p=b.modrn(s).toString(e);b=b.idivn(s),a=b.isZero()?p+a:u[o-p.length]+p+a}this.isZero()&&(a="0"+a);while(a.length%t!==0)a="0"+a;return 0!==this.negative&&(a="-"+a),a}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},c&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var p=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function x(e){for(var t=new Array(e.bitLength()),a=0;a>>n&1}return t}function m(e,t,a){a.negative=t.negative^e.negative;var r=e.length+t.length|0;a.length=r,r=r-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,d=c/67108864|0;a.words[0]=f;for(var o=1;o>>26,b=67108863&d,u=Math.min(o,t.length-1),h=Math.max(0,o-e.length+1);h<=u;h++){var l=o-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+b,s+=c/67108864|0,b=67108863&c}a.words[o]=0|b,d=0|s}return 0!==d?a.words[o]=0|d:a.length--,a._strip()}i.prototype.toArrayLike=function(e,t,a){this._strip();var n=this.byteLength(),i=a||Math.max(1,n);r(n<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var c=p(e,i),f="le"===t?"LE":"BE";return this["_toArrayLike"+f](c,n),c},i.prototype._toArrayLikeLE=function(e,t){for(var a=0,r=0,n=0,i=0;n>8&255),a>16&255),6===i?(a>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a=0&&(e[a--]=c>>8&255),a>=0&&(e[a--]=c>>16&255),6===i?(a>=0&&(e[a--]=c>>24&255),r=0,i=0):(r=c>>>24,i+=2)}if(a>=0){e[a--]=r;while(a>=0)e[a--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,a=0;return t>=4096&&(a+=13,t>>>=13),t>=64&&(a+=7,t>>>=7),t>=8&&(a+=4,t>>>=4),t>=2&&(a+=2,t>>>=2),a+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,a=0;return 0===(8191&t)&&(a+=13,t>>>=13),0===(127&t)&&(a+=7,t>>>=7),0===(15&t)&&(a+=4,t>>>=4),0===(3&t)&&(a+=2,t>>>=2),0===(1&t)&&a++,a},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var a=0;ae.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,a;this.length>e.length?(t=this,a=e):(t=e,a=this);for(var r=0;re.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),a=e%26;this._expand(t),a>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-a),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"===typeof e&&e>=0);var a=e/26|0,n=e%26;return this._expand(a+1),this.words[a]=t?this.words[a]|1<e.length?(a=this,r=e):(a=e,r=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=a.length,0!==n)this.words[this.length]=n,this.length++;else if(a!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var a,r,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(a=this,r=e):(a=e,r=this);for(var i=0,c=0;c>26,this.words[c]=67108863&t;for(;0!==i&&c>26,this.words[c]=67108863&t;if(0===i&&c>>13,h=0|c[1],l=8191&h,p=h>>>13,x=0|c[2],m=8191&x,g=x>>>13,v=0|c[3],y=8191&v,w=v>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,B=0|c[6],T=8191&B,P=B>>>13,I=0|c[7],C=8191&I,R=I>>>13,O=0|c[8],N=8191&O,U=O>>>13,L=0|c[9],j=8191&L,q=L>>>13,F=0|f[0],D=8191&F,H=F>>>13,z=0|f[1],K=8191&z,Z=z>>>13,G=0|f[2],V=8191&G,W=G>>>13,J=0|f[3],X=8191&J,Y=J>>>13,Q=0|f[4],$=8191&Q,ee=Q>>>13,te=0|f[5],ae=8191&te,re=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],de=8191&fe,oe=fe>>>13,se=0|f[8],be=8191&se,ue=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;a.negative=e.negative^t.negative,a.length=19,r=Math.imul(b,D),n=Math.imul(b,H),n=n+Math.imul(u,D)|0,i=Math.imul(u,H);var xe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(l,D),n=Math.imul(l,H),n=n+Math.imul(p,D)|0,i=Math.imul(p,H),r=r+Math.imul(b,K)|0,n=n+Math.imul(b,Z)|0,n=n+Math.imul(u,K)|0,i=i+Math.imul(u,Z)|0;var me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(m,D),n=Math.imul(m,H),n=n+Math.imul(g,D)|0,i=Math.imul(g,H),r=r+Math.imul(l,K)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,Z)|0,r=r+Math.imul(b,V)|0,n=n+Math.imul(b,W)|0,n=n+Math.imul(u,V)|0,i=i+Math.imul(u,W)|0;var ge=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(y,D),n=Math.imul(y,H),n=n+Math.imul(w,D)|0,i=Math.imul(w,H),r=r+Math.imul(m,K)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(g,K)|0,i=i+Math.imul(g,Z)|0,r=r+Math.imul(l,V)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,W)|0,r=r+Math.imul(b,X)|0,n=n+Math.imul(b,Y)|0,n=n+Math.imul(u,X)|0,i=i+Math.imul(u,Y)|0;var ve=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(_,D),n=Math.imul(_,H),n=n+Math.imul(k,D)|0,i=Math.imul(k,H),r=r+Math.imul(y,K)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,Z)|0,r=r+Math.imul(m,V)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(g,V)|0,i=i+Math.imul(g,W)|0,r=r+Math.imul(l,X)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0,r=r+Math.imul(b,$)|0,n=n+Math.imul(b,ee)|0,n=n+Math.imul(u,$)|0,i=i+Math.imul(u,ee)|0;var ye=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(S,D),n=Math.imul(S,H),n=n+Math.imul(E,D)|0,i=Math.imul(E,H),r=r+Math.imul(_,K)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,Z)|0,r=r+Math.imul(y,V)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,W)|0,r=r+Math.imul(m,X)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(g,X)|0,i=i+Math.imul(g,Y)|0,r=r+Math.imul(l,$)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,$)|0,i=i+Math.imul(p,ee)|0,r=r+Math.imul(b,ae)|0,n=n+Math.imul(b,re)|0,n=n+Math.imul(u,ae)|0,i=i+Math.imul(u,re)|0;var we=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(T,D),n=Math.imul(T,H),n=n+Math.imul(P,D)|0,i=Math.imul(P,H),r=r+Math.imul(S,K)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,Z)|0,r=r+Math.imul(_,V)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,W)|0,r=r+Math.imul(y,X)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,r=r+Math.imul(m,$)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(g,$)|0,i=i+Math.imul(g,ee)|0,r=r+Math.imul(l,ae)|0,n=n+Math.imul(l,re)|0,n=n+Math.imul(p,ae)|0,i=i+Math.imul(p,re)|0,r=r+Math.imul(b,ie)|0,n=n+Math.imul(b,ce)|0,n=n+Math.imul(u,ie)|0,i=i+Math.imul(u,ce)|0;var Me=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(C,D),n=Math.imul(C,H),n=n+Math.imul(R,D)|0,i=Math.imul(R,H),r=r+Math.imul(T,K)|0,n=n+Math.imul(T,Z)|0,n=n+Math.imul(P,K)|0,i=i+Math.imul(P,Z)|0,r=r+Math.imul(S,V)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(_,X)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,r=r+Math.imul(y,$)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,$)|0,i=i+Math.imul(w,ee)|0,r=r+Math.imul(m,ae)|0,n=n+Math.imul(m,re)|0,n=n+Math.imul(g,ae)|0,i=i+Math.imul(g,re)|0,r=r+Math.imul(l,ie)|0,n=n+Math.imul(l,ce)|0,n=n+Math.imul(p,ie)|0,i=i+Math.imul(p,ce)|0,r=r+Math.imul(b,de)|0,n=n+Math.imul(b,oe)|0,n=n+Math.imul(u,de)|0,i=i+Math.imul(u,oe)|0;var _e=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(N,D),n=Math.imul(N,H),n=n+Math.imul(U,D)|0,i=Math.imul(U,H),r=r+Math.imul(C,K)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(R,K)|0,i=i+Math.imul(R,Z)|0,r=r+Math.imul(T,V)|0,n=n+Math.imul(T,W)|0,n=n+Math.imul(P,V)|0,i=i+Math.imul(P,W)|0,r=r+Math.imul(S,X)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,r=r+Math.imul(_,$)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,$)|0,i=i+Math.imul(k,ee)|0,r=r+Math.imul(y,ae)|0,n=n+Math.imul(y,re)|0,n=n+Math.imul(w,ae)|0,i=i+Math.imul(w,re)|0,r=r+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(g,ie)|0,i=i+Math.imul(g,ce)|0,r=r+Math.imul(l,de)|0,n=n+Math.imul(l,oe)|0,n=n+Math.imul(p,de)|0,i=i+Math.imul(p,oe)|0,r=r+Math.imul(b,be)|0,n=n+Math.imul(b,ue)|0,n=n+Math.imul(u,be)|0,i=i+Math.imul(u,ue)|0;var ke=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(j,D),n=Math.imul(j,H),n=n+Math.imul(q,D)|0,i=Math.imul(q,H),r=r+Math.imul(N,K)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(U,K)|0,i=i+Math.imul(U,Z)|0,r=r+Math.imul(C,V)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(R,V)|0,i=i+Math.imul(R,W)|0,r=r+Math.imul(T,X)|0,n=n+Math.imul(T,Y)|0,n=n+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,r=r+Math.imul(S,$)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,$)|0,i=i+Math.imul(E,ee)|0,r=r+Math.imul(_,ae)|0,n=n+Math.imul(_,re)|0,n=n+Math.imul(k,ae)|0,i=i+Math.imul(k,re)|0,r=r+Math.imul(y,ie)|0,n=n+Math.imul(y,ce)|0,n=n+Math.imul(w,ie)|0,i=i+Math.imul(w,ce)|0,r=r+Math.imul(m,de)|0,n=n+Math.imul(m,oe)|0,n=n+Math.imul(g,de)|0,i=i+Math.imul(g,oe)|0,r=r+Math.imul(l,be)|0,n=n+Math.imul(l,ue)|0,n=n+Math.imul(p,be)|0,i=i+Math.imul(p,ue)|0,r=r+Math.imul(b,le)|0,n=n+Math.imul(b,pe)|0,n=n+Math.imul(u,le)|0,i=i+Math.imul(u,pe)|0;var Ae=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(j,K),n=Math.imul(j,Z),n=n+Math.imul(q,K)|0,i=Math.imul(q,Z),r=r+Math.imul(N,V)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(U,V)|0,i=i+Math.imul(U,W)|0,r=r+Math.imul(C,X)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,r=r+Math.imul(T,$)|0,n=n+Math.imul(T,ee)|0,n=n+Math.imul(P,$)|0,i=i+Math.imul(P,ee)|0,r=r+Math.imul(S,ae)|0,n=n+Math.imul(S,re)|0,n=n+Math.imul(E,ae)|0,i=i+Math.imul(E,re)|0,r=r+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,r=r+Math.imul(y,de)|0,n=n+Math.imul(y,oe)|0,n=n+Math.imul(w,de)|0,i=i+Math.imul(w,oe)|0,r=r+Math.imul(m,be)|0,n=n+Math.imul(m,ue)|0,n=n+Math.imul(g,be)|0,i=i+Math.imul(g,ue)|0,r=r+Math.imul(l,le)|0,n=n+Math.imul(l,pe)|0,n=n+Math.imul(p,le)|0,i=i+Math.imul(p,pe)|0;var Se=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(j,V),n=Math.imul(j,W),n=n+Math.imul(q,V)|0,i=Math.imul(q,W),r=r+Math.imul(N,X)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(U,X)|0,i=i+Math.imul(U,Y)|0,r=r+Math.imul(C,$)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,r=r+Math.imul(T,ae)|0,n=n+Math.imul(T,re)|0,n=n+Math.imul(P,ae)|0,i=i+Math.imul(P,re)|0,r=r+Math.imul(S,ie)|0,n=n+Math.imul(S,ce)|0,n=n+Math.imul(E,ie)|0,i=i+Math.imul(E,ce)|0,r=r+Math.imul(_,de)|0,n=n+Math.imul(_,oe)|0,n=n+Math.imul(k,de)|0,i=i+Math.imul(k,oe)|0,r=r+Math.imul(y,be)|0,n=n+Math.imul(y,ue)|0,n=n+Math.imul(w,be)|0,i=i+Math.imul(w,ue)|0,r=r+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(g,le)|0,i=i+Math.imul(g,pe)|0;var Ee=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(j,X),n=Math.imul(j,Y),n=n+Math.imul(q,X)|0,i=Math.imul(q,Y),r=r+Math.imul(N,$)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(U,$)|0,i=i+Math.imul(U,ee)|0,r=r+Math.imul(C,ae)|0,n=n+Math.imul(C,re)|0,n=n+Math.imul(R,ae)|0,i=i+Math.imul(R,re)|0,r=r+Math.imul(T,ie)|0,n=n+Math.imul(T,ce)|0,n=n+Math.imul(P,ie)|0,i=i+Math.imul(P,ce)|0,r=r+Math.imul(S,de)|0,n=n+Math.imul(S,oe)|0,n=n+Math.imul(E,de)|0,i=i+Math.imul(E,oe)|0,r=r+Math.imul(_,be)|0,n=n+Math.imul(_,ue)|0,n=n+Math.imul(k,be)|0,i=i+Math.imul(k,ue)|0,r=r+Math.imul(y,le)|0,n=n+Math.imul(y,pe)|0,n=n+Math.imul(w,le)|0,i=i+Math.imul(w,pe)|0;var Be=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,r=Math.imul(j,$),n=Math.imul(j,ee),n=n+Math.imul(q,$)|0,i=Math.imul(q,ee),r=r+Math.imul(N,ae)|0,n=n+Math.imul(N,re)|0,n=n+Math.imul(U,ae)|0,i=i+Math.imul(U,re)|0,r=r+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(R,ie)|0,i=i+Math.imul(R,ce)|0,r=r+Math.imul(T,de)|0,n=n+Math.imul(T,oe)|0,n=n+Math.imul(P,de)|0,i=i+Math.imul(P,oe)|0,r=r+Math.imul(S,be)|0,n=n+Math.imul(S,ue)|0,n=n+Math.imul(E,be)|0,i=i+Math.imul(E,ue)|0,r=r+Math.imul(_,le)|0,n=n+Math.imul(_,pe)|0,n=n+Math.imul(k,le)|0,i=i+Math.imul(k,pe)|0;var Te=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(j,ae),n=Math.imul(j,re),n=n+Math.imul(q,ae)|0,i=Math.imul(q,re),r=r+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(U,ie)|0,i=i+Math.imul(U,ce)|0,r=r+Math.imul(C,de)|0,n=n+Math.imul(C,oe)|0,n=n+Math.imul(R,de)|0,i=i+Math.imul(R,oe)|0,r=r+Math.imul(T,be)|0,n=n+Math.imul(T,ue)|0,n=n+Math.imul(P,be)|0,i=i+Math.imul(P,ue)|0,r=r+Math.imul(S,le)|0,n=n+Math.imul(S,pe)|0,n=n+Math.imul(E,le)|0,i=i+Math.imul(E,pe)|0;var Pe=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,r=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(q,ie)|0,i=Math.imul(q,ce),r=r+Math.imul(N,de)|0,n=n+Math.imul(N,oe)|0,n=n+Math.imul(U,de)|0,i=i+Math.imul(U,oe)|0,r=r+Math.imul(C,be)|0,n=n+Math.imul(C,ue)|0,n=n+Math.imul(R,be)|0,i=i+Math.imul(R,ue)|0,r=r+Math.imul(T,le)|0,n=n+Math.imul(T,pe)|0,n=n+Math.imul(P,le)|0,i=i+Math.imul(P,pe)|0;var Ie=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(j,de),n=Math.imul(j,oe),n=n+Math.imul(q,de)|0,i=Math.imul(q,oe),r=r+Math.imul(N,be)|0,n=n+Math.imul(N,ue)|0,n=n+Math.imul(U,be)|0,i=i+Math.imul(U,ue)|0,r=r+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(R,le)|0,i=i+Math.imul(R,pe)|0;var Ce=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(j,be),n=Math.imul(j,ue),n=n+Math.imul(q,be)|0,i=Math.imul(q,ue),r=r+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(U,le)|0,i=i+Math.imul(U,pe)|0;var Re=(o+r|0)+((8191&n)<<13)|0;o=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(q,le)|0,i=Math.imul(q,pe);var Oe=(o+r|0)+((8191&n)<<13)|0;return o=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,d[0]=xe,d[1]=me,d[2]=ge,d[3]=ve,d[4]=ye,d[5]=we,d[6]=Me,d[7]=_e,d[8]=ke,d[9]=Ae,d[10]=Se,d[11]=Ee,d[12]=Be,d[13]=Te,d[14]=Pe,d[15]=Ie,d[16]=Ce,d[17]=Re,d[18]=Oe,0!==o&&(d[19]=o,a.length++),a};function v(e,t,a){a.negative=t.negative^e.negative,a.length=e.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}a.words[i]=f,r=c,c=n}return 0!==r?a.words[i]=r:a.length--,a._strip()}function y(e,t,a){return v(e,t,a)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var a,r=this.length+e.length;return a=10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):y(this,e,t),a},w.prototype.makeRBT=function(e){for(var t=new Array(e),a=i.prototype._countBits(e)-1,r=0;r>=1;return r},w.prototype.permute=function(e,t,a,r,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,a[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,a+=i/67108864|0,a+=c>>>26,this.words[n]=67108863&c}return 0!==a&&(this.words[n]=a,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=x(e);if(0===t.length)return new i(1);for(var a=this,r=0;r=0);var t,a=e%26,n=(e-a)/26,i=67108863>>>26-a<<26-a;if(0!==a){var c=0;for(t=0;t>>26-a}c&&(this.words[t]=c,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,c=Math.min((e-i)/26,this.length),f=67108863^67108863>>>i<c)for(this.length-=c,o=0;o=0&&(0!==s||o>=n);o--){var b=0|this.words[o];this.words[o]=s<<26-i|b>>>i,s=b&f}return d&&0!==s&&(d.words[d.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,a){return r(0===this.negative),this.iushrn(e,t,a)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"===typeof e&&e>=0);var t=e%26,a=(e-t)/26,n=1<=0);var t=e%26,a=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=a)return this;if(0!==t&&a++,this.length=Math.min(a,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"===typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(d/67108864|0),this.words[n+a]=67108863&i}for(;n>26,this.words[n+a]=67108863&i;if(0===f)return this._strip();for(r(-1===f),f=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var a=this.length-e.length,r=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);a=26-f,0!==a&&(n=n.ushln(a),r.iushln(a),c=0|n.words[n.length-1]);var d,o=r.length-n.length;if("mod"!==t){d=new i(null),d.length=o+1,d.words=new Array(d.length);for(var s=0;s=0;u--){var h=67108864*(0|r.words[n.length+u])+(0|r.words[n.length+u-1]);h=Math.min(h/c|0,67108863),r._ishlnsubmul(n,h,u);while(0!==r.negative)h--,r.negative=0,r._ishlnsubmul(n,1,u),r.isZero()||(r.negative^=1);d&&(d.words[u]=h)}return d&&d._strip(),r._strip(),"div"!==t&&0!==a&&r.iushrn(a),{div:d||null,mod:r}},i.prototype.divmod=function(e,t,a){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(f=this.neg().divmod(e,t),"mod"!==t&&(n=f.div.neg()),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.iadd(e)),{div:n,mod:c}):0===this.negative&&0!==e.negative?(f=this.divmod(e.neg(),t),"mod"!==t&&(n=f.div.neg()),{div:n,mod:f.mod}):0!==(this.negative&e.negative)?(f=this.neg().divmod(e.neg(),t),"div"!==t&&(c=f.mod.neg(),a&&0!==c.negative&&c.isub(e)),{div:f.div,mod:c}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,c,f},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var a=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),n=e.andln(1),i=a.cmp(r);return i<0||1===n&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(a*n+(0|this.words[i]))%e;return t?-n:n},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var a=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*a;this.words[n]=i/e|0,a=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),d=new i(1),o=0;while(t.isEven()&&a.isEven())t.iushrn(1),a.iushrn(1),++o;var s=a.clone(),b=t.clone();while(!t.isZero()){for(var u=0,h=1;0===(t.words[0]&h)&&u<26;++u,h<<=1);if(u>0){t.iushrn(u);while(u-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(b)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(a.words[0]&p)&&l<26;++l,p<<=1);if(l>0){a.iushrn(l);while(l-- >0)(f.isOdd()||d.isOdd())&&(f.iadd(s),d.isub(b)),f.iushrn(1),d.iushrn(1)}t.cmp(a)>=0?(t.isub(a),n.isub(f),c.isub(d)):(a.isub(t),f.isub(n),d.isub(c))}return{a:f,b:d,gcd:a.iushln(o)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,a=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),d=a.clone();while(t.cmpn(1)>0&&a.cmpn(1)>0){for(var o=0,s=1;0===(t.words[0]&s)&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0)c.isOdd()&&c.iadd(d),c.iushrn(1)}for(var b=0,u=1;0===(a.words[0]&u)&&b<26;++b,u<<=1);if(b>0){a.iushrn(b);while(b-- >0)f.isOdd()&&f.iadd(d),f.iushrn(1)}t.cmp(a)>=0?(t.isub(a),c.isub(f)):(a.isub(t),f.isub(c))}return n=0===t.cmpn(1)?c:f,n.cmpn(0)<0&&n.iadd(e),n},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),a=e.clone();t.negative=0,a.negative=0;for(var r=0;t.isEven()&&a.isEven();r++)t.iushrn(1),a.iushrn(1);do{while(t.isEven())t.iushrn(1);while(a.isEven())a.iushrn(1);var n=t.cmp(a);if(n<0){var i=t;t=a,a=i}else if(0===n||0===a.cmpn(1))break;t.isub(a)}while(1);return a.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0===(1&this.words[0])},i.prototype.isOdd=function(){return 1===(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"===typeof e);var t=e%26,a=(e-t)/26,n=1<>>26,f&=67108863,this.words[c]=f}return 0!==i&&(this.words[c]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,a=e<0;if(0!==this.negative&&!a)return-1;if(0===this.negative&&a)return 1;if(this._strip(),this.length>1)t=1;else{a&&(e=-e),r(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;a--){var r=0|this.words[a],n=0|e.words[a];if(r!==n){rn&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new B(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var M={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function k(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function B(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){B.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}_.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,a=e;do{this.split(a,this.tmp),a=this.imulK(a),a=a.iadd(this.tmp),t=a.bitLength()}while(t>this.n);var r=t0?a.isub(this.p):void 0!==a.strip?a.strip():a._strip(),a},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},n(k,_),k.prototype.split=function(e,t){for(var a=4194303,r=Math.min(e.length,9),n=0;n>>22,i=c}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},k.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,a=0;a>>=26,e.words[a]=n,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(M[e])return M[e];var t;if("k256"===e)t=new k;else if("p224"===e)t=new A;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return M[e]=t,t},B.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},B.prototype._verify2=function(e,t){r(0===(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},B.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},B.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},B.prototype.add=function(e,t){this._verify2(e,t);var a=e.add(t);return a.cmp(this.m)>=0&&a.isub(this.m),a._forceRed(this)},B.prototype.iadd=function(e,t){this._verify2(e,t);var a=e.iadd(t);return a.cmp(this.m)>=0&&a.isub(this.m),a},B.prototype.sub=function(e,t){this._verify2(e,t);var a=e.sub(t);return a.cmpn(0)<0&&a.iadd(this.m),a._forceRed(this)},B.prototype.isub=function(e,t){this._verify2(e,t);var a=e.isub(t);return a.cmpn(0)<0&&a.iadd(this.m),a},B.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},B.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},B.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},B.prototype.isqr=function(e){return this.imul(e,e.clone())},B.prototype.sqr=function(e){return this.mul(e,e)},B.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2===1),3===t){var a=this.m.add(new i(1)).iushrn(2);return this.pow(e,a)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);r(!n.isZero());var f=new i(1).toRed(this),d=f.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,o).cmp(d))s.redIAdd(d);var b=this.pow(s,n),u=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=c;while(0!==h.cmp(f)){for(var p=h,x=0;0!==p.cmp(f);x++)p=p.redSqr();r(x=0;n--){for(var s=t.words[n],b=o-1;b>=0;b--){var u=s>>b&1;c!==r[0]&&(c=this.sqr(c)),0!==u||0!==f?(f<<=1,f|=u,d++,(d===a||0===n&&0===b)&&(c=this.mul(c,r[f]),d=0,f=0)):d=0}o=26}return c},B.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},B.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new T(e)},n(T,B),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var a=e.imul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),i=n;return n.cmp(this.m)>=0?i=n.isub(this.m):n.cmpn(0)<0&&(i=n.iadd(this.m)),i._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var a=e.mul(t),r=a.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=a.isub(r).iushrn(this.shift),c=n;return n.cmp(this.m)>=0?c=n.isub(this.m):n.cmpn(0)<0&&(c=n.iadd(this.m)),c._forceRed(this)},T.prototype.invm=function(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}}(e,this)},35085:function(e,t,a){"use strict";var r=a(44328).i8,n=a(36603),i=a(50170),c=a(329),f=a(98662),d=a(65579),o=a(92062),s=a(77802),b=function(){var e=this;n.packageInit(this,arguments),this.version=r,this.utils=s,this.eth=new i(this),this.shh=new d(this),this.bzz=new o(this);var t=this.setProvider;this.setProvider=function(a,r){return t.apply(e,arguments),e.eth.setRequestManager(e._requestManager),e.shh.setRequestManager(e._requestManager),e.bzz.setProvider(a),!0}};b.version=r,b.utils=s,b.modules={Eth:i,Net:c,Personal:f,Shh:d,Bzz:o},n.addProviders(b),e.exports=b},13977:function(e,t,a){var r;if(a(21703),"object"===typeof globalThis)r=globalThis;else try{r=a(7179)}catch(f){}finally{if(r||"undefined"===typeof window||(r=window),!r)throw new Error("Could not determine global this")}var n=r.WebSocket||r.MozWebSocket,i=a(6824);function c(e,t){var a;return a=t?new n(e,t):new n(e),a}n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(c,e,{get:function(){return n[e]}})})),e.exports={w3cwebsocket:n?c:null,version:i}},6824:function(e,t,a){e.exports=a(19794).version},12591:function(e,t,a){"use strict";var r=a(98625),n=a(24647),i=a(15477),c=i("Object.prototype.toString"),f=a(92582)(),d="undefined"===typeof globalThis?a.g:globalThis,o=n(),s=i("String.prototype.slice"),b={},u=a(82762),h=Object.getPrototypeOf;f&&u&&h&&r(o,(function(e){if("function"===typeof d[e]){var t=new d[e];if(Symbol.toStringTag in t){var a=h(t),r=u(a,Symbol.toStringTag);if(!r){var n=h(a);r=u(n,Symbol.toStringTag)}b[e]=r.get}}}));var l=function(e){var t=!1;return r(b,(function(a,r){if(!t)try{var n=a.call(e);n===r&&(t=n)}catch(i){}})),t},p=a(18300);e.exports=function(e){return!!p(e)&&(f&&Symbol.toStringTag in e?l(e):s(c(e),8,-1))}},13123:function(e,t,a){a(21703);var r=a(52606),n=a(27285),i=a(67293),c=a(3732),f=a(18196),d="application/json",o=function(){};function s(e,t,a){if(!e||"string"!==typeof e)throw new TypeError("must specify a URL");if("function"===typeof t&&(a=t,t={}),a&&"function"!==typeof a)throw new TypeError("expected cb to be undefined or a function");a=a||o,t=t||{};var s=t.json?"json":"text";t=i({responseType:s},t);var b=t.headers||{},u=(t.method||"GET").toUpperCase(),h=t.query;return h&&("string"!==typeof h&&(h=r.stringify(h)),e=n(e,h)),"json"===t.responseType&&c(b,"Accept",d),t.json&&"GET"!==u&&"HEAD"!==u&&(c(b,"Content-Type",d),t.body=JSON.stringify(t.body)),t.method=u,t.url=e,t.headers=b,delete t.query,delete t.json,f(t,a)}e.exports=s},3732:function(e){function t(e,t,a){var r=t.toLowerCase();e[t]||e[r]||(e[t]=a)}e.exports=t},18289:function(e){function t(e,t){return t?{statusCode:t.statusCode,headers:t.headers,method:e.method,url:e.url,rawRequest:t.rawRequest?t.rawRequest:t}:null}e.exports=t},18196:function(e,t,a){a(21703);var r=a(28470),n=a(18289),i=function(){};function c(e,t){delete e.uri;var a=!1;"json"===e.responseType&&(e.responseType="text",a=!0);var c=r(e,(function(r,c,f){if(a&&!r)try{var d=c.rawRequest.responseText;f=JSON.parse(d)}catch(o){r=o}c=n(e,c),t(r,r?null:f,c),t=i})),f=c.onabort;return c.onabort=function(){var e=f.apply(c,Array.prototype.slice.call(arguments));return t(new Error("XHR Aborted")),t=i,e},c}e.exports=c},52606:function(e,t,a){"use strict";var r=a(58959),n=a(67293),i=a(52386);function c(e){switch(e.arrayFormat){case"index":return function(t,a,r){return null===a?[d(t,e),"[",r,"]"].join(""):[d(t,e),"[",d(r,e),"]=",d(a,e)].join("")};case"bracket":return function(t,a){return null===a?d(t,e):[d(t,e),"[]=",d(a,e)].join("")};default:return function(t,a){return null===a?d(t,e):[d(t,e),"=",d(a,e)].join("")}}}function f(e){var t;switch(e.arrayFormat){case"index":return function(e,a,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=a):r[e]=a};case"bracket":return function(e,a,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],a):r[e]=[a]:r[e]=a};default:return function(e,t,a){void 0!==a[e]?a[e]=[].concat(a[e],t):a[e]=t}}}function d(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function o(e){return Array.isArray(e)?e.sort():"object"===typeof e?o(Object.keys(e)).sort((function(e,t){return Number(e)-Number(t)})).map((function(t){return e[t]})):e}function s(e){var t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function b(e,t){t=n({arrayFormat:"none"},t);var a=f(t),r=Object.create(null);return"string"!==typeof e?r:(e=e.trim().replace(/^[?#&]/,""),e?(e.split("&").forEach((function(e){var t=e.replace(/\+/g," ").split("="),n=t.shift(),c=t.length>0?t.join("="):void 0;c=void 0===c?null:i(c),a(i(n),c,r)})),Object.keys(r).sort().reduce((function(e,t){var a=r[t];return Boolean(a)&&"object"===typeof a&&!Array.isArray(a)?e[t]=o(a):e[t]=a,e}),Object.create(null))):r)}t.extract=s,t.parse=b,t.stringify=function(e,t){var a={encode:!0,strict:!0,arrayFormat:"none"};t=n(a,t),!1===t.sort&&(t.sort=function(){});var r=c(t);return e?Object.keys(e).sort(t.sort).map((function(a){var n=e[a];if(void 0===n)return"";if(null===n)return d(a,t);if(Array.isArray(n)){var i=[];return n.slice().forEach((function(e){void 0!==e&&i.push(r(a,e,i.length))})),i.join("&")}return d(a,t)+"="+d(n,t)})).filter((function(e){return e.length>0})).join("&"):""},t.parseUrl=function(e,t){return{url:e.split("?")[0]||"",query:b(s(e),t)}}},58959:function(e){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}},33650:function(e,t,a){"use strict";a(21703);var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])};return function(t,a){function r(){this.constructor=t}e(t,a),t.prototype=null===a?Object.create(a):(r.prototype=a.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(Error);t.SecurityError=n;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(Error);t.InvalidStateError=i;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(Error);t.NetworkError=c;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(Error);t.SyntaxError=f},51283:function(e,t,a){"use strict";function r(e){for(var a in e)t.hasOwnProperty(a)||(t[a]=e[a])}Object.defineProperty(t,"__esModule",{value:!0}),r(a(78642));var n=a(43012);t.XMLHttpRequestEventTarget=n.XMLHttpRequestEventTarget},29810:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e){this.type=e,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}return e}();t.ProgressEvent=a},43012:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(){this.listeners={}}return e.prototype.addEventListener=function(e,t){e=e.toLowerCase(),this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t.handleEvent||t)},e.prototype.removeEventListener=function(e,t){if(e=e.toLowerCase(),this.listeners[e]){var a=this.listeners[e].indexOf(t.handleEvent||t);a<0||this.listeners[e].splice(a,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var a=0,r=this.listeners[t];a=0)return this._url=this._parseUrl(a.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=a,this._response.on("data",(function(e){return r._onHttpResponseData(a,e)})),this._response.on("end",(function(){return r._onHttpResponseEnd(a)})),this._response.on("close",(function(){return r._onHttpResponseClose(a)})),this.responseUrl=this._url.href.split("#")[0],this.status=a.statusCode,this.statusText=f.STATUS_CODES[this.status],this._parseResponseHeaders(a);var n=this._responseHeaders["content-length"]||"";this._totalBytes=+n,this._lengthComputable=!!n,this._setReadyState(t.HEADERS_RECEIVED)}},t.prototype._onHttpResponseData=function(e,a){this._response===e&&(this._responseParts.push(new n(a)),this._loadedBytes+=a.length,this.readyState!==t.LOADING&&this._setReadyState(t.LOADING),this._dispatchProgress("progress"))},t.prototype._onHttpResponseEnd=function(e){this._response===e&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(t.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},t.prototype._onHttpResponseClose=function(e){if(this._response===e){var a=this._request;this._setError(),a.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},t.prototype._onHttpTimeout=function(e){this._request===e&&(this._setError(),e.abort(),this._setReadyState(t.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},t.prototype._onHttpRequestError=function(e,a){this._request===e&&(this._setError(),e.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},t.prototype._dispatchProgress=function(e){var a=new t.ProgressEvent(e);a.lengthComputable=this._lengthComputable,a.loaded=this._loadedBytes,a.total=this._totalBytes,this.dispatchEvent(a)},t.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},t.prototype._parseUrl=function(e,t,a){var r=null==this.nodejsBaseUrl?e:s.resolve(this.nodejsBaseUrl,e),n=s.parse(r,!1,!0);n.hash=null;var i=(n.auth||"").split(":"),c=i[0],f=i[1];return(c||f||t||a)&&(n.auth=(t||c||"")+":"+(a||f||"")),n},t.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var a=t.toLowerCase();this._privateHeaders[a]||(this._responseHeaders[a]=e.headers[t])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},t.prototype._parseResponse=function(){var e=n.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(e.toString("utf-8"))}catch(i){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=e);case"arraybuffer":this.responseText=null;for(var t=new ArrayBuffer(e.length),a=new Uint8Array(t),r=0;r0&&(l=setTimeout((function(){if(!b){b=!0,h.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",c(e)}}),e.timeout)),h.setRequestHeader)for(o in g)g.hasOwnProperty(o)&&h.setRequestHeader(o,g[o]);else if(e.headers&&!d(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(h.responseType=e.responseType),"beforeSend"in e&&"function"===typeof e.beforeSend&&e.beforeSend(h),h.send(m||null),h}function u(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(a){}return null}function h(){}e.exports=s,e.exports["default"]=s,s.XMLHttpRequest=r.XMLHttpRequest||h,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:r.XDomainRequest,f(["get","put","post","patch","head","delete"],(function(e){s["delete"===e?"del":e]=function(t,a,r){return a=o(t,a,r),a.method=e.toUpperCase(),b(a)}}))},57636:function(e){e.exports=a;var t=Object.prototype.hasOwnProperty;function a(){for(var e={},a=0;a((0,n.dD)("data-v-bb821688"),e=e(),(0,n.Cn)(),e),l={class:"wrap"},p={class:"top"},x={class:"header flex align-center justify-between"},m={class:"left flex align-center"},g=h((()=>(0,n._)("span",{class:"title"},"ANT-ETH",-1))),v={class:"right flex align-center"},y=h((()=>(0,n._)("img",{src:d,class:"icon"},null,-1))),w={key:0,class:"address"},M={class:"banner-content"},_=h((()=>(0,n._)("span",{class:"em"},"1000,000",-1))),k=(0,n.Uk)(" ETH"),A={key:1},S=h((()=>(0,n._)("img",{src:o,class:"banner"},null,-1))),E={class:"block-title"},B={class:"block-content"},T={class:"accredit-box"},P=h((()=>(0,n._)("img",{src:b},null,-1))),I=h((()=>(0,n._)("p",{class:"title"},"Dapp",-1))),C=h((()=>(0,n._)("p",null,"DappConnect",-1))),R=[P,I,C],O=h((()=>(0,n._)("img",{src:u},null,-1))),N=h((()=>(0,n._)("p",{class:"title"},"Wallet",-1))),U=h((()=>(0,n._)("p",null,"WalletConnect",-1))),L=[O,N,U],j={class:"wallet-box"},q={class:"sub-title"},F={class:"title"},D={class:"wallet-warp flex flex-wrap align-center justify-between"},H=["href"],z={class:"text"};function K(e,t,a,r,d,o){const b=(0,n.up)("van-dropdown-item"),u=(0,n.up)("van-dropdown-menu"),h=(0,n.up)("OrePool"),P=(0,n.up)("van-tab"),I=(0,n.up)("Account"),C=(0,n.up)("van-tabs"),O=(0,n.up)("van-button"),N=(0,n.up)("van-overlay"),U=(0,n.up)("Share"),K=(0,n.up)("van-popup");return(0,n.wg)(),(0,n.iD)("div",l,[(0,n._)("div",p,[(0,n._)("div",x,[(0,n._)("div",m,[(0,n._)("img",{src:f,class:"icon",onClick:t[0]||(t[0]=(...e)=>r.openShare&&r.openShare(...e))}),(0,n.Wm)(u,{"active-color":"#3D8AF2",class:"i18-wrap"},{default:(0,n.w5)((()=>[(0,n.Wm)(b,{modelValue:r.local,"onUpdate:modelValue":t[1]||(t[1]=e=>r.local=e),options:r.languague,onChange:r.changeLanguage},null,8,["modelValue","options","onChange"])])),_:1})]),g,(0,n._)("div",v,[y,r.walletAddress?((0,n.wg)(),(0,n.iD)("span",w,(0,i.zw)(r.walletAddress),1)):((0,n.wg)(),(0,n.iD)("span",{key:1,onClick:t[2]||(t[2]=(...e)=>r.showAccreditModal&&r.showAccreditModal(...e))},(0,i.zw)(e.$t("message.ConnectWallet")),1))])]),(0,n._)("div",M,[(0,n._)("p",null,(0,i.zw)(e.$t("message.Defi")),1),(0,n._)("p",null,[(0,n.Uk)((0,i.zw)(e.$t("message.Reward")),1),_,k]),r.hasApprove||r.availableWallet?(0,n.kq)("",!0):((0,n.wg)(),(0,n.iD)("button",{key:0,onClick:t[3]||(t[3]=e=>r.isShowApproveModal=!0)},(0,i.zw)(e.$t("message.ReceiveVoucher")),1)),r.availableWallet?((0,n.wg)(),(0,n.iD)("button",A,(0,i.zw)(r.availableWallet)+" USDT",1)):(0,n.kq)("",!0)])]),S,(0,n.Wm)(C,{class:"scale","title-active-color":"#080808","title-inactive-color":"#999999","line-height":"4px"},{default:(0,n.w5)((()=>[(0,n.Wm)(P,{title:e.$t("message.MiningPool")},{default:(0,n.w5)((()=>[(0,n.Wm)(h)])),_:1},8,["title"]),(0,n.Wm)(P,{title:e.$t("message.Account")},{default:(0,n.w5)((()=>[(0,n.Wm)(I,{ref:"accountRef",simulateData:r.simulateData},null,8,["simulateData"])])),_:1},8,["title"])])),_:1}),(0,n.Wm)(N,{show:r.isShowApproveModal,onClick:t[5]||(t[5]=e=>r.isShowApproveModal=!1),class:"wrapper"},{default:(0,n.w5)((()=>[(0,n._)("div",{class:"block",onClick:t[4]||(t[4]=(0,c.iM)((()=>{}),["stop"]))},[(0,n._)("div",E,[(0,n._)("p",null,(0,i.zw)(e.$t("message.ReceiveDescription")),1)]),(0,n._)("p",B,(0,i.zw)(e.$t("message.Description")),1),(0,n.Wm)(O,{class:"block-btn",loading:r.isApproving,"loading-text":e.$t("message.Approving"),type:"warning",onClick:r.toApprove},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Receive")),1)])),_:1},8,["loading","loading-text","onClick"])])])),_:1},8,["show"]),(0,n.Wm)(N,{show:r.isShowAccreditModal,onClick:t[10]||(t[10]=e=>r.isShowAccreditModal=!1),class:"wrapper"},{default:(0,n.w5)((()=>[(0,n._)("div",{class:"block",onClick:t[9]||(t[9]=(0,c.iM)((()=>{}),["stop"]))},[(0,n._)("img",{class:"close-icon",onClick:t[6]||(t[6]=e=>r.isShowAccreditModal=!1),src:s}),(0,n._)("div",T,[(0,n._)("div",{class:"item",onClick:t[7]||(t[7]=e=>r.showDappModal())},R),(0,n._)("div",{class:"item",onClick:t[8]||(t[8]=e=>r.showWalletModal())},L)])])])),_:1},8,["show"]),(0,n.Wm)(N,{show:r.isShowWalletModal,onClick:t[13]||(t[13]=e=>r.isShowWalletModal=!1),class:"wrapper"},{default:(0,n.w5)((()=>[(0,n._)("div",{class:"walletconnect-modal-wrap",onClick:t[12]||(t[12]=(0,c.iM)((()=>{}),["stop"]))},[(0,n._)("img",{class:"close-icon",onClick:t[11]||(t[11]=e=>r.isShowWalletModal=!1),src:s}),(0,n._)("div",j,[(0,n._)("div",q,[(0,n._)("span",null,(0,i.zw)(e.$t("message.Mobile")),1)]),(0,n._)("p",F,(0,i.zw)(e.$t("message.ChooseWallet")),1),(0,n._)("div",D,[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(r.dappList,(e=>((0,n.wg)(),(0,n.iD)("a",{href:e.link,target:"_blank",class:"item"},[(0,n._)("div",{class:"icon",style:(0,i.j5)({background:"url("+e.imgUrl+")"})},null,4),(0,n._)("p",z,(0,i.zw)(e.name),1)],8,H)))),256))])])])])),_:1},8,["show"]),(0,n.Wm)(K,{position:"bottom",show:r.iShowSharePopup},{default:(0,n.w5)((()=>[(0,n.Wm)(U,{ref:"shareRef",onClose:r.closeShare},null,8,["onClose"])])),_:1},8,["show"])])}a(52262),a(24506),a(21703);var Z=a(61639);const G=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],V=["eth_sendTransaction","eth_signTransaction","eth_sign","eth_signTypedData","eth_signTypedData_v1","eth_signTypedData_v2","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],W={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};a(48675),a(3462);var J=a(2396),X=a.n(J),Y=a(3896);function Q(e){return Y.arrayToBuffer(new Uint8Array(e))}function $(e,t){return Y.arrayToHex(new Uint8Array(e),!t)}function ee(e){return Y.bufferToArray(e).buffer}function te(e){return Y.utf8ToBuffer(e)}function ae(e,t){return Y.utf8ToHex(e,!t)}function re(e){return Y.hexToArray(e).buffer}function ne(e,t){const a=Y.removeHexPrefix(Y.sanitizeHex(new(X())(e).toString(16)));return t?a:Y.addHexPrefix(a)}var ie=a(69893);var ce=a(29441);function fe(){const e=Date.now()*Math.pow(10,3),t=Math.floor(Math.random()*Math.pow(10,3));return e+t}function de(e){return Y.sanitizeHex(e)}function oe(e){return Y.removeHexLeadingZeros(Y.addHexPrefix(e))}const se=fe;function be(){const e=((e,t)=>{for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t})();return e}function ue(e,t){let a;const r=W[e];return r&&(a=`https://${r}.infura.io/v3/${t}`),a}function he(e,t){let a;const r=ue(e,t.infuraId);return t.custom&&t.custom[e]?a=t.custom[e]:r&&(a=r),a}function le(e){return""===e||"string"===typeof e&&""===e.trim()}function pe(e){return!(e&&e.length)}function xe(e,t){return Y.isHexString(e,t)}function me(e){return"undefined"!==typeof e.method}function ge(e){return"undefined"!==typeof e.result}function ve(e){return"undefined"!==typeof e.error}function ye(e){return"undefined"!==typeof e.event}function we(e){return G.includes(e)||e.startsWith("wc_")}function Me(e){return!!e.method.startsWith("wc_")||!V.includes(e.method)}function _e(e){e=(0,Y.removeHexPrefix)(e.toLowerCase());const t=(0,Y.removeHexPrefix)((0,ie.keccak_256)(te(e)));let a="";for(let r=0;r7?a+=e[r].toUpperCase():a+=e[r];return(0,Y.addHexPrefix)(a)}const ke=e=>!!e&&("0x"===e.toLowerCase().substring(0,2)&&(!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||e===_e(e))));function Ae(e){return pe(e)||xe(e[0])||(e[0]=ae(e[0])),e}function Se(e){if("undefined"!==typeof e.type&&"0"!==e.type)return e;if("undefined"===typeof e.from||!ke(e.from))throw new Error("Transaction object must include a valid 'from' value.");function t(e){let t=e;return("number"===typeof e||"string"===typeof e&&!le(e))&&(xe(e)?"string"===typeof e&&(t=de(e)):t=ne(e)),"string"===typeof t&&(t=oe(t)),t}const a={from:de(e.from),to:"undefined"===typeof e.to?"":de(e.to),gasPrice:"undefined"===typeof e.gasPrice?"":t(e.gasPrice),gas:"undefined"===typeof e.gas?"undefined"===typeof e.gasLimit?"":t(e.gasLimit):t(e.gas),value:"undefined"===typeof e.value?"":t(e.value),nonce:"undefined"===typeof e.nonce?"":t(e.nonce),data:"undefined"===typeof e.data?"":de(e.data)||"0x"},r=["gasPrice","gas","value","nonce"];return Object.keys(a).forEach((e=>{!a[e].trim().length&&r.includes(e)&&delete a[e]})),a}function Ee(e){const t=e.message||"Failed or Rejected Request";let a=-32e3;if(e&&!e.code)switch(t){case"Parse error":a=-32700;break;case"Invalid request":a=-32600;break;case"Method not found":a=-32601;break;case"Invalid params":a=-32602;break;case"Internal error":a=-32603;break;default:a=-32e3;break}const r={code:a,message:t};return r}var Be=a(14782);function Te(e){const t=-1!==e.indexOf("?")?e.indexOf("?"):void 0,a="undefined"!==typeof t?e.substr(t):"";return a}function Pe(e,t){let a=Ie(e);return a=Object.assign(Object.assign({},a),t),e=Ce(a),e}function Ie(e){return Be.parse(e)}function Ce(e){return Be.stringify(e)}function Re(e){return"undefined"!==typeof e.bridge}function Oe(e){const t=e.indexOf(":"),a=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r=e.substring(0,t),n=e.substring(t+1,a);function i(e){const t="@",a=e.split(t),r={handshakeTopic:a[0],version:parseInt(a[1],10)};return r}const c=i(n),f="undefined"!==typeof a?e.substr(a):"";function d(e){const t=Ie(e),a={key:t.key||"",bridge:t.bridge||""};return a}const o=d(f),s=Object.assign(Object.assign({protocol:r},c),o);return s}class Ne{constructor(){this._eventEmitters=[],"undefined"!==typeof window&&"undefined"!==typeof window.addEventListener&&(window.addEventListener("online",(()=>this.trigger("online"))),window.addEventListener("offline",(()=>this.trigger("offline"))))}on(e,t){this._eventEmitters.push({event:e,callback:t})}trigger(e){let t=[];e&&(t=this._eventEmitters.filter((t=>t.event===e))),t.forEach((e=>{e.callback()}))}}var Ue=Ne;const Le="undefined"!==typeof a.g.WebSocket?a.g.WebSocket:a(90994);class je{constructor(e){if(this.opts=e,this._queue=[],this._events=[],this._subscriptions=[],this._protocol=e.protocol,this._version=e.version,this._url="",this._netMonitor=null,this._socket=null,this._nextSocket=null,this._subscriptions=e.subscriptions||[],this._netMonitor=e.netMonitor||new Ue,!e.url||"string"!==typeof e.url)throw new Error("Missing or invalid WebSocket url");this._url=e.url,this._netMonitor.on("online",(()=>this._socketCreate()))}set readyState(e){}get readyState(){return this._socket?this._socket.readyState:-1}set connecting(e){}get connecting(){return 0===this.readyState}set connected(e){}get connected(){return 1===this.readyState}set closing(e){}get closing(){return 2===this.readyState}set closed(e){}get closed(){return 3===this.readyState}open(){this._socketCreate()}close(){this._socketClose()}send(e,t,a){if(!t||"string"!==typeof t)throw new Error("Missing or invalid topic field");this._socketSend({topic:t,type:"pub",payload:e,silent:!!a})}subscribe(e){this._socketSend({topic:e,type:"sub",payload:"",silent:!0})}on(e,t){this._events.push({event:e,callback:t})}_socketCreate(){if(this._nextSocket)return;const e=qe(this._url,this._protocol,this._version);if(this._nextSocket=new Le(e),!this._nextSocket)throw new Error("Failed to create socket");this._nextSocket.onmessage=e=>this._socketReceive(e),this._nextSocket.onopen=()=>this._socketOpen(),this._nextSocket.onerror=e=>this._socketError(e),this._nextSocket.onclose=()=>{setTimeout((()=>{this._nextSocket=null,this._socketCreate()}),1e3)}}_socketOpen(){this._socketClose(),this._socket=this._nextSocket,this._nextSocket=null,this._queueSubscriptions(),this._pushQueue()}_socketClose(){this._socket&&(this._socket.onclose=()=>{},this._socket.close())}_socketSend(e){const t=JSON.stringify(e);this._socket&&1===this._socket.readyState?this._socket.send(t):(this._setToQueue(e),this._socketCreate())}async _socketReceive(e){let t;try{t=JSON.parse(e.data)}catch(a){return}if(this._socketSend({topic:t.topic,type:"ack",payload:"",silent:!0}),this._socket&&1===this._socket.readyState){const e=this._events.filter((e=>"message"===e.event));e&&e.length&&e.forEach((e=>e.callback(t)))}}_socketError(e){const t=this._events.filter((e=>"error"===e.event));t&&t.length&&t.forEach((t=>t.callback(e)))}_queueSubscriptions(){const e=this._subscriptions;e.forEach((e=>this._queue.push({topic:e,type:"sub",payload:"",silent:!0}))),this._subscriptions=this.opts.subscriptions||[]}_setToQueue(e){this._queue.push(e)}_pushQueue(){const e=this._queue;e.forEach((e=>this._socketSend(e))),this._queue=[]}}function qe(e,t,a){var r,n;const i=e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e,c=i.split("?"),f=(0,Z.isBrowser)()?{protocol:t,version:a,env:"browser",host:(null===(r=(0,Z.getLocation)())||void 0===r?void 0:r.host)||""}:{protocol:t,version:a,env:(null===(n=(0,Z.detectEnv)())||void 0===n?void 0:n.name)||""},d=Pe(Te(c[1]||""),f);return c[0]+"?"+d}var Fe=je;const De="Session currently connected",He="Session currently disconnected",ze="Session Rejected",Ke="Missing JSON RPC response",Ze='JSON-RPC success response must include "result" field',Ge='JSON-RPC error response must include "error" field',Ve='JSON RPC request must have valid "method" value',We='JSON RPC request must have valid "id" value',Je="Missing one of the required parameters: bridge / uri / session",Xe="JSON RPC response format is invalid",Ye="URI format is invalid",Qe="QRCode Modal not provided",$e="User close QRCode Modal";class et{constructor(){this._eventEmitters=[]}subscribe(e){this._eventEmitters.push(e)}unsubscribe(e){this._eventEmitters=this._eventEmitters.filter((t=>t.event!==e))}trigger(e){let t,a=[];t=me(e)?e.method:ge(e)||ve(e)?`response:${e.id}`:ye(e)?e.event:"",t&&(a=this._eventEmitters.filter((e=>e.event===t))),a&&a.length||we(t)||ye(t)||(a=this._eventEmitters.filter((e=>"call_request"===e.event))),a.forEach((t=>{if(ve(e)){const a=new Error(e.error.message);t.callback(a,null)}else t.callback(null,e)}))}}var tt=et;class at{constructor(e="walletconnect"){this.storageId=e}getSession(){let e=null;const t=(0,Z.getLocal)(this.storageId);return t&&Re(t)&&(e=t),e}setSession(e){return(0,Z.setLocal)(this.storageId,e),e}removeSession(){(0,Z.removeLocal)(this.storageId)}}var rt=at;const nt="walletconnect.org",it="abcdefghijklmnopqrstuvwxyz0123456789",ct=it.split("").map((e=>`https://${e}.bridge.walletconnect.org`));function ft(e){let t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0];return t=t.split(":")[0],t=t.split("?")[0],t}function dt(e){return ft(e).split(".").slice(-2).join(".")}function ot(){return Math.floor(Math.random()*ct.length)}function st(){return ct[ot()]}function bt(e){return dt(e)===nt}function ut(e){return bt(e)?st():e}class ht{constructor(e){if(this.protocol="wc",this.version=1,this._bridge="",this._key=null,this._clientId="",this._clientMeta=null,this._peerId="",this._peerMeta=null,this._handshakeId=0,this._handshakeTopic="",this._connected=!1,this._accounts=[],this._chainId=0,this._networkId=0,this._rpcUrl="",this._eventManager=new tt,this._clientMeta=(0,Z.getClientMeta)()||e.connectorOpts.clientMeta||null,this._cryptoLib=e.cryptoLib,this._sessionStorage=e.sessionStorage||new rt(e.connectorOpts.storageId),this._qrcodeModal=e.connectorOpts.qrcodeModal,this._qrcodeModalOptions=e.connectorOpts.qrcodeModalOptions,this._signingMethods=[...V,...e.connectorOpts.signingMethods||[]],!e.connectorOpts.bridge&&!e.connectorOpts.uri&&!e.connectorOpts.session)throw new Error(Je);e.connectorOpts.bridge&&(this.bridge=ut(e.connectorOpts.bridge)),e.connectorOpts.uri&&(this.uri=e.connectorOpts.uri);const t=e.connectorOpts.session||this._getStorageSession();t&&(this.session=t),this.handshakeId&&this._subscribeToSessionResponse(this.handshakeId,"Session request rejected"),this._transport=e.transport||new Fe({protocol:this.protocol,version:this.version,url:this.bridge,subscriptions:[this.clientId]}),this._subscribeToInternalEvents(),this._initTransport(),e.connectorOpts.uri&&this._subscribeToSessionRequest(),e.pushServerOpts&&this._registerPushServer(e.pushServerOpts)}set bridge(e){e&&(this._bridge=e)}get bridge(){return this._bridge}set key(e){if(!e)return;const t=re(e);this._key=t}get key(){if(this._key){const e=$(this._key,!0);return e}return""}set clientId(e){e&&(this._clientId=e)}get clientId(){let e=this._clientId;return e||(e=this._clientId=be()),this._clientId}set peerId(e){e&&(this._peerId=e)}get peerId(){return this._peerId}set clientMeta(e){}get clientMeta(){let e=this._clientMeta;return e||(e=this._clientMeta=(0,Z.getClientMeta)()),e}set peerMeta(e){this._peerMeta=e}get peerMeta(){const e=this._peerMeta;return e}set handshakeTopic(e){e&&(this._handshakeTopic=e)}get handshakeTopic(){return this._handshakeTopic}set handshakeId(e){e&&(this._handshakeId=e)}get handshakeId(){return this._handshakeId}get uri(){const e=this._formatUri();return e}set uri(e){if(!e)return;const{handshakeTopic:t,bridge:a,key:r}=this._parseUri(e);this.handshakeTopic=t,this.bridge=a,this.key=r}set chainId(e){this._chainId=e}get chainId(){const e=this._chainId;return e}set networkId(e){this._networkId=e}get networkId(){const e=this._networkId;return e}set accounts(e){this._accounts=e}get accounts(){const e=this._accounts;return e}set rpcUrl(e){this._rpcUrl=e}get rpcUrl(){const e=this._rpcUrl;return e}set connected(e){}get connected(){return this._connected}set pending(e){}get pending(){return!!this._handshakeTopic}get session(){return{connected:this.connected,accounts:this.accounts,chainId:this.chainId,bridge:this.bridge,key:this.key,clientId:this.clientId,clientMeta:this.clientMeta,peerId:this.peerId,peerMeta:this.peerMeta,handshakeId:this.handshakeId,handshakeTopic:this.handshakeTopic}}set session(e){e&&(this._connected=e.connected,this.accounts=e.accounts,this.chainId=e.chainId,this.bridge=e.bridge,this.key=e.key,this.clientId=e.clientId,this.clientMeta=e.clientMeta,this.peerId=e.peerId,this.peerMeta=e.peerMeta,this.handshakeId=e.handshakeId,this.handshakeTopic=e.handshakeTopic)}on(e,t){const a={event:e,callback:t};this._eventManager.subscribe(a)}off(e){this._eventManager.unsubscribe(e)}async createInstantRequest(e){this._key=await this._generateKey();const t=this._formatRequest({method:"wc_instantRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,request:this._formatRequest(e)}]});this.handshakeId=t.id,this.handshakeTopic=be(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(()=>{throw new Error($e)}));const a=()=>{this.killSession()};try{const e=await this._sendCallRequest(t);return e&&a(),e}catch(r){throw a(),r}}async connect(e){if(!this._qrcodeModal)throw new Error(Qe);return this.connected?{chainId:this.chainId,accounts:this.accounts}:(await this.createSession(e),new Promise((async(e,t)=>{this.on("modal_closed",(()=>t(new Error($e)))),this.on("connect",((a,r)=>{if(a)return t(a);e(r.params[0])}))})))}async createSession(e){if(this._connected)throw new Error(De);if(this.pending)return;this._key=await this._generateKey();const t=this._formatRequest({method:"wc_sessionRequest",params:[{peerId:this.clientId,peerMeta:this.clientMeta,chainId:e&&e.chainId?e.chainId:null}]});this.handshakeId=t.id,this.handshakeTopic=be(),this._sendSessionRequest(t,"Session update rejected",{topic:this.handshakeTopic}),this._eventManager.trigger({event:"display_uri",params:[this.uri]})}approveSession(e){if(this._connected)throw new Error(De);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl,peerId:this.clientId,peerMeta:this.clientMeta},a={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(a),this._connected=!0,this._setStorageSession(),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})}rejectSession(e){if(this._connected)throw new Error(De);const t=e&&e.message?e.message:ze,a=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(a),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}updateSession(e){if(!this._connected)throw new Error(He);this.chainId=e.chainId,this.accounts=e.accounts,this.networkId=e.networkId||0,this.rpcUrl=e.rpcUrl||"";const t={approved:!0,chainId:this.chainId,networkId:this.networkId,accounts:this.accounts,rpcUrl:this.rpcUrl},a=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(a,"Session update rejected"),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]}),this._manageStorageSession()}async killSession(e){const t=e?e.message:"Session Disconnected",a={approved:!1,chainId:null,networkId:null,accounts:null},r=this._formatRequest({method:"wc_sessionUpdate",params:[a]});await this._sendRequest(r),this._handleSessionDisconnect(t)}async sendTransaction(e){if(!this._connected)throw new Error(He);const t=Se(e),a=this._formatRequest({method:"eth_sendTransaction",params:[t]}),r=await this._sendCallRequest(a);return r}async signTransaction(e){if(!this._connected)throw new Error(He);const t=Se(e),a=this._formatRequest({method:"eth_signTransaction",params:[t]}),r=await this._sendCallRequest(a);return r}async signMessage(e){if(!this._connected)throw new Error(He);const t=this._formatRequest({method:"eth_sign",params:e}),a=await this._sendCallRequest(t);return a}async signPersonalMessage(e){if(!this._connected)throw new Error(He);e=Ae(e);const t=this._formatRequest({method:"personal_sign",params:e}),a=await this._sendCallRequest(t);return a}async signTypedData(e){if(!this._connected)throw new Error(He);const t=this._formatRequest({method:"eth_signTypedData",params:e}),a=await this._sendCallRequest(t);return a}async updateChain(e){if(!this._connected)throw new Error("Session currently disconnected");const t=this._formatRequest({method:"wallet_updateChain",params:[e]}),a=await this._sendCallRequest(t);return a}unsafeSend(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),new Promise(((t,a)=>{this._subscribeToResponse(e.id,((e,r)=>{if(e)a(e);else{if(!r)throw new Error(Ke);t(r)}}))}))}async sendCustomRequest(e,t){if(!this._connected)throw new Error(He);switch(e.method){case"eth_accounts":return this.accounts;case"eth_chainId":return ne(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":e.params&&(e.params[0]=Se(e.params[0]));break;case"personal_sign":e.params&&(e.params=Ae(e.params));break;default:break}const a=this._formatRequest(e),r=await this._sendCallRequest(a,t);return r}approveRequest(e){if(!ge(e))throw new Error(Ze);{const t=this._formatResponse(e);this._sendResponse(t)}}rejectRequest(e){if(!ve(e))throw new Error(Ge);{const t=this._formatResponse(e);this._sendResponse(t)}}transportClose(){this._transport.close()}async _sendRequest(e,t){const a=this._formatRequest(e),r=await this._encrypt(a),n="undefined"!==typeof(null===t||void 0===t?void 0:t.topic)?t.topic:this.peerId,i=JSON.stringify(r),c="undefined"!==typeof(null===t||void 0===t?void 0:t.forcePushNotification)?!t.forcePushNotification:Me(a);this._transport.send(i,n,c)}async _sendResponse(e){const t=await this._encrypt(e),a=this.peerId,r=JSON.stringify(t),n=!0;this._transport.send(r,a,n)}async _sendSessionRequest(e,t,a){this._sendRequest(e,a),this._subscribeToSessionResponse(e.id,t)}_sendCallRequest(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),this._subscribeToCallResponse(e.id)}_formatRequest(e){if("undefined"===typeof e.method)throw new Error(Ve);const t={id:"undefined"===typeof e.id?se():e.id,jsonrpc:"2.0",method:e.method,params:"undefined"===typeof e.params?[]:e.params};return t}_formatResponse(e){if("undefined"===typeof e.id)throw new Error(We);const t={id:e.id,jsonrpc:"2.0"};if(ve(e)){const a=Ee(e.error),r=Object.assign(Object.assign(Object.assign({},t),e),{error:a});return r}if(ge(e)){const a=Object.assign(Object.assign({},t),e);return a}throw new Error(Xe)}_handleSessionDisconnect(e){const t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),(0,Z.removeLocal)(Z.mobileLinkChoiceKey)),this._connected&&(this._connected=!1),this._handshakeId&&(this._handshakeId=0),this._handshakeTopic&&(this._handshakeTopic=""),this._peerId&&(this._peerId=""),this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession(),this.transportClose()}_handleSessionResponse(e,t){t&&t.approved?(this._connected?(t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),this._eventManager.trigger({event:"session_update",params:[{chainId:this.chainId,accounts:this.accounts}]})):(this._connected=!0,t.chainId&&(this.chainId=t.chainId),t.accounts&&(this.accounts=t.accounts),t.peerId&&!this.peerId&&(this.peerId=t.peerId),t.peerMeta&&!this.peerMeta&&(this.peerMeta=t.peerMeta),this._eventManager.trigger({event:"connect",params:[{peerId:this.peerId,peerMeta:this.peerMeta,chainId:this.chainId,accounts:this.accounts}]})),this._manageStorageSession()):this._handleSessionDisconnect(e)}async _handleIncomingMessages(e){const t=[this.clientId,this.handshakeTopic];if(!t.includes(e.topic))return;let a;try{a=JSON.parse(e.payload)}catch(n){return}const r=await this._decrypt(a);r&&this._eventManager.trigger(r)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(e,t){this.on(`response:${e}`,t)}_subscribeToSessionResponse(e,t){this._subscribeToResponse(e,((e,a)=>{e?this._handleSessionResponse(e.message):a.result?this._handleSessionResponse(t,a.result):a.error&&a.error.message?this._handleSessionResponse(a.error.message):this._handleSessionResponse(t)}))}_subscribeToCallResponse(e){return new Promise(((t,a)=>{this._subscribeToResponse(e,((e,r)=>{e?a(e):r.result?t(r.result):r.error&&r.error.message?a(new Error(r.error.message)):a(new Error(Xe))}))}))}_subscribeToInternalEvents(){this.on("display_uri",(()=>{this._qrcodeModal&&this._qrcodeModal.open(this.uri,(()=>{this._eventManager.trigger({event:"modal_closed",params:[]})}),this._qrcodeModalOptions)})),this.on("connect",(()=>{this._qrcodeModal&&this._qrcodeModal.close()})),this.on("call_request_sent",((e,t)=>{const{request:a}=t.params[0];if((0,Z.isMobile)()&&this._signingMethods.includes(a.method)){const e=(0,Z.getLocal)(Z.mobileLinkChoiceKey);e&&(window.location.href=e.href)}})),this.on("wc_sessionRequest",((e,t)=>{e&&this._eventManager.trigger({event:"error",params:[{code:"SESSION_REQUEST_ERROR",message:e.toString()}]}),this.handshakeId=t.id,this.peerId=t.params[0].peerId,this.peerMeta=t.params[0].peerMeta;const a=Object.assign(Object.assign({},t),{method:"session_request"});this._eventManager.trigger(a)})),this.on("wc_sessionUpdate",((e,t)=>{e&&this._handleSessionResponse(e.message),this._handleSessionResponse("Session disconnected",t.params[0])}))}_initTransport(){this._transport.on("message",(e=>this._handleIncomingMessages(e))),this._transport.on("open",(()=>this._eventManager.trigger({event:"transport_open",params:[]}))),this._transport.on("close",(()=>this._eventManager.trigger({event:"transport_close",params:[]}))),this._transport.on("error",(()=>this._eventManager.trigger({event:"transport_error",params:["Websocket connection failed"]}))),this._transport.open()}_formatUri(){const e=this.protocol,t=this.handshakeTopic,a=this.version,r=encodeURIComponent(this.bridge),n=this.key,i=`${e}:${t}@${a}?bridge=${r}&key=${n}`;return i}_parseUri(e){const t=Oe(e);if(t.protocol===this.protocol){if(!t.handshakeTopic)throw Error("Invalid or missing handshakeTopic parameter value");const e=t.handshakeTopic;if(!t.bridge)throw Error("Invalid or missing bridge url parameter value");const a=decodeURIComponent(t.bridge);if(!t.key)throw Error("Invalid or missing key parameter value");const r=t.key;return{handshakeTopic:e,bridge:a,key:r}}throw new Error(Ye)}async _generateKey(){if(this._cryptoLib){const e=await this._cryptoLib.generateKey();return e}return null}async _encrypt(e){const t=this._key;if(this._cryptoLib&&t){const a=await this._cryptoLib.encrypt(e,t);return a}return null}async _decrypt(e){const t=this._key;if(this._cryptoLib&&t){const a=await this._cryptoLib.decrypt(e,t);return a}return null}_getStorageSession(){let e=null;return this._sessionStorage&&(e=this._sessionStorage.getSession()),e}_setStorageSession(){this._sessionStorage&&this._sessionStorage.setSession(this.session)}_removeStorageSession(){this._sessionStorage&&this._sessionStorage.removeSession()}_manageStorageSession(){this._connected?this._setStorageSession():this._removeStorageSession()}_registerPushServer(e){if(!e.url||"string"!==typeof e.url)throw Error("Invalid or missing pushServerOpts.url parameter value");if(!e.type||"string"!==typeof e.type)throw Error("Invalid or missing pushServerOpts.type parameter value");if(!e.token||"string"!==typeof e.token)throw Error("Invalid or missing pushServerOpts.token parameter value");const t={bridge:this.bridge,topic:this.clientId,type:e.type,token:e.token,peerName:"",language:e.language||""};this.on("connect",(async(a,r)=>{if(a)throw a;if(e.peerMeta){const e=r.params[0].peerMeta.name;t.peerName=e}try{const a=await fetch(`${e.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}),r=await a.json();if(!r.success)throw Error("Failed to register in Push Server")}catch(a){throw Error("Failed to register in Push Server")}}))}}var lt=ht;function pt(e){const t=ce.getBrowerCrypto();return t.getRandomValues(new Uint8Array(e))}const xt=256,mt=xt,gt=xt,vt="AES-CBC",yt=`SHA-${mt}`,wt="HMAC",Mt="encrypt",_t="decrypt",kt="sign",At="verify";function St(e){return e===vt?{length:mt,name:vt}:{hash:{name:yt},name:wt}}function Et(e){return e===vt?[Mt,_t]:[kt,At]}async function Bt(e,t=vt){return ce.getSubtleCrypto().importKey("raw",e,St(t),!0,Et(t))}async function Tt(e,t,a){const r=ce.getSubtleCrypto(),n=await Bt(t,vt),i=await r.encrypt({iv:e,name:vt},n,a);return new Uint8Array(i)}async function Pt(e,t,a){const r=ce.getSubtleCrypto(),n=await Bt(t,vt),i=await r.decrypt({iv:e,name:vt},n,a);return new Uint8Array(i)}async function It(e,t){const a=ce.getSubtleCrypto(),r=await Bt(e,wt),n=await a.sign({length:gt,name:wt},r,t);return new Uint8Array(n)}function Ct(e,t,a){return Tt(e,t,a)}function Rt(e,t,a){return Pt(e,t,a)}async function Ot(e,t){const a=await It(e,t);return a}async function Nt(e){const t=(e||256)/8,a=pt(t),r=ee(Y.arrayToBuffer(a));return r}async function Ut(e,t){const a=Y.hexToArray(e.data),r=Y.hexToArray(e.iv),n=Y.hexToArray(e.hmac),i=Y.arrayToHex(n,!1),c=Y.concatArrays(a,r),f=await Ot(t,c),d=Y.arrayToHex(f,!1);return Y.removeHexPrefix(i)===Y.removeHexPrefix(d)}async function Lt(e,t,a){const r=Y.bufferToArray(Q(t)),n=a||await Nt(128),i=Y.bufferToArray(Q(n)),c=Y.arrayToHex(i,!1),f=JSON.stringify(e),d=Y.utf8ToArray(f),o=await Ct(i,r,d),s=Y.arrayToHex(o,!1),b=Y.concatArrays(o,i),u=await Ot(r,b),h=Y.arrayToHex(u,!1);return{data:s,hmac:h,iv:c}}async function jt(e,t){const a=Y.bufferToArray(Q(t));if(!a)throw new Error("Missing key: required for decryption");const r=await Ut(e,a);if(!r)return null;const n=Y.hexToArray(e.data),i=Y.hexToArray(e.iv),c=await Rt(i,a,n),f=Y.arrayToUtf8(c);let d;try{d=JSON.parse(f)}catch(o){return null}return d}class qt extends lt{constructor(e,t){super({cryptoLib:r,connectorOpts:e,pushServerOpts:t})}}var Ft=qt,Dt=a(83581),Ht=a.n(Dt),zt=a(6856),Kt=a.n(zt),Zt=a(51283);const Gt=(0,Z.getFromWindow)("XMLHttpRequest")||Zt.XMLHttpRequest;class Vt extends(Kt()){constructor(e){super(),this.url=e}formatError(e,t,a=-1){return{error:{message:t,code:a},id:e.id,jsonrpc:e.jsonrpc}}send(e,t){return new Promise((a=>{if("eth_subscribe"===e.method){const t=this.formatError(e,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",t),a(t)}const r=new Gt;let n=!1;const i=(i,c)=>{if(!n)if(r.abort(),n=!0,t)t(i,c);else{const{id:t,jsonrpc:r}=e,n=i?{id:t,jsonrpc:r,error:{message:i.message,code:i.code}}:{id:t,jsonrpc:r,result:c};this.emit("payload",n),a(n)}};r.open("POST",this.url,!0),r.setRequestHeader("Content-Type","application/json"),r.timeout=6e4,r.onerror=i,r.ontimeout=i,r.onreadystatechange=()=>{if(4===r.readyState)try{const e=JSON.parse(r.responseText);i(e.error,e.result)}catch(e){i(e)}},r.send(JSON.stringify(e))}))}}var Wt=Vt;const Jt=a(79948),Xt=a(91501),Yt=a(51080),Qt=a(23220),$t=a(49537),ea=a(50822),ta=a(95905);class aa extends Jt{constructor(e){if(super({pollingInterval:e.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=Ht(),this.qrcodeModalOptions=void 0,this.rpc=null,this.infuraId="",this.http=null,this.isConnecting=!1,this.connected=!1,this.connectCallbacks=[],this.accounts=[],this.chainId=1,this.rpcUrl="",this.enable=async()=>{const e=await this.getWalletConnector();if(e)return this.start(),this.subscribeWalletConnector(),e.accounts;throw new Error("Failed to connect to WalleConnect")},this.request=async e=>this.send(e),this.send=async(e,t)=>{if("string"===typeof e){const a=e;let r=t;return"personal_sign"===a&&(r=Ae(r)),this.sendAsyncPromise(a,r)}if(e=Object.assign({id:se(),jsonrpc:"2.0"},e),"personal_sign"===e.method&&(e.params=Ae(e.params)),!t)return this.sendAsyncPromise(e.method,e.params);this.sendAsync(e,t)},this.onConnect=e=>{this.connectCallbacks.push(e)},this.triggerConnect=e=>{this.connectCallbacks&&this.connectCallbacks.length&&this.connectCallbacks.forEach((t=>t(e)))},this.bridge=e.connector?e.connector.bridge:e.bridge||"https://bridge.walletconnect.org",this.qrcode="undefined"===typeof e.qrcode||!1!==e.qrcode,this.qrcodeModal=e.qrcodeModal||this.qrcodeModal,this.qrcodeModalOptions=e.qrcodeModalOptions,this.wc=e.connector||new Ft({bridge:this.bridge,qrcodeModal:this.qrcode?this.qrcodeModal:void 0,qrcodeModalOptions:this.qrcodeModalOptions,storageId:null===e||void 0===e?void 0:e.storageId,signingMethods:null===e||void 0===e?void 0:e.signingMethods,clientMeta:null===e||void 0===e?void 0:e.clientMeta}),this.rpc=e.rpc||null,!this.rpc&&(!e.infuraId||"string"!==typeof e.infuraId||!e.infuraId.trim()))throw new Error("Missing one of the required parameters: rpc or infuraId");this.infuraId=e.infuraId||"",this.chainId=(null===e||void 0===e?void 0:e.chainId)||this.chainId,this.initialize()}get isWalletConnect(){return!0}get connector(){return this.wc}get walletMeta(){return this.wc.peerMeta}async disconnect(){this.close()}async close(){const e=await this.getWalletConnector({disableSessionCreation:!0});await e.killSession(),await this.onDisconnect()}async handleRequest(e){try{let t,a=null;const r=await this.getWalletConnector();switch(e.method){case"wc_killSession":await this.close(),a=null;break;case"eth_accounts":a=r.accounts;break;case"eth_coinbase":a=r.accounts[0];break;case"eth_chainId":a=r.chainId;break;case"net_version":a=r.chainId;break;case"eth_uninstallFilter":this.sendAsync(e,(e=>e)),a=!0;break;default:t=await this.handleOtherRequests(e)}return t||this.formatResponse(e,a)}catch(t){throw this.emit("error",t),t}}async handleOtherRequests(e){if(!V.includes(e.method)&&e.method.startsWith("eth_"))return this.handleReadRequests(e);const t=await this.getWalletConnector(),a=await t.sendCustomRequest(e);return this.formatResponse(e,a)}async handleReadRequests(e){if(!this.http){const e=new Error("HTTP Connection not available");throw this.emit("error",e),e}return this.http.send(e)}formatResponse(e,t){return{id:e.id,jsonrpc:e.jsonrpc,result:t}}getWalletConnector(e={}){const{disableSessionCreation:t=!1}=e;return new Promise(((e,a)=>{const r=this.wc;this.isConnecting?this.onConnect((t=>e(t))):r.connected||t?(this.connected||(this.connected=!0,this.updateState(r.session)),e(r)):(this.isConnecting=!0,r.on("modal_closed",(()=>{a(new Error("User closed modal"))})),r.createSession({chainId:this.chainId}).then((()=>{r.on("connect",((t,n)=>{if(t)return this.isConnecting=!1,a(t);this.isConnecting=!1,this.connected=!0,n&&this.updateState(n.params[0]),this.emit("connect"),this.triggerConnect(r),e(r)}))})).catch((e=>{this.isConnecting=!1,a(e)})))}))}async subscribeWalletConnector(){const e=await this.getWalletConnector();e.on("disconnect",(e=>{e?this.emit("error",e):this.onDisconnect()})),e.on("session_update",((e,t)=>{e?this.emit("error",e):this.updateState(t.params[0])}))}async onDisconnect(){await this.stop(),this.emit("close",1e3,"Connection closed"),this.emit("disconnect",1e3,"Connection disconnected"),this.connected=!1}async updateState(e){const{accounts:t,chainId:a,networkId:r,rpcUrl:n}=e;(!this.accounts||t&&this.accounts!==t)&&(this.accounts=t,this.emit("accountsChanged",t)),(!this.chainId||a&&this.chainId!==a)&&(this.chainId=a,this.emit("chainChanged",a)),(!this.networkId||r&&this.networkId!==r)&&(this.networkId=r,this.emit("networkChanged",r)),this.updateRpcUrl(this.chainId,n||"")}updateRpcUrl(e,t=""){const a={infuraId:this.infuraId,custom:this.rpc||void 0};t=t||he(e,a),t?(this.rpcUrl=t,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${e}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new Wt(this.rpcUrl),this.http.on("payload",(e=>this.emit("payload",e))),this.http.on("error",(e=>this.emit("error",e))))}sendAsyncPromise(e,t){return new Promise(((a,r)=>{this.sendAsync({id:se(),jsonrpc:"2.0",method:e,params:t||[]},((e,t)=>{e?r(e):a(t.result)}))}))}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new Yt({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new Xt),this.addProvider(new ta),this.addProvider(new Qt),this.addProvider(new ea),this.addProvider(new $t(this.configWallet())),this.addProvider({handleRequest:async(e,t,a)=>{try{const{error:t,result:r}=await this.handleRequest(e);a(t,r)}catch(r){a(r)}},setEngine:e=>e})}configWallet(){return{getAccounts:async e=>{try{const t=await this.getWalletConnector(),a=t.accounts;a&&a.length?e(null,a):e(new Error("Failed to get accounts"))}catch(t){e(t)}},processMessage:async(e,t)=>{try{const a=await this.getWalletConnector(),r=await a.signMessage([e.from,e.data]);t(null,r)}catch(a){t(a)}},processPersonalMessage:async(e,t)=>{try{const a=await this.getWalletConnector(),r=await a.signPersonalMessage([e.data,e.from]);t(null,r)}catch(a){t(a)}},processSignTransaction:async(e,t)=>{try{const a=await this.getWalletConnector(),r=await a.signTransaction(e);t(null,r)}catch(a){t(a)}},processTransaction:async(e,t)=>{try{const a=await this.getWalletConnector(),r=await a.sendTransaction(e);t(null,r)}catch(a){t(a)}},processTypedMessage:async(e,t)=>{try{const a=await this.getWalletConnector(),r=await a.signTypedData([e.from,e.data]);t(null,r)}catch(a){t(a)}}}}}var ra=aa,na=a(35085),ia=a.n(na),ca=a(44870),fa=a(10153),da=a(2354),oa=a(32954),sa=a(93744),ba=a(77974),ua=a(8),ha=a(35577),la=a(5473),pa=a(71915);const xa={class:"box"},ma={class:"title"},ga={class:"box-content"},va={class:"row flex align-center justify-between"},ya={class:"name"},wa={class:"count em"},Ma={class:"row flex align-center justify-between"},_a={class:"name"},ka={class:"count em"},Aa={class:"row flex align-center justify-between"},Sa={class:"name"},Ea={class:"count"},Ba={class:"row flex align-center justify-between"},Ta={class:"name"},Pa={class:"count"},Ia={class:"m-title"},Ca={class:"m-subtitle"},Ra={class:"box"},Oa={class:"title"},Na={class:"box-content"},Ua={class:"row flex align-center justify-between"},La={class:"name"},ja={class:"name"},qa={class:"row flex align-center justify-between"},Fa={class:"small-name"},Da={class:"small-count"},Ha={class:"m-title"},za={class:"m-subtitle"},Ka={class:"m-title"},Za={class:"m-subtitle"},Ga=(0,n._)("div",{class:"img-wrap flex justify-between"},[(0,n._)("img",{src:fa}),(0,n._)("img",{src:da}),(0,n._)("img",{src:oa})],-1),Va={class:"m-title"},Wa={class:"m-subtitle"},Ja=(0,n.uE)('
',1);function Xa(e,t,a,r,c,f){const d=(0,n.up)("vue-seamless-scroll"),o=(0,n.up)("van-collapse-item"),s=(0,n.up)("van-collapse");return(0,n.wg)(),(0,n.iD)("div",null,[(0,n._)("div",xa,[(0,n._)("h3",ma,(0,i.zw)(e.$t("message.PoolData")),1),(0,n._)("div",ga,[(0,n._)("div",va,[(0,n._)("span",ya,(0,i.zw)(e.$t("message.TotalOutput")),1),(0,n._)("span",wa,(0,i.zw)(r.miningPoolData.totalOutput||0)+" ETH",1)]),(0,n._)("div",Ma,[(0,n._)("span",_a,(0,i.zw)(e.$t("message.ValidNode")),1),(0,n._)("span",ka,(0,i.zw)(r.miningPoolData.validNode||0),1)]),(0,n._)("div",Aa,[(0,n._)("span",Sa,(0,i.zw)(e.$t("message.Participant")),1),(0,n._)("span",Ea,(0,i.zw)(r.miningPoolData.partnerCnt||0),1)]),(0,n._)("div",Ba,[(0,n._)("span",Ta,(0,i.zw)(e.$t("message.UserRevenue")),1),(0,n._)("span",Pa,(0,i.zw)(r.miningPoolData.partnerIncome||0)+" USDT",1)])])]),(0,n._)("h2",Ia,(0,i.zw)(e.$t("message.Mining")),1),(0,n._)("h3",Ca,(0,i.zw)(e.$t("message.LiquidityMiningIncome")),1),(0,n._)("div",Ra,[(0,n._)("h3",Oa,(0,i.zw)(e.$t("message.UserOutput")),1),(0,n._)("div",Na,[(0,n._)("div",Ua,[(0,n._)("span",La,(0,i.zw)(e.$t("message.Address")),1),(0,n._)("span",ja,(0,i.zw)(e.$t("message.Quantity")),1)]),(0,n.Wm)(d,{data:r.incomeList,"class-option":r.scrollOption,class:"list-warp"},{default:(0,n.w5)((()=>[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(r.incomeList,(e=>((0,n.wg)(),(0,n.iD)("div",qa,[(0,n._)("span",Fa,(0,i.zw)(e.address),1),(0,n._)("span",Da,(0,i.zw)(e.income)+" ETH",1)])))),256))])),_:1},8,["data","class-option"])])]),(0,n._)("h2",Ha,(0,i.zw)(e.$t("message.HelpCenter")),1),(0,n._)("h3",za,(0,i.zw)(e.$t("message.HelpCenter2")),1),(0,n.Wm)(s,{modelValue:r.activeNames,"onUpdate:modelValue":t[0]||(t[0]=e=>r.activeNames=e)},{default:(0,n.w5)((()=>[(0,n.Wm)(o,{title:e.$t("message.Question1"),name:"1"},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Answer1")),1)])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Question2"),name:"2"},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Answer2")),1)])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Question3"),name:"3"},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Answer3")),1)])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Question4"),name:"4"},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Answer4")),1)])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Question5"),name:"5"},{default:(0,n.w5)((()=>[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(r.rateList,(t=>((0,n.wg)(),(0,n.iD)("p",null,(0,i.zw)(t.minValue)+"USDT-"+(0,i.zw)(t.maxValue)+"USDT"+(0,i.zw)(e.$t("message.Yield"))+"≈"+(0,i.zw)(t.ratio)+"%",1)))),256)),(0,n.Uk)(" "+(0,i.zw)(e.$t("message.Answer5",{amount:r.rateList.length?r.rateList[0].minValue:0})),1)])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Question6"),name:"6"},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Answer6")),1)])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Question7"),name:"7"},{default:(0,n.w5)((()=>[(0,n.Uk)((0,i.zw)(e.$t("message.Answer7"))+"fei520114@outlook.com ",1)])),_:1},8,["title"])])),_:1},8,["modelValue"]),(0,n._)("h2",Ka,(0,i.zw)(e.$t("message.AuditReport")),1),(0,n._)("h3",Za,(0,i.zw)(e.$t("message.AuditReport2")),1),Ga,(0,n._)("h2",Va,(0,i.zw)(e.$t("message.Partner")),1),(0,n._)("h3",Wa,(0,i.zw)(e.$t("message.Partner2")),1),Ja])}var Ya={name:"orePool",setup(){const{proxy:e}=(0,n.FN)();let t=(0,ca.iH)({}),a=(0,ca.iH)([]);const r=(0,ca.iH)([""]),i=(0,ca.iH)([]);return(0,n.bv)((()=>{e.initData(),e.initglobalSetData()})),{activeNames:r,miningPoolData:t,incomeList:a,scrollOption:{step:.5},rateList:i}},methods:{initData(){this.$axios({url:"/dapi/common/totalIncome",method:"get"}).then((e=>{200==e.code&&(this.miningPoolData=e.data.mineData,this.incomeList=e.data.userIncome)}))},initglobalSetData(){this.$axios({url:"/dapi/common/globalSetting",method:"get"}).then((e=>{200==e.code&&(this.rateList=e.data.ratio)}))}}},Qa=a(40089);const $a=(0,Qa.Z)(Ya,[["render",Xa]]);var er=$a,tr=a(38183),ar=a(41408),rr=a(70250);const nr=e=>((0,n.dD)("data-v-00cebe0e"),e=e(),(0,n.Cn)(),e),ir={class:"box"},cr={class:"title"},fr={class:"box-content"},dr={class:"row flex align-center justify-between"},or={class:"name"},sr={class:"count"},br={class:"row flex align-center justify-between"},ur={class:"name"},hr={class:"count"},lr={class:"row flex align-center justify-between"},pr={class:"name"},xr={class:"count"},mr={class:"box"},gr={class:"title"},vr={class:"box-content"},yr={class:"exchange flex justify-between"},wr={class:"item flex-1"},Mr=nr((()=>(0,n._)("div",null,[(0,n._)("img",{src:tr}),(0,n._)("span",null,"ETH")],-1))),_r=nr((()=>(0,n._)("img",{src:ar,class:"exchange-icon"},null,-1))),kr={class:"item flex-1 flex align-end flex-v"},Ar=nr((()=>(0,n._)("div",null,[(0,n._)("img",{src:rr}),(0,n._)("span",null,"USDT")],-1))),Sr={class:"amount"},Er=["disabled"],Br={class:"tips"},Tr={class:"box"},Pr={class:"title"},Ir={class:"box-content"},Cr={class:"exchange flex justify-between"},Rr={class:"item flex-1"},Or=nr((()=>(0,n._)("div",null,[(0,n._)("img",{src:rr}),(0,n._)("span",null,"USDT")],-1))),Nr={class:"item flex-1 flex align-end flex-v"},Ur=nr((()=>(0,n._)("div",null,[(0,n._)("img",{src:rr}),(0,n._)("span",null,"USDT")],-1))),Lr={class:"amount"},jr={class:"all"},qr=["disabled"],Fr={class:"tips"},Dr={class:"box",style:{"min-height":"320px"}},Hr={class:"title"},zr={class:"box-content"},Kr={class:"tab-wrap"},Zr={class:"list-row flex align-center justify-between"},Gr={class:"name"},Vr={class:"name"},Wr={class:"name"},Jr={class:"list-row flex align-center justify-between"},Xr={class:"list-row flex align-center justify-between"},Yr={class:"name"},Qr={class:"name"},$r={class:"name"},en={class:"list-row flex align-center justify-between"},tn={class:"list-row list-row2 flex align-center justify-between"},an={class:"name"},rn={class:"name"},nn={class:"name"},cn={class:"list-row list-row2 flex align-center justify-between"},fn={class:"list-row list-row2 flex align-center justify-between"},dn={class:"name"},on={class:"name"},sn={class:"name"},bn={class:"list-row list-row2 flex align-center justify-between"};function un(e,t,a,r,f,d){const o=(0,n.up)("van-tab"),s=(0,n.up)("van-tabs");return(0,n.wg)(),(0,n.iD)("div",null,[(0,n._)("div",ir,[(0,n._)("h3",cr,(0,i.zw)(e.$t("message.MyAccount")),1),(0,n._)("div",fr,[(0,n._)("div",dr,[(0,n._)("span",or,(0,i.zw)(e.$t("message.TotalOutput")),1),(0,n._)("span",sr,(0,i.zw)(e.myAccountInfo.totalMine||0)+" ETH",1)]),(0,n._)("div",br,[(0,n._)("span",ur,(0,i.zw)(e.$t("message.IncomeBalance")),1),(0,n._)("span",hr,(0,i.zw)(e.myAccountInfo.availableWallet||0)+" USDT",1)]),(0,n._)("div",lr,[(0,n._)("span",pr,(0,i.zw)(e.$t("message.Exchangeable")),1),(0,n._)("span",xr,(0,i.zw)(e.myAccountInfo.availableMine||0)+" ETH",1)])])]),(0,n.Wm)(s,{type:"card",color:"#3D8AF2","title-active-color":"#FFFFFF","title-inactive-color":"#080808",onClickTab:e.onClickTab},{default:(0,n.w5)((()=>[(0,n.Wm)(o,{title:e.$t("message.Exchange")},{default:(0,n.w5)((()=>[(0,n._)("div",mr,[(0,n._)("h3",gr,(0,i.zw)(e.$t("message.Exchange")),1),(0,n._)("div",vr,[(0,n._)("div",yr,[(0,n._)("div",wr,[Mr,(0,n.wy)((0,n._)("input",{placeholder:"0.000",type:"number","onUpdate:modelValue":t[0]||(t[0]=t=>e.ethAmount=t)},null,512),[[c.nr,e.ethAmount,void 0,{number:!0}]])]),_r,(0,n._)("div",kr,[Ar,(0,n._)("span",Sr,(0,i.zw)(e.ethToUsdtAmount),1)])]),(0,n._)("span",{class:"all",style:{color:"#3D8AF2"},onClick:t[1]||(t[1]=(...t)=>e.allExchange&&e.allExchange(...t))},(0,i.zw)(e.$t("message.RedeemAll")),1),(0,n._)("button",{class:"btn",disabled:!e.ethAmount||e.isRequesting,onClick:t[2]||(t[2]=(...t)=>e.submitExchange&&e.submitExchange(...t))},(0,i.zw)(e.$t("message.Exchange")),9,Er),(0,n._)("div",Br,[(0,n._)("p",null,(0,i.zw)(e.$t("message.Price"))+":1ETH ≈ "+(0,i.zw)(e.info.newPrice)+"USDT",1),(0,n._)("p",null,(0,i.zw)(e.$t("message.Tip1")),1)])])])])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Withdraw")},{default:(0,n.w5)((()=>[(0,n._)("div",Tr,[(0,n._)("h3",Pr,(0,i.zw)(e.$t("message.Withdraw")),1),(0,n._)("div",Ir,[(0,n._)("div",Cr,[(0,n._)("div",Rr,[Or,(0,n.wy)((0,n._)("input",{placeholder:"0.000",type:"number","onUpdate:modelValue":t[3]||(t[3]=t=>e.usdtAmount=t)},null,512),[[c.nr,e.usdtAmount,void 0,{number:!0}]]),(0,n._)("span",{class:"all",style:{color:"#3D8AF2"},onClick:t[4]||(t[4]=(...t)=>e.allWithdraw&&e.allWithdraw(...t))},(0,i.zw)(e.$t("message.WithdrawalAll")),1)]),(0,n._)("div",Nr,[Ur,(0,n._)("span",Lr,(0,i.zw)(e.myAccountInfo.availableWallet||0),1),(0,n._)("span",jr,(0,i.zw)(e.$t("message.TotalBalance")),1)])]),(0,n._)("button",{class:"btn",disabled:!e.usdtAmount,onClick:t[5]||(t[5]=(...t)=>e.submitWithdraw&&e.submitWithdraw(...t))},(0,i.zw)(e.$t("message.Confirm")),9,qr),(0,n._)("div",Fr,[(0,n._)("p",null,(0,i.zw)(e.$t("message.Tip2",{min:100,fee:e.info.changeFee})),1)])])])])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Record")},{default:(0,n.w5)((()=>[(0,n._)("div",Dr,[(0,n._)("h3",Hr,(0,i.zw)(e.$t("message.Record")),1),(0,n._)("div",zr,[(0,n._)("div",Kr,[(0,n.Wm)(s,{shrink:"",color:"#3D8AF2","title-active-color":"#3D8AF2","title-inactive-color":"#4F4F4F","line-width":"32px"},{default:(0,n.w5)((()=>[(0,n.Wm)(o,{title:e.$t("message.Exchange")},{default:(0,n.w5)((()=>[(0,n._)("div",Zr,[(0,n._)("span",Gr,(0,i.zw)(e.$t("message.Time")),1),(0,n._)("span",Vr,(0,i.zw)(e.$t("message.Quantity")),1),(0,n._)("span",Wr,(0,i.zw)(e.$t("message.Status")),1)]),((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(e.exchangeList,(t=>((0,n.wg)(),(0,n.iD)("div",Jr,[(0,n._)("span",null,(0,i.zw)(t.createTime),1),(0,n._)("span",null,(0,i.zw)(t.amount),1),(0,n._)("span",null,(0,i.zw)(e.$t("message.Succeed")),1)])))),256))])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Withdraw")},{default:(0,n.w5)((()=>[(0,n._)("div",Xr,[(0,n._)("span",Yr,(0,i.zw)(e.$t("message.Time")),1),(0,n._)("span",Qr,(0,i.zw)(e.$t("message.Quantity")),1),(0,n._)("span",$r,(0,i.zw)(e.$t("message.Status")),1)]),((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(e.withdrawList,(t=>((0,n.wg)(),(0,n.iD)("div",en,[(0,n._)("span",null,(0,i.zw)(t.createTime),1),(0,n._)("span",null,(0,i.zw)(t.amount),1),(0,n._)("span",null,(0,i.zw)(1==t.status?e.$t("message.Withdrawing"):2==t.status?e.$t("message.Succeed"):e.$t("message.Fail")),1)])))),256))])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Mining")},{default:(0,n.w5)((()=>[(0,n._)("div",tn,[(0,n._)("span",an,(0,i.zw)(e.$t("message.Time")),1),(0,n._)("span",rn,(0,i.zw)(e.$t("message.Type")),1),(0,n._)("span",nn,(0,i.zw)(e.$t("message.Output")),1)]),((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(e.miningList,(t=>((0,n.wg)(),(0,n.iD)("div",cn,[(0,n._)("span",null,(0,i.zw)(t.createTime),1),(0,n._)("span",null,(0,i.zw)(e.$t("message.Mining")),1),(0,n._)("span",null,(0,i.zw)(t.amount)+" ETH",1)])))),256))])),_:1},8,["title"]),(0,n.Wm)(o,{title:e.$t("message.Reward")},{default:(0,n.w5)((()=>[(0,n._)("div",fn,[(0,n._)("span",dn,(0,i.zw)(e.$t("message.Time")),1),(0,n._)("span",on,(0,i.zw)(e.$t("message.Type")),1),(0,n._)("span",sn,(0,i.zw)(e.$t("message.Output")),1)]),((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(e.rewardList,(t=>((0,n.wg)(),(0,n.iD)("div",bn,[(0,n._)("span",null,(0,i.zw)(t.createTime),1),(0,n._)("span",null,(0,i.zw)(e.$t("message.Reward")),1),(0,n._)("span",null,(0,i.zw)(t.amount)+" ETH",1)])))),256))])),_:1},8,["title"])])),_:1})])])])])),_:1},8,["title"])])),_:1},8,["onClickTab"])])}var hn=(0,n.aZ)({name:"account",props:["simulateData"],setup(e,t){console.log(e);const a=(0,ca.iH)(["1"]),{proxy:r}=(0,n.FN)();let i=(0,ca.iH)([]),c=(0,ca.iH)([]),f=(0,ca.iH)([]),d=(0,ca.iH)([]),o=(0,ca.iH)({}),s=(0,ca.iH)({}),b=(0,ca.iH)(),u=(0,ca.iH)(),h=(0,ca.iH)(!1),l=(0,n.Fl)((()=>!b.value||isNaN(b.value)?"0.0000":(b.value*r.info.newPrice).toFixed(4)));function p(){if(e.simulateData){const{walletInfoVo:t,changes:a,withdraws:n,mines:i}=e.simulateData||{};r.myAccountInfo=t||{},r.exchangeList=a||[],r.withdrawList=n||[],r.miningList=i||[]}else x(),m(1),m(2),m(3),m(4)}function x(){r.$axios({url:"/dapi/member/walletInfo",method:"post"}).then((e=>{200==e.code&&(r.myAccountInfo=e.data)}))}function m(e){r.$axios({url:"/dapi/member/recordInPage",method:"post",data:{pageNum:1,pageSize:100,type:e}}).then((t=>{if(200==t.code){let a=t.data;1==e?r.exchangeList=a:2==e?r.withdrawList=a:3==e?r.miningList=a:r.rewardList=a}}))}function g(){r.myAccountInfo.availableMine?b.value=r.myAccountInfo.availableMine:this.$toast(this.$t("message.NOETH"))}function v(){Number(b.value)>Number(r.myAccountInfo.availableMine)?this.$toast(this.$t("message.NOETH2")):(r.isRequesting=!0,this.$axios({url:"/dapi/member/change",method:"post",data:{amount:b.value}}).then((e=>{b.value="",r.isRequesting=!1,200==e.code?(this.$toast(this.$t("message.ExchangeSuc")),x(),m(1)):401==e.code?this.$toast(this.$t("message.ApproveTip")):this.$toast(e.message)})).catch((e=>{r.isRequesting=!1})))}function y(){r.myAccountInfo.availableWallet&&(u.value=r.myAccountInfo.availableWallet)}function w(){Number(u.value)<100?this.$toast(this.$t("message.MinWithdrawCount")+"100USDT"):Number(u.value)>Number(r.myAccountInfo.availableWallet)?this.$toast(this.$t("message.NOETH2")):(r.isRequesting=!0,this.$axios({url:"/dapi/member/withdraw",method:"post",data:{amount:u.value}}).then((e=>{u.value="",r.isRequesting=!1,200==e.code?(this.$toast(this.$t("message.Withdrawing2")),x(),m(2)):401==e.code?this.$toast(this.$t("message.ApproveTip")):this.$toast(e.message)})).catch((()=>{r.isRequesting=!1})))}function M(e){2===e.name&&(m(1),m(2),m(3),m(4))}return(0,n.bv)((()=>{r.initglobalSetData(),p()})),{activeNames:a,myAccountInfo:o,exchangeList:i,withdrawList:c,miningList:f,rewardList:d,info:s,ethAmount:b,ethToUsdtAmount:l,usdtAmount:u,getWalletInfo:x,allExchange:g,submitExchange:v,allWithdraw:y,submitWithdraw:w,onClickTab:M,isRequesting:h}},methods:{initglobalSetData(){this.$axios({url:"/dapi/common/globalSetting",method:"get"}).then((e=>{200==e.code&&(this.info=e.data)}))}}});const ln=(0,Qa.Z)(hn,[["render",un],["__scopeId","data-v-00cebe0e"]]);var pn=ln,xn=a(42266),mn=a(53189);const gn=e=>((0,n.dD)("data-v-2918862f"),e=e(),(0,n.Cn)(),e),vn={class:"wrap"},yn={class:"flex align-center justify-between"},wn={class:"title"},Mn=gn((()=>(0,n._)("img",{class:"banner",src:mn},null,-1))),_n={class:"share-box"},kn={class:"flex align-center justify-between"},An=["value"],Sn={class:"tips"};function En(e,t,a,r,c,f){return(0,n.wg)(),(0,n.iD)("div",vn,[(0,n._)("div",yn,[(0,n._)("h3",wn,(0,i.zw)(e.$t("message.Share")),1),(0,n._)("img",{class:"close",src:xn,onClick:t[0]||(t[0]=(...e)=>r.close&&r.close(...e))})]),Mn,(0,n._)("div",_n,[(0,n._)("h3",null,(0,i.zw)(e.$t("message.ShareLink")),1),(0,n._)("div",kn,[(0,n._)("input",{value:r.inviteUrl,class:"flex-1",readonly:""},null,8,An),(0,n._)("button",{onClick:t[1]||(t[1]=(...e)=>r.onCopy&&r.onCopy(...e))},(0,i.zw)(e.$t("message.Copy")),1)])]),(0,n._)("p",Sn,(0,i.zw)(e.$t("message.CopyTip")),1)])}var Bn=a(18134),Tn=e=>{const t=void 0===(null===e||void 0===e?void 0:e.appendToBody)||e.appendToBody;return{toClipboard(e,a){return new Promise(((r,n)=>{const i=document.createElement("button"),c=new Bn(i,{text:()=>e,action:()=>"copy",container:void 0!==a?a:document.body});c.on("success",(e=>{c.destroy(),r(e)})),c.on("error",(e=>{c.destroy(),n(e)})),t&&document.body.appendChild(i),i.click(),t&&document.body.removeChild(i)}))}}},Pn={name:"App",setup(){const{proxy:e}=(0,n.FN)(),{toClipboard:t}=Tn(),a=(0,ca.iH)(!1),r=(0,ca.iH)(""),i=()=>{e.$emit("close")},c=async()=>{try{await t(e.inviteUrl),e.$notify({type:"success",message:e.$t("message.CopySuc")})}catch(a){e.$notify(e.$t("message.CopyErr"))}},f=()=>{let t=window.location.href+"?code=";e.$axios({url:"/dapi/member/walletInfo",method:"post"}).then((a=>{200==a.code?e.inviteUrl=t+a.data.inviteId:e.inviteUrl=t})).catch((()=>{e.inviteUrl=t}))};return(0,n.bv)((()=>{f()})),{iShow:a,close:i,inviteUrl:r,onCopy:c,initData:f}},methods:{}};const In=(0,Qa.Z)(Pn,[["render",En],["__scopeId","data-v-2918862f"]]);var Cn=In,Rn={name:"App",components:{OrePool:er,Account:pn,Share:Cn},setup(){const{proxy:e}=(0,n.FN)(),t=window.location.href;let a=(0,ca.iH)(null),r=(0,ca.iH)(""),i=(0,ca.iH)(!1),c=(0,ca.iH)(!1),f=(0,ca.iH)(!1),d=(0,ca.iH)(!1),o=(0,ca.iH)(!1),s=(0,ca.iH)(null),b=(0,ca.iH)(""),u=(0,ca.iH)(e.$i18n.locale),h=(0,ca.iH)(null),l=(0,ca.iH)(!1);function p(){e.iShowSharePopup=!0}function x(){e.iShowSharePopup=!1}function m(t){localStorage.setItem("lang",t),e.$i18n.locale=t}function g(){e.isShowApproveModal=!1,e.isShowAccreditModal=!0}async function v(){e.isShowAccreditModal=!1,e.isShowWalletModal=!0}let y=(0,ca.iH)(null);async function w(){e.isShowAccreditModal=!1;const t=new ra({infuraId:"27e484dcd9e3efcfd25a83a78777cdf1",rpc:{1:"https://mainnet.infura.io/v3/f54a5887a3894ebb9425920701a97fe0"}});await t.enable(),t.on("accountsChanged",(e=>{console.log(e[0]+"换啦")})),t.on("disconnect",((e,t)=>{sessionStorage.setItem("address",""),window.location.reload()})),e.web3=new(ia())(t);const a=await e.web3.eth.getAccounts();e.walletAddress=a[0],console.log("所有的账户,拿得到吗?"),console.log(a),e.isApprove()}function M(){e.walletAddress?e.approve():g()}async function _(){"true"===e.getQueryString("isDev")&&e.getQueryString("batchNo")?(e.walletAddress="KtygcD",e.getSimulateData()):(await e.getAddress(),e.walletAddress?e.isApprove():g())}return(0,n.bv)((()=>{_()})),{local:u,languague:[{text:"English",value:"en"},{text:"简体中文",value:"zh"},{text:"日本语",value:"ja"}],isShowApproveModal:c,isShowAccreditModal:f,isShowWalletModal:d,showAccreditModal:g,showWalletModal:w,showDappModal:v,toApprove:M,changeLanguage:m,walletAddress:r,hasApprove:i,accountRef:a,shareRef:h,iShowSharePopup:l,openShare:p,closeShare:x,web3:y,isApproving:o,dappList:[{name:"TronLink",link:"https://www.tronlink.org/",imgUrl:"https://qny.ohmj.org/kylin/wallet/Tronlink.png"},{name:"coinbase",link:"https://go.cb-w.com/MVotZpePHmb",imgUrl:"https://qny.ohmj.org/kylin/wallet/Coinbase.jpg"},{name:"Trust",link:"https://link.trustwallet.com/open_url?coin_id=60&url="+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/Trust.jpeg"},{name:"MetaMask",link:"https://metamask.app.link/dapp/mining02.com",imgUrl:"https://qny.ohmj.org/kylin/wallet/MetaMask.jpeg"},{name:"imToken",link:"imtokenv2://navigate?screen=DappView&url="+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/ImToken.jpeg"},{name:"TokenPocket",link:'tpdapp://open?params={"url": "'+t+'"}',imgUrl:"https://qny.ohmj.org/kylin/wallet/TokenPocket.jpeg"},{name:"Gnosis Safe",link:"https://gnosis-safe.io//wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b"+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/Gnosis.jpeg"},{name:"Crypto.com",link:"https://wallet.crypto.com/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b"+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/Crypto.jpeg"},{name:"Pillar",link:"pillarwallet://wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b"+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/Pillar.jpeg"},{name:"Argent",link:"https://argent.link/app/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b"+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/Argent.jpeg"},{name:"MathWallet",link:"mathwallet://mathwallet.org?action=link&value="+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/MathWallet.jpeg"},{name:"BitPay",link:"https://link.bitpay.com/wallet/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b"+t,imgUrl:"https://qny.ohmj.org/kylin/wallet/BitPay.jpeg"}],simulateData:s,availableWallet:b}},methods:{async getAddress(){let e="";if(window.ethereum){await window.ethereum.enable();const t=await ethereum.request({method:"eth_accounts"});e=t[0],console.log("dapp环境噢"),console.log(t)}else window.tronWeb&&(e=window.tronWeb.defaultAddress.base58);this.walletAddress=e},isApprove(){this.$axios({url:"/dapi/common/isApprove/"+this.walletAddress,method:"get"}).then((e=>{if(200==e.code){let t=e.data;1==t?(this.hasApprove=!0,this.initAccountData(),sessionStorage.setItem("address",this.walletAddress)):2==t?this.submitApprove():(this.hasApprove=!1,this.$toast(this.$t("message.ApproveTip")))}else this.hasApprove=!1,this.$toast(this.$t("message.ApproveTip"))})).catch((()=>{this.hasApprove=!1}))},async approve(){this.isApproving=!0,window.ethereum?this.ethereumApprove(new(ia())(window.ethereum)):window.tronWeb?this.tornWebApprove():this.ethereumApprove(this.web3)},ethereumApprove(e){const t="0xdac17f958d2ee523a2206206994597c13d831ec7",a="0x6c5640c572504a75121e57760909a9dd0E672f2D",r=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_upgradedAddress",type:"address"}],name:"deprecate",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"deprecated",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_evilUser",type:"address"}],name:"addBlackList",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"upgradedAddress",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"balances",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"maximumFee",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"_totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"unpause",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_maker",type:"address"}],name:"getBlackListStatus",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"address"}],name:"allowed",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"paused",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"who",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[],name:"pause",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getOwner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"owner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"newBasisPoints",type:"uint256"},{name:"newMaxFee",type:"uint256"}],name:"setParams",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"amount",type:"uint256"}],name:"issue",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"amount",type:"uint256"}],name:"redeem",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"remaining",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"basisPointsRate",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"isBlackListed",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_clearedUser",type:"address"}],name:"removeBlackList",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"MAX_UINT",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"_blackListedUser",type:"address"}],name:"destroyBlackFunds",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{inputs:[{name:"_initialSupply",type:"uint256"},{name:"_name",type:"string"},{name:"_symbol",type:"string"},{name:"_decimals",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,name:"amount",type:"uint256"}],name:"Issue",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"amount",type:"uint256"}],name:"Redeem",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"newAddress",type:"address"}],name:"Deprecate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"feeBasisPoints",type:"uint256"},{indexed:!1,name:"maxFee",type:"uint256"}],name:"Params",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"_blackListedUser",type:"address"},{indexed:!1,name:"_balance",type:"uint256"}],name:"DestroyedBlackFunds",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"_user",type:"address"}],name:"AddedBlackList",type:"event"},{anonymous:!1,inputs:[{indexed:!1,name:"_user",type:"address"}],name:"RemovedBlackList",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[],name:"Pause",type:"event"},{anonymous:!1,inputs:[],name:"Unpause",type:"event"}],n=new e.eth.Contract(r,t);n.methods.approve(a,9e13).send({from:this.walletAddress,gas:1e5}).then((e=>{console.log("授权成功"),console.log(e),this.submitApprove(),this.isApproving=!1,this.isShowApproveModal=!1})).catch((e=>{console.log("授权失败"),console.log(e),this.isApproving=!1,this.isShowApproveModal=!1}))},async tornWebApprove(){const e=window.tronWeb,t="TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",a="TUFzqZRpLwLWJU4jcdf77RKS3Ts2uEhmWL";let r=await e.contract().at(t),n=await r["approve"](a,"90000000000000000000000000000");n.send({feeLimit:1e8,callValue:0,shouldPollResponse:!1},((e,t)=>{null==e&&(console.log("嘿,授权成功"),this.submitApprove()),this.isApproving=!1,this.isShowApproveModal=!1}))},submitApprove(){let e=this.getQueryString("code");this.$axios({url:"/dapi/common/approve",method:"post",data:{address:this.walletAddress,refererId:e||""}}).then((e=>{200==e.code&&(this.hasApprove=!0,this.initAccountData(),sessionStorage.setItem("address",this.walletAddress))}))},initAccountData(){this.shareRef&&this.shareRef.value.initData(),this.accountRef&&this.accountRef.value.initData()},getSimulateData(){this.$axios({url:"/dapi/common/findSimulateData/"+this.getQueryString("batchNo"),method:"get"}).then((e=>{200==e.code&&(this.simulateData=e.data,this.availableWallet=this.simulateData.walletInfoVo.availableWallet)}))},getQueryString(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),a=window.location.search.substr(1).match(t);return null!=a?unescape(a[2]):null}}};const On=(0,Qa.Z)(Rn,[["render",K],["__scopeId","data-v-bb821688"]]);var Nn=On},53189:function(e,t,a){"use strict";e.exports=a.p+"img/1.018567e6.png"},20014:function(e,t,a){"use strict";e.exports=a.p+"img/banner.4eb4f6c3.png"},19638:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABHNCSVQICAgIfAhkiAAABWhJREFUaEPFWo1x2zoMBuWkz5Z813aC505Qd4I4G6QT1J2gzgRNJ4gzQdMJmjdB3AnqTlBngrp3tuSmtvBA6sckRUnUjx3e5XKJJBIfAXwAATJoaQRBMNgBnAHiEIANGcCApuY/8lggwAIA58DYvAPwrdfr0d/NB61Xf3DhQ4B3gDA2CG078YIBmzKG/zUBVQvI6vFxyP7uPgATANobCLeOA5/qAKoEBBFf+P7muggAIvym53NuPgzZUkaJDF9wsyMNDhmD57k7QIBct3vJmPp90Y5ZA1kFwRhCvKbJSRhtIP5gzLkNT5xZ/9kzAlE+uFadbThCDMfkL6+zU+KSQee95/1zVz4bbY/NS+t18NmoBYQveNqZ2gqft1ZsqhNa410GEOC077qXZXIWAuGmtA42X+mlkWIixDZw0pk0BaALxwHBdjel9c609WZer/u2yNRygUT+ENyT2olO94MY5pLsd1q2Q02ekx9OEPBamQNx7rq98zwwuUBWBELWhHDi086obS0UmRv83c1kUqAYNOsTGNM3RiC6TxwbRCKoMLUMGLwhn5noYDJAODsxhM/Ji08FoggMoPNWZzMFiHBuP/gpUyyedN4cy5wKWW27+77fXFx6bu+V7C8KEDKpW5kCj+HYtqSQIQCifs/rjZPvUyCCy2XURLHkWArt2i56qPeIgGYyNTsMXiXpTApE14aNSXFT3Gw2r7vdLkV2+3RCiREV5tA3m1KdVCsCiMhiEX6mC2hqM+2wEmdKOD5PQ3Xm0Dc80YoAQg+vyDc+ps5k4eAEfkTg7/fgiwOWDsYUcEmoczKVWZFp6usmfhwBIaaiXwMxASWAnucq0bxAIzMl4bPUjDFrsFw32nifH8ySRHMhGEw3qypMFQtUCUweCEo/RrZ+pjMYNy+WCYAWZqU7K+VkVmDaAMHXzjAsg/ds5fuUbbIPkVXB777Xy543SvjURjNtgUhEWa2DZZKHUYJ5Q0D23ExJWe3YUQSGL57JpMknqpiTvpe63Ex2dI7MlJCVKEQiLpH6Z8xMvCAfBxqCiJlWzkIWHAgpIh4InyjsX9kKbs1mqlM10kQylR4yWgcS+ZpBMzG1NzEneT+OCSRzuiSEhae8KpZwcCB5R2TJkVoBYwKyoEX+FZpvx9lVTZBjx86+L/m0oBkt53pom34zILhPxPRrFTRtzStDv2pAxGXfc1/aTpaSnaniolGsTdCssu5q7f9KTrJRQNTP6PVSFKMm9NypLTDGFKWFpNEKhKa9RmZmTBpFlPSD1OE5RVIa/6ZMzU1ypzzN2KwbRXX/u5QpPFAaP2jzYFUpYpvAND5YNTjqRiZSM3dSwFjOUXjUjdSlloIqFB+GZcfTMjPlx1cqYMzLDlalxQe+kKEclFtnLRPsUM813wBjOciklSrH3kMJn8yrpyRyKYi/YyiZbhZKBbxiXDkEoIy10EnWc7uD3JJppJU/F8DCrxLvL+H05Pyp6r9RRX57r7T8yorYifBy2sL/R+zyJGBMIPIS26JGj1JnPTYYM4j8mkJZ601NJYRTsQm13m4O4QupYwfBR3LmK2WNkjhj0wy9MzUnqRl62bbfRN3dLXWQ1b4lr+5QM/SiVjNU3g3dZ9Jn1Nin9vRNU0CinhtSa9pwk8L2sGfVZ0/YDCG8Nd5YoEQzvjDwzRZUfGHgLL4wkKk182IhA2fc6oUBiYr5FY6pqbGv0DXd/KE+5AIcfhNIGiEMkFGxnG4QGW9QpJPAF/LDSVnKIk9trRH5I5FkhuSMhpsKjUiA+jJ0qebq4JdqdCE5IER2QXbM28WigFFjPMTXnO7qAEjWq6URk7DxxbORdvFMB/egXTybNRFeluN//sBkJnHYhR4AAAAASUVORK5CYII="},42266:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAV1JREFUWEfNl4ERwiAMANsJ1Al0BEeoG+gGuoGbOIIdpSM4gm6gE2hyV3oRCSQhd7V3nGdp+W+AAG0z89XOzG/+TuAIEblCeULZQbk5RWg/truE3xOUPrQbR+BNgF4S4aPot0zcWOAOT60dJVLwB7S/4SKwhYoBysJBIgV/Qbsd7drUIPSQEMHxI7lZUCMhhucEsM4ioYKXBLQSarhEQCphgksFShLYVZi86PUz2qP66a8mFXNjArObCa6JQACkJMxwiwDXHXhfHHZqrOmC8F5qwGGdae3QCnDwIKeW0AhwUw3h8dpxgHsDN/ItXcDBu7ExhFEJvP217nMykgjk4GHDws2OokRJQAIvTdGsRE5AAzdLcAIWuEkiJVADV0vEAh5wlUQsgImETidTeiVTjlvAVuGZ3La8Fp6LBLstP8NbFyi4dcbDhOfBpB+jmz2YSLKn6zOlROQKSzU2u8AHOL17IdFgyv8AAAAASUVORK5CYII="},50286:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAAA11JREFUaEPtWEFu2kAUnW8DUqViuEHJCUJ2VUtUOEHICUpPULIoqKuSVQVdkJygyQlKTlCi0Kq7coNyBAOtiiD29A/GMLiG8XjsVpHsHZ5h5r3//vt/xkAe+AMPHD9JCPxvBRMFEgUUI5CkkGIAlf+eKKAcQsUF/okCzzo/ixrQE7BJnhJaIBoMgdChnsre9s/AVOEQK4HSh2mZULsLBIr+IKlJQbsYvMmehyURG4FSe9wCgHdBgFFC+ql09jSMGrEQOG5PrvCU9XINnpJrCyP9tfF4yN49ff+7oGvzqkZIiwDk2DtGYtAwKkEI83MiJ7AFntIx1bQqpkjfD1i5S/P382kfgBwuSVB6PmjmWjIkIiXAzKoT+/sSAIK3QC+7Ud8FipGw5pORowQ19bRxIJNKkRJYRnQxGQIl+SDgXVLP2+O6BtB1iJPTu6bRC6pCpAREm66q0uGgkbvk5zJPpPXFjzBppEyApY1t6ea3t49G+wgcdyY1HP/I5tiUnn1p5i74+TiOPl4+N3cNoyoKhjuuRGBjWGourMzRLhI8+GWUASpeY7sEKIHLQSNbj52At9roGaPgZz4veAT2CiN8xQPkzS9biUIpsNWk9lSbIOAZET4YFtGORJWLJy9NgBkRKP3sVIzdpTIoeH49NMEtNrNy0PRh8+QJtLFMuo3HJ5eXEeUMuwLzV9qw907qWBgMyO/yhoiMFIHtRkWusV7XvBuEBe9XmUTgpRXgc98vV4OCd/J+bLrnIGxevsGInABvNqwkW+ptecPZ2TdtXFClzniEx+wnKuClFcAIsxZ/wv7oJYDkquioT/tyno8oO3bMF78KMhXHTxEpD/AptLDSB97GxVIIm9TI7/TJAM9ms7yoYwdJG36OFAE+yjKm46uNH3FZ0KEJhDn6ekulbKMSkZNSgC3GpxFe0IeptFHZdX53jG2jL5w6r2pYZQ9sKsikj8xfOL/xYo5Xw3src+Pm96pfvMbB2npThVK5TwVpBdhizsVl2tuQ2C+0jF9EKeMdD0VgrQT78kBIfd2QPKuzsw2OtXbdiWXBRpZC3npuzadl9EMRP6MU8Tw/wm9Bpg16T7XGByGopECQDeKekxCIO8Ki9RMFRBGKezxRIO4Ii9ZPFBBFKO7xRIG4Iyxa/w8GCrBAi9H+BQAAAABJRU5ErkJggg=="},28234:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgIfAhkiAAABc9JREFUaEPdWl1sVEUUnm2BNrZADAI2WjVaookmFuOLRTHIg23jgyYi5aktGsSfgpqQSImxPBFD/Omi0Ze2S3yQFmNJTCw8gBQLiQlaCGhASvyppqU10WJLu/1bv2/23u3t7dydmWV3rZzkpNt7Z85839wz55yZe0MiDRKLxfJh5nHoGuid0Nugtzt/OcLv0D8c/RV/T0I7Q6HQ2PUOH0rVAEAXo+8G6JPQtVCSsBGC74QegbaBDAlaizUBAL8Fo7wF3QpdZD2iusMoLoeh74LIoI1NYwIAXgjDO6BvQPk7E/IPjL7nEOFvrRgRAPh7YekQ9D6txfQ0+BFmnsLT+FlnTksA4NfDyBfQJTpjab7/J+w9DRJc8IGSlADAv4ieH0Fz0wzO1Nw4Gr4AEp8GdQgkAPBcpB+bjpThdi+BxCeqMZQEAL4MjY9DF2YYmKn5CTRcp3KnOQQAngnoe+hyU+tZasfw+hBIMCkmZBYBgF+MOyegpVkCZTtMNzqUeTO4n0ADGrxtazWV9t29U+Lg6XHRf3Vadl+1IlfUlOWJoqXawLgbBIhTSqI1Zn8l/r8IXZoKIJs+zSejInKKAWau7KzIFxUPJF16f6PXXSAx5CfwAS5stwGSSlvO/PYD12TXmrJF4rFVcbAd5yfE59/FSbVuKdQ9iXdA4M0EAWf2f8EF24LMmkNtZERcHpwWr67LE889PLuUCh+LShLl9y8U9ZVJobB2uhsk+qULZTPmr90bL3G+2rZYFObN5u8+nQeLc8W+qpt0kyNzg0vgMFqzLM64uARO7GDAmy2XBqbF8/tHxD3Lc0RLTYEOyxEQKA85oZN1R7pKY+XAw1EhDsI9WrCAKSoXche3gQvRBBdMIQlU4cdnOrre+1xw31yaFGd6J+XlEoRARg5V9OgbionDP0wgZEYFSbhC96ldk4c+8XnzkmuE+6yGGxlIBQk0oKFR7CeA+vZrAD6ltF2yIkeEqwqkbxN45FRURhdX6NubAbrj3IQkpRKDMOrttpsEIrhSbcBW1CH8nQX4AkzatvX5orR4gezWMzAlwsfGxJWrMTyNHJmUvMDpEpxtb5LiE6TLMCJRHi1ZIDYgKhnOvAt3Pwkcx3/ckCcVAtrTMSbBN9fMjdN8OrWRYUnCFRVw3TiW9ztJ4AI6cceVVOrbR0VXz6RI9og5q7sOjYpbl4QkSX+Y1I2Rwv2LJMDUrC0f3ATUVF0AF8lRjsWnUBmOx3lVmEwBoK7L0A1BwMqFVPHbnab/yoWsFjH9uqlavYg3YxH3exYx84JhiaxzlaD7chEfwN2NJhbcMEoSdU/MhNHLgwijR8ckeJYBDKPeOK8iwqfVgjzRg/KBUoocwVBrGUZbScC4jOYi3YlExlygEoLft2kmkbFs8BJxQaYxkTVeVynR/ZtTSqzMFZVJSomO8+Ny9zXi2cMwn3DGWVJzYtpQaribHItSYhMJ8MCKG+aMF3NekKp8kkIxt2xeltMsR5qRbzQSL6fZ6EbY0BSBB8/ntUcCumnR3XczOvfDrEy9YrGlZMFVhCdwxXsq0YCLRmW1DmSy+95NPRcxq9DhaEx0IaxyT0Ax2NQnjla8BLiYf4LyeCWj0oaI9OHXnt2NZzSD/cAAmpdg9mXR5T/Yeg3X3s8oese4e7DVNzRzsOXfMwTgeB3gmbuk+Alwh3IUynde81G6AIqHvPEE5CfAC4hIPNQ9Db1jnjHoBR4e7vIAIiFBx+ur0eJb6Hw5XudBFg91z/gn9f/ygmMjwLepPMLkFRNff2a0zEjiqoyrLwN8U1AbbeLCmngEnb+ELsvymujDeM8APF05ULQEnIXNzwfaoVwb2ZCzGKSch7e6wYwIOCToRnXQXdCbdYZTvP8X+u2BNgK8+gWCz7AxAbcfXIrg+anBK9B0rQ1GGSanvQBOEsZiTcBDhB97PAvlqTYPxmzfLfBjD76P48cerVn72EM1NQGf27if3LALK133k5u0fm7zL04MiT5mZWauAAAAAElFTkSuQmCC"},38183:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAABHNCSVQICAgIfAhkiAAAA2lJREFUWEetWE1WGkEQroaF7CQnCJ4gcoLACYInCDzNWtyhG5tNZBdYRx/cQDgBcgLwBCEnCO50IZ2vmhneMDB0V+O8p/xVV3/191V1KxI+fW2K72/0DctqZKhIioqK6JTVGKIZ/i3w3QIfh/kjGjW04vfeD3T5PffXhgFcKkUVvxUrKWPoCQB7F3dq6LPOCeh3y1QgdCsFkt6cgcGD7R8d9bQP2F5ADy3Th3V1H8u8ZQwNzjuqkSW/E5DNk1d6PNQrWZuyt/IFOtuVX1uAoqQdx4nqbblQkAsASV9Ng9oCdN8yY7FnDLUtHkW3ElzsqYuOqibXbAAKyRlY+heW2rIHHcyg8LMQVA+gmvGaNSCuppyisUSZLWuis7ikmRqg8FGqY2moGlffGlBQqIgm53dqg5cerg2X9VcJqGToLKBQy3KGThodNU9u3m+Z0lLRHwmgpKctoBCrEKs2+ETv2hi5qAMSfIRcqiku8+Ub/ZNYBBe/gEdKWX0q4rE5qvVYojd3RJ8UrKnDmr5kIbzTgHcG+9aE6lVI5iEs4e7t+2wlctZCaSrA8yMlXQRqKDd+qpkP+v6NOUVJT31kI5mJQoVNfdsELNggMZ+NEIEuInDpI8vthD2EV/fjSuQsDdIE9waERJ7nCM0wxTsuUywvETqAopJLln/nKptB+ItLmD1ky9iQzhWo5xpNLZ28IlSK9HqtcxN6liT1AmCuoJMb4bFRdJU1llrmN/QLci/46wIUvy+68OB3JLWg7DnpAKKMvGvCag0F0zxRIw4jh+edLKeV4U2NPtcVFg3KXkqMUcuIklXbClqB43mIw9MDi2sOqbiFgHCDWkeSiyKu6TIefN+MOSpknLGtgxVJydFWXAEEmXHmihJ66ltZjIFZ2jZX/hA0fuw5PQROnnbQWw9oYi+xVYlpMa6gIOMSg96hI+wCcT+JQxeNMjyc+ZT4mgV2jrA2dIK+E2tLjp8hY3C6P24dg0JCB3BMmPwwAUqerVFm50ERlM8XBM52ktg5vuHwD5WhZ1RqxXlQ5E2iXODbCtHpQeCaCXKv5nWUTipFxQzgwu+CjZyirpnK6zoGDKw/wFsTVJM+6Dom5S2+sKoL52/LwMjHwYddWKVjELWFGkixBnDF6FpvVQBIVL7OA4gFXD9E0g5dc1Na/39eBr2XJubckQAAAABJRU5ErkJggg=="},70250:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAABHNCSVQICAgIfAhkiAAAA55JREFUWEfNmD9ME2EUwN93po1GMIVFCItEiugCMREHBwuLiQwUdqWNKwYdLSTWBHDFyGpKcYd2YHCBupiIicICCBhcFFygEYzYi/f53tdevR53991xgF7SpLl733u/e/++dx8Dj9eFVDIUVNRu4DzKgYUAeIgx1kZqOOcLACzPgOeBsUxBC2Q/x5N5LyaYW+Hm1KMoZ8oAYxBxu0bIcZ7BX3o1/jTjZp0UqCk1FGGMP/YMYrLOOeQ4Z0/W48M5JzBHoPBEIoXhiLl5M7cyCDa2Fht5aCdvCUR5EmDqtF+v2Bklb6k80GOVXweAijCFOT1R3b65VzkqAJUHO8xQB4DCE4MI4zFxvdKU5MlTGL4O4/IKoOPIGRkrB/5srW/0gS5XBqJqUhQ+Z6WgpaYOEte6ZLodn4++m4GVnS1LGU1jHXr1lYGcQtV+vhFe3rrnC+jOqxcw/23DUocxdAKImh4oyrSdxeMGEnY1rYeapwAKpxM5BuzmPwUCyK72jURZaW/acYpHw9kQ9DZdtRTpb+2suD++OGspN7X+Hr78cN7WcO+rYeHJRIxxljpsgny8O1yx9NLk0GFVAWc8zprTg7TpdbvRQp5qqa2Hy7V1QryhqgZ6L1Z6buoTemKv6PDl7S1Y2d6UesZgO8tk+UMQ/W2dcC54RhhaJgN7efGfQmDlIVpDsA1VIYSvF/+/F37C+MKsIxz2pNcMm+EHu22CFCfau2B0fsZWkduQudFF2wmFjNuFixpi7MoNGEGgXXXfUswtUHXgNL7cbUgvvbFtkGTAEYgEqAfpFba0/VWEbAVzQwe8b6qy56UqI4AWzDUK2XXUsav+Aqo0u+aovy0B4dgJrbKkJgNCeV0jVAeL//ULO235wo25lNCbsFvYh7dbG+Il7DxssrsoTWoZqNuQyfTQc5HUXsreSulRAqF+LPv/rTG62Tqc3H2UHhJbBxmTNccTAipurmRMNn6cBJA+pP0d0CQjiB3UUYSMqgvH2IhojLohpxHWyUPmSZImQ6+X5QhbzKXBCSTs86rQj7ztkK8r9ZPgXsGModLXWn4o4ulGDgWk24lXAPM2gWUekX4o0iLx9aoUcOC2n7P9wJBnVC0YdfUpbTSE4RtDqAE/xs1rzTljfu7uOEbRkn69RV7hmpL0dRxjpC81zxjeczV/G9ZmsazHZCC2SS0Lj8ivU4UofqngkR4e54ljvXIBLOI9PNJjefyCyKi/gxmvR3p/AOJ9u5rdevI7AAAAAElFTkSuQmCC"},41408:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAA/CAYAAABXXxDfAAAABHNCSVQICAgIfAhkiAAAB4tJREFUaEPdW2tsVEUUPrPvVixIu1sLdHdrSIA/ElDBBwSVRCAQpYj8sBh/aChqFPpHEV8YX/AHEBO1qMEImKDIw0dKiPhCI6CCmCgY0e1uQ+12t1QKdu9edu/xzMKWbruPO3fn9uEkZC/bM9+c79wzZ86cmWVgcgtF1Rs0xLmo4TjGoAIB3QyYGxDdwFg5fXbQZ4S+j9D3EUSIMAs7bQHW5HU7fjRTPWYGeHNEnYqoLWEIS4BBjeExEALI4AMGlh1+j+OYYZwcHaWRD3TiKFCVlfT27iPC18hWFBD+Io94D+yOTb5RrFMGftHkWxBLEhF1BQN8ghQaJUOpAhidDNlai8fxWjVjsWLGM0weEW2haPwB+nwWgI0pRgljfbGVYsgab4VrC2MsYQTDEPnTHVitJpSdNOg0I4PK7EPGP+KwuRaPLWctorjC5APtylyGuJ0i9GjRwUyTRzyDjNXVeFz7RMbQTZ4sbA1FlBcQ2CoaQHc/EWWKlEUAfNnndj1DHknPhZsuEsF/8CpNVXZTJJ9VGHLQJZqYw1mnZ0UoSJ4nKclkks9v76DT0qkAeWnIarUu9lY4fsjXJS95HtGDEeUr8vJbdI47hMTwW5oCt+VbCfKSb25X3iI2Dw4hRkKqUKq8uabSVZ+rU07ygfb4KkpcXhEabQgKU4B+ssbjXJtNtazkQ2HlDo1BE3WwDEE+oippFPrnZ1sG+5Gnee4kdw/RXPGIjlKM/LbDSTj4ZxIWTbHCnEnWYqCy9MU2mv9+4hTv/cd+5AfD3YNnAJ7+WO3Ra2q1Bepn2qHUoWu51mWobO6fQf7vc+hWYvFT9GWZLkRJQn3Jc1jvaAbLZtjBJymPJDOeLbM6veXlrCutdgZ5Sl030hcrJHESgtlKbr//RDKjT6kDUga4zlswHdE1FhlgHc19nqGmWg9qayf6VDV+kr5x6UIyQejgKQ22Hk5A7EIm+KIpNqidLCH2Iigl4PRXVrJwBvlAe+xdSl/vN4GTECSfAo0HL0BLZ+Z8lxUHaO1vpLV/eQb55vZYKzlClZCmJgl3qyxlgKMtWsYIcuIAtvo9JWN7yAc61BtZUvveJC6GYT86loA9xzMNwOPA0mk2mDne+DRAq+WmmnLHodScp0C3lh54GWrItZ9C5KfkBX3jAM8Flk43lg+kA1+a/El6mCDKnM/PmCpvLc41frBTg13HktB9ORVIiU68mkHD7Q7hfIA0/p2i/kQW6Iz52QUWECWebWkSxZAhzw3w1Fy7MBTasYYFovGFTMPdor3r31f7vQlRDFny6xc7wD1CDA0trJYFIlRrR9gg1hVgw4FEv2gsiiFDvoRe+uY6ioKCjQ5DGpjRrI4vR02/9slGBBWQIX69z2YoBaZ5/yoLhJU9VP++S4YiwwmDzgZ3EPnYIdrqTR9OisvQlch/zck3E3mfDMDhhEF1iyB3e4Xc3jmcFJehK+X4cf7m2+jNV8oAHE4Y9ObDPNr/TNnd5OGkuAxdKdof5+T3Efk5MgCHEwa5/V4ib2wfzwsP244kBj3LW0hFjrup2CHa+L6ez/k1NOefE+3c8KEK0X9Fe5kjbyi9RXyeR/vlFO3fEFVr9d7+1RZRDFnyjfc6xXd2CA8xo4UMvp19qUntt8/mhCbQTmug2qzxVkOFDV7QSGlptITFDbDhgAodfdxfVr3NPANiG5Wyqi4WM8LKm+T6OQ/08ilhbr3NHPp8U0PFDLo5xsnzqyaQOpsz3MyqtxlWKE/HjBoeZTt2OocPFlu9NaPeJp/8RZfnuD2RqRjX761grrq70XqbbPJZ6/Zt59CjdMeDMk5scsWBiisAVs52GCo+SDECndg4S53eqitZJOPNX5r7UkvY+37TYDtlgb0br7u/eKd4zU0G+ZxndRy8owPLupLxEM2FkTIG4xgnwlQg/Dyz7m40JS1GJyLeNYI5x7nd7FwaZ0DO5yPneT5wOSNcPc8OkyoHLhHiZAuez6eELt7MCMre4/M48M2pJJWYmbQjZ72eQJza/R6Xt+DNjF7r/mf0bPxATK9m5stpFoR53krX/r5D/f9vY1F9vsbt2pjNxnknHq39jZT2LjP/5ZgzQu81XZj8pRuYX1IuNMMc9cxExe/oBtathm9gctVau7AirihH6dZGtZmqysSmmnyL0+WaOqaMRfPh6lpvmiNYBZqyk+7Y3yxTSVOwEA9ZXa751SMZbbjzN13kLy2B9mC7soUMUFcIdBD//rbP7XyYXF3XIaJu8mlCZIBHKVvip7rGrkWYYxm6w4b1tFt7RwRemDwHD0ZjszWN7Rroy4pZifEfJVrgHr+7hAKzWDNEng8RDmNlN4s3EMAj9F/BqwFiSuaQPk9n7K+Xas716Xt1oqiGyacHajmLoxPx+OMDaIQUaZvDuU5PUCs62uuxaMoIivIY5QS1lBhdq6ePiAwlLL/QvN5tc7k2FUs6PW7Rbz4bgZYojtUwvoAUXkDbqdlUICkRIZqSRYhRvy8I41Ob1flJdQU7LYxRoIMp5HuPyX9uCtHEtCQmxhMhfg/AT27r48/8XgA/JyeSQboXlPrk/6xg+wMqbEeK/bloIWP9BwhhA40mu8LzAAAAAElFTkSuQmCC"},4790:function(e,t,a){"use strict";e.exports=a.p+"img/icon7.b4968d52.png"},39830:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAABHNCSVQICAgIfAhkiAAADZZJREFUeF7tm/ezFeUZx589dEGa9I40aYJSBBIEjYMlRkUUS2IhiWaSGSe/ZCb/Rn5MRmIJJiIEKWrUJKLE6EQRkSIlFGlSpNdLuZzN97N7Fw7Xc8/d8p6LmdkdLzDjOe9997Pfp7/rWX45JeA5XS1fzHKgjkWQA82BOibgeLlcoTlQxwQcL5crNAfqmIDj5XKF5kAdE3C8XK7QHKhjAo6XyxWaA3VMwPFyuUJdA/V9/4TjNWMtp99rRd/sWI3Z7hO+bfjGty2HzfaeNDt6xuz0ObPzRTP9F3yOJ+/pj4L+btnMrENrs05tzPq0NxvezbNhXc16XuvZtS3NmhWunk483Zi223QXv+6EYG055NtHO337fK/Z/lNmZy6Ypd0I/ADZu4PZuJ5mU/p7dn1nz65pwUNoWrhVBxop8cJFs6+lxH/tAKTZzmNmNbXVeZDAHdTZ7LbrzSb19axLW89aSNWhyqsLuGpAAYn2Ud6Ww7598JVvHwvkPqmxqa5mYodLuG2Q2VSptm8Hz1pLtYUqQq0KUGDWCOQeKXLFV2bvbvHtgECmNemsDwC/26+j2V1DzW4d4Fn3dl7gh6uhVqdAUWRRfxxSUPl0tx+A3HjQ7JzM/btwtRbEm3ub3T3Us7E9vSCwuVarM6CoEnBfHfHtH1sxcbODp6+eKht6gAQw3MCMIWbTBxast/7dXBJ2pVYnQIF5Wib+xV7f3twcRm5853f56ih1Tu4bqpW0q3VzN1AzAw1gnjf7UCnQkg2+bZKJX7xazjLhE2wlFzCmh9n9Izwb19uztg7SrExAgXlSOeV724q2eIPM/agbEyeINNfNcsPNMEdA6Q8S/IvK9M/LtZCGuXhuZAI3qCh4QFCnKWC1yQg1E9CT53xbtrFoSzeGFU7aC2CYXOdrqHbMerQL/92htaKxgBYgDEz9nFPuSmFw6LRv+/Q7KQqOqtrKEvjwqwM7mf14jGdTBTWL+acGWiu5zF9btL+u180pqqe5UAcAh3QxG3odqQ0pjVlHgUQppDbcbJQ2hllEqFDczNEaPwC646hvmw+ZbVXpelh7SeNyeKjXqxj4+XjPpvTzUpevqYGikGcWF+1gCpgIjjLxlj5m4+W7yBE7tQkhAjluxMXl1MoFEAAPn/EDl7Nyj2+f7kmXYQD1DhUBv51WkErTVVSpgR6TOuYsSg6Uhsb0AUqwB3oyszAXdJG2ABflHjsrtSowvrfdt092m52SkuNeWMOjo1FpwVo2NdCLsj2i+gurfDsun9bYxfPG+c8e7dmN3fGRnkB6l8y5se/H/f8R2AOnUKpvC9bF8+/AnNJPMMepsXKdlzrhT61QbvCE1PDPbb69KKhHzzZ8yy1k4zQqHh4VdoGqVfaV7iAqfzcd9O3lz5Ub72s4KwDmBFVQ+M8hghlkFinr/UxA2fQpqXO5zGsuUBVt619tFL1njQzTkq7q+jR1rxJL2n3ct5e0v+Wq3ghqpReWM0G+/KmbPBupBD8LTNbNCJQlwsT+7f/69qfVVyoVmLPlkx4a6VlHBZ3gF6Z88nFNvtzn6C8cVBB95QvSvMtZAMFxnJQ552bPRjiAmRlo6eZPnfftbZWd87TpI1IquRzKnC0zx19eDZD1XQCZwPMrfXtni2QgpQLzp/KZKLPgqMtfVqFXNvHjBw4S/Xek1LfVZZooM3qwzsyzwoz242IdzH/R+nBqMFOWMyoBzPrDjXL7+RZQzOOsqpHTUlwLPbV2wYwmvqnWXNBmFaDa6nv8ZIHADVxQnkmKxh6onMgMslysyf0VtW4b7S9u+y7KeRENfrhdKy8ojevf3xVAgUml8YGCzMe7/KC1RTdmaBduJBucpBCiKP3xrqK9sUl1vVzII0q5RvcgS8gGNc1eKHnX7pf1yQLprJG1TOlXsPatruRyCSgwidLLNvr2+pdhcCHdmaQW16M3qsXVtW4u0wRBJepgvb+9aC+ttqDbz0W9/cuJYWeoVcrEOw1MCgYqsL+s8W3dgTD9oqf68Ciz2wcVVCpfhhoA5QaOSJl/E/3X1vmqNi7/2ggq6hjZvfpKjTpYH2qY97KyBhogUaaDLhm+zVEguaUP86HqKjUqEr7Yp7RLuez6OpgRHSwYqDMGF+zaOqUGQIl+b0qZC6XMUpjRFzF36u6fjPVU7VQPajRiXqGB3kI92B2ajNZv0eFCA6hKdSYIapsqQj1f69sqNc1Jt9buL18Y9FJz53F1qW4fFJ4J8I6cKfqYOD+VSkgsbJJKs8dk/qFS3aoDmDxM/PfrKmkZM9dPwqMHjAsdrjIWq5moMfE1guraE9WqZfUfzcVIAzd8U7n3ilIfUb49Y0jBvLkrL/qLBJM0orELpY7vpb6hlDpGQ664EbKxdYGJ/35fMJfIUirBLLWaYWr7PaQ8d7KgZs0oSvd4QTAJyhQqtAXjXLQhn5bVePfNq5XJx/lK+BnUMVZjg6f0ZaBmLSUD/y2Y76knsFQwd6PMmNvhAdNHnaV8ktMipHhZ0jR+7XnBXKFg+Moas21HYm6k7mPjJDbvuWW1Po2DJBfWPrJb+EToZ6aFGsH8uwqBZZt823M8+VgDVzSoDird9nYt05v/OflMxjnz15ptV281yYXQ7h8uoGv2XvR//6mcriJYkgsPOhyoaircIpNLCjWK5qRpSwVzf0k0T7KPyGoGKKWimzVNfdY0SgXmu1uKQbsPl5NkXgXMaQPDQOnVqh3zpU6+zVWNu7pCi6vcTbIQJvekFkoyNojyzDcEcqHKQBfze6ymr6YANIjvUG7IkZu45h8q07c/K8/cLStpKBiWY4DbuV1JPpGehnmQNhHR6Bu+oFxrpcYHSZ/OYEGllzhRaUwcpVKeklUsUGp0uEzLL6lCo89jNb0UcWl4TJdS4/RdI5ivrdUIpUJm0RDM6VLmk7LS/pqHBfOvKLFnPMuhrj/I/FfpoEJSqKQxLNyY+RNB52vzr+onTmaRFC5QGfQ9O8FTeUh113B6F8FkL3Eyi9K9UPAAE2XSNA+HiXUK5YOYIVLn4Ctjjc++Tg6VEQeBqiGlEkFflVmRKFfrKGN00501u3pukmd3DC7fOgTmcpk5e9mVMBgCEzMnfbykzLpE+NvdJlHdKPOf+1mo1CT+JJob/UwmN17mX5r8U3XgoygnmVQ2xdVOfvQ3U8MqpjRnBiYFxItycXsSnt+Oxjl0+Bl7V+w2RTfJ2AClUr8CNQmAIPrXKRWobICOPmaFqSc9kECX6R4dQ2T2z/nSpDN3jtf8enKoVA7dcsySQ7/cW1KYNM1vHXDZZ8bqh0ZQi4K6/oCqBZkEh7/ouMS9IqhP6CmSBSzR2IEgRNsryUX6Q5Ma0+Kh/u6joq3YkWwv/L4OalwQNKcKBjN7rOTrhMrkePn3+wsmZk40b6DWrThTQqlAxVRXyacmVddQlYbd2upUntKxJPPxCAIddXLLqOfI4YrnVxaDYRtKS3LRYqMVSZMj6bEhZmMoE4HgMyulY40O6YC6Ru0rmgSAoYNe7QuAd+v85uNjC0ZwiW6AwLlf8/Y/yr9z/pTOe7UvuvLjNXv6hbKGgYrmjeW2jQJlwzSfgUr0pydYTaidpKQ7BfNBqZPXZOrfAHvZq6PmnAX4t3xqUjeS5AEAc6JUTZAdFAMma8cCGkHlQC0dmDUym2pA7aITd5wsfmB4eZiX/LugclKaZviH8qknExy3iQsUmN9Tu5Jm9oAKPrP+erGBBlBl/usIVIJKnpo04jZ0MwSxrvK1KPNHN1SGGa2BK+LUHa1HAtXxCidX4kKMPhdF86dvKljfwGfGXyER0EipG5VSAfUTRcwkKVW5bUWVDT7znmGe9Shj5g3dDlB3CupiNVg+2K7jjQ6gEs1J2p+Q/+7VPhnMRCZfelMEB8rUeYKKH0tr/hHMe4eF09Vuet2lMadfHy5Ws1OVztINiv7bzI5kgEqaNmMwp114mSE5zNRA+SJQtwoqk0Aibhqo18lnPqTTJXcJZpcMp0sIVDSml20q6g0UQU3RcKHj/0MVELNGFqynGixppxGJTb5UIahjW11wWC6TS5L8c04UmPfKZ3bWuaekyvyWUoPoL6XqiPqbmuMnCVQoE//98CjMPD3MTAqNVEqtT8Ql+Y9bxZBnPj6GktILTi5nhVka/Q+oUb1gfdHe2hzv1R4mlXdKmTOHF6yP+qlx2o+VQlQmhUZQifZb9XbxAjWLMf9KSqW2njOOxF0VkI7WuIIZ3SSuiMO2NK6X6s2UsxVKZmDyuuLMEeELYFlhZlZo6U3QT43MvyGomNYzE6QINSraBrOfBPlI/Mwl8O+cNSBPXaiXKsplIgFMmfksmTkTSxcwnQEtVSq5IYGKl2ZLa3/M/FlgSpm8EFAtmKUP+YQOdoXN7CuhAvNuKROf2V0w0wagsmlgcA7H0cVSrLbzWNi4RalA5cWEX+lM0g/0hgVnkqoNsxRqjXqf82lqayyMK8JKaAc+NqagzCL+3CkuInxowkZW40sDdp/qbV5q2KrZ9n2K5JM1N48z42l89eSfOKuc7i0dBn5fmQjHv+9XAIpOVCdfrfI3quPEXO/y/2i9HKjjh5UDzYE6JuB4uVyhOVDHBBwvlys0B+qYgOPlcoXmQB0TcLxcrtAcqGMCjpfLFZoDdUzA8XK5QnOgjgk4Xu5/jrhtbKRe8K0AAAAASUVORK5CYII="},10153:function(e,t,a){"use strict";e.exports=a.p+"img/img1.d1d00702.png"},2354:function(e,t,a){"use strict";e.exports=a.p+"img/img2.96ce2ee5.png"},32954:function(e,t,a){"use strict";e.exports=a.p+"img/img3.53099b4f.png"},93744:function(e,t,a){"use strict";e.exports=a.p+"img/img4.9c4730d5.png"},77974:function(e,t,a){"use strict";e.exports=a.p+"img/img5.9cb62c6e.png"},8:function(e,t,a){"use strict";e.exports=a.p+"img/img6.e1023e8c.png"},35577:function(e,t,a){"use strict";e.exports=a.p+"img/img7.46b55a63.png"},5473:function(e,t,a){"use strict";e.exports=a.p+"img/img8.fe0dd4a9.png"},71915:function(e,t,a){"use strict";e.exports=a.p+"img/img9.56132f25.png"},62859:function(){},57973:function(){},75304:function(){},54185:function(){},88677:function(){},62808:function(){},46601:function(){},89214:function(){},71922:function(){},2363:function(){},22263:function(){},85568:function(){},24322:function(){},5536:function(){},16978:function(){},52361:function(){},94616:function(){},6567:function(){},11875:function(){},12449:function(){},83941:function(){},56773:function(){},55896:function(){},57463:function(){},23424:function(){},8185:function(){},87500:function(){},89455:function(){},33557:function(){},84701:function(){},27966:function(){},46479:function(){},47531:function(){},24647:function(e,t,a){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"===typeof globalThis?a.g:globalThis;e.exports=function(){for(var e=[],t=0;t