(self["webpackChunkANT_ETH"]=self["webpackChunkANT_ETH"]||[]).push([[998],{19662:function(e,t,r){var a=r(17854),n=r(60614),i=r(66330),c=a.TypeError;e.exports=function(e){if(n(e))return e;throw c(i(e)+" is not a function")}},96077:function(e,t,r){var a=r(17854),n=r(60614),i=a.String,c=a.TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw c("Can't set "+i(e)+" as a prototype")}},51223:function(e,t,r){var a=r(5112),n=r(70030),i=r(3070),c=a("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}},25787:function(e,t,r){var a=r(17854),n=r(47976),i=a.TypeError;e.exports=function(e,t){if(n(t,e))return e;throw i("Incorrect invocation")}},19670:function(e,t,r){var a=r(17854),n=r(70111),i=a.String,c=a.TypeError;e.exports=function(e){if(n(e))return e;throw c(i(e)+" is not an object")}},24019:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},90260:function(e,t,r){"use strict";var a,n,i,c=r(24019),f=r(19781),o=r(17854),d=r(60614),s=r(70111),u=r(92597),b=r(70648),h=r(66330),l=r(68880),p=r(31320),x=r(3070).f,m=r(47976),v=r(79518),g=r(27674),y=r(5112),w=r(69711),M=o.Int8Array,_=M&&M.prototype,k=o.Uint8ClampedArray,A=k&&k.prototype,S=M&&v(M),E=_&&v(_),T=Object.prototype,P=o.TypeError,I=y("toStringTag"),B=w("TYPED_ARRAY_TAG"),C=w("TYPED_ARRAY_CONSTRUCTOR"),O=c&&!!g&&"Opera"!==b(o.opera),R=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},L={BigInt64Array:8,BigUint64Array:8},U=function(e){if(!s(e))return!1;var t=b(e);return"DataView"===t||u(N,t)||u(L,t)},j=function(e){if(!s(e))return!1;var t=b(e);return u(N,t)||u(L,t)},F=function(e){if(j(e))return e;throw P("Target is not a typed array")},D=function(e){if(d(e)&&(!g||m(S,e)))return e;throw P(h(e)+" is not a typed array constructor")},H=function(e,t,r,a){if(f){if(r)for(var n in N){var i=o[n];if(i&&u(i.prototype,e))try{delete i.prototype[e]}catch(c){try{i.prototype[e]=t}catch(d){}}}E[e]&&!r||p(E,e,r?t:O&&_[e]||t,a)}},q=function(e,t,r){var a,n;if(f){if(g){if(r)for(a in N)if(n=o[a],n&&u(n,e))try{delete n[e]}catch(i){}if(S[e]&&!r)return;try{return p(S,e,r?t:O&&S[e]||t)}catch(i){}}for(a in N)n=o[a],!n||n[e]&&!r||p(n,e,t)}};for(a in N)n=o[a],i=n&&n.prototype,i?l(i,C,n):O=!1;for(a in L)n=o[a],i=n&&n.prototype,i&&l(i,C,n);if((!O||!d(S)||S===Function.prototype)&&(S=function(){throw P("Incorrect invocation")},O))for(a in N)o[a]&&g(o[a],S);if((!O||!E||E===T)&&(E=S.prototype,O))for(a in N)o[a]&&g(o[a].prototype,E);if(O&&v(A)!==E&&g(A,E),f&&!u(E,I))for(a in R=!0,x(E,I,{get:function(){return s(this)?this[B]:void 0}}),N)o[a]&&l(o[a],B,a);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_CONSTRUCTOR:C,TYPED_ARRAY_TAG:R&&B,aTypedArray:F,aTypedArrayConstructor:D,exportTypedArrayMethod:H,exportTypedArrayStaticMethod:q,isView:U,isTypedArray:j,TypedArray:S,TypedArrayPrototype:E}},41318:function(e,t,r){var a=r(45656),n=r(51400),i=r(26244),c=function(e){return function(t,r,c){var f,o=a(t),d=i(o),s=n(c,d);if(e&&r!=r){while(d>s)if(f=o[s++],f!=f)return!0}else for(;d>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}};e.exports={includes:c(!0),indexOf:c(!1)}},50206:function(e,t,r){var a=r(1702);e.exports=a([].slice)},84326:function(e,t,r){var a=r(1702),n=a({}.toString),i=a("".slice);e.exports=function(e){return i(n(e),8,-1)}},70648:function(e,t,r){var a=r(17854),n=r(51694),i=r(60614),c=r(84326),f=r(5112),o=f("toStringTag"),d=a.Object,s="Arguments"==c(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(r){}};e.exports=n?c:function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=u(t=d(e),o))?r:s?c(t):"Object"==(a=c(t))&&i(t.callee)?"Arguments":a}},77741:function(e,t,r){var a=r(1702),n=a("".replace),i=function(e){return String(Error(e).stack)}("zxcasd"),c=/\n\s*at [^:]*:[^\n]*/,f=c.test(i);e.exports=function(e,t){if(f&&"string"==typeof e)while(t--)e=n(e,c,"");return e}},99920:function(e,t,r){var a=r(92597),n=r(53887),i=r(31236),c=r(3070);e.exports=function(e,t,r){for(var f=n(t),o=c.f,d=i.f,s=0;s0&&a[0]<4?1:+(a[0]+a[1])),!n&&c&&(a=c.match(/Edge\/(\d+)/),(!a||a[1]>=74)&&(a=c.match(/Chrome\/(\d+)/),a&&(n=+a[1]))),e.exports=n},80748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},22914:function(e,t,r){var a=r(47293),n=r(79114);e.exports=!a((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",n(1,7)),7!==e.stack)}))},82109:function(e,t,r){var a=r(17854),n=r(31236).f,i=r(68880),c=r(31320),f=r(83505),o=r(99920),d=r(54705);e.exports=function(e,t){var r,s,u,b,h,l,p=e.target,x=e.global,m=e.stat;if(s=x?a:m?a[p]||f(p,{}):(a[p]||{}).prototype,s)for(u in t){if(h=t[u],e.noTargetGet?(l=n(s,u),b=l&&l.value):b=s[u],r=d(x?u:p+(m?".":"#")+u,e.forced),!r&&void 0!==b){if(typeof h==typeof b)continue;o(h,b)}(e.sham||b&&b.sham)&&i(h,"sham",!0),c(s,u,h,e)}}},47293:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},22104:function(e,t,r){var a=r(34374),n=Function.prototype,i=n.apply,c=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(a?c.bind(i):function(){return c.apply(i,arguments)})},49974:function(e,t,r){var a=r(1702),n=r(19662),i=r(34374),c=a(a.bind);e.exports=function(e,t){return n(e),void 0===t?e:i?c(e,t):function(){return e.apply(t,arguments)}}},34374:function(e,t,r){var a=r(47293);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},46916:function(e,t,r){var a=r(34374),n=Function.prototype.call;e.exports=a?n.bind(n):function(){return n.apply(n,arguments)}},76530:function(e,t,r){var a=r(19781),n=r(92597),i=Function.prototype,c=a&&Object.getOwnPropertyDescriptor,f=n(i,"name"),o=f&&"something"===function(){}.name,d=f&&(!a||a&&c(i,"name").configurable);e.exports={EXISTS:f,PROPER:o,CONFIGURABLE:d}},1702:function(e,t,r){var a=r(34374),n=Function.prototype,i=n.bind,c=n.call,f=a&&i.bind(c,c);e.exports=a?function(e){return e&&f(e)}:function(e){return e&&function(){return c.apply(e,arguments)}}},35005:function(e,t,r){var a=r(17854),n=r(60614),i=function(e){return n(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(a[e]):a[e]&&a[e][t]}},58173:function(e,t,r){var a=r(19662);e.exports=function(e,t){var r=e[t];return null==r?void 0:a(r)}},17854:function(e,t,r){var a=function(e){return e&&e.Math==Math&&e};e.exports=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},92597:function(e,t,r){var a=r(1702),n=r(47908),i=a({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(n(e),t)}},3501:function(e){e.exports={}},60490:function(e,t,r){var a=r(35005);e.exports=a("document","documentElement")},64664:function(e,t,r){var a=r(19781),n=r(47293),i=r(80317);e.exports=!a&&!n((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},68361:function(e,t,r){var a=r(17854),n=r(1702),i=r(47293),c=r(84326),f=a.Object,o=n("".split);e.exports=i((function(){return!f("z").propertyIsEnumerable(0)}))?function(e){return"String"==c(e)?o(e,""):f(e)}:f},79587:function(e,t,r){var a=r(60614),n=r(70111),i=r(27674);e.exports=function(e,t,r){var c,f;return i&&a(c=t.constructor)&&c!==r&&n(f=c.prototype)&&f!==r.prototype&&i(e,f),e}},42788:function(e,t,r){var a=r(1702),n=r(60614),i=r(5465),c=a(Function.toString);n(i.inspectSource)||(i.inspectSource=function(e){return c(e)}),e.exports=i.inspectSource},58340:function(e,t,r){var a=r(70111),n=r(68880);e.exports=function(e,t){a(t)&&"cause"in t&&n(e,"cause",t.cause)}},29909:function(e,t,r){var a,n,i,c=r(68536),f=r(17854),o=r(1702),d=r(70111),s=r(68880),u=r(92597),b=r(5465),h=r(6200),l=r(3501),p="Object already initialized",x=f.TypeError,m=f.WeakMap,v=function(e){return i(e)?n(e):a(e,{})},g=function(e){return function(t){var r;if(!d(t)||(r=n(t)).type!==e)throw x("Incompatible receiver, "+e+" required");return r}};if(c||b.state){var y=b.state||(b.state=new m),w=o(y.get),M=o(y.has),_=o(y.set);a=function(e,t){if(M(y,e))throw new x(p);return t.facade=e,_(y,e,t),t},n=function(e){return w(y,e)||{}},i=function(e){return M(y,e)}}else{var k=h("state");l[k]=!0,a=function(e,t){if(u(e,k))throw new x(p);return t.facade=e,s(e,k,t),t},n=function(e){return u(e,k)?e[k]:{}},i=function(e){return u(e,k)}}e.exports={set:a,get:n,has:i,enforce:v,getterFor:g}},60614:function(e){e.exports=function(e){return"function"==typeof e}},54705:function(e,t,r){var a=r(47293),n=r(60614),i=/#|\.prototype\./,c=function(e,t){var r=o[f(e)];return r==s||r!=d&&(n(t)?a(t):!!t)},f=c.normalize=function(e){return String(e).replace(i,".").toLowerCase()},o=c.data={},d=c.NATIVE="N",s=c.POLYFILL="P";e.exports=c},70111:function(e,t,r){var a=r(60614);e.exports=function(e){return"object"==typeof e?null!==e:a(e)}},31913:function(e){e.exports=!1},52190:function(e,t,r){var a=r(17854),n=r(35005),i=r(60614),c=r(47976),f=r(43307),o=a.Object;e.exports=f?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&c(t.prototype,o(e))}},26244:function(e,t,r){var a=r(17466);e.exports=function(e){return a(e.length)}},30133:function(e,t,r){var a=r(7392),n=r(47293);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},68536:function(e,t,r){var a=r(17854),n=r(60614),i=r(42788),c=a.WeakMap;e.exports=n(c)&&/native code/.test(i(c))},56277:function(e,t,r){var a=r(41340);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:a(e)}},70030:function(e,t,r){var a,n=r(19670),i=r(36048),c=r(80748),f=r(3501),o=r(60490),d=r(80317),s=r(6200),u=">",b="<",h="prototype",l="script",p=s("IE_PROTO"),x=function(){},m=function(e){return b+l+u+e+b+"/"+l+u},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){var e,t=d("iframe"),r="java"+l+":";return t.style.display="none",o.appendChild(t),t.src=String(r),e=t.contentWindow.document,e.open(),e.write(m("document.F=Object")),e.close(),e.F},y=function(){try{a=new ActiveXObject("htmlfile")}catch(t){}y="undefined"!=typeof document?document.domain&&a?v(a):g():v(a);var e=c.length;while(e--)delete y[h][c[e]];return y()};f[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(x[h]=n(e),r=new x,x[h]=null,r[p]=e):r=y(),void 0===t?r:i.f(r,t)}},36048:function(e,t,r){var a=r(19781),n=r(3353),i=r(3070),c=r(19670),f=r(45656),o=r(81956);t.f=a&&!n?Object.defineProperties:function(e,t){c(e);var r,a=f(t),n=o(t),d=n.length,s=0;while(d>s)i.f(e,r=n[s++],a[r]);return e}},3070:function(e,t,r){var a=r(17854),n=r(19781),i=r(64664),c=r(3353),f=r(19670),o=r(34948),d=a.TypeError,s=Object.defineProperty,u=Object.getOwnPropertyDescriptor,b="enumerable",h="configurable",l="writable";t.f=n?c?function(e,t,r){if(f(e),t=o(t),f(r),"function"===typeof e&&"prototype"===t&&"value"in r&&l in r&&!r[l]){var a=u(e,t);a&&a[l]&&(e[t]=r.value,r={configurable:h in r?r[h]:a[h],enumerable:b in r?r[b]:a[b],writable:!1})}return s(e,t,r)}:s:function(e,t,r){if(f(e),t=o(t),f(r),i)try{return s(e,t,r)}catch(a){}if("get"in r||"set"in r)throw d("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},31236:function(e,t,r){var a=r(19781),n=r(46916),i=r(55296),c=r(79114),f=r(45656),o=r(34948),d=r(92597),s=r(64664),u=Object.getOwnPropertyDescriptor;t.f=a?u:function(e,t){if(e=f(e),t=o(t),s)try{return u(e,t)}catch(r){}if(d(e,t))return c(!n(i.f,e,t),e[t])}},8006:function(e,t,r){var a=r(16324),n=r(80748),i=n.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,i)}},25181:function(e,t){t.f=Object.getOwnPropertySymbols},79518:function(e,t,r){var a=r(17854),n=r(92597),i=r(60614),c=r(47908),f=r(6200),o=r(49920),d=f("IE_PROTO"),s=a.Object,u=s.prototype;e.exports=o?s.getPrototypeOf:function(e){var t=c(e);if(n(t,d))return t[d];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof s?u:null}},47976:function(e,t,r){var a=r(1702);e.exports=a({}.isPrototypeOf)},16324:function(e,t,r){var a=r(1702),n=r(92597),i=r(45656),c=r(41318).indexOf,f=r(3501),o=a([].push);e.exports=function(e,t){var r,a=i(e),d=0,s=[];for(r in a)!n(f,r)&&n(a,r)&&o(s,r);while(t.length>d)n(a,r=t[d++])&&(~c(s,r)||o(s,r));return s}},81956:function(e,t,r){var a=r(16324),n=r(80748);e.exports=Object.keys||function(e){return a(e,n)}},55296:function(e,t){"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,n=a&&!r.call({1:2},1);t.f=n?function(e){var t=a(this,e);return!!t&&t.enumerable}:r},27674:function(e,t,r){var a=r(1702),n=r(19670),i=r(96077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{e=a(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),e(r,[]),t=r instanceof Array}catch(c){}return function(r,a){return n(r),i(a),t?e(r,a):r.__proto__=a,r}}():void 0)},92140:function(e,t,r){var a=r(17854),n=r(46916),i=r(60614),c=r(70111),f=a.TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!c(a=n(r,e)))return a;if(i(r=e.valueOf)&&!c(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!c(a=n(r,e)))return a;throw f("Can't convert object to primitive value")}},53887:function(e,t,r){var a=r(35005),n=r(1702),i=r(8006),c=r(25181),f=r(19670),o=n([].concat);e.exports=a("Reflect","ownKeys")||function(e){var t=i.f(f(e)),r=c.f;return r?o(t,r(e)):t}},31320:function(e,t,r){var a=r(17854),n=r(60614),i=r(92597),c=r(68880),f=r(83505),o=r(42788),d=r(29909),s=r(76530).CONFIGURABLE,u=d.get,b=d.enforce,h=String(String).split("String");(e.exports=function(e,t,r,o){var d,u=!!o&&!!o.unsafe,l=!!o&&!!o.enumerable,p=!!o&&!!o.noTargetGet,x=o&&void 0!==o.name?o.name:t;n(r)&&("Symbol("===String(x).slice(0,7)&&(x="["+String(x).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!i(r,"name")||s&&r.name!==x)&&c(r,"name",x),d=b(r),d.source||(d.source=h.join("string"==typeof x?x:""))),e!==a?(u?!p&&e[t]&&(l=!0):delete e[t],l?e[t]=r:c(e,t,r)):l?e[t]=r:f(t,r)})(Function.prototype,"toString",(function(){return n(this)&&u(this).source||o(this)}))},84488:function(e,t,r){var a=r(17854),n=a.TypeError;e.exports=function(e){if(void 0==e)throw n("Can't call method on "+e);return e}},83505:function(e,t,r){var a=r(17854),n=Object.defineProperty;e.exports=function(e,t){try{n(a,e,{value:t,configurable:!0,writable:!0})}catch(r){a[e]=t}return t}},6200:function(e,t,r){var a=r(72309),n=r(69711),i=a("keys");e.exports=function(e){return i[e]||(i[e]=n(e))}},5465:function(e,t,r){var a=r(17854),n=r(83505),i="__core-js_shared__",c=a[i]||n(i,{});e.exports=c},72309:function(e,t,r){var a=r(31913),n=r(5465);(e.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.1",mode:a?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},20261:function(e,t,r){var a,n,i,c,f=r(17854),o=r(22104),d=r(49974),s=r(60614),u=r(92597),b=r(47293),h=r(60490),l=r(50206),p=r(80317),x=r(48053),m=r(6833),v=r(35268),g=f.setImmediate,y=f.clearImmediate,w=f.process,M=f.Dispatch,_=f.Function,k=f.MessageChannel,A=f.String,S=0,E={},T="onreadystatechange";try{a=f.location}catch(O){}var P=function(e){if(u(E,e)){var t=E[e];delete E[e],t()}},I=function(e){return function(){P(e)}},B=function(e){P(e.data)},C=function(e){f.postMessage(A(e),a.protocol+"//"+a.host)};g&&y||(g=function(e){x(arguments.length,1);var t=s(e)?e:_(e),r=l(arguments,1);return E[++S]=function(){o(t,void 0,r)},n(S),S},y=function(e){delete E[e]},v?n=function(e){w.nextTick(I(e))}:M&&M.now?n=function(e){M.now(I(e))}:k&&!m?(i=new k,c=i.port2,i.port1.onmessage=B,n=d(c.postMessage,c)):f.addEventListener&&s(f.postMessage)&&!f.importScripts&&a&&"file:"!==a.protocol&&!b(C)?(n=C,f.addEventListener("message",B,!1)):n=T in p("script")?function(e){h.appendChild(p("script"))[T]=function(){h.removeChild(this),P(e)}}:function(e){setTimeout(I(e),0)}),e.exports={set:g,clear:y}},51400:function(e,t,r){var a=r(19303),n=Math.max,i=Math.min;e.exports=function(e,t){var r=a(e);return r<0?n(r+t,0):i(r,t)}},45656:function(e,t,r){var a=r(68361),n=r(84488);e.exports=function(e){return a(n(e))}},19303:function(e){var t=Math.ceil,r=Math.floor;e.exports=function(e){var a=+e;return a!==a||0===a?0:(a>0?r:t)(a)}},17466:function(e,t,r){var a=r(19303),n=Math.min;e.exports=function(e){return e>0?n(a(e),9007199254740991):0}},47908:function(e,t,r){var a=r(17854),n=r(84488),i=a.Object;e.exports=function(e){return i(n(e))}},84590:function(e,t,r){var a=r(17854),n=r(73002),i=a.RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw i("Wrong offset");return r}},73002:function(e,t,r){var a=r(17854),n=r(19303),i=a.RangeError;e.exports=function(e){var t=n(e);if(t<0)throw i("The argument can't be less than 0");return t}},57593:function(e,t,r){var a=r(17854),n=r(46916),i=r(70111),c=r(52190),f=r(58173),o=r(92140),d=r(5112),s=a.TypeError,u=d("toPrimitive");e.exports=function(e,t){if(!i(e)||c(e))return e;var r,a=f(e,u);if(a){if(void 0===t&&(t="default"),r=n(a,e,t),!i(r)||c(r))return r;throw s("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},34948:function(e,t,r){var a=r(57593),n=r(52190);e.exports=function(e){var t=a(e,"string");return n(t)?t:t+""}},51694:function(e,t,r){var a=r(5112),n=a("toStringTag"),i={};i[n]="z",e.exports="[object z]"===String(i)},41340:function(e,t,r){var a=r(17854),n=r(70648),i=a.String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},66330:function(e,t,r){var a=r(17854),n=a.String;e.exports=function(e){try{return n(e)}catch(t){return"Object"}}},69711:function(e,t,r){var a=r(1702),n=0,i=Math.random(),c=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+c(++n+i,36)}},43307:function(e,t,r){var a=r(30133);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:function(e,t,r){var a=r(19781),n=r(47293);e.exports=a&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},48053:function(e,t,r){var a=r(17854),n=a.TypeError;e.exports=function(e,t){if(ex&&u(a,arguments[x]),a}));if(M.prototype=y,"Error"!==v&&(f?f(M,w):o(M,w,{name:!0})),o(M,g),!l)try{y.name!==v&&i(y,"name",v),y.constructor=M}catch(_){}return M}}},32120:function(e,t,r){var a=r(82109),n=r(35005),i=r(22104),c=r(47293),f=r(89191),o="AggregateError",d=n(o),s=!c((function(){return 1!==d([1]).errors[0]}))&&c((function(){return 7!==d([1],o,{cause:7}).cause}));a({global:!0,forced:s},{AggregateError:f(o,(function(e){return function(t,r){return i(e,this,arguments)}}),s,!0)})},52262:function(e,t,r){"use strict";var a=r(82109),n=r(47908),i=r(26244),c=r(19303),f=r(51223);a({target:"Array",proto:!0},{at:function(e){var t=n(this),r=i(t),a=c(e),f=a>=0?a:r+a;return f<0||f>=r?void 0:t[f]}}),f("at")},21703:function(e,t,r){var a=r(82109),n=r(17854),i=r(22104),c=r(89191),f="WebAssembly",o=n[f],d=7!==Error("e",{cause:7}).cause,s=function(e,t){var r={};r[e]=c(e,t,d),a({global:!0,forced:d},r)},u=function(e,t){if(o&&o[e]){var r={};r[e]=c(f+"."+e,t,d),a({target:f,stat:!0,forced:d},r)}};s("Error",(function(e){return function(t){return i(e,this,arguments)}})),s("EvalError",(function(e){return function(t){return i(e,this,arguments)}})),s("RangeError",(function(e){return function(t){return i(e,this,arguments)}})),s("ReferenceError",(function(e){return function(t){return i(e,this,arguments)}})),s("SyntaxError",(function(e){return function(t){return i(e,this,arguments)}})),s("TypeError",(function(e){return function(t){return i(e,this,arguments)}})),s("URIError",(function(e){return function(t){return i(e,this,arguments)}})),u("CompileError",(function(e){return function(t){return i(e,this,arguments)}})),u("LinkError",(function(e){return function(t){return i(e,this,arguments)}})),u("RuntimeError",(function(e){return function(t){return i(e,this,arguments)}}))},24506:function(e,t,r){"use strict";var a=r(82109),n=r(1702),i=r(84488),c=r(19303),f=r(41340),o=r(47293),d=n("".charAt),s=o((function(){return"\ud842"!=="𠮷".at(-2)}));a({target:"String",proto:!0,forced:s},{at:function(e){var t=f(i(this)),r=t.length,a=c(e),n=a>=0?a:r+a;return n<0||n>=r?void 0:d(t,n)}})},48675:function(e,t,r){"use strict";var a=r(90260),n=r(26244),i=r(19303),c=a.aTypedArray,f=a.exportTypedArrayMethod;f("at",(function(e){var t=c(this),r=n(t),a=i(e),f=a>=0?a:r+a;return f<0||f>=r?void 0:t[f]}))},3462:function(e,t,r){"use strict";var a=r(17854),n=r(46916),i=r(90260),c=r(26244),f=r(84590),o=r(47908),d=r(47293),s=a.RangeError,u=a.Int8Array,b=u&&u.prototype,h=b&&b.set,l=i.aTypedArray,p=i.exportTypedArrayMethod,x=!d((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&&d((function(){var e=new u(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),r=o(e);if(x)return n(h,this,r,t);var a=this.length,i=c(r),d=0;if(i+t>a)throw s("Wrong length");while(d=e.length&&(e=void 0),{value:e&&e[a++],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(r(87295)),c=n(r(31227)),f=n(r(40439)),o=n(r(37098)),d=n(r(17687)),s=n(r(49422));function u(e){var t,r,n={1:"mainnet",3:"ropsten",4:"rinkeby",42:"kovan",5:"goerli",11155111:"sepolia"},u={mainnet:i.default,ropsten:c.default,rinkeby:f.default,kovan:o.default,goerli:d.default,sepolia:s.default};if(e)try{for(var b=a(e),h=b.next();!h.done;h=b.next()){var l=h.value,p=l.name;n[l.chainId.toString()]=p,u[p]=l}}catch(x){t={error:x}}finally{try{h&&!h.done&&(r=b.return)&&r.call(b)}finally{if(t)throw t.error}}return u["names"]=n,u}t._getInitializedChains=u,t.chains=u()},38158:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EIPs=void 0,t.EIPs={1559:r(77523),2315:r(83339),2537:r(26769),2565:r(17897),2718:r(62170),2929:r(88436),2930:r(96213),3198:r(25491),3529:r(20070),3541:r(21871),3554:r(47225),3607:r(3968),3675:r(98571),3855:r(64551),4345:r(74818)}},86625:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hardforks=void 0,t.hardforks=[["chainstart",r(60114)],["homestead",r(62800)],["dao",r(7197)],["tangerineWhistle",r(22302)],["spuriousDragon",r(90716)],["byzantium",r(26985)],["constantinople",r(35993)],["petersburg",r(4064)],["istanbul",r(83166)],["muirGlacier",r(42946)],["berlin",r(20015)],["london",r(61250)],["shanghai",r(5553)],["arrowGlacier",r(51971)],["merge",r(88648)]]},82099:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,a=arguments.length;r=e.length&&(e=void 0),{value:e&&e[a++],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,o,d=r(43793),s=r(88913),u=r(64466),b=r(20455),h=r(86625),l=r(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"}(o=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 r,a,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:o.Istanbul;try{for(var d=c(f._chainParams.hardforks),s=d.next();!s.done;s=d.next()){var u=s.value;u.forkHash||(u.forkHash=f._calcForkHash(u.name))}}catch(b){r={error:b}}finally{try{s&&!s.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.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,r){var a;void 0===r&&(r={});var n=null!==(a=r.baseChain)&&void 0!==a?a:"mainnet",c=i({},t._getChainParams(n));if(c["name"]="custom-chain","string"!==typeof e)return new t(i({chain:i(i({},c),e)},r));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:o.Berlin});if(e===f.OptimisticEthereum)return t.custom({name:f.OptimisticEthereum,chainId:10,networkId:10},{hardfork:o.Berlin});throw new Error("Custom chain ".concat(e," not supported"))},t.forCustomChain=function(e,r,a,n){var c=t._getChainParams(e);return new t({chain:i(i({},c),r),hardfork:a,supportedHardforks:n})},t.isSupportedChainId=function(e){var t=(0,b._getInitializedChains)();return Boolean(t["names"][e.toString()])},t._getChainParams=function(e,t){var r=(0,b._getInitializedChains)(t);if("number"===typeof e||u.BN.isBN(e)){if(e=e.toString(),r["names"][e]){var a=r["names"][e];return r[a]}throw new Error("Chain with ID ".concat(e," not supported"))}if(r[e])return r[e];throw new Error("Chain with name ".concat(e," not supported"))},t.prototype.setChain=function(e){var r,a;if("number"===typeof e||"string"===typeof e||u.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),o=f.next();!o.done;o=f.next()){var d=o.value;if(void 0===e[d])throw new Error("Missing required chain parameter: ".concat(d))}}catch(s){r={error:s}}finally{try{o&&!o.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}this._chainParams=e}return this._chainParams},t.prototype.setHardfork=function(e){var t,r;if(!this._isSupportedHardfork(e))throw new Error("Hardfork ".concat(e," not set as supported in supportedHardforks"));var a=!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)),a=!0)}}catch(o){t={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}if(!a)throw new Error("Hardfork with name ".concat(e," not supported"))},t.prototype.getHardforkByBlockNumber=function(e,t){var r,a;e=(0,u.toType)(e,u.TypeOutput.BN),t=(0,u.toType)(t,u.TypeOutput.BN);var n,i,f,d=o.Chainstart;try{for(var s=c(this.hardforks()),b=s.next();!b.done;b=s.next()){var h=b.value;if(null!==h.block)e.gte(new u.BN(h.block))&&(d=h.name),t&&h.td&&(t.gte(new u.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 u.BN(h.td)))return h.name}}catch(x){r={error:x}}finally{try{b&&!b.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}if(t){var l="block number: ".concat(e," (-> ").concat(d,"), ");if(n&&!this.hardforkGteHardfork(d,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,d)){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 d},t.prototype.setHardforkByBlockNumber=function(e,t){var r=this.getHardforkByBlockNumber(e,t);return this.setHardfork(r),r},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,r,a=this.hardforks();try{for(var n=c(a),i=n.next();!i.done;i=n.next()){var f=i.value;if(f["name"]===e)return f}}catch(o){t={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.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,r;if(!(this._supportedHardforks.length>0))return!0;try{for(var a=c(this._supportedHardforks),n=a.next();!n.done;n=a.next()){var i=n.value;if(e===i)return!0}}catch(f){t={error:f}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return!1},t.prototype.setEIPs=function(e){var t,r,a=this;void 0===e&&(e=[]);var n=function(t){if(!(t in l.EIPs))throw new Error("".concat(t," not supported"));var r=i.gteHardfork(l.EIPs[t]["minimumHardfork"]);if(!r)throw new Error("".concat(t," cannot be activated on hardfork ").concat(i.hardfork(),", minimumHardfork: ").concat(r));l.EIPs[t].requiredEIPs&&l.EIPs[t].requiredEIPs.forEach((function(r){if(!e.includes(r)&&!a.isActivatedEIP(r))throw new Error("".concat(t," requires EIP ").concat(r,", but is not included in the EIP list"))}))},i=this;try{for(var f=c(e),o=f.next();!o.done;o=f.next()){var d=o.value;n(d)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(r=f.return)&&r.call(f)}finally{if(t)throw t.error}}this._eips=e},t.prototype.param=function(e,t){var r,a,n=null;try{for(var i=c(this._eips),f=i.next();!f.done;f=i.next()){var o=f.value;if(n=this.paramByEIP(e,t,o),null!==n)return n}}catch(d){r={error:d}}finally{try{f&&!f.done&&(a=i.return)&&a.call(i)}finally{if(r)throw r.error}}return this.paramByHardfork(e,t,this._hardfork)},t.prototype.paramByHardfork=function(e,t,r){var a,n,i,f;r=this._chooseHardfork(r);var o=null;try{for(var d=c(h.hardforks),s=d.next();!s.done;s=d.next()){var u=s.value;if("eips"in u[1]){var b=u[1]["eips"];try{for(var l=(i=void 0,c(b)),p=l.next();!p.done;p=l.next()){var x=p.value,m=this.paramByEIP(e,t,x);o=null!==m?m:o}}catch(v){i={error:v}}finally{try{p&&!p.done&&(f=l.return)&&f.call(l)}finally{if(i)throw i.error}}}else{if(!u[1][e])throw new Error("Topic ".concat(e," not defined"));void 0!==u[1][e][t]&&(o=u[1][e][t].v)}if(u[0]===r)break}}catch(g){a={error:g}}finally{try{s&&!s.done&&(n=d.return)&&n.call(d)}finally{if(a)throw a.error}}return o},t.prototype.paramByEIP=function(e,t,r){if(!(r in l.EIPs))throw new Error("".concat(r," not supported"));var a=l.EIPs[r];if(!(e in a))throw new Error("Topic ".concat(e," not defined"));if(void 0===a[e][t])return null;var n=a[e][t].v;return n},t.prototype.paramByBlock=function(e,t,r){var a=this.activeHardforks(r),n=a[a.length-1]["name"];return this.paramByHardfork(e,t,n)},t.prototype.isActivatedEIP=function(e){var t,r;if(this.eips().includes(e))return!0;try{for(var a=c(h.hardforks),n=a.next();!n.done;n=a.next()){var i=n.value,f=i[1];if(this.gteHardfork(f["name"])&&"eips"in f&&f["eips"].includes(e))return!0}}catch(o){t={error:o}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return!1},t.prototype.hardforkIsActiveOnBlock=function(e,t,r){var a;void 0===r&&(r={}),t=(0,u.toType)(t,u.TypeOutput.BN);var n=null!==(a=r.onlySupported)&&void 0!==a&&a;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,r){var a,n;void 0===r&&(r={});var i,f=void 0!==r.onlyActive&&r.onlyActive;e=this._chooseHardfork(e,r.onlySupported),i=f?this.activeHardforks(null,r):this.hardforks();var o=-1,d=-1,s=0;try{for(var u=c(i),b=u.next();!b.done;b=u.next()){var h=b.value;h["name"]===e&&(o=s),h["name"]===t&&(d=s),s+=1}}catch(l){a={error:l}}finally{try{b&&!b.done&&(n=u.return)&&n.call(u)}finally{if(a)throw a.error}}return o>=d&&-1!==d},t.prototype.gteHardfork=function(e,t){return this.hardforkGteHardfork(null,e,t)},t.prototype.hardforkIsActiveOnChain=function(e,t){var r,a,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()),o=f.next();!o.done;o=f.next()){var d=o.value;if(d["name"]===e&&null!==d["block"])return!0}}catch(s){r={error:s}}finally{try{o&&!o.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}return!1},t.prototype.activeHardforks=function(e,t){var r,a;void 0===t&&(t={});var n=[],i=this.hardforks();try{for(var f=c(i),o=f.next();!o.done;o=f.next()){var d=o.value;if(null!==d["block"]){if(void 0!==e&&null!==e&&e0)return r[r.length-1]["name"];throw new Error("No (supported) active hardfork found")},t.prototype.hardforkBlock=function(e){var t=this.hardforkBlockBN(e);return(0,u.toType)(t,u.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 u.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 u.BN(t)},t.prototype.isHardforkBlock=function(e,t){e=(0,u.toType)(e,u.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.hardforkBlockBN(t);return!!r&&r.eq(e)},t.prototype.nextHardforkBlock=function(e){var t=this.nextHardforkBlockBN(e);return(0,u.toType)(t,u.TypeOutput.Number)},t.prototype.nextHardforkBlockBN=function(e){e=this._chooseHardfork(e,!1);var t=this.hardforkBlockBN(e);if(null===t)return null;var r=this.hardforks().reduce((function(e,r){var a=new u.BN(r.block);return a.gt(t)&&null===e?a:e}),null);return r},t.prototype.isNextHardforkBlock=function(e,t){e=(0,u.toType)(e,u.TypeOutput.BN),t=this._chooseHardfork(t,!1);var r=this.nextHardforkBlockBN(t);return null!==r&&r.eq(e)},t.prototype._calcForkHash=function(e){var t,r,n=a.from(this.genesis().hash.substr(2),"hex"),i=a.alloc(0),f=0;try{for(var o=c(this.hardforks()),d=o.next();!d.done;d=o.next()){var b=d.value,h=b.block;if(0!==h&&null!==h&&h!==f){var l=a.from(h.toString(16).padStart(16,"0"),"hex");i=a.concat([i,l])}if(b.name===e)break;null!==h&&(f=h)}}catch(m){t={error:m}}finally{try{d&&!d.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}var p=a.concat([n,i]),x=(0,u.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 r="No fork hash calculation possible for future hardfork";throw new Error(r)}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 r(31617);case"ropsten":return r(53712);case"rinkeby":return r(3023);case"kovan":return r(28777);case"goerli":return r(15382);case"sepolia":return r(81847)}if(this._customChains&&this._customChains.length>0&&Array.isArray(this._customChains[0]))try{for(var a=c(this._customChains),n=a.next();!n.done;n=a.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=a.return)&&t.call(a)}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,u.toType)(this.chainIdBN(),u.TypeOutput.Number)},t.prototype.chainIdBN=function(){return new u.BN(this._chainParams["chainId"])},t.prototype.chainName=function(){return this._chainParams["name"]},t.prototype.networkId=function(){return(0,u.toType)(this.networkIdBN(),u.TypeOutput.Number)},t.prototype.networkIdBN=function(){return new u.BN(this._chainParams["networkId"])},t.prototype.eips=function(){return this._eips},t.prototype.consensusType=function(){var e,t,r,a=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]&&(r=f[1]["consensus"]["type"]),f[0]===a)break}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r||this._chainParams["consensus"]["type"]},t.prototype.consensusAlgorithm=function(){var e,t,r,a=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]&&(r=f[1]["consensus"]["algorithm"]),f[0]===a)break}}catch(o){e={error:o}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r||this._chainParams["consensus"]["algorithm"]},t.prototype.consensusConfig=function(){var e,t,r,a=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]&&(r=f[1]["consensus"][f[1]["consensus"]["algorithm"]]),f[0]===a)break}}catch(d){e={error:d}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}if(r)return r;var o=this.consensusAlgorithm();return this._chainParams["consensus"][o]},t.prototype.copy=function(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this)},t}(d.EventEmitter);t["default"]=p},30302:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(62859).Buffer}catch(I){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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(r(57973)),f=r(36799),o=r(52010),d=r(16261),s=r(77002),u=r(80233),b=r(40032),h=r(26768),l=r(28651),p=function(){function e(e,t,r,a){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===r&&(r=s.KECCAK256_RLP),void 0===a&&(a=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=a,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,a=t.balance,n=t.stateRoot,i=t.codeHash;return new e(r?new f.BN((0,u.toBuffer)(r)):void 0,a?new f.BN((0,u.toBuffer)(a)):void 0,n?(0,u.toBuffer)(n):void 0,i?(0,u.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 r=n(t,4),a=r[0],i=r[1],c=r[2],o=r[3];return new e(new f.BN(a),new f.BN(i),c,o)},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 r=(0,d.stripHexPrefix)(e).toLowerCase(),a="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);a=n.toString()+"0x"}for(var i=(0,b.keccakFromString)(a+r).toString("hex"),c="0x",f=0;f=8?c+=r[f].toUpperCase():c+=r[f];return c};t.toChecksumAddress=m;var v=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.isValidChecksumAddress=v;var g=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new f.BN(t);return r.isZero()?(0,b.rlphash)([e,null]).slice(-20):(0,b.rlphash)([e,a.from(r.toArray())]).slice(-20)};t.generateAddress=g;var y=function(e,t,r){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,b.keccak256)(a.concat([a.from("ff","hex"),e,t,(0,b.keccak256)(r)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,o.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,o.publicKeyVerify)(a.concat([a.from([4]),e])):!!t&&(0,o.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,b.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),a.from((0,o.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=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,u.zeros)(e);return(0,u.bufferToHex)(t)};t.zeroAddress=E;var T=function(e){try{(0,h.assertIsString)(e)}catch(a){return!1}var r=(0,t.zeroAddress)();return r===e};t.isZeroAddress=T},96607:function(e,t,r){"use strict";var a=r(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(r(57973)),c=r(36799),f=r(80233),o=r(6151),d=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,o.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(a.isBuffer(t),"Public key should be Buffer");var r=(0,o.pubToAddress)(t);return new e(r)},e.fromPrivateKey=function(t){(0,i.default)(a.isBuffer(t),"Private key should be Buffer");var r=(0,o.privateToAddress)(t);return new e(r)},e.generate=function(t,r){return(0,i.default)(c.BN.isBN(r)),new e((0,o.generateAddress)(t.buf,r.toArrayLike(a)))},e.generate2=function(t,r,n){return(0,i.default)(a.isBuffer(r)),(0,i.default)(a.isBuffer(n)),new e((0,o.generateAddress2)(t.buf,r,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),r=new c.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return a.from(this.buf)},e}();t.Address=d},80233:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),r(48675),r(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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=r(36799),f=r(16261),o=r(26768),d=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=d;var s=function(e){var r=(0,t.intToHex)(e);return a.from((0,f.padToEven)(r.slice(2)),"hex")};t.intToBuffer=s;var u=function(e){return a.allocUnsafe(e).fill(0)};t.zeros=u;var b=function(e,r,a){var n=(0,t.zeros)(r);return a?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,o.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,o.assertIsArray)(e),p(e)};t.unpadArray=m;var v=function(e){return(0,o.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=v;var g=function(e){if(null===e||void 0===e)return a.allocUnsafe(0);if(a.isBuffer(e))return a.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return a.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 a.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(a)}if(e.toArray)return a.from(e.toArray());if(e.toBuffer)return a.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=g;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 a.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 r=a.from(e.replace(t,""),"hex");return r.toString("utf8")};t.toUtf8=A;var S=function(e){if(a.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],n=0;n0&&0===d[0])throw new Error("".concat(o," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}};function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):a.from(e)}function P(e){return Array.isArray(e)?e.map((function(e){return P(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=T,t.bufArrToArr=P},77002:function(e,t,r){"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 a=r(15361),n=r(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=a.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=a.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=a.Buffer.from(t.KECCAK256_RLP_S,"hex")},36799:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);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(r(30302));t.BN=f.default;var o=i(r(98217));t.rlp=o},40032:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(92802),i=r(65443),c=r(36799),f=r(80233),o=r(26768),d=function(e,t){switch(void 0===t&&(t=256),(0,o.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=d;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var u=function(e,r){void 0===r&&(r=256),(0,o.assertIsString)(e);var n=a.from(e,"utf8");return(0,t.keccak)(n,r)};t.keccakFromString=u;var b=function(e,r){return void 0===r&&(r=256),(0,o.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromHexString=b;var h=function(e,r){return void 0===r&&(r=256),(0,o.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,o.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,o.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,o.assertIsArray)(e),l(e)};t.sha256FromArray=m;var v=function(e,t){e=(0,f.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(r,32):r},g=function(e,t){return(0,o.assertIsBuffer)(e),v(e,t)};t.ripemd160=g;var y=function(e,t){return(0,o.assertIsString)(e),v(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,o.assertIsArray)(e),v(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},26768:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=r(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(!a.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 o=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=o},64466:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};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(r(77002),t),n(r(6151),t),n(r(96607),t),n(r(40032),t),n(r(43292),t),n(r(80233),t),n(r(2364),t),n(r(36799),t),n(r(28651),t);var i=r(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,r){"use strict";var a=r(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]}r(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 a.byteLength(e,"utf8")}function o(e,t,r){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[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function d(e){var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);r=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[r]=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})})),r)if("string"===typeof r&&(r=a.from((0,c.stripHexPrefix)(r),"hex")),a.isBuffer(r)&&(r=f.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,o.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var n=Object.keys(r);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}};t.defineProperties=d},43292:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(52010),i=r(36799),c=r(80233),f=r(40032),o=r(26768),d=r(28651);function s(e,t,r){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,o=a.from(c.slice(0,32)),s=a.from(c.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var u=r?f+(2*r+35):f+27;return{r:o,s:s,v:u}}var b=(0,d.toType)(r,d.TypeOutput.BN),h=b.muln(2).addn(35).addn(f).toArrayLike(a);return{r:o,s:s,v:h}}function u(e,t){var r=(0,d.toType)(e,d.TypeOutput.BN);if(!t)return r.subn(27);var a=(0,d.toType)(t,d.TypeOutput.BN);return r.sub(a.muln(2).addn(35))}function b(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,r,i,f){var o=a.concat([(0,c.setLengthLeft)(r,32),(0,c.setLengthLeft)(i,32)],64),d=u(t,f);if(!b(d))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(o,d.toNumber(),e);return a.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(r,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");var f=(0,d.toType)(e,d.TypeOutput.Number),o=r;return(f>28&&f%2===1||1===f||28===f)&&(o=a.from(r),o[0]|=128),(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(o,32)]))};t.toCompactSig=p;var x=function(e){var t,r,a,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(32,33))>>7,r[0]&=127}return a<27&&(a+=27),{v:a,r:t,s:r}};t.fromRpcSig=x;var m=function(e,t,r,a,n){void 0===a&&(a=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!b(u(e,n)))return!1;var o=new i.BN(t),d=new i.BN(r);return!(o.isZero()||o.gt(f)||d.isZero()||d.gt(f))&&(!a||1!==d.cmp(c))};t.isValidSignature=m;var v=function(e){(0,o.assertIsBuffer)(e);var t=a.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(a.concat([t,e]))};t.hashPersonalMessage=v},28651:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=r(36799),c=r(16261),f=r(80233);function o(e){return"0x".concat(e.toString(16))}function d(e){return(0,f.unpadBuffer)(e.toArrayLike(a))}function s(e){return d(e)}function u(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 r=(0,f.toBuffer)(e);if(t===n.Buffer)return r;if(t===n.BN)return new i.BN(r);if(t===n.Number){var a=new i.BN(r),o=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(a.gt(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return a.toNumber()}return"0x".concat(r.toString("hex"))}}t.bnToHex=o,t.bnToUnpaddedBuffer=d,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=u},78193:function(e,t,r){"use strict";r(21703);var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);return n(t,e),t},c=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},f=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseTransaction=void 0;var o=i(r(82099)),d=r(25327),s=r(98829),u=function(){function e(e){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=o.Chain.Mainnet,this.DEFAULT_HARDFORK=o.Hardfork.Istanbul;var t=e.nonce,r=e.gasLimit,a=e.to,n=e.value,i=e.data,c=e.v,f=e.r,s=e.s,u=e.type;this._type=new d.BN((0,d.toBuffer)(u)).toNumber();var b=(0,d.toBuffer)(""===a?"0x":a),h=(0,d.toBuffer)(""===c?"0x":c),l=(0,d.toBuffer)(""===f?"0x":f),p=(0,d.toBuffer)(""===s?"0x":s);this.nonce=new d.BN((0,d.toBuffer)(""===t?"0x":t)),this.gasLimit=new d.BN((0,d.toBuffer)(""===r?"0x":r)),this.to=b.length>0?new d.Address(b):void 0,this.value=new d.BN((0,d.toBuffer)(""===n?"0x":n)),this.data=(0,d.toBuffer)(""===i?"0x":i),this.v=h.length>0?new d.BN(h):void 0,this.r=l.length>0?new d.BN(l):void 0,this.s=p.length>0?new d.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"),r=0,a=0;a-1&&this.activeCapabilities.splice(u,1)}return o},e.prototype._getCommon=function(e,t){var r;if(t){var a=new d.BN((0,d.toBuffer)(t));if(e){if(!e.chainIdBN().eq(a)){var n=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(n)}return e.copy()}return o.default.isSupportedChainId(a)?new o.default({chain:a,hardfork:this.DEFAULT_HARDFORK}):o.default.forCustomChain(this.DEFAULT_CHAIN,{name:"custom-chain",networkId:a,chainId:a},this.DEFAULT_HARDFORK)}return null!==(r=null===e||void 0===e?void 0:e.copy())&&void 0!==r?r:new o.default({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})},e.prototype._validateCannotExceedMaxInteger=function(e,t,r){var a,n;void 0===t&&(t=256),void 0===r&&(r=!1);try{for(var i=c(Object.entries(e)),o=i.next();!o.done;o=i.next()){var s=f(o.value,2),u=s[0],b=s[1];switch(t){case 64:if(r){if(null===b||void 0===b?void 0:b.gte(d.MAX_UINT64)){var h=this._errorMsg("".concat(u," cannot equal or exceed MAX_UINT64 (2^64-1), given ").concat(b));throw new Error(h)}}else if(null===b||void 0===b?void 0:b.gt(d.MAX_UINT64)){h=this._errorMsg("".concat(u," cannot exceed MAX_UINT64 (2^64-1), given ").concat(b));throw new Error(h)}break;case 256:if(r){if(null===b||void 0===b?void 0:b.gte(d.MAX_INTEGER)){h=this._errorMsg("".concat(u," cannot equal or exceed MAX_INTEGER (2^256-1), given ").concat(b));throw new Error(h)}}else if(null===b||void 0===b?void 0:b.gt(d.MAX_INTEGER)){h=this._errorMsg("".concat(u," cannot exceed MAX_INTEGER (2^256-1), given ").concat(b));throw new Error(h)}break;default:h=this._errorMsg("unimplemented bits value");throw new Error(h)}}}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}},e.prototype._getSharedErrorPostfix=function(){var e="";try{e=this.isSigned()?(0,d.bufferToHex)(this.hash()):"not available (unsigned)"}catch(n){e="error"}var t="";try{t=this.isSigned().toString()}catch(n){e="error"}var r="";try{r=this.common.hardfork()}catch(n){r="error"}var a="tx type=".concat(this.type," hash=").concat(e," nonce=").concat(this.nonce," value=").concat(this.value," ");return a+="signed=".concat(t," hf=").concat(r),a},e}();t.BaseTransaction=u},95887:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,a=arguments.length;r0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0});var f=r(25327),o=r(78193),d=r(98829),s=r(56903),u=2,b=a.from(u.toString(16).padStart(2,"0"),"hex"),h=function(e){function t(t,r){var a,n;void 0===r&&(r={});var c=e.call(this,i(i({},t),{type:u}))||this;c.DEFAULT_HARDFORK="london";var o=t.chainId,b=t.accessList,h=t.maxFeePerGas,l=t.maxPriorityFeePerGas;if(c.common=c._getCommon(r.common,o),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!==b&&void 0!==b?b:[]);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===(a=c.s)||void 0===a?void 0:a.gt(d.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===r||void 0===r?void 0:r.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,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(b))throw new Error("Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: ".concat(u,", received: ").concat(e.slice(0,1).toString("hex")));var a=f.rlp.decode(e.slice(1));if(!Array.isArray(a))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(a,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),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 a=c(e,12),n=a[0],i=a[1],o=a[2],d=a[3],s=a[4],u=a[5],b=a[6],h=a[7],l=a[8],p=a[9],x=a[10],m=a[11];return(0,f.validateNoLeadingZeroes)({nonce:i,maxPriorityFeePerGas:o,maxFeePerGas:d,gasLimit:s,value:b,v:p,r:x,s:m}),new t({chainId:new f.BN(n),nonce:i,maxPriorityFeePerGas:o,maxFeePerGas:d,gasLimit:s,to:u,value:b,data:h,accessList:null!==l&&void 0!==l?l:[],v:void 0!==p?new f.BN(p):void 0,r:x,s:m},r)},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)),r=t.add(e);return this.gasLimit.mul(r).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:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):a.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):a.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):a.from([])]},t.prototype.serialize=function(){var e=this.raw();return a.concat([b,f.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,9),r=a.concat([b,f.rlp.encode(t)]);return e?(0,f.keccak256)(r):r},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 r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(d.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var a=this,n=a.v,i=a.r,c=a.s;try{return(0,f.ecrecover)(r,n.addn(27),(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(c))}catch(o){t=this._errorMsg("Invalid Signature");throw new Error(t)}},t.prototype._processSignature=function(e,r,a){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(r),s:new f.BN(a)},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}(o.BaseTransaction);t["default"]=h},17562:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,a=arguments.length;r0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0});var f=r(25327),o=r(78193),d=r(98829),s=r(56903),u=1,b=a.from(u.toString(16).padStart(2,"0"),"hex"),h=function(e){function t(t,r){var a,n;void 0===r&&(r={});var c=e.call(this,i(i({},t),{type:u}))||this;c.DEFAULT_HARDFORK="berlin";var o=t.chainId,b=t.accessList,h=t.gasPrice;if(c.common=c._getCommon(r.common,o),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!==b&&void 0!==b?b:[]);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===(a=c.s)||void 0===a?void 0:a.gt(d.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===r||void 0===r?void 0:r.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,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,r){if(void 0===r&&(r={}),!e.slice(0,1).equals(b))throw new Error("Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: ".concat(u,", received: ").concat(e.slice(0,1).toString("hex")));var a=f.rlp.decode(e.slice(1));if(!Array.isArray(a))throw new Error("Invalid serialized tx input: must be array");return t.fromValuesArray(a,r)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),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 a=c(e,11),n=a[0],i=a[1],o=a[2],d=a[3],s=a[4],u=a[5],b=a[6],h=a[7],l=a[8],p=a[9],x=a[10];(0,f.validateNoLeadingZeroes)({nonce:i,gasPrice:o,gasLimit:d,value:u,v:l,r:p,s:x});var m=[];return new t({chainId:new f.BN(n),nonce:i,gasPrice:o,gasLimit:d,to:s,value:u,data:b,accessList:null!==h&&void 0!==h?h:m,v:void 0!==l?new f.BN(l):void 0,r:p,s:x},r)},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:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):a.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):a.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):a.from([])]},t.prototype.serialize=function(){var e=this.raw();return a.concat([b,f.rlp.encode(e)])},t.prototype.getMessageToSign=function(e){void 0===e&&(e=!0);var t=this.raw().slice(0,8),r=a.concat([b,f.rlp.encode(t)]);return e?(0,f.keccak256)(r):r},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 r=this.getMessageToVerifySignature();if(this.common.gteHardfork("homestead")&&(null===(e=this.s)||void 0===e?void 0:e.gt(d.N_DIV_2))){t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}var a=this,n=a.yParity,i=a.r,c=a.s;try{return(0,f.ecrecover)(r,n.addn(27),(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(c))}catch(o){t=this._errorMsg("Invalid Signature");throw new Error(t)}},t.prototype._processSignature=function(e,r,a){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(r),s:new f.BN(a)},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,r=this._getSharedErrorPostfix();return r+=" gasPrice=".concat(this.gasPrice," accessListCount=").concat(null!==(t=null===(e=this.accessList)||void 0===e?void 0:e.length)&&void 0!==t?t:0),r},t.prototype._errorMsg=function(e){return"".concat(e," (").concat(this.errorStr(),")")},t}(o.BaseTransaction);t["default"]=h},89883:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},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=r(69903);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return i(c).default}});var f=r(17562);Object.defineProperty(t,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return i(f).default}});var o=r(62607);Object.defineProperty(t,"TransactionFactory",{enumerable:!0,get:function(){return i(o).default}});var d=r(95887);Object.defineProperty(t,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return i(d).default}}),n(r(98829),t)},69903:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!==typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,a=arguments.length;r0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.call(i)}finally{if(n)throw n.error}}return c};Object.defineProperty(t,"__esModule",{value:!0});var f=r(25327),o=r(98829),d=r(78193),s=0,u=function(e){function t(t,r){var a;void 0===r&&(r={});var n=e.call(this,i(i({},t),{type:s}))||this;if(n.common=n._validateTxV(n.v,r.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 d=n.v,u=n.common.chainIdBN().muln(2);(d.eq(u.addn(35))||d.eq(u.addn(36)))&&n.activeCapabilities.push(o.Capability.EIP155ReplayProtection)}else n.activeCapabilities.push(o.Capability.EIP155ReplayProtection);var b=null===(a=null===r||void 0===r?void 0:r.freeze)||void 0===a||a;return b&&Object.freeze(n),n}return n(t,e),t.fromTxData=function(e,r){return void 0===r&&(r={}),new t(e,r)},t.fromSerializedTx=function(e,t){void 0===t&&(t={});var r=f.rlp.decode(e);if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,t)},t.fromRlpSerializedTx=function(e,r){return void 0===r&&(r={}),t.fromSerializedTx(e,r)},t.fromValuesArray=function(e,r){if(void 0===r&&(r={}),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 a=c(e,9),n=a[0],i=a[1],o=a[2],d=a[3],s=a[4],u=a[5],b=a[6],h=a[7],l=a[8];return(0,f.validateNoLeadingZeroes)({nonce:n,gasPrice:i,gasLimit:o,value:s,v:b,r:h,s:l}),new t({nonce:n,gasPrice:i,gasLimit:o,to:d,value:s,data:u,v:b,r:h,s:l},r)},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:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,f.bnToUnpaddedBuffer)(this.v):a.from([]),void 0!==this.r?(0,f.bnToUnpaddedBuffer)(this.r):a.from([]),void 0!==this.s?(0,f.bnToUnpaddedBuffer)(this.s):a.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:a.from([]),(0,f.bnToUnpaddedBuffer)(this.value),this.data];return this.supports(o.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(o.N_DIV_2))){var r=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(r)}var a=this,n=a.v,i=a.r,c=a.s;try{return(0,f.ecrecover)(t,n,(0,f.bnToUnpaddedBuffer)(i),(0,f.bnToUnpaddedBuffer)(c),this.supports(o.Capability.EIP155ReplayProtection)?this.common.chainIdBN():void 0)}catch(d){r=this._errorMsg("Invalid Signature");throw new Error(r)}},t.prototype._processSignature=function(e,r,a){var n=new f.BN(e);this.supports(o.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(r),s:new f.BN(a)},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 r;if(void 0!==e&&!e.eqn(0)&&(!t||t.gteHardfork("spuriousDragon"))&&!e.eqn(27)&&!e.eqn(28))if(t){var a=t.chainIdBN().muln(2),n=e.eq(a.addn(35))||e.eq(a.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,r=e.subn(i).divn(2)}return this._getCommon(t,r)},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"),r=this.v,a=this.common.chainIdBN().muln(2),n=r.eq(a.addn(35))||r.eq(a.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}(d.BaseTransaction);t["default"]=u},62607:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0});var n=r(25327),i=r(89883),c=function(){function e(){}return e.fromTxData=function(e,t){if(void 0===t&&(t={}),"type"in e&&void 0!==e.type){var r=new n.BN((0,n.toBuffer)(e.type)).toNumber();if(0===r)return i.Transaction.fromTxData(e,t);if(1===r)return i.AccessListEIP2930Transaction.fromTxData(e,t);if(2===r)return i.FeeMarketEIP1559Transaction.fromTxData(e,t);throw new Error("Tx instantiation with type ".concat(r," not supported"))}return i.Transaction.fromTxData(e,t)},e.fromSerializedData=function(e,t){if(void 0===t&&(t={}),e[0]<=127){var r=void 0;switch(e[0]){case 1:r=2930;break;case 2:r=1559;break;default:throw new Error("TypedTransaction with ID ".concat(e[0]," unknown"))}return 1559===r?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={}),a.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 r=0==e||e>=128&&e<=255;if(r)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,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.N_DIV_2=t.isAccessList=t.isAccessListBuffer=t.Capability=void 0;var a=r(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 a.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16)},56903:function(e,t,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.AccessLists=void 0;var a=r(25327),n=r(98829),i=function(){function e(){}return e.getAccessListData=function(e){var t,r;if(e&&(0,n.isAccessList)(e)){t=e;for(var i=[],c=0;c=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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(r(54185)),f=r(45928),o=r(52010),d=r(56019),s=r(48630),u=r(22025),b=r(9129),h=r(1397),l=r(52831),p=function(){function e(e,t,r,a){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===r&&(r=s.KECCAK256_RLP),void 0===a&&(a=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=a,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,a=t.balance,n=t.stateRoot,i=t.codeHash;return new e(r?new f.BN((0,u.toBuffer)(r)):void 0,a?new f.BN((0,u.toBuffer)(a)):void 0,n?(0,u.toBuffer)(n):void 0,i?(0,u.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 r=n(t,4),a=r[0],i=r[1],c=r[2],o=r[3];return new e(new f.BN(a),new f.BN(i),c,o)},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 r=(0,d.stripHexPrefix)(e).toLowerCase(),a="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);a=n.toString()+"0x"}for(var i=(0,b.keccakFromString)(a+r).toString("hex"),c="0x",f=0;f=8?c+=r[f].toUpperCase():c+=r[f];return c};t.toChecksumAddress=m;var v=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.isValidChecksumAddress=v;var g=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new f.BN(t);return r.isZero()?(0,b.rlphash)([e,null]).slice(-20):(0,b.rlphash)([e,a.from(r.toArray())]).slice(-20)};t.generateAddress=g;var y=function(e,t,r){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,b.keccak256)(a.concat([a.from("ff","hex"),e,t,(0,b.keccak256)(r)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,o.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,o.publicKeyVerify)(a.concat([a.from([4]),e])):!!t&&(0,o.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,b.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),a.from((0,o.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=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,u.zeros)(e);return(0,u.bufferToHex)(t)};t.zeroAddress=E;var T=function(e){try{(0,h.assertIsString)(e)}catch(a){return!1}var r=(0,t.zeroAddress)();return r===e};t.isZeroAddress=T},99034:function(e,t,r){"use strict";var a=r(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(r(54185)),c=r(45928),f=r(22025),o=r(68031),d=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,o.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(a.isBuffer(t),"Public key should be Buffer");var r=(0,o.pubToAddress)(t);return new e(r)},e.fromPrivateKey=function(t){(0,i.default)(a.isBuffer(t),"Private key should be Buffer");var r=(0,o.privateToAddress)(t);return new e(r)},e.generate=function(t,r){return(0,i.default)(c.BN.isBN(r)),new e((0,o.generateAddress)(t.buf,r.toArrayLike(a)))},e.generate2=function(t,r,n){return(0,i.default)(a.isBuffer(r)),(0,i.default)(a.isBuffer(n)),new e((0,o.generateAddress2)(t.buf,r,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),r=new c.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return a.from(this.buf)},e}();t.Address=d},22025:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),r(48675),r(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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=r(45928),f=r(56019),o=r(1397),d=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=d;var s=function(e){var r=(0,t.intToHex)(e);return a.from((0,f.padToEven)(r.slice(2)),"hex")};t.intToBuffer=s;var u=function(e){return a.allocUnsafe(e).fill(0)};t.zeros=u;var b=function(e,r,a){var n=(0,t.zeros)(r);return a?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,o.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,o.assertIsArray)(e),p(e)};t.unpadArray=m;var v=function(e){return(0,o.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=v;var g=function(e){if(null===e||void 0===e)return a.allocUnsafe(0);if(a.isBuffer(e))return a.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return a.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 a.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(a)}if(e.toArray)return a.from(e.toArray());if(e.toBuffer)return a.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=g;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 a.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 r=a.from(e.replace(t,""),"hex");return r.toString("utf8")};t.toUtf8=A;var S=function(e){if(a.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],n=0;n0&&0===d[0])throw new Error("".concat(o," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}};function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):a.from(e)}function P(e){return Array.isArray(e)?e.map((function(e){return P(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=T,t.bufArrToArr=P},48630:function(e,t,r){"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 a=r(15361),n=r(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=a.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=a.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=a.Buffer.from(t.KECCAK256_RLP_S,"hex")},45928:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);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(r(24660));t.BN=f.default;var o=i(r(98217));t.rlp=o},9129:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(92802),i=r(65443),c=r(45928),f=r(22025),o=r(1397),d=function(e,t){switch(void 0===t&&(t=256),(0,o.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=d;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var u=function(e,r){void 0===r&&(r=256),(0,o.assertIsString)(e);var n=a.from(e,"utf8");return(0,t.keccak)(n,r)};t.keccakFromString=u;var b=function(e,r){return void 0===r&&(r=256),(0,o.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromHexString=b;var h=function(e,r){return void 0===r&&(r=256),(0,o.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,o.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,o.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,o.assertIsArray)(e),l(e)};t.sha256FromArray=m;var v=function(e,t){e=(0,f.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(r,32):r},g=function(e,t){return(0,o.assertIsBuffer)(e),v(e,t)};t.ripemd160=g;var y=function(e,t){return(0,o.assertIsString)(e),v(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,o.assertIsArray)(e),v(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},1397:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=r(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(!a.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 o=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=o},25327:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};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(r(48630),t),n(r(68031),t),n(r(99034),t),n(r(9129),t),n(r(41596),t),n(r(22025),t),n(r(69161),t),n(r(45928),t),n(r(52831),t);var i=r(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,r){"use strict";var a=r(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]}r(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 a.byteLength(e,"utf8")}function o(e,t,r){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[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function d(e){var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);r=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[r]=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})})),r)if("string"===typeof r&&(r=a.from((0,c.stripHexPrefix)(r),"hex")),a.isBuffer(r)&&(r=f.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,o.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var n=Object.keys(r);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}};t.defineProperties=d},41596:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(52010),i=r(45928),c=r(22025),f=r(9129),o=r(1397),d=r(52831);function s(e,t,r){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,o=a.from(c.slice(0,32)),s=a.from(c.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var u=r?f+(2*r+35):f+27;return{r:o,s:s,v:u}}var b=(0,d.toType)(r,d.TypeOutput.BN),h=b.muln(2).addn(35).addn(f).toArrayLike(a);return{r:o,s:s,v:h}}function u(e,t){var r=(0,d.toType)(e,d.TypeOutput.BN);if(!t)return r.subn(27);var a=(0,d.toType)(t,d.TypeOutput.BN);return r.sub(a.muln(2).addn(35))}function b(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,r,i,f){var o=a.concat([(0,c.setLengthLeft)(r,32),(0,c.setLengthLeft)(i,32)],64),d=u(t,f);if(!b(d))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(o,d.toNumber(),e);return a.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(r,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");var f=(0,d.toType)(e,d.TypeOutput.Number),o=r;return(f>28&&f%2===1||1===f||28===f)&&(o=a.from(r),o[0]|=128),(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(o,32)]))};t.toCompactSig=p;var x=function(e){var t,r,a,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(32,33))>>7,r[0]&=127}return a<27&&(a+=27),{v:a,r:t,s:r}};t.fromRpcSig=x;var m=function(e,t,r,a,n){void 0===a&&(a=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!b(u(e,n)))return!1;var o=new i.BN(t),d=new i.BN(r);return!(o.isZero()||o.gt(f)||d.isZero()||d.gt(f))&&(!a||1!==d.cmp(c))};t.isValidSignature=m;var v=function(e){(0,o.assertIsBuffer)(e);var t=a.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(a.concat([t,e]))};t.hashPersonalMessage=v},52831:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=r(45928),c=r(56019),f=r(22025);function o(e){return"0x".concat(e.toString(16))}function d(e){return(0,f.unpadBuffer)(e.toArrayLike(a))}function s(e){return d(e)}function u(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 r=(0,f.toBuffer)(e);if(t===n.Buffer)return r;if(t===n.BN)return new i.BN(r);if(t===n.Number){var a=new i.BN(r),o=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(a.gt(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return a.toNumber()}return"0x".concat(r.toString("hex"))}}t.bnToHex=o,t.bnToUnpaddedBuffer=d,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=u},50534:function(e,t,r){"use strict";r.d(t,{RQ:function(){return ee},_R:function(){return p}});var a=r(72224),n=r(48737);const i="abi/5.0.7",c=new n.Yd(i),f={};let o={calldata:!0,memory:!0,storage:!0},d={calldata:!0,memory:!0};function s(e,t){if("bytes"===e||"string"===e){if(o[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&d[t])return!0;return(o[t]||"payable"===t)&&c.throwArgumentError("invalid modifier","name",t),!1}function u(e,t){let r=e;function a(t){c.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function n(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}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 r(e){return p.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}return r(u(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=r(36482),v=(r(48675),r(3462),r(83966));const g=new n.Yd(i);class y{constructor(e,t,r,a){this.name=e,this.type=t,this.localName=r,this.dynamic=a}_throwError(e,t){g.throwArgumentError(e,this.localName,t)}}class w{constructor(e){(0,a.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 r=t.length%this.wordSize;return r&&(t=(0,m.zo)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,m.lE)(v.O$.from(e));return t.length>this.wordSize&&g.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,r,n){(0,a.zG)(this,"_data",(0,m.lE)(e)),(0,a.zG)(this,"wordSize",t||32),(0,a.zG)(this,"_coerceFunc",r),(0,a.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 r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):M.coerce(e,t)}_peekBytes(e,t,r){let a=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+a>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?a=t:g.throwError("data out-of-bounds",n.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+a})),this._data.slice(this._offset,this._offset+a)}subReader(e){return new M(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return v.O$.from(this.readBytes(this.wordSize))}}var _=r(80594);class k extends y{constructor(e){super("address","address",e,!1)}encode(e,t){try{(0,_.Kn)(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return(0,_.Kn)((0,m.$m)(e.readValue().toHexString(),20))}}r(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,r){let a=null;if(Array.isArray(r))a=r;else if(r&&"object"===typeof r){let e={};a=t.map((t=>{const a=t.localName;return a||S.throwError("cannot encode object for signature with missing names",n.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[a]&&S.throwError("cannot encode object for signature with duplicate names",n.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[a]=!0,r[a]}))}else S.throwArgumentError("invalid tuple value","tuple",r);t.length!==a.length&&S.throwArgumentError("types/value length mismatch","tuple",r);let i=new w(e.wordSize),c=new w(e.wordSize),f=[];t.forEach(((e,t)=>{let r=a[t];if(e.dynamic){let t=c.length;e.encode(c,r);let a=i.writeUpdatableValue();f.push((e=>{a(e+t)}))}else e.encode(i,r)})),f.forEach((e=>{e(i.length)}));let o=e.appendWriter(i);return o+=e.appendWriter(c),o}function T(e,t){let r=[],a=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),f=a.subReader(r.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&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let a=e.localName;if(!a||1!==i[a])return;if("length"===a&&(a="_length"),null!=r[a])return;const n=r[t];n instanceof Error?Object.defineProperty(r,a,{get:()=>{throw n}}):r[a]=n}));for(let n=0;n{throw e}})}return Object.freeze(r)}class P extends y{constructor(e,t,r){const a=e.type+"["+(t>=0?t:"")+"]",n=-1===t||e.dynamic;super("array",a,r,n),this.coder=e,this.length=t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),S.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let n=0;n>6!==2)break;e++}return e}return e===D.OVERRUN?r.length-t-1:0}function z(e,t,r,a,n){return e===D.OVERLONG?(a.push(n),0):(a.push(65533),q(e,t,r,a,n))}(function(e){e["current"]="",e["NFC"]="NFC",e["NFD"]="NFD",e["NFKC"]="NFKC",e["NFKD"]="NFKD"})(F||(F={})),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"}(D||(D={}));const K=Object.freeze({error:H,ignore:q,replace:z});function W(e,t){null==t&&(t=K.error),e=(0,m.lE)(e);const r=[];let a=0;while(a>7===0){r.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)){a+=t(128===(192&n)?D.UNEXPECTED_CONTINUE:D.BAD_PREFIX,a-1,e,r);continue}i=3,c=65535}if(a-1+i>=e.length){a+=t(D.OVERRUN,a-1,e,r);continue}let f=n&(1<<8-i-1)-1;for(let o=0;o1114111?a+=t(D.OUT_OF_RANGE,a-1-i,e,r,f):f>=55296&&f<=57343?a+=t(D.UTF16_SURROGATE,a-1-i,e,r,f):f<=c?a+=t(D.OVERLONG,a-1-i,e,r,f):r.push(f))}return r}function G(e,t=F.current){t!=F.current&&(j.checkNormalize(),e=e.normalize(t));let r=[];for(let a=0;a>6|192),r.push(63&t|128);else if(55296==(64512&t)){a++;const n=e.charCodeAt(a);if(a>=e.length||56320!==(64512&n))throw new Error("invalid utf-8 string");const i=65536+((1023&t)<<10)+(1023&n);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(t>>12|224),r.push(t>>6&63|128),r.push(63&t|128)}return(0,m.lE)(r)}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 Z(e,t){return V(W(e,t))}class $ extends B{constructor(e){super("string",e)}encode(e,t){return super.encode(e,G(t))}decode(e){return Z(super.decode(e))}}class J extends y{constructor(e,t){let r=!1;const a=[];e.forEach((e=>{e.dynamic&&(r=!0),a.push(e.type)}));const n="tuple("+a.join(",")+")";super("tuple",n,t,r),this.coders=e}encode(e,t){return E(e,this.coders,t)}decode(e){return e.coerce(this.name,T(e,this.coders))}}const Y=new n.Yd(i),X=new RegExp(/^bytes([0-9]*)$/),Q=new RegExp(/^(u?int)([0-9]*)$/);class ee{constructor(e){Y.checkNew(new.target,ee),(0,a.zG)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new k(e.name);case"bool":return new I(e.name);case"string":return new $(e.name);case"bytes":return new C(e.name);case"array":return new P(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new J((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new R(e.name)}let t=e.type.match(Q);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!==0)&&Y.throwArgumentError("invalid "+t[1]+" bit length","param",e),new L(r/8,"int"===t[1],e.name)}if(t=e.type.match(X),t){let r=parseInt(t[1]);return(0===r||r>32)&&Y.throwArgumentError("invalid bytes length","param",e),new O(r,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 r=e.map((e=>this._getCoder(p.from(e)))),a=new J(r,"_"),i=this._getWriter();return a.encode(i,t),i.data}decode(e,t,r){const a=e.map((e=>this._getCoder(p.from(e)))),n=new J(a,"_");return n.decode(this._getReader((0,m.lE)(t),r))}}new ee,new n.Yd(i)},80594:function(e,t,r){"use strict";r.d(t,{Kn:function(){return p}});r(48675),r(3462);var a=r(36482),n=r(83966),i=r(76502),c=r(48737);const f="address/5.6.0",o=new c.Yd(f);function d(e){(0,a.A7)(e,20)||o.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),r=new Uint8Array(40);for(let a=0;a<40;a++)r[a]=t[a].charCodeAt(0);const n=(0,a.lE)((0,i.w)(r));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(15&n[a>>1])>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const s=9007199254740991;function u(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const b={};for(let x=0;x<10;x++)b[String(x)]=String(x);for(let x=0;x<26;x++)b[String.fromCharCode(65+x)]=String(10+x);const h=Math.floor(u(s));function l(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map((e=>b[e])).join("");while(t.length>=h){let e=t.substring(0,h);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);while(r.length<2)r="0"+r;return r}function p(e){let t=null;if("string"!==typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.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)&&o.throwArgumentError("bad icap checksum","address",e),t=(0,n.g$)(e.substring(4));while(t.length<40)t="0"+t;t=d("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}},83966:function(e,t,r){"use strict";r.d(t,{O$:function(){return h},g$:function(){return v}});var a=r(92024),n=r.n(a),i=r(36482),c=r(48737);const f="bignumber/5.6.0";var o=n().BN;const d=new c.Yd(f),s={},u=9007199254740991;let b=!1;class h{constructor(e,t){d.checkNew(new.target,h),e!==s&&d.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 d.throwError("this platform does not support BigInt",c.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?b||(b=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",c.Yd.errors.UNEXPECTED_ARGUMENT,{}):d.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 o(e))):d.throwArgumentError("invalid BigNumber string","value",e);if("number"===typeof e)return e%1&&m("underflow","BigNumber.from",e),(e>=u||e<=-u)&&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 d.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]&&d.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 o("-"+t.substring(3),16):new o(t.substring(2),16)}function m(e,t,r){const a={fault:e,operation:t};return null!=r&&(a.value=r),d.throwError(e,c.Yd.errors.NUMERIC_FAULT,a)}function v(e){return new o(e,36).toString(16)}},92024:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(88677).Buffer}catch(E){}function f(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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"],u=[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 h(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function l(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?s[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:s[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function m(e,t,r){var a=new v;return a.mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):a<63?l(this,e,t):a<1024?x(this,e,t):m(this,e,t),r},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},v.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 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 a(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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 g[e]=t,t},A.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){"use strict";r.d(t,{lE:function(){return u},zo:function(){return b},xs:function(){return y},E1:function(){return v},p3:function(){return g},$m:function(){return w},Dv:function(){return m},_t:function(){return s},Zq:function(){return o},A7:function(){return p},N:function(){return M},G1:function(){return h}});r(48675),r(3462);var a=r(48737);const n="bytes/5.6.0",i=new a.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 o(e){return p(e)&&!(e.length%2)||s(e)}function d(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(!d(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function u(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 r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":i.throwArgumentError("hex data is odd-length","value",e));const a=[];for(let e=0;eu(e))),r=t.reduce(((e,t)=>e+t.length),0),a=new Uint8Array(r);return t.reduce(((e,t)=>(a.set(t,e),e+t.length)),0),f(a)}function h(e){let t=u(e);if(0===t.length)return t;let r=0;while(rt&&i.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),f(r)}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 r=0;r>4]+x[15&a]}return t}return i.throwArgumentError("invalid hexlify value","value",e)}function v(e){if("string"!==typeof e)e=m(e);else if(!p(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!==typeof e?e=m(e):(!p(e)||e.length%2)&&i.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"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(o(e)){let r=u(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=m(r.slice(0,32)),t.s=m(r.slice(32,64))):65===r.length?(t.r=m(r.slice(0,32)),t.s=m(r.slice(32,64)),t.v=r[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&&(r[32]|=128),t._vs=m(r.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 r=l(u(t._vs),32);t._vs=m(r);const a=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=a:t.recoveryParam!==a&&i.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const n=m(r);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 r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&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 r=u(t.s);r[0]>=128&&i.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const a=m(r);t._vs&&(p(t._vs)||i.throwArgumentError("signature invalid _vs","signature",e),t._vs=w(t._vs,32)),null==t._vs?t._vs=a:t._vs!==a&&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,r){"use strict";r.d(t,{Bz:function(){return f},_Y:function(){return i},fh:function(){return c},tL:function(){return n}});var a=r(83966);const n=a.O$.from(-1),i=a.O$.from(0),c=a.O$.from(1),f=a.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},76502:function(e,t,r){"use strict";r.d(t,{w:function(){return c}});var a=r(69893),n=r.n(a),i=r(36482);function c(e){return"0x"+n().keccak_256((0,i.lE)(e))}},48737:function(e,t,r){"use strict";r.d(t,{Yd:function(){return l}});r(21703),r(48675),r(3462);const a="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"],o=null;function d(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){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=d();var u,b;(function(e){e["DEBUG"]="DEBUG",e["INFO"]="INFO",e["WARNING"]="WARNING",e["ERROR"]="ERROR",e["OFF"]="OFF"})(u||(u={})),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"}(b||(b={}));const h="0123456789abcdef";class l{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==c[r]&&this.throwArgumentError("invalid log level name","logLevel",e),f>c[r]||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,r){if(i)return this.makeError("censored error",t,{});t||(t=l.errors.UNKNOWN_ERROR),r||(r={});const a=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=h[15&t[e]];a.push(e+"=Uint8Array(0x"+r+")")}else a.push(e+"="+JSON.stringify(t))}catch(f){a.push(e+"="+JSON.stringify(r[e].toString()))}})),a.push(`code=${t}`),a.push(`version=${this.version}`);const n=e;let c="";switch(t){case b.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 b.CALL_EXCEPTION:case b.INSUFFICIENT_FUNDS:case b.MISSING_NEW:case b.NONCE_EXPIRED:case b.REPLACEMENT_UNDERPRICED:case b.TRANSACTION_REPLACED:case b.UNPREDICTABLE_GAS_LIMIT:c=t;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(e+=" ("+a.join(", ")+")");const f=new Error(e);return f.reason=n,f.code=t,Object.keys(r).forEach((function(e){f[e]=r[e]})),f}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,l.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,a){e||this.throwError(t,r,a)}assertArgument(e,t,r,a){e||this.throwArgumentError(t,r,a)}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,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,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 o||(o=new l(a)),o}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=b,l.levels=u},72224:function(e,t,r){"use strict";r.d(t,{uj:function(){return f},zG:function(){return c}});var a=r(48737);const n="properties/5.6.0";const i=new a.Yd(n);function c(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function f(e,t){e&&"object"===typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}},26407:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(62808).Buffer}catch(E){}function f(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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"],u=[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 h(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function l(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?s[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:s[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function m(e,t,r){var a=new v;return a.mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):a<63?l(this,e,t):a<1024?x(this,e,t):m(this,e,t),r},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},v.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 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 a(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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 g[e]=t,t},A.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){"use strict";r.r(t),r.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 Ie}});r(21703);var a=r(80594),n=r(83966),i=r(36482),c=r(5554),f=r(76502),o=r(72224),d=r(48737);const s="rlp/5.6.0",u=new d.Yd(s);function b(e){const t=[];while(e)t.unshift(255&e),e>>=8;return t}function h(e,t,r){let a=0;for(let n=0;nt+1+a&&u.throwError("child data too short",d.Yd.errors.BUFFER_OVERRUN,{})}return{consumed:1+a,result:n}}function m(e,t){if(0===e.length&&u.throwError("data too short",d.Yd.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&u.throwError("data short segment too short",d.Yd.errors.BUFFER_OVERRUN,{});const a=h(e,t+1,r);return t+1+r+a>e.length&&u.throwError("data long segment too short",d.Yd.errors.BUFFER_OVERRUN,{}),x(e,t,t+1+r,r+a)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&u.throwError("data array too short",d.Yd.errors.BUFFER_OVERRUN,{}),x(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&u.throwError("data array too short",d.Yd.errors.BUFFER_OVERRUN,{});const a=h(e,t+1,r);t+1+r+a>e.length&&u.throwError("data array too short",d.Yd.errors.BUFFER_OVERRUN,{});const n=(0,i.Dv)(e.slice(t+1+r,t+1+r+a));return{consumed:1+r+a,result:n}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&u.throwError("data too short",d.Yd.errors.BUFFER_OVERRUN,{});const a=(0,i.Dv)(e.slice(t+1,t+1+r));return{consumed:1+r,result:a}}return{consumed:1,result:(0,i.Dv)(e[t])}}function v(e){const t=(0,i.lE)(e),r=m(t,0);return r.consumed!==t.length&&u.throwArgumentError("invalid rlp data","data",e),r.result}var g=r(26407),y=r.n(g),w=r(78730),M=r.n(w);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self&&self;function _(e,t,r){return r={path:t,exports:{},require:function(e,t){return k(e,void 0===t||null===t?r.path:t)}},e(r,r.exports),r.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,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var E=_((function(e,t){var r=t;function a(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!==typeof e){for(var a=0;a>8,c=255&n;i?r.push(i,c):r.push(c)}return r}function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r(n>>1)-1?(n>>1)-o:o,i.isubn(f)):f=0,a[c]=f,i.iushrn(1)}return a}function n(e,t){var r=[[],[]];e=e.clone(),t=t.clone();var a,n=0,i=0;while(e.cmpn(-n)>0||t.cmpn(-i)>0){var c,f,o=e.andln(3)+n&3,d=t.andln(3)+i&3;3===o&&(o=-1),3===d&&(d=-1),0===(1&o)?c=0:(a=e.andln(7)+n&7,c=3!==a&&5!==a||2!==d?o:-o),r[0].push(c),0===(1&d)?f=0:(a=t.andln(7)+i&7,f=3!==a&&5!==a||2!==o?d:-d),r[1].push(f),2*n===c+1&&(n=1-n),2*i===f+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function i(e,t,r){var a="_"+t;e.prototype[t]=function(){return void 0!==this[a]?this[a]:this[a]=r.call(this)}}function c(e){return"string"===typeof e?r.toArray(e,"hex"):e}function f(e){return new(y())(e,"hex","le")}r.assert=A,r.toArray=E.toArray,r.zero2=E.zero2,r.toHex=E.toHex,r.encode=E.encode,r.getNAF=a,r.getJSF=n,r.cachedProperty=i,r.parseBytes=c,r.intFromLE=f})),P=T.getNAF,I=T.getJSF,B=T.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var O=C;function R(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){B(e.precomputed);var r=e._getDoubles(),a=P(t,1,this._bitLength),n=(1<=i;o--)c=(c<<1)+a[o];f.push(c)}for(var d=this.jpoint(null,null,null),s=this.jpoint(null,null,null),u=n;u>0;u--){for(i=0;i=0;f--){for(var o=0;f>=0&&0===i[f];f--)o++;if(f>=0&&o++,c=c.dblp(o),f<0)break;var d=i[f];B(0!==d),c="affine"===e.type?d>0?c.mixedAdd(n[d-1>>1]):c.mixedAdd(n[-d-1>>1].neg()):d>0?c.add(n[d-1>>1]):c.add(n[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},C.prototype._wnafMulAdd=function(e,t,r,a,n){var i,c,f,o=this._wnafT1,d=this._wnafT2,s=this._wnafT3,u=0;for(i=0;i=1;i-=2){var h=i-1,l=i;if(1===o[h]&&1===o[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=I(r[h],r[l]);for(u=Math.max(m[0].length,u),s[h]=new Array(u),s[l]=new Array(u),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=d[c][k-1>>1]:k<0&&(f=d[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)},R.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],a=this,n=0;n=0&&(i=t,c=r),a.negative&&(a=a.neg(),n=n.neg()),i.negative&&(i=i.neg(),c=c.neg()),[{a:a,b:n},{a:i,b:c}]},U.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],a=t[1],n=a.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),c=n.mul(r.a),f=i.mul(a.a),o=n.mul(r.b),d=i.mul(a.b),s=e.sub(c).sub(f),u=o.add(d).neg();return{k1:s,k2:u}},U.prototype.pointFromX=function(e,t){e=new(y())(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),a=r.redSqrt();if(0!==a.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=a.fromRed().isOdd();return(t&&!n||!t&&n)&&(a=a.redNeg()),this.point(e,a)},U.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,a=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(a).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},U.prototype._endoWnafMulAdd=function(e,t,r){for(var a=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},F.prototype.isInfinity=function(){return this.inf},F.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 r=t.redSqr().redISub(this.x).redISub(e.x),a=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,a)},F.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,r=this.x.redSqr(),a=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(a),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)},F.prototype.getX=function(){return this.x.fromRed()},F.prototype.getY=function(){return this.y.fromRed()},F.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)},F.prototype.mulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n):this.curve._wnafMulAdd(1,a,n,2)},F.prototype.jmulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n,!0):this.curve._wnafMulAdd(1,a,n,2,!0)},F.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))},F.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,a=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(a)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(a)}}}return t},F.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(D,O.BasePoint),U.prototype.jpoint=function(e,t,r){return new D(this,e,t,r)},D.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),a=this.y.redMul(t).redMul(e);return this.curve.point(r,a)},D.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},D.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),a=this.x.redMul(t),n=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(r.redMul(this.z)),f=a.redSub(n),o=i.redSub(c);if(0===f.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=f.redSqr(),s=d.redMul(f),u=a.redMul(d),b=o.redSqr().redIAdd(s).redISub(u).redISub(u),h=o.redMul(u.redISub(b)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(b,h,l)},D.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,a=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),c=r.redSub(a),f=n.redSub(i);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=c.redSqr(),d=o.redMul(c),s=r.redMul(o),u=f.redSqr().redIAdd(d).redISub(s).redISub(s),b=f.redMul(s.redISub(u)).redISub(n.redMul(d)),h=this.z.redMul(c);return this.curve.jpoint(u,b,h)},D.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 r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},D.prototype.inspect=function(){return this.isInfinity()?"":""},D.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var H=_((function(e,t){var r=t;r.base=O,r.short=j,r.mont=null,r.edwards=null})),q=_((function(e,t){var r,a=t,n=T.assert;function i(e){"short"===e.type?this.curve=new H.short(e):"edwards"===e.type?this.curve=new H.edwards(e):this.curve=new H.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(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}a.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{r=null.crash()}catch(f){r=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",r]})}));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"),r=E.toArray(e.nonce,e.nonceEnc||"hex"),a=E.toArray(e.pers,e.persEnc||"hex");A(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,a)}var K=z;z.prototype._init=function(e,t,r){var a=e.concat(t).concat(r);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(r||[])),this._reseed=1},z.prototype.generate=function(e,t,r,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(a=r,r=t,t=null),r&&(r=E.toArray(r,a||"hex"),this._update(r));var n=[];while(n.length"};var Z=T.assert;function $(e,t){if(e instanceof $)return e;this._importDER(e,t)||(Z(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 J=$;function Y(){this.place=0}function X(e,t){var r=e[t.place++];if(!(128&r))return r;var a=15&r;if(0===a||a>4)return!1;for(var n=0,i=0,c=t.place;i>>=0;return!(n<=127)&&(t.place=c,n)}function Q(e){var t=0,r=e.length-1;while(!e[t]&&!(128&e[t+1])&&t>>3);e.push(128|r);while(--r)e.push(t>>>(r<<3)&255);e.push(t)}}$.prototype._importDER=function(e,t){e=T.toArray(e,t);var r=new Y;if(48!==e[r.place++])return!1;var a=X(e,r);if(!1===a)return!1;if(a+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var n=X(e,r);if(!1===n)return!1;var i=e.slice(r.place,n+r.place);if(r.place+=n,2!==e[r.place++])return!1;var c=X(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.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},$.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Q(t),r=Q(r);while(!r[0]&&!(128&r[1]))r=r.slice(1);var a=[2];ee(a,t.length),a=a.concat(t),a.push(2),ee(a,r.length);var n=a.concat(r),i=[48];return ee(i,n.length),i=i.concat(n),T.encode(i,e)};var te=function(){throw new Error("unsupported")},re=T.assert;function ae(e){if(!(this instanceof ae))return new ae(e);"string"===typeof e&&(re(Object.prototype.hasOwnProperty.call(q,e),"Unknown curve "+e),e=q[e]),e instanceof q.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=ae;ae.prototype.keyPair=function(e){return new V(this,e)},ae.prototype.keyFromPrivate=function(e,t){return V.fromPrivate(this,e,t)},ae.prototype.keyFromPublic=function(e,t){return V.fromPublic(this,e,t)},ae.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()}),r=this.n.byteLength(),a=this.n.sub(new(y())(2));;){var n=new(y())(t.generate(r));if(!(n.cmp(a)>0))return n.iaddn(1),this.keyFromPrivate(n)}},ae.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},ae.prototype.sign=function(e,t,r,a){"object"===typeof r&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),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:a.pers,persEnc:a.persEnc||"utf8"}),o=this.n.sub(new(y())(1)),d=0;;d++){var s=a.k?a.k(d):new(y())(f.generate(this.n.byteLength()));if(s=this._truncateToN(s,!0),!(s.cmpn(1)<=0||s.cmp(o)>=0)){var u=this.g.mul(s);if(!u.isInfinity()){var b=u.getX(),h=b.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=(u.getY().isOdd()?1:0)|(0!==b.cmp(h)?2:0);return a.canonical&&l.cmp(this.nh)>0&&(l=this.n.sub(l),p^=1),new J({r:h,s:l,recoveryParam:p})}}}}}},ae.prototype.verify=function(e,t,r,a){e=this._truncateToN(new(y())(e,16)),r=this.keyFromPublic(r,a),t=new J(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),o=f.mul(e).umod(this.n),d=f.mul(n).umod(this.n);return this.curve._maxwellTrick?(c=this.g.jmulAdd(o,r.getPublic(),d),!c.isInfinity()&&c.eqXToP(n)):(c=this.g.mulAdd(o,r.getPublic(),d),!c.isInfinity()&&0===c.getX().umod(this.n).cmp(n))},ae.prototype.recoverPubKey=function(e,t,r,a){re((3&r)===r,"The recovery param is more than two bits"),t=new J(t,a);var n=this.n,i=new(y())(e),c=t.r,f=t.s,o=1&r,d=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");c=d?this.curve.pointFromX(c.add(this.curve.n),o):this.curve.pointFromX(c,o);var s=t.r.invm(n),u=n.sub(i).mul(s).umod(n),b=f.mul(s).umod(n);return this.g.mulAdd(u,c,b)},ae.prototype.getKeyRecoveryParam=function(e,t,r,a){if(t=new J(t,a),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(r))return n}throw new Error("Unable to find valid recovery factor")};var ie=_((function(e,t){var r=t;r.version={version:"6.5.4"}.version,r.utils=T,r.rand=function(){throw new Error("unsupported")},r.curve=H,r.curves=q,r.ec=ne,r.eddsa=null})),ce=ie.ec;const fe="signing-key/5.6.0",oe=new d.Yd(fe);let de=null;function se(){return de||(de=new ce("secp256k1")),de}class ue{constructor(e){(0,o.zG)(this,"curve","secp256k1"),(0,o.zG)(this,"privateKey",(0,i.Dv)(e));const t=se().keyFromPrivate((0,i.lE)(this.privateKey));(0,o.zG)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,o.zG)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,o.zG)(this,"_isSigningKey",!0)}_addPoint(e){const t=se().keyFromPublic((0,i.lE)(this.publicKey)),r=se().keyFromPublic((0,i.lE)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=se().keyFromPrivate((0,i.lE)(this.privateKey)),r=(0,i.lE)(e);32!==r.length&&oe.throwArgumentError("bad digest length","digest",e);const a=t.sign(r,{canonical:!0});return(0,i.N)({recoveryParam:a.recoveryParam,r:(0,i.$m)("0x"+a.r.toString(16),32),s:(0,i.$m)("0x"+a.s.toString(16),32)})}computeSharedSecret(e){const t=se().keyFromPrivate((0,i.lE)(this.privateKey)),r=se().keyFromPublic((0,i.lE)(he(e)));return(0,i.$m)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function be(e,t){const r=(0,i.N)(t),a={r:(0,i.lE)(r.r),s:(0,i.lE)(r.s)};return"0x"+se().recoverPubKey((0,i.lE)(e),a,r.recoveryParam).encode("hex",!1)}function he(e,t){const r=(0,i.lE)(e);if(32===r.length){const e=new ue(r);return t?"0x"+se().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,i.Dv)(r):"0x"+se().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+se().keyFromPublic(r).getPublic(!0,"hex"):(0,i.Dv)(r):oe.throwArgumentError("invalid public or private key","key","[REDACTED]")}const le="transactions/5.6.0",pe=new d.Yd(le);var xe;function me(e){return"0x"===e?null:(0,a.Kn)(e)}function ve(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 ge=[{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,a.Kn)((0,i.p3)((0,f.w)((0,i.p3)(t,1)),12))}function Me(e,t){return we(be((0,i.lE)(e),t))}function _e(e,t){const r=(0,i.G1)(n.O$.from(e).toHexString());return r.length>32&&pe.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function ke(e,t){return{address:(0,a.Kn)(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,i.E1)(t)&&pe.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,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 r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return ke(t,Object.keys(r).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),r=n.O$.from(e.maxFeePerGas||0);t.eq(r)||pe.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[_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,a.Kn)(e.to):"0x",_e(e.value||0,"value"),e.data||"0x",Se(e.accessList||[])];if(t){const e=(0,i.N)(t);r.push(_e(e.recoveryParam,"recoveryParam")),r.push((0,i.G1)(e.r)),r.push((0,i.G1)(e.s))}return(0,i.xs)(["0x02",p(r)])}function Te(e,t){const r=[_e(e.chainId||0,"chainId"),_e(e.nonce||0,"nonce"),_e(e.gasPrice||0,"gasPrice"),_e(e.gasLimit||0,"gasLimit"),null!=e.to?(0,a.Kn)(e.to):"0x",_e(e.value||0,"value"),e.data||"0x",Se(e.accessList||[])];if(t){const e=(0,i.N)(t);r.push(_e(e.recoveryParam,"recoveryParam")),r.push((0,i.G1)(e.r)),r.push((0,i.G1)(e.s))}return(0,i.xs)(["0x01",p(r)])}function Pe(e,t){(0,o.uj)(e,ye);const r=[];ge.forEach((function(t){let a=e[t.name]||[];const n={};t.numeric&&(n.hexPad="left"),a=(0,i.lE)((0,i.Dv)(a,n)),t.length&&a.length!==t.length&&a.length>0&&pe.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,a),t.maxLength&&(a=(0,i.G1)(a),a.length>t.maxLength&&pe.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,a)),r.push((0,i.Dv)(a))}));let a=0;if(null!=e.chainId?(a=e.chainId,"number"!==typeof a&&pe.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,i.Zq)(t)&&t.v>28&&(a=Math.floor((t.v-35)/2)),0!==a&&(r.push((0,i.Dv)(a)),r.push("0x"),r.push("0x")),!t)return p(r);const n=(0,i.N)(t);let c=27+n.recoveryParam;return 0!==a?(r.pop(),r.pop(),r.pop(),c+=2*a+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),r.push((0,i.Dv)(c)),r.push((0,i.G1)((0,i.lE)(n.r))),r.push((0,i.G1)((0,i.lE)(n.s))),p(r)}function Ie(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),Pe(e,t);switch(e.type){case 1:return Te(e,t);case 2:return Ee(e,t);default:break}return pe.throwError(`unsupported transaction type: ${e.type}`,d.Yd.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Be(e,t,r){try{const r=ve(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(a){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)(r(e));e.from=Me(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(a){console.log(a)}}function Ce(e){const t=v(e.slice(1));9!==t.length&&12!==t.length&&pe.throwArgumentError("invalid component count for transaction type: 2","payload",(0,i.Dv)(e));const r=ve(t[2]),a=ve(t[3]),n={type:2,chainId:ve(t[0]).toNumber(),nonce:ve(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:a,gasPrice:null,gasLimit:ve(t[4]),to:me(t[5]),value:ve(t[6]),data:t[7],accessList:Ae(t[8])};return 9===t.length||(n.hash=(0,f.w)(e),Be(n,t.slice(9),Ee)),n}function Oe(e){const t=v(e.slice(1));8!==t.length&&11!==t.length&&pe.throwArgumentError("invalid component count for transaction type: 1","payload",(0,i.Dv)(e));const r={type:1,chainId:ve(t[0]).toNumber(),nonce:ve(t[1]).toNumber(),gasPrice:ve(t[2]),gasLimit:ve(t[3]),to:me(t[4]),value:ve(t[5]),data:t[6],accessList:Ae(t[7])};return 8===t.length||(r.hash=(0,f.w)(e),Be(r,t.slice(8),Te)),r}function Re(e){const t=v(e);9!==t.length&&6!==t.length&&pe.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:ve(t[0]).toNumber(),gasPrice:ve(t[1]),gasLimit:ve(t[2]),to:me(t[3]),value:ve(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=n.O$.from(t[6]).toNumber()}catch(a){return console.log(a),r}if(r.r=(0,i.$m)(t[7],32),r.s=(0,i.$m)(t[8],32),n.O$.from(r.r).isZero()&&n.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const c=t.slice(0,6);0!==r.chainId&&(c.push((0,i.Dv)(r.chainId)),c.push("0x"),c.push("0x"),n-=2*r.chainId+8);const o=(0,f.w)(p(c));try{r.from=Me(o,{r:(0,i.Dv)(r.r),s:(0,i.Dv)(r.s),recoveryParam:n})}catch(a){console.log(a)}r.hash=(0,f.w)(e)}return r.type=null,r}function Ne(e){const t=(0,i.lE)(e);if(t[0]>127)return Re(t);switch(t[0]){case 1:return Oe(t);case 2:return Ce(t);default:break}return pe.throwError(`unsupported transaction type: ${t[0]}`,d.Yd.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},73055:function(e,t,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0});const a=r(43793);function n(e,t,r){try{Reflect.apply(e,t,r)}catch(a){setTimeout((()=>{throw a}))}}function i(e){const t=e.length,r=new Array(t);for(let a=0;a0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const c=a[e];if(void 0===c)return!1;if("function"===typeof c)n(c,this,t);else{const e=c.length,r=i(c);for(let a=0;ac(e)))}var o=e=>e===window,d=(e,t)=>({top:0,left:0,right:e,bottom:t,width:e,height:t}),s=e=>{const t=(0,a.SU)(e);if(o(t)){const e=t.innerWidth,r=t.innerHeight;return d(e,r)}return(null==t?void 0:t.getBoundingClientRect)?t.getBoundingClientRect():d(0,0)};function u(e){const t=(0,n.f3)(e,null);if(t){const e=(0,n.FN)(),{link:r,unlink:a,internalChildren:i}=t;r(e),(0,n.Ah)((()=>a(e)));const c=(0,n.Fl)((()=>i.indexOf(e)));return{parent:t,index:c}}return{parent:null,index:(0,a.iH)(-1)}}function b(e){const t=[],r=e=>{Array.isArray(e)&&e.forEach((e=>{var a;(0,n.lA)(e)&&(t.push(e),(null==(a=e.component)?void 0:a.subTree)&&(t.push(e.component.subTree),r(e.component.subTree.children)),e.children&&r(e.children))}))};return r(e),t}function h(e,t,r){const a=b(e.subTree.children);r.sort(((e,t)=>a.indexOf(e.vnode)-a.indexOf(t.vnode)));const n=r.map((e=>e.proxy));t.sort(((e,t)=>{const r=n.indexOf(e),a=n.indexOf(t);return r-a}))}function l(e){const t=(0,a.qj)([]),r=(0,a.qj)([]),i=(0,n.FN)(),c=a=>{const c=e=>{e.proxy&&(r.push(e),t.push(e.proxy),h(i,t,r))},f=e=>{const a=r.indexOf(e);t.splice(a,1),r.splice(a,1)};(0,n.JJ)(e,Object.assign({link:c,unlink:f,children:t,internalChildren:r},a))};return{children:t,linkChildren:c}}var p,x;function m(e){let t;(0,n.bv)((()=>{e(),(0,n.Y3)((()=>{t=!0}))})),(0,n.dl)((()=>{t&&e()}))}function v(e,t,r={}){if(!i)return;const{target:c=window,passive:f=!1,capture:o=!1}=r;let d;const s=r=>{const n=(0,a.SU)(r);n&&!d&&(n.addEventListener(e,t,{capture:o,passive:f}),d=!0)},u=r=>{const n=(0,a.SU)(r);n&&d&&(n.removeEventListener(e,t,o),d=!1)};(0,n.Ah)((()=>u(c))),(0,n.se)((()=>u(c))),m((()=>s(c))),(0,a.dq)(c)&&(0,n.YP)(c,((e,t)=>{u(t),s(e)}))}function g(e,t,r={}){if(!i)return;const{eventName:n="click"}=r,c=r=>{const n=(0,a.SU)(e);n&&!n.contains(r.target)&&t(r)};v(n,c,{target:document})}function y(){if(!p&&(p=(0,a.iH)(0),x=(0,a.iH)(0),i)){const e=()=>{p.value=window.innerWidth,x.value=window.innerHeight};e(),window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0})}return{width:p,height:x}}var w,M=/scroll|auto/i,_=i?window:void 0;function k(e){const t=1;return"HTML"!==e.tagName&&"BODY"!==e.tagName&&e.nodeType===t}function A(e,t=_){let r=e;while(r&&r!==t&&k(r)){const{overflowY:e}=window.getComputedStyle(r);if(M.test(e))return r;r=r.parentNode}return t}function S(e,t=_){const r=(0,a.iH)();return(0,n.bv)((()=>{e.value&&(r.value=A(e.value,t))})),r}function E(){if(!w&&(w=(0,a.iH)("visible"),i)){const e=()=>{w.value=document.hidden?"hidden":"visible"};e(),window.addEventListener("visibilitychange",e)}return w}Symbol("van-field")},44870:function(e,t,r){"use strict";r.d(t,{Bj:function(){return i},Fl:function(){return qe},IU:function(){return Ee},Jd:function(){return _},PG:function(){return _e},SU:function(){return je},Um:function(){return ye},WL:function(){return De},X$:function(){return E},X3:function(){return Se},XI:function(){return Ne},Xl:function(){return Te},dq:function(){return Oe},iH:function(){return Re},j:function(){return A},lk:function(){return k},qj:function(){return ge},qq:function(){return g},yT:function(){return Ae}});var a=r(87139);let n;class i{constructor(e=!1){this.active=!0,this.effects=[],this.cleanups=[],!e&&n&&(this.parent=n,this.index=(n.scopes||(n.scopes=[])).push(this)-1)}run(e){if(this.active)try{return n=this,e()}finally{n=this.parent}else 0}on(){n=this}off(){n=this.parent}stop(e){if(this.active){let t,r;for(t=0,r=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},o=e=>(e.w&l)>0,d=e=>(e.n&l)>0,s=({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let r=0;for(let a=0;a{("length"===t||t>=n)&&d.push(e)}));else switch(void 0!==r&&d.push(o.get(r)),t){case"add":(0,a.kJ)(e)?(0,a.S0)(r)&&d.push(o.get("length")):(d.push(o.get(m)),(0,a._N)(e)&&d.push(o.get(v)));break;case"delete":(0,a.kJ)(e)||(d.push(o.get(m)),(0,a._N)(e)&&d.push(o.get(v)));break;case"set":(0,a._N)(e)&&d.push(o.get(m));break}if(1===d.length)d[0]&&T(d[0]);else{const e=[];for(const t of d)t&&e.push(...t);T(f(e))}}function T(e,t){for(const r of(0,a.kJ)(e)?e:[...e])(r!==x||r.allowRecurse)&&(r.scheduler?r.scheduler():r.run())}const P=(0,a.fY)("__proto__,__v_isRef,__isVue"),I=new Set(Object.getOwnPropertyNames(Symbol).map((e=>Symbol[e])).filter(a.yk)),B=L(),C=L(!1,!0),O=L(!0),R=N();function N(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const r=Ee(this);for(let t=0,n=this.length;t{e[t]=function(...e){_();const r=Ee(this)[t].apply(this,e);return k(),r}})),e}function L(e=!1,t=!1){return function(r,n,i){if("__v_isReactive"===n)return!e;if("__v_isReadonly"===n)return e;if("__v_isShallow"===n)return t;if("__v_raw"===n&&i===(e?t?xe:pe:t?le:he).get(r))return r;const c=(0,a.kJ)(r);if(!e&&c&&(0,a.RI)(R,n))return Reflect.get(R,n,i);const f=Reflect.get(r,n,i);if((0,a.yk)(n)?I.has(n):P(n))return f;if(e||A(r,"get",n),t)return f;if(Oe(f)){const e=!c||!(0,a.S0)(n);return e?f.value:f}return(0,a.Kn)(f)?e?we(f):ge(f):f}}const U=F(),j=F(!0);function F(e=!1){return function(t,r,n,i){let c=t[r];if(ke(c)&&Oe(c)&&!Oe(n))return!1;if(!e&&!ke(n)&&(Ae(n)||(n=Ee(n),c=Ee(c)),!(0,a.kJ)(t)&&Oe(c)&&!Oe(n)))return c.value=n,!0;const f=(0,a.kJ)(t)&&(0,a.S0)(r)?Number(r)e,V=e=>Reflect.getPrototypeOf(e);function Z(e,t,r=!1,a=!1){e=e["__v_raw"];const n=Ee(e),i=Ee(t);t!==i&&!r&&A(n,"get",t),!r&&A(n,"get",i);const{has:c}=V(n),f=a?G:r?Ie:Pe;return c.call(n,t)?f(e.get(t)):c.call(n,i)?f(e.get(i)):void(e!==n&&e.get(t))}function $(e,t=!1){const r=this["__v_raw"],a=Ee(r),n=Ee(e);return e!==n&&!t&&A(a,"has",e),!t&&A(a,"has",n),e===n?r.has(e):r.has(e)||r.has(n)}function J(e,t=!1){return e=e["__v_raw"],!t&&A(Ee(e),"iterate",m),Reflect.get(e,"size",e)}function Y(e){e=Ee(e);const t=Ee(this),r=V(t),a=r.has.call(t,e);return a||(t.add(e),E(t,"add",e,e)),this}function X(e,t){t=Ee(t);const r=Ee(this),{has:n,get:i}=V(r);let c=n.call(r,e);c||(e=Ee(e),c=n.call(r,e));const f=i.call(r,e);return r.set(e,t),c?(0,a.aU)(t,f)&&E(r,"set",e,t,f):E(r,"add",e,t),this}function Q(e){const t=Ee(this),{has:r,get:a}=V(t);let n=r.call(t,e);n||(e=Ee(e),n=r.call(t,e));const i=a?a.call(t,e):void 0,c=t.delete(e);return n&&E(t,"delete",e,void 0,i),c}function ee(){const e=Ee(this),t=0!==e.size,r=void 0,a=e.clear();return t&&E(e,"clear",void 0,void 0,r),a}function te(e,t){return function(r,a){const n=this,i=n["__v_raw"],c=Ee(i),f=t?G:e?Ie:Pe;return!e&&A(c,"iterate",m),i.forEach(((e,t)=>r.call(a,f(e),f(t),n)))}}function re(e,t,r){return function(...n){const i=this["__v_raw"],c=Ee(i),f=(0,a._N)(c),o="entries"===e||e===Symbol.iterator&&f,d="keys"===e&&f,s=i[e](...n),u=r?G:t?Ie:Pe;return!t&&A(c,"iterate",d?v:m),{next(){const{value:e,done:t}=s.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function ae(e){return function(...t){return"delete"!==e&&this}}function ne(){const e={get(e){return Z(this,e)},get size(){return J(this)},has:$,add:Y,set:X,delete:Q,clear:ee,forEach:te(!1,!1)},t={get(e){return Z(this,e,!1,!0)},get size(){return J(this)},has:$,add:Y,set:X,delete:Q,clear:ee,forEach:te(!1,!0)},r={get(e){return Z(this,e,!0)},get size(){return J(this,!0)},has(e){return $.call(this,e,!0)},add:ae("add"),set:ae("set"),delete:ae("delete"),clear:ae("clear"),forEach:te(!0,!1)},a={get(e){return Z(this,e,!0,!0)},get size(){return J(this,!0)},has(e){return $.call(this,e,!0)},add:ae("add"),set:ae("set"),delete:ae("delete"),clear:ae("clear"),forEach:te(!0,!0)},n=["keys","values","entries",Symbol.iterator];return n.forEach((n=>{e[n]=re(n,!1,!1),r[n]=re(n,!0,!1),t[n]=re(n,!1,!0),a[n]=re(n,!0,!0)})),[e,r,t,a]}const[ie,ce,fe,oe]=ne();function de(e,t){const r=t?e?oe:fe:e?ce:ie;return(t,n,i)=>"__v_isReactive"===n?!e:"__v_isReadonly"===n?e:"__v_raw"===n?t:Reflect.get((0,a.RI)(r,n)&&n in t?r:t,n,i)}const se={get:de(!1,!1)},ue={get:de(!1,!0)},be={get:de(!0,!1)};const he=new WeakMap,le=new WeakMap,pe=new WeakMap,xe=new WeakMap;function me(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ve(e){return e["__v_skip"]||!Object.isExtensible(e)?0:me((0,a.W7)(e))}function ge(e){return ke(e)?e:Me(e,!1,z,se,he)}function ye(e){return Me(e,!1,W,ue,le)}function we(e){return Me(e,!0,K,be,pe)}function Me(e,t,r,n,i){if(!(0,a.Kn)(e))return e;if(e["__v_raw"]&&(!t||!e["__v_isReactive"]))return e;const c=i.get(e);if(c)return c;const f=ve(e);if(0===f)return e;const o=new Proxy(e,2===f?n:r);return i.set(e,o),o}function _e(e){return ke(e)?_e(e["__v_raw"]):!(!e||!e["__v_isReactive"])}function ke(e){return!(!e||!e["__v_isReadonly"])}function Ae(e){return!(!e||!e["__v_isShallow"])}function Se(e){return _e(e)||ke(e)}function Ee(e){const t=e&&e["__v_raw"];return t?Ee(t):e}function Te(e){return(0,a.Nj)(e,"__v_skip",!0),e}const Pe=e=>(0,a.Kn)(e)?ge(e):e,Ie=e=>(0,a.Kn)(e)?we(e):e;function Be(e){w&&x&&(e=Ee(e),S(e.dep||(e.dep=f())))}function Ce(e,t){e=Ee(e),e.dep&&T(e.dep)}function Oe(e){return!(!e||!0!==e.__v_isRef)}function Re(e){return Le(e,!1)}function Ne(e){return Le(e,!0)}function Le(e,t){return Oe(e)?e:new Ue(e,t)}class Ue{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:Ee(e),this._value=t?e:Pe(e)}get value(){return Be(this),this._value}set value(e){e=this.__v_isShallow?e:Ee(e),(0,a.aU)(e,this._rawValue)&&(this._rawValue=e,this._value=this.__v_isShallow?e:Pe(e),Ce(this,e))}}function je(e){return Oe(e)?e.value:e}const Fe={get:(e,t,r)=>je(Reflect.get(e,t,r)),set:(e,t,r,a)=>{const n=e[t];return Oe(n)&&!Oe(r)?(n.value=r,!0):Reflect.set(e,t,r,a)}};function De(e){return _e(e)?e:new Proxy(e,Fe)}class He{constructor(e,t,r,a){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this._dirty=!0,this.effect=new g(e,(()=>{this._dirty||(this._dirty=!0,Ce(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!a,this["__v_isReadonly"]=r}get value(){const e=Ee(this);return Be(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function qe(e,t,r=!1){let n,i;const c=(0,a.mf)(e);c?(n=e,i=a.dG):(n=e.get,i=e.set);const f=new He(n,i,c||!i,r);return f}Promise.resolve()},73396:function(e,t,r){"use strict";r.d(t,{$d:function(){return c},Ah:function(){return Ce},Cn:function(){return H},FN:function(){return Sr},Fl:function(){return qr},HY:function(){return Ft},JJ:function(){return Y},Jd:function(){return Be},Ko:function(){return xr},P$:function(){return oe},Q6:function(){return le},U2:function(){return se},Uk:function(){return or},Us:function(){return wt},WI:function(){return mr},Wm:function(){return nr},Xn:function(){return Pe},Y3:function(){return M},Y8:function(){return ie},YP:function(){return ee},_:function(){return ar},aZ:function(){return pe},bv:function(){return Te},dD:function(){return D},dG:function(){return lr},dl:function(){return ge},f3:function(){return X},h:function(){return zr},iD:function(){return Jt},ic:function(){return Ie},j4:function(){return Yt},kq:function(){return sr},lA:function(){return Xt},lR:function(){return Ot},nK:function(){return he},se:function(){return ye},uE:function(){return dr},up:function(){return Nt},w5:function(){return q},wF:function(){return Ee},wg:function(){return Wt},wy:function(){return ht},xv:function(){return Dt}});r(21703);var a=r(44870),n=r(87139);function i(e,t,r,a){let n;try{n=a?e(...a):e()}catch(i){f(i,t,r)}return n}function c(e,t,r,a){if((0,n.mf)(e)){const c=i(e,t,r,a);return c&&(0,n.tI)(c)&&c.catch((e=>{f(e,t,r)})),c}const o=[];for(let n=0;n>>1,n=C(u[a]);nb&&u.splice(t,1)}function E(e,t,r,a){(0,n.kJ)(e)?r.push(...e):t&&t.includes(e,e.allowRecurse?a+1:a)||r.push(e),A()}function T(e){E(e,l,h,p)}function P(e){E(e,m,x,v)}function I(e,t=null){if(h.length){for(w=t,l=[...new Set(h)],h.length=0,p=0;pC(e)-C(t))),v=0;vnull==e.id?1/0:e.id;function O(e){s=!1,d=!0,I(e),u.sort(((e,t)=>C(e)-C(t)));n.dG;try{for(b=0;be.trim())):t&&(i=r.map(n.He))}let d;let s=a[d=(0,n.hR)(t)]||a[d=(0,n.hR)((0,n._A)(t))];!s&&f&&(s=a[d=(0,n.hR)((0,n.rs)(t))]),s&&c(s,e,6,i);const u=a[d+"Once"];if(u){if(e.emitted){if(e.emitted[d])return}else e.emitted={};e.emitted[d]=!0,c(u,e,6,i)}}function N(e,t,r=!1){const a=t.emitsCache,i=a.get(e);if(void 0!==i)return i;const c=e.emits;let f={},o=!1;if(!(0,n.mf)(e)){const a=e=>{const r=N(e,t,!0);r&&(o=!0,(0,n.l7)(f,r))};!r&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return c||o?((0,n.kJ)(c)?c.forEach((e=>f[e]=null)):(0,n.l7)(f,c),a.set(e,f),f):(a.set(e,null),null)}function L(e,t){return!(!e||!(0,n.F7)(t))&&(t=t.slice(2).replace(/Once$/,""),(0,n.RI)(e,t[0].toLowerCase()+t.slice(1))||(0,n.RI)(e,(0,n.rs)(t))||(0,n.RI)(e,t))}let U=null,j=null;function F(e){const t=U;return U=e,j=e&&e.type.__scopeId||null,t}function D(e){j=e}function H(){j=null}function q(e,t=U,r){if(!t)return e;if(e._n)return e;const a=(...r)=>{a._d&&Zt(-1);const n=F(t),i=e(...r);return F(n),a._d&&Zt(1),i};return a._n=!0,a._c=!0,a._d=!0,a}function z(e){const{type:t,vnode:r,proxy:a,withProxy:i,props:c,propsOptions:[o],slots:d,attrs:s,emit:u,render:b,renderCache:h,data:l,setupState:p,ctx:x,inheritAttrs:m}=e;let v,g;const y=F(e);try{if(4&r.shapeFlag){const e=i||a;v=ur(b.call(e,e,h,c,p,l,x)),g=s}else{const e=t;0,v=ur(e.length>1?e(c,{attrs:s,slots:d,emit:u}):e(c,null)),g=t.props?s:K(s)}}catch(M){zt.length=0,f(M,e,1),v=nr(Ht)}let w=v;if(g&&!1!==m){const e=Object.keys(g),{shapeFlag:t}=w;e.length&&7&t&&(o&&e.some(n.tR)&&(g=W(g,o)),w=fr(w,g))}return r.dirs&&(w.dirs=w.dirs?w.dirs.concat(r.dirs):r.dirs),r.transition&&(w.transition=r.transition),v=w,F(y),v}const K=e=>{let t;for(const r in e)("class"===r||"style"===r||(0,n.F7)(r))&&((t||(t={}))[r]=e[r]);return t},W=(e,t)=>{const r={};for(const a in e)(0,n.tR)(a)&&a.slice(9)in t||(r[a]=e[a]);return r};function G(e,t,r){const{props:a,children:n,component:i}=e,{props:c,children:f,patchFlag:o}=t,d=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(r&&o>=0))return!(!n&&!f||f&&f.$stable)||a!==c&&(a?!c||V(a,c,d):!!c);if(1024&o)return!0;if(16&o)return a?V(a,c,d):!!c;if(8&o){const e=t.dynamicProps;for(let t=0;te.__isSuspense;function J(e,t){t&&t.pendingBranch?(0,n.kJ)(e)?t.effects.push(...e):t.effects.push(e):P(e)}function Y(e,t){if(Ar){let r=Ar.provides;const a=Ar.parent&&Ar.parent.provides;a===r&&(r=Ar.provides=Object.create(a)),r[e]=t}else 0}function X(e,t,r=!1){const a=Ar||U;if(a){const i=null==a.parent?a.vnode.appContext&&a.vnode.appContext.provides:a.parent.provides;if(i&&e in i)return i[e];if(arguments.length>1)return r&&(0,n.mf)(t)?t.call(a.proxy):t}else 0}const Q={};function ee(e,t,r){return te(e,t,r)}function te(e,t,{immediate:r,deep:f,flush:o,onTrack:d,onTrigger:s}=n.kT){const u=Ar;let b,h,l=!1,p=!1;if((0,a.dq)(e)?(b=()=>e.value,l=(0,a.yT)(e)):(0,a.PG)(e)?(b=()=>e,f=!0):(0,n.kJ)(e)?(p=!0,l=e.some(a.PG),b=()=>e.map((e=>(0,a.dq)(e)?e.value:(0,a.PG)(e)?ne(e):(0,n.mf)(e)?i(e,u,2):void 0))):b=(0,n.mf)(e)?t?()=>i(e,u,2):()=>{if(!u||!u.isUnmounted)return h&&h(),c(e,u,3,[x])}:n.dG,t&&f){const e=b;b=()=>ne(e())}let x=e=>{h=y.onStop=()=>{i(e,u,4)}};if(Cr)return x=n.dG,t?r&&c(t,u,3,[b(),p?[]:void 0,x]):b(),n.dG;let m=p?[]:Q;const v=()=>{if(y.active)if(t){const e=y.run();(f||l||(p?e.some(((e,t)=>(0,n.aU)(e,m[t]))):(0,n.aU)(e,m)))&&(h&&h(),c(t,u,3,[e,m===Q?void 0:m,x]),m=e)}else y.run()};let g;v.allowRecurse=!!t,g="sync"===o?v:"post"===o?()=>yt(v,u&&u.suspense):()=>{!u||u.isMounted?T(v):v()};const y=new a.qq(b,g);return t?r?v():m=y.run():"post"===o?yt(y.run.bind(y),u&&u.suspense):y.run(),()=>{y.stop(),u&&u.scope&&(0,n.Od)(u.scope.effects,y)}}function re(e,t,r){const a=this.proxy,i=(0,n.HD)(e)?e.includes(".")?ae(a,e):()=>a[e]:e.bind(a,a);let c;(0,n.mf)(t)?c=t:(c=t.handler,r=t);const f=Ar;Er(this);const o=te(i,c.bind(a),r);return f?Er(f):Tr(),o}function ae(e,t){const r=t.split(".");return()=>{let t=e;for(let e=0;e{ne(e,t)}));else if((0,n.PO)(e))for(const r in e)ne(e[r],t);return e}function ie(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Te((()=>{e.isMounted=!0})),Be((()=>{e.isUnmounting=!0})),e}const ce=[Function,Array],fe={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ce,onEnter:ce,onAfterEnter:ce,onEnterCancelled:ce,onBeforeLeave:ce,onLeave:ce,onAfterLeave:ce,onLeaveCancelled:ce,onBeforeAppear:ce,onAppear:ce,onAfterAppear:ce,onAppearCancelled:ce},setup(e,{slots:t}){const r=Sr(),n=ie();let i;return()=>{const c=t.default&&le(t.default(),!0);if(!c||!c.length)return;const f=(0,a.IU)(e),{mode:o}=f;const d=c[0];if(n.isLeaving)return ue(d);const s=be(d);if(!s)return ue(d);const u=se(s,f,n,r);he(s,u);const b=r.subTree,h=b&&be(b);let l=!1;const{getTransitionKey:p}=s.type;if(p){const e=p();void 0===i?i=e:e!==i&&(i=e,l=!0)}if(h&&h.type!==Ht&&(!Qt(s,h)||l)){const e=se(h,f,n,r);if(he(h,e),"out-in"===o)return n.isLeaving=!0,e.afterLeave=()=>{n.isLeaving=!1,r.update()},ue(d);"in-out"===o&&s.type!==Ht&&(e.delayLeave=(e,t,r)=>{const a=de(n,h);a[String(h.key)]=h,e._leaveCb=()=>{t(),e._leaveCb=void 0,delete u.delayedLeave},u.delayedLeave=r})}return d}}},oe=fe;function de(e,t){const{leavingVNodes:r}=e;let a=r.get(t.type);return a||(a=Object.create(null),r.set(t.type,a)),a}function se(e,t,r,a){const{appear:n,mode:i,persisted:f=!1,onBeforeEnter:o,onEnter:d,onAfterEnter:s,onEnterCancelled:u,onBeforeLeave:b,onLeave:h,onAfterLeave:l,onLeaveCancelled:p,onBeforeAppear:x,onAppear:m,onAfterAppear:v,onAppearCancelled:g}=t,y=String(e.key),w=de(r,e),M=(e,t)=>{e&&c(e,a,9,t)},_={mode:i,persisted:f,beforeEnter(t){let a=o;if(!r.isMounted){if(!n)return;a=x||o}t._leaveCb&&t._leaveCb(!0);const i=w[y];i&&Qt(e,i)&&i.el._leaveCb&&i.el._leaveCb(),M(a,[t])},enter(e){let t=d,a=s,i=u;if(!r.isMounted){if(!n)return;t=m||d,a=v||s,i=g||u}let c=!1;const f=e._enterCb=t=>{c||(c=!0,M(t?i:a,[e]),_.delayedLeave&&_.delayedLeave(),e._enterCb=void 0)};t?(t(e,f),t.length<=1&&f()):f()},leave(t,a){const n=String(e.key);if(t._enterCb&&t._enterCb(!0),r.isUnmounting)return a();M(b,[t]);let i=!1;const c=t._leaveCb=r=>{i||(i=!0,a(),M(r?p:l,[t]),t._leaveCb=void 0,w[n]===e&&delete w[n])};w[n]=e,h?(h(t,c),h.length<=1&&c()):c()},clone(e){return se(e,t,r,a)}};return _}function ue(e){if(me(e))return e=fr(e),e.children=null,e}function be(e){return me(e)?e.children?e.children[0]:void 0:e}function he(e,t){6&e.shapeFlag&&e.component?he(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function le(e,t=!1){let r=[],a=0;for(let n=0;n1)for(let n=0;n!!e.type.__asyncLoader;const me=e=>e.type.__isKeepAlive;RegExp,RegExp;function ve(e,t){return(0,n.kJ)(e)?e.some((e=>ve(e,t))):(0,n.HD)(e)?e.split(",").includes(t):!!e.test&&e.test(t)}function ge(e,t){we(e,"a",t)}function ye(e,t){we(e,"da",t)}function we(e,t,r=Ar){const a=e.__wdc||(e.__wdc=()=>{let t=r;while(t){if(t.isDeactivated)return;t=t.parent}return e()});if(Ae(t,a,r),r){let e=r.parent;while(e&&e.parent)me(e.parent.vnode)&&Me(a,t,r,e),e=e.parent}}function Me(e,t,r,a){const i=Ae(t,e,a,!0);Ce((()=>{(0,n.Od)(a[t],i)}),r)}function _e(e){let t=e.shapeFlag;256&t&&(t-=256),512&t&&(t-=512),e.shapeFlag=t}function ke(e){return 128&e.shapeFlag?e.ssContent:e}function Ae(e,t,r=Ar,n=!1){if(r){const i=r[e]||(r[e]=[]),f=t.__weh||(t.__weh=(...n)=>{if(r.isUnmounted)return;(0,a.Jd)(),Er(r);const i=c(t,r,e,n);return Tr(),(0,a.lk)(),i});return n?i.unshift(f):i.push(f),f}}const Se=e=>(t,r=Ar)=>(!Cr||"sp"===e)&&Ae(e,t,r),Ee=Se("bm"),Te=Se("m"),Pe=Se("bu"),Ie=Se("u"),Be=Se("bum"),Ce=Se("um"),Oe=Se("sp"),Re=Se("rtg"),Ne=Se("rtc");function Le(e,t=Ar){Ae("ec",e,t)}let Ue=!0;function je(e){const t=qe(e),r=e.proxy,i=e.ctx;Ue=!1,t.beforeCreate&&De(t.beforeCreate,e,"bc");const{data:c,computed:f,methods:o,watch:d,provide:s,inject:u,created:b,beforeMount:h,mounted:l,beforeUpdate:p,updated:x,activated:m,deactivated:v,beforeDestroy:g,beforeUnmount:y,destroyed:w,unmounted:M,render:_,renderTracked:k,renderTriggered:A,errorCaptured:S,serverPrefetch:E,expose:T,inheritAttrs:P,components:I,directives:B,filters:C}=t,O=null;if(u&&Fe(u,i,O,e.appContext.config.unwrapInjectedRef),o)for(const a in o){const e=o[a];(0,n.mf)(e)&&(i[a]=e.bind(r))}if(c){0;const t=c.call(r,r);0,(0,n.Kn)(t)&&(e.data=(0,a.qj)(t))}if(Ue=!0,f)for(const a in f){const e=f[a],t=(0,n.mf)(e)?e.bind(r,r):(0,n.mf)(e.get)?e.get.bind(r,r):n.dG;0;const c=!(0,n.mf)(e)&&(0,n.mf)(e.set)?e.set.bind(r):n.dG,o=qr({get:t,set:c});Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e})}if(d)for(const a in d)He(d[a],i,r,a);if(s){const e=(0,n.mf)(s)?s.call(r):s;Reflect.ownKeys(e).forEach((t=>{Y(t,e[t])}))}function R(e,t){(0,n.kJ)(t)?t.forEach((t=>e(t.bind(r)))):t&&e(t.bind(r))}if(b&&De(b,e,"c"),R(Ee,h),R(Te,l),R(Pe,p),R(Ie,x),R(ge,m),R(ye,v),R(Le,S),R(Ne,k),R(Re,A),R(Be,y),R(Ce,M),R(Oe,E),(0,n.kJ)(T))if(T.length){const t=e.exposed||(e.exposed={});T.forEach((e=>{Object.defineProperty(t,e,{get:()=>r[e],set:t=>r[e]=t})}))}else e.exposed||(e.exposed={});_&&e.render===n.dG&&(e.render=_),null!=P&&(e.inheritAttrs=P),I&&(e.components=I),B&&(e.directives=B)}function Fe(e,t,r=n.dG,i=!1){(0,n.kJ)(e)&&(e=Ve(e));for(const c in e){const r=e[c];let f;f=(0,n.Kn)(r)?"default"in r?X(r.from||c,r.default,!0):X(r.from||c):X(r),(0,a.dq)(f)&&i?Object.defineProperty(t,c,{enumerable:!0,configurable:!0,get:()=>f.value,set:e=>f.value=e}):t[c]=f}}function De(e,t,r){c((0,n.kJ)(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,r)}function He(e,t,r,a){const i=a.includes(".")?ae(r,a):()=>r[a];if((0,n.HD)(e)){const r=t[e];(0,n.mf)(r)&&ee(i,r)}else if((0,n.mf)(e))ee(i,e.bind(r));else if((0,n.Kn)(e))if((0,n.kJ)(e))e.forEach((e=>He(e,t,r,a)));else{const a=(0,n.mf)(e.handler)?e.handler.bind(r):t[e.handler];(0,n.mf)(a)&&ee(i,a,e)}else 0}function qe(e){const t=e.type,{mixins:r,extends:a}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:c}}=e.appContext,f=i.get(t);let o;return f?o=f:n.length||r||a?(o={},n.length&&n.forEach((e=>ze(o,e,c,!0))),ze(o,t,c)):o=t,i.set(t,o),o}function ze(e,t,r,a=!1){const{mixins:n,extends:i}=t;i&&ze(e,i,r,!0),n&&n.forEach((t=>ze(e,t,r,!0)));for(const c in t)if(a&&"expose"===c);else{const a=Ke[c]||r&&r[c];e[c]=a?a(e[c],t[c]):t[c]}return e}const Ke={data:We,props:$e,emits:$e,methods:$e,computed:$e,beforeCreate:Ze,created:Ze,beforeMount:Ze,mounted:Ze,beforeUpdate:Ze,updated:Ze,beforeDestroy:Ze,beforeUnmount:Ze,destroyed:Ze,unmounted:Ze,activated:Ze,deactivated:Ze,errorCaptured:Ze,serverPrefetch:Ze,components:$e,directives:$e,watch:Je,provide:We,inject:Ge};function We(e,t){return t?e?function(){return(0,n.l7)((0,n.mf)(e)?e.call(this,this):e,(0,n.mf)(t)?t.call(this,this):t)}:t:e}function Ge(e,t){return $e(Ve(e),Ve(t))}function Ve(e){if((0,n.kJ)(e)){const t={};for(let r=0;r0)||16&o){let a;Qe(e,t,c,f)&&(u=!0);for(const i in d)t&&((0,n.RI)(t,i)||(a=(0,n.rs)(i))!==i&&(0,n.RI)(t,a))||(s?!r||void 0===r[i]&&void 0===r[a]||(c[i]=et(s,d,i,void 0,e,!0)):delete c[i]);if(f!==d)for(const e in f)t&&(0,n.RI)(t,e)||(delete f[e],u=!0)}else if(8&o){const r=e.vnode.dynamicProps;for(let a=0;a{d=!0;const[r,a]=tt(e,t,!0);(0,n.l7)(f,r),a&&o.push(...a)};!r&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}if(!c&&!d)return a.set(e,n.Z6),n.Z6;if((0,n.kJ)(c))for(let u=0;u-1,a[1]=r<0||e-1||(0,n.RI)(a,"default"))&&o.push(t)}}}}const s=[f,o];return a.set(e,s),s}function rt(e){return"$"!==e[0]}function at(e){const t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:null===e?"null":""}function nt(e,t){return at(e)===at(t)}function it(e,t){return(0,n.kJ)(t)?t.findIndex((t=>nt(t,e))):(0,n.mf)(t)&&nt(t,e)?0:-1}const ct=e=>"_"===e[0]||"$stable"===e,ft=e=>(0,n.kJ)(e)?e.map(ur):[ur(e)],ot=(e,t,r)=>{const a=q(((...e)=>ft(t(...e))),r);return a._c=!1,a},dt=(e,t,r)=>{const a=e._ctx;for(const i in e){if(ct(i))continue;const r=e[i];if((0,n.mf)(r))t[i]=ot(i,r,a);else if(null!=r){0;const e=ft(r);t[i]=()=>e}}},st=(e,t)=>{const r=ft(t);e.slots.default=()=>r},ut=(e,t)=>{if(32&e.vnode.shapeFlag){const r=t._;r?(e.slots=(0,a.IU)(t),(0,n.Nj)(t,"_",r)):dt(t,e.slots={})}else e.slots={},t&&st(e,t);(0,n.Nj)(e.slots,er,1)},bt=(e,t,r)=>{const{vnode:a,slots:i}=e;let c=!0,f=n.kT;if(32&a.shapeFlag){const e=t._;e?r&&1===e?c=!1:((0,n.l7)(i,t),r||1!==e||delete i._):(c=!t.$stable,dt(t,i)),f=t}else t&&(st(e,t),f={default:1});if(c)for(const n in i)ct(n)||n in f||delete i[n]};function ht(e,t){const r=U;if(null===r)return e;const a=r.proxy,i=e.dirs||(e.dirs=[]);for(let c=0;cvt(e,t&&((0,n.kJ)(t)?t[a]:t),r,c,f)));if(xe(c)&&!f)return;const o=4&c.shapeFlag?Fr(c.component)||c.component.proxy:c.el,d=f?null:o,{i:s,r:u}=e;const b=t&&t.r,h=s.refs===n.kT?s.refs={}:s.refs,l=s.setupState;if(null!=b&&b!==u&&((0,n.HD)(b)?(h[b]=null,(0,n.RI)(l,b)&&(l[b]=null)):(0,a.dq)(b)&&(b.value=null)),(0,n.mf)(u))i(u,s,12,[d,h]);else{const t=(0,n.HD)(u),i=(0,a.dq)(u);if(t||i){const i=()=>{if(e.f){const r=t?h[u]:u.value;f?(0,n.kJ)(r)&&(0,n.Od)(r,o):(0,n.kJ)(r)?r.includes(o)||r.push(o):t?h[u]=[o]:(u.value=[o],e.k&&(h[e.k]=u.value))}else t?(h[u]=d,(0,n.RI)(l,u)&&(l[u]=d)):(0,a.dq)(u)&&(u.value=d,e.k&&(h[e.k]=d))};d?(i.id=-1,yt(i,r)):i()}else 0}}function gt(){}const yt=J;function wt(e){return Mt(e)}function Mt(e,t){gt();const r=(0,n.E9)();r.__VUE__=!0;const{insert:i,remove:c,patchProp:f,createElement:o,createText:d,createComment:s,setText:u,setElementText:b,parentNode:h,nextSibling:l,setScopeId:p=n.dG,cloneNode:x,insertStaticContent:m}=e,v=(e,t,r,a=null,n=null,i=null,c=!1,f=null,o=!!t.dynamicChildren)=>{if(e===t)return;e&&!Qt(e,t)&&(a=Q(e),V(e,n,i,!0),e=null),-2===t.patchFlag&&(o=!1,t.dynamicChildren=null);const{type:d,ref:s,shapeFlag:u}=t;switch(d){case Dt:g(e,t,r,a);break;case Ht:y(e,t,r,a);break;case qt:null==e&&w(t,r,a,c);break;case Ft:N(e,t,r,a,n,i,c,f,o);break;default:1&u?A(e,t,r,a,n,i,c,f,o):6&u?L(e,t,r,a,n,i,c,f,o):(64&u||128&u)&&d.process(e,t,r,a,n,i,c,f,o,te)}null!=s&&n&&vt(s,e&&e.ref,i,t||e,!t)},g=(e,t,r,a)=>{if(null==e)i(t.el=d(t.children),r,a);else{const r=t.el=e.el;t.children!==e.children&&u(r,t.children)}},y=(e,t,r,a)=>{null==e?i(t.el=s(t.children||""),r,a):t.el=e.el},w=(e,t,r,a)=>{[e.el,e.anchor]=m(e.children,t,r,a,e.el,e.anchor)},M=({el:e,anchor:t},r,a)=>{let n;while(e&&e!==t)n=l(e),i(e,r,a),e=n;i(t,r,a)},_=({el:e,anchor:t})=>{let r;while(e&&e!==t)r=l(e),c(e),e=r;c(t)},A=(e,t,r,a,n,i,c,f,o)=>{c=c||"svg"===t.type,null==e?E(t,r,a,n,i,c,f,o):C(e,t,n,i,c,f,o)},E=(e,t,r,a,c,d,s,u)=>{let h,l;const{type:p,props:m,shapeFlag:v,transition:g,patchFlag:y,dirs:w}=e;if(e.el&&void 0!==x&&-1===y)h=e.el=x(e.el);else{if(h=e.el=o(e.type,d,m&&m.is,m),8&v?b(h,e.children):16&v&&P(e.children,h,null,a,c,d&&"foreignObject"!==p,s,u),w&<(e,null,a,"created"),m){for(const t in m)"value"===t||(0,n.Gg)(t)||f(h,t,null,m[t],d,e.children,a,c,X);"value"in m&&f(h,"value",null,m.value),(l=m.onVnodeBeforeMount)&&pr(l,a,e)}T(h,e,e.scopeId,s,a)}w&<(e,null,a,"beforeMount");const M=(!c||c&&!c.pendingBranch)&&g&&!g.persisted;M&&g.beforeEnter(h),i(h,t,r),((l=m&&m.onVnodeMounted)||M||w)&&yt((()=>{l&&pr(l,a,e),M&&g.enter(h),w&<(e,null,a,"mounted")}),c)},T=(e,t,r,a,n)=>{if(r&&p(e,r),a)for(let i=0;i{for(let d=o;d{const d=t.el=e.el;let{patchFlag:s,dynamicChildren:u,dirs:h}=t;s|=16&e.patchFlag;const l=e.props||n.kT,p=t.props||n.kT;let x;r&&_t(r,!1),(x=p.onVnodeBeforeUpdate)&&pr(x,r,t,e),h&<(t,e,r,"beforeUpdate"),r&&_t(r,!0);const m=i&&"foreignObject"!==t.type;if(u?O(e.dynamicChildren,u,d,r,a,m,c):o||H(e,t,d,null,r,a,m,c,!1),s>0){if(16&s)R(d,t,l,p,r,a,i);else if(2&s&&l.class!==p.class&&f(d,"class",null,p.class,i),4&s&&f(d,"style",l.style,p.style,i),8&s){const n=t.dynamicProps;for(let t=0;t{x&&pr(x,r,t,e),h&<(t,e,r,"updated")}),a)},O=(e,t,r,a,n,i,c)=>{for(let f=0;f{if(r!==a){for(const d in a){if((0,n.Gg)(d))continue;const s=a[d],u=r[d];s!==u&&"value"!==d&&f(e,d,u,s,o,t.children,i,c,X)}if(r!==n.kT)for(const d in r)(0,n.Gg)(d)||d in a||f(e,d,r[d],null,o,t.children,i,c,X);"value"in a&&f(e,"value",r.value,a.value)}},N=(e,t,r,a,n,c,f,o,s)=>{const u=t.el=e?e.el:d(""),b=t.anchor=e?e.anchor:d("");let{patchFlag:h,dynamicChildren:l,slotScopeIds:p}=t;p&&(o=o?o.concat(p):p),null==e?(i(u,r,a),i(b,r,a),P(t.children,r,b,n,c,f,o,s)):h>0&&64&h&&l&&e.dynamicChildren?(O(e.dynamicChildren,l,r,n,c,f,o),(null!=t.key||n&&t===n.subTree)&&kt(e,t,!0)):H(e,t,r,b,n,c,f,o,s)},L=(e,t,r,a,n,i,c,f,o)=>{t.slotScopeIds=f,null==e?512&t.shapeFlag?n.ctx.activate(t,r,a,c,o):U(t,r,a,n,i,c,o):j(e,t,o)},U=(e,t,r,a,n,i,c)=>{const f=e.component=kr(e,a,n);if(me(e)&&(f.ctx.renderer=te),Or(f),f.asyncDep){if(n&&n.registerDep(f,F),!e.el){const e=f.subTree=nr(Ht);y(null,e,t,r)}}else F(f,e,t,r,n,i,c)},j=(e,t,r)=>{const a=t.component=e.component;if(G(e,t,r)){if(a.asyncDep&&!a.asyncResolved)return void D(a,t,r);a.next=t,S(a.update),a.update()}else t.component=e.component,t.el=e.el,a.vnode=t},F=(e,t,r,i,c,f,o)=>{const d=()=>{if(e.isMounted){let t,{next:r,bu:a,u:i,parent:d,vnode:s}=e,u=r;0,_t(e,!1),r?(r.el=s.el,D(e,r,o)):r=s,a&&(0,n.ir)(a),(t=r.props&&r.props.onVnodeBeforeUpdate)&&pr(t,d,r,s),_t(e,!0);const b=z(e);0;const l=e.subTree;e.subTree=b,v(l,b,h(l.el),Q(l),e,c,f),r.el=b.el,null===u&&Z(e,b.el),i&&yt(i,c),(t=r.props&&r.props.onVnodeUpdated)&&yt((()=>pr(t,d,r,s)),c)}else{let a;const{el:o,props:d}=t,{bm:s,m:u,parent:b}=e,h=xe(t);if(_t(e,!1),s&&(0,n.ir)(s),!h&&(a=d&&d.onVnodeBeforeMount)&&pr(a,b,t),_t(e,!0),o&&ae){const r=()=>{e.subTree=z(e),ae(o,e.subTree,e,c,null)};h?t.type.__asyncLoader().then((()=>!e.isUnmounted&&r())):r()}else{0;const a=e.subTree=z(e);0,v(null,a,r,i,e,c,f),t.el=a.el}if(u&&yt(u,c),!h&&(a=d&&d.onVnodeMounted)){const e=t;yt((()=>pr(a,b,e)),c)}256&t.shapeFlag&&e.a&&yt(e.a,c),e.isMounted=!0,t=r=i=null}},s=e.effect=new a.qq(d,(()=>k(e.update)),e.scope),u=e.update=s.run.bind(s);u.id=e.uid,_t(e,!0),u()},D=(e,t,r)=>{t.component=e;const n=e.vnode.props;e.vnode=t,e.next=null,Xe(e,t.props,n,r),bt(e,t.children,r),(0,a.Jd)(),I(void 0,e.update),(0,a.lk)()},H=(e,t,r,a,n,i,c,f,o=!1)=>{const d=e&&e.children,s=e?e.shapeFlag:0,u=t.children,{patchFlag:h,shapeFlag:l}=t;if(h>0){if(128&h)return void K(d,u,r,a,n,i,c,f,o);if(256&h)return void q(d,u,r,a,n,i,c,f,o)}8&l?(16&s&&X(d,n,i),u!==d&&b(r,u)):16&s?16&l?K(d,u,r,a,n,i,c,f,o):X(d,n,i,!0):(8&s&&b(r,""),16&l&&P(u,r,a,n,i,c,f,o))},q=(e,t,r,a,i,c,f,o,d)=>{e=e||n.Z6,t=t||n.Z6;const s=e.length,u=t.length,b=Math.min(s,u);let h;for(h=0;hu?X(e,i,c,!0,!1,b):P(t,r,a,i,c,f,o,d,b)},K=(e,t,r,a,i,c,f,o,d)=>{let s=0;const u=t.length;let b=e.length-1,h=u-1;while(s<=b&&s<=h){const a=e[s],n=t[s]=d?br(t[s]):ur(t[s]);if(!Qt(a,n))break;v(a,n,r,null,i,c,f,o,d),s++}while(s<=b&&s<=h){const a=e[b],n=t[h]=d?br(t[h]):ur(t[h]);if(!Qt(a,n))break;v(a,n,r,null,i,c,f,o,d),b--,h--}if(s>b){if(s<=h){const e=h+1,n=eh)while(s<=b)V(e[s],i,c,!0),s++;else{const l=s,p=s,x=new Map;for(s=p;s<=h;s++){const e=t[s]=d?br(t[s]):ur(t[s]);null!=e.key&&x.set(e.key,s)}let m,g=0;const y=h-p+1;let w=!1,M=0;const _=new Array(y);for(s=0;s=y){V(a,i,c,!0);continue}let n;if(null!=a.key)n=x.get(a.key);else for(m=p;m<=h;m++)if(0===_[m-p]&&Qt(a,t[m])){n=m;break}void 0===n?V(a,i,c,!0):(_[n-p]=s+1,n>=M?M=n:w=!0,v(a,t[n],r,null,i,c,f,o,d),g++)}const k=w?At(_):n.Z6;for(m=k.length-1,s=y-1;s>=0;s--){const e=p+s,n=t[e],b=e+1{const{el:c,type:f,transition:o,children:d,shapeFlag:s}=e;if(6&s)return void W(e.component.subTree,t,r,a);if(128&s)return void e.suspense.move(t,r,a);if(64&s)return void f.move(e,t,r,te);if(f===Ft){i(c,t,r);for(let e=0;eo.enter(c)),n);else{const{leave:e,delayLeave:a,afterLeave:n}=o,f=()=>i(c,t,r),d=()=>{e(c,(()=>{f(),n&&n()}))};a?a(c,f,d):d()}else i(c,t,r)},V=(e,t,r,a=!1,n=!1)=>{const{type:i,props:c,ref:f,children:o,dynamicChildren:d,shapeFlag:s,patchFlag:u,dirs:b}=e;if(null!=f&&vt(f,null,r,e,!0),256&s)return void t.ctx.deactivate(e);const h=1&s&&b,l=!xe(e);let p;if(l&&(p=c&&c.onVnodeBeforeUnmount)&&pr(p,t,e),6&s)Y(e.component,r,a);else{if(128&s)return void e.suspense.unmount(r,a);h&<(e,null,t,"beforeUnmount"),64&s?e.type.remove(e,t,r,n,te,a):d&&(i!==Ft||u>0&&64&u)?X(d,t,r,!1,!0):(i===Ft&&384&u||!n&&16&s)&&X(o,t,r),a&&$(e)}(l&&(p=c&&c.onVnodeUnmounted)||h)&&yt((()=>{p&&pr(p,t,e),h&<(e,null,t,"unmounted")}),r)},$=e=>{const{type:t,el:r,anchor:a,transition:n}=e;if(t===Ft)return void J(r,a);if(t===qt)return void _(e);const i=()=>{c(r),n&&!n.persisted&&n.afterLeave&&n.afterLeave()};if(1&e.shapeFlag&&n&&!n.persisted){const{leave:t,delayLeave:a}=n,c=()=>t(r,i);a?a(e.el,i,c):c()}else i()},J=(e,t)=>{let r;while(e!==t)r=l(e),c(e),e=r;c(t)},Y=(e,t,r)=>{const{bum:a,scope:i,update:c,subTree:f,um:o}=e;a&&(0,n.ir)(a),i.stop(),c&&(c.active=!1,V(f,e,t,r)),o&&yt(o,t),yt((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},X=(e,t,r,a=!1,n=!1,i=0)=>{for(let c=i;c6&e.shapeFlag?Q(e.component.subTree):128&e.shapeFlag?e.suspense.next():l(e.anchor||e.el),ee=(e,t,r)=>{null==e?t._vnode&&V(t._vnode,null,null,!0):v(t._vnode||null,e,t,null,null,null,r),B(),t._vnode=e},te={p:v,um:V,m:W,r:$,mt:U,mc:P,pc:H,pbc:O,n:Q,o:e};let re,ae;return t&&([re,ae]=t(te)),{render:ee,hydrate:re,createApp:mt(ee,re)}}function _t({effect:e,update:t},r){e.allowRecurse=t.allowRecurse=r}function kt(e,t,r=!1){const a=e.children,i=t.children;if((0,n.kJ)(a)&&(0,n.kJ)(i))for(let n=0;n>1,e[r[f]]0&&(t[a]=r[i-1]),r[i]=a)}}i=r.length,c=r[i-1];while(i-- >0)r[i]=c,c=t[c];return r}const St=e=>e.__isTeleport,Et=e=>e&&(e.disabled||""===e.disabled),Tt=e=>"undefined"!==typeof SVGElement&&e instanceof SVGElement,Pt=(e,t)=>{const r=e&&e.to;if((0,n.HD)(r)){if(t){const e=t(r);return e}return null}return r},It={__isTeleport:!0,process(e,t,r,a,n,i,c,f,o,d){const{mc:s,pc:u,pbc:b,o:{insert:h,querySelector:l,createText:p,createComment:x}}=d,m=Et(t.props);let{shapeFlag:v,children:g,dynamicChildren:y}=t;if(null==e){const e=t.el=p(""),d=t.anchor=p("");h(e,r,a),h(d,r,a);const u=t.target=Pt(t.props,l),b=t.targetAnchor=p("");u&&(h(b,u),c=c||Tt(u));const x=(e,t)=>{16&v&&s(g,e,t,n,i,c,f,o)};m?x(r,d):u&&x(u,b)}else{t.el=e.el;const a=t.anchor=e.anchor,s=t.target=e.target,h=t.targetAnchor=e.targetAnchor,p=Et(e.props),x=p?r:s,v=p?a:h;if(c=c||Tt(s),y?(b(e.dynamicChildren,y,x,n,i,c,f),kt(e,t,!0)):o||u(e,t,x,v,n,i,c,f,!1),m)p||Bt(t,r,a,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=Pt(t.props,l);e&&Bt(t,e,null,d,0)}else p&&Bt(t,s,h,d,1)}},remove(e,t,r,a,{um:n,o:{remove:i}},c){const{shapeFlag:f,children:o,anchor:d,targetAnchor:s,target:u,props:b}=e;if(u&&i(s),(c||!Et(b))&&(i(d),16&f))for(let h=0;h0?Kt||n.Z6:null,Gt(),Vt>0&&Kt&&Kt.push(e),e}function Jt(e,t,r,a,n,i){return $t(ar(e,t,r,a,n,i,!0))}function Yt(e,t,r,a,n){return $t(nr(e,t,r,a,n,!0))}function Xt(e){return!!e&&!0===e.__v_isVNode}function Qt(e,t){return e.type===t.type&&e.key===t.key}const er="__vInternal",tr=({key:e})=>null!=e?e:null,rr=({ref:e,ref_key:t,ref_for:r})=>null!=e?(0,n.HD)(e)||(0,a.dq)(e)||(0,n.mf)(e)?{i:U,r:e,k:t,f:!!r}:e:null;function ar(e,t=null,r=null,a=0,i=null,c=(e===Ft?0:1),f=!1,o=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&tr(t),ref:t&&rr(t),scopeId:j,slotScopeIds:null,children:r,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:c,patchFlag:a,dynamicProps:i,dynamicChildren:null,appContext:null};return o?(hr(d,r),128&c&&e.normalize(d)):r&&(d.shapeFlag|=(0,n.HD)(r)?8:16),Vt>0&&!f&&Kt&&(d.patchFlag>0||6&c)&&32!==d.patchFlag&&Kt.push(d),d}const nr=ir;function ir(e,t=null,r=null,i=0,c=null,f=!1){if(e&&e!==Lt||(e=Ht),Xt(e)){const a=fr(e,t,!0);return r&&hr(a,r),a}if(Hr(e)&&(e=e.__vccOpts),t){t=cr(t);let{class:e,style:r}=t;e&&!(0,n.HD)(e)&&(t.class=(0,n.C_)(e)),(0,n.Kn)(r)&&((0,a.X3)(r)&&!(0,n.kJ)(r)&&(r=(0,n.l7)({},r)),t.style=(0,n.j5)(r))}const o=(0,n.HD)(e)?1:$(e)?128:St(e)?64:(0,n.Kn)(e)?4:(0,n.mf)(e)?2:0;return ar(e,t,r,i,c,o,f,!0)}function cr(e){return e?(0,a.X3)(e)||er in e?(0,n.l7)({},e):e:null}function fr(e,t,r=!1){const{props:a,ref:i,patchFlag:c,children:f}=e,o=t?lr(a||{},t):a,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:o,key:o&&tr(o),ref:t&&t.ref?r&&i?(0,n.kJ)(i)?i.concat(rr(t)):[i,rr(t)]:rr(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:f,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ft?-1===c?16:16|c:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fr(e.ssContent),ssFallback:e.ssFallback&&fr(e.ssFallback),el:e.el,anchor:e.anchor};return d}function or(e=" ",t=0){return nr(Dt,null,e,t)}function dr(e,t){const r=nr(qt,null,e);return r.staticCount=t,r}function sr(e="",t=!1){return t?(Wt(),Yt(Ht,null,e)):nr(Ht,null,e)}function ur(e){return null==e||"boolean"===typeof e?nr(Ht):(0,n.kJ)(e)?nr(Ft,null,e.slice()):"object"===typeof e?br(e):nr(Dt,null,String(e))}function br(e){return null===e.el||e.memo?e:fr(e)}function hr(e,t){let r=0;const{shapeFlag:a}=e;if(null==t)t=null;else if((0,n.kJ)(t))r=16;else if("object"===typeof t){if(65&a){const r=t.default;return void(r&&(r._c&&(r._d=!1),hr(e,r()),r._c&&(r._d=!0)))}{r=32;const a=t._;a||er in t?3===a&&U&&(1===U.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=U}}else(0,n.mf)(t)?(t={default:t,_ctx:U},r=32):(t=String(t),64&a?(r=16,t=[or(t)]):r=8);e.children=t,e.shapeFlag|=r}function lr(...e){const t={};for(let r=0;rt(e,r,void 0,c&&c[r])));else{const r=Object.keys(e);i=new Array(r.length);for(let a=0,n=r.length;a!Xt(e)||e.type!==Ht&&!(e.type===Ft&&!vr(e.children))))?e:null}const gr=e=>e?Pr(e)?Fr(e)||e.proxy:gr(e.parent):null,yr=(0,n.l7)(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>gr(e.parent),$root:e=>gr(e.root),$emit:e=>e.emit,$options:e=>qe(e),$forceUpdate:e=>()=>k(e.update),$nextTick:e=>M.bind(e.proxy),$watch:e=>re.bind(e)}),wr={get({_:e},t){const{ctx:r,setupState:i,data:c,props:f,accessCache:o,type:d,appContext:s}=e;let u;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return i[t];case 2:return c[t];case 4:return r[t];case 3:return f[t]}else{if(i!==n.kT&&(0,n.RI)(i,t))return o[t]=1,i[t];if(c!==n.kT&&(0,n.RI)(c,t))return o[t]=2,c[t];if((u=e.propsOptions[0])&&(0,n.RI)(u,t))return o[t]=3,f[t];if(r!==n.kT&&(0,n.RI)(r,t))return o[t]=4,r[t];Ue&&(o[t]=0)}}const b=yr[t];let h,l;return b?("$attrs"===t&&(0,a.j)(e,"get",t),b(e)):(h=d.__cssModules)&&(h=h[t])?h:r!==n.kT&&(0,n.RI)(r,t)?(o[t]=4,r[t]):(l=s.config.globalProperties,(0,n.RI)(l,t)?l[t]:void 0)},set({_:e},t,r){const{data:a,setupState:i,ctx:c}=e;return i!==n.kT&&(0,n.RI)(i,t)?(i[t]=r,!0):a!==n.kT&&(0,n.RI)(a,t)?(a[t]=r,!0):!(0,n.RI)(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(c[t]=r,!0))},has({_:{data:e,setupState:t,accessCache:r,ctx:a,appContext:i,propsOptions:c}},f){let o;return!!r[f]||e!==n.kT&&(0,n.RI)(e,f)||t!==n.kT&&(0,n.RI)(t,f)||(o=c[0])&&(0,n.RI)(o,f)||(0,n.RI)(a,f)||(0,n.RI)(yr,f)||(0,n.RI)(i.config.globalProperties,f)},defineProperty(e,t,r){return null!=r.get?this.set(e,t,r.get(),null):null!=r.value&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};const Mr=pt();let _r=0;function kr(e,t,r){const i=e.type,c=(t?t.appContext:e.appContext)||Mr,f={uid:_r++,vnode:e,type:i,parent:t,appContext:c,root:null,next:null,subTree:null,effect:null,update:null,scope:new a.Bj(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(c.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:tt(i,c),emitsOptions:N(i,c),emit:null,emitted:null,propsDefaults:n.kT,inheritAttrs:i.inheritAttrs,ctx:n.kT,data:n.kT,props:n.kT,attrs:n.kT,slots:n.kT,refs:n.kT,setupState:n.kT,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return f.ctx={_:f},f.root=t?t.root:f,f.emit=R.bind(null,f),e.ce&&e.ce(f),f}let Ar=null;const Sr=()=>Ar||U,Er=e=>{Ar=e,e.scope.on()},Tr=()=>{Ar&&Ar.scope.off(),Ar=null};function Pr(e){return 4&e.vnode.shapeFlag}let Ir,Br,Cr=!1;function Or(e,t=!1){Cr=t;const{props:r,children:a}=e.vnode,n=Pr(e);Ye(e,r,n,t),ut(e,a);const i=n?Rr(e,t):void 0;return Cr=!1,i}function Rr(e,t){const r=e.type;e.accessCache=Object.create(null),e.proxy=(0,a.Xl)(new Proxy(e.ctx,wr));const{setup:c}=r;if(c){const r=e.setupContext=c.length>1?jr(e):null;Er(e),(0,a.Jd)();const o=i(c,e,0,[e.props,r]);if((0,a.lk)(),Tr(),(0,n.tI)(o)){if(o.then(Tr,Tr),t)return o.then((r=>{Nr(e,r,t)})).catch((t=>{f(t,e,0)}));e.asyncDep=o}else Nr(e,o,t)}else Lr(e,t)}function Nr(e,t,r){(0,n.mf)(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:(0,n.Kn)(t)&&(e.setupState=(0,a.WL)(t)),Lr(e,r)}function Lr(e,t,r){const i=e.type;if(!e.render){if(!t&&Ir&&!i.render){const t=i.template;if(t){0;const{isCustomElement:r,compilerOptions:a}=e.appContext.config,{delimiters:c,compilerOptions:f}=i,o=(0,n.l7)((0,n.l7)({isCustomElement:r,delimiters:c},a),f);i.render=Ir(t,o)}}e.render=i.render||n.dG,Br&&Br(e)}Er(e),(0,a.Jd)(),je(e),(0,a.lk)(),Tr()}function Ur(e){return new Proxy(e.attrs,{get(t,r){return(0,a.j)(e,"get","$attrs"),t[r]}})}function jr(e){const t=t=>{e.exposed=t||{}};let r;return{get attrs(){return r||(r=Ur(e))},slots:e.slots,emit:e.emit,expose:t}}function Fr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy((0,a.WL)((0,a.Xl)(e.exposed)),{get(t,r){return r in t?t[r]:r in yr?yr[r](e):void 0}}))}function Dr(e){return(0,n.mf)(e)&&e.displayName||e.name}function Hr(e){return(0,n.mf)(e)&&"__vccOpts"in e}const qr=(e,t)=>(0,a.Fl)(e,t,Cr);function zr(e,t,r){const a=arguments.length;return 2===a?(0,n.Kn)(t)&&!(0,n.kJ)(t)?Xt(t)?nr(e,null,[t]):nr(e,t):nr(e,null,t):(a>3?r=Array.prototype.slice.call(arguments,2):3===a&&Xt(r)&&(r=[r]),nr(e,t,r))}Symbol("");const Kr="3.2.31"},49242:function(e,t,r){"use strict";r.d(t,{F8:function(){return fe},iM:function(){return ce},nr:function(){return ae},ri:function(){return be},uT:function(){return U}});var a=r(87139),n=r(73396);r(44870);const i="http://www.w3.org/2000/svg",c="undefined"!==typeof document?document:null,f=c&&c.createElement("template"),o={insert:(e,t,r)=>{t.insertBefore(e,r||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,r,a)=>{const n=t?c.createElementNS(i,e):c.createElement(e,r?{is:r}:void 0);return"select"===e&&a&&null!=a.multiple&&n.setAttribute("multiple",a.multiple),n},createText:e=>c.createTextNode(e),createComment:e=>c.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>c.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},cloneNode(e){const t=e.cloneNode(!0);return"_value"in e&&(t._value=e._value),t},insertStaticContent(e,t,r,a,n,i){const c=r?r.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling)){while(1)if(t.insertBefore(n.cloneNode(!0),r),n===i||!(n=n.nextSibling))break}else{f.innerHTML=a?`${e}`:e;const n=f.content;if(a){const e=n.firstChild;while(e.firstChild)n.appendChild(e.firstChild);n.removeChild(e)}t.insertBefore(n,r)}return[c?c.nextSibling:t.firstChild,r?r.previousSibling:t.lastChild]}};function d(e,t,r){const a=e._vtc;a&&(t=(t?[t,...a]:[...a]).join(" ")),null==t?e.removeAttribute("class"):r?e.setAttribute("class",t):e.className=t}function s(e,t,r){const n=e.style,i=(0,a.HD)(r);if(r&&!i){for(const e in r)b(n,e,r[e]);if(t&&!(0,a.HD)(t))for(const e in t)null==r[e]&&b(n,e,"")}else{const a=n.display;i?t!==r&&(n.cssText=r):t&&e.removeAttribute("style"),"_vod"in e&&(n.display=a)}}const u=/\s*!important$/;function b(e,t,r){if((0,a.kJ)(r))r.forEach((r=>b(e,t,r)));else if(t.startsWith("--"))e.setProperty(t,r);else{const n=p(e,t);u.test(r)?e.setProperty((0,a.rs)(n),r.replace(u,""),"important"):e[n]=r}}const h=["Webkit","Moz","ms"],l={};function p(e,t){const r=l[t];if(r)return r;let n=(0,a._A)(t);if("filter"!==n&&n in e)return l[t]=n;n=(0,a.kC)(n);for(let a=0;adocument.createEvent("Event").timeStamp&&(g=()=>performance.now());const e=navigator.userAgent.match(/firefox\/(\d+)/i);y=!!(e&&Number(e[1])<=53)}let w=0;const M=Promise.resolve(),_=()=>{w=0},k=()=>w||(M.then(_),w=g());function A(e,t,r,a){e.addEventListener(t,r,a)}function S(e,t,r,a){e.removeEventListener(t,r,a)}function E(e,t,r,a,n=null){const i=e._vei||(e._vei={}),c=i[t];if(a&&c)c.value=a;else{const[r,f]=P(t);if(a){const c=i[t]=I(a,n);A(e,r,c,f)}else c&&(S(e,r,c,f),i[t]=void 0)}}const T=/(?:Once|Passive|Capture)$/;function P(e){let t;if(T.test(e)){let r;t={};while(r=e.match(T))e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[(0,a.rs)(e.slice(2)),t]}function I(e,t){const r=e=>{const a=e.timeStamp||g();(y||a>=r.attached-1)&&(0,n.$d)(B(e,r.value),t,5,[e])};return r.value=e,r.attached=k(),r}function B(e,t){if((0,a.kJ)(t)){const r=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{r.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}const C=/^on[a-z]/,O=(e,t,r,n,i=!1,c,f,o,u)=>{"class"===t?d(e,n,i):"style"===t?s(e,r,n):(0,a.F7)(t)?(0,a.tR)(t)||E(e,t,r,n,f):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):R(e,t,n,i))?v(e,t,n,c,f,o,u):("true-value"===t?e._trueValue=n:"false-value"===t&&(e._falseValue=n),m(e,t,n,i))};function R(e,t,r,n){return n?"innerHTML"===t||"textContent"===t||!!(t in e&&C.test(t)&&(0,a.mf)(r)):"spellcheck"!==t&&"draggable"!==t&&("form"!==t&&(("list"!==t||"INPUT"!==e.tagName)&&(("type"!==t||"TEXTAREA"!==e.tagName)&&((!C.test(t)||!(0,a.HD)(r))&&t in e))))}"undefined"!==typeof HTMLElement&&HTMLElement;const N="transition",L="animation",U=(e,{slots:t})=>(0,n.h)(n.P$,H(e),t);U.displayName="Transition";const j={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},F=(U.props=(0,a.l7)({},n.P$.props,j),(e,t=[])=>{(0,a.kJ)(e)?e.forEach((e=>e(...t))):e&&e(...t)}),D=e=>!!e&&((0,a.kJ)(e)?e.some((e=>e.length>1)):e.length>1);function H(e){const t={};for(const a in e)a in j||(t[a]=e[a]);if(!1===e.css)return t;const{name:r="v",type:n,duration:i,enterFromClass:c=`${r}-enter-from`,enterActiveClass:f=`${r}-enter-active`,enterToClass:o=`${r}-enter-to`,appearFromClass:d=c,appearActiveClass:s=f,appearToClass:u=o,leaveFromClass:b=`${r}-leave-from`,leaveActiveClass:h=`${r}-leave-active`,leaveToClass:l=`${r}-leave-to`}=e,p=q(i),x=p&&p[0],m=p&&p[1],{onBeforeEnter:v,onEnter:g,onEnterCancelled:y,onLeave:w,onLeaveCancelled:M,onBeforeAppear:_=v,onAppear:k=g,onAppearCancelled:A=y}=t,S=(e,t,r)=>{W(e,t?u:o),W(e,t?s:f),r&&r()},E=(e,t)=>{W(e,l),W(e,h),t&&t()},T=e=>(t,r)=>{const a=e?k:g,i=()=>S(t,e,r);F(a,[t,i]),G((()=>{W(t,e?d:c),K(t,e?u:o),D(a)||Z(t,n,x,i)}))};return(0,a.l7)(t,{onBeforeEnter(e){F(v,[e]),K(e,c),K(e,f)},onBeforeAppear(e){F(_,[e]),K(e,d),K(e,s)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){const r=()=>E(e,t);K(e,b),X(),K(e,h),G((()=>{W(e,b),K(e,l),D(w)||Z(e,n,m,r)})),F(w,[e,r])},onEnterCancelled(e){S(e,!1),F(y,[e])},onAppearCancelled(e){S(e,!0),F(A,[e])},onLeaveCancelled(e){E(e),F(M,[e])}})}function q(e){if(null==e)return null;if((0,a.Kn)(e))return[z(e.enter),z(e.leave)];{const t=z(e);return[t,t]}}function z(e){const t=(0,a.He)(e);return t}function K(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e._vtc||(e._vtc=new Set)).add(t)}function W(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const{_vtc:r}=e;r&&(r.delete(t),r.size||(e._vtc=void 0))}function G(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let V=0;function Z(e,t,r,a){const n=e._endId=++V,i=()=>{n===e._endId&&a()};if(r)return setTimeout(i,r);const{type:c,timeout:f,propCount:o}=$(e,t);if(!c)return a();const d=c+"end";let s=0;const u=()=>{e.removeEventListener(d,b),i()},b=t=>{t.target===e&&++s>=o&&u()};setTimeout((()=>{s(r[e]||"").split(", "),n=a(N+"Delay"),i=a(N+"Duration"),c=J(n,i),f=a(L+"Delay"),o=a(L+"Duration"),d=J(f,o);let s=null,u=0,b=0;t===N?c>0&&(s=N,u=c,b=i.length):t===L?d>0&&(s=L,u=d,b=o.length):(u=Math.max(c,d),s=u>0?c>d?N:L:null,b=s?s===N?i.length:o.length:0);const h=s===N&&/\b(transform|all)(,|$)/.test(r[N+"Property"]);return{type:s,timeout:u,propCount:b,hasTransform:h}}function J(e,t){while(e.lengthY(t)+Y(e[r]))))}function Y(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function X(){return document.body.offsetHeight}new WeakMap,new WeakMap;const Q=e=>{const t=e.props["onUpdate:modelValue"];return(0,a.kJ)(t)?e=>(0,a.ir)(t,e):t};function ee(e){e.target.composing=!0}function te(e){const t=e.target;t.composing&&(t.composing=!1,re(t,"input"))}function re(e,t){const r=document.createEvent("HTMLEvents");r.initEvent(t,!0,!0),e.dispatchEvent(r)}const ae={created(e,{modifiers:{lazy:t,trim:r,number:n}},i){e._assign=Q(i);const c=n||i.props&&"number"===i.props.type;A(e,t?"change":"input",(t=>{if(t.target.composing)return;let n=e.value;r?n=n.trim():c&&(n=(0,a.He)(n)),e._assign(n)})),r&&A(e,"change",(()=>{e.value=e.value.trim()})),t||(A(e,"compositionstart",ee),A(e,"compositionend",te),A(e,"change",te))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:r,trim:n,number:i}},c){if(e._assign=Q(c),e.composing)return;if(document.activeElement===e){if(r)return;if(n&&e.value.trim()===t)return;if((i||"number"===e.type)&&(0,a.He)(e.value)===t)return}const f=null==t?"":t;e.value!==f&&(e.value=f)}};const ne=["ctrl","shift","alt","meta"],ie={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>ne.some((r=>e[`${r}Key`]&&!t.includes(r)))},ce=(e,t)=>(r,...a)=>{for(let e=0;e{oe(e,!1)})):oe(e,t))},beforeUnmount(e,{value:t}){oe(e,t)}};function oe(e,t){e.style.display=t?e._vod:"none"}const de=(0,a.l7)({patchProp:O},o);let se;function ue(){return se||(se=(0,n.Us)(de))}const be=(...e)=>{const t=ue().createApp(...e);const{mount:r}=t;return t.mount=e=>{const n=he(e);if(!n)return;const i=t._component;(0,a.mf)(i)||i.render||i.template||(i.template=n.innerHTML),n.innerHTML="";const c=r(n,!1,n instanceof SVGElement);return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),c},t};function he(e){if((0,a.HD)(e)){const t=document.querySelector(e);return t}return e}},87139:function(e,t,r){"use strict";function a(e,t){const r=Object.create(null),a=e.split(",");for(let n=0;n!!r[e.toLowerCase()]:e=>!!r[e]}r.d(t,{C_:function(){return h},DM:function(){return C},E9:function(){return ae},F7:function(){return k},Gg:function(){return K},HD:function(){return N},He:function(){return te},Kn:function(){return U},NO:function(){return M},Nj:function(){return ee},Od:function(){return E},PO:function(){return q},Pq:function(){return f},RI:function(){return P},S0:function(){return z},W7:function(){return H},WV:function(){return p},Z6:function(){return y},_A:function(){return V},_N:function(){return B},aU:function(){return X},dG:function(){return w},e1:function(){return i},fY:function(){return a},hR:function(){return Y},hq:function(){return x},ir:function(){return Q},j5:function(){return d},kC:function(){return J},kJ:function(){return I},kT:function(){return g},l7:function(){return S},mf:function(){return R},rs:function(){return $},tI:function(){return j},tR:function(){return A},yA:function(){return o},yk:function(){return L},zw:function(){return m}});const n="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt",i=a(n);const c="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",f=a(c);function o(e){return!!e||""===e}function d(e){if(I(e)){const t={};for(let r=0;r{if(e){const r=e.split(u);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}function h(e){let t="";if(N(e))t=e;else if(I(e))for(let r=0;rp(e,t)))}const m=e=>N(e)?e:null==e?"":I(e)||U(e)&&(e.toString===F||!R(e.toString))?JSON.stringify(e,v,2):String(e),v=(e,t)=>t&&t.__v_isRef?v(e,t.value):B(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,r])=>(e[`${t} =>`]=r,e)),{})}:C(t)?{[`Set(${t.size})`]:[...t.values()]}:!U(t)||I(t)||q(t)?t:String(t),g={},y=[],w=()=>{},M=()=>!1,_=/^on[^a-z]/,k=e=>_.test(e),A=e=>e.startsWith("onUpdate:"),S=Object.assign,E=(e,t)=>{const r=e.indexOf(t);r>-1&&e.splice(r,1)},T=Object.prototype.hasOwnProperty,P=(e,t)=>T.call(e,t),I=Array.isArray,B=e=>"[object Map]"===D(e),C=e=>"[object Set]"===D(e),O=e=>e instanceof Date,R=e=>"function"===typeof e,N=e=>"string"===typeof e,L=e=>"symbol"===typeof e,U=e=>null!==e&&"object"===typeof e,j=e=>U(e)&&R(e.then)&&R(e.catch),F=Object.prototype.toString,D=e=>F.call(e),H=e=>D(e).slice(8,-1),q=e=>"[object Object]"===D(e),z=e=>N(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,K=a(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),W=e=>{const t=Object.create(null);return r=>{const a=t[r];return a||(t[r]=e(r))}},G=/-(\w)/g,V=W((e=>e.replace(G,((e,t)=>t?t.toUpperCase():"")))),Z=/\B([A-Z])/g,$=W((e=>e.replace(Z,"-$1").toLowerCase())),J=W((e=>e.charAt(0).toUpperCase()+e.slice(1))),Y=W((e=>e?`on${J(e)}`:"")),X=(e,t)=>!Object.is(e,t),Q=(e,t)=>{for(let r=0;r{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:r})},te=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let re;const ae=()=>re||(re="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:{})},61639:function(e,t,r){"use strict";r.r(t),r.d(t,{detectEnv:function(){return _},detectOS:function(){return k},formatIOSMobile:function(){return Y},formatMobileRegistry:function(){return ie},formatMobileRegistryEntry:function(){return ne},getClientMeta:function(){return q},getCrypto:function(){return F},getCryptoOrThrow:function(){return j},getDappRegistryUrl:function(){return ae},getDocument:function(){return O},getDocumentOrThrow:function(){return C},getFromWindow:function(){return I},getFromWindowOrThrow:function(){return B},getLocal:function(){return Z},getLocalStorage:function(){return H},getLocalStorageOrThrow:function(){return D},getLocation:function(){return U},getLocationOrThrow:function(){return L},getMobileLinkRegistry:function(){return ee},getMobileRegistryEntry:function(){return Q},getNavigator:function(){return N},getNavigatorOrThrow:function(){return R},getWalletRegistryUrl:function(){return re},isAndroid:function(){return A},isBrowser:function(){return P},isIOS:function(){return S},isMobile:function(){return E},isNode:function(){return T},mobileLinkChoiceKey:function(){return J},removeLocal:function(){return $},safeJsonParse:function(){return W},safeJsonStringify:function(){return G},saveMobileLinkInfo:function(){return X},setLocal:function(){return V}});var a=r(91342),n=r(23380),i=r(96027),c=function(){for(var e=0,t=0,r=arguments.length;t1)}function E(){const e=k();return!!e&&(A()||S())}function T(){const e=_(),t=!(!e||!e.name)&&"node"===e.name.toLowerCase();return t}function P(){const e=!T()&&!!N();return e}const I=n.getFromWindow,B=n.getFromWindowOrThrow,C=n.getDocumentOrThrow,O=n.getDocument,R=n.getNavigatorOrThrow,N=n.getNavigator,L=n.getLocationOrThrow,U=n.getLocation,j=n.getCryptoOrThrow,F=n.getCrypto,D=n.getLocalStorageOrThrow,H=n.getLocalStorage;function q(){return a.D()}r(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 W=z,G=K;function V(e,t){const r=G(t),a=H();a&&a.setItem(e,r)}function Z(e){let t=null,r=null;const a=H();return a&&(r=a.getItem(e)),t=r?W(r):r,t}function $(e){const t=H();t&&t.removeItem(e)}const J="WALLETCONNECT_DEEPLINK_CHOICE";function Y(e,t){const r=encodeURIComponent(e);return t.universalLink?`${t.universalLink}/wc?uri=${r}`:t.deepLink?`${t.deepLink}${t.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function X(e){const t=e.href.split("?")[0];V(J,Object.assign(Object.assign({},e),{href:t}))}function Q(e,t){return e.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())))[0]}function ee(e,t){let r=e;return t&&(r=t.map((t=>Q(e,t))).filter(Boolean)),r}const te="https://registry.walletconnect.com";function re(){return te+"/api/v2/wallets"}function ae(){return te+"/api/v2/dapps"}function ne(e,t="mobile"){var r;return{name:e.name||"",shortName:e.metadata.shortName||"",color:e.metadata.colors.primary||"",logo:null!==(r=e.image_url.sm)&&void 0!==r?r:"",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,r){"use strict";var a=r(15361)["Buffer"];r(48675),r(3462),r(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(r(6513)),c=n(r(75519)),f="hex",o="utf8",d="binary",s="buffer",u="array",b="typed-array",h="array-buffer",l="0";function p(e){return new Uint8Array(e)}function x(e,t=!1){const r=e.toString(f);return t?se(r):r}function m(e){return e.toString(o)}function v(e){return e.readUIntBE(0,e.length)}function g(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 v(y(e))}function k(e){return Array.from(e).map(F).join("")}function A(e){return a.from(de(e),f)}function S(e){return p(A(e))}function E(e){return m(A(e))}function T(e){return _(S(e))}function P(e){return k(S(e))}function I(e){return a.from(e,o)}function B(e){return p(I(e))}function C(e,t=!1){return x(I(e),t)}function O(e){const t=parseInt(e,10);return pe(le(t),"Number can only safely store up to 53 bits"),t}function R(e){return k(B(e))}function N(e){return D(F(e))}function L(e){return H(F(e))}function U(e,t){return q(F(e),t)}function j(e){return`${e}`}function F(e){const t=(e>>>0).toString(2);return ce(t)}function D(e){return y(H(e))}function H(e){return new Uint8Array(ae(e).map((e=>parseInt(e,2))))}function q(e,t){return w(H(e),t)}function z(e){return M(H(e))}function K(e){return _(H(e))}function W(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 a.isBuffer(e)}function Z(e){return i.default.strict(e)&&!V(e)}function $(e){return!Z(e)&&!V(e)&&"undefined"!==typeof e.byteLength}function J(e){return V(e)?s:Z(e)?b:$(e)?h:Array.isArray(e)?u:typeof e}function Y(e){return W(e)?d:G(e)?f:o}function X(...e){const t=a.concat(e);return t}function Q(...e){let t=[];return e.forEach((e=>t=t.concat(Array.from(e)))),new Uint8Array([...t])}function ee(e,t){const r=e.length-t;return r>0&&(e=e.slice(r)),e}function te(e,t){return e.slice(0,t)}function re(e,t=8){const r=e%t;return r?(e-r)/t*t+t:e}function ae(e,t=8){const r=ce(e).match(new RegExp(`.{${t}}`,"gi"));return Array.from(r||[])}function ne(e){return ae(e).map(xe).join("")}function ie(e){return q(ne(P(e)))}function ce(e,t=8,r=l){return fe(e,re(e.length,t),r)}function fe(e,t,r=l){return me(e,t,!0,r)}function oe(e,t,r=l){return me(e,t,!1,r)}function de(e){return e.replace(/^0x/,"")}function se(e){return e.startsWith("0x")?e:`0x${e}`}function ue(e){return e=de(e),e=ce(e,2),e&&(e=se(e)),e}function be(e){const t=e.startsWith("0x");return e=de(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,r,a=l){const n=t-e.length;let i=e;if(n>0){const t=a.repeat(n);i=r?t+e:e+t}return i}t.bufferToArray=p,t.bufferToHex=x,t.bufferToUtf8=m,t.bufferToNumber=v,t.bufferToBinary=g,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=T,t.hexToBinary=P,t.utf8ToBuffer=I,t.utf8ToArray=B,t.utf8ToHex=C,t.utf8ToNumber=O,t.utf8ToBinary=R,t.numberToBuffer=N,t.numberToArray=L,t.numberToHex=U,t.numberToUtf8=j,t.numberToBinary=F,t.binaryToBuffer=D,t.binaryToArray=H,t.binaryToHex=q,t.binaryToUtf8=z,t.binaryToNumber=K,t.isBinaryString=W,t.isHexString=G,t.isBuffer=V,t.isTypedArray=Z,t.isArrayBuffer=$,t.getType=J,t.getEncoding=Y,t.concatBuffers=X,t.concatArrays=Q,t.trimLeft=ee,t.trimRight=te,t.calcByteLength=re,t.splitBytes=ae,t.swapBytes=ne,t.swapHex=ie,t.sanitizeBytes=ce,t.padLeft=fe,t.padRight=oe,t.removeHexPrefix=de,t.addHexPrefix=se,t.sanitizeHex=ue,t.removeHexLeadingZeros=be},46129:function(e,t,r){"use strict";function a(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function n(){const e=a();return e.subtle||e.webkitSubtle}function i(){return!!a()&&!!n()}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=a,t.getSubtleCrypto=n,t.isBrowserCryptoAvailable=i},46862:function(e,t,r){"use strict";var a=r(96027);function n(){return"undefined"===typeof document&&"undefined"!==typeof navigator&&"ReactNative"===navigator.product}function i(){return"undefined"!==typeof a&&"undefined"!==typeof a.versions&&"undefined"!==typeof a.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,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(46129),t),n(r(46862),t)},83581:function(e,t,r){var a=r(96027);function n(e){return e&&"object"===typeof e&&"default"in e?e["default"]:e}var i=r(61639),c=n(r(38385)),f=n(r(51945)),o=r(45626);function d(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 u(e,t){try{var r=e()}catch(a){return t(a)}return r&&r.then?r.then(void 0,t):r}var b="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",v="walletconnect-qrcode-modal",g="walletconnect-qrcode-close",y="walletconnect-qrcode-text",w="walletconnect-connect-button";function M(e){return o.createElement("div",{className:"walletconnect-modal__header"},o.createElement("img",{src:b,className:"walletconnect-modal__headerLogo"}),o.createElement("p",null,h),o.createElement("div",{className:"walletconnect-modal__close__wrapper",onClick:e.onClose},o.createElement("div",{id:g,className:"walletconnect-modal__close__icon"},o.createElement("div",{className:"walletconnect-modal__close__line1"}),o.createElement("div",{className:"walletconnect-modal__close__line2"}))))}function _(e){return o.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,r=e.href,a=e.name,n=e.logo,i=e.onClick;return o.createElement("a",{className:"walletconnect-modal__base__row",href:r,onClick:i,rel:"noopener noreferrer",target:"_blank"},o.createElement("h3",{className:"walletconnect-modal__base__row__h3"},a),o.createElement("div",{className:"walletconnect-modal__base__row__right"},o.createElement("div",{className:"walletconnect-modal__base__row__right__app-icon",style:{background:"url('"+n+"') "+t,backgroundSize:"100%"}}),o.createElement("img",{src:k,className:"walletconnect-modal__base__row__right__caret"})))}function S(e){var t=e.color,r=e.href,a=e.name,n=e.logo,i=e.onClick,c=window.innerWidth<768?(a.length>8?2.5:2.7)+"vw":"inherit";return o.createElement("a",{className:"walletconnect-connect__button__icon_anchor",href:r,onClick:i,rel:"noopener noreferrer",target:"_blank"},o.createElement("div",{className:"walletconnect-connect__button__icon",style:{background:"url('"+n+"') "+t,backgroundSize:"100%"}}),o.createElement("div",{style:{fontSize:c},className:"walletconnect-connect__button__text"},a))}var E=5,T=12;function P(e){var t=i.isAndroid(),r=o.useState(""),a=r[0],n=r[1],c=o.useState(""),f=c[0],d=c[1],s=o.useState(1),u=s[0],b=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/T),v=[(u-1)*T+1,u*T],g=h.length?h.filter((function(e,t){return t+1>=v[0]&&t+1<=v[1]})):[],w=!(t||!(m>1)),M=void 0;function k(e){n(e.target.value),clearTimeout(M),e.target.value?M=setTimeout((function(){d(e.target.value),b(1)}),1e3):(n(""),d(""),b(1))}return o.createElement("div",null,o.createElement("p",{id:y,className:"walletconnect-qrcode__text"},t?e.text.connect_mobile_wallet:e.text.choose_preferred_wallet),!t&&o.createElement("input",{className:"walletconnect-search__input",placeholder:"Search",value:a,onChange:k}),o.createElement("div",{className:"walletconnect-connect__buttons__wrapper"+(t?"__android":x&&h.length?"__wrap":"")},t?o.createElement(_,{name:e.text.connect,color:p,href:e.uri,onClick:o.useCallback((function(){i.saveMobileLinkInfo({name:"Unknown",href:e.uri})}),[])}):g.length?g.map((function(t){var r=t.color,a=t.name,n=t.shortName,c=t.logo,f=i.formatIOSMobile(e.uri,t),d=o.useCallback((function(){i.saveMobileLinkInfo({name:a,href:f})}),[g]);return x?o.createElement(S,{color:r,href:f,name:n||a,logo:c,onClick:d}):o.createElement(A,{color:r,href:f,name:a,logo:c,onClick:d})})):o.createElement(o.Fragment,null,o.createElement("p",null,l.length?e.errorMessage:e.links.length&&!h.length?e.text.no_wallets_found:e.text.loading))),w&&o.createElement("div",{className:"walletconnect-modal__footer"},Array(m).fill(0).map((function(e,t){var r=t+1,a=u===r;return o.createElement("a",{style:{margin:"auto 10px",fontWeight:a?"bold":"normal"},onClick:function(){return b(r)}},r)}))))}function I(e){var t=!!e.message.trim();return o.createElement("div",{className:"walletconnect-qrcode__notification"+(t?" notification__show":"")},e.message)}var B=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||o.useEffect((function(){var n=function(){try{if(t)return Promise.resolve();f(!0);var n=u((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=r?"mobile":"desktop",o=i.getMobileLinkRegistry(i.formatMobileRegistry(n,c),a);f(!1),b(!0),B(o.length?"":e.text.no_supported_wallets),E(o);var d=1===o.length;d&&(y(i.formatIOSMobile(e.uri,o[0])),p(!0)),k(d)}))}))}),(function(t){f(!1),b(!0),B(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()}))};O();var R=r?l:!l;return o.createElement("div",{id:v,className:"walletconnect-qrcode__base animated fadeIn"},o.createElement("div",{className:"walletconnect-modal__base"},o.createElement(M,{onClose:e.onClose}),_&&l?o.createElement("div",{className:"walletconnect-modal__single_wallet"},o.createElement("a",{onClick:function(){return i.saveMobileLinkInfo({name:S[0].name,href:g})},href:g,rel:"noopener noreferrer",target:"_blank"},e.text.connect_with+" "+(_?S[0].name:"")+" ›")):t||c||!c&&S.length?o.createElement("div",{className:"walletconnect-modal__mobile__toggle"+(R?" right__selected":"")},o.createElement("div",{className:"walletconnect-modal__mobile__toggle_selector"}),r?o.createElement(o.Fragment,null,o.createElement("a",{onClick:function(){return p(!1),O()}},e.text.mobile),o.createElement("a",{onClick:function(){return p(!0)}},e.text.qrcode)):o.createElement(o.Fragment,null,o.createElement("a",{onClick:function(){return p(!0)}},e.text.qrcode),o.createElement("a",{onClick:function(){return p(!1),O()}},e.text.desktop))):null,o.createElement("div",null,l||!t&&!c&&!S.length?o.createElement(C,Object.assign({},x)):o.createElement(P,Object.assign({},x,{links:S,errorMessage:I})))))}var R={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"},L={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"},U={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:"지갑을 찾을 수 없습니다"},F={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"},D={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:"没有找到钱包"},H={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:"هیچ کیف پولی پیدا نشد"},q={de:R,en:N,es:L,fr:U,ko:j,pt:F,zh:D,fa:H};function z(){var e=i.getDocumentOrThrow(),t=e.getElementById(m);t&&e.head.removeChild(t);var r=e.createElement("style");r.setAttribute("id",m),r.innerText=s,e.head.appendChild(r)}function K(){var e=i.getDocumentOrThrow(),t=e.createElement("div");return t.setAttribute("id",x),e.body.appendChild(t),t}function W(){var e=i.getDocumentOrThrow(),t=e.getElementById(v);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(){W(),e&&e()}}function V(){var e=i.getNavigatorOrThrow().language.split("-")[0]||"en";return q[e]||q["en"]}function Z(e,t,r){z();var a=K();o.render(o.createElement(O,{text:V(),uri:e,onClose:G(t),qrcodeModalOptions:r}),a)}function $(){W()}var J=function(){return"undefined"!==typeof a&&"undefined"!==typeof a.versions&&"undefined"!==typeof a.versions.node};function Y(e,t,r){console.log(e),J()?d(e):Z(e,t,r)}function X(){J()||$()}var Q={open:Y,close:X};e.exports=Q},90994:function(e,t,r){"use strict";r(21703),e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},30322:function(e,t,r){"use strict";r.d(t,{Z:function(){return xt}});var a={};r.r(a),r.d(a,{decrypt:function(){return Ye},encrypt:function(){return Je},generateKey:function(){return Ze},verifyHmac:function(){return $e}});r(21703);var n=r(61639);const i=["session_request","session_update","exchange_key","connect","disconnect","display_uri","modal_closed","transport_open","transport_close","transport_error"],c=["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"],f={1:"mainnet",3:"ropsten",4:"rinkeby",5:"goerli",42:"kovan"};r(48675),r(3462);var o=r(2396),d=r.n(o),s=r(3896);function u(e){return s.arrayToBuffer(new Uint8Array(e))}function b(e,t){return s.arrayToHex(new Uint8Array(e),!t)}function h(e){return s.bufferToArray(e).buffer}function l(e){return s.utf8ToBuffer(e)}function p(e,t){return s.utf8ToHex(e,!t)}function x(e){return s.hexToArray(e).buffer}function m(e,t){const r=s.removeHexPrefix(s.sanitizeHex(new(d())(e).toString(16)));return t?r:s.addHexPrefix(r)}var v=r(69893);var g=r(29441);function y(){const e=Date.now()*Math.pow(10,3),t=Math.floor(Math.random()*Math.pow(10,3));return e+t}function w(e){return s.sanitizeHex(e)}function M(e){return s.removeHexLeadingZeros(s.addHexPrefix(e))}const _=y;function k(){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 A(e,t){let r;const a=f[e];return a&&(r=`https://${a}.infura.io/v3/${t}`),r}function S(e,t){let r;const a=A(e,t.infuraId);return t.custom&&t.custom[e]?r=t.custom[e]:a&&(r=a),r}function E(e){return""===e||"string"===typeof e&&""===e.trim()}function T(e){return!(e&&e.length)}function P(e,t){return s.isHexString(e,t)}function I(e){return"undefined"!==typeof e.method}function B(e){return"undefined"!==typeof e.result}function C(e){return"undefined"!==typeof e.error}function O(e){return"undefined"!==typeof e.event}function R(e){return i.includes(e)||e.startsWith("wc_")}function N(e){return!!e.method.startsWith("wc_")||!c.includes(e.method)}function L(e){e=(0,s.removeHexPrefix)(e.toLowerCase());const t=(0,s.removeHexPrefix)((0,v.keccak_256)(l(e)));let r="";for(let a=0;a7?r+=e[a].toUpperCase():r+=e[a];return(0,s.addHexPrefix)(r)}const U=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===L(e))));function j(e){return T(e)||P(e[0])||(e[0]=p(e[0])),e}function F(e){if("undefined"!==typeof e.type&&"0"!==e.type)return e;if("undefined"===typeof e.from||!U(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&&!E(e))&&(P(e)?"string"===typeof e&&(t=w(e)):t=m(e)),"string"===typeof t&&(t=M(t)),t}const r={from:w(e.from),to:"undefined"===typeof e.to?"":w(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?"":w(e.data)||"0x"},a=["gasPrice","gas","value","nonce"];return Object.keys(r).forEach((e=>{!r[e].trim().length&&a.includes(e)&&delete r[e]})),r}function D(e){const t=e.message||"Failed or Rejected Request";let r=-32e3;if(e&&!e.code)switch(t){case"Parse error":r=-32700;break;case"Invalid request":r=-32600;break;case"Method not found":r=-32601;break;case"Invalid params":r=-32602;break;case"Internal error":r=-32603;break;default:r=-32e3;break}const a={code:r,message:t};return a}var H=r(14782);function q(e){const t=-1!==e.indexOf("?")?e.indexOf("?"):void 0,r="undefined"!==typeof t?e.substr(t):"";return r}function z(e,t){let r=K(e);return r=Object.assign(Object.assign({},r),t),e=W(r),e}function K(e){return H.parse(e)}function W(e){return H.stringify(e)}function G(e){return"undefined"!==typeof e.bridge}function V(e){const t=e.indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,a=e.substring(0,t),n=e.substring(t+1,r);function i(e){const t="@",r=e.split(t),a={handshakeTopic:r[0],version:parseInt(r[1],10)};return a}const c=i(n),f="undefined"!==typeof r?e.substr(r):"";function o(e){const t=K(e),r={key:t.key||"",bridge:t.bridge||""};return r}const d=o(f),s=Object.assign(Object.assign({protocol:a},c),d);return s}class Z{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 $=Z;const J="undefined"!==typeof r.g.WebSocket?r.g.WebSocket:r(90994);class Y{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 $,!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,r){if(!t||"string"!==typeof t)throw new Error("Missing or invalid topic field");this._socketSend({topic:t,type:"pub",payload:e,silent:!!r})}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=X(this._url,this._protocol,this._version);if(this._nextSocket=new J(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(r){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 X(e,t,r){var a,i;const c=e.startsWith("https")?e.replace("https","wss"):e.startsWith("http")?e.replace("http","ws"):e,f=c.split("?"),o=(0,n.isBrowser)()?{protocol:t,version:r,env:"browser",host:(null===(a=(0,n.getLocation)())||void 0===a?void 0:a.host)||""}:{protocol:t,version:r,env:(null===(i=(0,n.detectEnv)())||void 0===i?void 0:i.name)||""},d=z(q(f[1]||""),o);return f[0]+"?"+d}var Q=Y;const ee="Session currently connected",te="Session currently disconnected",re="Session Rejected",ae="Missing JSON RPC response",ne='JSON-RPC success response must include "result" field',ie='JSON-RPC error response must include "error" field',ce='JSON RPC request must have valid "method" value',fe='JSON RPC request must have valid "id" value',oe="Missing one of the required parameters: bridge / uri / session",de="JSON RPC response format is invalid",se="URI format is invalid",ue="QRCode Modal not provided",be="User close QRCode Modal";class he{constructor(){this._eventEmitters=[]}subscribe(e){this._eventEmitters.push(e)}unsubscribe(e){this._eventEmitters=this._eventEmitters.filter((t=>t.event!==e))}trigger(e){let t,r=[];t=I(e)?e.method:B(e)||C(e)?`response:${e.id}`:O(e)?e.event:"",t&&(r=this._eventEmitters.filter((e=>e.event===t))),r&&r.length||R(t)||O(t)||(r=this._eventEmitters.filter((e=>"call_request"===e.event))),r.forEach((t=>{if(C(e)){const r=new Error(e.error.message);t.callback(r,null)}else t.callback(null,e)}))}}var le=he;class pe{constructor(e="walletconnect"){this.storageId=e}getSession(){let e=null;const t=(0,n.getLocal)(this.storageId);return t&&G(t)&&(e=t),e}setSession(e){return(0,n.setLocal)(this.storageId,e),e}removeSession(){(0,n.removeLocal)(this.storageId)}}var xe=pe;const me="walletconnect.org",ve="abcdefghijklmnopqrstuvwxyz0123456789",ge=ve.split("").map((e=>`https://${e}.bridge.walletconnect.org`));function ye(e){let t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0];return t=t.split(":")[0],t=t.split("?")[0],t}function we(e){return ye(e).split(".").slice(-2).join(".")}function Me(){return Math.floor(Math.random()*ge.length)}function _e(){return ge[Me()]}function ke(e){return we(e)===me}function Ae(e){return ke(e)?_e():e}class Se{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 le,this._clientMeta=(0,n.getClientMeta)()||e.connectorOpts.clientMeta||null,this._cryptoLib=e.cryptoLib,this._sessionStorage=e.sessionStorage||new xe(e.connectorOpts.storageId),this._qrcodeModal=e.connectorOpts.qrcodeModal,this._qrcodeModalOptions=e.connectorOpts.qrcodeModalOptions,this._signingMethods=[...c,...e.connectorOpts.signingMethods||[]],!e.connectorOpts.bridge&&!e.connectorOpts.uri&&!e.connectorOpts.session)throw new Error(oe);e.connectorOpts.bridge&&(this.bridge=Ae(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 Q({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=x(e);this._key=t}get key(){if(this._key){const e=b(this._key,!0);return e}return""}set clientId(e){e&&(this._clientId=e)}get clientId(){let e=this._clientId;return e||(e=this._clientId=k()),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,n.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:r,key:a}=this._parseUri(e);this.handshakeTopic=t,this.bridge=r,this.key=a}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 r={event:e,callback:t};this._eventManager.subscribe(r)}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=k(),this._eventManager.trigger({event:"display_uri",params:[this.uri]}),this.on("modal_closed",(()=>{throw new Error(be)}));const r=()=>{this.killSession()};try{const e=await this._sendCallRequest(t);return e&&r(),e}catch(a){throw r(),a}}async connect(e){if(!this._qrcodeModal)throw new Error(ue);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(be)))),this.on("connect",((r,a)=>{if(r)return t(r);e(a.params[0])}))})))}async createSession(e){if(this._connected)throw new Error(ee);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=k(),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(ee);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},r={id:this.handshakeId,jsonrpc:"2.0",result:t};this._sendResponse(r),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(ee);const t=e&&e.message?e.message:re,r=this._formatResponse({id:this.handshakeId,error:{message:t}});this._sendResponse(r),this._connected=!1,this._eventManager.trigger({event:"disconnect",params:[{message:t}]}),this._removeStorageSession()}updateSession(e){if(!this._connected)throw new Error(te);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},r=this._formatRequest({method:"wc_sessionUpdate",params:[t]});this._sendSessionRequest(r,"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",r={approved:!1,chainId:null,networkId:null,accounts:null},a=this._formatRequest({method:"wc_sessionUpdate",params:[r]});await this._sendRequest(a),this._handleSessionDisconnect(t)}async sendTransaction(e){if(!this._connected)throw new Error(te);const t=F(e),r=this._formatRequest({method:"eth_sendTransaction",params:[t]}),a=await this._sendCallRequest(r);return a}async signTransaction(e){if(!this._connected)throw new Error(te);const t=F(e),r=this._formatRequest({method:"eth_signTransaction",params:[t]}),a=await this._sendCallRequest(r);return a}async signMessage(e){if(!this._connected)throw new Error(te);const t=this._formatRequest({method:"eth_sign",params:e}),r=await this._sendCallRequest(t);return r}async signPersonalMessage(e){if(!this._connected)throw new Error(te);e=j(e);const t=this._formatRequest({method:"personal_sign",params:e}),r=await this._sendCallRequest(t);return r}async signTypedData(e){if(!this._connected)throw new Error(te);const t=this._formatRequest({method:"eth_signTypedData",params:e}),r=await this._sendCallRequest(t);return r}async updateChain(e){if(!this._connected)throw new Error("Session currently disconnected");const t=this._formatRequest({method:"wallet_updateChain",params:[e]}),r=await this._sendCallRequest(t);return r}unsafeSend(e,t){return this._sendRequest(e,t),this._eventManager.trigger({event:"call_request_sent",params:[{request:e,options:t}]}),new Promise(((t,r)=>{this._subscribeToResponse(e.id,((e,a)=>{if(e)r(e);else{if(!a)throw new Error(ae);t(a)}}))}))}async sendCustomRequest(e,t){if(!this._connected)throw new Error(te);switch(e.method){case"eth_accounts":return this.accounts;case"eth_chainId":return m(this.chainId);case"eth_sendTransaction":case"eth_signTransaction":e.params&&(e.params[0]=F(e.params[0]));break;case"personal_sign":e.params&&(e.params=j(e.params));break;default:break}const r=this._formatRequest(e),a=await this._sendCallRequest(r,t);return a}approveRequest(e){if(!B(e))throw new Error(ne);{const t=this._formatResponse(e);this._sendResponse(t)}}rejectRequest(e){if(!C(e))throw new Error(ie);{const t=this._formatResponse(e);this._sendResponse(t)}}transportClose(){this._transport.close()}async _sendRequest(e,t){const r=this._formatRequest(e),a=await this._encrypt(r),n="undefined"!==typeof(null===t||void 0===t?void 0:t.topic)?t.topic:this.peerId,i=JSON.stringify(a),c="undefined"!==typeof(null===t||void 0===t?void 0:t.forcePushNotification)?!t.forcePushNotification:N(r);this._transport.send(i,n,c)}async _sendResponse(e){const t=await this._encrypt(e),r=this.peerId,a=JSON.stringify(t),n=!0;this._transport.send(a,r,n)}async _sendSessionRequest(e,t,r){this._sendRequest(e,r),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(ce);const t={id:"undefined"===typeof e.id?_():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(fe);const t={id:e.id,jsonrpc:"2.0"};if(C(e)){const r=D(e.error),a=Object.assign(Object.assign(Object.assign({},t),e),{error:r});return a}if(B(e)){const r=Object.assign(Object.assign({},t),e);return r}throw new Error(de)}_handleSessionDisconnect(e){const t=e||"Session Disconnected";this._connected||(this._qrcodeModal&&this._qrcodeModal.close(),(0,n.removeLocal)(n.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 r;try{r=JSON.parse(e.payload)}catch(n){return}const a=await this._decrypt(r);a&&this._eventManager.trigger(a)}_subscribeToSessionRequest(){this._transport.subscribe(this.handshakeTopic)}_subscribeToResponse(e,t){this.on(`response:${e}`,t)}_subscribeToSessionResponse(e,t){this._subscribeToResponse(e,((e,r)=>{e?this._handleSessionResponse(e.message):r.result?this._handleSessionResponse(t,r.result):r.error&&r.error.message?this._handleSessionResponse(r.error.message):this._handleSessionResponse(t)}))}_subscribeToCallResponse(e){return new Promise(((t,r)=>{this._subscribeToResponse(e,((e,a)=>{e?r(e):a.result?t(a.result):a.error&&a.error.message?r(new Error(a.error.message)):r(new Error(de))}))}))}_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:r}=t.params[0];if((0,n.isMobile)()&&this._signingMethods.includes(r.method)){const e=(0,n.getLocal)(n.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 r=Object.assign(Object.assign({},t),{method:"session_request"});this._eventManager.trigger(r)})),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,r=this.version,a=encodeURIComponent(this.bridge),n=this.key,i=`${e}:${t}@${r}?bridge=${a}&key=${n}`;return i}_parseUri(e){const t=V(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 r=decodeURIComponent(t.bridge);if(!t.key)throw Error("Invalid or missing key parameter value");const a=t.key;return{handshakeTopic:e,bridge:r,key:a}}throw new Error(se)}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 r=await this._cryptoLib.encrypt(e,t);return r}return null}async _decrypt(e){const t=this._key;if(this._cryptoLib&&t){const r=await this._cryptoLib.decrypt(e,t);return r}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(r,a)=>{if(r)throw r;if(e.peerMeta){const e=a.params[0].peerMeta.name;t.peerName=e}try{const r=await fetch(`${e.url}/new`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json();if(!a.success)throw Error("Failed to register in Push Server")}catch(r){throw Error("Failed to register in Push Server")}}))}}var Ee=Se;function Te(e){const t=g.getBrowerCrypto();return t.getRandomValues(new Uint8Array(e))}const Pe=256,Ie=Pe,Be=Pe,Ce="AES-CBC",Oe=`SHA-${Ie}`,Re="HMAC",Ne="encrypt",Le="decrypt",Ue="sign",je="verify";function Fe(e){return e===Ce?{length:Ie,name:Ce}:{hash:{name:Oe},name:Re}}function De(e){return e===Ce?[Ne,Le]:[Ue,je]}async function He(e,t=Ce){return g.getSubtleCrypto().importKey("raw",e,Fe(t),!0,De(t))}async function qe(e,t,r){const a=g.getSubtleCrypto(),n=await He(t,Ce),i=await a.encrypt({iv:e,name:Ce},n,r);return new Uint8Array(i)}async function ze(e,t,r){const a=g.getSubtleCrypto(),n=await He(t,Ce),i=await a.decrypt({iv:e,name:Ce},n,r);return new Uint8Array(i)}async function Ke(e,t){const r=g.getSubtleCrypto(),a=await He(e,Re),n=await r.sign({length:Be,name:Re},a,t);return new Uint8Array(n)}function We(e,t,r){return qe(e,t,r)}function Ge(e,t,r){return ze(e,t,r)}async function Ve(e,t){const r=await Ke(e,t);return r}async function Ze(e){const t=(e||256)/8,r=Te(t),a=h(s.arrayToBuffer(r));return a}async function $e(e,t){const r=s.hexToArray(e.data),a=s.hexToArray(e.iv),n=s.hexToArray(e.hmac),i=s.arrayToHex(n,!1),c=s.concatArrays(r,a),f=await Ve(t,c),o=s.arrayToHex(f,!1);return s.removeHexPrefix(i)===s.removeHexPrefix(o)}async function Je(e,t,r){const a=s.bufferToArray(u(t)),n=r||await Ze(128),i=s.bufferToArray(u(n)),c=s.arrayToHex(i,!1),f=JSON.stringify(e),o=s.utf8ToArray(f),d=await We(i,a,o),b=s.arrayToHex(d,!1),h=s.concatArrays(d,i),l=await Ve(a,h),p=s.arrayToHex(l,!1);return{data:b,hmac:p,iv:c}}async function Ye(e,t){const r=s.bufferToArray(u(t));if(!r)throw new Error("Missing key: required for decryption");const a=await $e(e,r);if(!a)return null;const n=s.hexToArray(e.data),i=s.hexToArray(e.iv),c=await Ge(i,r,n),f=s.arrayToUtf8(c);let o;try{o=JSON.parse(f)}catch(d){return null}return o}class Xe extends Ee{constructor(e,t){super({cryptoLib:a,connectorOpts:e,pushServerOpts:t})}}var Qe=Xe,et=r(83581),tt=r.n(et),rt=r(6856),at=r.n(rt),nt=r(51283);const it=(0,n.getFromWindow)("XMLHttpRequest")||nt.XMLHttpRequest;class ct extends(at()){constructor(e){super(),this.url=e}formatError(e,t,r=-1){return{error:{message:t,code:r},id:e.id,jsonrpc:e.jsonrpc}}send(e,t){return new Promise((r=>{if("eth_subscribe"===e.method){const t=this.formatError(e,"Subscriptions are not supported by this HTTP endpoint");return this.emit("error",t),r(t)}const a=new it;let n=!1;const i=(i,c)=>{if(!n)if(a.abort(),n=!0,t)t(i,c);else{const{id:t,jsonrpc:a}=e,n=i?{id:t,jsonrpc:a,error:{message:i.message,code:i.code}}:{id:t,jsonrpc:a,result:c};this.emit("payload",n),r(n)}};a.open("POST",this.url,!0),a.setRequestHeader("Content-Type","application/json"),a.timeout=6e4,a.onerror=i,a.ontimeout=i,a.onreadystatechange=()=>{if(4===a.readyState)try{const e=JSON.parse(a.responseText);i(e.error,e.result)}catch(e){i(e)}},a.send(JSON.stringify(e))}))}}var ft=ct;const ot=r(79948),dt=r(91501),st=r(51080),ut=r(23220),bt=r(49537),ht=r(50822),lt=r(95905);class pt extends ot{constructor(e){if(super({pollingInterval:e.pollingInterval||8e3}),this.bridge="https://bridge.walletconnect.org",this.qrcode=!0,this.qrcodeModal=tt(),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 r=e;let a=t;return"personal_sign"===r&&(a=j(a)),this.sendAsyncPromise(r,a)}if(e=Object.assign({id:_(),jsonrpc:"2.0"},e),"personal_sign"===e.method&&(e.params=j(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 Qe({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,r=null;const a=await this.getWalletConnector();switch(e.method){case"wc_killSession":await this.close(),r=null;break;case"eth_accounts":r=a.accounts;break;case"eth_coinbase":r=a.accounts[0];break;case"eth_chainId":r=a.chainId;break;case"net_version":r=a.chainId;break;case"eth_uninstallFilter":this.sendAsync(e,(e=>e)),r=!0;break;default:t=await this.handleOtherRequests(e)}return t||this.formatResponse(e,r)}catch(t){throw this.emit("error",t),t}}async handleOtherRequests(e){if(!c.includes(e.method)&&e.method.startsWith("eth_"))return this.handleReadRequests(e);const t=await this.getWalletConnector(),r=await t.sendCustomRequest(e);return this.formatResponse(e,r)}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,r)=>{const a=this.wc;this.isConnecting?this.onConnect((t=>e(t))):a.connected||t?(this.connected||(this.connected=!0,this.updateState(a.session)),e(a)):(this.isConnecting=!0,a.on("modal_closed",(()=>{r(new Error("User closed modal"))})),a.createSession({chainId:this.chainId}).then((()=>{a.on("connect",((t,n)=>{if(t)return this.isConnecting=!1,r(t);this.isConnecting=!1,this.connected=!0,n&&this.updateState(n.params[0]),this.emit("connect"),this.triggerConnect(a),e(a)}))})).catch((e=>{this.isConnecting=!1,r(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:r,networkId:a,rpcUrl:n}=e;(!this.accounts||t&&this.accounts!==t)&&(this.accounts=t,this.emit("accountsChanged",t)),(!this.chainId||r&&this.chainId!==r)&&(this.chainId=r,this.emit("chainChanged",r)),(!this.networkId||a&&this.networkId!==a)&&(this.networkId=a,this.emit("networkChanged",a)),this.updateRpcUrl(this.chainId,n||"")}updateRpcUrl(e,t=""){const r={infuraId:this.infuraId,custom:this.rpc||void 0};t=t||S(e,r),t?(this.rpcUrl=t,this.updateHttpConnection()):this.emit("error",new Error(`No RPC Url available for chainId: ${e}`))}updateHttpConnection(){this.rpcUrl&&(this.http=new ft(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(((r,a)=>{this.sendAsync({id:_(),jsonrpc:"2.0",method:e,params:t||[]},((e,t)=>{e?a(e):r(t.result)}))}))}initialize(){this.updateRpcUrl(this.chainId),this.addProvider(new st({eth_hashrate:"0x00",eth_mining:!1,eth_syncing:!0,net_listening:!0,web3_clientVersion:"WalletConnect/v1.x.x/javascript"})),this.addProvider(new dt),this.addProvider(new lt),this.addProvider(new ut),this.addProvider(new ht),this.addProvider(new bt(this.configWallet())),this.addProvider({handleRequest:async(e,t,r)=>{try{const{error:t,result:a}=await this.handleRequest(e);r(t,a)}catch(a){r(a)}},setEngine:e=>e})}configWallet(){return{getAccounts:async e=>{try{const t=await this.getWalletConnector(),r=t.accounts;r&&r.length?e(null,r):e(new Error("Failed to get accounts"))}catch(t){e(t)}},processMessage:async(e,t)=>{try{const r=await this.getWalletConnector(),a=await r.signMessage([e.from,e.data]);t(null,a)}catch(r){t(r)}},processPersonalMessage:async(e,t)=>{try{const r=await this.getWalletConnector(),a=await r.signPersonalMessage([e.data,e.from]);t(null,a)}catch(r){t(r)}},processSignTransaction:async(e,t)=>{try{const r=await this.getWalletConnector(),a=await r.signTransaction(e);t(null,a)}catch(r){t(r)}},processTransaction:async(e,t)=>{try{const r=await this.getWalletConnector(),a=await r.sendTransaction(e);t(null,a)}catch(r){t(r)}},processTypedMessage:async(e,t)=>{try{const r=await this.getWalletConnector(),a=await r.signTypedData([e.from,e.data]);t(null,a)}catch(r){t(r)}}}}}var xt=pt},23380:function(e,t,r){"use strict";function a(e){let t;return"undefined"!==typeof window&&"undefined"!==typeof window[e]&&(t=window[e]),t}function n(e){const t=a(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}function i(){return n("document")}function c(){return a("document")}function f(){return n("navigator")}function o(){return a("navigator")}function d(){return n("location")}function s(){return a("location")}function u(){return n("crypto")}function b(){return a("crypto")}function h(){return n("localStorage")}function l(){return a("localStorage")}r(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=a,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=i,t.getDocument=c,t.getNavigatorOrThrow=f,t.getNavigator=o,t.getLocationOrThrow=d,t.getLocation=s,t.getCryptoOrThrow=u,t.getCrypto=b,t.getLocalStorageOrThrow=h,t.getLocalStorage=l},91342:function(e,t,r){"use strict";t.D=void 0;const a=r(23380);function n(){let e,t;try{e=a.getDocumentOrThrow(),t=a.getLocationOrThrow()}catch(b){return null}function r(){const r=e.getElementsByTagName("link"),a=[];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 r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{const a=t.pathname.split("/");a.pop();const n=a.join("/");r+=n+"/"+e}a.push(r)}else if(0===e.indexOf("//")){const r=t.protocol+e;a.push(r)}else a.push(e)}}return a}function n(...t){const r=e.getElementsByTagName("meta");for(let e=0;ea.getAttribute(e))).filter((e=>!!e&&t.includes(e)));if(n.length&&n){const e=a.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(),o=c(),d=t.origin,s=r(),u={description:o,url:d,icons:s,name:f};return u}t.D=n},18625:function(e,t,r){"use strict";const a=t;a.bignum=r(2396),a.define=r(49542).define,a.base=r(51406),a.constants=r(84194),a.decoders=r(86410),a.encoders=r(19375)},49542:function(e,t,r){"use strict";const a=r(19375),n=r(86410),i=r(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 r(e){this._initNamed(e,t)}return i(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(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,r){return this._getDecoder(t).decode(e,r)},f.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(a[e])),this.encoders[e]},f.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},42956:function(e,t,r){"use strict";const a=r(81923),n=r(5487).b,i=r(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}}a(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 r=new c(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},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(r){r.join(e,t),t+=r.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,r){"use strict";const a=t;a.Reporter=r(5487).b,a.DecoderBuffer=r(42956).C,a.EncoderBuffer=r(42956).R,a.Node=r(92851)},92851:function(e,t,r){"use strict";r(21703);const a=r(5487).b,n=r(42956).R,i=r(42956).C,c=r(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"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(f),d=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function s(e,t,r){const a={};this._baseState=a,a.name=r,a.enc=e,a.parent=t||null,a.children=null,a.tag=null,a.args=null,a.reverseArgs=null,a.choice=null,a.optional=!1,a.any=!1,a.obj=!1,a.use=null,a.useDecoder=null,a.key=null,a["default"]=null,a.explicit=null,a.implicit=null,a.contains=null,a.parent||(a.children=[],this._wrap())}e.exports=s;const u=["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={};u.forEach((function(r){t[r]=e[r]}));const r=new this.constructor(t.parent);return r._baseState=t,r},s.prototype._wrap=function(){const e=this._baseState;o.forEach((function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,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,r=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==r.length&&(c(null===t.children),t.children=r,r.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(r){r==(0|r)&&(r|=0);const a=e[r];t[a]=r})),t})))},d.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,r=Array.prototype.slice.call(arguments);return c(null===t.tag),t.tag=e,this._useArgs(r),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 r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let a,n=r["default"],c=!0,f=null;if(null!==r.key&&(f=e.enterKey(r.key)),r.optional){let a=null;if(null!==r.explicit?a=r.explicit:null!==r.implicit?a=r.implicit:null!==r.tag&&(a=r.tag),null!==a||r.any){if(c=this._peekTag(e,a,r.any),e.isError(c))return c}else{const a=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),c=!0}catch(o){c=!1}e.restore(a)}}if(r.obj&&c&&(a=e.enterObject()),c){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const a=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const a=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(a))return a;r.any?n=e.raw(t):e=a}if(t&&t.track&&null!==r.tag&&t.track(e.path(),a,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(n=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(n))return n;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(e,t)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const a=new i(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(a,t)}}return r.obj&&c&&(n=e.leaveObject(a)),null===r.key||null===n&&!0!==c?null!==f&&e.exitKey(f):e.leaveKey(f,r.key,n),n},s.prototype._decodeGeneric=function(e,t,r){const a=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,a.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&a.args?this._decodeObjid(t,a.args[0],a.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,a.args&&a.args[0],r):null!==a.use?this._getUse(a.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},s.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),c(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},s.prototype._decodeChoice=function(e,t){const r=this._baseState;let a=null,n=!1;return Object.keys(r.choice).some((function(i){const c=e.save(),f=r.choice[i];try{const r=f._decode(e,t);if(e.isError(r))return!1;a={type:i,value:r},n=!0}catch(o){return e.restore(c),!1}return!0}),this),n?a:e.error("Choice not matched")},s.prototype._createEncoderBuffer=function(e){return new n(e,this.reporter)},s.prototype._encode=function(e,t,r){const a=this._baseState;if(null!==a["default"]&&a["default"]===e)return;const n=this._encodeValue(e,t,r);return void 0===n||this._skipDefault(n,t,r)?void 0:n},s.prototype._encodeValue=function(e,t,r){const n=this._baseState;if(null===n.parent)return n.children[0]._encode(e,t||new a);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,r)._encode(e,t),f=!0;else if(n.children)c=n.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const a=t.enterKey(r._baseState.key);if("object"!==typeof e)return t.error("Child expected, but input is not object");const n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(a),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 r=this.clone();r._baseState.implicit=null,c=this._createEncoderBuffer(e.map((function(r){const a=this._baseState;return this._getUse(a.args[0],e)._encode(r,t)}),r))}else null!==n.use?i=this._getUse(n.use,r)._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,r=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,r,c))}return null!==n.explicit&&(i=this._encodeComposite(n.explicit,!1,"context",i)),i},s.prototype._encodeChoice=function(e,t){const r=this._baseState,a=r.choice[e.type];return a||c(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),a._encode(e.value,t)},s.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.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,r.args&&r.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,r){"use strict";r(21703);const a=r(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,r){const a=this._reporterState;this.exitKey(e),null!==a.obj&&(a.obj[t]=r)},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,r=t.obj;return t.obj=e,r},n.prototype.error=function(e){let t;const r=this._reporterState,a=e instanceof i;if(t=a?e:new i(r.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!r.options.partial)throw t;return a||r.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},a(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 r(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const a=e[r];t[a]=r})),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=r(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=r(t.tag)},84194:function(e,t,r){"use strict";const a=t;a._reverse=function(e){const t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);const a=e[r];t[a]=r})),t},a.der=r(70607)},96496:function(e,t,r){"use strict";const a=r(81923),n=r(2396),i=r(42956).C,c=r(92851),f=r(70607);function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new d,this.tree._init(e.body)}function d(e){c.call(this,"der",e)}function s(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const a=f.tagClass[r>>6],n=0===(32&r);if(31===(31&r)){let a=r;r=0;while(128===(128&a)){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;const i=f.tag[r];return{cls:a,primitive:n,tag:r,tagStr:i}}function u(e,t,r){let a=e.readUInt8(r);if(e.isError(a))return a;if(!t&&128===a)return null;if(0===(128&a))return a;const n=127&a;if(n>4)return e.error("length octect is too long");a=0;for(let i=0;i=31?a.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|=c.tagClassByName[r||"universal"]<<6,n)}e.exports=f,f.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},a(o,i),o.prototype._encodeComposite=function(e,t,r,a){const i=s(e,t,r,this.reporter);if(a.length<128){const e=n.alloc(2);return e[0]=i,e[1]=a.length,this._createEncoderBuffer([e,a])}let c=1;for(let n=a.length;n>=256;n>>=8)c++;const f=n.alloc(2+c);f[0]=i,f[1]=128|c;for(let n=1+c,o=a.length;o>0;n--,o>>=8)f[n]=255&o;return this._createEncoderBuffer([f,a])},o.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 r=0;r=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let a=0;for(let n=0;n=128;t>>=7)a++}const i=n.alloc(a);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)},o.prototype._encodeTime=function(e,t){let r;const a=new Date(e);return"gentime"===t?r=[d(a.getUTCFullYear()),d(a.getUTCMonth()+1),d(a.getUTCDate()),d(a.getUTCHours()),d(a.getUTCMinutes()),d(a.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[d(a.getUTCFullYear()%100),d(a.getUTCMonth()+1),d(a.getUTCDate()),d(a.getUTCHours()),d(a.getUTCMinutes()),d(a.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},o.prototype._encodeNull=function(){return this._createEncoderBuffer("")},o.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 r=n.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let n=e;n>=256;n>>=8)r++;const a=new Array(r);for(let n=a.length-1;n>=0;n--)a[n]=255&e,e>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(n.from(a))},o.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},o.prototype._use=function(e,t){return"function"===typeof e&&(e=e(t)),e._getEncoder("der").tree},o.prototype._skipDefault=function(e,t,r){const a=this._baseState;let n;if(null===a["default"])return!1;const i=e.join();if(void 0===a.defaultBuffer&&(a.defaultBuffer=this._encodeValue(a["default"],t,r).join()),i.length!==a.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 r=!1;this._currentReleaser=function(){r||(r=!0,e._value++,e._dispatch())},t([this._value--,this._currentReleaser])}},e}();t["default"]=n},41704:function(e,t,r){"use strict";t.WU=void 0;var a=r(14059);Object.defineProperty(t,"WU",{enumerable:!0,get:function(){return a.default}});var n=r(66846);var i=r(419)},419:function(e,t,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=void 0;var a=r(62900);function n(e,t,r){var n=this;return void 0===r&&(r=new Error("timeout")),{acquire:function(){return new Promise((function(i,c){return a.__awaiter(n,void 0,void 0,(function(){var n,f,o;return a.__generator(this,(function(a){switch(a.label){case 0:return n=!1,setTimeout((function(){n=!0,c(r)}),t),[4,e.acquire()];case 1:return f=a.sent(),n?(o=Array.isArray(f)?f[1]:f,o()):i(f),[2]}}))}))}))},runExclusive:function(e){return a.__awaiter(this,void 0,void 0,(function(){var t,r;return a.__generator(this,(function(a){switch(a.label){case 0:t=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return r=a.sent(),Array.isArray(r)?(t=r[1],[4,e(r[0])]):[3,4];case 3:return[2,a.sent()];case 4:return t=r,[4,e()];case 5:return[2,a.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,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s;var a=r(70150),n=d(a),i=r(17467),c=d(i),f=r(28498),o=d(f);function d(e){return e&&e.__esModule?e:{default:e}}function s(e){return(0,c.default)((function(t,r){var a;try{a=e.apply(this,t)}catch(i){return r(i)}(0,n.default)(a)&&"function"===typeof a.then?a.then((function(e){u(r,null,e)}),(function(e){u(r,e.message?e:new Error(e))})):r(null,a)}))}function u(e,t,r){try{e(t,r)}catch(a){(0,o.default)(b,a)}}function b(e){throw e}e.exports=t["default"]},91718:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=s;var a=r(95906),n=d(a),i=r(22988),c=d(i),f=r(67279),o=d(f);function d(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r,a){(0,n.default)(t)(e,(0,c.default)((0,o.default)(r)),a)}e.exports=t["default"]},63068:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t,r){var a=(0,n.default)(e)?y:w;a(e,(0,v.default)(t),r)};var a=r(45372),n=g(a),i=r(32294),c=g(i),f=r(60336),o=g(f),d=r(18855),s=g(d),u=r(98869),b=g(u),h=r(4934),l=g(h),p=r(55621),x=g(p),m=r(67279),v=g(m);function g(e){return e&&e.__esModule?e:{default:e}}function y(e,t,r){r=(0,l.default)(r||b.default);var a=0,n=0,i=e.length;function f(e,t){e?r(e):++n!==i&&t!==c.default||r(null)}for(0===i&&r(null);a2&&(n=(0,o.default)(arguments,1)),a[t]=n,r(e)}))}),(function(e){r(e,a)}))}e.exports=t["default"]},28498:function(e,t,r){"use strict";var a=r(96027);r(84633),Object.defineProperty(t,"__esModule",{value:!0}),t.hasNextTick=t.hasSetImmediate=void 0,t.fallback=s,t.wrap=u;var n=r(14195),i=c(n);function c(e){return e&&e.__esModule?e:{default:e}}var f,o=t.hasSetImmediate="function"===typeof setImmediate&&setImmediate,d=t.hasNextTick="object"===typeof a&&"function"===typeof a.nextTick;function s(e){setTimeout(e,0)}function u(e){return function(t){var r=(0,i.default)(arguments,1);e((function(){t.apply(null,r)}))}}f=o?setImmediate:d?a.nextTick:s,t["default"]=u(f)},14195:function(e,t){"use strict";function r(e,t){t|=0;for(var r=Math.max(e.length-t,0),a=Array(r),n=0;n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){b.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){b.headers[e]=n.merge(o)})),e.exports=b},58507:function(e){"use strict";e.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},4679:function(e){e.exports={version:"0.26.1"}},15955:function(e){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),a=0;a=0)return;c[t]="set-cookie"===t?(c[t]?c[t]:[]).concat([r]):c[t]?c[t]+", "+r:r}})),c):c}},45431:function(e){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},46298:function(e,t,r){"use strict";r(21703);var a=r(4679).version,n={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){n[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={};function c(e,t,r){if("object"!==typeof e)throw new TypeError("options must be an object");var a=Object.keys(e),n=a.length;while(n-- >0){var i=a[n],c=t[i];if(c){var f=e[i],o=void 0===f||c(f,i,e);if(!0!==o)throw new TypeError("option "+i+" must be "+o)}else if(!0!==r)throw Error("Unknown option "+i)}}n.transitional=function(e,t,r){function n(e,t){return"[Axios v"+a+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,a,c){if(!1===e)throw new Error(n(a," has been removed"+(t?" in "+t:"")));return t&&!i[a]&&(i[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,a,c)}},e.exports={assertOptions:c,validators:n}},26642:function(e,t,r){"use strict";var a=r(15955),n=Object.prototype.toString;function i(e){return Array.isArray(e)}function c(e){return"undefined"===typeof e}function f(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function o(e){return"[object ArrayBuffer]"===n.call(e)}function d(e){return"[object FormData]"===n.call(e)}function s(e){var t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&o(e.buffer),t}function u(e){return"string"===typeof e}function b(e){return"number"===typeof e}function h(e){return null!==e&&"object"===typeof e}function l(e){if("[object Object]"!==n.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function p(e){return"[object Date]"===n.call(e)}function x(e){return"[object File]"===n.call(e)}function m(e){return"[object Blob]"===n.call(e)}function v(e){return"[object Function]"===n.call(e)}function g(e){return h(e)&&v(e.pipe)}function y(e){return"[object URLSearchParams]"===n.call(e)}function w(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function M(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function _(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),i(e))for(var r=0,a=e.length;r=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r>>0,u=new Uint8Array(d);while(i!==c){for(var b=t[i],h=0,l=d-1;(0!==b||h>>0,u[l]=b%f>>>0,b=b/f>>>0;if(0!==b)throw new Error("Non-zero carry");n=h,i++}var p=d-n;while(p!==d&&0===u[p])p++;for(var x=o.repeat(r);p>>0,s=new Uint8Array(c);while(e[r]){var u=t[e.charCodeAt(r)];if(255===u)return;for(var b=0,h=c-1;(0!==u||b>>0,s[h]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=b,r++}var l=c-i;while(l!==c&&0===s[l])l++;var p=a.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=b(e);if(t)return t;throw new Error("Non-base"+f+" character")}return{encode:u,decodeUnsafe:b,decode:h}}e.exports=n},61271:function(e,t,r){"use strict";r(48675),r(3462),r(21703),t.byteLength=s,t.toByteArray=b,t.fromByteArray=p;for(var a=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,o=c.length;f0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var a=r===t?0:4-r%4;return[r,a]}function s(e){var t=d(e),r=t[0],a=t[1];return 3*(r+a)/4-a}function u(e,t,r){return 3*(t+r)/4-r}function b(e){var t,r,a=d(e),c=a[0],f=a[1],o=new i(u(e,c,f)),s=0,b=f>0?c-4:c;for(r=0;r>16&255,o[s++]=t>>8&255,o[s++]=255&t;return 2===f&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,o[s++]=255&t),1===f&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,o[s++]=t>>8&255,o[s++]=255&t),o}function h(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}function l(e,t,r){for(var a,n=[],i=t;io?o:f+c));return 1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"=")),i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2396:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c=r(46601).Buffer}catch(S){}function f(e,t,r){for(var a=0,n=Math.min(e.length,r),i=t;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return a}function o(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){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):(a(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(a("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"===r)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 r=0;r=t;r-=6)n=f(e,r,r+6),this.words[a]|=n<>>26-i&4194303,i+=24,i>=26&&(i-=26,a++);r+6!==t&&(n=f(e,t,r+6),this.words[a]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,d=0,s=r;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 d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],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 b(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function h(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?d[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],h=u[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:d[b-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function p(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function x(e,t,r){var a=new m;return a.mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?l(this,e,t):a<63?h(this,e,t):a<1024?p(this,e,t):x(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},m.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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=b(e);if(0===t.length)return new i(1);for(var r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 g(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(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.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 a(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 v[e]=t,t},k.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){var a;function n(e){this.rand=e}if(r(48675),r(3462),r(21703),e.exports=function(e){return a||(a=new n(null)),a.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),r=0;r>>24]^s[l>>>16&255]^u[p>>>8&255]^b[255&x]^t[m++],c=d[l>>>24]^s[p>>>16&255]^u[x>>>8&255]^b[255&h]^t[m++],f=d[p>>>24]^s[x>>>16&255]^u[h>>>8&255]^b[255&l]^t[m++],o=d[x>>>24]^s[h>>>16&255]^u[l>>>8&255]^b[255&p]^t[m++],h=i,l=c,p=f,x=o;return i=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[p>>>8&255]<<8|a[255&x])^t[m++],c=(a[l>>>24]<<24|a[p>>>16&255]<<16|a[x>>>8&255]<<8|a[255&h])^t[m++],f=(a[p>>>24]<<24|a[x>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^t[m++],o=(a[x>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&p])^t[m++],i>>>=0,c>>>=0,f>>>=0,o>>>=0,[i,c,f,o]}var f=[0,1,2,4,8,16,32,64,128,27,54],o=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],a=[],n=[[],[],[],[]],i=[[],[],[],[]],c=0,f=0,o=0;o<256;++o){var d=f^f<<1^f<<2^f<<3^f<<4;d=d>>>8^255&d^99,r[c]=d,a[d]=c;var s=e[c],u=e[s],b=e[u],h=257*e[d]^16843008*d;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*b^65537*u^257*s^16843008*c,i[0][d]=h<<24|h>>>8,i[1][d]=h<<16|h>>>16,i[2][d]=h<<8|h>>>24,i[3][d]=h,0===c?c=f=1:(c=s^e[e[e[b^s]]],f^=e[e[f]])}return{SBOX:r,INV_SBOX:a,SUB_MIX:n,INV_SUB_MIX:i}}();function d(e){this._key=n(e),this._reset()}d.blockSize=16,d.keySize=32,d.prototype.blockSize=d.blockSize,d.prototype.keySize=d.keySize,d.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,a=4*(r+1),n=[],i=0;i>>24,c=o.SBOX[c>>>24]<<24|o.SBOX[c>>>16&255]<<16|o.SBOX[c>>>8&255]<<8|o.SBOX[255&c],c^=f[i/t|0]<<24):t>6&&i%t===4&&(c=o.SBOX[c>>>24]<<24|o.SBOX[c>>>16&255]<<16|o.SBOX[c>>>8&255]<<8|o.SBOX[255&c]),n[i]=n[i-t]^c}for(var d=[],s=0;s>>24]]^o.INV_SUB_MIX[1][o.SBOX[b>>>16&255]]^o.INV_SUB_MIX[2][o.SBOX[b>>>8&255]]^o.INV_SUB_MIX[3][o.SBOX[255&b]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=d},d.prototype.encryptBlockRaw=function(e){return e=n(e),c(e,this._keySchedule,o.SUB_MIX,o.SBOX,this._nRounds)},d.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=a.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},d.prototype.decryptBlock=function(e){e=n(e);var t=e[1];e[1]=e[3],e[3]=t;var r=c(e,this._invKeySchedule,o.INV_SUB_MIX,o.INV_SBOX,this._nRounds),i=a.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},d.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},e.exports.AES=d},89043:function(e,t,r){r(21703);var a=r(88970),n=r(6779).Buffer,i=r(11414),c=r(81923),f=r(92789),o=r(96662),d=r(40306);function s(e,t){var r=0;e.length!==t.length&&r++;for(var a=Math.min(e.length,t.length),n=0;n16)throw new Error("unable to decrypt data");var r=-1;while(++r16)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},b.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=p,t.createDecipheriv=l},74213:function(e,t,r){r(21703);var a=r(65612),n=r(89043),i=r(6779).Buffer,c=r(25248),f=r(11414),o=r(88970),d=r(13692),s=r(81923);function u(e,t,r){f.call(this),this._cache=new h,this._cipher=new o.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}s(u,f),u.prototype._update=function(e){var t,r;this._cache.add(e);var a=[];while(t=this._cache.get())r=this._mode.encrypt(this,t),a.push(r);return i.concat(a)};var b=i.alloc(16,16);function h(){this.cache=i.allocUnsafe(0)}function l(e,t,r){var f=a[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 r&&(r=i.from(r)),"GCM"!==f.mode&&r.length!==f.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===f.type?new c(f.module,t,r):"auth"===f.type?new n(f.module,t,r):new u(f.module,t,r)}function p(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=d(t,!1,r.key,r.iv);return l(e,n.key,n.iv)}u.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(b))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.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),r=-1;while(++r>>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=a.alloc(16,0),this.cache=a.allocUnsafe(0)}f.prototype.ghash=function(e){var t=-1;while(++t0;e--)a[e]=a[e]>>>1|(1&a[e-1])<<31;a[0]=a[0]>>>1,r&&(a[0]=a[0]^225<<24)}this.state=c(n)},f.prototype.update=function(e){var t;this.cache=a.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(a.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,r=e.length;while(r--){if(t=e.readUInt8(r),255!==t){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}e.exports=t},66151:function(e,t,r){var a=r(96662);t.encrypt=function(e,t){var r=a(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var n=e._cipher.decryptBlock(t);return a(n,r)}},36557:function(e,t,r){var a=r(6779).Buffer,n=r(96662);function i(e,t,r){var i=t.length,c=n(t,e._cache);return e._cache=e._cache.slice(i),e._prev=a.concat([e._prev,r?t:c]),c}t.encrypt=function(e,t,r){var n,c=a.allocUnsafe(0);while(t.length){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=a.allocUnsafe(0)),!(e._cache.length<=t.length)){c=a.concat([c,i(e,t,r)]);break}n=e._cache.length,c=a.concat([c,i(e,t.slice(0,n),r)]),t=t.slice(n)}return c}},12610:function(e,t,r){var a=r(6779).Buffer;function n(e,t,r){var a,n,c,f=-1,o=8,d=0;while(++f>f%8,e._prev=i(e._prev,r?n:c);return d}function i(e,t){var r=e.length,n=-1,i=a.allocUnsafe(e.length);e=a.concat([e,a.from([t])]);while(++n>7;return i}t.encrypt=function(e,t,r){var i=t.length,c=a.allocUnsafe(i),f=-1;while(++f=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function o(e,t){var r=c(t),i=t.modulus.byteLength(),f=new n(e).mul(r.blinder).umod(t.modulus),o=f.toRed(n.mont(t.prime1)),d=f.toRed(n.mont(t.prime2)),s=t.coefficient,u=t.prime1,b=t.prime2,h=o.redPow(t.exponent1).fromRed(),l=d.redPow(t.exponent2).fromRed(),p=h.isub(l).imul(s).umod(u).imul(b);return l.iadd(p).imul(r.unblinder).umod(t.modulus).toArrayLike(a,"be",i)}o.getr=f,e.exports=o},58509:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(71922).Buffer}catch(I){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){e.exports=r(75207)},68130:function(e,t,r){r(21703);var a=r(29882).Buffer,n=r(65443),i=r(98141),c=r(81923),f=r(36528),o=r(72170),d=r(75207);function s(e){i.Writable.call(this);var t=d[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 u(e){i.Writable.call(this);var t=d[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash),this._tag=t.id,this._signType=t.sign}function b(e){return new s(e)}function h(e){return new u(e)}Object.keys(d).forEach((function(e){d[e].id=a.from(d[e].id,"hex"),d[e.toLowerCase()]=d[e]})),c(s,i.Writable),s.prototype._write=function(e,t,r){this._hash.update(e),r()},s.prototype.update=function(e,t){return"string"===typeof e&&(e=a.from(e,t)),this._hash.update(e),this},s.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),a=f(r,e,this._hashType,this._signType,this._tag);return t?a.toString(t):a},c(u,i.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return"string"===typeof e&&(e=a.from(e,t)),this._hash.update(e),this},u.prototype.verify=function(e,t,r){"string"===typeof t&&(t=a.from(t,r)),this.end();var n=this._hash.digest();return o(t,n,e,this._signType,this._tag)},e.exports={Sign:b,Verify:h,createSign:b,createVerify:h}},36528:function(e,t,r){r(21703);var a=r(29882).Buffer,n=r(54868),i=r(28593),c=r(32127).ec,f=r(79194),o=r(2616),d=r(1308);function s(e,t,r,n,c){var f=o(t);if(f.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return u(e,f)}if("dsa"===f.type){if("dsa"!==n)throw new Error("wrong private key type");return b(e,f,r)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");e=a.concat([c,e]);var d=f.modulus.byteLength(),s=[0,1];while(e.length+s.length+10&&r.ishrn(a),r}function x(e,t){e=p(e,t),e=e.mod(t);var r=a.from(e.toArray());if(r.length=t)throw new Error("invalid sig")}e.exports=o},79194:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(2363).Buffer}catch(I){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){r(21703); /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var a=r(15361),n=a.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function c(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=a:(i(a,t),t.Buffer=c),c.prototype=Object.create(n.prototype),i(n,c),c.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},c.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var a=n(e);return void 0!==t?"string"===typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},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 a.SlowBuffer(e)}},96662:function(e,t,r){var a=r(15361)["Buffer"];e.exports=function(e,t){for(var r=Math.min(e.length,t.length),n=new a(r),i=0;i * @license MIT */r(48675),r(3462),r(21703);var a=r(61271),n=r(27055),i="function"===typeof Symbol&&"function"===typeof Symbol["for"]?Symbol["for"]("nodejs.util.inspect.custom"):null;t.Buffer=d,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(r){return!1}}function o(e){if(e>c)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){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,r)}function s(e,t,r){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,r);if("undefined"!==typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return d.from(a,t,r);var n=v(e);if(n)return n;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(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 b(e,t,r){return u(e),e<=0?o(e):void 0!==t?"string"===typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}function h(e){return u(e),o(e<0?0:0|g(e))}function l(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),a=o(r),n=a.write(e,t);return n!==r&&(a=a.slice(0,n)),a}function p(e){for(var t=e.length<0?0:0|g(e.length),r=o(t),a=0;a=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),d.alloc(+e)}function w(e,t){if(d.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 r=e.length,a=arguments.length>2&&!0===arguments[2];if(!a&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(n)return a?-1:G(e).length;t=(""+t).toLowerCase(),n=!0}}function M(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return U(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return N(this,t,r);case"latin1":case"binary":return L(this,t,r);case"base64":return B(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function _(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function k(e,t,r,a,n){if(0===e.length)return-1;if("string"===typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,X(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"===typeof t&&(t=d.from(t,a)),d.isBuffer(t))return 0===t.length?-1:A(e,t,r,a,n);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):A(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function A(e,t,r,a,n){var i,c=1,f=e.length,o=t.length;if(void 0!==a&&(a=String(a).toLowerCase(),"ucs2"===a||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;c=2,f/=2,o/=2,r/=2}function d(e,t){return 1===c?e[t]:e.readUInt16BE(t*c)}if(n){var s=-1;for(i=r;if&&(r=f-o),i=r;i>=0;i--){for(var u=!0,b=0;bn&&(a=n)):a=n;var i=t.length;a>i/2&&(a=i/2);for(var c=0;c239?4:d>223?3:d>191?2:1;if(n+u<=r)switch(u){case 1:d<128&&(s=d);break;case 2:i=e[n+1],128===(192&i)&&(o=(31&d)<<6|63&i,o>127&&(s=o));break;case 3:i=e[n+1],c=e[n+2],128===(192&i)&&128===(192&c)&&(o=(15&d)<<12|(63&i)<<6|63&c,o>2047&&(o<55296||o>57343)&&(s=o));break;case 4:i=e[n+1],c=e[n+2],f=e[n+3],128===(192&i)&&128===(192&c)&&128===(192&f)&&(o=(15&d)<<18|(63&i)<<12|(63&c)<<6|63&f,o>65535&&o<1114112&&(s=o))}null===s?(s=65533,u=1):s>65535&&(s-=65536,a.push(s>>>10&1023|55296),s=56320|1023&s),a.push(s),n+=u}return R(a)}t.kMaxLength=c,d.TYPED_ARRAY_SUPPORT=f(),d.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(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(e,t,r){return b(e,t,r)},d.allocUnsafe=function(e){return h(e)},d.allocUnsafeSlow=function(e){return h(e)},d.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==d.prototype},d.compare=function(e,t){if(Y(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);na.length?d.from(i).copy(a,n):Uint8Array.prototype.set.call(a,i,n);else{if(!d.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(a,n)}n+=i.length}return a},d.byteLength=w,d.prototype._isBuffer=!0,d.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;tr&&(e+=" ... "),""},i&&(d.prototype[i]=d.prototype.inspect),d.prototype.compare=function(e,t,r,a,n){if(Y(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.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===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,n>>>=0,this===e)return 0;for(var i=n-a,c=r-t,f=Math.min(i,c),o=this.slice(a,n),s=e.slice(t,r),u=0;u>>=0,isFinite(r)?(r>>>=0,void 0===a&&(a="utf8")):(a=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function R(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var r="",a=0;while(aa)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,a,n,i){if(!d.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 H(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(e,t,r,a,i){return t=+t,r>>>=0,i||H(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,a,23,4),r+4}function z(e,t,r,a,i){return t=+t,r>>>=0,i||H(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,a,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length;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>>=0,t>>>=0,r||F(e,t,this.length);var a=this[e],n=1,i=0;while(++i>>=0,t>>>=0,r||F(e,t,this.length);var a=this[e+--t],n=1;while(t>0&&(n*=256))a+=this[e+--t]*n;return a},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);var a=this[e],n=1,i=0;while(++i=n&&(a-=Math.pow(2,8*t)),a},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);var a=t,n=1,i=this[e+--a];while(a>0&&(n*=256))i+=this[e+--a]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},d.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),n.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),n.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),n.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),n.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var n=Math.pow(2,8*r)-1;D(this,e,t,r,n,0)}var i=1,c=0;this[t]=255&e;while(++c>>=0,r>>>=0,!a){var n=Math.pow(2,8*r)-1;D(this,e,t,r,n,0)}var i=r-1,c=1;this[t+i]=255&e;while(--i>=0&&(c*=256))this[t+i]=e/c&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(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},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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},d.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}var i=0,c=1,f=0;this[t]=255&e;while(++i>0)-f&255;return t+r},d.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}var i=r-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+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(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},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(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},d.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return z(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return z(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,a){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(c+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(e){for(var t=[],r=0;r>8,n=r%256,i.push(n),i.push(a)}return i}function $(e){return a.toByteArray(W(e))}function J(e,t,r,a){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=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 X(e){return e!==e}var Q=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var a=16*r,n=0;n<16;++n)t[a+n]=e[r]+e[n];return t}()},15477:function(e,t,r){"use strict";var a=r(8692),n=r(81542),i=n(a("String.prototype.indexOf"));e.exports=function(e,t){var r=a(e,!!t);return"function"===typeof r&&i(e,".prototype.")>-1?n(r):r}},81542:function(e,t,r){"use strict";var a=r(49148),n=r(8692),i=n("%Function.prototype.apply%"),c=n("%Function.prototype.call%"),f=n("%Reflect.apply%",!0)||a.call(c,i),o=n("%Object.getOwnPropertyDescriptor%",!0),d=n("%Object.defineProperty%",!0),s=n("%Math.max%");if(d)try{d({},"a",{value:1})}catch(b){d=null}e.exports=function(e){var t=f(a,c,arguments);if(o&&d){var r=o(t,"length");r.configurable&&d(t,"length",{value:1+s(0,e.length-(arguments.length-1))})}return t};var u=function(){return f(a,i,arguments)};d?d(e.exports,"apply",{value:u}):e.exports.apply=u},68754:function(e,t,r){"use strict";const a=r(83630),n={};for(const[i,c]of Object.entries(a))n[i.toUpperCase().replace(/-/g,"_")]=c;e.exports=Object.freeze(n)},68018:function(e,t,r){"use strict";r(21703);const{Buffer:a}=r(15361),n=r(42611),i=r(48681),c=r(63459),f=r(94718);t=e.exports,t.addPrefix=(e,t)=>{let r;if(a.isBuffer(e))r=f.varintBufferEncode(e);else{if(!c[e])throw new Error("multicodec not recognized");r=c[e]}return a.concat([r,t])},t.rmPrefix=e=>(n.decode(e),e.slice(n.decode.bytes)),t.getCodec=e=>{const t=n.decode(e),r=i.get(t);if(void 0===r)throw new Error(`Code ${t} not found`);return r},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 o=r(68754);Object.assign(t,o),t.print=r(86347)},48681:function(e,t,r){"use strict";const a=r(83630),n=new Map;for(const i in a){const e=a[i];n.set(e,i)}e.exports=Object.freeze(n)},86347:function(e,t,r){"use strict";const a=r(83630),n={};for(const[i,c]of Object.entries(a))void 0===n[c]&&(n[c]=i);e.exports=Object.freeze(n)},94718:function(e,t,r){"use strict";const a=r(42611),{Buffer:n}=r(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(a.encode(i(e)))}function o(e){return c(a.decode(e))}function d(e){return n.from(a.encode(e))}e.exports={numberToBuffer:c,bufferToNumber:i,varintBufferEncode:f,varintBufferDecode:o,varintEncode:d}},63459:function(e,t,r){"use strict";const a=r(83630),n=r(94718).varintEncode,i={};for(const c in a){const e=a[c];i[c]=n(e)}e.exports=Object.freeze(i)},8702:function(e,t,r){"use strict";const a=r(21272),{Buffer:n}=r(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{a.validate(e.multihash)}catch(t){let e=t.message;return e||(e="Multihash validation failed"),e}}};e.exports=i},4821:function(e,t,r){"use strict";r(21703);const{Buffer:a}=r(15361),n=r(21272),i=r(64869),c=r(68018),f=r(83630),o=r(8702),d=r(67151);class s{constructor(e,t,r,f){if(u.isCID(e)){const t=e;return this.version=t.version,this.codec=t.codec,this.multihash=a.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 r=i.decode(e);this.version=parseInt(r.slice(0,1).toString("hex"),16),this.codec=c.getCodec(r.slice(1)),this.multihash=c.rmPrefix(r.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(a.isBuffer(e)){const t=e.slice(0,1),r=parseInt(t.toString("hex"),16);if(1===r){const t=e;this.version=r,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=r,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=a.concat([a.from("01","hex"),c.getCodeVarint(this.codec),this.multihash])}Object.defineProperty(this,"_buffer",{value:e})}return e}get prefix(){return a.concat([a.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 u(0,this.codec,this.multihash)}toV1(){return new u(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=o.checkCIDComponents(e);if(t)throw new Error(t)}}const u=d(s,{className:"CID",symbolName:"@ipld/js-cid/CID"});u.codecs=f,e.exports=u},11414:function(e,t,r){r(21703);var a=r(6779).Buffer,n=r(22263).Transform,i=r(25605).s,c=r(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,r){"string"===typeof e&&(e=a.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),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,r){var a;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(n){a=n}finally{r(a)}},f.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(r){t=r}e(t)},f.prototype._finalOrDigest=function(e){var t=this.__final()||a.alloc(0);return e&&(t=this._toString(t,e,!0)),t},f.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new i(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var a=this._decoder.write(e);return r&&(a+=this._decoder.end()),a},e.exports=f},67151:function(e){"use strict";function t(e,{className:t,symbolName:r}){const a=Symbol.for(r),n={[t]:class extends e{constructor(...e){super(...e),Object.defineProperty(this,a,{value:!0})}get[Symbol.toStringTag](){return t}}}[t];return n[`is${t}`]=e=>!(!e||!e[a]),n}function r(e,{className:t,symbolName:r,withoutNew:a}){const n=Symbol.for(r),i={[t]:function(...t){if(a&&!(this instanceof i))return new i(...t);const r=e.call(this,...t)||this;return r&&!r[n]&&Object.defineProperty(r,n,{value:!0}),r}}[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=r},79120:function(e){var t=function(){window.cancelAnimationFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){return window.clearTimeout(e)}}(),window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)}}()};e.exports=t},3506:function(e){var t=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(var r=0;r{let t=new a(e);return 0===t.version&&(t=t.toV1()),t.toString("base32")};t.cidV0ToV1Base32=n},72624:function(e,t,r){const a=r(58429),{hexStringToBuffer:n,profiles:i}=r(11970),{cidV0ToV1Base32:c}=r(45201);e.exports={helpers:{cidV0ToV1Base32:c},decode:function(e){const t=n(e),r=a.getCodec(t),c=a.rmPrefix(t);let f=i[r];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 r=i[e];r||(r=i["default"]);const n=r.encode(t);return a.addPrefix(e,n).toString("hex")},getCodec:function(e){let t=n(e);return a.getCodec(t)}}},11970:function(e,t,r){var a=r(15361)["Buffer"];const n=r(4821),i=r(21272),c=e=>{let t=e.slice(0,2),r=e.slice(2),a="";return a="0x"===t?r:e,i.fromHexString(a)},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=>a.from(e,"utf8")},o={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")},d={"swarm-ns":{encode:f.swarm,decode:o.hexMultiHash},"ipfs-ns":{encode:f.ipfs,decode:o.b58MultiHash},"ipns-ns":{encode:f.ipfs,decode:o.b58MultiHash},default:{encode:f.utf8,decode:o.utf8}};t.hexStringToBuffer=c,t.profiles=d},15292:function(e,t){(function(){"use strict";function e(t,r,a,n){return this instanceof e?(this.domain=t||void 0,this.path=r||"/",this.secure=!!a,this.script=!!n,this):new e(t,r,a,n)}function r(e,t,a){return e instanceof r?e:this instanceof r?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(a||"/"),this.explicit_path=!1,this.domain=t||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,t,a),this):new r(e,t,a)}e.All=Object.freeze(Object.create(null)),t.CookieAccessInfo=e,t.Cookie=r,r.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("; ")},r.prototype.toValueString=function(){return this.name+"="+this.value};var a=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function n(){var e,t,a;return this instanceof n?(e=Object.create(null),this.setCookie=function(n,i,c){var f,o;if(n=new r(n,i,c),f=n.expiration_date<=Date.now(),void 0!==e[n.name]){for(t=e[n.name],o=0;o>>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[r]=e;return"undefined"!==typeof Int32Array?new Int32Array(t):t}e.version="1.2.1";var r=t();function a(e){var t=0,r=0,a=0,n="undefined"!==typeof Int32Array?new Int32Array(4096):new Array(4096);for(a=0;256!=a;++a)n[a]=e[a];for(a=0;256!=a;++a)for(r=e[a],t=256+a;t<4096;t+=256)r=n[t]=r>>>8^e[255&r];var i=[];for(a=1;16!=a;++a)i[a-1]="undefined"!==typeof Int32Array?n.subarray(256*a,256*a+256):n.slice(256*a,256*a+256);return i}var n=a(r),i=n[0],c=n[1],f=n[2],o=n[3],d=n[4],s=n[5],u=n[6],b=n[7],h=n[8],l=n[9],p=n[10],x=n[11],m=n[12],v=n[13],g=n[14];function y(e,t){for(var a=-1^t,n=0,i=e.length;n>>8^r[255&(a^e.charCodeAt(n++))];return~a}function w(e,t){for(var a=-1^t,n=e.length-15,y=0;y>8&255]^m[e[y++]^a>>16&255]^x[e[y++]^a>>>24]^p[e[y++]]^l[e[y++]]^h[e[y++]]^b[e[y++]]^u[e[y++]]^s[e[y++]]^d[e[y++]]^o[e[y++]]^f[e[y++]]^c[e[y++]]^i[e[y++]]^r[e[y++]];n+=15;while(y>>8^r[255&(a^e[y++])];return~a}function M(e,t){for(var a=-1^t,n=0,i=e.length,c=0,f=0;n>>8^r[255&(a^c)]:c<2048?(a=a>>>8^r[255&(a^(192|c>>6&31))],a=a>>>8^r[255&(a^(128|63&c))]):c>=55296&&c<57344?(c=64+(1023&c),f=1023&e.charCodeAt(n++),a=a>>>8^r[255&(a^(240|c>>8&7))],a=a>>>8^r[255&(a^(128|c>>2&63))],a=a>>>8^r[255&(a^(128|f>>6&15|(3&c)<<4))],a=a>>>8^r[255&(a^(128|63&f))]):(a=a>>>8^r[255&(a^(224|c>>12&15))],a=a>>>8^r[255&(a^(128|c>>6&63))],a=a>>>8^r[255&(a^(128|63&c))]);return~a}e.table=r,e.bstr=y,e.buf=w,e.str=M}))},49907:function(e,t,r){var a=r(15361)["Buffer"],n=r(32127),i=r(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 o(e,t,r){Array.isArray(e)||(e=e.toArray());var n=new a(e);if(r&&n.lengthr){var a="rmd160"===e?new o:d(e);t=a.update(t).digest()}else t.lengthf?t=e(t):t.length0;a--)t+=this._buffer(e,t),r+=this._flushBuffer(n,r);return t+=this._buffer(e,t),n},n.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},n.prototype._pad=function(e,t){if(0===t)return!1;while(t>>1];r=i.r28shl(r,f),n=i.r28shl(n,f),i.pc2(r,n,e.keys,c)}},o.prototype._update=function(e,t,r,a){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(r,c,a),i.writeUInt32BE(r,f,a+4)},o.prototype._pad=function(e,t){for(var r=e.length-t,a=t;a>>0,c=h}i.rip(f,c,a,n)},o.prototype._decrypt=function(e,t,r,a,n){for(var c=r,f=t,o=e.keys.length-2;o>=0;o-=2){var d=e.keys[o],s=e.keys[o+1];i.expand(c,e.tmp,0),d^=e.tmp[0],s^=e.tmp[1];var u=i.substitute(d,s),b=i.permute(u),h=c;c=(f^b)>>>0,f=h}i.rip(c,f,a,n)}},33040:function(e,t,r){"use strict";var a=r(14961),n=r(81923),i=r(76224),c=r(27853);function f(e,t){a.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),n=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[c.create({type:"encrypt",key:r}),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:r})]}function o(e){i.call(this,e);var t=new f(this.type,this.options.key);this._edeState=t}n(o,i),e.exports=o,o.create=function(e){return new o(e)},o.prototype._update=function(e,t,r,a){var n=this._edeState;n.ciphers[0]._update(e,t,r,a),n.ciphers[1]._update(r,a,r,a),n.ciphers[2]._update(r,a,r,a)},o.prototype._pad=c.prototype._pad,o.prototype._unpad=c.prototype._unpad},99379:function(e,t){"use strict";t.readUInt32BE=function(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,a){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}r[a+0]=n>>>0,r[a+1]=i>>>0},t.rip=function(e,t,r,a){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;r[a+0]=n>>>0,r[a+1]=i>>>0},t.pc1=function(e,t,r,a){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;r[a+0]=n>>>0,r[a+1]=i>>>0},t.r28shl=function(e,t){return e<>>28-t};var r=[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,a,n){for(var i=0,c=0,f=r.length>>>1,o=0;o>>r[o]&1;for(o=f;o>>r[o]&1;a[n+0]=i>>>0,a[n+1]=c>>>0},t.expand=function(e,t,r){var a=0,n=0;a=(1&e)<<5|e>>>27;for(var i=23;i>=15;i-=4)a<<=6,a|=e>>>i&63;for(i=11;i>=3;i-=4)n|=e>>>i&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=a>>>0,t[r+1]=n>>>0};var a=[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 r=0,n=0;n<4;n++){var i=e>>>18-6*n&63,c=a[64*n+i];r<<=4,r|=c}for(n=0;n<4;n++){i=t>>>18-6*n&63,c=a[256+64*n+i];r<<=4,r|=c}return r>>>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,r=0;r>>n[r]&1;return t>>>0},t.padSplit=function(e,t,r){var a=e.toString(2);while(a.lengthe)r.ishrn(1);if(r.isEven()&&r.iadd(o),r.testn(1)||r.iadd(d),t.cmp(d)){if(!t.cmp(s))while(r.mod(u).cmp(b))r.iadd(l)}else while(r.mod(i).cmp(h))r.iadd(l);if(c=r.shrn(1),m(c)&&m(r)&&v(c)&&v(r)&&f.test(c)&&f.test(r))return r}}},98716:function(e,t,r){"use strict";r(21703);var a={single_source_shortest_paths:function(e,t,r){var n={},i={};i[t]=0;var c,f,o,d,s,u,b,h,l,p=a.PriorityQueue.make();p.push(t,0);while(!p.empty())for(o in c=p.pop(),f=c.value,d=c.cost,s=e[f]||{},s)s.hasOwnProperty(o)&&(u=s[o],b=d+u,h=i[o],l="undefined"===typeof i[o],(l||h>b)&&(i[o]=b,p.push(o,b),n[o]=f));if("undefined"!==typeof r&&"undefined"===typeof i[r]){var x=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(x)}return n},extract_shortest_path_from_predecessor_list:function(e,t){var r=[],a=t;while(a)r.push(a),e[a],a=e[a];return r.reverse(),r},find_path:function(e,t,r){var n=a.single_source_shortest_paths(e,t,r);return a.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=a.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=a},32127:function(e,t,r){"use strict";var a=t;a.version=r(18597).i8,a.utils=r(87913),a.rand=r(31482),a.curve=r(11626),a.curves=r(69474),a.ec=r(98082),a.eddsa=r(39322)},57661:function(e,t,r){"use strict";r(21703);var a=r(21646),n=r(87913),i=n.getNAF,c=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new a(t.p,16),this.red=t.prime?a.red(t.prime):a.mont(this.p),this.zero=new a(0).toRed(this.red),this.one=new a(1).toRed(this.red),this.two=new a(2).toRed(this.red),this.n=t.n&&new a(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function d(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=o,o.prototype.point=function(){throw new Error("Not implemented")},o.prototype.validate=function(){throw new Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){f(e.precomputed);var r=e._getDoubles(),a=i(t,1,this._bitLength),n=(1<=c;s--)o=(o<<1)+a[s];d.push(o)}for(var u=this.jpoint(null,null,null),b=this.jpoint(null,null,null),h=n;h>0;h--){for(c=0;c=0;d--){for(var s=0;d>=0&&0===c[d];d--)s++;if(d>=0&&s++,o=o.dblp(s),d<0)break;var u=c[d];f(0!==u),o="affine"===e.type?u>0?o.mixedAdd(n[u-1>>1]):o.mixedAdd(n[-u-1>>1].neg()):u>0?o.add(n[u-1>>1]):o.add(n[-u-1>>1].neg())}return"affine"===e.type?o.toP():o},o.prototype._wnafMulAdd=function(e,t,r,a,n){var f,o,d,s=this._wnafT1,u=this._wnafT2,b=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 v=[-3,-1,-5,-7,0,7,5,1,3],g=c(r[p],r[x]);for(h=Math.max(g[0].length,h),b[p]=new Array(h),b[x]=new Array(h),o=0;o=0;f--){var k=0;while(f>=0){var A=!0;for(o=0;o=0&&k++,M=M.dblp(k),f<0)break;for(o=0;o0?d=u[o][S-1>>1]:S<0&&(d=u[o][-S-1>>1].neg()),M="affine"===d.type?M.mixedAdd(d):M.add(d))}}for(f=0;f=Math.ceil((e.bitLength()+1)/t.step)},d.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],a=this,n=0;n":""},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var a=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=a.redAdd(t),c=i.redSub(r),f=a.redSub(t),o=n.redMul(c),d=i.redMul(f),s=n.redMul(f),u=c.redMul(i);return this.curve.point(o,d,u,s)},d.prototype._projDbl=function(){var e,t,r,a,n,i,c=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){a=this.curve._mulA(f);var d=a.redAdd(o);this.zOne?(e=c.redSub(f).redSub(o).redMul(d.redSub(this.curve.two)),t=d.redMul(a.redSub(o)),r=d.redSqr().redSub(d).redSub(d)):(n=this.z.redSqr(),i=d.redSub(n).redISub(n),e=c.redSub(f).redISub(o).redMul(i),t=d.redMul(a.redSub(o)),r=d.redMul(i))}else a=f.redAdd(o),n=this.curve._mulC(this.z).redSqr(),i=a.redSub(n).redSub(n),e=this.curve._mulC(c.redISub(a)).redMul(i),t=this.curve._mulC(a).redMul(f.redISub(o)),r=a.redMul(i);return this.curve.point(e,t,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),a=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),c=n.redSub(a),f=n.redAdd(a),o=r.redAdd(t),d=i.redMul(c),s=f.redMul(o),u=i.redMul(o),b=c.redMul(f);return this.curve.point(d,s,b,u)},d.prototype._projAdd=function(e){var t,r,a=this.z.redMul(e.z),n=a.redSqr(),i=this.x.redMul(e.x),c=this.y.redMul(e.y),f=this.curve.d.redMul(i).redMul(c),o=n.redSub(f),d=n.redAdd(f),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(c),u=a.redMul(o).redMul(s);return this.curve.twisted?(t=a.redMul(d).redMul(c.redSub(this.curve._mulA(i))),r=o.redMul(d)):(t=a.redMul(d).redMul(c.redSub(i)),r=this.curve._mulC(o).redMul(d)),this.curve.point(u,t,r)},d.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},d.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},d.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},d.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},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},d.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),a=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(a),0===this.x.cmp(t))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},11626:function(e,t,r){"use strict";var a=t;a.base=r(57661),a.short=r(78441),a.mont=r(96433),a.edwards=r(51727)},96433:function(e,t,r){"use strict";r(21703);var a=r(21646),n=r(81923),i=r(57661),c=r(87913);function f(e){i.call(this,"mont",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.i4=new a(4).toRed(this.red).redInvm(),this.two=new a(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new a(t,16),this.z=new a(r,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,r=t.redSqr(),a=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t),n=a.redSqrt();return 0===n.redSqr().cmp(a)},n(o,i.BasePoint),f.prototype.decodePoint=function(e,t){return this.point(c.toArray(e,t),1)},f.prototype.point=function(e,t){return new o(this,e,t)},f.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),r=this.x.redSub(this.z),a=r.redSqr(),n=t.redSub(a),i=t.redMul(a),c=n.redMul(a.redAdd(this.curve.a24.redMul(n)));return this.curve.point(i,c)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),a=this.x.redSub(this.z),n=e.x.redAdd(e.z),i=e.x.redSub(e.z),c=i.redMul(r),f=n.redMul(a),o=t.z.redMul(c.redAdd(f).redSqr()),d=t.x.redMul(c.redISub(f).redSqr());return this.curve.point(o,d)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,a=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]?(r=r.diffAdd(a,n),a=a.dbl()):(a=r.diffAdd(a,n),r=r.dbl());return a},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},78441:function(e,t,r){"use strict";r(21703);var a=r(87913),n=r(21646),i=r(81923),c=r(57661),f=a.assert;function o(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 d(e,t,r,a){c.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),a&&(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,r,a){c.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===a?(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(r,16),this.z=new n(a,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(o,c),e.exports=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r,a;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)r=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))?r=c[0]:(r=c[1],f(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return a=e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(r),{beta:t,lambda:r,basis:a}}},o.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),a=r.redNeg(),i=new n(3).toRed(t).redNeg().redSqrt().redMul(r),c=a.redAdd(i).fromRed(),f=a.redSub(i).fromRed();return[c,f]},o.prototype._getEndoBasis=function(e){var t,r,a,i,c,f,o,d,s,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),b=e,h=this.n.clone(),l=new n(1),p=new n(0),x=new n(0),m=new n(1),v=0;while(0!==b.cmpn(0)){var g=h.div(b);d=h.sub(g.mul(b)),s=x.sub(g.mul(l));var y=m.sub(g.mul(p));if(!a&&d.cmp(u)<0)t=o.neg(),r=l,a=d.neg(),i=s;else if(a&&2===++v)break;o=d,h=b,b=d,x=l,l=s,m=p,p=y}c=d.neg(),f=s;var w=a.sqr().add(i.sqr()),M=c.sqr().add(f.sqr());return M.cmp(w)>=0&&(c=t,f=r),a.negative&&(a=a.neg(),i=i.neg()),c.negative&&(c=c.neg(),f=f.neg()),[{a:a,b:i},{a:c,b:f}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],a=t[1],n=a.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),c=n.mul(r.a),f=i.mul(a.a),o=n.mul(r.b),d=i.mul(a.b),s=e.sub(c).sub(f),u=o.add(d).neg();return{k1:s,k2:u}},o.prototype.pointFromX=function(e,t){e=new n(e,16),e.red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),a=r.redSqrt();if(0!==a.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=a.fromRed().isOdd();return(t&&!i||!t&&i)&&(a=a.redNeg()),this.point(e,a)},o.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,a=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(a).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var a=this._endoWnafT1,n=this._endoWnafT2,i=0;i":""},d.prototype.isInfinity=function(){return this.inf},d.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 r=t.redSqr().redISub(this.x).redISub(e.x),a=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,a)},d.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,r=this.x.redSqr(),a=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(a),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)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.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)},d.prototype.mulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n):this.curve._wnafMulAdd(1,a,n,2)},d.prototype.jmulAdd=function(e,t,r){var a=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(a,n,!0):this.curve._wnafMulAdd(1,a,n,2,!0)},d.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))},d.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,a=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(a)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(a)}}}return t},d.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),o.prototype.jpoint=function(e,t,r){return new s(this,e,t,r)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),a=this.y.redMul(t).redMul(e);return this.curve.point(r,a)},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(),r=this.z.redSqr(),a=this.x.redMul(t),n=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),c=e.y.redMul(r.redMul(this.z)),f=a.redSub(n),o=i.redSub(c);if(0===f.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=f.redSqr(),s=d.redMul(f),u=a.redMul(d),b=o.redSqr().redIAdd(s).redISub(u).redISub(u),h=o.redMul(u.redISub(b)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(b,h,l)},s.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,a=e.x.redMul(t),n=this.y,i=e.y.redMul(t).redMul(this.z),c=r.redSub(a),f=n.redSub(i);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=c.redSqr(),d=o.redMul(c),s=r.redMul(o),u=f.redSqr().redIAdd(d).redISub(s).redISub(s),b=f.redMul(s.redISub(u)).redISub(n.redMul(d)),h=this.z.redMul(c);return this.curve.jpoint(u,b,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 r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},69474:function(e,t,r){"use strict";var a,n=t,i=r(78730),c=r(11626),f=r(87913),o=f.assert;function d(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,o(this.g.validate(),"Invalid curve"),o(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 r=new d(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=d,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{a=r(36027)}catch(u){a=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",a]})},98082:function(e,t,r){"use strict";r(21703);var a=r(21646),n=r(72570),i=r(87913),c=r(69474),f=r(31482),o=i.assert,d=r(96964),s=r(4958);function u(e){if(!(this instanceof u))return new u(e);"string"===typeof e&&(o(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=u,u.prototype.keyPair=function(e){return new d(this,e)},u.prototype.keyFromPrivate=function(e,t){return d.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return d.fromPublic(this,e,t)},u.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()}),r=this.n.byteLength(),i=this.n.sub(new a(2));;){var c=new a(t.generate(r));if(!(c.cmp(i)>0))return c.iaddn(1),this.keyFromPrivate(c)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,i){"object"===typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new a(e,16));for(var c=this.n.byteLength(),f=t.getPrivate().toArray("be",c),o=e.toArray("be",c),d=new n({hash:this.hash,entropy:f,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new a(1)),b=0;;b++){var h=i.k?i.k(b):new a(d.generate(this.n.byteLength()));if(h=this._truncateToN(h,!0),!(h.cmpn(1)<=0||h.cmp(u)>=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 v=(l.getY().isOdd()?1:0)|(0!==p.cmp(x)?2:0);return i.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new s({r:x,s:m,recoveryParam:v})}}}}}},u.prototype.verify=function(e,t,r,n){e=this._truncateToN(new a(e,16)),r=this.keyFromPublic(r,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,o=c.invm(this.n),d=o.mul(e).umod(this.n),u=o.mul(i).umod(this.n);return this.curve._maxwellTrick?(f=this.g.jmulAdd(d,r.getPublic(),u),!f.isInfinity()&&f.eqXToP(i)):(f=this.g.mulAdd(d,r.getPublic(),u),!f.isInfinity()&&0===f.getX().umod(this.n).cmp(i))},u.prototype.recoverPubKey=function(e,t,r,n){o((3&r)===r,"The recovery param is more than two bits"),t=new s(t,n);var i=this.n,c=new a(e),f=t.r,d=t.s,u=1&r,b=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&b)throw new Error("Unable to find sencond key candinate");f=b?this.curve.pointFromX(f.add(this.curve.n),u):this.curve.pointFromX(f,u);var h=t.r.invm(i),l=i.sub(c).mul(h).umod(i),p=d.mul(h).umod(i);return this.g.mulAdd(l,f,p)},u.prototype.getKeyRecoveryParam=function(e,t,r,a){if(t=new s(t,a),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(r))return n}throw new Error("Unable to find valid recovery factor")}},96964:function(e,t,r){"use strict";var a=r(21646),n=r(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,r){return t instanceof c?t:new c(e,{pub:t,pubEnc:r})},c.fromPrivate=function(e,t,r){return t instanceof c?t:new c(e,{priv:t,privEnc:r})},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 a(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,r){return this.ec.sign(e,this,t,r)},c.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},c.prototype.inspect=function(){return""}},4958:function(e,t,r){"use strict";var a=r(21646),n=r(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 a(e.r,16),this.s=new a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function f(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var a=15&r;if(0===a||a>4)return!1;for(var n=0,i=0,c=t.place;i>>=0;return!(n<=127)&&(t.place=c,n)}function d(e){var t=0,r=e.length-1;while(!e[t]&&!(128&e[t+1])&&t>>3);e.push(128|r);while(--r)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=c,c.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new f;if(48!==e[r.place++])return!1;var i=o(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var c=o(e,r);if(!1===c)return!1;var d=e.slice(r.place,c+r.place);if(r.place+=c,2!==e[r.place++])return!1;var s=o(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new a(d),this.s=new a(u),this.recoveryParam=null,!0},c.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=d(t),r=d(r);while(!r[0]&&!(128&r[1]))r=r.slice(1);var a=[2];s(a,t.length),a=a.concat(t),a.push(2),s(a,r.length);var i=a.concat(r),c=[48];return s(c,i.length),c=c.concat(i),n.encode(c,e)}},39322:function(e,t,r){"use strict";var a=r(78730),n=r(69474),i=r(87913),c=i.assert,f=i.parseBytes,o=r(64586),d=r(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=a.sha512}e.exports=s,s.prototype.sign=function(e,t){e=f(e);var r=this.keyFromSecret(t),a=this.hashInt(r.messagePrefix(),e),n=this.g.mul(a),i=this.encodePoint(n),c=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),o=a.add(c).umod(this.curve.n);return this.makeSignature({R:n,S:o,Rencoded:i})},s.prototype.verify=function(e,t,r){e=f(e),t=this.makeSignature(t);var a=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),a.pubBytes(),e),i=this.g.mul(t.S()),c=t.R().add(a.pub().mul(n));return c.eq(i)},s.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(n>>1)-1?(n>>1)-o:o,i.isubn(f)):f=0,a[c]=f,i.iushrn(1)}return a}function o(e,t){var r=[[],[]];e=e.clone(),t=t.clone();var a,n=0,i=0;while(e.cmpn(-n)>0||t.cmpn(-i)>0){var c,f,o=e.andln(3)+n&3,d=t.andln(3)+i&3;3===o&&(o=-1),3===d&&(d=-1),0===(1&o)?c=0:(a=e.andln(7)+n&7,c=3!==a&&5!==a||2!==d?o:-o),r[0].push(c),0===(1&d)?f=0:(a=t.andln(7)+i&7,f=3!==a&&5!==a||2!==o?d:-d),r[1].push(f),2*n===c+1&&(n=1-n),2*i===f+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function d(e,t,r){var a="_"+t;e.prototype[t]=function(){return void 0!==this[a]?this[a]:this[a]=r.call(this)}}function s(e){return"string"===typeof e?a.toArray(e,"hex"):e}function u(e){return new n(e,"hex","le")}a.assert=i,a.toArray=c.toArray,a.zero2=c.zero2,a.toHex=c.toHex,a.encode=c.encode,a.getNAF=f,a.getJSF=o,a.cachedProperty=d,a.parseBytes=s,a.intFromLE=u},21646:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(85568).Buffer}catch(E){}function f(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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"],u=[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 h(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function l(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?s[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:s[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function m(e,t,r){var a=new v;return a.mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):a<63?l(this,e,t):a<1024?x(this,e,t):m(this,e,t),r},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},v.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 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 a(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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 g[e]=t,t},A.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){r(21703);var a=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 a()}try{return __global__||a()}finally{delete Object.prototype.__global__}}()},94890:function(e,t,r){r(50402),r(33018);const a=r(43353),n=1e3,i=(e,t)=>e+t,c=["sync","latest"];class f extends a{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&&o(e)<=o(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 o(e){return Number.parseInt(e,16)}e.exports=f},97965:function(e,t,r){r(21703);const a=r(33018),n=r(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,r=e.retryTimeout||t/10,a=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=r,this._keepEventLoopActive=a,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 r=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:\n${e.stack}`);try{this.emit("error",r)}catch(t){console.error(r)}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 a((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((r=>{const a=setTimeout(r,e);a.unref&&t&&a.unref()}))}e.exports=c},20591:function(e,t,r){var a=r(15361)["Buffer"],n=r(4046).keccak_256,i=r(88612);function c(e){for(var t="",r=0;r<32;r++)t+="00";if(name=f(e),name){var i=name.split(".");for(r=i.length-1;r>=0;r--){var c=n(i[r]);t=n(new a(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,r){var a=r(96027);r(48675),r(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 a&&a.versions&&a.versions.node;n&&(t=r.g);for(var i=!t.JS_SHA3_NO_COMMON_JS&&e.exports,c="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],o=[1,256,65536,16777216],d=[6,1536,393216,100663296],s=[0,8,16,24],u=[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],b=[224,256,384,512],h=[128,256],l=["hex","buffer","arrayBuffer","array"],p=function(e,t,r){return function(a){return new E(e,t,e).update(a)[r]()}},x=function(e,t,r){return function(a,n){return new E(e,t,n).update(a)[r]()}},m=function(e,t){var r=p(e,t,"hex");r.create=function(){return new E(e,t,e)},r.update=function(e){return r.create().update(e)};for(var a=0;a>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var a=0;a<50;++a)this.s[a]=0}E.prototype.update=function(e){var t="string"!==typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));var r,a,n=e.length,i=this.blocks,c=this.byteCount,f=this.blockCount,o=0,d=this.s;while(o>2]|=e[o]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(i[r>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=c){for(this.start=r-c,this.block=i[f],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],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&&(T(r),i=0)}return n&&(e=r[i],n>0&&(o+=c[e>>4&15]+c[15&e]),n>1&&(o+=c[e>>12&15]+c[e>>8&15]),n>2&&(o+=c[e>>20&15]+c[e>>16&15])),o},E.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,a=this.outputBlocks,n=this.extraBytes,i=0,c=0,f=this.outputBits>>3;e=n?new ArrayBuffer(a+1<<2):new ArrayBuffer(f);var o=new Uint32Array(e);while(c>8&255,o[e+2]=t>>16&255,o[e+3]=t>>24&255;f%r===0&&T(a)}return i&&(e=f<<2,t=a[c],i>0&&(o[e]=255&t),i>1&&(o[e+1]=t>>8&255),i>2&&(o[e+2]=t>>16&255)),o};var T=function(e){var t,r,a,n,i,c,f,o,d,s,b,h,l,p,x,m,v,g,y,w,M,_,k,A,S,E,T,P,I,B,C,O,R,N,L,U,j,F,D,H,q,z,K,W,G,V,Z,$,J,Y,X,Q,ee,te,re,ae,ne,ie,ce,fe,oe,de,se;for(a=0;a<48;a+=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],o=e[4]^e[14]^e[24]^e[34]^e[44],d=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],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),r=l^(f<<1|c>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=n^(o<<1|d>>>31),r=i^(d<<1|o>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=c^(s<<1|b>>>31),r=f^(b<<1|s>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=o^(h<<1|l>>>31),r=d^(l<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=s^(n<<1|i>>>31),r=b^(i<<1|n>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],x=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,oe=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,L=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ae=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,D=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~m&g,e[1]=x^~v&y,e[10]=A^~E&P,e[11]=S^~T&I,e[20]=N^~U&F,e[21]=L^~j&D,e[30]=W^~V&$,e[31]=G^~Z&J,e[40]=te^~ae&ie,e[41]=re^~ne&ce,e[2]=m^~g&w,e[3]=v^~y&M,e[12]=E^~P&B,e[13]=T^~I&C,e[22]=U^~F&H,e[23]=j^~D&q,e[32]=V^~$&Y,e[33]=Z^~J&X,e[42]=ae^~ie&fe,e[43]=ne^~ce&oe,e[4]=g^~w&_,e[5]=y^~M&k,e[14]=P^~B&O,e[15]=I^~C&R,e[24]=F^~H&z,e[25]=D^~q&K,e[34]=$^~Y&Q,e[35]=J^~X&ee,e[44]=ie^~fe&de,e[45]=ce^~oe&se,e[6]=w^~_&p,e[7]=M^~k&x,e[16]=B^~O&A,e[17]=C^~R&S,e[26]=H^~z&N,e[27]=q^~K&L,e[36]=Y^~Q&W,e[37]=X^~ee&G,e[46]=fe^~de&te,e[47]=oe^~se&re,e[8]=_^~p&m,e[9]=k^~x&v,e[18]=O^~A&E,e[19]=R^~S&T,e[28]=z^~N&U,e[29]=K^~L&j,e[38]=Q^~W&V,e[39]=ee^~G&Z,e[48]=de^~te&ae,e[49]=se^~re&ne,e[0]^=u[a],e[1]^=u[a+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,r){const a=r(71287),n=r(58829),{incrementHexInt:i}=r(85181);class c extends a{constructor({provider:e,params:t}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:t}){const r=t,a=i(e),c=await n({provider:this.provider,fromBlock:a,toBlock:r}),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=r(t),f=r(i),o=f-c+1,d=Array(o).fill().map(((e,t)=>c+t)).map(a),s=await Promise.all(d.map((t=>n(e,"eth_getBlockByNumber",[t,!1]))));return s}function r(e){return void 0===e||null===e?e:Number.parseInt(e,16)}function a(e){if(void 0===e||null===e)return e;const t=e.toString(16);return"0x"+t}function n(e,t,r){return new Promise(((a,n)=>{e.sendAsync({id:1,jsonrpc:"2.0",method:t,params:r},((e,t)=>{if(e)return n(e);a(t.result)}))}))}e.exports=t},85181:function(e){function t(...e){const t=a(e);return t[0]}function r(...e){const t=a(e);return t[t.length-1]}function a(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 o(t+1)}function o(e){if(void 0===e||null===e)return e;let t=e.toString(16);const r=t.length%2;return r&&(t="0"+t),"0x"+t}function d(e){let t="0x";for(let r=0;r{if(0===n.length)return;const r=await u.acquire();try{await Promise.all(p(n).map((async r=>{try{await r.update({oldBlock:e,newBlock:t})}catch(a){console.error(a)}})))}catch(a){console.error(a)}r()};return m.newLogFilter=g,m.newBlockFilter=y,m.newPendingTransactionFilter=w,m.uninstallFilter=k,m.getFilterChanges=M,m.getFilterLogs=_,m.destroy=()=>{E()},m;async function g(e){const r=new c({provider:t,params:e});await A(r);return r}async function y(){const e=new f({provider:t});await A(e);return e}async function w(){const e=new o({provider:t});await A(e);return e}async function M(e){const t=s(e),r=n[t];if(!r)throw new Error(`No filter for index "${t}"`);const a=r.getChangesAndClear();return a}async function _(e){const t=s(e),r=n[t];if(!r)throw new Error(`No filter for index "${t}"`);return"log"===r.type?results=r.getAllResults():results=[],results}async function k(e){const t=s(e),r=n[t],a=Boolean(r);return a&&await S(t),a}async function A(t){const a=p(n).length,i=await e.getLatestBlock();await t.initialize({currentBlock:i}),r++,n[r]=t,t.id=r,t.idHex=d(r);const c=p(n).length;return T({prevFilterCount:a,newFilterCount:c}),r}async function S(e){const t=p(n).length;delete n[e];const r=p(n).length;T({prevFilterCount:t,newFilterCount:r})}async function E(){const e=p(n).length;n={},T({prevFilterCount:e,newFilterCount:0})}function T({prevFilterCount:t,newFilterCount:r}){0===t&&r>0?e.on("sync",v):t>0&&0===r&&e.removeListener("sync",v)}}function b(e){return h((async(...t)=>{const r=await e(...t),a=d(r.id);return a}))}function h(e){return n((async(t,r)=>{const a=await e.apply(null,t.params);r.result=a}))}function l({mutex:e}){return t=>async(r,a,n,i)=>{const c=await e.acquire();c(),t(r,a,n,i)}}function p(e,t){const r=[];for(let a in e)r.push(e[a]);return r}e.exports=u},19121:function(e,t,r){const a=r(50402),n=r(98490),i=r(8706),{bnToHex:c,hexToInt:f,incrementHexInt:o,minBlockRef:d,blockRefIsNumber:s}=r(85181);class u extends i{constructor({provider:e,params:t}){super(),this.type="log",this.ethQuery=new a(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 r=d(this.params.toBlock,e),a=Object.assign({},this.params,{toBlock:r}),n=await this._fetchLogs(a);this.addInitialResults(n)}async update({oldBlock:e,newBlock:t}){const r=t;let a;a=e?o(e):t;const n=Object.assign({},this.params,{fromBlock:a,toBlock:r}),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 r=this.params.topics.every(((t,r)=>{let a=e.topics[r];if(!a)return!1;a=a.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(a);return c}));return r}}e.exports=u},98490:function(e,t,r){"use strict";r(21703);const a=(e,t,r,a)=>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===r?a:this;Reflect.apply(e,f,n)}))},n=new WeakMap;e.exports=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(null===e||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":r}\``);const i=(e,r)=>{let a=n.get(e);if(a||(a={},n.set(e,a)),r in a)return a[r];const i=e=>"string"===typeof e||"symbol"===typeof r?r===e:e.test(r),c=Reflect.getOwnPropertyDescriptor(e,r),f=void 0===c||c.writable||c.configurable,o=t.include?t.include.some(i):!t.exclude.some(i),d=o&&f;return a[r]=d,d},c=new WeakMap,f=new Proxy(e,{apply(e,r,n){const i=c.get(e);if(i)return Reflect.apply(i,r,n);const o=t.excludeMain?e:a(e,t,f,e);return c.set(e,o),Reflect.apply(o,r,n)},get(e,r){const n=e[r];if(!i(e,r)||n===Function.prototype[r])return n;const o=c.get(n);if(o)return o;if("function"===typeof n){const r=a(n,t,f,e);return c.set(n,r),r}return n}});return f}},67234:function(e,t,r){r(21703);const a=r(73055)["default"],n=r(62506),{createAsyncMiddleware:i}=r(2482),c=r(56615),{unsafeRandomBytes:f,incrementHexInt:o}=r(85181),d=r(58829);function s({blockTracker:e,provider:t}){const r={},s=c({blockTracker:e,provider:t});let b=!1;const h=new a,l=n({eth_subscribe:i(p),eth_unsubscribe:i(x)});return l.destroy=v,{events:h,middleware:l};async function p(a,n){if(b)throw new Error("SubscriptionManager - attempting to use after destroying");const i=a.params[0],c=f(16);let h;switch(i){case"newHeads":h=l({subId:c});break;case"logs":const e=a.params[1],t=await s.newLogFilter(e);h=p({subId:c,filter:t});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${i}"`)}return r[c]=h,void(n.result=c);function l({subId:r}){const a={type:i,destroy:async()=>{e.removeListener("sync",a.update)},update:async({oldBlock:e,newBlock:a})=>{const n=a,i=o(e),c=await d({provider:t,fromBlock:i,toBlock:n}),f=c.map(u);f.forEach((e=>{m(r,e)}))}};return e.on("sync",a.update),a}function p({subId:e,filter:t}){t.on("update",(t=>m(e,t)));const r={type:i,destroy:async()=>await s.uninstallFilter(t.idHex)};return r}}async function x(e,t){if(b)throw new Error("SubscriptionManager - attempting to use after destroying");const a=e.params[0],n=r[a];n?(delete r[a],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 v(){h.removeAllListeners();for(const e in r)r[e].destroy(),delete r[e];b=!0}}function u(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,r){const a=r(71287),n=r(58829),{incrementHexInt:i}=r(85181);class c extends a{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const t=e,r=i(e),a=await n({provider:this.provider,fromBlock:r,toBlock:t}),c=[];for(const n of a)c.push(...n.transactions);this.addResults(c)}}e.exports=c},47322:function(e,t,r){r(21703);const a=r(61014),n=r(40534),i=[void 0,null,""];function c(e={}){const{blockTracker:t}=e;if(!t)throw new Error("createBlockCacheMiddleware - No BlockTracker specified");const r=new f,i={perma:r,block:r,fork:r};return n((async(e,n,c)=>{if(e.skipCache)return c();const f=a.cacheTypeForPayload(e),o=i[f];if(!o)return c();if(!o.canCacheRequest(e))return c();let d,s=a.blockTagForPayload(e);if(s||(s="latest"),"earliest"===s)d="0x00";else if("latest"===s){const e=await t.getLatestBlock();r.clearBefore(e),d=e}else d=s;const u=await o.get(e,d);void 0===u?(await c(),await o.set(e,d,n.result)):n.result=u}))}e.exports=c;class f{constructor(){this.cache={}}getBlockCacheForPayload(e,t){const r=Number.parseInt(t,16);let a=this.cache[r];if(!a){const e={};this.cache[r]=e,a=e}return a}async get(e,t){const r=this.getBlockCacheForPayload(e,t);if(!r)return;const n=a.cacheIdentifierForPayload(e,!0),i=r[n];return i}async set(e,t,r){const n=this.canCacheResult(e,r);if(!n)return;const i=this.getBlockCacheForPayload(e,t),c=a.cacheIdentifierForPayload(e,!0);i[c]=r}canCacheRequest(e){if(!a.canCache(e))return!1;const t=a.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,r=Number.parseInt(e,16);Object.keys(t.cache).map(Number).filter((e=>edelete t.cache[e]))}}},61014:function(e,t,r){const a=r(40391);function n(e,t){const r=t?f(e):e.params;return i(e)?e.method+":"+a(r):null}function i(e){return"never"!==d(e)}function c(e){let t=o(e);return t>=e.params.length?null:e.params[t]}function f(e){const t=o(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function o(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 d(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:o,cacheTypeForPayload:d}},40534:function(e){e.exports=function(e){return(t,r,a,n)=>{let i;const c=new Promise((e=>{i=e}));let f,o;const d=async()=>{o=!0,a((e=>{f=e,i()})),await c};e(t,r,d).then((async()=>{o?(await c,f(null)):n(null)})).catch((e=>{f?f(e):n(e)}))}}},38249:function(e){e.exports=function(e){return(t,r,a,n)=>{const i=e[t.method];return void 0===i?a():"function"===typeof i?i(t,r,a,n):(r.result=i,n())}}},62506:function(e,t,r){e.exports=r(38249)},53895:function(e){var t=function(e,t){for(var r=[],a=0;a>6|192);else{if(n>55295&&n<56320){if(++a==e.length)return null;var i=e.charCodeAt(a);if(i<56320||i>57343)return null;n=65536+((1023&n)<<10)+(1023&i),r+=t(n>>18|240),r+=t(n>>12&63|128)}else r+=t(n>>12|224);r+=t(n>>6&63|128)}r+=t(63&n|128)}}return r},_=function(e){var t="",r=0,n=i(e);while(r127){if(c>191&&c<224){if(r>=n)return null;c=(31&c)<<6|63&a(e,r)}else if(c>223&&c<240){if(r+1>=n)return null;c=(15&c)<<12|(63&a(e,r))<<6|63&a(e,++r)}else{if(!(c>239&&c<248))return null;if(r+2>=n)return null;c=(7&c)<<18|(63&a(e,r))<<12|(63&a(e,++r))<<6|63&a(e,++r)}++r}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:o,pad:d,padRight:s,fromAscii:y,toAscii:w,fromString:M,toString:_,fromNumber:p,toNumber:x,fromNat:v,toNat:g,fromArray:b,toArray:u,fromUint8Array:l,toUint8Array:h}},50849:function(e){var t="0123456789abcdef".split(""),r=[1,256,65536,16777216],a=[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,o=e.blocks,d=e.blockCount<<2,s=e.blockCount,u=e.outputBlocks,b=e.s,h=0;while(h>2]|=n[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[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)<=d){for(e.start=x-d,e.block=o[s],x=0;x>2]|=r[3&x],e.lastByteIndex===d)for(o[0]=o[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(b),x=0)}return"0x"+p},f=function(e){var t,r,a,i,c,f,o,d,s,u,b,h,l,p,x,m,v,g,y,w,M,_,k,A,S,E,T,P,I,B,C,O,R,N,L,U,j,F,D,H,q,z,K,W,G,V,Z,$,J,Y,X,Q,ee,te,re,ae,ne,ie,ce,fe,oe,de,se;for(a=0;a<48;a+=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],o=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],b=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|o>>>31),r=l^(o<<1|f>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|s>>>31),r=c^(s<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=f^(u<<1|b>>>31),r=o^(b<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(h<<1|l>>>31),r=s^(l<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(i<<1|c>>>31),r=b^(c<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],x=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,oe=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,L=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ae=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,D=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~m&g,e[1]=x^~v&y,e[10]=A^~E&P,e[11]=S^~T&I,e[20]=N^~U&F,e[21]=L^~j&D,e[30]=W^~V&$,e[31]=G^~Z&J,e[40]=te^~ae&ie,e[41]=re^~ne&ce,e[2]=m^~g&w,e[3]=v^~y&M,e[12]=E^~P&B,e[13]=T^~I&C,e[22]=U^~F&H,e[23]=j^~D&q,e[32]=V^~$&Y,e[33]=Z^~J&X,e[42]=ae^~ie&fe,e[43]=ne^~ce&oe,e[4]=g^~w&_,e[5]=y^~M&k,e[14]=P^~B&O,e[15]=I^~C&R,e[24]=F^~H&z,e[25]=D^~q&K,e[34]=$^~Y&Q,e[35]=J^~X&ee,e[44]=ie^~fe&de,e[45]=ce^~oe&se,e[6]=w^~_&p,e[7]=M^~k&x,e[16]=B^~O&A,e[17]=C^~R&S,e[26]=H^~z&N,e[27]=q^~K&L,e[36]=Y^~Q&W,e[37]=X^~ee&G,e[46]=fe^~de&te,e[47]=oe^~se&re,e[8]=_^~p&m,e[9]=k^~x&v,e[18]=O^~A&E,e[19]=R^~S&T,e[28]=z^~N&U,e[29]=K^~L&j,e[38]=Q^~W&V,e[39]=ee^~G&Z,e[48]=de^~te&ae,e[49]=se^~re&ne,e[0]^=n[a],e[1]^=n[a+1]},o=function(e){return function(t){var r;if("0x"===t.slice(0,2)){r=[];for(var a=2,n=t.length;a=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(!u(t))throw new Error(`Invalid ethereum address given: "${t}"`);const r=a.padLeft(t,64);return i(e,r)}function o(e,t){if(!n(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error(`Invalid contract address given: "${t}"`);return i(e,t)}function d(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 u(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=o,t.isTopicInBloom=d,t.isTopic=s,t.isAddress=u},16773:function(e,t,r){"use strict";r(21703),r(48675),r(3462),Object.defineProperty(t,"__esModule",{value:!0});const a=r(69893);function n(e){return"0x"+a.keccak_256(c(e))}function i(e){const t=[];for(let r=0;r>>4).toString(16)),t.push((15&e[r]).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 r=[];for(let a=0;a=256||parseInt(String(r))!=r)return!1}return!0}function o(e){return void 0!==e.slice||(e.slice=()=>{const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}t.keccak256=n,t.padLeft=(e,t)=>{const r=/^0x/i.test(e)||"number"===typeof e;e=e.toString().replace(/^0x/i,"");const a=t-e.length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(a).join("0")+e},t.bytesToHex=i,t.toByteArray=c},30952:function(e,t,r){"use strict";var a=r(15361)["Buffer"];function n(e){return function(t){var r=e();return r.update(t),a.from(r.digest())}}Object.defineProperty(t,"__esModule",{value:!0}),t.createHashFunction=n},92802:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(30952),n=r(70574);t.keccak224=a.createHashFunction((function(){return n("keccak224")})),t.keccak256=a.createHashFunction((function(){return n("keccak256")})),t.keccak384=a.createHashFunction((function(){return n("keccak384")})),t.keccak512=a.createHashFunction((function(){return n("keccak512")}))},71418:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(67602);function n(e){return new Promise((function(t,r){a(e,(function(e,a){e?r(e):t(a)}))}))}function i(e){return a(e)}t.getRandomBytes=n,t.getRandomBytesSync=i},52010:function(e,t,r){"use strict";r(21703);var a=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function c(e){try{o(a.next(e))}catch(t){i(t)}}function f(e){try{o(a["throw"](e))}catch(t){i(t)}}function o(e){e.done?r(e.value):n(e.value).then(c,f)}o((a=a.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,a,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 o([e,t])}}function o(i){if(r)throw new TypeError("Generator is already executing.");while(c)try{if(r=1,a&&(n=2&i[0]?a["return"]:i[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,i[1])).done)return n;switch(a=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++,a=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]r)throw new Error("Elements exceed array size: "+r);for(b in f=[],e=e.slice(0,e.lastIndexOf("[")),"string"===typeof t&&(t=JSON.parse(t)),t)f.push(h(e,t[b]));if("dynamic"===r){var l=h("uint256",t.length);f.unshift(l)}return a.concat(f)}if("bytes"===e)return t=a.from(t),f=a.concat([h("uint256",t.length),t]),t.length%32!==0&&(f=a.concat([f,n.zeros(32-t.length%32)])),f;if(e.startsWith("bytes")){if(r=o(e),r<1||r>32)throw new Error("Invalid bytes width: "+r);return n.setLengthRight(t,32)}if(e.startsWith("uint")){if(r=o(e),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(c=u(t),c.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+c.bitLength());if(c<0)throw new Error("Supplied uint is negative");return c.toArrayLike(a,"be",32)}if(e.startsWith("int")){if(r=o(e),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(c=u(t),c.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+c.bitLength());return c.toTwos(256).toArrayLike(a,"be",32)}if(e.startsWith("ufixed")){if(r=d(e),c=u(t),c<0)throw new Error("Supplied ufixed is negative");return h("uint256",c.mul(new i(2).pow(new i(r[1]))))}if(e.startsWith("fixed"))return r=d(e),h("int256",u(t).mul(new i(2).pow(new i(r[1]))));throw new Error("Unsupported or invalid type: "+e)}function l(e,t,r){var n,c,f,o;if("string"===typeof e&&(e=p(e)),"address"===e.name)return l(e.rawType,t,r).toArrayLike(a,"be",20).toString("hex");if("bool"===e.name)return l(e.rawType,t,r).toString()===new i(1).toString();if("string"===e.name){var d=l(e.rawType,t,r);return a.from(d,"utf8").toString()}if(e.isArray){for(f=[],n=e.size,"dynamic"===e.size&&(r=l("uint256",t,r).toNumber(),n=l("uint256",t,r).toNumber(),r+=32),o=0;oe.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(r,r+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,r),!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,r),!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,r,a;if(m(e)){t=s(e);var n=e.slice(0,e.lastIndexOf("["));return n=p(n),r={isArray:!0,name:e,size:t,memoryUsage:"dynamic"===t?32:n.memoryUsage*t,subArray:n},r}switch(e){case"address":a="uint160";break;case"bool":a="uint8";break;case"string":a="bytes";break}if(r={rawType:a,name:e,memoryUsage:32},e.startsWith("bytes")&&"bytes"!==e||e.startsWith("uint")||e.startsWith("int")?r.size=o(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=d(e)),e.startsWith("bytes")&&"bytes"!==e&&(r.size<1||r.size>32))throw new Error("Invalid bytes width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint width: "+r.size);return r}function x(e){return"string"===e||"bytes"===e||"dynamic"===s(e)}function m(e){return e.lastIndexOf("]")===e.length-1}function v(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}function g(e){return e>="0"&&e<="9"}c.eventID=function(e,t){var r=e+"("+t.map(f).join(",")+")";return n.keccak256(a.from(r))},c.methodID=function(e,t){return c.eventID(e,t).slice(0,4)},c.rawEncode=function(e,t){var r=[],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;cb)throw new Error("Elements exceed array size: "+b)}var h=t.map((function(e){return c.solidityHexValue(d,e,256)}));return a.concat(h)}if("bytes"===e)return t;if("string"===e)return a.from(t,"utf8");if("bool"===e){r=r||8;var l=Array(r/4).join("0");return a.from(t?l+"1":l+"0","hex")}if("address"===e){var p=20;return r&&(p=r/8),n.setLengthLeft(t,p)}if(e.startsWith("bytes")){if(i=o(e),i<1||i>32)throw new Error("Invalid bytes width: "+i);return n.setLengthRight(t,i)}if(e.startsWith("uint")){if(i=o(e),i%8||i<8||i>256)throw new Error("Invalid uint width: "+i);if(f=u(t),f.bitLength()>i)throw new Error("Supplied uint exceeds width: "+i+" vs "+f.bitLength());return r=r||i,f.toArrayLike(a,"be",r/8)}if(e.startsWith("int")){if(i=o(e),i%8||i<8||i>256)throw new Error("Invalid int width: "+i);if(f=u(t),f.bitLength()>i)throw new Error("Supplied int exceeds width: "+i+" vs "+f.bitLength());return r=r||i,f.toTwos(i).toArrayLike(a,"be",r/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 r=[],n=0;n=8?n+=e[c].toUpperCase():n+=e[c];return n},t.isValidChecksumAddress=function(e,r){return t.isValidAddress(e)&&t.toChecksumAddress(e,r)===e},t.generateAddress=function(e,t){e=o.toBuffer(e);var r=new f(t);return r.isZero()?d.rlphash([e,null]).slice(-20):d.rlphash([e,a.from(r.toArray())]).slice(-20)},t.generateAddress2=function(e,t,r){var i=o.toBuffer(e),c=o.toBuffer(t),f=o.toBuffer(r);n(20===i.length),n(32===c.length);var s=d.keccak256(a.concat([a.from("ff","hex"),i,c,d.keccak256(f)]));return s.slice(-20)},t.isPrecompiled=function(e){var t=o.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(a.concat([a.from([4]),e])):!!t&&c.publicKeyVerify(e)},t.pubToAddress=function(e,t){return void 0===t&&(t=!1),e=o.toBuffer(e),t&&64!==e.length&&(e=c.publicKeyConvert(e,!1).slice(1)),n(64===e.length),d.keccak(e).slice(-20)},t.publicToAddress=t.pubToAddress,t.privateToAddress=function(e){return t.publicToAddress(t.privateToPublic(e))},t.privateToPublic=function(e){return e=o.toBuffer(e),c.publicKeyCreate(e,!1).slice(1)},t.importPublic=function(e){return e=o.toBuffer(e),64!==e.length&&(e=c.publicKeyConvert(e,!1).slice(1)),e}},47833:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(43898),i=r(2396);t.zeros=function(e){return a.allocUnsafe(e).fill(0)},t.setLengthLeft=function(e,r,a){void 0===a&&(a=!1);var n=t.zeros(r);return e=t.toBuffer(e),a?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(e){if(!a.isBuffer(e))if(Array.isArray(e))e=a.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=a.from(n.padToEven(n.stripHexPrefix(e)),"hex")}else if("number"===typeof e)e=n.intToBuffer(e);else if(null===e||void 0===e)e=a.allocUnsafe(0);else if(i.isBN(e))e=e.toArrayLike(a);else{if(!e.toArray)throw new Error("invalid type");e=a.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 a.from(e.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!==typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(e){if(a.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],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[r]=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})})),r)if("string"===typeof r&&(r=a.from(i.stripHexPrefix(r),"hex")),a.isBuffer(r)&&(r=c.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=f.toBuffer(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var o=Object.keys(r);t.forEach((function(t){-1!==o.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==o.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}}},93161:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(48675),r(3462),r(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=r(52010),i=r(69080),c=r(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 r=i.privateKeyExport(e,t);return c.privateKeyExport(e,r,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 a.from(n.privateKeyNegate(Uint8Array.from(e)))},t.privateKeyModInverse=function(e){if(32!==e.length)throw new Error("private key length is invalid");return a.from(i.privateKeyModInverse(Uint8Array.from(e)))},t.privateKeyTweakAdd=function(e,t){return a.from(n.privateKeyTweakAdd(Uint8Array.from(e),t))},t.privateKeyTweakMul=function(e,t){return a.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},t.publicKeyCreate=function(e,t){return a.from(n.publicKeyCreate(Uint8Array.from(e),t))},t.publicKeyConvert=function(e,t){return a.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,r){return a.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),r))},t.publicKeyTweakMul=function(e,t,r){return a.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),r))},t.publicKeyCombine=function(e,t){var r=[];return e.forEach((function(e){r.push(Uint8Array.from(e))})),a.from(n.publicKeyCombine(r,t))},t.signatureNormalize=function(e){return a.from(n.signatureNormalize(Uint8Array.from(e)))},t.signatureExport=function(e){return a.from(n.signatureExport(Uint8Array.from(e)))},t.signatureImport=function(e){return a.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,r){if(null===r)throw new TypeError("options should be an Object");var i=void 0;if(r){if(i={},null===r.data)throw new TypeError("options.data should be a Buffer");if(r.data){if(32!=r.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(r.data)}if(null===r.noncefn)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(i.noncefn=function(e,t,n,i,c){var f=null!=n?a.from(n):null,o=null!=i?a.from(i):null,d=a.from("");return r.noncefn&&(d=r.noncefn(a.from(e),a.from(t),f,o,c)),new Uint8Array(d)})}var c=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),i);return{signature:a.from(c.signature),recovery:c.recid}},t.verify=function(e,t,r){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)},t.recover=function(e,t,r,i){return a.from(n.ecdsaRecover(Uint8Array.from(t),r,Uint8Array.from(e),i))},t.ecdh=function(e,t){return a.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},t.ecdhUnsafe=function(e,t,r){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 a.from(i.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),r))}},21236:function(e,t,r){"use strict";var a=r(15361)["Buffer"];Object.defineProperty(t,"__esModule",{value:!0});var n=a.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=a.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,r){void 0===r&&(r=!0);var c=a.from(r?n:i);return e.copy(c,r?8:9),t.copy(c,r?181:214),c},t.privateKeyImport=function(e){var t=e.length,r=0;if(t2)return null;if(t1?e[r+a-2]<<8:0);return r+=a,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 o=i;if(i+=f,2!==e[i++])return null;var d=e[i++];if(128&d){if(c=d-128,i+c>n)return null;for(;c>0&&0===e[i];i+=1,c-=1);for(d=0;c>0;i+=1,c-=1)d=(d<<8)+e[i]}if(d>n-i)return null;var s=i;for(i+=d;f>0&&0===e[o];f-=1,o+=1);if(f>32)return null;var u=e.slice(o,o+f);for(u.copy(t,32-u.length);d>0&&0===e[s];d-=1,s+=1);if(d>32)return null;var b=e.slice(s,s+d);return b.copy(r,32-b.length),{r:t,s:r}}},69080:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0});var n=r(2396),i=r(32127).ec,c=new i("secp256k1"),f=c.curve;t.privateKeyExport=function(e,t){void 0===t&&(t=!0);var r=new n(e);if(r.ucmp(f.n)>=0)throw new Error("couldn't export to DER format");var a=c.g.mul(r);return o(a.getX(),a.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(a,"be",32)},t.signatureImport=function(e){var t=new n(e.r);t.ucmp(f.n)>=0&&(t=new n(0));var r=new n(e.s);return r.ucmp(f.n)>=0&&(r=new n(0)),a.concat([t.toArrayLike(a,"be",32),r.toArrayLike(a,"be",32)])},t.ecdhUnsafe=function(e,t,r){void 0===r&&(r=!0);var a=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 d=a.pub.mul(i);return o(d.getX(),d.getY(),r)};var o=function(e,t,r){var n;return r?(n=a.alloc(33),n[0]=t.isOdd()?3:2,e.toArrayLike(a,"be",32).copy(n,1)):(n=a.alloc(65),n[0]=4,e.toArrayLike(a,"be",32).copy(n,1),t.toArrayLike(a,"be",32).copy(n,33)),n}},29847:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.hashPersonalMessage=t.isValidSignature=t.fromRpcSig=t.toRpcSig=t.ecrecover=t.ecsign=void 0;var n=r(93161),i=r(2396),c=r(47833),f=r(12338);function o(e,t){return t?e-(2*t+35):e-27}function d(e){return 0===e||1===e}t.ecsign=function(e,t,r){var a=n.sign(e,t),i=a.recovery,c={r:a.signature.slice(0,32),s:a.signature.slice(32,64),v:r?i+(2*r+35):i+27};return c},t.ecrecover=function(e,t,r,i,f){var s=a.concat([c.setLength(r,32),c.setLength(i,32)],64),u=o(t,f);if(!d(u))throw new Error("Invalid signature v value");var b=n.recover(e,s,u);return n.publicKeyConvert(b,!1).slice(1)},t.toRpcSig=function(e,t,r,n){var i=o(e,n);if(!d(i))throw new Error("Invalid signature v value");return c.bufferToHex(a.concat([c.setLengthLeft(t,32),c.setLengthLeft(r,32),c.toBuffer(e)]))},t.fromRpcSig=function(e){var t=c.toBuffer(e);if(65!==t.length)throw new Error("Invalid signature length");var r=t[64];return r<27&&(r+=27),{v:r,r:t.slice(0,32),s:t.slice(32,64)}},t.isValidSignature=function(e,t,r,a,n){void 0===a&&(a=!0);var c=new i("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!d(o(e,n)))return!1;var s=new i(t),u=new i(r);return!(s.isZero()||s.gt(f)||u.isZero()||u.gt(f))&&(!a||1!==u.cmp(c))},t.hashPersonalMessage=function(e){var t=a.from("Ethereum Signed Message:\n"+e.length.toString(),"utf-8");return f.keccak(a.concat([t,e]))}},60253:function(e,t,r){"use strict";var a=r(15361)["Buffer"];function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r(21703);var i=r(60345),c=r(42696),f=i.BN,o=new f("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),d=function(){function e(t){n(this,e),t=t||{};var r=[{name:"nonce",length:32,allowLess:!0,default:new a([])},{name:"gasPrice",length:32,allowLess:!0,default:new a([])},{name:"gasLimit",alias:"gas",length:32,allowLess:!0,default:new a([])},{name:"to",allowZero:!0,length:20,default:new a([])},{name:"value",length:32,allowLess:!0,default:new a([])},{name:"data",alias:"input",allowZero:!0,default:new a([])},{name:"v",allowZero:!0,default:new a([28])},{name:"r",length:32,allowZero:!0,allowLess:!0,default:new a([])},{name:"s",length:32,allowZero:!0,allowLess:!0,default:new a([])}];i.defineProperties(this,r,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 r=this.raw.slice();this.v=this._chainId,this.r=0,this.s=0,t=this.raw,this.raw=r}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(o))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(r){return!1}return!!this._senderPubKey},e.prototype.sign=function(e){var t=this.hash(!1),r=i.ecsign(t,e);this._chainId>0&&(r.v+=2*this._chainId+8),Object.assign(this,r)},e.prototype.getDataFee=function(){for(var e=this.raw[5],t=new f(0),r=0;r0&&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=d},60345:function(e,t,r){"use strict";r(21703);var a="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=r(92802),i=n.keccak224,c=n.keccak384,f=n.keccak256,o=n.keccak512,d=r(69262),s=r(16978),u=r(98217),b=r(2396),h=r(65443),l=r(6779).Buffer;Object.assign(t,r(43898)),t.MAX_INTEGER=new b("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new b("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=b,t.rlp=u,t.secp256k1=d,t.zeros=function(e){return l.allocUnsafe(e).fill(0)},t.zeroAddress=function(){var e=20,r=t.zeros(e);return t.bufferToHex(r)},t.setLengthLeft=t.setLength=function(e,r,a){var n=t.zeros(r);return e=t.toBuffer(e),a?e.length0&&"0"===r.toString())e=e.slice(1),r=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(b.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 b(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return e=t.toBuffer(e),"0x"+e.toString("hex")},t.fromSigned=function(e){return new b(e).fromTwos(256)},t.toUnsigned=function(e){return l.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return i(e);case 256:return f(e);case 384:return c(e);case 512:return o(e);default:throw new Error("Invald algorithm: keccak"+r)}},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,r){e=t.toBuffer(e);var a=h("rmd160").update(e).digest();return!0===r?t.setLength(a,32):a},t.rlphash=function(e){return t.keccak(u.encode(e))},t.isValidPrivate=function(e){return d.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?d.publicKeyVerify(l.concat([l.from([4]),e])):!!t&&d.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=d.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),d.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return e=t.toBuffer(e),64!==e.length&&(e=d.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=d.sign(e,t),a={};return a.r=r.signature.slice(0,32),a.s=r.signature.slice(32,64),a.v=r.recovery+27,a},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(l.concat([r,e]))},t.ecrecover=function(e,r,a,n){var i=l.concat([t.setLength(a,32),t.setLength(n,32)],64),c=r-27;if(0!==c&&1!==c)throw new Error("Invalid signature v value");var f=d.recover(e,i,c);return d.publicKeyConvert(f,!1).slice(1)},t.toRpcSig=function(e,r,a){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(l.concat([t.setLengthLeft(r,32),t.setLengthLeft(a,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(e=t.toBuffer(e),65!==e.length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,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 r=t.zeroAddress();return r===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),a="0x",n=0;n=8?a+=e[n].toUpperCase():a+=e[n];return a},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=new b(r),r=r.isZero()?null:l.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!==typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,a){var n=new b("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new b("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new b(t),r=new b(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==a||1!==new b(r).cmp(n))))},t.baToJSON=function(e){if(l.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],a=0;a=n.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===n.length||!r.length||s(r.length===n.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[a]=n}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:n,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.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=u.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,a){e[e._fields[a]]=t.toBuffer(r)}))}else{if("object"!==("undefined"===typeof n?"undefined":a(n)))throw new Error("invalid data");var i=Object.keys(n);r.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,r){"use strict";var a=r(15361)["Buffer"];r(48675),r(3462),r(21703);var n=r(52010),i=r(11126),c=r(2031),f=function(e){return 32===e.length&&n.privateKeyVerify(Uint8Array.from(e))},o=function(e,t){if(32!==e.length)throw new RangeError("private key length is invalid");var r=i.privateKeyExport(e,t);return c.privateKeyExport(e,r,t)},d=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 a.from(n.privateKeyNegate(Uint8Array.from(e)))},u=function(e){if(32!==e.length)throw new Error("private key length is invalid");return a.from(i.privateKeyModInverse(Uint8Array.from(e)))},b=function(e,t){return a.from(n.privateKeyTweakAdd(Uint8Array.from(e),t))},h=function(e,t){return a.from(n.privateKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t)))},l=function(e,t){return a.from(n.publicKeyCreate(Uint8Array.from(e),t))},p=function(e,t){return a.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,r){return a.from(n.publicKeyTweakAdd(Uint8Array.from(e),Uint8Array.from(t),r))},v=function(e,t,r){return a.from(n.publicKeyTweakMul(Uint8Array.from(e),Uint8Array.from(t),r))},g=function(e,t){var r=[];return e.forEach((function(e){r.push(Uint8Array.from(e))})),a.from(n.publicKeyCombine(r,t))},y=function(e){return a.from(n.signatureNormalize(Uint8Array.from(e)))},w=function(e){return a.from(n.signatureExport(Uint8Array.from(e)))},M=function(e){return a.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,r){if(null===r)throw new TypeError("options should be an Object");var i=void 0;if(r){if(i={},null===r.data)throw new TypeError("options.data should be a Buffer");if(r.data){if(32!==r.data.length)throw new RangeError("options.data length is invalid");i.data=new Uint8Array(r.data)}if(null===r.noncefn)throw new TypeError("options.noncefn should be a Function");r.noncefn&&(i.noncefn=function(e,t,n,i,c){var f=null!=n?a.from(n):null,o=null!=i?a.from(i):null,d=a.from("");return r.noncefn&&(d=r.noncefn(a.from(e),a.from(t),f,o,c)),Uint8Array.from(d)})}var c=n.ecdsaSign(Uint8Array.from(e),Uint8Array.from(t),i);return{signature:a.from(c.signature),recovery:c.recid}},A=function(e,t,r){return n.ecdsaVerify(Uint8Array.from(t),Uint8Array.from(e),r)},S=function(e,t,r,i){return a.from(n.ecdsaRecover(Uint8Array.from(t),r,Uint8Array.from(e),i))},E=function(e,t){return a.from(n.ecdh(Uint8Array.from(e),Uint8Array.from(t),{}))},T=function(e,t,r){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 a.from(i.ecdhUnsafe(Uint8Array.from(e),Uint8Array.from(t),r))};e.exports={privateKeyVerify:f,privateKeyExport:o,privateKeyImport:d,privateKeyNegate:s,privateKeyModInverse:u,privateKeyTweakAdd:b,privateKeyTweakMul:h,publicKeyCreate:l,publicKeyConvert:p,publicKeyVerify:x,publicKeyTweakAdd:m,publicKeyTweakMul:v,publicKeyCombine:g,signatureNormalize:y,signatureExport:w,signatureImport:M,signatureImportLax:_,sign:k,verify:A,recover:S,ecdh:E,ecdhUnsafe:T}},2031:function(e,t,r){"use strict";var a=r(15361)["Buffer"],n=a.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=a.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,r){var c=a.from(r?n:i);return e.copy(c,r?8:9),t.copy(c,r?181:214),c},t.privateKeyImport=function(e){var t=e.length,r=0;if(t2)return null;if(t1?e[r+a-2]<<8:0);return r+=a,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 o=i;if(i+=f,2!==e[i++])return null;var d=e[i++];if(128&d){if(c=d-128,i+c>n)return null;for(;c>0&&0===e[i];i+=1,c-=1);for(d=0;c>0;i+=1,c-=1)d=(d<<8)+e[i]}if(d>n-i)return null;var s=i;for(i+=d;f>0&&0===e[o];f-=1,o+=1);if(f>32)return null;var u=e.slice(o,o+f);for(u.copy(t,32-u.length);d>0&&0===e[s];d-=1,s+=1);if(d>32)return null;var b=e.slice(s,s+d);return b.copy(r,32-b.length),{r:t,s:r}}},11126:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=r(2396),i=r(32127).ec,c=new i("secp256k1"),f=c.curve;t.privateKeyExport=function(e,t){var r=new n(e);if(r.ucmp(f.n)>=0)throw new Error("couldn't export to DER format");var a=c.g.mul(r);return o(a.getX(),a.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(a,"be",32)},t.signatureImport=function(e){var t=new n(e.r);t.ucmp(f.n)>=0&&(t=new n(0));var r=new n(e.s);return r.ucmp(f.n)>=0&&(r=new n(0)),a.concat([t.toArrayLike(a,"be",32),r.toArrayLike(a,"be",32)])},t.ecdhUnsafe=function(e,t,r){var a=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 d=a.pub.mul(i);return o(d.getX(),d.getY(),r)};var o=function(e,t,r){var n=void 0;return r?(n=a.alloc(33),n[0]=t.isOdd()?3:2,e.toArrayLike(a,"be",32).copy(n,1)):(n=a.alloc(65),n[0]=4,e.toArrayLike(a,"be",32).copy(n,1),t.toArrayLike(a,"be",32).copy(n,33)),n}},59426:function(e,t,r){"use strict";r(21703);var a=r(9642),n=r(70594),i=new a(0),c=new a(-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 o(e){var t=e?e.toLowerCase():"ether",r=f[t];if("string"!==typeof r)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 a(r,10)}function d(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,r){var a=n(e),d=a.lt(i),s=o(t),u=f[t].length-1||1,b=r||{};d&&(a=a.mul(c));var h=a.mod(s).toString(10);while(h.length2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var b=u[0],h=u[1];if(b||(b="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 a}function o(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){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):(a(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(a("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"===r)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 r=0;r=t;r-=6)n=f(e,r,r+6),this.words[a]|=n<>>26-i&4194303,i+=24,i>=26&&(i-=26,a++);r+6!==t&&(n=f(e,t,r+6),this.words[a]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,d=0,s=r;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 d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],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 b(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function h(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?d[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],h=u[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:d[b-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function p(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function x(e,t,r){var a=new m;return a.mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?l(this,e,t):a<63?h(this,e,t):a<1024?p(this,e,t):x(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},m.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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=b(e);if(0===t.length)return new i(1);for(var r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 g(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(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.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 a(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 v[e]=t,t},k.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=r(44866),i=r(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 o(e){var t=f(e);return new a(c(t.slice(2)),"hex")}function d(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 a.byteLength(e,"utf8")}function s(e,t,r){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(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function u(e){var t=new a(c(i(e).replace(/^0+|0+$/g,"")),"hex");return t.toString("utf8")}function b(e){var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);r0&&f.length>n&&!f.warned){f.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=f.length,c(o)}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,r){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=h.bind(a);return n.listener=r,a.wrapFn=n,n}function p(e,t,r){var a=e._events;if(void 0===a)return[];var n=a[t];return void 0===n?[]:"function"===typeof n?r?[n.listener||n]:[n]:r?g(n):m(n,n.length)}function x(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),a=0;a0&&(c=t[0]),c instanceof Error)throw c;var f=new Error("Unhandled error."+(c?" ("+c.message+")":""));throw f.context=c,f}var o=n[e];if(void 0===o)return!1;if("function"===typeof o)i(o,this,t);else{var d=o.length,s=m(o,d);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){c=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():v(r,n),1===r.length&&(a[e]=r[0]),void 0!==a.removeListener&&this.emit("removeListener",e,c||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,a;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,i=Object.keys(r);for(a=0;a=0;a--)this.removeListener(e,t[a]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):x.call(e,t)},o.prototype.listenerCount=x,o.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},13692:function(e,t,r){r(21703);var a=r(6779).Buffer,n=r(74993);function i(e,t,r,i){if(a.isBuffer(e)||(e=a.from(e,"binary")),t&&(a.isBuffer(t)||(t=a.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");var c=r/8,f=a.alloc(c),o=a.alloc(i||0),d=a.alloc(0);while(c>0||i>0){var s=new n;s.update(d),s.update(e),t&&s.update(t),d=s.digest();var u=0;if(c>0){var b=f.length-c;u=Math.min(c,d.length),d.copy(f,b,0,u),c-=u}if(u0){var h=o.length-i,l=Math.min(i,d.length-u);d.copy(o,h,u,u+l),i-=l}}return d.fill(0),{key:f,iv:o}}e.exports=i},25383:function(e){e.exports=c,c.default=c,c.stable=s,c.stableStringify=s;var t="[...]",r="[Circular]",a=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function c(e,t,r,c){var f;"undefined"===typeof c&&(c=i()),o(e,"",0,[],void 0,0,c);try{f=0===n.length?JSON.stringify(e,t,r):JSON.stringify(e,b(t),r)}catch(s){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(0!==a.length){var d=a.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return f}function f(e,t,r,i){var c=Object.getOwnPropertyDescriptor(i,r);void 0!==c.get?c.configurable?(Object.defineProperty(i,r,{value:e}),a.push([i,r,t,c])):n.push([t,r,e]):(i[r]=e,a.push([i,r,t]))}function o(e,a,n,i,c,d,s){var u;if(d+=1,"object"===typeof e&&null!==e){for(u=0;us.depthLimit)return void f(t,e,a,c);if("undefined"!==typeof s.edgesLimit&&n+1>s.edgesLimit)return void f(t,e,a,c);if(i.push(e),Array.isArray(e))for(u=0;ut?1:0}function s(e,t,r,c){"undefined"===typeof c&&(c=i());var f,o=u(e,"",0,[],void 0,0,c)||e;try{f=0===n.length?JSON.stringify(o,t,r):JSON.stringify(o,b(t),r)}catch(s){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(0!==a.length){var d=a.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return f}function u(e,n,i,c,o,s,b){var h;if(s+=1,"object"===typeof e&&null!==e){for(h=0;hb.depthLimit)return void f(t,e,n,o);if("undefined"!==typeof b.edgesLimit&&i+1>b.edgesLimit)return void f(t,e,n,o);if(c.push(e),Array.isArray(e))for(h=0;h0)for(var a=0;a1&&"boolean"!==typeof t)throw new c('"allowMissing" argument must be a boolean');var r=S(e),a=r.length>0?r[0]:"",i=E("%"+a+"%",t),f=i.name,d=i.value,s=!1,u=i.alias;u&&(a=u[0],w(r,y([0,1],u)));for(var b=1,h=!0;b=r.length){var v=o(d,l);h=!!v,d=h&&"get"in v&&!("originalValue"in v.get)?v.get:d[l]}else h=g(d,l),d=d[l];h&&!s&&(p[f]=d)}}return d}},15743:function(e,t,r){var a;a="undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:"undefined"!==typeof self?self:{},e.exports=a},82763:function(e,t,r){"use strict";var a="undefined"!==typeof Symbol&&Symbol,n=r(33994);e.exports=function(){return"function"===typeof a&&("function"===typeof Symbol&&("symbol"===typeof a("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"),r=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(r))return!1;var a=42;for(t in e[t]=a,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!==a||!0!==i.enumerable)return!1}return!0}},92582:function(e,t,r){"use strict";var a=r(33994);e.exports=function(){return a()&&!!Symbol.toStringTag}},5769:function(e,t,r){"use strict";var a=r(49148);e.exports=a.call(Function.call,Object.prototype.hasOwnProperty)},10761:function(e,t,r){"use strict";r(21703);var a=r(17662).Buffer,n=r(98141).Transform,i=r(81923);function c(e,t){if(!a.isBuffer(e)&&"string"!==typeof e)throw new TypeError(t+" must be a string or a buffer")}function f(e){n.call(this),this._block=a.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,r){var a=null;try{this.update(e,t)}catch(n){a=n}r(a)},f.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(r){t=r}e(t)},f.prototype.update=function(e,t){if(c(e,"Data"),this._finalized)throw new Error("Digest already called");a.isBuffer(e)||(e=a.from(e,t));var r=this._block,n=0;while(this._blockOffset+e.length-n>=this._blockSize){for(var i=this._blockOffset;i0;++f)this._length[f]+=o,o=this._length[f]/4294967296|0,o>0&&(this._length[f]-=4294967296*o);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 r=0;r<4;++r)this._length[r]=0;return t},f.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=f},17662:function(e,t,r){r(21703); /*! safe-buffer. MIT License. Feross Aboukhadijeh */ var a=r(15361),n=a.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function c(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=a:(i(a,t),t.Buffer=c),c.prototype=Object.create(n.prototype),i(n,c),c.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},c.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var a=n(e);return void 0!==t?"string"===typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},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 a.SlowBuffer(e)}},78730:function(e,t,r){var a=t;a.utils=r(13610),a.common=r(79291),a.sha=r(52762),a.ripemd=r(97),a.hmac=r(4133),a.sha1=a.sha.sha1,a.sha256=a.sha.sha256,a.sha224=a.sha.sha224,a.sha384=a.sha.sha384,a.sha512=a.sha.sha512,a.ripemd160=a.ripemd.ripemd160},79291:function(e,t,r){"use strict";var a=r(13610),n=r(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=a.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 r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=a.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,a[n++]=e>>>16&255,a[n++]=e>>>8&255,a[n++]=255&e}else for(a[n++]=255&e,a[n++]=e>>>8&255,a[n++]=e>>>16&255,a[n++]=e>>>24&255,a[n++]=0,a[n++]=0,a[n++]=0,a[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 b(e){return n(e,17)^n(e,19)^e>>>10}t.ft_1=i,t.ch32=c,t.maj32=f,t.p32=o,t.s0_256=d,t.s1_256=s,t.g0_256=u,t.g1_256=b},13610:function(e,t,r){"use strict";var a=r(14961),n=r(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 r=[];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,r[a++]=63&c|128):i(e,n)?(c=65536+((1023&c)<<10)+(1023&e.charCodeAt(++n)),r[a++]=c>>18|240,r[a++]=c>>12&63|128,r[a++]=c>>6&63|128,r[a++]=63&c|128):(r[a++]=c>>12|224,r[a++]=c>>6&63|128,r[a++]=63&c|128)}else for(n=0;n>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24;return t>>>0}function d(e,t){for(var r="",a=0;a>>0}return c}function h(e,t){for(var r=new Array(4*e.length),a=0,n=0;a>>24,r[n+1]=i>>>16&255,r[n+2]=i>>>8&255,r[n+3]=255&i):(r[n+3]=i>>>24,r[n+2]=i>>>16&255,r[n+1]=i>>>8&255,r[n]=255&i)}return r}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,r){return e+t+r>>>0}function v(e,t,r,a){return e+t+r+a>>>0}function g(e,t,r,a,n){return e+t+r+a+n>>>0}function y(e,t,r,a){var n=e[t],i=e[t+1],c=a+i>>>0,f=(c>>0,e[t+1]=c}function w(e,t,r,a){var n=t+a>>>0,i=(n>>0}function M(e,t,r,a){var n=t+a;return n>>>0}function _(e,t,r,a,n,i,c,f){var o=0,d=t;d=d+a>>>0,o+=d>>0,o+=d>>0,o+=d>>0}function k(e,t,r,a,n,i,c,f){var o=t+a+i+f;return o>>>0}function A(e,t,r,a,n,i,c,f,o,d){var s=0,u=t;u=u+a>>>0,s+=u>>0,s+=u>>0,s+=u>>0,s+=u>>0}function S(e,t,r,a,n,i,c,f,o,d){var s=t+a+i+f+d;return s>>>0}function E(e,t,r){var a=t<<32-r|e>>>r;return a>>>0}function T(e,t,r){var a=e<<32-r|t>>>r;return a>>>0}function P(e,t,r){return e>>>r}function I(e,t,r){var a=e<<32-r|t>>>r;return a>>>0}t.inherits=n,t.toArray=c,t.toHex=f,t.htonl=o,t.toHex32=d,t.zero2=s,t.zero8=u,t.join32=b,t.split32=h,t.rotr32=l,t.rotl32=p,t.sum32=x,t.sum32_3=m,t.sum32_4=v,t.sum32_5=g,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=T,t.shr64_hi=P,t.shr64_lo=I},72570:function(e,t,r){"use strict";r(21703);var a=r(78730),n=r(26605),i=r(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"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),a=n.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,a)}e.exports=c,c.prototype._init=function(e,t,r){var a=e.concat(t).concat(r);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(r||[])),this._reseed=1},c.prototype.generate=function(e,t,r,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(a=r,r=t,t=null),r&&(r=n.toArray(r,a||"hex"),this._update(r));var i=[];while(i.length=196608?r>=917760&&r<=917999?18874368:0:e[t[r>>4]][15&r]}return{mapStr:r,mapChar:a}}))},63304:function(e,t,r){"use strict";r(21703);const a=2147483647,n=36,i=1,c=26,f=38,o=700,d=72,s=128,u="-",b=/^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,v=String.fromCharCode;function g(e){throw new RangeError(p[e])}function y(e,t){const r=[];let a=e.length;while(a--)r[a]=t(e[a]);return r}function w(e,t){const r=e.split("@");let a="";r.length>1&&(a=r[0]+"@",e=r[1]),e=e.replace(l,".");const n=e.split("."),i=y(n,t).join(".");return a+i}function M(e){const t=[];let r=0;const a=e.length;while(r=55296&&n<=56319&&rString.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,r){let a=0;for(e=r?m(e/o):e>>1,e+=m(e/t);e>x*c>>1;a+=n)e=m(e/x);return m(a+(x+1)*e/(e+f))},E=function(e){const t=[],r=e.length;let f=0,o=s,b=d,h=e.lastIndexOf(u);h<0&&(h=0);for(let a=0;a=128&&g("not-basic"),t.push(e.charCodeAt(a));for(let d=h>0?h+1:0;d=r&&g("invalid-input");const s=k(e.charCodeAt(d++));(s>=n||s>m((a-f)/t))&&g("overflow"),f+=s*t;const u=o<=b?i:o>=b+c?c:o-b;if(sm(a/h)&&g("overflow"),t*=h}const u=t.length+1;b=S(f-s,u,0==s),m(f/u)>a-o&&g("overflow"),o+=m(f/u),f%=u,t.splice(f++,0,o)}return String.fromCodePoint(...t)},T=function(e){const t=[];e=M(e);let r=e.length,f=s,o=0,b=d;for(const a of e)a<128&&t.push(v(a));let h=t.length,l=h;h&&t.push(u);while(l=f&&tm((a-o)/d)&&g("overflow"),o+=(r-f)*d,f=r;for(const s of e)if(sa&&g("overflow"),s==f){let e=o;for(let r=n;;r+=n){const a=r<=b?i:r>=b+c?c:r-b;if(e>23,b=s>>21&3,h=s>>5&65535,l=31&s,p=t.mapStr.substr(h,l);if(0===b||a&&1&u)throw new Error("Illegal char "+d);1===b?i.push(p):2===b?i.push(n?p:d):3===b&&i.push(d)}var x=i.join("").normalize("NFC");return x}function a(t,a,i){void 0===i&&(i=!1);var c=r(t,i,a),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,a),t})),f.join(".")}function n(e,a,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(r(e,a,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,r){void 0===r&&(r={});var n,i=!("transitional"in r)||r.transitional,c="useStd3ASCII"in r&&r.useStd3ASCII,f="verifyDnsLength"in r&&r.verifyDnsLength,o=a(t,i,c).split("."),d=o.map(e.toASCII),s=d.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: "+u)}}return s}function c(e,t){void 0===t&&(t={});var r="useStd3ASCII"in t&&t.useStd3ASCII;return a(e,!1,r)}return{toUnicode:c,toAscii:i}}))},27055:function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,r,a,n){var i,c,f=8*n-a-1,o=(1<>1,s=-7,u=r?n-1:0,b=r?-1:1,h=e[t+u];for(u+=b,i=h&(1<<-s)-1,h>>=-s,s+=f;s>0;i=256*i+e[t+u],u+=b,s-=8);for(c=i&(1<<-s)-1,i>>=-s,s+=a;s>0;c=256*c+e[t+u],u+=b,s-=8);if(0===i)i=1-d;else{if(i===o)return c?NaN:1/0*(h?-1:1);c+=Math.pow(2,a),i-=d}return(h?-1:1)*c*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var c,f,o,d=8*i-n-1,s=(1<>1,b=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,l=a?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*(o=Math.pow(2,-c))<1&&(c--,o*=2),t+=c+u>=1?b/o:b*Math.pow(2,1-u),t*o>=2&&(c++,o/=2),c+u>=s?(f=0,c=s):c+u>=1?(f=(t*o-1)*Math.pow(2,n),c+=u):(f=t*Math.pow(2,u-1)*Math.pow(2,n),c=0));n>=8;e[r+h]=255&f,h+=l,f/=256,n-=8);for(c=c<0;e[r+h]=255&c,h+=l,c/=256,d-=8);e[r+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 r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},32773:function(e,t,r){"use strict";var a=r(92582)(),n=r(15477),i=n("Object.prototype.toString"),c=function(e){return!(a&&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)},o=function(){return c(arguments)}();c.isLegacyArguments=f,e.exports=o?c:f},43940:function(e){e.exports=r;var t=Object.prototype.toString;function r(e){if(!e)return!1;var r=t.call(e);return"[object Function]"===r||"function"===typeof e&&"[object RegExp]"!==r||"undefined"!==typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}},84784:function(e,t,r){"use strict";var a,n=Object.prototype.toString,i=Function.prototype.toString,c=/^\s*(?:function)?\*/,f=r(92582)(),o=Object.getPrototypeOf,d=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(!o)return!1;if("undefined"===typeof a){var r=d();a=!!r&&o(r)}return o(e)===a}},44866:function(e,t,r){r(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,r){"use strict";var a=r(98625),n=r(24647),i=r(15477),c=i("Object.prototype.toString"),f=r(92582)(),o="undefined"===typeof globalThis?r.g:globalThis,d=n(),s=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r-1}return!!h&&p(e)}},6513:function(e,t,r){r(48675),r(3462),e.exports=i,i.strict=c,i.loose=f;var a=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[a.call(e)]}},69893:function(e,t,r){var a,n=r(96027);r(21703),r(48675),r(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,o=f?window:{};o.JS_SHA3_NO_WINDOW&&(f=!1);var d=!f&&"object"===typeof self,s=!o.JS_SHA3_NO_NODE_JS&&"object"===typeof n&&n.versions&&n.versions.node;s?o=r.g:d&&(o=self);var u=!o.JS_SHA3_NO_COMMON_JS&&e.exports,b=r.amdO,h=!o.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],v=[6,1536,393216,100663296],g=[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};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!o.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,r){return function(a){return new z(e,t,e).update(a)[r]()}},S=function(e,t,r){return function(a,n){return new z(e,t,n).update(a)[r]()}},E=function(e,t,r){return function(t,a,n,i){return N["cshake"+e].update(t,a,n,i)[r]()}},T=function(e,t,r){return function(t,a,n,i){return N["kmac"+e].update(t,a,n,i)[r]()}},P=function(e,t,r,a){for(var n=0;n<_.length;++n){var i=_[n];e[i]=t(r,a,i)}return e},I=function(e,t){var r=A(e,t,"hex");return r.create=function(){return new z(e,t,e)},r.update=function(e){return r.create().update(e)},P(r,A,e,t)},B=function(e,t){var r=S(e,t,"hex");return r.create=function(r){return new z(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},P(r,S,e,t)},C=function(e,t){var r=k[e],a=E(e,t,"hex");return a.create=function(a,n,i){return n||i?new z(e,t,a).bytepad([n,i],r):N["shake"+e].create(a)},a.update=function(e,t,r,n){return a.create(t,r,n).update(e)},P(a,E,e,t)},O=function(e,t){var r=k[e],a=T(e,t,"hex");return a.create=function(a,n,i){return new K(e,t,n).bytepad(["KMAC",i],r).bytepad([a],r)},a.update=function(e,t,r,n){return a.create(e,r,n).update(t)},P(a,T,e,t)},R=[{name:"keccak",padding:m,bits:w,createMethod:I},{name:"sha3",padding:v,bits:w,createMethod:I},{name:"shake",padding:p,bits:M,createMethod:B},{name:"cshake",padding:x,bits:M,createMethod:C},{name:"kmac",padding:x,bits:M,createMethod:O}],N={},L=[],U=0;U>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var a=0;a<50;++a)this.s[a]=0}function K(e,t,r){z.call(this,e,t,r)}z.prototype.update=function(e){if(this.finalized)throw new Error(c);var t,r=typeof e;if("string"!==r){if("object"!==r)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 a,n,f=this.blocks,o=this.byteCount,d=e.length,s=this.blockCount,u=0,b=this.s;while(u>2]|=e[u]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(f[a>>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)<=o){for(this.start=a-o,this.block=f[s],a=0;a>=8,r=255&e;while(r>0)n.unshift(r),e>>=8,r=255&e,++a;return t?n.push(a):n.unshift(a),this.update(n),n.length},z.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)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 a=0,n=e.length;if(t)a=n;else for(var c=0;c=57344?a+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++c)),a+=4)}return a+=this.encode(8*a),this.update(e),a},z.prototype.bytepad=function(e,t){for(var r=this.encode(t),a=0;a>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],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&&(W(r),i=0)}return n&&(e=r[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,r=this.s,a=this.outputBlocks,n=this.extraBytes,i=0,c=0,f=this.outputBits>>3;e=n?new ArrayBuffer(a+1<<2):new ArrayBuffer(f);var o=new Uint32Array(e);while(c>8&255,o[e+2]=t>>16&255,o[e+3]=t>>24&255;f%r===0&&W(a)}return i&&(e=f<<2,t=a[c],o[e]=255&t,i>1&&(o[e+1]=t>>8&255),i>2&&(o[e+2]=t>>16&255)),o},K.prototype=new z,K.prototype.finalize=function(){return this.encode(this.outputBits,!0),z.prototype.finalize.call(this)};var W=function(e){var t,r,a,n,i,c,f,o,d,s,u,b,h,l,p,x,m,v,g,w,M,_,k,A,S,E,T,P,I,B,C,O,R,N,L,U,j,F,D,H,q,z,K,W,G,V,Z,$,J,Y,X,Q,ee,te,re,ae,ne,ie,ce,fe,oe,de,se;for(a=0;a<48;a+=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],o=e[4]^e[14]^e[24]^e[34]^e[44],d=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],b=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49],t=b^(c<<1|f>>>31),r=h^(f<<1|c>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=n^(o<<1|d>>>31),r=i^(d<<1|o>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=c^(s<<1|u>>>31),r=f^(u<<1|s>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=o^(b<<1|h>>>31),r=d^(h<<1|b>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=s^(n<<1|i>>>31),r=u^(i<<1|n>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,l=e[0],p=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,oe=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,L=e[3]<<1|e[2]>>>31,x=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ae=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,D=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=l^~x&v,e[1]=p^~m&g,e[10]=A^~E&P,e[11]=S^~T&I,e[20]=N^~U&F,e[21]=L^~j&D,e[30]=W^~V&$,e[31]=G^~Z&J,e[40]=te^~ae&ie,e[41]=re^~ne&ce,e[2]=x^~v&w,e[3]=m^~g&M,e[12]=E^~P&B,e[13]=T^~I&C,e[22]=U^~F&H,e[23]=j^~D&q,e[32]=V^~$&Y,e[33]=Z^~J&X,e[42]=ae^~ie&fe,e[43]=ne^~ce&oe,e[4]=v^~w&_,e[5]=g^~M&k,e[14]=P^~B&O,e[15]=I^~C&R,e[24]=F^~H&z,e[25]=D^~q&K,e[34]=$^~Y&Q,e[35]=J^~X&ee,e[44]=ie^~fe&de,e[45]=ce^~oe&se,e[6]=w^~_&l,e[7]=M^~k&p,e[16]=B^~O&A,e[17]=C^~R&S,e[26]=H^~z&N,e[27]=q^~K&L,e[36]=Y^~Q&W,e[37]=X^~ee&G,e[46]=fe^~de&te,e[47]=oe^~se&re,e[8]=_^~l&x,e[9]=k^~p&m,e[18]=O^~A&E,e[19]=R^~S&T,e[28]=z^~N&U,e[29]=K^~L&j,e[38]=Q^~W&V,e[39]=ee^~G&Z,e[48]=de^~te&ae,e[49]=se^~re&ne,e[0]^=y[a],e[1]^=y[a+1]};if(u)e.exports=N;else{for(U=0;U{try{const[n,i,f]=await c._runAllMiddleware(e,t,this._middleware);return i?(await c._runReturnHandlers(f),a(n)):r((async e=>{try{await c._runReturnHandlers(f)}catch(t){return e(t)}return e()}))}catch(n){return a(n)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(r){if(t)return t(r);throw r}}_promiseHandle(e){return new Promise((t=>{this._handle(e,((e,r)=>{t(r)}))}))}async _handle(e,t){if(!e||Array.isArray(e)||"object"!==typeof e){const r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!==typeof e.method){const r=new i.EthereumRpcError(i.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},e),a={id:r.id,jsonrpc:r.jsonrpc};let n=null;try{await this._processRequest(r,a)}catch(c){n=c}return n&&(delete a.result,a.error||(a.error=i.serializeError(n))),t(n,a)}async _processRequest(e,t){const[r,a,n]=await c._runAllMiddleware(e,t,this._middleware);if(c._checkForCompletion(e,t,a),await c._runReturnHandlers(n),r)throw r}static async _runAllMiddleware(e,t,r){const a=[];let n=null,i=!1;for(const f of r)if([n,i]=await c._runMiddleware(e,t,f,a),i)break;return[n,i,a.reverse()]}static _runMiddleware(e,t,r,a){return new Promise((n=>{const c=e=>{const r=e||t.error;r&&(t.error=i.serializeError(r)),n([r,!0])},o=r=>{t.error?c(t.error):(r&&("function"!==typeof r&&c(new i.EthereumRpcError(i.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${f(e)}`,{request:e})),a.push(r)),n([null,!1]))};try{r(e,t,o,c)}catch(d){c(d)}}))}static async _runReturnHandlers(e){for(const t of e)await new Promise(((e,r)=>{t((t=>t?r(t):e()))}))}static _checkForCompletion(e,t,r){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(!r)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 r(e){return async(t,r,a,n)=>{let i;const c=new Promise((e=>{i=e}));let f=null,o=!1;const d=async()=>{o=!0,a((e=>{f=e,i()})),await c};try{await e(t,r,d),o?(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=r},79430:function(e,t){"use strict";function r(e){return(t,r,a,n)=>{const i=e[t.method];return void 0===i?a():"function"===typeof i?i(t,r,a,n):(r.result=i,n())}}Object.defineProperty(t,"__esModule",{value:!0}),t.createScaffoldMiddleware=void 0,t.createScaffoldMiddleware=r},80321:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;const r=4294967295;let a=Math.floor(Math.random()*r);function n(){return a=(a+1)%r,a}t.getUniqueId=n},71298:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdRemapMiddleware=void 0;const a=r(80321);function n(){return(e,t,r,n)=>{const i=e.id,c=a.getUniqueId();e.id=c,t.id=c,r((r=>{e.id=i,t.id=i,r()}))}}t.createIdRemapMiddleware=n},2482:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(71298),t),n(r(26993),t),n(r(79430),t),n(r(80321),t),n(r(71222),t),n(r(33848),t)},33848:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMiddleware=void 0;const a=r(71222);function n(e){const t=new a.JsonRpcEngine;return e.forEach((e=>t.push(e))),t.asMiddleware()}t.mergeMiddleware=n},29648:function(e,t,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const a=r(25383);class n extends Error{constructor(e,t,r){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!==r&&(this.data=r)}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 a.default(this.serialize(),f,2)}}t.EthereumRpcError=n;class i extends n{constructor(e,t,r){if(!c(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}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,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const a=r(29648),n=r(10696),i=r(14668);function c(e,t){const[r,i]=o(t);return new a.EthereumRpcError(e,r||n.getMessageFromCode(e),i)}function f(e,t){const[r,i]=o(t);return new a.EthereumProviderError(e,r||n.getMessageFromCode(e),i)}function o(e){if(e){if("string"===typeof e)return[e];if("object"===typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!==typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}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:r,data:n}=e;if(!r||"string"!==typeof r)throw new Error('"message" must be a nonempty string');return new a.EthereumProviderError(t,r,n)}}}},86901:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const a=r(29648);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return a.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return a.EthereumProviderError}});const n=r(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=r(43791);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return i.ethErrors}});const c=r(14668);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return c.errorCodes}})},10696:function(e,t,r){"use strict";r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const a=r(14668),n=r(29648),i=a.errorCodes.rpc.internal,c="Unspecified error message. This is a bug, please report it.",f={code:i,message:o(i)};function o(e,r=c){if(Number.isInteger(e)){const r=e.toString();if(h(a.errorValues,r))return a.errorValues[r].message;if(u(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function d(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!a.errorValues[t]||!!u(e)}function s(e,{fallbackError:t=f,shouldIncludeStack:r=!1}={}){var a,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")&&d(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=o(c.code),c.data={originalError:b(e)})}else{c.code=t.code;const r=null===(a=e)||void 0===a?void 0:a.message;c.message=r&&"string"===typeof r?r:t.message,c.data={originalError:b(e)}}const s=null===(i=e)||void 0===i?void 0:i.stack;return r&&e&&s&&"string"===typeof s&&(c.stack=s),c}function u(e){return e>=-32099&&e<=-32e3}function b(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=o,t.isValidCode=d,t.serializeError=s},21770:function(e){function t(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r="undefined"!==typeof e.start?e.start:Math.floor(Math.random()*t);return function(){return r%=t,r++}}e.exports=t},40391:function(e,t,r){r(21703);var a="undefined"!==typeof JSON?JSON:r(34286);e.exports=function(e,t){t||(t={}),"function"===typeof t&&(t={cmp:t});var r=t.space||"";"number"===typeof r&&(r=Array(r+1).join(" "));var c="boolean"===typeof t.cycles&&t.cycles,f=t.replacer||function(e,t){return t},o=t.cmp&&function(e){return function(t){return function(r,a){var n={key:r,value:t[r]},i={key:a,value:t[a]};return e(n,i)}}}(t.cmp),d=[];return function e(t,s,u,b){var h=r?"\n"+new Array(b+1).join(r):"",l=r?": ":":";if(u&&u.toJSON&&"function"===typeof u.toJSON&&(u=u.toJSON()),u=f.call(t,s,u),void 0!==u){if("object"!==typeof u||null===u)return a.stringify(u);if(n(u)){for(var p=[],x=0;x="0"&&r<="9")t+=r,f();if("."===r){t+=".";while(f()&&r>="0"&&r<="9")t+=r}if("e"===r||"E"===r){t+=r,f(),"-"!==r&&"+"!==r||(t+=r,f());while(r>="0"&&r<="9")t+=r,f()}if(e=+t,isFinite(e))return e;c("Bad number")},d=function(){var e,t,a,n="";if('"'===r)while(f()){if('"'===r)return f(),n;if("\\"===r)if(f(),"u"===r){for(a=0,t=0;t<4;t+=1){if(e=parseInt(f(),16),!isFinite(e))break;a=16*a+e}n+=String.fromCharCode(a)}else{if("string"!==typeof i[r])break;n+=i[r]}else n+=r}c("Bad string")},s=function(){while(r&&r<=" ")f()},u=function(){switch(r){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 '"+r+"'")},b=function(){var e=[];if("["===r){if(f("["),s(),"]"===r)return f("]"),e;while(r){if(e.push(n()),s(),"]"===r)return f("]"),e;f(","),s()}}c("Bad array")},h=function(){var e,t={};if("{"===r){if(f("{"),s(),"}"===r)return f("}"),t;while(r){if(e=d(),s(),f(":"),Object.hasOwnProperty.call(t,e)&&c('Duplicate key "'+e+'"'),t[e]=n(),s(),"}"===r)return f("}"),t;f(","),s()}}c("Bad object")};n=function(){switch(s(),r){case"{":return h();case"[":return b();case'"':return d();case"-":return o();default:return r>="0"&&r<="9"?o():u()}},e.exports=function(e,i){var f;return a=e,t=0,r=" ",f=n(),s(),r&&c("Syntax error"),"function"===typeof i?function e(t,r){var a,n,c=t[r];if(c&&"object"===typeof c)for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(n=e(c,a),void 0!==n?c[a]=n:delete c[a]);return i.call(t,r,c)}({"":f},""):f}},69185:function(e,t,r){r(21703);var a,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 o(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 d(e,t){var r,c,f,s,u,b=a,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 o(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(a+=n,u=[],"[object Array]"===Object.prototype.toString.apply(h)){for(s=h.length,r=0;rclass t extends n{constructor(t,r,a,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=a,this._hashBitLength=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let a=null;try{this.update(e,t)}catch(n){a=n}r(a)}_flush(e){let t=null;try{this.push(this.digest())}catch(r){t=r}e(t)}update(e,t){if(!a.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 a.isBuffer(e)||(e=a.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,r){var a=r(15361)["Buffer"];r(21703);const{Transform:n}=r(98141);e.exports=e=>class t extends n{constructor(t,r,a,n){super(n),this._rate=t,this._capacity=r,this._delimitedSuffix=a,this._options=n,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let a=null;try{this.update(e,t)}catch(n){a=n}r(a)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!a.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 a.isBuffer(e)||(e=a.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_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 r=[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 a=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],o=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],b=e[9]^e[19]^e[29]^e[39]^e[49];let h=u^(i<<1|c>>>31),l=b^(c<<1|i>>>31);const p=e[0]^h,x=e[1]^l,m=e[10]^h,v=e[11]^l,g=e[20]^h,y=e[21]^l,w=e[30]^h,M=e[31]^l,_=e[40]^h,k=e[41]^l;h=a^(f<<1|o>>>31),l=n^(o<<1|f>>>31);const A=e[2]^h,S=e[3]^l,E=e[12]^h,T=e[13]^l,P=e[22]^h,I=e[23]^l,B=e[32]^h,C=e[33]^l,O=e[42]^h,R=e[43]^l;h=i^(d<<1|s>>>31),l=c^(s<<1|d>>>31);const N=e[4]^h,L=e[5]^l,U=e[14]^h,j=e[15]^l,F=e[24]^h,D=e[25]^l,H=e[34]^h,q=e[35]^l,z=e[44]^h,K=e[45]^l;h=f^(u<<1|b>>>31),l=o^(b<<1|u>>>31);const W=e[6]^h,G=e[7]^l,V=e[16]^h,Z=e[17]^l,$=e[26]^h,J=e[27]^l,Y=e[36]^h,X=e[37]^l,Q=e[46]^h,ee=e[47]^l;h=d^(a<<1|n>>>31),l=s^(n<<1|a>>>31);const te=e[8]^h,re=e[9]^l,ae=e[18]^h,ne=e[19]^l,ie=e[28]^h,ce=e[29]^l,fe=e[38]^h,oe=e[39]^l,de=e[48]^h,se=e[49]^l,ue=p,be=x,he=v<<4|m>>>28,le=m<<4|v>>>28,pe=g<<3|y>>>29,xe=y<<3|g>>>29,me=M<<9|w>>>23,ve=w<<9|M>>>23,ge=_<<18|k>>>14,ye=k<<18|_>>>14,we=A<<1|S>>>31,Me=S<<1|A>>>31,_e=T<<12|E>>>20,ke=E<<12|T>>>20,Ae=P<<10|I>>>22,Se=I<<10|P>>>22,Ee=C<<13|B>>>19,Te=B<<13|C>>>19,Pe=O<<2|R>>>30,Ie=R<<2|O>>>30,Be=L<<30|N>>>2,Ce=N<<30|L>>>2,Oe=U<<6|j>>>26,Re=j<<6|U>>>26,Ne=D<<11|F>>>21,Le=F<<11|D>>>21,Ue=H<<15|q>>>17,je=q<<15|H>>>17,Fe=K<<29|z>>>3,De=z<<29|K>>>3,He=W<<28|G>>>4,qe=G<<28|W>>>4,ze=Z<<23|V>>>9,Ke=V<<23|Z>>>9,We=$<<25|J>>>7,Ge=J<<25|$>>>7,Ve=Y<<21|X>>>11,Ze=X<<21|Y>>>11,$e=ee<<24|Q>>>8,Je=Q<<24|ee>>>8,Ye=te<<27|re>>>5,Xe=re<<27|te>>>5,Qe=ae<<20|ne>>>12,et=ne<<20|ae>>>12,tt=ce<<7|ie>>>25,rt=ie<<7|ce>>>25,at=fe<<8|oe>>>24,nt=oe<<8|fe>>>24,it=de<<14|se>>>18,ct=se<<14|de>>>18;e[0]=ue^~_e&Ne,e[1]=be^~ke&Le,e[10]=He^~Qe&pe,e[11]=qe^~et&xe,e[20]=we^~Oe&We,e[21]=Me^~Re&Ge,e[30]=Ye^~he&Ae,e[31]=Xe^~le&Se,e[40]=Be^~ze&tt,e[41]=Ce^~Ke&rt,e[2]=_e^~Ne&Ve,e[3]=ke^~Le&Ze,e[12]=Qe^~pe&Ee,e[13]=et^~xe&Te,e[22]=Oe^~We&at,e[23]=Re^~Ge&nt,e[32]=he^~Ae&Ue,e[33]=le^~Se&je,e[42]=ze^~tt&me,e[43]=Ke^~rt&ve,e[4]=Ne^~Ve&it,e[5]=Le^~Ze&ct,e[14]=pe^~Ee&Fe,e[15]=xe^~Te&De,e[24]=We^~at&ge,e[25]=Ge^~nt&ye,e[34]=Ae^~Ue&$e,e[35]=Se^~je&Je,e[44]=tt^~me&Pe,e[45]=rt^~ve&Ie,e[6]=Ve^~it&ue,e[7]=Ze^~ct&be,e[16]=Ee^~Fe&He,e[17]=Te^~De&qe,e[26]=at^~ge&we,e[27]=nt^~ye&Me,e[36]=Ue^~$e&Ye,e[37]=je^~Je&Xe,e[46]=me^~Pe&Be,e[47]=ve^~Ie&Ce,e[8]=it^~ue&_e,e[9]=ct^~be&ke,e[18]=Fe^~He&Qe,e[19]=De^~qe&et,e[28]=ge^~we&Oe,e[29]=ye^~Me&Re,e[38]=$e^~Ye&he,e[39]=Je^~Xe&le,e[48]=Pe^~Be&ze,e[49]=Ie^~Ce&Ke,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},79464:function(e,t,r){var a=r(15361)["Buffer"];const n=r(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 r=0;r<50;++r)this.state[r]=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},41552:function(){(function(e,t){var r,a=e.document,n=a.documentElement,i=a.querySelector('meta[name="viewport"]'),c=a.querySelector('meta[name="flexible"]'),f=0,o=0,d=t.flexible||(t.flexible={});if(i){console.warn("将根据已有的meta标签来设置缩放比例");var s=i.getAttribute("content").match(/initial\-scale=([\d\.]+)/);s&&(o=parseFloat(s[1]),f=parseInt(1/o))}else if(c){var u=c.getAttribute("content");if(u){var b=u.match(/initial\-dpr=([\d\.]+)/),h=u.match(/maximum\-dpr=([\d\.]+)/);b&&(f=parseFloat(b[1]),o=parseFloat((1/f).toFixed(2))),h&&(f=parseFloat(h[1]),o=parseFloat((1/f).toFixed(2)))}}if(!f&&!o){e.navigator.appVersion.match(/android/gi);var l=e.navigator.appVersion.match(/iphone/gi),p=e.devicePixelRatio;f=l?p>=3&&(!f||f>=3)?3:p>=2&&(!f||f>=2)?2:1:1,o=1/f}if(n.setAttribute("data-dpr",f),!i)if(i=a.createElement("meta"),i.setAttribute("name","viewport"),i.setAttribute("content","initial-scale="+o+", maximum-scale="+o+", minimum-scale="+o+", user-scalable=no"),n.firstElementChild)n.firstElementChild.appendChild(i);else{var x=a.createElement("div");x.appendChild(i),a.write(x.innerHTML)}function m(){var t=n.getBoundingClientRect().width;t/f>540&&(t=540*f);var r=t/10;n.style.fontSize=r+"px",d.rem=e.rem=r}e.addEventListener("resize",(function(){clearTimeout(r),r=setTimeout(m,300)}),!1),e.addEventListener("pageshow",(function(e){e.persisted&&(clearTimeout(r),r=setTimeout(m,300))}),!1),"complete"===a.readyState?a.body.style.fontSize=12*f+"px":a.addEventListener("DOMContentLoaded",(function(e){a.body.style.fontSize=12*f+"px"}),!1),m(),d.dpr=e.dpr=f,d.refreshRem=m,d.rem2px=function(e){var t=parseFloat(e)*this.rem;return"string"===typeof e&&e.match(/rem$/)&&(t+="px"),t},d.px2rem=function(e){var t=parseFloat(e)/this.rem;return"string"===typeof e&&e.match(/px$/)&&(t+="rem"),t}})(window,window["lib"]||(window["lib"]={}))},99016:function(e,t,r){var a=r(69159),n=a.Symbol;e.exports=n},7498:function(e,t,r){var a=r(52802),n=r(68804),i=r(26602),c=r(21976),f=r(38286),o=r(56965),d=Object.prototype,s=d.hasOwnProperty;function u(e,t){var r=i(e),d=!r&&n(e),u=!r&&!d&&c(e),b=!r&&!d&&!u&&o(e),h=r||d||u||b,l=h?a(e.length,String):[],p=l.length;for(var x in e)!t&&!s.call(e,x)||h&&("length"==x||u&&("offset"==x||"parent"==x)||b&&("buffer"==x||"byteLength"==x||"byteOffset"==x)||f(x,p))||l.push(x);return l}e.exports=u},96423:function(e,t,r){var a=r(99016),n=r(52366),i=r(52886),c="[object Null]",f="[object Undefined]",o=a?a.toStringTag:void 0;function d(e){return null==e?void 0===e?f:c:o&&o in Object(e)?n(e):i(e)}e.exports=d},29986:function(e,t,r){var a=r(96423),n=r(74430),i="[object Arguments]";function c(e){return n(e)&&a(e)==i}e.exports=c},86930:function(e,t,r){var a=r(96423),n=r(84629),i=r(74430),c="[object Arguments]",f="[object Array]",o="[object Boolean]",d="[object Date]",s="[object Error]",u="[object Function]",b="[object Map]",h="[object Number]",l="[object Object]",p="[object RegExp]",x="[object Set]",m="[object String]",v="[object WeakMap]",g="[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]",T="[object Uint16Array]",P="[object Uint32Array]",I={};function B(e){return i(e)&&n(e.length)&&!!I[a(e)]}I[w]=I[M]=I[_]=I[k]=I[A]=I[S]=I[E]=I[T]=I[P]=!0,I[c]=I[f]=I[g]=I[o]=I[y]=I[d]=I[s]=I[u]=I[b]=I[h]=I[l]=I[p]=I[x]=I[m]=I[v]=!1,e.exports=B},841:function(e,t,r){var a=r(9192),n=r(47348),i=Object.prototype,c=i.hasOwnProperty;function f(e){if(!a(e))return n(e);var t=[];for(var r in Object(e))c.call(e,r)&&"constructor"!=r&&t.push(r);return t}e.exports=f},52802:function(e){function t(e,t){var r=-1,a=Array(e);while(++r-1&&e%1==0&&e-1&&e%1==0&&e<=t}e.exports=r},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,r){var a=r(86930),n=r(87362),i=r(71330),c=i&&i.isTypedArray,f=c?n(c):a;e.exports=f},24337:function(e,t,r){var a=r(7498),n=r(841),i=r(45372);function c(e){return i(e)?a(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,r){"use strict";var a=r(81923),n=r(10761),i=r(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 o(e,t){return e<>>32-t}function d(e,t,r,a,n,i,c){return o(e+(t&r|~t&a)+n+i|0,c)+t|0}function s(e,t,r,a,n,i,c){return o(e+(t&a|r&~a)+n+i|0,c)+t|0}function u(e,t,r,a,n,i,c){return o(e+(t^r^a)+n+i|0,c)+t|0}function b(e,t,r,a,n,i,c){return o(e+(r^(t|~a))+n+i|0,c)+t|0}a(f,n),f.prototype._update=function(){for(var e=c,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,a=this._b,n=this._c,i=this._d;r=d(r,a,n,i,e[0],3614090360,7),i=d(i,r,a,n,e[1],3905402710,12),n=d(n,i,r,a,e[2],606105819,17),a=d(a,n,i,r,e[3],3250441966,22),r=d(r,a,n,i,e[4],4118548399,7),i=d(i,r,a,n,e[5],1200080426,12),n=d(n,i,r,a,e[6],2821735955,17),a=d(a,n,i,r,e[7],4249261313,22),r=d(r,a,n,i,e[8],1770035416,7),i=d(i,r,a,n,e[9],2336552879,12),n=d(n,i,r,a,e[10],4294925233,17),a=d(a,n,i,r,e[11],2304563134,22),r=d(r,a,n,i,e[12],1804603682,7),i=d(i,r,a,n,e[13],4254626195,12),n=d(n,i,r,a,e[14],2792965006,17),a=d(a,n,i,r,e[15],1236535329,22),r=s(r,a,n,i,e[1],4129170786,5),i=s(i,r,a,n,e[6],3225465664,9),n=s(n,i,r,a,e[11],643717713,14),a=s(a,n,i,r,e[0],3921069994,20),r=s(r,a,n,i,e[5],3593408605,5),i=s(i,r,a,n,e[10],38016083,9),n=s(n,i,r,a,e[15],3634488961,14),a=s(a,n,i,r,e[4],3889429448,20),r=s(r,a,n,i,e[9],568446438,5),i=s(i,r,a,n,e[14],3275163606,9),n=s(n,i,r,a,e[3],4107603335,14),a=s(a,n,i,r,e[8],1163531501,20),r=s(r,a,n,i,e[13],2850285829,5),i=s(i,r,a,n,e[2],4243563512,9),n=s(n,i,r,a,e[7],1735328473,14),a=s(a,n,i,r,e[12],2368359562,20),r=u(r,a,n,i,e[5],4294588738,4),i=u(i,r,a,n,e[8],2272392833,11),n=u(n,i,r,a,e[11],1839030562,16),a=u(a,n,i,r,e[14],4259657740,23),r=u(r,a,n,i,e[1],2763975236,4),i=u(i,r,a,n,e[4],1272893353,11),n=u(n,i,r,a,e[7],4139469664,16),a=u(a,n,i,r,e[10],3200236656,23),r=u(r,a,n,i,e[13],681279174,4),i=u(i,r,a,n,e[0],3936430074,11),n=u(n,i,r,a,e[3],3572445317,16),a=u(a,n,i,r,e[6],76029189,23),r=u(r,a,n,i,e[9],3654602809,4),i=u(i,r,a,n,e[12],3873151461,11),n=u(n,i,r,a,e[15],530742520,16),a=u(a,n,i,r,e[2],3299628645,23),r=b(r,a,n,i,e[0],4096336452,6),i=b(i,r,a,n,e[7],1126891415,10),n=b(n,i,r,a,e[14],2878612391,15),a=b(a,n,i,r,e[5],4237533241,21),r=b(r,a,n,i,e[12],1700485571,6),i=b(i,r,a,n,e[3],2399980690,10),n=b(n,i,r,a,e[10],4293915773,15),a=b(a,n,i,r,e[1],2240044497,21),r=b(r,a,n,i,e[8],1873313359,6),i=b(i,r,a,n,e[15],4264355552,10),n=b(n,i,r,a,e[6],2734768916,15),a=b(a,n,i,r,e[13],1309151649,21),r=b(r,a,n,i,e[4],4149444226,6),i=b(i,r,a,n,e[11],3174756917,10),n=b(n,i,r,a,e[2],718787259,15),a=b(a,n,i,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+a|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,r){var a=r(2396),n=r(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(),r=Math.ceil(t/8);do{var n=new a(this.rand.generate(r))}while(n.cmp(e)>=0);return n},i.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},i.prototype.test=function(e,t,r){var n=e.bitLength(),i=a.mont(e),c=new a(1).toRed(i);t||(t=Math.max(1,n/48|0));for(var f=e.subn(1),o=0;!f.testn(o);o++);for(var d=e.shrn(o),s=f.toRed(i),u=!0;t>0;t--){var b=this._randrange(new a(2),f);r&&r(b);var h=b.toRed(i).redPow(d);if(0!==h.cmp(c)&&0!==h.cmp(s)){for(var l=1;l0;t--){var s=this._randrange(new a(2),c),u=e.gcd(s);if(0!==u.cmpn(1))return u;var b=s.toRed(n).redPow(o);if(0!==b.cmp(i)&&0!==b.cmp(d)){for(var h=1;h>8,c=255&n;i?r.push(i,c):r.push(c)}return r}function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r=8&&(c[i++]=n>>>a-8&255,a-=8);return c.buffer}function n(e,t){const r=e.byteLength,a=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 o=0;o=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}r(48675),r(3462),r(21703),e.exports=function(e){return{encode(t){return n("string"===typeof t?Uint8Array.from(t):t,e)},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base32 character");return a(t,e)}}}},68627:function(e,t,r){"use strict";r(21703);const{Buffer:a}=r(15361);e.exports=function(e){const t=e.indexOf("=")>-1,r=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode(e){let n="";n="string"===typeof e?a.from(e).toString("base64"):e.toString("base64"),r&&(n=n.replace(/\+/g,"-").replace(/\//g,"_"));const i=n.indexOf("=");return i>0&&!t&&(n=n.substring(0,i)),n},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base64 character");return a.from(t,"base64")}}}},21985:function(e,t,r){"use strict";const a=r(91654),n=r(12516),i=r(69488),c=r(36359),f=r(68627),o=[["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-_="]],d=o.reduce(((e,t)=>(e[t[0]]=new a(t[0],t[1],t[2],t[3]),e)),{}),s=o.reduce(((e,t)=>(e[t[1]]=d[t[0]],e)),{});e.exports={names:d,codes:s}},64869:function(e,t,r){"use strict";r(21703);const{Buffer:a}=r(15361),n=r(21985);t=e.exports=c,t.encode=f,t.decode=o,t.isEncoded=d,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 r=u(e),n=a.from(r.code),i=r.name;return s(i,t),a.concat([n,t])}function f(e,t){const r=u(e),n=r.name;return c(n,a.from(r.encode(t)))}function o(e){a.isBuffer(e)&&(e=e.toString());const t=e.substring(0,1);e=e.substring(1,e.length),"string"===typeof e&&(e=a.from(e));const r=u(t);return a.from(r.decode(e.toString()))}function d(e){if(a.isBuffer(e)&&(e=e.toString()),"[object String]"!==Object.prototype.toString.call(e))return!1;const t=e.substring(0,1);try{const e=u(t);return e.name}catch(r){return!1}}function s(e,t){const r=u(e);r.decode(t.toString())}function u(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,r){"use strict";const a=r(24070),n={};for(const[i,c]of Object.entries(a))n[i.toUpperCase().replace(/-/g,"_")]=c;e.exports=Object.freeze(n)},58429:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);const n=r(42611),i=r(84644),c=r(20032),f=r(23036);t=e.exports,t.addPrefix=(e,t)=>{let r;if(a.isBuffer(e))r=f.varintBufferEncode(e);else{if(!c[e])throw new Error("multicodec not recognized");r=c[e]}return a.concat([r,t])},t.rmPrefix=e=>(n.decode(e),e.slice(n.decode.bytes)),t.getCodec=e=>{const t=n.decode(e),r=i.get(t);if(void 0===r)throw new Error(`Code ${t} not found`);return r},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 o=r(42177);Object.assign(t,o),t.print=r(96376)},84644:function(e,t,r){"use strict";const a=r(24070),n=new Map;for(const i in a){const e=a[i];n.set(e,i)}e.exports=Object.freeze(n)},96376:function(e,t,r){"use strict";const a=r(24070),n={};for(const[i,c]of Object.entries(a))void 0===n[c]&&(n[c]=i);e.exports=Object.freeze(n)},23036:function(e,t,r){"use strict";var a=r(15361)["Buffer"];const n=r(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),a.from(t,"hex")}function f(e){return a.from(n.encode(i(e)))}function o(e){return c(n.decode(e))}function d(e){return a.from(n.encode(e))}e.exports={numberToBuffer:c,bufferToNumber:i,varintBufferEncode:f,varintBufferDecode:o,varintEncode:d}},20032:function(e,t,r){"use strict";const a=r(24070),n=r(23036).varintEncode,i={};for(const c in a){const e=a[c];i[c]=n(e)}e.exports=Object.freeze(i)},42786:function(e){"use strict";class t{constructor(e,t,r,a){this.name=e,this.code=t,this.alphabet=a,r&&a&&(this.engine=r(a))}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,r){"use strict";r(21703);const{Buffer:a}=r(15361);e.exports=function(e){return{encode(e){return"string"===typeof e?a.from(e).toString("hex"):e.toString("hex")},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base16 character");return a.from(t,"hex")}}}},22059:function(e,t,r){"use strict";function a(e,t){e=e.replace(new RegExp("=","g"),"");const r=e.length;let a=0,n=0,i=0;const c=new Uint8Array(5*r/8|0);for(let f=0;f=8&&(c[i++]=n>>>a-8&255,a-=8);return c.buffer}function n(e,t){const r=e.byteLength,a=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 o=0;o=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}r(48675),r(3462),r(21703),e.exports=function(e){return{encode(t){return n("string"===typeof t?Uint8Array.from(t):t,e)},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base32 character");return a(t,e)}}}},67557:function(e,t,r){"use strict";r(21703);const{Buffer:a}=r(15361);e.exports=function(e){const t=e.indexOf("=")>-1,r=e.indexOf("-")>-1&&e.indexOf("_")>-1;return{encode(e){let n="";n="string"===typeof e?a.from(e).toString("base64"):e.toString("base64"),r&&(n=n.replace(/\+/g,"-").replace(/\//g,"_"));const i=n.indexOf("=");return i>0&&!t&&(n=n.substring(0,i)),n},decode(t){for(const r of t)if(e.indexOf(r)<0)throw new Error("invalid base64 character");return a.from(t,"base64")}}}},9005:function(e,t,r){"use strict";const a=r(42786),n=r(12516),i=r(32133),c=r(22059),f=r(67557),o=[["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-_="]],d=o.reduce(((e,t)=>(e[t[0]]=new a(t[0],t[1],t[2],t[3]),e)),{}),s=o.reduce(((e,t)=>(e[t[1]]=d[t[0]],e)),{});e.exports={names:d,codes:s}},74482:function(e,t,r){"use strict";r(21703);const{Buffer:a}=r(15361),n=r(9005);function i(e,t){if(!t)throw new Error("requires an encoded buffer");const r=s(e),n=a.from(r.code),i=r.name;return d(i,t),a.concat([n,t])}function c(e,t){const r=s(e),n=r.name;return i(n,a.from(r.encode(t)))}function f(e){a.isBuffer(e)&&(e=e.toString());const t=e.substring(0,1);e=e.substring(1,e.length),"string"===typeof e&&(e=a.from(e));const r=s(t);return a.from(r.decode(e.toString()))}function o(e){if(a.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(r){return!1}}function d(e,t){const r=s(e);r.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=o,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,r){"use strict";r(21703);const{Buffer:a}=r(15361),n=r(74482),i=r(42611),c=r(46742);function f(e){t.decode(e)}t.names=c.names,t.codes=c.codes,t.defaultLengths=c.defaultLengths,t.toHexString=function(e){if(!a.isBuffer(e))throw new Error("must be passed a buffer");return e.toString("hex")},t.fromHexString=function(e){return a.from(e,"hex")},t.toB58String=function(e){if(!a.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 a.isBuffer(e)&&(t=e.toString()),n.decode("z"+t)},t.decode=function(e){if(!a.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 r=i.decode(e);if(!t.isValidCode(r))throw new Error(`multihash unknown function code: 0x${r.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:r,name:c.codes[r],length:n,digest:e}},t.encode=function(e,r,n){if(!e||void 0===r)throw new Error("multihash encode requires at least two args: digest, code");const c=t.coerceCode(r);if(!a.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 a.concat([a.from(i.encode(c)),a.from(i.encode(n)),e])},t.coerceCode=function(e){let r=e;if("string"===typeof e){if(void 0===c.names[e])throw new Error(`Unrecognized hash function named: ${e}`);r=c.names[e]}if("number"!==typeof r)throw new Error(`Hash function code should be a number. Got: ${r}`);if(void 0===c.codes[r]&&!t.isAppCode(r))throw new Error(`Unrecognized function code: ${r}`);return r},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,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{c=r(15361).Buffer}catch(S){}function f(e,t,r){for(var a=0,n=Math.min(e.length,r),i=t;i=49&&c<=54?c-49+10:c>=17&&c<=22?c-17+10:15&c}return a}function o(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initNumber=function(e,t,r){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):(a(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(a("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"===r)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 r=0;r=t;r-=6)n=f(e,r,r+6),this.words[a]|=n<>>26-i&4194303,i+=24,i>=26&&(i-=26,a++);r+6!==t&&(n=f(e,t,r+6),this.words[a]|=n<>>26-i&4194303),this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,d=0,s=r;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 d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],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 b(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function h(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?d[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var b=s[e],h=u[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:d[b-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function p(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function x(e,t,r){var a=new m;return a.mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?l(this,e,t):a<63?h(this,e,t):a<1024?p(this,e,t):x(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},m.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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=b(e);if(0===t.length)return new i(1);for(var r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 g(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(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.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 a(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)}g.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):r.strip(),r},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},n(y,g),y.prototype.split=function(e,t){for(var r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 v[e]=t,t},k.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){r(21703);var a=r(5460),n=r(99468);e.exports=function(e){if("string"===typeof e||"number"===typeof e){var t=new a(1),r=String(e).toLowerCase().trim(),i="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),c=n(r);if("-"===c.substr(0,1)&&(c=n(c.slice(1)),t=new a(-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 a(c,16).mul(t);if((c.match(/^-?[0-9]+$/)||""===c)&&!1===i)return new a(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 a(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,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */r(21703);var a=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={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var a=Object.getOwnPropertyNames(t).map((function(e){return t[e]}));if("0123456789"!==a.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 r,f,o=c(e),d=1;ds&&(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)),R=s-e+z}function V(e){void 0!==i&&(f(i),o(),i=void 0),t=Error(e+"\nLn: "+W+"\nCol: "+K+"\nChr: "+r),d(Object(a["o"])(void 0,void 0,t))}function Z(){if(j===h)return f({}),o(),void(U=!0);j===l&&0===q||V("Unexpected end"),void 0!==i&&(f(i),o(),i=void 0),U=!0}function $(e){return"\r"===e||"\n"===e||" "===e||"\t"===e}function J(e){if(!t){if(U)return V("Cannot write after close");var a=0;r=e[0];while(r){if(a>0&&(n=r),r=e[a++],!r)break;switch(z++,"\n"===r?(W++,K=0):K++,j){case h:if("{"===r)j=p;else if("["===r)j=m;else if(!$(r))return V("Non-whitespace before {[.");continue;case y:case p:if($(r))continue;if(j===y)F.push(w);else{if("}"===r){f({}),o(),j=F.pop()||l;continue}F.push(x)}if('"'!==r)return V('Malformed object key should start with " ');j=g;continue;case w:case x:if($(r))continue;if(":"===r)j===x?(F.push(x),void 0!==i&&(f({}),c(i),i=void 0),q++):void 0!==i&&(c(i),i=void 0),j=l;else if("}"===r)void 0!==i&&(f(i),o(),i=void 0),o(),q--,j=F.pop()||l;else{if(","!==r)return V("Bad object");j===x&&F.push(x),void 0!==i&&(f(i),o(),i=void 0),j=y}continue;case m:case l:if($(r))continue;if(j===m){if(f([]),q++,j=l,"]"===r){o(),q--,j=F.pop()||l;continue}F.push(v)}if('"'===r)j=g;else if("{"===r)j=p;else if("["===r)j=m;else if("t"===r)j=M;else if("f"===r)j=A;else if("n"===r)j=P;else if("-"===r)N+=r;else if("0"===r)N+=r,j=O;else{if(-1==="123456789".indexOf(r))return V("Bad value");N+=r,j=O}continue;case v:if(","===r)F.push(v),void 0!==i&&(f(i),o(),i=void 0),j=l;else{if("]"!==r){if($(r))continue;return V("Bad array")}void 0!==i&&(f(i),o(),i=void 0),o(),q--,j=F.pop()||l}continue;case g:void 0===i&&(i="");var d=a-1;e:while(1){while(H>0)if(D+=r,r=e.charAt(a++),4===H?(i+=String.fromCharCode(parseInt(D,16)),H=0,d=a-1):H++,!r)break e;if('"'===r&&!L){j=F.pop()||l,i+=e.substring(d,a-1);break}if("\\"===r&&!L&&(L=!0,i+=e.substring(d,a-1),r=e.charAt(a++),!r))break;if(L){if(L=!1,"n"===r?i+="\n":"r"===r?i+="\r":"t"===r?i+="\t":"f"===r?i+="\f":"b"===r?i+="\b":"u"===r?(H=1,D=""):i+=r,r=e.charAt(a++),d=a-1,r)continue;break}u.lastIndex=a;var s=u.exec(e);if(!s){a=e.length+1,i+=e.substring(d,a-1);break}if(a=s.index+1,r=e.charAt(s.index),!r){i+=e.substring(d,a-1);break}}continue;case M:if(!r)continue;if("r"!==r)return V("Invalid true started with t"+r);j=_;continue;case _:if(!r)continue;if("u"!==r)return V("Invalid true started with tr"+r);j=k;continue;case k:if(!r)continue;if("e"!==r)return V("Invalid true started with tru"+r);f(!0),o(),j=F.pop()||l;continue;case A:if(!r)continue;if("a"!==r)return V("Invalid false started with f"+r);j=S;continue;case S:if(!r)continue;if("l"!==r)return V("Invalid false started with fa"+r);j=E;continue;case E:if(!r)continue;if("s"!==r)return V("Invalid false started with fal"+r);j=T;continue;case T:if(!r)continue;if("e"!==r)return V("Invalid false started with fals"+r);f(!1),o(),j=F.pop()||l;continue;case P:if(!r)continue;if("u"!==r)return V("Invalid null started with n"+r);j=I;continue;case I:if(!r)continue;if("l"!==r)return V("Invalid null started with nu"+r);j=B;continue;case B:if(!r)continue;if("l"!==r)return V("Invalid null started with nul"+r);f(null),o(),j=F.pop()||l;continue;case C:if("."!==r)return V("Leading zero not followed by .");N+=r,j=O;continue;case O:if(-1!=="0123456789".indexOf(r))N+=r;else if("."===r){if(-1!==N.indexOf("."))return V("Invalid number has two dots");N+=r}else if("e"===r||"E"===r){if(-1!==N.indexOf("e")||-1!==N.indexOf("E"))return V("Invalid number has two exponential");N+=r}else if("+"===r||"-"===r){if("e"!==n&&"E"!==n)return V("Invalid symbol in number");N+=r}else N&&(f(parseFloat(N)),o(),N=""),a--,j=F.pop()||l;continue;default:return V("Unknown state: "+j)}}z>=R&&G()}}e(a["m"]).on(J),e(a["n"]).on(Z)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return d}));var a=r(19),n=r(3),i=r(2),c=r(20),f=r(0);function o(){return new XMLHttpRequest}function d(e,t,r,o,d,s,u){var b=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,r=(" "+e.substr(l)).substr(1);r&&b(r),l=Object(i["e"])(e)}}function m(t){try{p&&e(n["c"]).emit(t.status,Object(c["a"])(t.getAllResponseHeaders())),p=!1}catch(r){}}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 r="2"===String(t.status)[0];r?(x(),e(n["n"]).emit()):h(Object(n["o"])(t.status,t.responseText))}};try{for(var v in t.open(r,o,!0),s)t.setRequestHeader(v,s[v]);Object(a["a"])(window.location,Object(a["b"])(o))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=u,t.send(d)}catch(g){window.setTimeout(Object(f["j"])(h,Object(n["o"])(void 0,void 0,g)),0)}}},function(e,t,r){"use strict";function a(e,t){function r(e){return{"http:":80,"https:":443}[e]}function a(t){return String(t.port||r(t.protocol||e.protocol))}return!!(t.protocol&&t.protocol!==e.protocol||t.host&&t.host!==e.host||t.host&&a(t)!==a(e))}function n(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/,r=t.exec(e)||[];return{protocol:r[1]||"",host:r[2]||"",port:r[3]||""}}r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return n}))},function(e,t,r){"use strict";function a(e){var t={};return e&&e.split("\r\n").forEach((function(e){var r=e.indexOf(": ");t[e.substring(0,r)]=e.substring(r+2)})),t}r.d(t,"a",(function(){return a}))}])["default"]}))},15678:function(e,t,r){"use strict";var a=r(18625);t.certificate=r(89866);var n=a.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=a.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=i;var c=a.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(f),this.key("subjectPublicKey").bitstr())}));t.PublicKey=c;var f=a.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())})),o=a.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(f),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=o;var d=a.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=d;var s=a.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=a.define("DSAparam",(function(){this.int()}));var u=a.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(b),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=u;var b=a.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=a.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},89866:function(e,t,r){"use strict";var a=r(18625),n=a.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),i=a.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),c=a.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),f=a.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(c),this.key("subjectPublicKey").bitstr())})),o=a.define("RelativeDistinguishedName",(function(){this.setof(i)})),d=a.define("RDNSequence",(function(){this.seqof(o)})),s=a.define("Name",(function(){this.choice({rdnSequence:this.use(d)})})),u=a.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))})),b=a.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),h=a.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(u),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(b).optional())})),l=a.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,r){var a=/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=r(13692),f=r(24699),o=r(6779).Buffer;e.exports=function(e,t){var r,d=e.toString(),s=d.match(a);if(s){var u="aes"+s[1],b=o.from(s[2],"hex"),h=o.from(s[3].replace(/[\r\n]/g,""),"base64"),l=c(t,b.slice(0,8),parseInt(s[1],10)).key,p=[],x=f.createDecipheriv(u,l,b);p.push(x.update(h)),p.push(x.final()),r=o.concat(p)}else{var m=d.match(i);r=o.from(m[2].replace(/[\r\n]/g,""),"base64")}var v=d.match(n)[1];return{tag:v,data:r}}},2616:function(e,t,r){r(21703);var a=r(15678),n=r(22562),i=r(83311),c=r(24699),f=r(15043),o=r(6779).Buffer;function d(e){var t;"object"!==typeof e||o.isBuffer(e)||(t=e.passphrase,e=e.key),"string"===typeof e&&(e=o.from(e));var r,n,c=i(e,t),f=c.tag,d=c.data;switch(f){case"CERTIFICATE":n=a.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(n||(n=a.PublicKey.decode(d,"der")),r=n.algorithm.algorithm.join("."),r){case"1.2.840.113549.1.1.1":return a.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=a.DSAparam.decode(n.subjectPublicKey.data,"der"),{type:"dsa",data:n.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":d=a.EncryptedPrivateKey.decode(d,"der"),d=s(d,t);case"PRIVATE KEY":switch(n=a.PrivateKey.decode(d,"der"),r=n.algorithm.algorithm.join("."),r){case"1.2.840.113549.1.1.1":return a.RSAPrivateKey.decode(n.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:n.algorithm.curve,privateKey:a.ECPrivateKey.decode(n.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return n.algorithm.params.priv_key=a.DSAparam.decode(n.subjectPrivateKey,"der"),{type:"dsa",params:n.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return a.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return a.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:a.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return d=a.ECPrivateKey.decode(d,"der"),{curve:d.parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+f)}}function s(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,a=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=n[e.algorithm.decrypt.cipher.algo.join(".")],d=e.algorithm.decrypt.cipher.iv,s=e.subjectPrivateKey,u=parseInt(i.split("-")[1],10)/8,b=f.pbkdf2Sync(t,r,a,u,"sha1"),h=c.createDecipheriv(i,b,d),l=[];return l.push(h.update(s)),l.push(h.final()),o.concat(l)}e.exports=d,d.signature=a.signature},65177:function(e){var t=function(e){return e.replace(/^\s+|\s+$/g,"")},r=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};for(var a={},n=t(e).split("\n"),i=0;i=6?"utf-8":"binary"}else a="utf-8";e.exports=a},88369:function(e,t,r){r(21703);var a=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>a||t!==t)throw new TypeError("Bad key length")}},26560:function(e,t,r){var a=r(56515),n=r(3128),i=r(61720),c=r(6779).Buffer,f=r(88369),o=r(53677),d=r(56816),s=c.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function b(e,t,r){var a=h(e),n="sha512"===e||"sha384"===e?128:64;t.length>n?t=a(t):t.lengthfunction(){const r=t.promiseModule,a=new Array(arguments.length);for(let e=0;e{t.errorFirst?a.push((function(e,a){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e{r=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},r);const a=e=>{const t=t=>"string"===typeof t?e===t:t.test(e);return r.include?r.include.some(t):!r.exclude.some(t)};let n;n="function"===typeof e?function(){return r.excludeMain?e.apply(this,arguments):t(e,r).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const i in e){const c=e[i];n[i]="function"===typeof c&&a(i)?t(c,r):c}return n}},45626:function(e,t,r){"use strict";r.r(t),r.d(t,{Children:function(){return ge},Component:function(){return g},Fragment:function(){return v},PureComponent:function(){return le},Suspense:function(){return Me},SuspenseList:function(){return Ae},cloneElement:function(){return He},createContext:function(){return F},createElement:function(){return p},createFactory:function(){return Fe},createPortal:function(){return Pe},createRef:function(){return m},default:function(){return We},findDOMNode:function(){return ze},forwardRef:function(){return me},hydrate:function(){return Oe},isValidElement:function(){return De},lazy:function(){return ke},memo:function(){return pe},render:function(){return Ce},unmountComponentAtNode:function(){return qe},unstable_batchedUpdates:function(){return Ke},useCallback:function(){return ae},useContext:function(){return ne},useDebugValue:function(){return ie},useEffect:function(){return X},useErrorBoundary:function(){return ce},useImperativeHandle:function(){return te},useLayoutEffect:function(){return Q},useMemo:function(){return re},useReducer:function(){return Y},useRef:function(){return ee},useState:function(){return J},version:function(){return je}});r(21703);var a,n,i,c,f,o,d,s={},u=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;function h(e,t){for(var r in t)e[r]=t[r];return e}function l(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,r){var a,n=arguments,i={};for(a in t)"key"!==a&&"ref"!==a&&(i[a]=t[a]);if(arguments.length>3)for(r=[r],a=3;a2&&(t.children=u.slice.call(arguments,2)),r={},t)"key"!==a&&"ref"!==a&&(r[a]=t[a]);return x(e.type,r,t.key||e.key,t.ref||e.ref,null)}function F(e){var t={},r={__c:"__cC"+d++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var a,n=this;return this.getChildContext||(a=[],this.getChildContext=function(){return t[r.__c]=n,t},this.shouldComponentUpdate=function(e){n.props.value!==e.value&&a.some((function(t){t.context=e.value,M(t)}))},this.sub=function(e){a.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){a.splice(a.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Consumer.contextType=r,r.Provider.__=r,r}a={__e:function(e,t){for(var r,a;t=t.__;)if((r=t.__c)&&!r.__)try{if(r.constructor&&null!=r.constructor.getDerivedStateFromError&&(a=!0,r.setState(r.constructor.getDerivedStateFromError(e))),null!=r.componentDidCatch&&(a=!0,r.componentDidCatch(e)),a)return M(r.__E=r)}catch(t){e=t}throw e}},g.prototype.setState=function(e,t){var r;r=this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(r,this.props)),e&&h(r,e),null!=e&&this.__v&&(t&&this.__h.push(t),M(this))},g.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),M(this))},g.prototype.render=v,n=[],i=0,c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=s,d=0;var D,H,q,z=0,K=[],W=a.__r,G=a.diffed,V=a.__c,Z=a.unmount;function $(e,t){a.__h&&a.__h(H,e,z||t),z=0;var r=H.__H||(H.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function J(e){return z=1,Y(ue,e)}function Y(e,t,r){var a=$(D++,2);return a.__c||(a.__c=H,a.__=[r?r(t):ue(void 0,t),function(t){var r=e(a.__[0],t);a.__[0]!==r&&(a.__[0]=r,a.__c.setState({}))}]),a.__}function X(e,t){var r=$(D++,3);!a.__s&&se(r.__H,t)&&(r.__=e,r.__H=t,H.__H.__h.push(r))}function Q(e,t){var r=$(D++,4);!a.__s&&se(r.__H,t)&&(r.__=e,r.__H=t,H.__h.push(r))}function ee(e){return z=5,re((function(){return{current:e}}),[])}function te(e,t,r){z=6,Q((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==r?r:r.concat(e))}function re(e,t){var r=$(D++,7);return se(r.__H,t)?(r.__H=t,r.__h=e,r.__=e()):r.__}function ae(e,t){return z=8,re((function(){return e}),t)}function ne(e){var t=H.context[e.__c],r=$(D++,9);return r.__c=e,t?(null==r.__&&(r.__=!0,t.sub(H)),t.props.value):e.__}function ie(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}function ce(e){var t=$(D++,10),r=J();return t.__=e,H.componentDidCatch||(H.componentDidCatch=function(e){t.__&&t.__(e),r[1](e)}),[r[0],function(){r[1](void 0)}]}function fe(){K.some((function(e){if(e.__P)try{e.__H.__h.forEach(oe),e.__H.__h.forEach(de),e.__H.__h=[]}catch(n){return e.__H.__h=[],a.__e(n,e.__v),!0}})),K=[]}function oe(e){e.t&&e.t()}function de(e){var t=e.__();"function"==typeof t&&(e.t=t)}function se(e,t){return!e||t.some((function(t,r){return t!==e[r]}))}function ue(e,t){return"function"==typeof t?t(e):t}function be(e,t){for(var r in t)e[r]=t[r];return e}function he(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var a in t)if("__source"!==a&&e[a]!==t[a])return!0;return!1}a.__r=function(e){W&&W(e),D=0,(H=e.__c).__H&&(H.__H.__h.forEach(oe),H.__H.__h.forEach(de),H.__H.__h=[])},a.diffed=function(e){G&&G(e);var t=e.__c;if(t){var r=t.__H;r&&r.__h.length&&(1!==K.push(t)&&q===a.requestAnimationFrame||((q=a.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(a),cancelAnimationFrame(t),setTimeout(e)},a=setTimeout(r,100);"undefined"!=typeof window&&(t=requestAnimationFrame(r))})(fe))}},a.__c=function(e,t){t.some((function(e){try{e.__h.forEach(oe),e.__h=e.__h.filter((function(e){return!e.__||de(e)}))}catch(f){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.__e(f,e.__v)}})),V&&V(e,t)},a.unmount=function(e){Z&&Z(e);var t=e.__c;if(t){var r=t.__H;if(r)try{r.__.forEach((function(e){return e.t&&e.t()}))}catch(e){a.__e(e,t.__v)}}};var le=function(e){var t,r;function a(t){var r;return(r=e.call(this,t)||this).isPureReactComponent=!0,r}return r=e,(t=a).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,a.prototype.shouldComponentUpdate=function(e,t){return he(this.props,e)||he(this.state,t)},a}(g);function pe(e,t){function r(e){var r=this.props.ref,a=r==e.ref;return!a&&r&&(r.call?r(null):r.current=null),t?!t(this.props,e)||!a:he(this.props,e)}function a(t){return this.shouldComponentUpdate=r,p(e,be({},t))}return a.prototype.isReactComponent=!0,a.displayName="Memo("+(e.displayName||e.name)+")",a.t=!0,a}var xe=a.__b;function me(e){function t(t){var r=be({},t);return delete r.ref,e(r,t.ref)}return t.prototype.isReactComponent=t.t=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}a.__b=function(e){e.type&&e.type.t&&e.ref&&(e.props.ref=e.ref,e.ref=null),xe&&xe(e)};var ve=function(e,t){return e?A(e).reduce((function(e,r,a){return e.concat(t(r,a))}),[]):null},ge={map:ve,forEach:ve,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=a.__e;function we(e){return e&&((e=be({},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,r,a;function n(n){if(t||(t=e()).then((function(e){r=e.default||e}),(function(e){a=e})),a)throw a;if(!r)throw t;return p(r,n)}return n.displayName="Lazy",n.t=!0,n}function Ae(){this.i=null,this.l=null}a.__e=function(e,t,r){if(e.then)for(var a,n=t;n=n.__;)if((a=n.__c)&&a.__c)return a.__c(e,t.__c);ye(e,t,r)},(Me.prototype=new g).__c=function(e,t){var r=this;null==r.o&&(r.o=[]),r.o.push(t);var a=_e(r.__v),n=!1,i=function(){n||(n=!0,a?a(c):c())};t.__c=t.componentWillUnmount,t.componentWillUnmount=function(){i(),t.__c&&t.__c()};var c=function(){var e;if(!--r.__u)for(r.__v.__k[0]=r.state.u,r.setState({u:r.__b=null});e=r.o.pop();)e.forceUpdate()};r.__u++||r.setState({u:r.__b=r.__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(g,null,t.u?null:e.children),t.u&&e.fallback]};var Se=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]1)for(var r=1;r=t.length){i++;break}var c=t.slice(2,n-1);if(("0002"!==a.toString("hex")&&!r||"0001"!==a.toString("hex")&&r)&&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 r=0,a=e.length;e.length!==t.length&&(r++,a=Math.min(e.length,t.length));var n=-1;while(++nh||new c(t).cmp(o.modulus)>=0)throw new Error("decryption error");i=r?d(new c(t),o):f(t,o);var l=s.alloc(h-i.length);if(i=s.concat([l,i],h),4===n)return u(o,i);if(1===n)return b(o,i,r);if(3===n)return i;throw new Error("unknown padding")}},48936:function(e,t,r){r(21703);var a=r(2616),n=r(67602),i=r(65443),c=r(96884),f=r(98479),o=r(2396),d=r(74466),s=r(28593),u=r(6779).Buffer;function b(e,t){var r=e.modulus.byteLength(),a=t.length,d=i("sha1").update(u.alloc(0)).digest(),s=d.length,b=2*s;if(a>r-b-2)throw new Error("message too long");var h=u.alloc(r-a-b-2),l=r-s-1,p=n(s),x=f(u.concat([d,h,u.alloc(1,1),t],l),c(p,l)),m=f(p,c(x,s));return new o(u.concat([u.alloc(1),m,x],r))}function h(e,t,r){var a,n=t.length,i=e.modulus.byteLength();if(n>i-11)throw new Error("message too long");return a=r?u.alloc(i-n-3,255):l(i-n-3),new o(u.concat([u.from([0,r?1:2]),a,u.alloc(1),t],i))}function l(e){var t,r=u.allocUnsafe(e),a=0,i=n(2*e),c=0;while(a=0)throw new Error("data too long for modulus")}return r?s(i,c):d(i,c)}},74466:function(e,t,r){var a=r(2396),n=r(6779).Buffer;function i(e,t){return n.from(e.toRed(a.mont(t.modulus)).redPow(new a(t.publicExponent)).fromRed().toArray())}e.exports=i},98479:function(e){e.exports=function(e,t){var r=e.length,a=-1;while(++a>>7-e%8&1)},put:function(e,t){for(var r=0;r>>t-r-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,r){r(21703);var a=r(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=a.alloc(e*e),this.reservedBit=a.alloc(e*e)}n.prototype.set=function(e,t,r,a){var n=e*this.size+t;this.data[n]=r,a&&(this.reservedBit[n]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=n},7591:function(e,t,r){var a=r(73385),n=r(15461);function i(e){this.mode=n.BYTE,this.data=a.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,r=this.data.length;t=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return a(e)}catch(n){return r}}},13375:function(e,t,r){var a=r(14288).getSymbolSize,n=7;t.getPositions=function(e){var t=a(e);return[[0,0],[t-n,0],[0,t-n]]}},57874:function(e,t,r){var a=r(14288),n=1335,i=21522,c=a.getBCHDigit(n);t.getEncodedBits=function(e,t){var r=e.bit<<3|t,f=r<<10;while(a.getBCHDigit(f)-c>=0)f^=n<=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},e.exports=i},1840:function(e,t,r){r(21703),t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var a={N1:3,N2:3,N3:40,N4:10};function n(e,r,a){switch(e){case t.Patterns.PATTERN000:return(r+a)%2===0;case t.Patterns.PATTERN001:return r%2===0;case t.Patterns.PATTERN010:return a%3===0;case t.Patterns.PATTERN011:return(r+a)%3===0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(a/3))%2===0;case t.Patterns.PATTERN101:return r*a%2+r*a%3===0;case t.Patterns.PATTERN110:return(r*a%2+r*a%3)%2===0;case t.Patterns.PATTERN111:return(r*a%3+(r+a)%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,r=0,n=0,i=0,c=null,f=null,o=0;o=5&&(r+=a.N1+(n-5)),c=s,n=1),s=e.get(d,o),s===f?i++:(i>=5&&(r+=a.N1+(i-5)),f=s,i=1)}n>=5&&(r+=a.N1+(n-5)),i>=5&&(r+=a.N1+(i-5))}return r},t.getPenaltyN2=function(e){for(var t=e.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(f,c),f>=10&&(1488===i||93===i)&&r++}return r*a.N3},t.getPenaltyN4=function(e){for(var t=0,r=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,r){if(t.isValid(e))return e;try{return i(e)}catch(a){return r}}},39186:function(e,t,r){var a=r(15461);function n(e){this.mode=a.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,r,a;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),a=parseInt(r,10),e.put(a,10);var n=this.data.length-t;n>0&&(r=this.data.substr(t),a=parseInt(r,10),e.put(a,3*n+1))},e.exports=n},30823:function(e,t,r){var a=r(73385),n=r(17512);t.mul=function(e,t){for(var r=a.alloc(e.length+t.length-1),i=0;i=0){for(var i=r[0],c=0;c=0&&f<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===f||6===f)||f>=2&&f<=4&&o>=2&&o<=4?e.set(i+f,c+o,!0,!0):e.set(i+f,c+o,!1,!0))}function g(e){for(var t=e.size,r=8;r>f&1),e.set(r,a,n,!0),e.set(a,r,n,!0)}function M(e,t,r){var a,n,i=e.size,c=l.getEncodedBits(t,r);for(a=0;a<15;a++)n=1===(c>>a&1),a<6?e.set(a,8,n,!0):a<8?e.set(a+1,8,n,!0):e.set(i-15+a,8,n,!0),a<8?e.set(8,i-a-1,n,!0):a<9?e.set(8,15-a-1+1,n,!0):e.set(8,15-a-1,n,!0);e.set(i-8,8,1,!0)}function _(e,t){for(var r=e.size,a=-1,n=r-1,i=7,c=0,f=r-1;f>0;f-=2){6===f&&f--;while(1){for(var o=0;o<2;o++)if(!e.isReserved(n,f-o)){var d=!1;c>>i&1)),e.set(n,f-o,d),i--,-1===i&&(c++,i=7)}if(n+=a,n<0||r<=n){n-=a,a=-a;break}}}}function k(e,t,r){var a=new c;r.forEach((function(t){a.put(t.mode.bit,4),a.put(t.getLength(),p.getCharCountIndicator(t.mode,e)),t.write(a)}));var i=n.getSymbolTotalCodewords(e),f=u.getTotalCodewordsCount(e,t),o=8*(i-f);a.getLengthInBits()+4<=o&&a.put(0,4);while(a.getLengthInBits()%8!==0)a.putBit(0);for(var d=(o-a.getLengthInBits())/8,s=0;s=7&&w(l,t),_(l,u),isNaN(a)&&(a=s.getBestMask(l,M.bind(null,l,r))),s.applyMask(a,l),M(l,r,a),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:a,segments:i}}t.create=function(e,t){if("undefined"===typeof e||""===e)throw new Error("No input text");var r,a,c=i.M;return"undefined"!==typeof t&&(c=i.from(t.errorCorrectionLevel,i.M),r=h.from(t.version),a=s.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),S(e,r,c,a)}},14365:function(e,t,r){r(21703);var a=r(73385),n=r(30823),i=r(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=a.alloc(this.degree),r=i.concat([e,t],e.length+this.degree),c=n.mod(r,this.genPoly),f=this.degree-c.length;if(f>0){var o=a.alloc(this.degree);return c.copy(o,f),o}return c},e.exports=c},3555:function(e,t){var r="[0-9]+",a="[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(r,"g"),t.ALPHANUMERIC=new RegExp(a,"g");var c=new RegExp("^"+n+"$"),f=new RegExp("^"+r+"$"),o=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 o.test(e)}},58439:function(e,t,r){r(21703);var a=r(15461),n=r(39186),i=r(6355),c=r(7591),f=r(59176),o=r(3555),d=r(14288),s=r(98716);function u(e){return unescape(encodeURIComponent(e)).length}function b(e,t,r){var a,n=[];while(null!==(a=e.exec(r)))n.push({data:a[0],index:a.index,mode:t,length:a[0].length});return n}function h(e){var t,r,n=b(o.NUMERIC,a.NUMERIC,e),i=b(o.ALPHANUMERIC,a.ALPHANUMERIC,e);d.isKanjiModeEnabled()?(t=b(o.BYTE,a.BYTE,e),r=b(o.KANJI,a.KANJI,e)):(t=b(o.BYTE_KANJI,a.BYTE,e),r=[]);var c=n.concat(i,t,r);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 a.NUMERIC:return n.getBitsLength(e);case a.ALPHANUMERIC:return i.getBitsLength(e);case a.KANJI:return f.getBitsLength(e);case a.BYTE:return c.getBitsLength(e)}}function p(e){return e.reduce((function(e,t){var r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}function x(e){for(var t=[],r=0;r40)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.');a=e},t.isKanjiModeEnabled=function(){return"undefined"!==typeof a},t.toSJIS=function(e){return a(e)}},25057:function(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},49693:function(e,t,r){r(21703);var a=r(14288),n=r(49757),i=r(72839),c=r(15461),f=r(25057),o=r(35267),d=7973,s=a.getBCHDigit(d);function u(e,r,a){for(var n=1;n<=40;n++)if(r<=t.getCapacity(n,a,e))return n}function b(e,t){return c.getCharCountIndicator(e,t)+4}function h(e,t){var r=0;return e.forEach((function(e){var a=b(e.mode,t);r+=a+e.getBitsLength()})),r}function l(e,r){for(var a=1;a<=40;a++){var n=h(e,a);if(n<=t.getCapacity(a,r,c.MIXED))return a}}t.from=function(e,t){return f.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!f.isValid(e))throw new Error("Invalid QR Code version");"undefined"===typeof r&&(r=c.BYTE);var i=a.getSymbolTotalCodewords(e),o=n.getTotalCodewordsCount(e,t),d=8*(i-o);if(r===c.MIXED)return d;var s=d-b(r,e);switch(r){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 r,a=i.from(t,i.M);if(o(e)){if(e.length>1)return l(e,a);if(0===e.length)return 1;r=e[0]}else r=e;return u(r.mode,r.getLength(),a)},t.getEncodedBits=function(e){if(!f.isValid(e)||e<7)throw new Error("Invalid QR Code version");var t=e<<12;while(a.getBCHDigit(t)-s>=0)t^=d<0&&d>0&&e[o-1]||(a+=c?i("M",d+r,.5+s+r):i("m",n,0),n=0,c=!1),d+1':"",u="',b='viewBox="0 0 '+d+" "+d+'"',h=i.width?'width="'+i.width+'" height="'+i.width+'" ':"",l=''+s+u+"\n";return"function"===typeof r&&r(null,l),l}},28920:function(e,t,r){function a(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 r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}r(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,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:a(e.color.dark||"#000000ff"),light:a(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,r){var a=t.getScale(e,r);return Math.floor((e+2*r.margin)*a)},t.qrToImageData=function(e,r,a){for(var n=r.modules.size,i=r.modules.data,c=t.getScale(n,a),f=Math.floor((n+2*a.margin)*c),o=a.margin*c,d=[a.color.light,a.color.dark],s=0;s=o&&u>=o&&s=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function o(e){return e!==e}function d(e,t){var r;return c.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t),r.__proto__=c.prototype):(r=e,null===r&&(r=new c(t)),r.length=t),r}function s(e,t){var r=d(e,t<0?0:0|f(t));if(!c.TYPED_ARRAY_SUPPORT)for(var a=0;a55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(c+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|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,r,a){for(var n=0;n=t.length||n>=e.length)break;t[n+r]=e[n]}return n}function v(e,t,r,a){return m(p(t,e.length-r),e,r,a)}function g(e,t,r,a){if("number"===typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&t instanceof ArrayBuffer?h(e,t,r,a):"string"===typeof t?u(e,t,r):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,r){void 0===t||void 0===r&&"string"===typeof t?(r=this.length,t=0):isFinite(t)&&(t|=0,isFinite(r)?r|=0:r=void 0);var a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return v(this,e,t,r)},c.prototype.slice=function(e,t){var r,a=this.length;if(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=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>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=>(r,a)=>{const n=r.length;return void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[s(t,e),"[",n,"]"].join("")]:[...r,[s(t,e),"[",s(n,e),"]=",s(a,e)].join("")]};case"bracket":return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,[s(t,e),"[]"].join("")]:[...r,[s(t,e),"[]=",s(a,e)].join("")];case"comma":case"separator":return t=>(r,a)=>null===a||void 0===a||0===a.length?r:0===r.length?[[s(t,e),"=",s(a,e)].join("")]:[[r,s(a,e)].join(e.arrayFormatSeparator)];default:return t=>(r,a)=>void 0===a||e.skipNull&&null===a||e.skipEmptyString&&""===a?r:null===a?[...r,s(t,e)]:[...r,[s(t,e),"=",s(a,e)].join("")]}}function o(e){let t;switch(e.arrayFormat){case"index":return(e,r,a)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===a[e]&&(a[e]={}),a[e][t[1]]=r):a[e]=r};case"bracket":return(e,r,a)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==a[e]?a[e]=[].concat(a[e],r):a[e]=[r]:a[e]=r};case"comma":case"separator":return(t,r,a)=>{const n="string"===typeof r&&r.split("").indexOf(e.arrayFormatSeparator)>-1,i=n?r.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===r?r:u(r,e);a[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}function d(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?a(e):encodeURIComponent(e):e}function u(e,t){return t.decode?n(e):e}function b(e){return Array.isArray(e)?e.sort():"object"===typeof e?b(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 r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),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),d(t.arrayFormatSeparator);const r=o(t),a=Object.create(null);if("string"!==typeof e)return a;if(e=e.trim().replace(/^[?#&]/,""),!e)return a;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:u(c,t),r(u(e,t),c,a)}for(const n of Object.keys(a)){const e=a[n];if("object"===typeof e&&null!==e)for(const r of Object.keys(e))e[r]=x(e[r],t);else a[n]=x(e,t)}return!1===t.sort?a:(!0===t.sort?Object.keys(a).sort():Object.keys(a).sort(t.sort)).reduce(((e,t)=>{const r=a[t];return Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?e[t]=b(r):e[t]=r,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),d(t.arrayFormatSeparator);const r=r=>t.skipNull&&c(e[r])||t.skipEmptyString&&""===e[r],a=f(t),n={};for(const c of Object.keys(e))r(c)||(n[c]=e[c]);const i=Object.keys(n);return!1!==t.sort&&i.sort(t.sort),i.map((r=>{const n=e[r];return void 0===n?"":null===n?s(r,t):Array.isArray(n)?n.reduce(a(r),[]).join("&"):s(r,t)+"="+s(n,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,a]=i(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(p(e),t)},t&&t.parseFragmentIdentifier&&a?{fragmentIdentifier:u(a,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const a=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,r);f&&(f=`?${f}`);let o=l(e.url);return e.fragmentIdentifier&&(o=`#${s(e.fragmentIdentifier,r)}`),`${a}${f}${o}`}},67602:function(e,t,r){"use strict";var a=r(96027);r(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=r(6779).Buffer,o=r.g.crypto||r.g.msCrypto;function d(e,t){if(e>i)throw new RangeError("requested too many random bytes");var r=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>o||e>t)throw new RangeError("offset out of range")}function b(e,t,r){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>r||e>o)throw new RangeError("buffer too small")}function h(e,t,a,n){if(!f.isBuffer(e)&&!(e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof t)n=t,t=0,a=e.length;else if("function"===typeof a)n=a,a=e.length-t;else if("function"!==typeof n)throw new TypeError('"cb" argument must be a function');return u(t,e.length),b(a,t,e.length),l(e,t,a,n)}function l(e,t,r,n){if(a.browser){var i=e.buffer,f=new Uint8Array(i,t,r);return d.getRandomValues(f),n?void a.nextTick((function(){n(null,e)})):e}if(!n){var o=c(r);return o.copy(e,t),e}c(r,(function(r,a){if(r)return n(r);a.copy(e,t),n(null,e)}))}function p(e,t,a){if("undefined"===typeof t&&(t=0),!f.isBuffer(e)&&!(e instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return u(t,e.length),void 0===a&&(a=e.length-t),b(a,t,e.length),l(e,t,a)}d&&d.getRandomValues||!a.browser?(t.randomFill=h,t.randomFillSync=p):(t.randomFill=n,t.randomFillSync=n)},55314:function(e,t,r){"use strict";function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}r(21703);var n={};function i(e,t,r){function i(e,r,a){return"string"===typeof t?t:t(e,r,a)}r||(r=Error);var c=function(e){function t(t,r,a){return e.call(this,i(t,r,a))||this}return a(t,e),t}(r);c.prototype.name=r.name,c.prototype.code=e,n[e]=c}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"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,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function d(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}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,r){var a,n;if("string"===typeof t&&f(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be",o(e," argument"))n="The ".concat(e," ").concat(a," ").concat(c(t,"type"));else{var i=d(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(i," ").concat(a," ").concat(c(t,"type"))}return n+=". Received type ".concat(typeof r),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,r){"use strict";var a=r(96027),n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=s;var i=r(50187),c=r(69621);r(81923)(s,i);for(var f=n(c.prototype),o=0;o0)if("string"===typeof t||c.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=d(t)),a)c.endEmitted?A(e,new k):B(e,c,t,!0);else if(c.ended)A(e,new M);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?B(e,c,t,!1):F(e,c)):B(e,c,t,!1)}else a||(c.reading=!1,F(e,c));return!c.ended&&(c.length=O?e=O:(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=R(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function L(e,t){if(u("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?U(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}}function U(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(j,e))}function j(e){var t=e._readableState;u("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 F(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(D,e,t))}function D(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){u("readable nexttick read 0"),e.read(0)}function K(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(W,e,t))}function W(e,t){u("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;u("flow",t.flowing);while(t.flowing&&null!==e.read());}function V(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function Z(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick($,t,e))}function $(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function J(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?Z(this):U(this),null;if(e=N(e,t),0===e&&t.ended)return 0===t.length&&Z(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?V(e,t):null,null===a?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&Z(this)),null!==a&&this.emit("data",a),a},P.prototype._read=function(e){A(this,new _("_read()"))},P.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e);break}a.pipesCount+=1,u("pipe count=%d opts=%j",a.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr,f=c?d:v;function o(e,t){u("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,h())}function d(){u("onend"),e.end()}a.endEmitted?n.nextTick(f):r.once("end",f),e.on("unpipe",o);var s=H(r);e.on("drain",s);var b=!1;function h(){u("cleanup"),e.removeListener("close",x),e.removeListener("finish",m),e.removeListener("drain",s),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",d),r.removeListener("end",v),r.removeListener("data",l),b=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}function l(t){u("ondata");var n=e.write(t);u("dest.write",n),!1===n&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==J(a.pipes,e))&&!b&&(u("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function p(t){u("onerror",t),v(),e.removeListener("error",p),0===i(e,"error")&&A(e,t)}function x(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",x),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",l),E(e,"error",p),e.once("close",x),e.once("finish",m),e.emit("pipe",r),a.flowing||(u("pipe resume"),r.resume()),e},P.prototype.unpipe=function(e){var t=this._readableState,r={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,r)),this;if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==a.flowing&&this.resume()):"readable"===e&&(a.endEmitted||a.readableListening||(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,u("on readable",a.length,a.reading),a.length?U(this):a.reading||n.nextTick(z,this))),r},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(q,this),r},P.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(q,this),t},P.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,K(this,e)),e.paused=!1,this},P.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){if(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),(!r.objectMode||null!==n&&void 0!==n)&&(r.objectMode||n&&n.length)){var i=t.push(n);i||(a=!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(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new v("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var a=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||K(this,a,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=h.destroy,T.prototype._undestroy=h.undestroy,T.prototype._destroy=function(e,t){t(e)}},9637:function(e,t,r){"use strict";var a,n=r(96027);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=r(83210),f=Symbol("lastResolve"),o=Symbol("lastReject"),d=Symbol("error"),s=Symbol("ended"),u=Symbol("lastPromise"),b=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 r=e[h].read();null!==r&&(e[u]=null,e[f]=null,e[o]=null,t(l(r,!1)))}}function x(e){n.nextTick(p,e)}function m(e,t){return function(r,a){e.then((function(){t[s]?r(l(void 0,!0)):t[b](r,a)}),a)}}var v=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((a={get stream(){return this[h]},next:function(){var e=this,t=this[d];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,r){n.nextTick((function(){e[d]?r(e[d]):t(l(void 0,!0))}))}));var r,a=this[u];if(a)r=new Promise(m(a,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(l(i,!1));r=new Promise(this[b])}return this[u]=r,r}},i(a,Symbol.asyncIterator,(function(){return this})),i(a,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(l(void 0,!0))}))}))})),a),v),y=function(e){var t,r=Object.create(g,(t={},i(t,h,{value:e,writable:!0}),i(t,f,{value:null,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,d,{value:null,writable:!0}),i(t,s,{value:e._readableState.endEmitted,writable:!0}),i(t,b,{value:function(e,t){var a=r[h].read();a?(r[u]=null,r[f]=null,r[o]=null,e(l(a,!1))):(r[f]=e,r[o]=t)},writable:!0}),t));return r[u]=null,c(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[o];return null!==t&&(r[u]=null,r[f]=null,r[o]=null,t(e)),void(r[d]=e)}var a=r[f];null!==a&&(r[u]=null,r[f]=null,r[o]=null,a(l(void 0,!0))),r[s]=!0})),e.on("readable",x.bind(null,r)),r};e.exports=y},98947:function(e,t,r){"use strict";function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}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,r=""+t.data;while(t=t.next)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);var t=s.allocUnsafe(e>>>0),r=this.head,a=0;while(r)l(r.data,t,a),a+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),e-=i,0===e){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,a=1;r.data.copy(t),e-=r.data.length;while(r=r.next){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),e-=i,0===e){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:h,value:function(e,t){return b(this,n({},t,{depth:0,customInspect:!1}))}}]),e}()},47508:function(e,t,r){"use strict";var a=r(96027);function n(e,t){var r=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,a.nextTick(o,this,e)):a.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?a.nextTick(c,r):(r._writableState.errorEmitted=!0,a.nextTick(i,r,e)):a.nextTick(i,r,e):t?(a.nextTick(c,r),t(e)):a.nextTick(c,r)})),this)}function i(e,t){o(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 o(e,t){e.emit("error",t)}function d(e,t){var r=e._readableState,a=e._writableState;r&&r.autoDestroy||a&&a.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:n,undestroy:f,errorOrDestroy:d}},83210:function(e,t,r){"use strict";var a=r(55314).q.ERR_STREAM_PREMATURE_CLOSE;function n(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,a=new Array(r),n=0;n0;return s(e,c,f,(function(e){a||(a=e),e&&i.forEach(u),c||(i.forEach(u),n(a))}))}));return t.reduce(b)}e.exports=l},21938:function(e,t,r){"use strict";var a=r(55314).q.ERR_INVALID_OPT_VALUE;function n(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function i(e,t,r,i){var c=n(t,i,r);if(null!=c){if(!isFinite(c)||Math.floor(c)!==c||c<0){var f=i?r:"highWaterMark";throw new a(f,c)}return Math.floor(c)}return e.objectMode?16:16384}e.exports={getHighWaterMark:i}},13066:function(e,t,r){e.exports=r(43793).EventEmitter},98141:function(e,t,r){t=e.exports=r(50187),t.Stream=t,t.Readable=t,t.Writable=r(69621),t.Duplex=r(31418),t.Transform=r(87825),t.PassThrough=r(80214),t.finished=r(83210),t.pipeline=r(26708)},3128:function(e,t,r){"use strict";var a=r(15361).Buffer,n=r(81923),i=r(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],o=[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],d=[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],u=[0,1518500249,1859775393,2400959708,2840853838],b=[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,r,a,n,i,c,f){return l(e+(t^r^a)+i+c|0,f)+n|0}function x(e,t,r,a,n,i,c,f){return l(e+(t&r|~t&a)+i+c|0,f)+n|0}function m(e,t,r,a,n,i,c,f){return l(e+((t|~r)^a)+i+c|0,f)+n|0}function v(e,t,r,a,n,i,c,f){return l(e+(t&a|r&~a)+i+c|0,f)+n|0}function g(e,t,r,a,n,i,c,f){return l(e+(t^(r|~a))+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 r=0|this._a,a=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(r,a,n,i,h,e[f[A]],u[0],d[A]),E=g(y,w,M,_,k,e[o[A]],b[0],s[A])):A<32?(S=x(r,a,n,i,h,e[f[A]],u[1],d[A]),E=v(y,w,M,_,k,e[o[A]],b[1],s[A])):A<48?(S=m(r,a,n,i,h,e[f[A]],u[2],d[A]),E=m(y,w,M,_,k,e[o[A]],b[2],s[A])):A<64?(S=v(r,a,n,i,h,e[f[A]],u[3],d[A]),E=x(y,w,M,_,k,e[o[A]],b[3],s[A])):(S=g(r,a,n,i,h,e[f[A]],u[4],d[A]),E=p(y,w,M,_,k,e[o[A]],b[4],s[A])),r=h,h=i,i=l(n,10),n=a,a=S,y=k,k=_,_=l(M,10),M=w,w=E}var T=this._b+n+_|0;this._b=this._c+i+k|0,this._c=this._d+h+y|0,this._d=this._e+r+w|0,this._e=this._a+a+M|0,this._a=T},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=a.alloc?a.alloc(20):new a(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,r){"use strict";var a=r(15361)["Buffer"];r(21703),r(48675),r(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(r(63250));function c(e){if(Array.isArray(e)){for(var t=[],r=0;re.length)throw new Error("invalid rlp: total length is larger than the data");if(i=e.slice(r,s),0===i.length)throw new Error("invalid rlp, List has a invalid length");while(i.length)c=u(i),o.push(c.data),i=c.remainder;return{data:o,remainder:e.slice(s)}}function b(e){return"0x"===e.slice(0,2)}function h(e){return"string"!==typeof e?e:b(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 a.from(t,"hex")}function m(e){if(!a.isBuffer(e)){if("string"===typeof e)return b(e)?a.from(p(h(e)),"hex"):a.from(e);if("number"===typeof e||"bigint"===typeof e)return e?x(e):a.from([]);if(null===e||void 0===e)return a.from([]);if(e instanceof Uint8Array)return a.from(e);if(i.default.isBN(e))return a.from(e.toArray());throw new Error("invalid type")}return e}t.encode=c,t.decode=d,t.getLength=s},63250:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(6567).Buffer}catch(I){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){r(21703);var a=r(15361),n=a.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function c(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=a:(i(a,t),t.Buffer=c),i(n,c),c.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},c.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var a=n(e);return void 0!==t?"string"===typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},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 a.SlowBuffer(e)}},43353:function(e,t,r){r(21703);const a=r(9242),n=r(43793);var i="object"===typeof Reflect?Reflect:null,c=i&&"function"===typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function f(){n.call(this)}function o(e,t,r){try{c(e,t,r)}catch(a){setTimeout((()=>{throw a}))}}function d(e,t){for(var r=new Array(t),a=0;a0&&(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)o(f,this,t);else{var s=f.length,u=d(f,s);for(r=0;r=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var a=c(e);return t&&0!==t.length?"string"===typeof r?a.fill(t,r):a.fill(t):a.fill(0),a}),!f.kStringMaxLength)try{f.kStringMaxLength=a.binding("buffer").kStringMaxLength}catch(d){}f.constants||(f.constants={MAX_LENGTH:f.kMaxLength},f.kStringMaxLength&&(f.constants.MAX_STRING_LENGTH=f.kStringMaxLength)),e.exports=f},80014:function(e,t,r){"use strict";r(48675),r(3462),r(21703),r(84633),function(t){const r=2147483647;function a(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 r=1779033703,a=3144134277,n=1013904242,i=2773480762,c=1359893119,f=2600822924,o=528734635,d=1541459225;const s=new Uint32Array(64);function u(e){let u=0,b=e.length;while(b>=64){let h,l,p,x,m,v=r,g=a,y=n,w=i,M=c,_=f,k=o,A=d;for(l=0;l<16;l++)p=u+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=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&g^v&y^g&y)|0,A=k,k=_,_=M,M=w+x|0,w=y,y=g,g=v,v=x+m|0;r=r+v|0,a=a+g|0,n=n+y|0,i=i+w|0,c=c+M|0,f=f+_|0,o=o+k|0,d=d+A|0,u+=64,b-=64}}u(e);let b,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),b=h+1;b>>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),u(m),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>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,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255]}function n(e,t,r){e=e.length<=64?e:a(e);const n=64+t.length+4,i=new Array(n),c=new Array(64);let f,o=[];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(r>=32)d(),o=o.concat(a(c.concat(a(i)))),r-=32;return r>0&&(d(),o=o.concat(a(c.concat(a(i))).slice(0,r))),o}function i(e,t,r,a,n){let i;for(d(e,16*(2*r-1),n,0,16),i=0;i<2*r;i++)o(e,16*i,n,16),f(n,a),d(n,0,e,t+16*i,16);for(i=0;i>>32-t}function f(e,t){d(e,0,t,0,16);for(let r=8;r>0;r-=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 r=0;r<16;++r)e[r]+=t[r]}function o(e,t,r,a){for(let n=0;n=256)return!1}return!0}function u(e,t){if("number"!==typeof e||e%1)throw new Error("invalid "+t);return e}function b(e,t,a,c,f,b,h){if(a=u(a,"N"),c=u(c,"r"),f=u(f,"p"),b=u(b,"dkLen"),0===a||0!==(a&a-1))throw new Error("N must be power of 2");if(a>r/128/c)throw new Error("N too large");if(c>r/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 r=0;rP&&(t=P);for(let e=0;eP&&(t=P);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 r=n(e,l,b);return h&&h(null,1,r),r}h&&I(B)};if(!h)while(1){const e=B();if(void 0!=e)return e}B()}const h={scrypt:function(e,t,r,a,n,i,c){return new Promise((function(f,o){let d=0;c&&c(0),b(e,t,r,a,n,i,(function(e,t,r){if(e)o(e);else if(r)c&&1!==d&&c(1),f(new Uint8Array(r));else if(c&&t!==d)return d=t,c(t)}))}))},syncScrypt:function(e,t,r,a,n,i){return new Uint8Array(b(e,t,r,a,n,i))}};e.exports=h}()},55899:function(e,t,r){e.exports=r(49338)(r(26951))},26951:function(e,t,r){r(48675),r(3462),r(21703);const a=r(32127).ec,n=new a("secp256k1"),i=n.curve,c=i.n.constructor;function f(e,t){let r=new c(t);if(r.cmp(i.p)>=0)return null;r=r.toRed(i.red);let a=r.redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===e!==a.isOdd()&&(a=a.redNeg()),n.keyPair({pub:{x:r,y:a}})}function o(e,t,r){let a=new c(t),f=new c(r);if(a.cmp(i.p)>=0||f.cmp(i.p)>=0)return null;if(a=a.toRed(i.red),f=f.toRed(i.red),(6===e||7===e)&&f.isOdd()!==(7===e))return null;const o=a.redSqr().redIMul(a);return f.redSqr().redISub(o.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:a,y:f}}):null}function d(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:o(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function s(e,t){const r=t.encode(null,33===e.length);for(let a=0;a=0)return 1;if(r.iadd(new c(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const a=r.toArrayLike(Uint8Array,"be",32);return e.set(a),0},privateKeyTweakMul(e,t){let r=new c(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new c(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const a=r.toArrayLike(Uint8Array,"be",32);return e.set(a),0},publicKeyVerify(e){const t=d(e);return null===t?1:0},publicKeyCreate(e,t){const r=new c(t);if(r.cmp(i.n)>=0||r.isZero())return 1;const a=n.keyFromPrivate(t).getPublic();return s(e,a),0},publicKeyConvert(e,t){const r=d(t);if(null===r)return 1;const a=r.getPublic();return s(e,a),0},publicKeyNegate(e,t){const r=d(t);if(null===r)return 1;const a=r.getPublic();return a.y=a.y.redNeg(),s(e,a),0},publicKeyCombine(e,t){const r=new Array(t.length);for(let n=0;n=0)return 2;const n=a.getPublic().add(i.g.mul(r));return n.isInfinity()?2:(s(e,n),0)},publicKeyTweakMul(e,t,r){const a=d(t);if(null===a)return 1;if(r=new c(r),r.cmp(i.n)>=0||r.isZero())return 2;const n=a.getPublic().mul(r);return s(e,n),0},signatureNormalize(e){const t=new c(e.subarray(0,32)),r=new c(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){const r=t.subarray(0,32),a=t.subarray(32,64);if(new c(r).cmp(i.n)>=0)return 1;if(new c(a).cmp(i.n)>=0)return 1;const{output:n}=e;let f=n.subarray(4,37);f[0]=0,f.set(r,1);let o=33,d=0;for(;o>1&&0===f[d]&&!(128&f[d+1]);--o,++d);if(f=f.subarray(d),128&f[0])return 1;if(o>1&&0===f[0]&&!(128&f[1]))return 1;let s=n.subarray(39,72);s[0]=0,s.set(a,1);let u=33,b=0;for(;u>1&&0===s[b]&&!(128&s[b+1]);--u,++b);return s=s.subarray(b),128&s[0]||u>1&&0===s[0]&&!(128&s[1])?1:(e.outputlen=6+o+u,n[0]=48,n[1]=e.outputlen-2,n[2]=2,n[3]=f.length,n.set(f,4),n[4+o]=2,n[5+o]=s.length,n.set(s,6+o),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 r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;const a=t[5+r];if(0===a)return 1;if(6+r+a!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(a>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let n=t.subarray(4,4+r);if(33===n.length&&0===n[0]&&(n=n.subarray(1)),n.length>32)return 1;let f=t.subarray(6+r);if(33===f.length&&0===f[0]&&(f=f.slice(1)),f.length>32)throw new Error("S length is too long");let o=new c(n);o.cmp(i.n)>=0&&(o=new c(0));let d=new c(t.subarray(6+r));return d.cmp(i.n)>=0&&(d=new c(0)),e.set(o.toArrayLike(Uint8Array,"be",32),0),e.set(d.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,a,f){if(f){const e=f;f=n=>{const i=e(t,r,null,a,n),f=i instanceof Uint8Array&&32===i.length;if(!f)throw new Error("This is the way");return new c(i)}}const o=new c(r);if(o.cmp(i.n)>=0||o.isZero())return 1;let d;try{d=n.sign(t,r,{canonical:!0,k:f,pers:a})}catch(s){return 1}return e.signature.set(d.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(d.s.toArrayLike(Uint8Array,"be",32),32),e.recid=d.recoveryParam,0},ecdsaVerify(e,t,r){const a={r:e.subarray(0,32),s:e.subarray(32,64)},f=new c(a.r),o=new c(a.s);if(f.cmp(i.n)>=0||o.cmp(i.n)>=0)return 1;if(1===o.cmp(n.nh)||f.isZero()||o.isZero())return 3;const s=d(r);if(null===s)return 2;const u=s.getPublic(),b=n.verify(t,a,u);return b?0:3},ecdsaRecover(e,t,r,a){const f={r:t.slice(0,32),s:t.slice(32,64)},o=new c(f.r),d=new c(f.s);if(o.cmp(i.n)>=0||d.cmp(i.n)>=0)return 1;if(o.isZero()||d.isZero())return 2;let u;try{u=n.recoverPubKey(a,f,r)}catch(b){return 2}return s(e,u),0},ecdh(e,t,r,a,f,o,s){const u=d(t);if(null===u)return 1;const b=new c(r);if(b.cmp(i.n)>=0||b.isZero())return 2;const h=u.getPublic().mul(b);if(void 0===f){const t=h.encode(null,!0),r=n.hash().update(t).digest();for(let a=0;a<32;++a)e[a]=r[a]}else{o||(o=new Uint8Array(32));const t=h.getX().toArray("be",32);for(let e=0;e<32;++e)o[e]=t[e];s||(s=new Uint8Array(32));const r=h.getY().toArray("be",32);for(let e=0;e<32;++e)s[e]=r[e];const n=f(o,s,a),i=n instanceof Uint8Array&&n.length===e.length;if(!i)return 2;e.set(n)}return 0}}},49338:function(e,t,r){r(21703),r(48675),r(3462);const a={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,r){if(n(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const a=r.join(", "),i=`Expected ${e} to be an Uint8Array with length [${a}]`;n(r.includes(t.length),i)}else{const a=`Expected ${e} to be an Uint8Array with length ${r}`;n(t.length===r,a)}}function c(e){n("Boolean"===o(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 o(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(a.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(a.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(t,r){switch(i("private key",t,32),i("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(a.TWEAK_ADD)}},privateKeyTweakMul(t,r){switch(i("private key",t,32),i("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(a.TWEAK_MUL)}},publicKeyVerify(t){return i("public key",t,[33,65]),0===e.publicKeyVerify(t)},publicKeyCreate(t,r=!0,n){switch(i("private key",t,32),c(r),n=f(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(a.SECKEY_INVALID);case 2:throw new Error(a.PUBKEY_SERIALIZE)}},publicKeyConvert(t,r=!0,n){switch(i("public key",t,[33,65]),c(r),n=f(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(a.PUBKEY_PARSE);case 2:throw new Error(a.PUBKEY_SERIALIZE)}},publicKeyNegate(t,r=!0,n){switch(i("public key",t,[33,65]),c(r),n=f(n,r?33:65),e.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(a.PUBKEY_PARSE);case 2:throw new Error(a.IMPOSSIBLE_CASE);case 3:throw new Error(a.PUBKEY_SERIALIZE)}},publicKeyCombine(t,r=!0,o){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(r),o=f(o,r?33:65),e.publicKeyCombine(o,t)){case 0:return o;case 1:throw new Error(a.PUBKEY_PARSE);case 2:throw new Error(a.PUBKEY_COMBINE);case 3:throw new Error(a.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(t,r,n=!0,o){switch(i("public key",t,[33,65]),i("tweak",r,32),c(n),o=f(o,n?33:65),e.publicKeyTweakAdd(o,t,r)){case 0:return o;case 1:throw new Error(a.PUBKEY_PARSE);case 2:throw new Error(a.TWEAK_ADD)}},publicKeyTweakMul(t,r,n=!0,o){switch(i("public key",t,[33,65]),i("tweak",r,32),c(n),o=f(o,n?33:65),e.publicKeyTweakMul(o,t,r)){case 0:return o;case 1:throw new Error(a.PUBKEY_PARSE);case 2:throw new Error(a.TWEAK_MUL)}},signatureNormalize(t){switch(i("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(a.SIG_PARSE)}},signatureExport(t,r){i("signature",t,64),r=f(r,72);const n={output:r,outputlen:72};switch(e.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(a.SIG_PARSE);case 2:throw new Error(a.IMPOSSIBLE_CASE)}},signatureImport(t,r){switch(i("signature",t),r=f(r,64),e.signatureImport(r,t)){case 0:return r;case 1:throw new Error(a.SIG_PARSE);case 2:throw new Error(a.IMPOSSIBLE_CASE)}},ecdsaSign(t,r,c={},d){i("message",t,32),i("private key",r,32),n("Object"===o(c),"Expected options to be an Object"),void 0!==c.data&&i("options.data",c.data),void 0!==c.noncefn&&n("Function"===o(c.noncefn),"Expected options.noncefn to be a Function"),d=f(d,64);const s={signature:d,recid:null};switch(e.ecdsaSign(s,t,r,c.data,c.noncefn)){case 0:return s;case 1:throw new Error(a.SIGN);case 2:throw new Error(a.IMPOSSIBLE_CASE)}},ecdsaVerify(t,r,n){switch(i("signature",t,64),i("message",r,32),i("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(a.SIG_PARSE);case 2:throw new Error(a.PUBKEY_PARSE)}},ecdsaRecover(t,r,d,s=!0,u){switch(i("signature",t,64),n("Number"===o(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),i("message",d,32),c(s),u=f(u,s?33:65),e.ecdsaRecover(u,t,r,d)){case 0:return u;case 1:throw new Error(a.SIG_PARSE);case 2:throw new Error(a.RECOVER);case 3:throw new Error(a.IMPOSSIBLE_CASE)}},ecdh(t,r,c={},d){switch(i("public key",t,[33,65]),i("private key",r,32),n("Object"===o(c),"Expected options to be an Object"),void 0!==c.data&&i("options.data",c.data),void 0!==c.hashfn?(n("Function"===o(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",d)):d=f(d,32),e.ecdh(d,t,r,c.data,c.hashfn,c.xbuf,c.ybuf)){case 0:return d;case 1:throw new Error(a.PUBKEY_PARSE);case 2:throw new Error(a.ECDH)}}})},46941:function(e,t,r){var a=r(96027);r(21703),function(t){"use strict";var r=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 r={n:1};"function"==typeof arguments[0]?r.task=arguments[0]:r.n=arguments[0],arguments.length>=2&&("function"==typeof arguments[1]?r.task=arguments[1]:r.n=arguments[1]);var a=r.task;if(r.task=function(){a(t.leave)},t.current+r.n-e>t.capacity)return 1===e&&(t.current--,t.firstHere=!1),t.queue.push(r);t.current+=r.n-e,r.task(t.leave),1===e&&(t.firstHere=!1)},leave:function(e){if(e=e||1,t.current-=e,t.queue.length){var a=t.queue[0];a.n+t.current>t.capacity||(t.queue.shift(),t.current+=a.n,r(a.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 a&&a&&"function"==typeof a.nextTick&&(r=a.nextTick),e.exports=n}()},37833:function(e,t,r){r(21703);var a=r(6779).Buffer;function n(e,t){this._block=a.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}n.prototype.update=function(e,t){"string"===typeof e&&(t=t||"utf8",e=a.from(e,t));for(var r=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 r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var a=(4294967295&r)>>>0,n=(r-a)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(a,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,r){r(21703);var a=e.exports=function(e){e=e.toLowerCase();var t=a[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};a.sha=r(96664),a.sha1=r(18272),a.sha224=r(52935),a.sha256=r(872),a.sha384=r(6461),a.sha512=r(82522)},96664:function(e,t,r){var a=r(81923),n=r(37833),i=r(6779).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function o(){this.init(),this._w=f,n.call(this,64,56)}function d(e){return e<<5|e>>>27}function s(e){return e<<30|e>>>2}function u(e,t,r,a){return 0===e?t&r|~t&a:2===e?t&r|t&a|r&a:t^r^a}a(o,n),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t=this._w,r=0|this._a,a=0|this._b,n=0|this._c,i=0|this._d,f=0|this._e,o=0;o<16;++o)t[o]=e.readInt32BE(4*o);for(;o<80;++o)t[o]=t[o-3]^t[o-8]^t[o-14]^t[o-16];for(var b=0;b<80;++b){var h=~~(b/20),l=d(r)+u(h,a,n,i)+f+t[b]+c[h]|0;f=i,i=n,n=s(a),a=r,r=l}this._a=r+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=f+this._e|0},o.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=o},18272:function(e,t,r){var a=r(81923),n=r(37833),i=r(6779).Buffer,c=[1518500249,1859775393,-1894007588,-899497514],f=new Array(80);function o(){this.init(),this._w=f,n.call(this,64,56)}function d(e){return e<<1|e>>>31}function s(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function b(e,t,r,a){return 0===e?t&r|~t&a:2===e?t&r|t&a|r&a:t^r^a}a(o,n),o.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},o.prototype._update=function(e){for(var t=this._w,r=0|this._a,a=0|this._b,n=0|this._c,i=0|this._d,f=0|this._e,o=0;o<16;++o)t[o]=e.readInt32BE(4*o);for(;o<80;++o)t[o]=d(t[o-3]^t[o-8]^t[o-14]^t[o-16]);for(var h=0;h<80;++h){var l=~~(h/20),p=s(r)+b(l,a,n,i)+f+t[h]+c[l]|0;f=i,i=n,n=u(a),a=r,r=p}this._a=r+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=f+this._e|0},o.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=o},52935:function(e,t,r){var a=r(81923),n=r(872),i=r(37833),c=r(6779).Buffer,f=new Array(64);function o(){this.init(),this._w=f,i.call(this,64,56)}a(o,n),o.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},o.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=o},872:function(e,t,r){var a=r(81923),n=r(37833),i=r(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 o(){this.init(),this._w=f,n.call(this,64,56)}function d(e,t,r){return r^e&(t^r)}function s(e,t,r){return e&t|r&(e|t)}function u(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function b(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}a(o,n),o.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},o.prototype._update=function(e){for(var t=this._w,r=0|this._a,a=0|this._b,n=0|this._c,i=0|this._d,f=0|this._e,o=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 v=0;v<64;++v){var g=x+b(f)+d(f,o,p)+c[v]+t[v]|0,y=u(r)+s(r,a,n)|0;x=p,p=o,o=f,f=i+g|0,i=n,n=a,a=r,r=g+y|0}this._a=r+this._a|0,this._b=a+this._b|0,this._c=n+this._c|0,this._d=i+this._d|0,this._e=f+this._e|0,this._f=o+this._f|0,this._g=p+this._g|0,this._h=x+this._h|0},o.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=o},6461:function(e,t,r){var a=r(81923),n=r(82522),i=r(37833),c=r(6779).Buffer,f=new Array(160);function o(){this.init(),this._w=f,i.call(this,128,112)}a(o,n),o.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},o.prototype._hash=function(){var e=c.allocUnsafe(48);function t(t,r,a){e.writeInt32BE(t,a),e.writeInt32BE(r,a+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=o},82522:function(e,t,r){var a=r(81923),n=r(37833),i=r(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 o(){this.init(),this._w=f,n.call(this,128,112)}function d(e,t,r){return r^e&(t^r)}function s(e,t,r){return e&t|r&(e|t)}function u(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function b(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}a(o,n),o.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},o.prototype._update=function(e){for(var t=this._w,r=0|this._ah,a=0|this._bh,n=0|this._ch,i=0|this._dh,f=0|this._eh,o=0|this._fh,v=0|this._gh,g=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,T=0;T<32;T+=2)t[T]=e.readInt32BE(4*T),t[T+1]=e.readInt32BE(4*T+4);for(;T<160;T+=2){var P=t[T-30],I=t[T-30+1],B=h(P,I),C=l(I,P);P=t[T-4],I=t[T-4+1];var O=p(P,I),R=x(I,P),N=t[T-14],L=t[T-14+1],U=t[T-32],j=t[T-32+1],F=C+L|0,D=B+N+m(F,C)|0;F=F+R|0,D=D+O+m(F,R)|0,F=F+j|0,D=D+U+m(F,j)|0,t[T]=D,t[T+1]=F}for(var H=0;H<160;H+=2){D=t[H],F=t[H+1];var q=s(r,a,n),z=s(y,w,M),K=u(r,y),W=u(y,r),G=b(f,k),V=b(k,f),Z=c[H],$=c[H+1],J=d(f,o,v),Y=d(k,A,S),X=E+V|0,Q=g+G+m(X,E)|0;X=X+Y|0,Q=Q+J+m(X,Y)|0,X=X+$|0,Q=Q+Z+m(X,$)|0,X=X+F|0,Q=Q+D+m(X,F)|0;var ee=W+z|0,te=K+q+m(ee,W)|0;g=v,E=S,v=o,S=A,o=f,A=k,k=_+X|0,f=i+Q+m(k,_)|0,i=n,_=M,n=a,M=w,a=r,w=y,y=X+ee|0,r=Q+te+m(y,X)|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+r+m(this._al,y)|0,this._bh=this._bh+a+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+o+m(this._fl,A)|0,this._gh=this._gh+v+m(this._gl,S)|0,this._hh=this._hh+g+m(this._hl,E)|0},o.prototype._hash=function(){var e=i.allocUnsafe(64);function t(t,r,a){e.writeInt32BE(t,a),e.writeInt32BE(r,a+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=o},36189:function(e,t,r){"use strict";r(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 r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+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,r){"use strict";r(21703);var a=r(54304).Buffer,n=a.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&&(a.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=u,t=4;break;case"base64":this.text=x,this.end=m,t=3;break;default:return this.write=v,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=a.allocUnsafe(t)}function o(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function d(e,t,r){var a=t.length-1;if(a=0?(n>0&&(e.lastNeed=n-1),n):--a=0?(n>0&&(e.lastNeed=n-2),n):--a=0?(n>0&&(2===n?n=0:e.lastNeed=n-3),n):0))}function s(e,t,r){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 u(e){var t=this.lastTotal-this.lastNeed,r=s(this,e,t);return void 0!==r?r: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 b(e,t){var r=d(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)}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 r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}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 r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function x(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}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 v(e){return e.toString(this.encoding)}function g(e){return e&&e.length?this.write(e):""}t.s=f,f.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r */ var a=r(15361),n=a.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function c(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=a:(i(a,t),t.Buffer=c),c.prototype=Object.create(n.prototype),i(n,c),c.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},c.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var a=n(e);return void 0!==t?"string"===typeof r?a.fill(t,r):a.fill(t):a.fill(0),a},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 a.SlowBuffer(e)}},99468:function(e,t,r){var a=r(44866);e.exports=function(e){return"string"!==typeof e?e:a(e)?e.slice(2):e}},81776:function(e,t,r){var a=function(){throw"This swarm.js function isn't available on the browser."},n={readFile:a},i={download:a,safeDownloadArchived:a,directoryTree:a},c={platform:a,arch:a},f={join:a,slice:a},o={spawn:a},d={lookup:a},s={},u=null,b=r(13123),h=r(33239),l=r(9193),p=r(77166),x=r(1717);e.exports=x({fs:n,files:i,os:c,path:f,child_process:o,defaultArchives:s,mimetype:d,request:b,downloadUrl:u,bytes:h,hash:l,pick:p})},77166:function(e,t,r){r(48675),r(3462);var a=function(e){return function(){return new Promise((function(t,r){var a,n=function(r){var a={},n=r.target.files.length,i=0;[].map.call(r.target.files,(function(r){var c=new FileReader;c.onload=function(c){var f=new Uint8Array(c.target.result);if("directory"===e){var o=r.webkitRelativePath;a[o.slice(o.indexOf("/")+1)]={type:"text/plain",data:f},++i===n&&t(a)}else if("file"===e){var d=r.webkitRelativePath;t({type:mimetype.lookup(d),data:f})}else t(f)},c.readAsArrayBuffer(r)}))};"directory"===e?(a=document.createElement("input"),a.addEventListener("change",n),a.type="file",a.webkitdirectory=!0,a.mozdirectory=!0,a.msdirectory=!0,a.odirectory=!0,a.directory=!0):(a=document.createElement("input"),a.addEventListener("change",n),a.type="file");var i=document.createEvent("MouseEvents");i.initEvent("click",!0,!1),a.dispatchEvent(i)}))}};e.exports={data:a("data"),file:a("file"),directory:a("directory")}},9193:function(e,t,r){var a=r(50849).keccak256,n=r(33239),i=function(e,t){var r=n.reverse(n.pad(6,n.fromNumber(e))),i=n.flatten([r,"0x0000",t]);return a(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 r=n.length(t);if(r<=4096)return i(r,t);var a=4096;while(128*a=400?a(new Error("Error ".concat(n.statusCode,"."))):r(new Uint8Array(t))}))}))}},v=function(e){return function(t){var r=function t(r){return function(a){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)(a+e.path)(n):Promise.resolve(h(a+e.path)(i(e))(n))};return m(e)(r).then((function(e){return JSON.parse(F(e)).entries})).then((function(e){return Promise.all(e.map(c))})).then((function(){return n}))}}};return r(t)("")({})}},g=function(e){return function(t){return v(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 v(e)(t).then((function(t){var r=Object.keys(t),a=r.map((function(e){return t[e].hash})),n=r.map((function(e){return t[e].type})),i=a.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(r)(c(e))}))}))}},w=function(e){return function(t){return function(a){return r.download(x(e)(t))(a)}}},M=function(e){return function(t){return function(r){return g(e)(t).then((function(t){var a=[];for(var i in t)if(i.length>0){var c=n.join(r,i);a.push(w(e)(t[i])(c))}return Promise.all(a).then((function(){return r}))}))}}},_=function(e){return function(t){return new Promise((function(r,a){var n={body:"string"===typeof t?D(t):t,method:"POST"};o("".concat(e,"/bzz-raw:/"),n,(function(e,t){return e?a(e):r(t)}))}))}},k=function(e){return function(t){return function(r){return function(a){var n=function n(i){var c="/"===r[0]?r:"/"+r,f="".concat(e,"/bzz:/").concat(t).concat(c),d={method:"PUT",headers:{"Content-Type":a.type},body:a.data};return new Promise((function(e,t){o(f,d,(function(r,a){return r?t(r):-1!==a.indexOf("error")?t(a):e(a)}))}))["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(r){return t.readFile(r).then((function(t){return A(e)({type:c.lookup(r),data:t})}))}},E=function(e){return function(t){return _(e)("{}").then((function(r){var a=function(r){return function(a){return k(e)(a)(r)(t[r])}},n=function(e,t){return e.then(a(t))};return Object.keys(t).reduce(n,Promise.resolve(r))}))}},T=function(e){return function(r){return t.readFile(r).then(_(e))}},P=function(e){return function(a){return function(n){return r.directoryTree(n).then((function(e){return Promise.all(e.map((function(e){return t.readFile(e)}))).then((function(t){var r=e.map((function(e){return e.slice(n.length)})),a=e.map((function(e){return c.lookup(e)||"text/plain"}));return l(r)(t.map((function(e,t){return{type:a[t],data:e}})))}))})).then((function(e){return p(a?{"":e[a]}:{})(e)})).then(E(e))}}},I=function(e){return function(t){if("data"===t.pick)return b.data().then(_(e));if("file"===t.pick)return b.file().then(A(e));if("directory"===t.pick)return b.directory().then(E(e));if(t.path)switch(t.kind){case"data":return T(e)(t.path);case"file":return S(e)(t.path);case"directory":return P(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"))}},B=function(e){return function(t){return function(r){return U(e)(t).then((function(a){return a?r?M(e)(t)(r):y(e)(t):r?w(e)(t)(r):m(e)(t)}))}}},C=function(e,t){var n=a.platform().replace("win32","windows")+"-"+("x64"===a.arch()?"amd64":"386"),i=(t||f)[n],c=d+i.archive+".tar.gz",o=i.archiveMD5,s=i.binaryMD5;return r.safeDownloadArchived(c)(o)(s)(e)},O=function(e){return new Promise((function(t,r){var a=i.spawn,n=function(e){return function(t){return-1!==(""+t).indexOf(e)}},c=e.account,f=e.password,o=e.dataDir,d=e.ensApi,s=e.privateKey,u=0,b=1,h=2,l="Passphrase",p="Swarm http proxy started",x=u,m=a(e.binPath,["--bzzaccount",c||s,"--datadir",o,"--ens-api",d]),v=function(e){x===u&&n(l)(e)?setTimeout((function(){x=b,m.stdin.write(f+"\n")}),500):n(p)(e)&&(x=h,clearTimeout(y),t(m))};m.stdout.on("data",v),m.stderr.on("data",v);var g=function(){return r(new Error("Couldn't start swarm process."))},y=setTimeout(g,2e4)}))},R=function(e){return new Promise((function(t,r){e.stderr.removeAllListeners("data"),e.stdout.removeAllListeners("data"),e.stdin.removeAllListeners("error"),e.removeAllListeners("error"),e.removeAllListeners("exit"),e.kill("SIGINT");var a=setTimeout((function(){return e.kill("SIGKILL")}),8e3);e.once("close",(function(){clearTimeout(a),t()}))}))},N=function(e){return function(t){return L("http://localhost:8500").then((function(r){return r?t(H("http://localhost:8500")).then((function(){})):C(e.binPath,e.archives).onData((function(t){return(e.onProgress||function(){})(t.length)})).then((function(){return O(e)})).then((function(e){return t(H("http://localhost:8500")).then((function(){return e}))})).then(R)}))}},L=function(e){var t="test",r="c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7";return _(e)(t).then((function(e){return e===r}))["catch"]((function(){return!1}))},U=function(e){return function(t){return m(e)(t).then((function(e){try{return!!JSON.parse(F(e)).entries}catch(t){return!1}}))}},j=function(e){return function(t,r,a,n,i){var c;return"undefined"!==typeof t&&(c=e(t)),"undefined"!==typeof r&&(c=e(r)),"undefined"!==typeof a&&(c=e(a)),"undefined"!==typeof n&&(c=e(n)),"undefined"!==typeof i&&(c=e(i)),c}},F=function(e){return s.toString(s.fromUint8Array(e))},D=function(e){return s.toUint8Array(s.fromString(e))},H=function(e){return{download:function(t,r){return B(e)(t)(r)},downloadData:j(m(e)),downloadDataToDisk:j(w(e)),downloadDirectory:j(y(e)),downloadDirectoryToDisk:j(M(e)),downloadEntries:j(v(e)),downloadRoutes:j(g(e)),isAvailable:function(){return L(e)},upload:function(t){return I(e)(t)},uploadData:j(_(e)),uploadFile:j(A(e)),uploadFileFromDisk:j(A(e)),uploadDataFromDisk:j(T(e)),uploadDirectory:j(E(e)),uploadDirectoryFromDisk:j(P(e)),uploadToManifest:j(k(e)),pick:b,hash:u,fromString:D,toString:F}};return{at:H,local:N,download:B,downloadBinary:C,downloadData:m,downloadDataToDisk:w,downloadDirectory:y,downloadDirectoryToDisk:M,downloadEntries:v,downloadRoutes:g,isAvailable:L,startProcess:O,stopProcess:R,upload:I,uploadData:_,uploadDataFromDisk:T,uploadFile:A,uploadFileFromDisk:S,uploadDirectory:E,uploadDirectoryFromDisk:P,uploadToManifest:k,pick:b,hash:u,fromString:D,toString:F}}},83545:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],a=0;a=0;f--)(n=e[f])&&(c=(i<3?n(c):i>3?n(t,r,c):n(t,r))||c);return i>3&&c&&Object.defineProperty(t,r,c),c}function o(e,t){return function(r,a){t(r,a,e)}}function d(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function s(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function c(e){try{o(a.next(e))}catch(t){i(t)}}function f(e){try{o(a["throw"](e))}catch(t){i(t)}}function o(e){e.done?r(e.value):n(e.value).then(c,f)}o((a=a.apply(e,t||[])).next())}))}function u(e,t){var r,a,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 o([e,t])}}function o(i){if(r)throw new TypeError("Generator is already executing.");while(c)try{if(r=1,a&&(n=2&i[0]?a["return"]:i[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,i[1])).done)return n;switch(a=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++,a=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[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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{o(n[e](t))}catch(r){u(i[0][3],r)}}function o(e){e.value instanceof g?Promise.resolve(e.value.v).then(d,s):u(i[0][2],e)}function d(e){f("next",e)}function s(e){f("throw",e)}function u(e,t){e(t),i.shift(),i.length&&f(i[0][0],i[0][1])}}function w(e){var t,r;return t={},a("next"),a("throw",(function(e){throw e})),a("return"),t[Symbol.iterator]=function(){return this},t;function a(a,n){t[a]=e[a]?function(t){return(r=!r)?{value:g(e[a](t)),done:"return"===a}:n?n(t):t}:n}}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"===typeof l?l(e):e[Symbol.iterator](),t={},a("next"),a("throw"),a("return"),t[Symbol.asyncIterator]=function(){return this},t);function a(r){t[r]=e[r]&&function(t){return new Promise((function(a,i){t=e[r](t),n(a,i,t.done,t.value)}))}}function n(e,t,r,a){Promise.resolve(a).then((function(t){e({value:t,done:r})}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&b(t,e,r);return k(t,e),t}function S(e){return e&&e.__esModule?e:{default:e}}function E(e,t,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)}function T(e,t,r,a,n){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!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"===a?n.call(e,r):n?n.value=r:t.set(e,r),r}},75519:function(e,t,r){var a=r(15361)["Buffer"],n=r(6513).strict;e.exports=function(e){if(n(e)){var t=a.from(e.buffer);return e.byteLength!==e.buffer.byteLength&&(t=t.slice(e.byteOffset,e.byteOffset+e.byteLength)),t}return a.from(e)}},27285:function(e){function t(e,t){if(t){t=t.trim().replace(/^(\?|#|&)/,""),t=t?"?"+t:t;var r=e.split(/[\?\#]/),a=r[0];t&&/\:\/\/[^\/]*$/.test(a)&&(a+="/");var n=e.match(/(\#.*)$/);e=a+t,n&&(e+=n[0])}return e}e.exports=t},62059:function(e,t,r){r(21703),function(e){var t,r,a,n=String.fromCharCode;function i(e){var t,r,a=[],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 o(e,t){return n(e>>t&63|128)}function d(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+=o(e,6)):0==(4292870144&e)&&(t=n(e>>18&7|240),t+=o(e,12),t+=o(e,6)),t+=n(63&e|128),t}function s(e){var t,r=i(e),a=r.length,n=-1,c="";while(++n=r)throw Error("Invalid byte index");var e=255&t[a];if(a++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function b(){var e,n,i,c,o;if(a>r)throw Error("Invalid byte index");if(a==r)return!1;if(e=255&t[a],a++,0==(128&e))return e;if(192==(224&e)){if(n=u(),o=(31&e)<<6|n,o>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&e)){if(n=u(),i=u(),o=(15&e)<<12|n<<6|i,o>=2048)return f(o),o;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=u(),i=u(),c=u(),o=(7&e)<<18|n<<12|i<<6|c,o>=65536&&o<=1114111))return o;throw Error("Invalid UTF-8 detected")}function h(e){t=i(e),r=t.length,a=0;var n,f=[];while(!1!==(n=b()))f.push(n);return c(f)}e.version="3.0.0",e.encode=s,e.decode=h}(t)},74633:function(e,t,r){function a(e,t){if(n("noDeprecation"))return e;var r=!1;function a(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return a}function n(e){try{if(!r.g.localStorage)return!1}catch(a){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}r(21703),e.exports=a},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,r){"use strict";r(48675),r(3462),r(21703);var a=r(32773),n=r(84784),i=r(12591),c=r(18300);function f(e){return e.call.bind(e)}var o="undefined"!==typeof BigInt,d="undefined"!==typeof Symbol,s=f(Object.prototype.toString),u=f(Number.prototype.valueOf),b=f(String.prototype.valueOf),h=f(Boolean.prototype.valueOf);if(o)var l=f(BigInt.prototype.valueOf);if(d)var p=f(Symbol.prototype.valueOf);function x(e,t){if("object"!==typeof e)return!1;try{return t(e),!0}catch(r){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 v(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):c(e)||H(e)}function g(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 T(e){return"BigInt64Array"===i(e)}function P(e){return"BigUint64Array"===i(e)}function I(e){return"[object Map]"===s(e)}function B(e){return"undefined"!==typeof Map&&(I.working?I(e):e instanceof Map)}function C(e){return"[object Set]"===s(e)}function O(e){return"undefined"!==typeof Set&&(C.working?C(e):e instanceof Set)}function R(e){return"[object WeakMap]"===s(e)}function N(e){return"undefined"!==typeof WeakMap&&(R.working?R(e):e instanceof WeakMap)}function L(e){return"[object WeakSet]"===s(e)}function U(e){return L(e)}function j(e){return"[object ArrayBuffer]"===s(e)}function F(e){return"undefined"!==typeof ArrayBuffer&&(j.working?j(e):e instanceof ArrayBuffer)}function D(e){return"[object DataView]"===s(e)}function H(e){return"undefined"!==typeof DataView&&(D.working?D(e):e instanceof DataView)}t.isArgumentsObject=a,t.isGeneratorFunction=n,t.isTypedArray=c,t.isPromise=m,t.isArrayBufferView=v,t.isUint8Array=g,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=T,t.isBigUint64Array=P,I.working="undefined"!==typeof Map&&I(new Map),t.isMap=B,C.working="undefined"!==typeof Set&&C(new Set),t.isSet=O,R.working="undefined"!==typeof WeakMap&&R(new WeakMap),t.isWeakMap=N,L.working="undefined"!==typeof WeakSet&&L(new WeakSet),t.isWeakSet=U,j.working="undefined"!==typeof ArrayBuffer&&j(new ArrayBuffer),t.isArrayBuffer=F,D.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&D(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=H;var q="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function z(e){return"[object SharedArrayBuffer]"===s(e)}function K(e){return"undefined"!==typeof q&&("undefined"===typeof z.working&&(z.working=z(new q)),z.working?z(e):e instanceof q)}function W(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 Z(e){return"[object Generator]"===s(e)}function $(e){return"[object WebAssembly.Module]"===s(e)}function J(e){return x(e,u)}function Y(e){return x(e,b)}function X(e){return x(e,h)}function Q(e){return o&&x(e,l)}function ee(e){return d&&x(e,p)}function te(e){return J(e)||Y(e)||X(e)||Q(e)||ee(e)}function re(e){return"undefined"!==typeof Uint8Array&&(F(e)||K(e))}t.isSharedArrayBuffer=K,t.isAsyncFunction=W,t.isMapIterator=G,t.isSetIterator=V,t.isGeneratorObject=Z,t.isWebAssemblyCompiledModule=$,t.isNumberObject=J,t.isStringObject=Y,t.isBooleanObject=X,t.isBigIntObject=Q,t.isSymbolObject=ee,t.isBoxedPrimitive=te,t.isAnyArrayBuffer=re,["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,r){var a=r(96027);r(21703);var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},a=0;a=n)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(t){return"[Circular]"}default:return e}})),f=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),y(r)?a.showHidden=r:r&&t._extend(a,r),S(a.showHidden)&&(a.showHidden=!1),S(a.depth)&&(a.depth=2),S(a.colors)&&(a.colors=!1),S(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=s),h(a,e,a.depth)}function s(e,t){var r=d.styles[t];return r?"["+d.colors[r][0]+"m"+e+"["+d.colors[r][1]+"m":e}function u(e,t){return e}function b(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}function h(e,r,a){if(e.customInspect&&r&&B(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return k(n)||(n=h(e,n,a)),n}var i=l(e,r);if(i)return i;var c=Object.keys(r),f=b(c);if(e.showHidden&&(c=Object.getOwnPropertyNames(r)),I(r)&&(c.indexOf("message")>=0||c.indexOf("description")>=0))return p(r);if(0===c.length){if(B(r)){var o=r.name?": "+r.name:"";return e.stylize("[Function"+o+"]","special")}if(E(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(P(r))return e.stylize(Date.prototype.toString.call(r),"date");if(I(r))return p(r)}var d,s="",u=!1,y=["{","}"];if(g(r)&&(u=!0,y=["[","]"]),B(r)){var w=r.name?": "+r.name:"";s=" [Function"+w+"]"}return E(r)&&(s=" "+RegExp.prototype.toString.call(r)),P(r)&&(s=" "+Date.prototype.toUTCString.call(r)),I(r)&&(s=" "+p(r)),0!==c.length||u&&0!=r.length?a<0?E(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),d=u?x(e,r,a,f,c):c.map((function(t){return m(e,r,a,f,t,u)})),e.seen.pop(),v(d,s,y)):y[0]+s+y[1]}function l(e,t){if(S(t))return e.stylize("undefined","undefined");if(k(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"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,r,a,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 v(e,t,r){var a=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return a>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function g(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 T(e)&&"[object RegExp]"===O(e)}function T(e){return"object"===typeof e&&null!==e}function P(e){return T(e)&&"[object Date]"===O(e)}function I(e){return T(e)&&("[object Error]"===O(e)||e instanceof Error)}function B(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 O(e){return Object.prototype.toString.call(e)}function R(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 r=a.pid;c[e]=function(){var a=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,a)}}else c[e]=function(){};return c[e]},t.inspect=d,d.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]},d.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(85716),t.isArray=g,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=T,t.isDate=P,t.types.isDate=P,t.isError=I,t.types.isNativeError=I,t.isFunction=B,t.isPrimitive=C,t.isBuffer=r(42051);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function L(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function U(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",L(),t.format.apply(t,arguments))},t.inherits=r(81923),t._extend=function(e,t){if(!t||!T(t))return e;var r=Object.keys(t),a=r.length;while(a--)e[r[a]]=t[r[a]];return e};var j="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function F(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function D(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r{if(t.content)return!0;const{content:r,showZero:a}=e;return(0,f.Xq)(r)&&""!==r&&(a||0!==r)},a=()=>{const{dot:a,max:n,content:i}=e;if(!a&&r())return t.content?t.content():(0,f.Xq)(n)&&(0,f.kE)(i)&&+i>n?`${n}+`:i},i=(0,n.Fl)((()=>{const r={background:e.color};if(e.offset){const[a,n]=e.offset;t.default?(r.top=(0,o.Nn)(n),r.right="number"===typeof a?(0,o.Nn)(-a):a.startsWith("-")?a.replace("-",""):`-${a}`):(r.marginTop=(0,o.Nn)(n),r.marginLeft=(0,o.Nn)(a))}return r})),c=()=>{if(r()||e.dot)return(0,n.Wm)("div",{class:s([e.position,{dot:e.dot,fixed:!!t.default}]),style:i.value},[a()])};return()=>{if(t.default){const{tag:r}=e;return(0,n.Wm)(r,{class:s("wrapper")},{default:()=>[t.default(),c()]})}return c()}}});const h=(0,a.n)(b)},51643:function(e,t,r){"use strict";r.d(t,{Z:function(){return v}});var a=r(8395),n=r(73396),i=r(62981),c=r(24452),f=r(65737),o=r(54005),d=r(11047),s=r(31900),u=r(10176),b=r(45512);const[h,l]=(0,i["do"])("button"),p=(0,c.l7)({},s.g2,{tag:(0,f.SQ)("button"),text:String,icon:String,type:(0,f.SQ)("default"),size:(0,f.SQ)("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:(0,f.SQ)("button"),loadingSize:f.Or,loadingText:String,loadingType:String,iconPosition:(0,f.SQ)("left")});var x=(0,n.aZ)({name:h,props:p,emits:["click"],setup(e,{emit:t,slots:r}){const a=(0,s.yj)(),i=()=>r.loading?r.loading():(0,n.Wm)(b.g,{size:e.loadingSize,type:e.loadingType,class:l("loading")},null),c=()=>e.loading?i():r.icon?(0,n.Wm)("div",{class:l("icon")},[r.icon()]):e.icon?(0,n.Wm)(u.J,{name:e.icon,class:l("icon"),classPrefix:e.iconPrefix},null):void 0,f=()=>{let t;if(t=e.loading?e.loadingText:r.default?r.default():e.text,t)return(0,n.Wm)("span",{class:l("text")},[t])},h=()=>{const{color:t,plain:r}=e;if(t){const e={color:r?t:"white"};return r||(e.background=t),t.includes("gradient")?e.border=0:e.borderColor=t,e}},p=r=>{e.loading?(0,o.PF)(r):e.disabled||(t("click",r),a())};return()=>{const{tag:t,type:r,size:a,block:i,round:o,plain:s,square:u,loading:b,disabled:x,hairline:m,nativeType:v,iconPosition:g}=e,y=[l([r,a,{plain:s,block:i,round:o,square:u,loading:b,disabled:x,hairline:m}]),{[d._K]:m}];return(0,n.Wm)(t,{type:v,class:y,style:h(),disabled:x,onClick:p},{default:()=>[(0,n.Wm)("div",{class:l("content")},["left"===g&&c(),f(),"right"===g&&c()])]})}}});const m=(0,a.n)(x);var v=m},10606:function(e,t,r){"use strict";r(31958),r(20368),r(56742),r(62939)},28355:function(e,t,r){"use strict";r.d(t,{Z:function(){return l},x:function(){return b}});var a=r(73396),n=r(62981),i=r(65737),c=r(24452),f=r(36300),o=r(31900),d=r(10176);const[s,u]=(0,n["do"])("cell"),b={icon:String,size:String,title:i.Or,value:i.Or,label:i.Or,center:Boolean,isLink:Boolean,border:i.J5,required:Boolean,iconPrefix:String,valueClass:i.Vg,labelClass:i.Vg,titleClass:i.Vg,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},h=(0,c.l7)({},b,o.g2);var l=(0,a.aZ)({name:s,props:h,setup(e,{slots:t}){const r=(0,o.yj)(),n=()=>{const r=t.label||(0,f.Xq)(e.label);if(r)return(0,a.Wm)("div",{class:[u("label"),e.labelClass]},[t.label?t.label():e.label])},i=()=>{if(t.title||(0,f.Xq)(e.title))return(0,a.Wm)("div",{class:[u("title"),e.titleClass],style:e.titleStyle},[t.title?t.title():(0,a.Wm)("span",null,[e.title]),n()])},c=()=>{const r=t.value||t.default,n=r||(0,f.Xq)(e.value);if(n){const n=t.title||(0,f.Xq)(e.title);return(0,a.Wm)("div",{class:[u("value",{alone:!n}),e.valueClass]},[r?r():(0,a.Wm)("span",null,[e.value])])}},s=()=>t.icon?t.icon():e.icon?(0,a.Wm)(d.J,{name:e.icon,class:u("left-icon"),classPrefix:e.iconPrefix},null):void 0,b=()=>{if(t["right-icon"])return t["right-icon"]();if(e.isLink){const t=e.arrowDirection?`arrow-${e.arrowDirection}`:"arrow";return(0,a.Wm)(d.J,{name:t,class:u("right-icon")},null)}};return()=>{var n,f;const{size:o,center:d,border:h,isLink:l,required:p}=e,x=null!=(n=e.clickable)?n:l,m={center:d,required:p,clickable:x,borderless:!h};return o&&(m[o]=!!o),(0,a.Wm)("div",{class:u(m),role:x?"button":void 0,tabindex:x?0:void 0,onClick:r},[s(),i(),c(),b(),null==(f=t.extra)?void 0:f.call(t)])}}})},26631:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var a=r(8395),n=r(28355);const i=(0,a.n)(n.Z)},71503:function(e,t,r){"use strict";r.d(t,{Z:function(){return M}});var a=r(8395),n=r(73396),i=r(49242),c=r(44870),f=r(28355),o=r(62981),d=r(24452),s=r(65737),u=r(3682),b=r(75634),h=r(10998),l=r(45978),p=r(26631);const[x,m]=(0,o["do"])("collapse-item"),v=["icon","title","value","label","right-icon"],g=(0,d.l7)({},f.x,{name:s.Or,isLink:s.J5,disabled:Boolean,readonly:Boolean,lazyRender:s.J5});var y=(0,n.aZ)({name:x,props:g,setup(e,{slots:t}){const r=(0,c.iH)(),a=(0,c.iH)(),{parent:o,index:s}=(0,b.NB)(u.g);if(!o)return void 0;const x=(0,n.Fl)((()=>{var t;return null!=(t=e.name)?t:s.value})),g=(0,n.Fl)((()=>o.isExpanded(x.value))),y=(0,c.iH)(g.value),w=(0,l.W)((()=>y.value||!e.lazyRender)),M=()=>{g.value?r.value&&(r.value.style.height=""):y.value=!1};(0,n.YP)(g,((e,t)=>{if(null===t)return;e&&(y.value=!0);const i=e?n.Y3:b.Wn;i((()=>{if(!a.value||!r.value)return;const{offsetHeight:t}=a.value;if(t){const a=`${t}px`;r.value.style.height=e?"0":a,(0,b.d1)((()=>{r.value&&(r.value.style.height=e?a:"0")}))}else M()}))}));const _=(e=!g.value)=>{o.toggle(x.value,e)},k=()=>{e.disabled||e.readonly||_()},A=()=>{const{border:r,disabled:a,readonly:i}=e,c=(0,d.ei)(e,Object.keys(f.x));return i&&(c.isLink=!1),(a||i)&&(c.clickable=!1),(0,n.Wm)(p.b,(0,n.dG)({role:"button",class:m("title",{disabled:a,expanded:g.value,borderless:!r}),"aria-expanded":String(g.value),onClick:k},c),(0,d.ei)(t,v))},S=w((()=>{var e;return(0,n.wy)((0,n.Wm)("div",{ref:r,class:m("wrapper"),onTransitionend:M},[(0,n.Wm)("div",{ref:a,class:m("content")},[null==(e=t.default)?void 0:e.call(t)])]),[[i.F8,y.value]])}));return(0,h.F)({toggle:_}),()=>(0,n.Wm)("div",{class:[m({border:s.value&&e.border})]},[A(),S()])}});const w=(0,a.n)(y);var M=w},57133:function(e,t,r){"use strict";r(31958),r(20368),r(56742),r(3094)},3682:function(e,t,r){"use strict";r.d(t,{Z:function(){return b},g:function(){return s}});var a=r(73396),n=r(62981),i=r(65737),c=r(11047),f=r(75634);const[o,d]=(0,n["do"])("collapse"),s=Symbol(o),u={border:i.J5,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var b=(0,a.aZ)({name:o,props:u,emits:["change","update:modelValue"],setup(e,{emit:t,slots:r}){const{linkChildren:n}=(0,f.$E)(s),i=e=>{t("change",e),t("update:modelValue",e)},o=(t,r)=>{const{accordion:a,modelValue:n}=e;i(a?t===n?"":t:r?n.concat(t):n.filter((e=>e!==t)))},u=t=>{const{accordion:r,modelValue:a}=e;return r?a===t:a.includes(t)};return n({toggle:o,isExpanded:u}),()=>{var t;return(0,a.Wm)("div",{class:[d(),{[c.r5]:e.border}]},[null==(t=r.default)?void 0:t.call(r)])}}})},44202:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(8395),n=r(3682);const i=(0,a.n)(n.Z);var c=i},72121:function(e,t,r){"use strict";r(31958)},57064:function(e,t,r){"use strict";r.d(t,{S:function(){return n},h:function(){return i}});var a=r(73396);const n=Symbol();function i(e){const t=(0,a.f3)(n,null);t&&(0,a.YP)(t,(t=>{t&&e()}))}},10998:function(e,t,r){"use strict";r.d(t,{F:function(){return i}});var a=r(73396),n=r(24452);function i(e){const t=(0,a.FN)();t&&(0,n.l7)(t.proxy,e)}},54049:function(e,t,r){"use strict";r.d(t,{M:function(){return i}});var a=r(73396);let n=0;function i(){const e=(0,a.FN)(),{name:t="unknown"}=(null==e?void 0:e.type)||{};return`${t}-${++n}`}},45978:function(e,t,r){"use strict";r.d(t,{W:function(){return i}});var a=r(44870),n=r(73396);function i(e){const t=(0,a.iH)(!1);return(0,n.YP)(e,(e=>{e&&(t.value=e)}),{immediate:!0}),e=>()=>t.value?e():null}},31900:function(e,t,r){"use strict";r.d(t,{BC:function(){return i},g2:function(){return n},yj:function(){return c}});var a=r(73396);const n={to:[String,Object],url:String,replace:Boolean};function i({to:e,url:t,replace:r,$router:a}){e&&a?a[r?"replace":"push"](e):t&&(r?location.replace(t):location.href=t)}function c(){const e=(0,a.FN)().proxy;return()=>i(e)}},65307:function(e,t,r){"use strict";r.d(t,{o:function(){return i}});var a=r(44870);function n(e,t){return e>t?"horizontal":t>e?"vertical":""}function i(){const e=(0,a.iH)(0),t=(0,a.iH)(0),r=(0,a.iH)(0),i=(0,a.iH)(0),c=(0,a.iH)(0),f=(0,a.iH)(0),o=(0,a.iH)(""),d=()=>"vertical"===o.value,s=()=>"horizontal"===o.value,u=()=>{r.value=0,i.value=0,c.value=0,f.value=0,o.value=""},b=r=>{u(),e.value=r.touches[0].clientX,t.value=r.touches[0].clientY},h=a=>{const d=a.touches[0];r.value=d.clientX<0?0:d.clientX-e.value,i.value=d.clientY-t.value,c.value=Math.abs(r.value),f.value=Math.abs(i.value);const s=10;(!o.value||c.value()=>t(e),v=x("open"),g=x("close"),y=x("opened"),w=()=>{a.showWrapper=!1,t("closed")},M=t=>{e.teleport&&t.stopPropagation()},_=(e=!a.showPopup,t={})=>{e!==a.showPopup&&(a.showPopup=e,a.transition=!t.immediate,e&&(a.showWrapper=!0))},k=()=>{if(r.title)return r.title();if(e.title)return e.title;const t=e.options.find((t=>t.value===e.modelValue));return t?t.text:""},A=r=>{const{activeColor:i}=f.props,c=r.value===e.modelValue,o=()=>{a.showPopup=!1,r.value!==e.modelValue&&(t("update:modelValue",r.value),t("change",r.value))},d=()=>{if(c)return(0,n.Wm)(l.J,{class:m("icon"),color:i,name:"success"},null)};return(0,n.Wm)(h.b,{role:"menuitem",key:r.value,icon:r.icon,title:r.text,class:m("option",{active:c}),style:{color:c?i:""},tabindex:c?0:-1,clickable:!0,onClick:o},{value:d})},S=()=>{const{offset:t}=f,{zIndex:c,overlay:s,duration:u,direction:b,closeOnClickOverlay:h}=f.props,l=(0,d.As)(c);return"down"===b?l.top=`${t.value}px`:l.bottom=`${t.value}px`,(0,n.wy)((0,n.Wm)("div",{style:l,class:m([b]),onClick:M},[(0,n.Wm)(p.G,{show:a.showPopup,"onUpdate:show":e=>a.showPopup=e,role:"menu",class:m("content"),overlay:s,position:"down"===b?"top":"bottom",duration:a.transition?u:0,lazyRender:e.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":`${f.id}-${o.value}`,closeOnClickOverlay:h,onOpen:v,onClose:g,onOpened:y,onClosed:w},{default:()=>{var t;return[e.options.map(A),null==(t=r.default)?void 0:t.call(r)]}})]),[[i.F8,a.showWrapper]])};return(0,b.F)({state:a,toggle:_,renderTitle:k}),()=>e.teleport?(0,n.Wm)(n.lR,{to:e.teleport},{default:()=>[S()]}):S()}});const y=(0,a.n)(g);var w=y},19692:function(e,t,r){"use strict";r(31958),r(20368),r(56742),r(3094),r(76196),r(22666),r(53532)},79199:function(e,t,r){"use strict";r.d(t,{L:function(){return p},Z:function(){return x}});var a=r(73396),n=r(44870),i=r(62981),c=r(65737),f=r(36300),o=r(54005),d=r(11047),s=r(54049),u=r(75634);const[b,h]=(0,i["do"])("dropdown-menu"),l={overlay:c.J5,zIndex:c.Or,duration:(0,c.SI)(.2),direction:(0,c.SQ)("down"),activeColor:String,closeOnClickOutside:c.J5,closeOnClickOverlay:c.J5},p=Symbol(b);var x=(0,a.aZ)({name:b,props:l,setup(e,{slots:t}){const r=(0,s.M)(),i=(0,n.iH)(),c=(0,n.iH)(),b=(0,n.iH)(0),{children:l,linkChildren:x}=(0,u.$E)(p),m=(0,u.eo)(i),v=(0,a.Fl)((()=>l.some((e=>e.state.showWrapper)))),g=(0,a.Fl)((()=>{if(v.value&&(0,f.Xq)(e.zIndex))return{zIndex:+e.zIndex+1}})),y=()=>{e.closeOnClickOutside&&l.forEach((e=>{e.toggle(!1)}))},w=()=>{if(c.value){const t=(0,u.EL)(c);"down"===e.direction?b.value=t.bottom:b.value=o.uK.value-t.top}},M=()=>{v.value&&w()},_=e=>{l.forEach(((t,r)=>{r===e?(w(),t.toggle()):t.state.showPopup&&t.toggle(!1,{immediate:!0})}))},k=(t,n)=>{const{showPopup:i}=t.state,{disabled:c,titleClass:f}=t;return(0,a.Wm)("div",{id:`${r}-${n}`,role:"button",tabindex:c?void 0:0,class:[h("item",{disabled:c}),{[d.e9]:!c}],onClick:()=>{c||_(n)}},[(0,a.Wm)("span",{class:[h("title",{down:i===("down"===e.direction),active:i}),f],style:{color:i?e.activeColor:""}},[(0,a.Wm)("div",{class:"van-ellipsis"},[t.renderTitle()])])])};return x({id:r,props:e,offset:b}),(0,u.Vd)(i,y),(0,u.OR)("scroll",M,{target:m}),()=>{var e;return(0,a.Wm)("div",{ref:i,class:h()},[(0,a.Wm)("div",{ref:c,style:g.value,class:h("bar",{opened:v.value})},[l.map(k)]),null==(e=t.default)?void 0:e.call(t)])}}})},96606:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(8395),n=r(79199);const i=(0,a.n)(n.Z);var c=i},74376:function(e,t,r){"use strict";r(31958),r(53532)},10176:function(e,t,r){"use strict";r.d(t,{J:function(){return g}});var a=r(8395),n=r(73396),i=r(62981),c=r(65737),f=r(43603),o=r(29061);const[d,s]=(0,i["do"])("config-provider"),u=Symbol(d),b={tag:(0,c.SQ)("div"),themeVars:Object,iconPrefix:String};function h(e){const t={};return Object.keys(e).forEach((r=>{t[`--van-${(0,f.GL)(r)}`]=e[r]})),t}(0,n.aZ)({name:d,props:b,setup(e,{slots:t}){const r=(0,n.Fl)((()=>{if(e.themeVars)return h(e.themeVars)}));return(0,n.JJ)(u,e),()=>(0,n.Wm)(e.tag,{class:s(),style:r.value},{default:()=>{var e;return[null==(e=t.default)?void 0:e.call(t)]}})}});const[l,p]=(0,i["do"])("icon"),x=e=>null==e?void 0:e.includes("/"),m={dot:Boolean,tag:(0,c.SQ)("i"),name:String,size:c.Or,badge:c.Or,color:String,badgeProps:Object,classPrefix:String};var v=(0,n.aZ)({name:l,props:m,setup(e,{slots:t}){const r=(0,n.f3)(u,null),a=(0,n.Fl)((()=>e.classPrefix||(null==r?void 0:r.iconPrefix)||p()));return()=>{const{tag:r,dot:i,name:c,size:d,badge:s,color:u}=e,b=x(c);return(0,n.Wm)(o.C,(0,n.dG)({dot:i,tag:r,class:[a.value,b?"":`${a.value}-${c}`],style:{color:u,fontSize:(0,f.Nn)(d)},content:s},e.badgeProps),{default:()=>{var e;return[null==(e=t.default)?void 0:e.call(t),b&&(0,n.Wm)("img",{class:p("image"),src:c},null)]}})}}});const g=(0,a.n)(v)},45512:function(e,t,r){"use strict";r.d(t,{g:function(){return p}});var a=r(8395),n=r(73396),i=r(62981),c=r(65737),f=r(24452),o=r(43603);const[d,s]=(0,i["do"])("loading"),u=Array(12).fill(null).map(((e,t)=>(0,n.Wm)("i",{class:s("line",String(t+1))},null))),b=(0,n.Wm)("svg",{class:s("circular"),viewBox:"25 25 50 50"},[(0,n.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),h={size:c.Or,type:(0,c.SQ)("circular"),color:String,vertical:Boolean,textSize:c.Or,textColor:String};var l=(0,n.aZ)({name:d,props:h,setup(e,{slots:t}){const r=(0,n.Fl)((()=>(0,f.l7)({color:e.color},(0,o.Xn)(e.size)))),a=()=>{var r;if(t.default)return(0,n.Wm)("span",{class:s("text"),style:{fontSize:(0,o.Nn)(e.textSize),color:null!=(r=e.textColor)?r:e.color}},[t.default()])};return()=>{const{type:t,vertical:i}=e;return(0,n.Wm)("div",{class:s([t,{vertical:i}])},[(0,n.Wm)("span",{class:s("spinner",t),style:r.value},["spinner"===t?u:b]),a()])}}});const p=(0,a.n)(l)},3412:function(e,t,r){"use strict";r.d(t,{a:function(){return m},Z:function(){return v}});var a=r(8395),n=r(73396),i=r(49242),c=r(62981),f=r(65737),o=r(54005),d=r(24452),s=r(43603),u=r(36300),b=r(45978);const[h,l]=(0,c["do"])("overlay"),p={show:Boolean,zIndex:f.Or,duration:f.Or,className:f.Vg,lockScroll:f.J5,lazyRender:f.J5,customStyle:Object};var x=(0,n.aZ)({name:h,props:p,setup(e,{slots:t}){const r=(0,b.W)((()=>e.show||!e.lazyRender)),a=e=>{(0,o.PF)(e,!0)},c=r((()=>{var r;const c=(0,d.l7)((0,s.As)(e.zIndex),e.customStyle);return(0,u.Xq)(e.duration)&&(c.animationDuration=`${e.duration}s`),(0,n.wy)((0,n.Wm)("div",{style:c,class:[l(),e.className],onTouchmove:e.lockScroll?a:d.ZT},[null==(r=t.default)?void 0:r.call(t)]),[[i.F8,e.show]])}));return()=>(0,n.Wm)(i.uT,{name:"van-fade",appear:!0},{default:c})}});const m=(0,a.n)(x);var v=m},53772:function(e,t,r){"use strict";r(31958),r(76196)},53504:function(e,t,r){"use strict";r.d(t,{G:function(){return I}});var a=r(8395),n=r(73396),i=r(49242),c=r(44870),f=r(65737);const o={show:Boolean,zIndex:f.Or,overlay:f.J5,duration:f.Or,teleport:[String,Object],lockScroll:f.J5,lazyRender:f.J5,beforeClose:Function,overlayStyle:Object,overlayClass:f.Vg,transitionAppear:Boolean,closeOnClickOverlay:f.J5};Object.keys(o);var d=r(24452),s=r(62981),u=r(36300),b=r(12556),h=r(11047),l=r(75634),p=r(10998),x=r(65307),m=r(54005);let v=0;const g="van-overflow-hidden";function y(e,t){const r=(0,x.o)(),a=t=>{r.move(t);const a=r.deltaY.value>0?"10":"01",n=(0,l.rP)(t.target,e.value),{scrollHeight:i,offsetHeight:c,scrollTop:f}=n;let o="11";0===f?o=c>=i?"00":"01":f+c>=i&&(o="10"),"11"===o||!r.isVertical()||parseInt(o,2)&parseInt(a,2)||(0,m.PF)(t,!0)},i=()=>{document.addEventListener("touchstart",r.start),document.addEventListener("touchmove",a,{passive:!1}),v||document.body.classList.add(g),v++},c=()=>{v&&(document.removeEventListener("touchstart",r.start),document.removeEventListener("touchmove",a),v--,v||document.body.classList.remove(g))},f=()=>t()&&i(),o=()=>t()&&c();(0,l.Ib)(f),(0,n.se)(o),(0,n.Jd)(o),(0,n.YP)(t,(e=>{e?i():c()}))}var w=r(45978),M=r(57064),_=r(10176),k=r(3412);const A=(0,d.l7)({},o,{round:Boolean,position:(0,f.SQ)("center"),closeIcon:(0,f.SQ)("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:(0,f.SQ)("top-right"),safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[S,E]=(0,s["do"])("popup");let T=2e3;var P=(0,n.aZ)({name:S,inheritAttrs:!1,props:A,emits:["open","close","opened","closed","keydown","update:show","click-overlay","click-close-icon"],setup(e,{emit:t,attrs:r,slots:a}){let f,o;const d=(0,c.iH)(),s=(0,c.iH)(),x=(0,w.W)((()=>e.show||!e.lazyRender)),m=(0,n.Fl)((()=>{const t={zIndex:d.value};if((0,u.Xq)(e.duration)){const r="center"===e.position?"animationDuration":"transitionDuration";t[r]=`${e.duration}s`}return t})),v=()=>{f||(void 0!==e.zIndex&&(T=+e.zIndex),f=!0,d.value=++T,t("open"))},g=()=>{f&&(0,b.I)(e.beforeClose,{done(){f=!1,t("close"),t("update:show",!1)}})},A=r=>{t("click-overlay",r),e.closeOnClickOverlay&&g()},S=()=>{if(e.overlay)return(0,n.Wm)(k.a,{show:e.show,class:e.overlayClass,zIndex:d.value,duration:e.duration,customStyle:e.overlayStyle,onClick:A},{default:a["overlay-content"]})},P=e=>{t("click-close-icon",e),g()},I=()=>{if(e.closeable)return(0,n.Wm)(_.J,{role:"button",tabindex:0,name:e.closeIcon,class:[E("close-icon",e.closeIconPosition),h.e9],classPrefix:e.iconPrefix,onClick:P},null)},B=()=>t("opened"),C=()=>t("closed"),O=e=>t("keydown",e),R=x((()=>{var t;const{round:c,position:f,safeAreaInsetTop:o,safeAreaInsetBottom:d}=e;return(0,n.wy)((0,n.Wm)("div",(0,n.dG)({ref:s,style:m.value,class:[E({round:c,[f]:f}),{"van-safe-area-top":o,"van-safe-area-bottom":d}],onKeydown:O},r),[null==(t=a.default)?void 0:t.call(a),I()]),[[i.F8,e.show]])})),N=()=>{const{position:t,transition:r,transitionAppear:a}=e,c="center"===t?"van-fade":`van-popup-slide-${t}`;return(0,n.Wm)(i.uT,{name:r||c,appear:a,onAfterEnter:B,onAfterLeave:C},{default:R})};return(0,n.YP)((()=>e.show),(e=>{e&&!f&&(v(),0===r.tabindex&&(0,n.Y3)((()=>{var e;null==(e=s.value)||e.focus()}))),!e&&f&&(f=!1,t("close"))})),(0,p.F)({popupRef:s}),y(s,(()=>e.show&&e.lockScroll)),(0,l.OR)("popstate",(()=>{e.closeOnPopstate&&(g(),o=!1)})),(0,n.bv)((()=>{e.show&&v()})),(0,n.dl)((()=>{o&&(t("update:show",!0),o=!1)})),(0,n.se)((()=>{e.show&&(g(),o=!0)})),(0,n.JJ)(M.S,(()=>e.show)),()=>e.teleport?(0,n.Wm)(n.lR,{to:e.teleport},{default:()=>[S(),N()]}):(0,n.Wm)(n.HY,null,[S(),N()])}});const I=(0,a.n)(P)},18700:function(e,t,r){"use strict";r.d(t,{P:function(){return x},Z:function(){return m}});var a=r(73396),n=r(44870),i=r(62981),c=r(65737),f=r(43603),o=r(54005),d=r(75634),s=r(65307),u=r(10998),b=r(57064);const[h,l]=(0,i["do"])("swipe"),p={loop:c.J5,width:c.Or,height:c.Or,vertical:Boolean,autoplay:(0,c.SI)(0),duration:(0,c.SI)(500),touchable:c.J5,lazyRender:Boolean,initialSwipe:(0,c.SI)(0),indicatorColor:String,showIndicators:c.J5,stopPropagation:c.J5},x=Symbol(h);var m=(0,a.aZ)({name:h,props:p,emits:["change"],setup(e,{emit:t,slots:r}){const i=(0,n.iH)(),c=(0,n.qj)({rect:null,width:0,height:0,offset:0,active:0,swiping:!1}),h=(0,s.o)(),{children:p,linkChildren:m}=(0,d.$E)(x),v=(0,a.Fl)((()=>p.length)),g=(0,a.Fl)((()=>c[e.vertical?"height":"width"])),y=(0,a.Fl)((()=>e.vertical?h.deltaY.value:h.deltaX.value)),w=(0,a.Fl)((()=>{if(c.rect){const t=e.vertical?c.rect.height:c.rect.width;return t-g.value*v.value}return 0})),M=(0,a.Fl)((()=>Math.ceil(Math.abs(w.value)/g.value))),_=(0,a.Fl)((()=>v.value*g.value)),k=(0,a.Fl)((()=>(c.active+v.value)%v.value)),A=(0,a.Fl)((()=>{const t=e.vertical?"vertical":"horizontal";return h.direction.value===t})),S=(0,a.Fl)((()=>{const t={transitionDuration:`${c.swiping?0:e.duration}ms`,transform:`translate${e.vertical?"Y":"X"}(${c.offset}px)`};if(g.value){const r=e.vertical?"height":"width",a=e.vertical?"width":"height";t[r]=`${_.value}px`,t[a]=e[a]?`${e[a]}px`:""}return t})),E=t=>{const{active:r}=c;return t?e.loop?(0,f.uZ)(r+t,-1,v.value):(0,f.uZ)(r+t,0,M.value):r},T=(t,r=0)=>{let a=t*g.value;e.loop||(a=Math.min(a,-w.value));let n=r-a;return e.loop||(n=(0,f.uZ)(n,w.value,0)),n},P=({pace:r=0,offset:a=0,emitChange:n})=>{if(v.value<=1)return;const{active:i}=c,f=E(r),o=T(f,a);if(e.loop){if(p[0]&&o!==w.value){const e=o0;p[v.value-1].setOffset(e?-_.value:0)}}c.active=f,c.offset=o,n&&f!==i&&t("change",k.value)},I=()=>{c.swiping=!0,c.active<=-1?P({pace:v.value}):c.active>=v.value&&P({pace:-v.value})},B=()=>{I(),h.reset(),(0,d.d1)((()=>{c.swiping=!1,P({pace:-1,emitChange:!0})}))},C=()=>{I(),h.reset(),(0,d.d1)((()=>{c.swiping=!1,P({pace:1,emitChange:!0})}))};let O;const R=()=>clearTimeout(O),N=()=>{R(),e.autoplay>0&&v.value>1&&(O=setTimeout((()=>{C(),N()}),+e.autoplay))},L=(t=+e.initialSwipe)=>{if(!i.value)return;const r=()=>{var r,a;if(!(0,o.xj)(i)){const t={width:i.value.offsetWidth,height:i.value.offsetHeight};c.rect=t,c.width=+(null!=(r=e.width)?r:t.width),c.height=+(null!=(a=e.height)?a:t.height)}v.value&&(t=Math.min(v.value-1,t)),c.active=t,c.swiping=!0,c.offset=T(t),p.forEach((e=>{e.setOffset(0)})),N()};(0,o.xj)(i)?(0,a.Y3)().then(r):r()},U=()=>L(c.active);let j;const F=t=>{e.touchable&&(h.start(t),j=Date.now(),R(),I())},D=t=>{e.touchable&&c.swiping&&(h.move(t),A.value&&((0,o.PF)(t,e.stopPropagation),P({offset:y.value})))},H=()=>{if(!e.touchable||!c.swiping)return;const t=Date.now()-j,r=y.value/t,a=Math.abs(r)>.25||Math.abs(y.value)>g.value/2;if(a&&A.value){const t=e.vertical?h.offsetY.value:h.offsetX.value;let r=0;r=e.loop?t>0?y.value>0?-1:1:0:-Math[y.value>0?"ceil":"floor"](y.value/g.value),P({pace:r,emitChange:!0})}else y.value&&P({pace:0});c.swiping=!1,N()},q=(t,r={})=>{I(),h.reset(),(0,d.d1)((()=>{let a;a=e.loop&&t===v.value?0===c.active?0:t:t%v.value,r.immediate?(0,d.d1)((()=>{c.swiping=!1})):c.swiping=!1,P({pace:a-c.active,emitChange:!0})}))},z=(t,r)=>{const n=r===k.value,i=n?{backgroundColor:e.indicatorColor}:void 0;return(0,a.Wm)("i",{style:i,class:l("indicator",{active:n})},null)},K=()=>r.indicator?r.indicator({active:k.value,total:v.value}):e.showIndicators&&v.value>1?(0,a.Wm)("div",{class:l("indicators",{vertical:e.vertical})},[Array(v.value).fill("").map(z)]):void 0;return(0,u.F)({prev:B,next:C,state:c,resize:U,swipeTo:q}),m({size:g,props:e,count:v,activeIndicator:k}),(0,a.YP)((()=>e.initialSwipe),(e=>L(+e))),(0,a.YP)(v,(()=>L(c.active))),(0,a.YP)((()=>e.autoplay),N),(0,a.YP)([o.bn,o.uK],U),(0,a.YP)((0,d.d9)(),(e=>{"visible"===e?N():R()})),(0,a.bv)(L),(0,a.dl)((()=>L(c.active))),(0,b.h)((()=>L(c.active))),(0,a.se)(R),(0,a.Jd)(R),()=>{var t;return(0,a.Wm)("div",{ref:i,class:l()},[(0,a.Wm)("div",{style:S.value,class:l("track",{vertical:e.vertical}),onTouchstart:F,onTouchmove:D,onTouchend:H,onTouchcancel:H},[null==(t=r.default)?void 0:t.call(r)]),K()])}}})},3233:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var a=r(8395),n=r(73396),i=r(49242),c=r(44870),f=r(62981),o=r(24452),d=r(65737),s=r(42238),u=r(75634),b=r(54049),h=r(10998),l=r(31900);const p=Symbol();var x=r(18700);const[m,v]=(0,f["do"])("swipe-item");var g=(0,n.aZ)({name:m,setup(e,{slots:t}){let r;const a=(0,c.qj)({offset:0,inited:!1,mounted:!1}),{parent:i,index:f}=(0,u.NB)(x.P);if(!i)return void 0;const o=(0,n.Fl)((()=>{const e={},{vertical:t}=i.props;return i.size.value&&(e[t?"height":"width"]=`${i.size.value}px`),a.offset&&(e.transform=`translate${t?"Y":"X"}(${a.offset}px)`),e})),d=(0,n.Fl)((()=>{const{loop:e,lazyRender:t}=i.props;if(!t||r)return!0;if(!a.mounted)return!1;const n=i.activeIndicator.value,c=i.count.value-1,o=0===n&&e?c:n-1,d=n===c&&e?0:n+1;return r=f.value===n||f.value===o||f.value===d,r})),s=e=>{a.offset=e};return(0,n.bv)((()=>{(0,n.Y3)((()=>{a.mounted=!0}))})),(0,h.F)({setOffset:s}),()=>{var e;return(0,n.Wm)("div",{class:v(),style:o.value},[d.value?null==(e=t.default)?void 0:e.call(t):null])}}});const y=(0,a.n)(g);const[w,M]=(0,f["do"])("tab"),_=(0,o.l7)({},l.g2,{dot:Boolean,name:d.Or,badge:d.Or,title:String,disabled:Boolean,titleClass:d.Vg,titleStyle:[String,Object],showZeroBadge:d.J5});var k=(0,n.aZ)({name:w,props:_,setup(e,{slots:t}){const r=(0,b.M)(),a=(0,c.iH)(!1),{parent:f,index:o}=(0,u.NB)(s.R);if(!f)return void 0;const d=()=>{var t;return null!=(t=e.name)?t:o.value},l=()=>{a.value=!0,f.props.lazyRender&&(0,n.Y3)((()=>{f.onRendered(d(),e.title)}))},x=(0,n.Fl)((()=>{const e=d()===f.currentName.value;return e&&!a.value&&l(),e}));return(0,n.YP)((()=>e.title),(()=>{f.setLine(),f.scrollIntoView()})),(0,n.JJ)(p,x),()=>{var e;const c=`${f.id}-${o.value}`,{animated:d,swipeable:s,scrollspy:u,lazyRender:b}=f.props;if(!t.default&&!d)return;const l=u||x.value;if(d||s)return(0,n.Wm)(y,{id:r,role:"tabpanel",class:M("panel-wrapper",{inactive:!x.value}),tabindex:x.value?0:-1,"aria-hidden":!x.value,"aria-labelledby":c},{default:()=>{var e;return[(0,n.Wm)("div",{class:M("panel")},[null==(e=t.default)?void 0:e.call(t)])]}});const p=a.value||u||!b,m=p?null==(e=t.default)?void 0:e.call(t):null;return(0,h.F)({id:r}),(0,n.wy)((0,n.Wm)("div",{id:r,role:"tabpanel",class:M("panel"),tabindex:l?0:-1,"aria-labelledby":c},[m]),[[i.F8,l]])}}});const A=(0,a.n)(k);var S=A},13599:function(e,t,r){"use strict";r(31958),r(20368),r(51771),r(89137),r(25338)},42238:function(e,t,r){"use strict";r.d(t,{R:function(){return D},Z:function(){return H}});var a=r(73396),n=r(44870),i=r(62981),c=r(65737),f=r(43603),o=r(54005),d=r(36300),s=r(12556),u=r(24452),b=r(11047),h=r(75634);function l(e,t,r){let a=0;const n=e.scrollLeft,i=0===r?1:Math.round(1e3*r/16);function c(){e.scrollLeft+=(t-n)/i,++at||!i&&nt?(0,h.Wn)(d):a&&(0,h.Wn)(a)}d()}var x=r(54049),m=r(31900);function v(){const e=(0,n.iH)([]),t=[];(0,a.Xn)((()=>{e.value=[]}));const r=r=>(t[r]||(t[r]=t=>{e.value[r]=t}),t[r]);return[e,r]}var g=r(10998),y=r(57064),w=r(8395);function M(e,t){if(!u._f||!window.IntersectionObserver)return;const r=new IntersectionObserver((e=>{t(e[0].intersectionRatio>0)}),{root:document.body}),n=()=>{e.value&&r.observe(e.value)},i=()=>{e.value&&r.unobserve(e.value)};(0,a.se)(i),(0,a.Jd)(i),(0,h.Ib)(n)}const[_,k]=(0,i["do"])("sticky"),A={zIndex:c.Or,position:(0,c.SQ)("top"),container:Object,offsetTop:(0,c.SI)(0),offsetBottom:(0,c.SI)(0)};var S=(0,a.aZ)({name:_,props:A,emits:["scroll","change"],setup(e,{emit:t,slots:r}){const i=(0,n.iH)(),c=(0,h.eo)(i),d=(0,n.qj)({fixed:!1,width:0,height:0,transform:0}),s=(0,a.Fl)((()=>(0,f.LU)("top"===e.position?e.offsetTop:e.offsetBottom))),b=(0,a.Fl)((()=>{const{fixed:e,height:t,width:r}=d;if(e)return{width:`${r}px`,height:`${t}px`}})),l=(0,a.Fl)((()=>{if(!d.fixed)return;const t=(0,u.l7)((0,f.As)(e.zIndex),{width:`${d.width}px`,height:`${d.height}px`,[e.position]:`${s.value}px`});return d.transform&&(t.transform=`translate3d(0, ${d.transform}px, 0)`),t})),p=e=>t("scroll",{scrollTop:e,isFixed:d.fixed}),x=()=>{if(!i.value||(0,o.xj)(i))return;const{container:t,position:r}=e,a=(0,h.EL)(i),n=(0,o.cx)(window);if(d.width=a.width,d.height=a.height,"top"===r)if(t){const e=(0,h.EL)(t),r=e.bottom-s.value-d.height;d.fixed=s.value>a.top&&e.bottom>0,d.transform=r<0?r:0}else d.fixed=s.value>a.top;else{const{clientHeight:e}=document.documentElement;if(t){const r=(0,h.EL)(t),n=e-r.top-s.value-d.height;d.fixed=e-s.valuer.top,d.transform=n<0?-n:0}else d.fixed=e-s.valued.fixed),(e=>t("change",e))),(0,h.OR)("scroll",x,{target:c}),M(i,x),()=>{var e;return(0,a.Wm)("div",{ref:i,style:b.value},[(0,a.Wm)("div",{class:k({fixed:d.fixed}),style:l.value},[null==(e=r.default)?void 0:e.call(r)])])}}});const E=(0,w.n)(S);var T=r(29061);const[P,I]=(0,i["do"])("tab");var B=(0,a.aZ)({name:P,props:{id:String,dot:Boolean,type:String,color:String,title:String,badge:c.Or,shrink:Boolean,isActive:Boolean,disabled:Boolean,controls:String,scrollable:Boolean,activeColor:String,inactiveColor:String,showZeroBadge:c.J5},setup(e,{slots:t}){const r=(0,a.Fl)((()=>{const t={},{type:r,color:a,disabled:n,isActive:i,activeColor:c,inactiveColor:f}=e,o="card"===r;a&&o&&(t.borderColor=a,n||(i?t.backgroundColor=a:t.color=a));const d=i?c:f;return d&&(t.color=d),t})),n=()=>{const r=(0,a.Wm)("span",{class:I("text",{ellipsis:!e.scrollable})},[t.title?t.title():e.title]);return e.dot||(0,d.Xq)(e.badge)&&""!==e.badge?(0,a.Wm)(T.C,{dot:e.dot,content:e.badge,showZero:e.showZeroBadge},{default:()=>[r]}):r};return()=>(0,a.Wm)("div",{id:e.id,role:"tab",class:[I([e.type,{grow:e.scrollable&&!e.shrink,shrink:e.shrink,active:e.isActive,disabled:e.disabled}])],style:r.value,tabindex:e.disabled?void 0:e.isActive?0:-1,"aria-selected":e.isActive,"aria-disabled":e.disabled||void 0,"aria-controls":e.controls},[n()])}}),C=r(18700);const O=(0,w.n)(C.Z);const[R,N]=(0,i["do"])("tabs");var L=(0,a.aZ)({name:R,props:{count:(0,c.ir)(Number),inited:Boolean,animated:Boolean,duration:(0,c.ir)(c.Or),swipeable:Boolean,lazyRender:Boolean,currentIndex:(0,c.ir)(Number)},emits:["change"],setup(e,{emit:t,slots:r}){const i=(0,n.iH)(),c=e=>t("change",e),f=()=>{var t;const n=null==(t=r.default)?void 0:t.call(r);return e.animated||e.swipeable?(0,a.Wm)(O,{ref:i,loop:!1,class:N("track"),duration:1e3*+e.duration,touchable:e.swipeable,lazyRender:e.lazyRender,showIndicators:!1,onChange:c},{default:()=>[n]}):n},o=t=>{const r=i.value;r&&r.state.active!==t&&r.swipeTo(t,{immediate:!e.inited})};return(0,a.YP)((()=>e.currentIndex),o),(0,a.bv)((()=>{o(e.currentIndex)})),()=>(0,a.Wm)("div",{class:N("content",{animated:e.animated||e.swipeable})},[f()])}});const[U,j]=(0,i["do"])("tabs"),F={type:(0,c.SQ)("line"),color:String,border:Boolean,sticky:Boolean,shrink:Boolean,active:(0,c.SI)(0),duration:(0,c.SI)(.3),animated:Boolean,ellipsis:c.J5,swipeable:Boolean,scrollspy:Boolean,offsetTop:(0,c.SI)(0),background:String,lazyRender:c.J5,lineWidth:c.Or,lineHeight:c.Or,beforeChange:Function,swipeThreshold:(0,c.SI)(5),titleActiveColor:String,titleInactiveColor:String},D=Symbol(U);var H=(0,a.aZ)({name:U,props:F,emits:["click","change","scroll","disabled","rendered","click-tab","update:active"],setup(e,{emit:t,slots:r}){let i,c,w;const M=(0,n.iH)(),_=(0,n.iH)(),k=(0,n.iH)(),A=(0,x.M)(),S=(0,h.eo)(M),[T,P]=v(),{children:I,linkChildren:C}=(0,h.$E)(D),O=(0,n.qj)({inited:!1,position:"",lineStyle:{},currentIndex:-1}),R=(0,a.Fl)((()=>I.length>e.swipeThreshold||!e.ellipsis||e.shrink)),N=(0,a.Fl)((()=>({borderColor:e.color,background:e.background}))),U=(e,t)=>{var r;return null!=(r=e.name)?r:t},F=(0,a.Fl)((()=>{const e=I[O.currentIndex];if(e)return U(e,O.currentIndex)})),H=(0,a.Fl)((()=>(0,f.LU)(e.offsetTop))),q=(0,a.Fl)((()=>e.sticky?H.value+i:0)),z=t=>{const r=_.value,a=T.value;if(!R.value||!r||!a||!a[O.currentIndex])return;const n=a[O.currentIndex].$el,i=n.offsetLeft-(r.offsetWidth-n.offsetWidth)/2;l(r,i,t?0:+e.duration)},K=()=>{const t=O.inited;(0,a.Y3)((()=>{const r=T.value;if(!r||!r[O.currentIndex]||"line"!==e.type||(0,o.xj)(M.value))return;const a=r[O.currentIndex].$el,{lineWidth:n,lineHeight:i}=e,c=a.offsetLeft+a.offsetWidth/2,s={width:(0,f.Nn)(n),backgroundColor:e.color,transform:`translateX(${c}px) translateX(-50%)`};if(t&&(s.transitionDuration=`${e.duration}s`),(0,d.Xq)(i)){const e=(0,f.Nn)(i);s.height=e,s.borderRadius=e}O.lineStyle=s}))},W=e=>{const t=e=0&&e{const a=W(r);if(!(0,d.Xq)(a))return;const n=I[a],i=U(n,a),c=null!==O.currentIndex;O.currentIndex=a,i!==e.active&&(t("update:active",i),c&&t("change",i,n.title))},V=e=>{const t=I.find(((t,r)=>U(t,r)===e)),r=t?I.indexOf(t):0;G(r)},Z=(t=!1)=>{if(e.scrollspy){const r=I[O.currentIndex].$el;if(r&&S.value){const a=(0,o.U4)(r,S.value)-q.value;c=!0,p(S.value,a,t?0:+e.duration,(()=>{c=!1}))}}},$=(r,a,n)=>{const{title:i,disabled:c}=I[a],f=U(I[a],a);c?t("disabled",f,i):((0,s.I)(e.beforeChange,{args:[f],done:()=>{G(a),Z()}}),t("click",f,i),(0,m.BC)(r)),t("click-tab",{name:f,title:i,event:n,disabled:c})},J=e=>{w=e.isFixed,t("scroll",e)},Y=e=>{(0,a.Y3)((()=>{V(e),Z(!0)}))},X=()=>{for(let e=0;eq.value)return 0===e?0:e-1}return I.length-1},Q=()=>{if(e.scrollspy&&!c){const e=X();G(e)}},ee=()=>I.map(((t,r)=>(0,a.Wm)(B,(0,a.dG)({id:`${A}-${r}`,ref:P(r),type:e.type,color:e.color,style:t.titleStyle,class:t.titleClass,shrink:e.shrink,isActive:r===O.currentIndex,controls:t.id,scrollable:R.value,activeColor:e.titleActiveColor,inactiveColor:e.titleInactiveColor,onClick:e=>$(t,r,e)},(0,u.ei)(t,["dot","badge","title","disabled","showZeroBadge"])),{title:t.$slots.title}))),te=()=>{if("line"===e.type&&I.length)return(0,a.Wm)("div",{class:j("line"),style:O.lineStyle},null)},re=()=>{var t,n;const{type:i,border:c}=e;return(0,a.Wm)("div",{ref:k,class:[j("wrap"),{[b.r5]:"line"===i&&c}]},[(0,a.Wm)("div",{ref:_,role:"tablist",class:j("nav",[i,{shrink:e.shrink,complete:R.value}]),style:N.value,"aria-orientation":"horizontal"},[null==(t=r["nav-left"])?void 0:t.call(r),ee(),te(),null==(n=r["nav-right"])?void 0:n.call(r)])])};(0,a.YP)([()=>e.color,o.bn],K),(0,a.YP)((()=>e.active),(e=>{e!==F.value&&V(e)})),(0,a.YP)((()=>I.length),(()=>{O.inited&&(V(e.active),K(),(0,a.Y3)((()=>{z(!0)})))})),(0,a.YP)((()=>O.currentIndex),(()=>{z(),K(),w&&!e.scrollspy&&(0,o.kn)(Math.ceil((0,o.U4)(M.value)-H.value))}));const ae=()=>{V(e.active),(0,a.Y3)((()=>{O.inited=!0,k.value&&(i=(0,h.EL)(k.value).height),z(!0)}))},ne=(e,r)=>t("rendered",e,r);return(0,g.F)({resize:K,scrollTo:Y}),(0,a.dl)(K),(0,y.h)(K),(0,h.Ib)(ae),(0,h.OR)("scroll",Q,{target:S}),C({id:A,props:e,setLine:K,onRendered:ne,currentName:F,scrollIntoView:z}),()=>{var t;return(0,a.Wm)("div",{ref:M,class:j([e.type])},[e.sticky?(0,a.Wm)(E,{container:M.value,offsetTop:H.value,onScroll:J},{default:()=>{var e;return[re(),null==(e=r["nav-bottom"])?void 0:e.call(r)]}}):[re(),null==(t=r["nav-bottom"])?void 0:t.call(r)],(0,a.Wm)(L,{count:I.length,inited:O.inited,animated:e.animated,duration:e.duration,swipeable:e.swipeable,lazyRender:e.lazyRender,currentIndex:O.currentIndex,onChange:G},{default:()=>{var e;return[null==(e=r.default)?void 0:e.call(r)]}})])}}})},10987:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var a=r(8395),n=r(42238);const i=(0,a.n)(n.Z);var c=i},55522:function(e,t,r){"use strict";r(31958),r(20368),r(51771),r(89137),r(25338)},3776:function(e,t,r){"use strict";r.d(t,{Z:function(){return N}});var a=r(73396),n=r(44870),i=r(24452),c=r(36300),f=r(8395),o=r(49242),d=r(10998);function s(){const e=(0,n.qj)({show:!1}),t=t=>{e.show=t},r=r=>{(0,i.l7)(e,r,{transitionAppear:!0}),t(!0)},a=()=>t(!1);return(0,d.F)({open:r,close:a,toggle:t}),{open:r,close:a,state:e,toggle:t}}function u(e){const t=(0,o.ri)(e),r=document.createElement("div");return document.body.appendChild(r),{instance:t.mount(r),unmount(){t.unmount(),document.body.removeChild(r)}}}var b=r(62981),h=r(65737);let l=0;function p(e){e?(l||document.body.classList.add("van-toast--unclickable"),l++):l&&(l--,l||document.body.classList.remove("van-toast--unclickable"))}var x=r(10176),m=r(53504),v=r(45512);const[g,y]=(0,b["do"])("toast"),w=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay"],M={icon:String,show:Boolean,type:(0,h.SQ)("text"),overlay:Boolean,message:h.Or,iconSize:h.Or,duration:(0,h.qM)(2e3),position:(0,h.SQ)("middle"),teleport:[String,Object],className:h.Vg,iconPrefix:String,transition:(0,h.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:h.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean};var _=(0,a.aZ)({name:g,props:M,emits:["update:show"],setup(e,{emit:t}){let r,n=!1;const f=()=>{const t=e.show&&e.forbidClick;n!==t&&(n=t,p(n))},o=e=>t("update:show",e),d=()=>{e.closeOnClick&&o(!1)},s=()=>clearTimeout(r),u=()=>{const{icon:t,type:r,iconSize:n,iconPrefix:i,loadingType:c}=e,f=t||"success"===r||"fail"===r;return f?(0,a.Wm)(x.J,{name:t||r,size:n,class:y("icon"),classPrefix:i},null):"loading"===r?(0,a.Wm)(v.g,{class:y("loading"),size:n,type:c},null):void 0},b=()=>{const{type:t,message:r}=e;if((0,c.Xq)(r)&&""!==r)return"html"===t?(0,a.Wm)("div",{key:0,class:y("text"),innerHTML:String(r)},null):(0,a.Wm)("div",{class:y("text")},[r])};return(0,a.YP)((()=>[e.show,e.forbidClick]),f),(0,a.YP)((()=>[e.show,e.type,e.message,e.duration]),(()=>{s(),e.show&&e.duration>0&&(r=setTimeout((()=>{o(!1)}),e.duration))})),(0,a.bv)(f),(0,a.Ah)(f),()=>(0,a.Wm)(m.G,(0,a.dG)({class:[y([e.position,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:d,onClosed:s,"onUpdate:show":o},(0,i.ei)(e,w)),{default:()=>[u(),b()]})}});const k={icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1};let A=[],S=!1,E=(0,i.l7)({},k);const T=new Map;function P(e){return(0,c.Kn)(e)?e:{message:e}}function I(){const{instance:e,unmount:t}=u({setup(){const r=(0,n.iH)(""),{open:i,state:c,close:f,toggle:o}=s(),d=()=>{S&&(A=A.filter((t=>t!==e)),t())},u=()=>{const e={onClosed:d,"onUpdate:show":o};return(0,a.Wm)(_,(0,a.dG)(c,e),null)};return(0,a.YP)(r,(e=>{c.message=e})),(0,a.FN)().render=u,{open:i,clear:f,message:r}}});return e}function B(){if(!A.length||S){const e=I();A.push(e)}return A[A.length-1]}function C(e={}){if(!i._f)return{};const t=B(),r=P(e);return t.open((0,i.l7)({},E,T.get(r.type||E.type),r)),t}const O=e=>t=>C((0,i.l7)({type:e},P(t)));function R(e,t){"string"===typeof e?T.set(e,t):(0,i.l7)(E,e)}C.loading=O("loading"),C.success=O("success"),C.fail=O("fail"),C.clear=e=>{var t;A.length&&(e?(A.forEach((e=>{e.clear()})),A=[]):S?null==(t=A.shift())||t.clear():A[0].clear())},C.setDefaultOptions=R,C.resetDefaultOptions=e=>{"string"===typeof e?T.delete(e):(E=(0,i.l7)({},k),T.clear())},C.allowMultiple=(e=!0)=>{S=e},C.install=e=>{e.use((0,f.n)(_)),e.config.globalProperties.$toast=C};var N=C},58146:function(e,t,r){"use strict";r(31958),r(20368),r(56742),r(62939),r(76196),r(22666)},24452:function(e,t,r){"use strict";function a(){}r.d(t,{U2:function(){return c},ZT:function(){return a},_f:function(){return i},ei:function(){return f},l7:function(){return n}});const n=Object.assign,i="undefined"!==typeof window;function c(e,t){const r=t.split(".");let a=e;return r.forEach((e=>{var t;a=null!=(t=a[e])?t:""})),a}function f(e,t,r){return t.reduce(((t,a)=>(r&&void 0===e[a]||(t[a]=e[a]),t)),{})}},11047:function(e,t,r){"use strict";r.d(t,{_K:function(){return n},e9:function(){return c},r5:function(){return i}});const a="van-hairline",n=`${a}--surround`,i=`${a}--top-bottom`,c="van-haptics-feedback";Symbol("van-form")},62981:function(e,t,r){"use strict";r.d(t,{do:function(){return v}});var a=r(24452),n=r(43603),i=r(36300),c=r(44870);const{hasOwnProperty:f}=Object.prototype;function o(e,t,r){const a=t[r];(0,i.Xq)(a)&&(f.call(e,r)&&(0,i.Kn)(a)?e[r]=d(Object(e[r]),a):e[r]=a)}function d(e,t){return Object.keys(t).forEach((r=>{o(e,t,r)})),e}var s={name:"姓名",tel:"电话",save:"保存",confirm:"确认",cancel:"取消",delete:"删除",loading:"加载中...",noCoupon:"暂无优惠券",nameEmpty:"请填写姓名",addContact:"添加联系人",telInvalid:"请填写正确的电话",vanCalendar:{end:"结束",start:"开始",title:"日期选择",weekdays:["日","一","二","三","四","五","六"],monthTitle:(e,t)=>`${e}年${t}月`,rangePrompt:e=>`最多选择 ${e} 天`},vanCascader:{select:"请选择"},vanPagination:{prev:"上一页",next:"下一页"},vanPullRefresh:{pulling:"下拉即可刷新...",loosing:"释放即可刷新..."},vanSubmitBar:{label:"合计:"},vanCoupon:{unlimited:"无门槛",discount:e=>`${e}折`,condition:e=>`满${e}元可用`},vanCouponCell:{title:"优惠券",count:e=>`${e}张可用`},vanCouponList:{exchange:"兑换",close:"不使用",enable:"可用",disabled:"不可用",placeholder:"输入优惠码"},vanAddressEdit:{area:"地区",postal:"邮政编码",areaEmpty:"请选择地区",addressEmpty:"请填写详细地址",postalEmpty:"邮政编码不正确",addressDetail:"详细地址",defaultAddress:"设为默认收货地址"},vanAddressList:{add:"新增地址"}};const u=(0,c.iH)("zh-CN"),b=(0,c.qj)({"zh-CN":s}),h={messages(){return b[u.value]},use(e,t){u.value=e,this.add({[e]:t})},add(e={}){d(b,e)}};var l=h;function p(e){const t=(0,n._A)(e)+".";return(e,...r)=>{const n=l.messages(),c=(0,a.U2)(n,t+e)||(0,a.U2)(n,e);return(0,i.mf)(c)?c(...r):c}}function x(e,t){return t?"string"===typeof t?` ${e}--${t}`:Array.isArray(t)?t.reduce(((t,r)=>t+x(e,r)),""):Object.keys(t).reduce(((r,a)=>r+(t[a]?x(e,a):"")),""):""}function m(e){return(t,r)=>(t&&"string"!==typeof t&&(r=t,t=""),t=t?`${e}__${t}`:e,`${t}${x(t,r)}`)}function v(e){const t=`van-${e}`;return[t,m(t),p(t)]}},54005:function(e,t,r){"use strict";r.d(t,{PF:function(){return b},QU:function(){return f},U4:function(){return s},bn:function(){return l},cx:function(){return c},kn:function(){return d},uK:function(){return p},xj:function(){return h}});var a=r(75634),n=r(44870),i=r(36300);function c(e){const t="scrollTop"in e?e.scrollTop:e.pageYOffset;return Math.max(t,0)}function f(e,t){"scrollTop"in e?e.scrollTop=t:e.scrollTo(e.scrollX,t)}function o(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function d(e){f(window,e),f(document.body,e)}function s(e,t){if(e===window)return 0;const r=t?c(t):o();return(0,a.EL)(e).top+r}(0,i.gn)();const u=e=>e.stopPropagation();function b(e,t){("boolean"!==typeof e.cancelable||e.cancelable)&&e.preventDefault(),t&&u(e)}function h(e){const t=(0,n.SU)(e);if(!t)return!1;const r=window.getComputedStyle(t),a="none"===r.display,i=null===t.offsetParent&&"fixed"!==r.position;return a||i}const{width:l,height:p}=(0,a.iP)()},43603:function(e,t,r){"use strict";r.d(t,{As:function(){return o},GL:function(){return m},LU:function(){return l},Nn:function(){return c},Xn:function(){return f},_A:function(){return x},uZ:function(){return v}});var a=r(24452),n=r(54005),i=r(36300);function c(e){if((0,i.Xq)(e))return(0,i.kE)(e)?`${e}px`:String(e)}function f(e){if((0,i.Xq)(e)){const t=c(e);return{width:t,height:t}}}function o(e){const t={};return void 0!==e&&(t.zIndex=+e),t}let d;function s(){if(!d){const e=document.documentElement,t=e.style.fontSize||window.getComputedStyle(e).fontSize;d=parseFloat(t)}return d}function u(e){return e=e.replace(/rem/g,""),+e*s()}function b(e){return e=e.replace(/vw/g,""),+e*n.bn.value/100}function h(e){return e=e.replace(/vh/g,""),+e*n.uK.value/100}function l(e){if("number"===typeof e)return e;if(a._f){if(e.includes("rem"))return u(e);if(e.includes("vw"))return b(e);if(e.includes("vh"))return h(e)}return parseFloat(e)}const p=/-(\w)/g,x=e=>e.replace(p,((e,t)=>t.toUpperCase())),m=e=>e.replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");const v=(e,t,r)=>Math.min(Math.max(e,t),r)},12556:function(e,t,r){"use strict";r.d(t,{I:function(){return i}});var a=r(24452),n=r(36300);function i(e,{args:t=[],done:r,canceled:i}){if(e){const c=e.apply(null,t);(0,n.tI)(c)?c.then((e=>{e?r():i&&i()})).catch(a.ZT):c?r():i&&i()}else r()}},65737:function(e,t,r){"use strict";r.d(t,{Ce:function(){return f},J5:function(){return i},Or:function(){return n},SI:function(){return d},SQ:function(){return s},Vg:function(){return a},ir:function(){return c},qM:function(){return o}});const a=null,n=[Number,String],i={type:Boolean,default:!0},c=e=>({type:e,required:!0}),f=()=>({type:Array,default:()=>[]}),o=e=>({type:Number,default:e}),d=e=>({type:n,default:e}),s=e=>({type:String,default:e})},36300:function(e,t,r){"use strict";r.d(t,{Kn:function(){return c},Xq:function(){return n},gn:function(){return d},kE:function(){return o},mf:function(){return i},tI:function(){return f}});var a=r(24452);const n=e=>void 0!==e&&null!==e,i=e=>"function"===typeof e,c=e=>null!==e&&"object"===typeof e,f=e=>c(e)&&i(e.then)&&i(e.catch);const o=e=>"number"===typeof e||/^\d+(\.\d+)?$/.test(e),d=()=>!!a._f&&/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())},8395:function(e,t,r){"use strict";r.d(t,{n:function(){return n}});var a=r(43603);function n(e){return e.install=t=>{const{name:r}=e;t.component(r,e),t.component((0,a._A)(`-${r}`),e)},e}},12706:function(e,t,r){r(21703),e.exports=i;var a=128,n=127;function i(e,t){var r,c=0,f=(t=t||0,0),o=t,d=e.length;do{if(o>=d)throw i.bytes=0,new RangeError("Could not decode varint");r=e[o++],c+=f<28?(r&n)<=a);return i.bytes=o-t,c}},30799:function(e){e.exports=i;var t=128,r=127,a=~r,n=Math.pow(2,31);function i(e,r,c){r=r||[],c=c||0;var f=c;while(e>=n)r[c++]=255&e|t,e/=128;while(e&a)r[c++]=255&e|t,e>>>=7;return r[c]=0|e,i.bytes=c-f+1,r}},42611:function(e,t,r){e.exports={encode:r(30799),decode:r(12706),encodingLength:r(63303)}},63303:function(e){var t=Math.pow(2,7),r=Math.pow(2,14),a=Math.pow(2,21),n=Math.pow(2,28),i=Math.pow(2,35),c=Math.pow(2,42),f=Math.pow(2,49),o=Math.pow(2,56),d=Math.pow(2,63);e.exports=function(e){return en?Symbol(e):e,c=(e,t,r)=>f({l:e,k:t,s:r}),f=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"===typeof e&&isFinite(e),d=e=>"[object Date]"===A(e),s=e=>"[object RegExp]"===A(e),u=e=>S(e)&&0===Object.keys(e).length;function b(e,t){"undefined"!==typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const h=Object.assign;let l;const p=()=>l||(l="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof r.g?r.g:{});function x(e){return e.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const m=Object.prototype.hasOwnProperty;function v(e,t){return m.call(e,t)}const g=Array.isArray,y=e=>"function"===typeof e,w=e=>"string"===typeof e,M=e=>"boolean"===typeof e,_=e=>null!==e&&"object"===typeof e,k=Object.prototype.toString,A=e=>k.call(e),S=e=>"[object Object]"===A(e),E=e=>null==e?"":g(e)||S(e)&&e.toString===k?JSON.stringify(e,null,2):String(e);r(21703); /*! * message-compiler v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */ const T={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,__EXTEND_POINT__:15};T.EXPECTED_TOKEN,T.INVALID_TOKEN_IN_PLACEHOLDER,T.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,T.UNKNOWN_ESCAPE_SEQUENCE,T.INVALID_UNICODE_ESCAPE_SEQUENCE,T.UNBALANCED_CLOSING_BRACE,T.UNTERMINATED_CLOSING_BRACE,T.EMPTY_PLACEHOLDER,T.NOT_ALLOW_NEST_PLACEHOLDER,T.INVALID_LINKED_FORMAT,T.MUST_HAVE_MESSAGES_IN_PLURAL,T.UNEXPECTED_EMPTY_LINKED_MODIFIER,T.UNEXPECTED_EMPTY_LINKED_KEY,T.UNEXPECTED_LEXICAL_ANALYSIS;function P(e,t,r={}){const{domain:a,messages:n,args:i}=r,c=e,f=new SyntaxError(String(c));return f.code=e,t&&(f.location=t),f.domain=a,f}function I(e){throw e}function B(e,t,r){return{line:e,column:t,offset:r}}function C(e,t,r){const a={start:e,end:t};return null!=r&&(a.source=r),a}const O=" ",R="\r",N="\n",L=String.fromCharCode(8232),U=String.fromCharCode(8233);function j(e){const t=e;let r=0,a=1,n=1,i=0;const c=e=>t[e]===R&&t[e+1]===N,f=e=>t[e]===N,o=e=>t[e]===U,d=e=>t[e]===L,s=e=>c(e)||f(e)||o(e)||d(e),u=()=>r,b=()=>a,h=()=>n,l=()=>i,p=e=>c(e)||o(e)||d(e)?N:t[e],x=()=>p(r),m=()=>p(r+i);function v(){return i=0,s(r)&&(a++,n=0),c(r)&&r++,r++,n++,t[r]}function g(){return c(r+i)&&i++,i++,t[r+i]}function y(){r=0,a=1,n=1,i=0}function w(e=0){i=e}function M(){const e=r+i;while(e!==r)v();i=0}return{index:u,line:b,column:h,peekOffset:l,charAt:p,currentChar:x,currentPeek:m,next:v,peek:g,reset:y,resetPeek:w,skipToPeek:M}}const F=void 0,D="'",H="tokenizer";function q(e,t={}){const r=!1!==t.location,a=j(e),n=()=>a.index(),i=()=>B(a.line(),a.column(),a.index()),c=i(),f=n(),o={currentType:14,offset:f,startLoc:c,endLoc:c,lastType:14,lastOffset:f,lastStartLoc:c,lastEndLoc:c,braceNest:0,inLinked:!1,text:""},d=()=>o,{onError:s}=t;function u(e,t,r,...a){const n=d();if(t.column+=r,t.offset+=r,s){const r=C(n.startLoc,t),i=P(e,r,{domain:H,args:a});s(i)}}function b(e,t,a){e.endLoc=i(),e.currentType=t;const n={type:t};return r&&(n.loc=C(e.startLoc,e.endLoc)),null!=a&&(n.value=a),n}const h=e=>b(e,14);function l(e,t){return e.currentChar()===t?(e.next(),t):(u(T.EXPECTED_TOKEN,i(),0,t),"")}function p(e){let t="";while(e.currentPeek()===O||e.currentPeek()===N)t+=e.currentPeek(),e.peek();return t}function x(e){const t=p(e);return e.skipToPeek(),t}function m(e){if(e===F)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function v(e){if(e===F)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}function g(e,t){const{currentType:r}=t;if(2!==r)return!1;p(e);const a=m(e.currentPeek());return e.resetPeek(),a}function y(e,t){const{currentType:r}=t;if(2!==r)return!1;p(e);const a="-"===e.currentPeek()?e.peek():e.currentPeek(),n=v(a);return e.resetPeek(),n}function w(e,t){const{currentType:r}=t;if(2!==r)return!1;p(e);const a=e.currentPeek()===D;return e.resetPeek(),a}function M(e,t){const{currentType:r}=t;if(8!==r)return!1;p(e);const a="."===e.currentPeek();return e.resetPeek(),a}function _(e,t){const{currentType:r}=t;if(9!==r)return!1;p(e);const a=m(e.currentPeek());return e.resetPeek(),a}function k(e,t){const{currentType:r}=t;if(8!==r&&12!==r)return!1;p(e);const a=":"===e.currentPeek();return e.resetPeek(),a}function A(e,t){const{currentType:r}=t;if(10!==r)return!1;const a=()=>{const t=e.currentPeek();return"{"===t?m(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===O||!t)&&(t===N?(e.peek(),a()):m(t))},n=a();return e.resetPeek(),n}function S(e){p(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function E(e,t=!0){const r=(t=!1,a="",n=!1)=>{const i=e.currentPeek();return"{"===i?"%"!==a&&t:"@"!==i&&i?"%"===i?(e.peek(),r(t,"%",!0)):"|"===i?!("%"!==a&&!n)||!(a===O||a===N):i===O?(e.peek(),r(!0,O,n)):i!==N||(e.peek(),r(!0,N,n)):"%"===a||t},a=r();return t&&e.resetPeek(),a}function I(e,t){const r=e.currentChar();return r===F?F:t(r)?(e.next(),r):null}function R(e){const t=e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t};return I(e,t)}function L(e){const t=e=>{const t=e.charCodeAt(0);return t>=48&&t<=57};return I(e,t)}function U(e){const t=e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};return I(e,t)}function q(e){let t="",r="";while(t=L(e))r+=t;return r}function z(e){let t="";while(1){const r=e.currentChar();if("{"===r||"}"===r||"@"===r||"|"===r||!r)break;if("%"===r){if(!E(e))break;t+=r,e.next()}else if(r===O||r===N)if(E(e))t+=r,e.next();else{if(S(e))break;t+=r,e.next()}else t+=r,e.next()}return t}function K(e){x(e);let t="",r="";while(t=R(e))r+=t;return e.currentChar()===F&&u(T.UNTERMINATED_CLOSING_BRACE,i(),0),r}function W(e){x(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${q(e)}`):t+=q(e),e.currentChar()===F&&u(T.UNTERMINATED_CLOSING_BRACE,i(),0),t}function G(e){x(e),l(e,"'");let t="",r="";const a=e=>e!==D&&e!==N;while(t=I(e,a))r+="\\"===t?V(e):t;const n=e.currentChar();return n===N||n===F?(u(T.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),n===N&&(e.next(),l(e,"'")),r):(l(e,"'"),r)}function V(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return Z(e,t,4);case"U":return Z(e,t,6);default:return u(T.UNKNOWN_ESCAPE_SEQUENCE,i(),0,t),""}}function Z(e,t,r){l(e,t);let a="";for(let n=0;n"{"!==e&&"}"!==e&&e!==O&&e!==N;while(t=I(e,a))r+=t;return r}function J(e){let t="",r="";while(t=R(e))r+=t;return r}function Y(e){const t=(r=!1,a)=>{const n=e.currentChar();return"{"!==n&&"%"!==n&&"@"!==n&&"|"!==n&&n?n===O?a:n===N?(a+=n,e.next(),t(r,a)):(a+=n,e.next(),t(!0,a)):a};return t(!1,"")}function X(e){x(e);const t=l(e,"|");return x(e),t}function Q(e,t){let r=null;const a=e.currentChar();switch(a){case"{":return t.braceNest>=1&&u(T.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),e.next(),r=b(t,2,"{"),x(e),t.braceNest++,r;case"}":return t.braceNest>0&&2===t.currentType&&u(T.EMPTY_PLACEHOLDER,i(),0),e.next(),r=b(t,3,"}"),t.braceNest--,t.braceNest>0&&x(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),r;case"@":return t.braceNest>0&&u(T.UNTERMINATED_CLOSING_BRACE,i(),0),r=ee(e,t)||h(t),t.braceNest=0,r;default:let a=!0,n=!0,c=!0;if(S(e))return t.braceNest>0&&u(T.UNTERMINATED_CLOSING_BRACE,i(),0),r=b(t,1,X(e)),t.braceNest=0,t.inLinked=!1,r;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return u(T.UNTERMINATED_CLOSING_BRACE,i(),0),t.braceNest=0,te(e,t);if(a=g(e,t))return r=b(t,5,K(e)),x(e),r;if(n=y(e,t))return r=b(t,6,W(e)),x(e),r;if(c=w(e,t))return r=b(t,7,G(e)),x(e),r;if(!a&&!n&&!c)return r=b(t,13,$(e)),u(T.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,r.value),x(e),r;break}return r}function ee(e,t){const{currentType:r}=t;let a=null;const n=e.currentChar();switch(8!==r&&9!==r&&12!==r&&10!==r||n!==N&&n!==O||u(T.INVALID_LINKED_FORMAT,i(),0),n){case"@":return e.next(),a=b(t,8,"@"),t.inLinked=!0,a;case".":return x(e),e.next(),b(t,9,".");case":":return x(e),e.next(),b(t,10,":");default:return S(e)?(a=b(t,1,X(e)),t.braceNest=0,t.inLinked=!1,a):M(e,t)||k(e,t)?(x(e),ee(e,t)):_(e,t)?(x(e),b(t,12,J(e))):A(e,t)?(x(e),"{"===n?Q(e,t)||a:b(t,11,Y(e))):(8===r&&u(T.INVALID_LINKED_FORMAT,i(),0),t.braceNest=0,t.inLinked=!1,te(e,t))}}function te(e,t){let r={type:14};if(t.braceNest>0)return Q(e,t)||h(t);if(t.inLinked)return ee(e,t)||h(t);const a=e.currentChar();switch(a){case"{":return Q(e,t)||h(t);case"}":return u(T.UNBALANCED_CLOSING_BRACE,i(),0),e.next(),b(t,3,"}");case"@":return ee(e,t)||h(t);default:if(S(e))return r=b(t,1,X(e)),t.braceNest=0,t.inLinked=!1,r;if(E(e))return b(t,0,z(e));if("%"===a)return e.next(),b(t,4,"%");break}return r}function re(){const{currentType:e,offset:t,startLoc:r,endLoc:c}=o;return o.lastType=e,o.lastOffset=t,o.lastStartLoc=r,o.lastEndLoc=c,o.offset=n(),o.startLoc=i(),a.currentChar()===F?b(o,14):te(a,o)}return{nextToken:re,currentOffset:n,currentPosition:i,context:d}}const z="parser",K=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function W(e,t,r){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||r,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function G(e={}){const t=!1!==e.location,{onError:r}=e;function a(e,t,a,n,...i){const c=e.currentPosition();if(c.offset+=n,c.column+=n,r){const e=C(a,c),n=P(t,e,{domain:z,args:i});r(n)}}function n(e,r,a){const n={type:e,start:r,end:r};return t&&(n.loc={start:a,end:a}),n}function i(e,r,a,n){e.end=r,n&&(e.type=n),t&&e.loc&&(e.loc.end=a)}function c(e,t){const r=e.context(),a=n(3,r.offset,r.startLoc);return a.value=t,i(a,e.currentOffset(),e.currentPosition()),a}function f(e,t){const r=e.context(),{lastOffset:a,lastStartLoc:c}=r,f=n(5,a,c);return f.index=parseInt(t,10),e.nextToken(),i(f,e.currentOffset(),e.currentPosition()),f}function o(e,t){const r=e.context(),{lastOffset:a,lastStartLoc:c}=r,f=n(4,a,c);return f.key=t,e.nextToken(),i(f,e.currentOffset(),e.currentPosition()),f}function d(e,t){const r=e.context(),{lastOffset:a,lastStartLoc:c}=r,f=n(9,a,c);return f.value=t.replace(K,W),e.nextToken(),i(f,e.currentOffset(),e.currentPosition()),f}function s(e){const t=e.nextToken(),r=e.context(),{lastOffset:c,lastStartLoc:f}=r,o=n(8,c,f);return 12!==t.type?(a(e,T.UNEXPECTED_EMPTY_LINKED_MODIFIER,r.lastStartLoc,0),o.value="",i(o,c,f),{nextConsumeToken:t,node:o}):(null==t.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,r.lastStartLoc,0,V(t)),o.value=t.value||"",i(o,e.currentOffset(),e.currentPosition()),{node:o})}function u(e,t){const r=e.context(),a=n(7,r.offset,r.startLoc);return a.value=t,i(a,e.currentOffset(),e.currentPosition()),a}function b(e){const t=e.context(),r=n(6,t.offset,t.startLoc);let c=e.nextToken();if(9===c.type){const t=s(e);r.modifier=t.node,c=t.nextConsumeToken||e.nextToken()}switch(10!==c.type&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(c)),c=e.nextToken(),2===c.type&&(c=e.nextToken()),c.type){case 11:null==c.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(c)),r.key=u(e,c.value||"");break;case 5:null==c.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(c)),r.key=o(e,c.value||"");break;case 6:null==c.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(c)),r.key=f(e,c.value||"");break;case 7:null==c.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(c)),r.key=d(e,c.value||"");break;default:a(e,T.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);const s=e.context(),b=n(7,s.offset,s.startLoc);return b.value="",i(b,s.offset,s.startLoc),r.key=b,i(r,s.offset,s.startLoc),{nextConsumeToken:c,node:r}}return i(r,e.currentOffset(),e.currentPosition()),{node:r}}function l(e){const t=e.context(),r=1===t.currentType?e.currentOffset():t.offset,s=1===t.currentType?t.endLoc:t.startLoc,u=n(2,r,s);u.items=[];let h=null;do{const r=h||e.nextToken();switch(h=null,r.type){case 0:null==r.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(r)),u.items.push(c(e,r.value||""));break;case 6:null==r.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(r)),u.items.push(f(e,r.value||""));break;case 5:null==r.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(r)),u.items.push(o(e,r.value||""));break;case 7:null==r.value&&a(e,T.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,V(r)),u.items.push(d(e,r.value||""));break;case 8:const n=b(e);u.items.push(n.node),h=n.nextConsumeToken||null;break}}while(14!==t.currentType&&1!==t.currentType);const l=1===t.currentType?t.lastOffset:e.currentOffset(),p=1===t.currentType?t.lastEndLoc:e.currentPosition();return i(u,l,p),u}function p(e,t,r,c){const f=e.context();let o=0===c.items.length;const d=n(1,t,r);d.cases=[],d.cases.push(c);do{const t=l(e);o||(o=0===t.items.length),d.cases.push(t)}while(14!==f.currentType);return o&&a(e,T.MUST_HAVE_MESSAGES_IN_PLURAL,r,0),i(d,e.currentOffset(),e.currentPosition()),d}function x(e){const t=e.context(),{offset:r,startLoc:a}=t,n=l(e);return 14===t.currentType?n:p(e,r,a,n)}function m(r){const c=q(r,h({},e)),f=c.context(),o=n(0,f.offset,f.startLoc);return t&&o.loc&&(o.loc.source=r),o.body=x(c),14!==f.currentType&&a(c,T.UNEXPECTED_LEXICAL_ANALYSIS,f.lastStartLoc,0,r[f.offset]||""),i(o,c.currentOffset(),c.currentPosition()),o}return{parse:m}}function V(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function Z(e,t={}){const r={ast:e,helpers:new Set},a=()=>r,n=e=>(r.helpers.add(e),e);return{context:a,helper:n}}function $(e,t){for(let r=0;rc;function o(e,t){c.code+=e}function d(e,t=!0){const r=t?n:"";o(i?r+" ".repeat(e):r)}function s(e=!0){const t=++c.indentLevel;e&&d(t)}function u(e=!0){const t=--c.indentLevel;e&&d(t)}function b(){d(c.indentLevel)}const h=e=>`_${e}`,l=()=>c.needIndent;return{context:f,push:o,indent:s,deindent:u,newline:b,helper:h,needIndent:l}}function Q(e,t){const{helper:r}=e;e.push(`${r("linked")}(`),ae(e,t.key),t.modifier&&(e.push(", "),ae(e,t.modifier)),e.push(")")}function ee(e,t){const{helper:r,needIndent:a}=e;e.push(`${r("normalize")}([`),e.indent(a());const n=t.items.length;for(let i=0;i1){e.push(`${r("plural")}([`),e.indent(a());const n=t.cases.length;for(let r=0;r{const r=w(t.mode)?t.mode:"normal",a=w(t.filename)?t.filename:"message.intl",n=!!t.sourceMap,i=null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",c=t.needIndent?t.needIndent:"arrow"!==r,f=e.helpers||[],o=X(e,{mode:r,filename:a,sourceMap:n,breakLineCode:i,needIndent:c});o.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),o.indent(c),f.length>0&&(o.push(`const { ${f.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),o.newline()),o.push("return "),ae(o,e),o.deindent(c),o.push("}");const{code:d,map:s}=o.context();return{ast:e,code:d,map:s?s.toJSON():void 0}};function ie(e,t={}){const r=h({},t),a=G(r),n=a.parse(e);return Y(n,r),ne(n,r)} /*! * devtools-if v9.2.0-beta.32 * (c) 2022 kazuya kawaguchi * Released under the MIT License. */ const ce={I18nInit:"i18n:init",FunctionTranslate:"function:translate"},fe=[];fe[0]={["w"]:[0],["i"]:[3,0],["["]:[4],["o"]:[7]},fe[1]={["w"]:[1],["."]:[2],["["]:[4],["o"]:[7]},fe[2]={["w"]:[2],["i"]:[3,0],["0"]:[3,0]},fe[3]={["i"]:[3,0],["0"]:[3,0],["w"]:[1,1],["."]:[2,1],["["]:[4,1],["o"]:[7,1]},fe[4]={["'"]:[5,0],['"']:[6,0],["["]:[4,2],["]"]:[1,3],["o"]:8,["l"]:[4,0]},fe[5]={["'"]:[4,0],["o"]:8,["l"]:[5,0]},fe[6]={['"']:[4,0],["o"]:8,["l"]:[6,0]};const oe=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function de(e){return oe.test(e)}function se(e){const t=e.charCodeAt(0),r=e.charCodeAt(e.length-1);return t!==r||34!==t&&39!==t?e:e.slice(1,-1)}function ue(e){if(void 0===e||null===e)return"o";const t=e.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function be(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(de(t)?se(t):"*"+t)}function he(e){const t=[];let r,a,n,i,c,f,o,d=-1,s=0,u=0;const b=[];function h(){const t=e[d+1];if(5===s&&"'"===t||6===s&&'"'===t)return d++,n="\\"+t,b[0](),!0}b[0]=()=>{void 0===a?a=n:a+=n},b[1]=()=>{void 0!==a&&(t.push(a),a=void 0)},b[2]=()=>{b[0](),u++},b[3]=()=>{if(u>0)u--,s=4,b[0]();else{if(u=0,void 0===a)return!1;if(a=be(a),!1===a)return!1;b[1]()}};while(null!==s)if(d++,r=e[d],"\\"!==r||!h()){if(i=ue(r),o=fe[s],c=o[i]||o["l"]||8,8===c)return;if(s=c[0],void 0!==c[1]&&(f=b[c[1]],f&&(n=r,!1===f())))return;if(7===s)return t}}const le=new Map;function pe(e,t){return _(e)?e[t]:null}function xe(e,t){if(!_(e))return null;let r=le.get(t);if(r||(r=he(t),r&&le.set(t,r)),!r)return null;const a=r.length;let n=e,i=0;while(ie,ve=e=>"",ge="text",ye=e=>0===e.length?"":e.join(""),we=E;function Me(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function _e(e){const t=o(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(o(e.named.count)||o(e.named.n))?o(e.named.count)?e.named.count:o(e.named.n)?e.named.n:t:t}function ke(e,t){t.count||(t.count=e),t.n||(t.n=e)}function Ae(e={}){const t=e.locale,r=_e(e),a=_(e.pluralRules)&&w(t)&&y(e.pluralRules[t])?e.pluralRules[t]:Me,n=_(e.pluralRules)&&w(t)&&y(e.pluralRules[t])?Me:void 0,i=e=>e[a(r,e.length,n)],c=e.list||[],f=e=>c[e],d=e.named||{};o(e.pluralIndex)&&ke(r,d);const s=e=>d[e];function u(t){const r=y(e.messages)?e.messages(t):!!_(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):ve)}const b=t=>e.modifiers?e.modifiers[t]:me,h=S(e.processor)&&y(e.processor.normalize)?e.processor.normalize:ye,l=S(e.processor)&&y(e.processor.interpolate)?e.processor.interpolate:we,p=(e,t)=>{const r=u(e)(m);return w(t)?b(t)(r):r},x=S(e.processor)&&w(e.processor.type)?e.processor.type:ge,m={["list"]:f,["named"]:s,["plural"]:i,["linked"]:p,["message"]:u,["type"]:x,["interpolate"]:l,["normalize"]:h};return m}let Se=null;function Ee(e){Se=e}function Te(e,t,r){Se&&Se.emit(ce.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:r})}const Pe=Ie(ce.FunctionTranslate);function Ie(e){return t=>Se&&Se.emit(e,t)}const Be={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,__EXTEND_POINT__:7};Be.NOT_FOUND_KEY,Be.FALLBACK_TO_TRANSLATE,Be.CANNOT_FORMAT_NUMBER,Be.FALLBACK_TO_NUMBER_FORMAT,Be.CANNOT_FORMAT_DATE,Be.FALLBACK_TO_DATE_FORMAT;function Ce(e,t,r){return[...new Set([r,...g(t)?t:_(t)?Object.keys(t):w(t)?[t]:[r]])]}function Oe(e,t,r){const a=w(r)?r:Fe,n=e;n.__localeChainCache||(n.__localeChainCache=new Map);let i=n.__localeChainCache.get(a);if(!i){i=[];let e=[r];while(g(e))e=Re(i,e,t);const c=g(t)||!S(t)?t:t["default"]?t["default"]:null;e=w(c)?[c]:c,g(e)&&Re(i,e,!1),n.__localeChainCache.set(a,i)}return i}function Re(e,t,r){let a=!0;for(let n=0;nw(e)?e.toUpperCase():e,lower:e=>w(e)?e.toLowerCase():e,capitalize:e=>w(e)?`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`:e}}let qe,ze,Ke;function We(e){qe=e}function Ge(e){ze=e}function Ve(e){Ke=e}let Ze=null;const $e=e=>{Ze=e},Je=()=>Ze;let Ye=null;const Xe=e=>{Ye=e},Qe=()=>Ye;let et=0;function tt(e={}){const t=w(e.version)?e.version:Ue,r=w(e.locale)?e.locale:Fe,a=g(e.fallbackLocale)||S(e.fallbackLocale)||w(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:r,n=S(e.messages)?e.messages:{[r]:{}},i=S(e.datetimeFormats)?e.datetimeFormats:{[r]:{}},c=S(e.numberFormats)?e.numberFormats:{[r]:{}},f=h({},e.modifiers||{},He()),o=e.pluralRules||{},d=y(e.missing)?e.missing:null,u=!M(e.missingWarn)&&!s(e.missingWarn)||e.missingWarn,l=!M(e.fallbackWarn)&&!s(e.fallbackWarn)||e.fallbackWarn,p=!!e.fallbackFormat,x=!!e.unresolving,m=y(e.postTranslation)?e.postTranslation:null,v=S(e.processor)?e.processor:null,k=!M(e.warnHtmlMessage)||e.warnHtmlMessage,A=!!e.escapeParameter,E=y(e.messageCompiler)?e.messageCompiler:qe,T=y(e.messageResolver)?e.messageResolver:ze||pe,P=y(e.localeFallbacker)?e.localeFallbacker:Ke||Ce,I=_(e.fallbackContext)?e.fallbackContext:void 0,B=y(e.onWarn)?e.onWarn:b,C=e,O=_(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,R=_(C.__numberFormatters)?C.__numberFormatters:new Map,N=_(C.__meta)?C.__meta:{};et++;const L={version:t,cid:et,locale:r,fallbackLocale:a,messages:n,modifiers:f,pluralRules:o,missing:d,missingWarn:u,fallbackWarn:l,fallbackFormat:p,unresolving:x,postTranslation:m,processor:v,warnHtmlMessage:k,escapeParameter:A,messageCompiler:E,messageResolver:T,localeFallbacker:P,fallbackContext:I,onWarn:B,__meta:N};return L.datetimeFormats=i,L.numberFormats=c,L.__datetimeFormatters=O,L.__numberFormatters=R,__INTLIFY_PROD_DEVTOOLS__&&Te(L,t,N),L}function rt(e,t,r,a,n){const{missing:i,onWarn:c}=e;if(null!==i){const a=i(e,r,t,n);return w(a)?a:t}return t}function at(e,t,r){const a=e;a.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}const nt=e=>e;let it=Object.create(null);function ct(e,t={}){{const r=t.onCacheKey||nt,a=r(e),n=it[a];if(n)return n;let i=!1;const c=t.onError||I;t.onError=e=>{i=!0,c(e)};const{code:f}=ie(e,t),o=new Function(`return ${f}`)();return i?o:it[a]=o}}let ft=T.__EXTEND_POINT__;const ot=()=>++ft,dt={INVALID_ARGUMENT:ft,INVALID_DATE_ARGUMENT:ot(),INVALID_ISO_DATE_ARGUMENT:ot(),__EXTEND_POINT__:ot()};function st(e){return P(e,null,void 0)}dt.INVALID_ARGUMENT,dt.INVALID_DATE_ARGUMENT,dt.INVALID_ISO_DATE_ARGUMENT;const ut=()=>"",bt=e=>y(e);function ht(e,...t){const{fallbackFormat:r,postTranslation:a,unresolving:n,messageCompiler:i,fallbackLocale:c,messages:f}=e,[o,d]=vt(...t),s=M(d.missingWarn)?d.missingWarn:e.missingWarn,u=M(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn,b=M(d.escapeParameter)?d.escapeParameter:e.escapeParameter,l=!!d.resolvedMessage,p=w(d.default)||M(d.default)?M(d.default)?o:d.default:r?i?o:()=>o:"",x=r||""!==p,m=w(d.locale)?d.locale:e.locale;b&<(d);let[v,g,y]=l?[o,m,f[m]||{}]:pt(e,o,m,c,u,s),_=v,k=o;if(l||w(_)||bt(_)||x&&(_=p,k=_),!l&&(!w(_)&&!bt(_)||!w(g)))return n?je:o;let A=!1;const S=()=>{A=!0},E=bt(_)?_:xt(e,o,g,_,k,S);if(A)return _;const T=yt(e,g,y,d),P=Ae(T),I=mt(e,E,P),B=a?a(I):I;if(__INTLIFY_PROD_DEVTOOLS__){const t={timestamp:Date.now(),key:w(o)?o:bt(_)?_.key:"",locale:g||(bt(_)?_.locale:""),format:w(_)?_:bt(_)?_.source:"",message:B};t.meta=h({},e.__meta,Je()||{}),Pe(t)}return B}function lt(e){g(e.list)?e.list=e.list.map((e=>w(e)?x(e):e)):_(e.named)&&Object.keys(e.named).forEach((t=>{w(e.named[t])&&(e.named[t]=x(e.named[t]))}))}function pt(e,t,r,a,n,i){const{messages:c,onWarn:f,messageResolver:o,localeFallbacker:d}=e,s=d(e,a,r);let u,b={},h=null,l=r,p=null;const x="translate";for(let m=0;m{throw i&&i(e),e},onCacheKey:e=>c(t,r,e)}}function yt(e,t,r,a){const{modifiers:n,pluralRules:i,messageResolver:c,fallbackLocale:f,fallbackWarn:d,missingWarn:s,fallbackContext:u}=e,b=a=>{let n=c(r,a);if(null==n&&u){const[,,e]=pt(u,a,t,f,d,s);n=c(e,a)}if(w(n)){let r=!1;const i=()=>{r=!0},c=xt(e,a,t,n,a,i);return r?ut:c}return bt(n)?n:ut},h={locale:t,modifiers:n,pluralRules:i,messages:b};return e.processor&&(h.processor=e.processor),a.list&&(h.list=a.list),a.named&&(h.named=a.named),o(a.plural)&&(h.pluralIndex=a.plural),h}const wt="undefined"!==typeof Intl;wt&&Intl.DateTimeFormat,wt&&Intl.NumberFormat;function Mt(e,...t){const{datetimeFormats:r,unresolving:a,fallbackLocale:n,onWarn:i,localeFallbacker:c}=e,{__datetimeFormatters:f}=e;const[o,d,s,b]=_t(...t),l=M(s.missingWarn)?s.missingWarn:e.missingWarn,p=(M(s.fallbackWarn)?s.fallbackWarn:e.fallbackWarn,!!s.part),x=w(s.locale)?s.locale:e.locale,m=c(e,n,x);if(!w(o)||""===o)return new Intl.DateTimeFormat(x).format(d);let v,g={},y=null,_=x,k=null;const A="datetime format";for(let u=0;u++Ct,Rt={FALLBACK_TO_ROOT:Ct,NOT_SUPPORTED_PRESERVE:Ot(),NOT_SUPPORTED_FORMATTER:Ot(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:Ot(),NOT_SUPPORTED_GET_CHOICE_INDEX:Ot(),COMPONENT_NAME_LEGACY_COMPATIBLE:Ot(),NOT_FOUND_PARENT_SCOPE:Ot(),NOT_SUPPORT_MULTI_I18N_INSTANCE:Ot()};Rt.FALLBACK_TO_ROOT,Rt.NOT_SUPPORTED_PRESERVE,Rt.NOT_SUPPORTED_FORMATTER,Rt.NOT_SUPPORTED_PRESERVE_DIRECTIVE,Rt.NOT_SUPPORTED_GET_CHOICE_INDEX,Rt.COMPONENT_NAME_LEGACY_COMPATIBLE,Rt.NOT_FOUND_PARENT_SCOPE,Rt.NOT_SUPPORT_MULTI_I18N_INSTANCE;let Nt=T.__EXTEND_POINT__;const Lt=()=>++Nt,Ut={UNEXPECTED_RETURN_TYPE:Nt,INVALID_ARGUMENT:Lt(),MUST_BE_CALL_SETUP_TOP:Lt(),NOT_INSLALLED:Lt(),NOT_AVAILABLE_IN_LEGACY_MODE:Lt(),REQUIRED_VALUE:Lt(),INVALID_VALUE:Lt(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Lt(),NOT_INSLALLED_WITH_PROVIDE:Lt(),UNEXPECTED_ERROR:Lt(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Lt(),BRIDGE_SUPPORT_VUE_2_ONLY:Lt(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Lt(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Lt(),__EXTEND_POINT__:Lt()};function jt(e,...t){return P(e,null,void 0)}Ut.UNEXPECTED_RETURN_TYPE,Ut.INVALID_ARGUMENT,Ut.MUST_BE_CALL_SETUP_TOP,Ut.NOT_INSLALLED,Ut.UNEXPECTED_ERROR,Ut.NOT_AVAILABLE_IN_LEGACY_MODE,Ut.REQUIRED_VALUE,Ut.INVALID_VALUE,Ut.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN,Ut.NOT_INSLALLED_WITH_PROVIDE,Ut.NOT_COMPATIBLE_LEGACY_VUE_I18N,Ut.BRIDGE_SUPPORT_VUE_2_ONLY,Ut.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION,Ut.NOT_AVAILABLE_COMPOSITION_IN_LEGACY;const Ft=i("__transrateVNode"),Dt=i("__datetimeParts"),Ht=i("__numberParts"),qt=i("__setPluralRules");i("__intlifyMeta");const zt=i("__injectWithOption");function Kt(e){if(!_(e))return e;for(const t in e)if(v(e,t))if(t.includes(".")){const r=t.split("."),a=r.length-1;let n=e;for(let e=0;e{if("locale"in e&&"resource"in e){const{locale:t,resource:r}=e;t?(c[t]=c[t]||{},Vt(r,c[t])):Vt(r,c)}else w(e)&&Vt(JSON.parse(e),c)})),null==n&&i)for(const f in c)v(c,f)&&Kt(c[f]);return c}const Gt=e=>!_(e)||g(e);function Vt(e,t){if(Gt(e)||Gt(t))throw jt(Ut.INVALID_VALUE);for(const r in e)v(e,r)&&(Gt(e[r])||Gt(t[r])?t[r]=e[r]:Vt(e[r],t[r]))}function Zt(e){return e.type}function $t(e,t,r){let a=_(t.messages)?t.messages:{};"__i18nGlobal"in r&&(a=Wt(e.locale.value,{messages:a,__i18n:r.__i18nGlobal}));const n=Object.keys(a);if(n.length&&n.forEach((t=>{e.mergeLocaleMessage(t,a[t])})),_(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach((r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])}))}if(_(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach((r=>{e.mergeNumberFormat(r,t.numberFormats[r])}))}}function Jt(e){return(0,Tt.Wm)(Tt.xv,null,e,0)}const Yt="__INTLIFY_META__";let Xt=0;function Qt(e){return(t,r,a,n)=>e(r,a,(0,Tt.FN)()||void 0,n)}const er=()=>{const e=(0,Tt.FN)();let t=null;return e&&(t=Zt(e)[Yt])?{[Yt]:t}:null};function tr(e={},t){const{__root:r}=e,n=void 0===r;let i=!M(e.inheritLocale)||e.inheritLocale;const c=(0,Pt.iH)(r&&i?r.locale.value:w(e.locale)?e.locale:Fe),f=(0,Pt.iH)(r&&i?r.fallbackLocale.value:w(e.fallbackLocale)||g(e.fallbackLocale)||S(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:c.value),d=(0,Pt.iH)(Wt(c.value,e)),u=(0,Pt.iH)(S(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),b=(0,Pt.iH)(S(e.numberFormats)?e.numberFormats:{[c.value]:{}});let l=r?r.missingWarn:!M(e.missingWarn)&&!s(e.missingWarn)||e.missingWarn,p=r?r.fallbackWarn:!M(e.fallbackWarn)&&!s(e.fallbackWarn)||e.fallbackWarn,x=r?r.fallbackRoot:!M(e.fallbackRoot)||e.fallbackRoot,m=!!e.fallbackFormat,v=y(e.missing)?e.missing:null,k=y(e.missing)?Qt(e.missing):null,A=y(e.postTranslation)?e.postTranslation:null,E=r?r.warnHtmlMessage:!M(e.warnHtmlMessage)||e.warnHtmlMessage,T=!!e.escapeParameter;const P=r?r.modifiers:S(e.modifiers)?e.modifiers:{};let I,B=e.pluralRules||r&&r.pluralRules;function C(){n&&Xe(null);const t={version:It,locale:c.value,fallbackLocale:f.value,messages:d.value,modifiers:P,pluralRules:B,missing:null===k?void 0:k,missingWarn:l,fallbackWarn:p,fallbackFormat:m,unresolving:!0,postTranslation:null===A?void 0:A,warnHtmlMessage:E,escapeParameter:T,messageResolver:e.messageResolver,__meta:{framework:"vue"}};t.datetimeFormats=u.value,t.numberFormats=b.value,t.__datetimeFormatters=S(I)?I.__datetimeFormatters:void 0,t.__numberFormatters=S(I)?I.__numberFormatters:void 0;const r=tt(t);return n&&Xe(r),r}function O(){return[c.value,f.value,d.value,u.value,b.value]}I=C(),at(I,c.value,f.value);const R=(0,Tt.Fl)({get:()=>c.value,set:e=>{c.value=e,I.locale=c.value}}),N=(0,Tt.Fl)({get:()=>f.value,set:e=>{f.value=e,I.fallbackLocale=f.value,at(I,c.value,e)}}),L=(0,Tt.Fl)((()=>d.value)),U=(0,Tt.Fl)((()=>u.value)),j=(0,Tt.Fl)((()=>b.value));function F(){return y(A)?A:null}function D(e){A=e,I.postTranslation=e}function H(){return v}function q(e){null!==e&&(k=Qt(e)),v=e,I.missing=k}function z(e,t,a,i,c,f){let d;if(O(),__INTLIFY_PROD_DEVTOOLS__)try{$e(er()),n||(I.fallbackContext=r?Qe():void 0),d=e(I)}finally{$e(null),n||(I.fallbackContext=void 0)}else d=e(I);if(o(d)&&d===je){const[e,a]=t();return r&&x?i(r):c(e)}if(f(d))return d;throw jt(Ut.UNEXPECTED_RETURN_TYPE)}function K(...e){return z((t=>Reflect.apply(ht,null,[t,...e])),(()=>vt(...e)),"translate",(t=>Reflect.apply(t.t,t,[...e])),(e=>e),(e=>w(e)))}function W(...e){const[t,r,a]=e;if(a&&!_(a))throw jt(Ut.INVALID_ARGUMENT);return K(t,r,h({resolvedMessage:!0},a||{}))}function G(...e){return z((t=>Reflect.apply(Mt,null,[t,...e])),(()=>_t(...e)),"datetime format",(t=>Reflect.apply(t.d,t,[...e])),(()=>De),(e=>w(e)))}function V(...e){return z((t=>Reflect.apply(At,null,[t,...e])),(()=>St(...e)),"number format",(t=>Reflect.apply(t.n,t,[...e])),(()=>De),(e=>w(e)))}function Z(e){return e.map((e=>w(e)?Jt(e):e))}const $=e=>e,J={normalize:Z,interpolate:$,type:"vnode"};function Y(...e){return z((t=>{let r;const a=t;try{a.processor=J,r=Reflect.apply(ht,null,[a,...e])}finally{a.processor=null}return r}),(()=>vt(...e)),"translate",(t=>t[Ft](...e)),(e=>[Jt(e)]),(e=>g(e)))}function X(...e){return z((t=>Reflect.apply(At,null,[t,...e])),(()=>St(...e)),"number format",(t=>t[Ht](...e)),(()=>[]),(e=>w(e)||g(e)))}function Q(...e){return z((t=>Reflect.apply(Mt,null,[t,...e])),(()=>_t(...e)),"datetime format",(t=>t[Dt](...e)),(()=>[]),(e=>w(e)||g(e)))}function ee(e){B=e,I.pluralRules=B}function te(e,t){const r=w(t)?t:c.value,a=ne(r);return null!==I.messageResolver(a,e)}function re(e){let t=null;const r=Oe(I,f.value,c.value);for(let a=0;a{i&&(c.value=e,I.locale=e,at(I,c.value,f.value))})),(0,Tt.YP)(r.fallbackLocale,(e=>{i&&(f.value=e,I.fallbackLocale=e,at(I,c.value,f.value))})));const he={id:Xt,locale:R,fallbackLocale:N,get inheritLocale(){return i},set inheritLocale(e){i=e,e&&r&&(c.value=r.locale.value,f.value=r.fallbackLocale.value,at(I,c.value,f.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:L,get modifiers(){return P},get pluralRules(){return B||{}},get isGlobal(){return n},get missingWarn(){return l},set missingWarn(e){l=e,I.missingWarn=l},get fallbackWarn(){return p},set fallbackWarn(e){p=e,I.fallbackWarn=p},get fallbackRoot(){return x},set fallbackRoot(e){x=e},get fallbackFormat(){return m},set fallbackFormat(e){m=e,I.fallbackFormat=m},get warnHtmlMessage(){return E},set warnHtmlMessage(e){E=e,I.warnHtmlMessage=e},get escapeParameter(){return T},set escapeParameter(e){T=e,I.escapeParameter=e},t:K,getLocaleMessage:ne,setLocaleMessage:ie,mergeLocaleMessage:ce,getPostTranslationHandler:F,setPostTranslationHandler:D,getMissingHandler:H,setMissingHandler:q,[qt]:ee};return he.datetimeFormats=U,he.numberFormats=j,he.rt=W,he.te=te,he.tm=ae,he.d=G,he.n=V,he.getDateTimeFormat=fe,he.setDateTimeFormat=oe,he.mergeDateTimeFormat=de,he.getNumberFormat=se,he.setNumberFormat=ue,he.mergeNumberFormat=be,he[zt]=e.__injectWithOption,he[Ft]=Y,he[Dt]=Q,he[Ht]=X,he}function rr(e){const t=w(e.locale)?e.locale:Fe,r=w(e.fallbackLocale)||g(e.fallbackLocale)||S(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,a=y(e.missing)?e.missing:void 0,n=!M(e.silentTranslationWarn)&&!s(e.silentTranslationWarn)||!e.silentTranslationWarn,i=!M(e.silentFallbackWarn)&&!s(e.silentFallbackWarn)||!e.silentFallbackWarn,c=!M(e.fallbackRoot)||e.fallbackRoot,f=!!e.formatFallbackMessages,o=S(e.modifiers)?e.modifiers:{},d=e.pluralizationRules,u=y(e.postTranslation)?e.postTranslation:void 0,b=!w(e.warnHtmlInMessage)||"off"!==e.warnHtmlInMessage,l=!!e.escapeParameterHtml,p=!M(e.sync)||e.sync;let x=e.messages;if(S(e.sharedMessages)){const t=e.sharedMessages,r=Object.keys(t);x=r.reduce(((e,r)=>{const a=e[r]||(e[r]={});return h(a,t[r]),e}),x||{})}const{__i18n:m,__root:v,__injectWithOption:_}=e,k=e.datetimeFormats,A=e.numberFormats,E=e.flatJson;return{locale:t,fallbackLocale:r,messages:x,flatJson:E,datetimeFormats:k,numberFormats:A,missing:a,missingWarn:n,fallbackWarn:i,fallbackRoot:c,fallbackFormat:f,modifiers:o,pluralRules:d,postTranslation:u,warnHtmlMessage:b,escapeParameter:l,messageResolver:e.messageResolver,inheritLocale:p,__i18n:m,__root:v,__injectWithOption:_}}function ar(e={},t){{const t=tr(rr(e)),r={id:t.id,get locale(){return t.locale.value},set locale(e){t.locale.value=e},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(e){t.fallbackLocale.value=e},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(e){},get missing(){return t.getMissingHandler()},set missing(e){t.setMissingHandler(e)},get silentTranslationWarn(){return M(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(e){t.missingWarn=M(e)?!e:e},get silentFallbackWarn(){return M(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(e){t.fallbackWarn=M(e)?!e:e},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(e){t.fallbackFormat=e},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(e){t.setPostTranslationHandler(e)},get sync(){return t.inheritLocale},set sync(e){t.inheritLocale=e},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(e){t.warnHtmlMessage="off"!==e},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(e){t.escapeParameter=e},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(e){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...e){const[r,a,n]=e,i={};let c=null,f=null;if(!w(r))throw jt(Ut.INVALID_ARGUMENT);const o=r;return w(a)?i.locale=a:g(a)?c=a:S(a)&&(f=a),g(n)?c=n:S(n)&&(f=n),Reflect.apply(t.t,t,[o,c||f||{},i])},rt(...e){return Reflect.apply(t.rt,t,[...e])},tc(...e){const[r,a,n]=e,i={plural:1};let c=null,f=null;if(!w(r))throw jt(Ut.INVALID_ARGUMENT);const d=r;return w(a)?i.locale=a:o(a)?i.plural=a:g(a)?c=a:S(a)&&(f=a),w(n)?i.locale=n:g(n)?c=n:S(n)&&(f=n),Reflect.apply(t.t,t,[d,c||f||{},i])},te(e,r){return t.te(e,r)},tm(e){return t.tm(e)},getLocaleMessage(e){return t.getLocaleMessage(e)},setLocaleMessage(e,r){t.setLocaleMessage(e,r)},mergeLocaleMessage(e,r){t.mergeLocaleMessage(e,r)},d(...e){return Reflect.apply(t.d,t,[...e])},getDateTimeFormat(e){return t.getDateTimeFormat(e)},setDateTimeFormat(e,r){t.setDateTimeFormat(e,r)},mergeDateTimeFormat(e,r){t.mergeDateTimeFormat(e,r)},n(...e){return Reflect.apply(t.n,t,[...e])},getNumberFormat(e){return t.getNumberFormat(e)},setNumberFormat(e,r){t.setNumberFormat(e,r)},mergeNumberFormat(e,r){t.mergeNumberFormat(e,r)},getChoiceIndex(e,t){return-1},__onComponentInstanceCreated(t){const{componentInstanceCreatedListener:a}=e;a&&a(t,r)}};return r}}const nr={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>"parent"===e||"global"===e,default:"parent"},i18n:{type:Object}};function ir({slots:e},t){if(1===t.length&&"default"===t[0]){const t=e.default?e.default():[];return t.reduce(((e,t)=>[...e,...g(t.children)?t.children:[t]]),[])}return t.reduce(((t,r)=>{const a=e[r];return a&&(t[r]=a()),t}),{})}function cr(e){return Tt.HY}const fr={name:"i18n-t",props:h({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>o(e)||!isNaN(e)}},nr),setup(e,t){const{slots:r,attrs:a}=t,n=e.i18n||Mr({useScope:e.scope,__useComponent:!0}),i=Object.keys(r).filter((e=>"_"!==e));return()=>{const r={};e.locale&&(r.locale=e.locale),void 0!==e.plural&&(r.plural=w(e.plural)?+e.plural:e.plural);const c=ir(t,i),f=n[Ft](e.keypath,c,r),o=h({},a),d=w(e.tag)||_(e.tag)?e.tag:cr();return(0,Tt.h)(d,o,f)}}};function or(e,t,r,a){const{slots:n,attrs:i}=t;return()=>{const t={part:!0};let c={};e.locale&&(t.locale=e.locale),w(e.format)?t.key=e.format:_(e.format)&&(w(e.format.key)&&(t.key=e.format.key),c=Object.keys(e.format).reduce(((t,a)=>r.includes(a)?h({},t,{[a]:e.format[a]}):t),{}));const f=a(e.value,t,c);let o=[t.key];g(f)?o=f.map(((e,t)=>{const r=n[e.type];return r?r({[e.type]:e.value,index:t,parts:f}):[e.value]})):w(f)&&(o=[f]);const d=h({},i),s=w(e.tag)||_(e.tag)?e.tag:cr();return(0,Tt.h)(s,d,o)}}const dr=["localeMatcher","style","unit","unitDisplay","currency","currencyDisplay","useGrouping","numberingSystem","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","notation","formatMatcher"],sr={name:"i18n-n",props:h({value:{type:Number,required:!0},format:{type:[String,Object]}},nr),setup(e,t){const r=e.i18n||Mr({useScope:"parent",__useComponent:!0});return or(e,t,dr,((...e)=>r[Ht](...e)))}},ur=["dateStyle","timeStyle","fractionalSecondDigits","calendar","dayPeriod","numberingSystem","localeMatcher","timeZone","hour12","hourCycle","formatMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName"],br={name:"i18n-d",props:h({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},nr),setup(e,t){const r=e.i18n||Mr({useScope:"parent",__useComponent:!0});return or(e,t,ur,((...e)=>r[Dt](...e)))}};function hr(e,t){const r=e;if("composition"===e.mode)return r.__getInstance(t)||e.global;{const a=r.__getInstance(t);return null!=a?a.__composer:e.global.__composer}}function lr(e){const t=(t,{instance:r,value:a,modifiers:n})=>{if(!r||!r.$)throw jt(Ut.UNEXPECTED_ERROR);const i=hr(e,r.$);const c=pr(a);t.textContent=Reflect.apply(i.t,i,[...xr(c)])};return{beforeMount:t,beforeUpdate:t}}function pr(e){if(w(e))return{path:e};if(S(e)){if(!("path"in e))throw jt(Ut.REQUIRED_VALUE,"path");return e}throw jt(Ut.INVALID_VALUE)}function xr(e){const{path:t,locale:r,args:a,choice:n,plural:i}=e,c={},f=a||{};return w(r)&&(c.locale=r),o(n)&&(c.plural=n),o(i)&&(c.plural=i),[t,f,c]}function mr(e,t,...r){const a=S(r[0])?r[0]:{},n=!!a.useI18nComponentName,i=!M(a.globalInstall)||a.globalInstall;i&&(e.component(n?"i18n":fr.name,fr),e.component(sr.name,sr),e.component(br.name,br)),e.directive("t",lr(t))}function vr(e,t,r){return{beforeCreate(){const a=(0,Tt.FN)();if(!a)throw jt(Ut.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const r=n.i18n;n.__i18n&&(r.__i18n=n.__i18n),r.__root=t,this===this.$root?this.$i18n=gr(e,r):(r.__injectWithOption=!0,this.$i18n=ar(r))}else n.__i18n?this===this.$root?this.$i18n=gr(e,n):this.$i18n=ar({__i18n:n.__i18n,__injectWithOption:!0,__root:t}):this.$i18n=e;n.__i18nGlobal&&$t(t,n,n),e.__onComponentInstanceCreated(this.$i18n),r.__setInstance(a,this.$i18n),this.$t=(...e)=>this.$i18n.t(...e),this.$rt=(...e)=>this.$i18n.rt(...e),this.$tc=(...e)=>this.$i18n.tc(...e),this.$te=(e,t)=>this.$i18n.te(e,t),this.$d=(...e)=>this.$i18n.d(...e),this.$n=(...e)=>this.$i18n.n(...e),this.$tm=e=>this.$i18n.tm(e)},mounted(){0},unmounted(){const e=(0,Tt.FN)();if(!e)throw jt(Ut.UNEXPECTED_ERROR);delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__deleteInstance(e),delete this.$i18n}}}function gr(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[qt](t.pluralizationRules||e.pluralizationRules);const r=Wt(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(r).forEach((t=>e.mergeLocaleMessage(t,r[t]))),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach((r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r]))),t.numberFormats&&Object.keys(t.numberFormats).forEach((r=>e.mergeNumberFormat(r,t.numberFormats[r]))),e}const yr=i("global-vue-i18n");function wr(e={},t){const r=__VUE_I18N_LEGACY_API__&&M(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,a=!!e.globalInjection,n=!__VUE_I18N_LEGACY_API__||!r||!!e.allowComposition,c=new Map,f=_r(e,r),o=i("");function d(e){return c.get(e)||null}function s(e,t){c.set(e,t)}function u(e){c.delete(e)}{const e={get mode(){return __VUE_I18N_LEGACY_API__&&r?"legacy":"composition"},get allowComposition(){return n},async install(t,...n){t.__VUE_I18N_SYMBOL__=o,t.provide(t.__VUE_I18N_SYMBOL__,e),!r&&a&&Cr(t,e.global),__VUE_I18N_FULL_INSTALL__&&mr(t,e,...n),__VUE_I18N_LEGACY_API__&&r&&t.mixin(vr(f,f.__composer,e))},get global(){return f},__instances:c,__getInstance:d,__setInstance:s,__deleteInstance:u};return e}}function Mr(e={}){const t=(0,Tt.FN)();if(null==t)throw jt(Ut.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&null!=t.appContext.app&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw jt(Ut.NOT_INSLALLED);const r=kr(t),a=Sr(r),n=Zt(t),i=Ar(e,n);if(__VUE_I18N_LEGACY_API__&&"legacy"===r.mode&&!e.__useComponent){if(!r.allowComposition)throw jt(Ut.NOT_AVAILABLE_IN_LEGACY_MODE);return Pr(t,i,a,e)}if("global"===i)return $t(a,e,n),a;if("parent"===i){let n=Er(r,t,e.__useComponent);return null==n&&(n=a),n}const c=r;let f=c.__getInstance(t);if(null==f){const r=h({},e);"__i18n"in n&&(r.__i18n=n.__i18n),a&&(r.__root=a),f=tr(r),Tr(c,t,f),c.__setInstance(t,f)}return f}function _r(e,t,r){return __VUE_I18N_LEGACY_API__&&t?ar(e):tr(e)}function kr(e){{const t=(0,Tt.f3)(e.isCE?yr:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw jt(e.isCE?Ut.NOT_INSLALLED_WITH_PROVIDE:Ut.UNEXPECTED_ERROR);return t}}function Ar(e,t){return u(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Sr(e){return"composition"===e.mode?e.global:e.global.__composer}function Er(e,t,r=!1){let a=null;const n=t.root;let i=t.parent;while(null!=i){const t=e;if("composition"===e.mode)a=t.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const e=t.__getInstance(i);null!=e&&(a=e.__composer,r&&a&&!a[zt]&&(a=null))}if(null!=a)break;if(n===i)break;i=i.parent}return a}function Tr(e,t,r){(0,Tt.bv)((()=>{0}),t),(0,Tt.Ah)((()=>{e.__deleteInstance(t)}),t)}function Pr(e,t,r,a={}){const n="local"===t,i=(0,Pt.XI)(null);if(n&&e.proxy&&!e.proxy.$options.i18n)throw jt(Ut.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const c=!M(a.inheritLocale)||a.inheritLocale,f=(0,Pt.iH)(n&&c?r.locale.value:w(a.locale)?a.locale:Fe),o=(0,Pt.iH)(n&&c?r.fallbackLocale.value:w(a.fallbackLocale)||g(a.fallbackLocale)||S(a.fallbackLocale)||!1===a.fallbackLocale?a.fallbackLocale:f.value),d=(0,Pt.iH)(Wt(f.value,a)),u=(0,Pt.iH)(S(a.datetimeFormats)?a.datetimeFormats:{[f.value]:{}}),b=(0,Pt.iH)(S(a.numberFormats)?a.numberFormats:{[f.value]:{}}),h=n?r.missingWarn:!M(a.missingWarn)&&!s(a.missingWarn)||a.missingWarn,l=n?r.fallbackWarn:!M(a.fallbackWarn)&&!s(a.fallbackWarn)||a.fallbackWarn,p=n?r.fallbackRoot:!M(a.fallbackRoot)||a.fallbackRoot,x=!!a.fallbackFormat,m=y(a.missing)?a.missing:null,v=y(a.postTranslation)?a.postTranslation:null,_=n?r.warnHtmlMessage:!M(a.warnHtmlMessage)||a.warnHtmlMessage,k=!!a.escapeParameter,A=n?r.modifiers:S(a.modifiers)?a.modifiers:{},E=a.pluralRules||n&&r.pluralRules;function T(){return[f.value,o.value,d.value,u.value,b.value]}const P=(0,Tt.Fl)({get:()=>i.value?i.value.locale.value:f.value,set:e=>{i.value&&(i.value.locale.value=e),f.value=e}}),I=(0,Tt.Fl)({get:()=>i.value?i.value.fallbackLocale.value:o.value,set:e=>{i.value&&(i.value.fallbackLocale.value=e),o.value=e}}),B=(0,Tt.Fl)((()=>i.value?i.value.messages.value:d.value)),C=(0,Tt.Fl)((()=>u.value)),O=(0,Tt.Fl)((()=>b.value));function R(){return i.value?i.value.getPostTranslationHandler():v}function N(e){i.value&&i.value.setPostTranslationHandler(e)}function L(){return i.value?i.value.getMissingHandler():m}function U(e){i.value&&i.value.setMissingHandler(e)}function j(e){return T(),e()}function F(...e){return i.value?j((()=>Reflect.apply(i.value.t,null,[...e]))):j((()=>""))}function D(...e){return i.value?Reflect.apply(i.value.rt,null,[...e]):""}function H(...e){return i.value?j((()=>Reflect.apply(i.value.d,null,[...e]))):j((()=>""))}function q(...e){return i.value?j((()=>Reflect.apply(i.value.n,null,[...e]))):j((()=>""))}function z(e){return i.value?i.value.tm(e):{}}function K(e,t){return!!i.value&&i.value.te(e,t)}function W(e){return i.value?i.value.getLocaleMessage(e):{}}function G(e,t){i.value&&(i.value.setLocaleMessage(e,t),d.value[e]=t)}function V(e,t){i.value&&i.value.mergeLocaleMessage(e,t)}function Z(e){return i.value?i.value.getDateTimeFormat(e):{}}function $(e,t){i.value&&(i.value.setDateTimeFormat(e,t),u.value[e]=t)}function J(e,t){i.value&&i.value.mergeDateTimeFormat(e,t)}function Y(e){return i.value?i.value.getNumberFormat(e):{}}function X(e,t){i.value&&(i.value.setNumberFormat(e,t),b.value[e]=t)}function Q(e,t){i.value&&i.value.mergeNumberFormat(e,t)}const ee={get id(){return i.value?i.value.id:-1},locale:P,fallbackLocale:I,messages:B,datetimeFormats:C,numberFormats:O,get inheritLocale(){return i.value?i.value.inheritLocale:c},set inheritLocale(e){i.value&&(i.value.inheritLocale=e)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(d.value)},get modifiers(){return i.value?i.value.modifiers:A},get pluralRules(){return i.value?i.value.pluralRules:E},get isGlobal(){return!!i.value&&i.value.isGlobal},get missingWarn(){return i.value?i.value.missingWarn:h},set missingWarn(e){i.value&&(i.value.missingWarn=e)},get fallbackWarn(){return i.value?i.value.fallbackWarn:l},set fallbackWarn(e){i.value&&(i.value.missingWarn=e)},get fallbackRoot(){return i.value?i.value.fallbackRoot:p},set fallbackRoot(e){i.value&&(i.value.fallbackRoot=e)},get fallbackFormat(){return i.value?i.value.fallbackFormat:x},set fallbackFormat(e){i.value&&(i.value.fallbackFormat=e)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:_},set warnHtmlMessage(e){i.value&&(i.value.warnHtmlMessage=e)},get escapeParameter(){return i.value?i.value.escapeParameter:k},set escapeParameter(e){i.value&&(i.value.escapeParameter=e)},t:F,getPostTranslationHandler:R,setPostTranslationHandler:N,getMissingHandler:L,setMissingHandler:U,rt:D,d:H,n:q,tm:z,te:K,getLocaleMessage:W,setLocaleMessage:G,mergeLocaleMessage:V,getDateTimeFormat:Z,setDateTimeFormat:$,mergeDateTimeFormat:J,getNumberFormat:Y,setNumberFormat:X,mergeNumberFormat:Q};function te(e){e.locale.value=f.value,e.fallbackLocale.value=o.value,Object.keys(d.value).forEach((t=>{e.mergeLocaleMessage(t,d.value[t])})),Object.keys(u.value).forEach((t=>{e.mergeDateTimeFormat(t,u.value[t])})),Object.keys(b.value).forEach((t=>{e.mergeNumberFormat(t,b.value[t])})),e.escapeParameter=k,e.fallbackFormat=x,e.fallbackRoot=p,e.fallbackWarn=l,e.missingWarn=h,e.warnHtmlMessage=_}return(0,Tt.wF)((()=>{if(null==e.proxy||null==e.proxy.$i18n)throw jt(Ut.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const r=i.value=e.proxy.$i18n.__composer;"global"===t?(f.value=r.locale.value,o.value=r.fallbackLocale.value,d.value=r.messages.value,u.value=r.datetimeFormats.value,b.value=r.numberFormats.value):n&&te(r)})),ee}const Ir=["locale","fallbackLocale","availableLocales"],Br=["t","rt","d","n","tm"];function Cr(e,t){const r=Object.create(null);Ir.forEach((e=>{const a=Object.getOwnPropertyDescriptor(t,e);if(!a)throw jt(Ut.UNEXPECTED_ERROR);const n=(0,Pt.dq)(a.value)?{get(){return a.value.value},set(e){a.value.value=e}}:{get(){return a.get&&a.get()}};Object.defineProperty(r,e,n)})),e.config.globalProperties.$i18n=r,Br.forEach((r=>{const a=Object.getOwnPropertyDescriptor(t,r);if(!a||!a.value)throw jt(Ut.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${r}`,a)}))}if(We(ct),Ge(xe),Ve(Oe),Bt(),__INTLIFY_PROD_DEVTOOLS__){const e=p();e.__INTLIFY__=!0,Ee(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}},40089:function(e,t){"use strict";t.Z=(e,t)=>{const r=e.__vccOpts||e;for(const[a,n]of t)r[a]=n;return r}},44152:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var a=r(73396),n=r(87139);const i={ref:"wrap"},c=["innerHTML"];function f(e,t,r,f,o,d){return(0,a.wg)(),(0,a.iD)("div",i,[d.navigation?((0,a.wg)(),(0,a.iD)("div",{key:0,style:(0,n.j5)(d.leftSwitch),class:(0,n.C_)(d.leftSwitchClass),onClick:t[0]||(t[0]=(...e)=>d.leftSwitchClick&&d.leftSwitchClick(...e))},[(0,a.WI)(e.$slots,"left-switch")],6)):(0,a.kq)("",!0),d.navigation?((0,a.wg)(),(0,a.iD)("div",{key:1,style:(0,n.j5)(d.rightSwitch),class:(0,n.C_)(d.rightSwitchClass),onClick:t[1]||(t[1]=(...e)=>d.rightSwitchClick&&d.rightSwitchClick(...e))},[(0,a.WI)(e.$slots,"right-switch")],6)):(0,a.kq)("",!0),(0,a._)("div",{ref:"realBox",style:(0,n.j5)(d.pos),onMouseenter:t[2]||(t[2]=(...e)=>d.enter&&d.enter(...e)),onMouseleave:t[3]||(t[3]=(...e)=>d.leave&&d.leave(...e)),onTouchstart:t[4]||(t[4]=(...e)=>d.touchStart&&d.touchStart(...e)),onTouchmove:t[5]||(t[5]=(...e)=>d.touchMove&&d.touchMove(...e)),onTouchend:t[6]||(t[6]=(...e)=>d.touchEnd&&d.touchEnd(...e))},[(0,a._)("div",{ref:"slotList",style:(0,n.j5)(d.float)},[(0,a.WI)(e.$slots,"default")],4),(0,a._)("div",{innerHTML:o.copyHtml,style:(0,n.j5)(d.float)},null,12,c)],36)],512)}r(79120)();const o=r(3506),d=r(31682);var s={name:"vue-seamless-scroll",data(){return{xPos:0,yPos:0,delay:0,copyHtml:"",height:0,width:0,realBoxWidth:0}},props:{data:{type:Array,default:()=>[]},classOption:{type:Object,default:()=>({})}},computed:{leftSwitchState(){return this.xPos<0},rightSwitchState(){return Math.abs(this.xPos)=this.options.limitMoveNum},hoverStopSwitch(){return this.options.hoverStop&&this.autoPlay&&this.scrollSwitch},canTouchScroll(){return this.options.openTouch},isHorizontal(){return this.options.direction>1},baseFontSize(){return this.options.isSingleRemUnit?parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1},realSingleStopWidth(){return this.options.singleWidth*this.baseFontSize},realSingleStopHeight(){return this.options.singleHeight*this.baseFontSize},step(){let e,t=this.options.step;return e=this.isHorizontal?this.realSingleStopWidth:this.realSingleStopHeight,e>0&&e%t>0&&console.error("如果设置了单步滚动,step需是单步大小的约数,否则无法保证单步滚动结束的位置是否准确。~~~~~"),t}},methods:{reset(){this._cancle(),this._initMove()},leftSwitchClick(){this.leftSwitchState&&(Math.abs(this.xPos){this._cancle()}),a+20)):this._cancle()},touchMove(e){if(!this.canTouchScroll||e.targetTouches.length>1||e.scale&&1!==e.scale)return;const t=e.targetTouches[0],{direction:r}=this.options;this.endPos={x:t.pageX-this.startPos.x,y:t.pageY-this.startPos.y},event.preventDefault();const a=Math.abs(this.endPos.x)1&&(this.xPos=this.startPosX+this.endPos.x)},touchEnd(){if(!this.canTouchScroll)return;let e;const t=this.options.direction;if(this.delay=50,1===t)this.yPos>0&&(this.yPos=0);else if(0===t){let e=this.realBoxHeight/2*-1;this.yPos0&&(this.xPos=0);else if(3===t){let e=-1*this.realBoxWidth;this.xPos{this.delay=0,this._move()}),this.delay)},enter(){this.hoverStopSwitch&&this._stopMove()},leave(){this.hoverStopSwitch&&this._startMove()},_move(){this.isHover||(this._cancle(),this.reqFrame=requestAnimationFrame(function(){const e=this.realBoxHeight/2,t=this.realBoxWidth/2;let{direction:r,waitTime:a}=this.options,{step:n}=this;1===r?(Math.abs(this.yPos)>=e&&(this.$emit("ScrollEnd"),this.yPos=0),this.yPos-=n):0===r?(this.yPos>=0&&(this.$emit("ScrollEnd"),this.yPos=-1*e),this.yPos+=n):2===r?(Math.abs(this.xPos)>=t&&(this.$emit("ScrollEnd"),this.xPos=0),this.xPos-=n):3===r&&(this.xPos>=0&&(this.$emit("ScrollEnd"),this.xPos=-1*t),this.xPos+=n),this.singleWaitTime&&clearTimeout(this.singleWaitTime),this.realSingleStopHeight?Math.abs(this.yPos)%this.realSingleStopHeight{this._move()}),a):this._move():this.realSingleStopWidth&&Math.abs(this.xPos)%this.realSingleStopWidth{this._move()}),a):this._move()}.bind(this)))},_initMove(){this.$nextTick((()=>{const{switchDelay:e}=this.options,{autoPlay:t,isHorizontal:r}=this;if(this._dataWarm(this.data),this.copyHtml="",r){this.height=this.$refs.wrap.offsetHeight,this.width=this.$refs.wrap.offsetWidth;let e=this.$refs.slotList.offsetWidth;t&&(e=2*e+1),this.$refs.realBox.style.width=e+"px",this.realBoxWidth=e}if(!t)return this.ease="linear",void(this.delay=e);if(this.ease="ease-in",this.delay=0,this.scrollSwitch){let e;e&&clearTimeout(e),this.copyHtml=this.$refs.slotList.innerHTML,setTimeout((()=>{this.realBoxHeight=this.$refs.realBox.offsetHeight,this._move()}),0)}else this._cancle(),this.yPos=this.xPos=0}))},_dataWarm(e){e.length>100&&console.warn(`数据达到了${e.length}条有点多哦~,可能会造成部分老旧浏览器卡顿。`)},_startMove(){this.isHover=!1,this._move()},_stopMove(){this.isHover=!0,this.singleWaitTime&&clearTimeout(this.singleWaitTime),this._cancle()}},mounted(){this._initMove()},watch:{data(e,t){this._dataWarm(e),o(e,t)||this.reset()},autoPlay(e){e?this.reset():this._stopMove()}},beforeCreate(){this.reqFrame=null,this.singleWaitTime=null,this.isHover=!1,this.ease="ease-in"},beforeDestroy(){this._cancle(),clearTimeout(this.singleWaitTime)}},u=r(40089);const b=(0,u.Z)(s,[["render",f]]);var h=b;h.install=function(e,t={}){e.component(t.componentName||h.name,h)},"undefined"!==typeof window&&window.Vue&&Vue.component(h.name,h);var l=h},92062:function(e,t,r){"use strict";r(21703),r(52262),r(24506);var a=r(81776),n=function e(t){this.givenProvider=e.givenProvider,t&&t._requestManager&&(t=t.currentProvider),"undefined"!==typeof document&&(this.pick=a.pick),this.setProvider(t)};n.givenProvider=null,"undefined"!==typeof ethereum&ðereum.bzz&&(n.givenProvider=ethereum.bzz),n.prototype.setProvider=function(e){if(e&&"object"===typeof e&&"string"===typeof e.bzz&&(e=e.bzz),"string"!==typeof e){this.currentProvider=null;var t=new Error("No provider set, please set one using bzz.setProvider().");return this.download=this.upload=this.isAvailable=function(){throw t},!1}return this.currentProvider=e,this.download=a.at(e).download,this.upload=a.at(e).upload,this.isAvailable=a.at(e).isAvailable,!0},e.exports=n},64:function(e,t,r){"use strict";r(21703),e.exports={ErrorResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:JSON.stringify(e),r=e.error&&e.error.data?e.error.data:null,a=new Error("Returned error: "+t);return a.data=r,a},InvalidNumberOfParams:function(e,t,r){return new Error('Invalid number of parameters for "'+r+'". Got '+e+" expected "+t+"!")},InvalidConnection:function(e,t){return this.ConnectionError("CONNECTION ERROR: Couldn't connect to node "+e+".",t)},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:"Invalid JSON RPC response: "+JSON.stringify(e);return new Error(t)},ConnectionTimeout:function(e){return new Error("CONNECTION TIMEOUT: timeout of "+e+" ms achived")},ConnectionNotOpenError:function(e){return this.ConnectionError("connection not open on send()",e)},ConnectionCloseError:function(e){return"object"===typeof e&&e.code&&e.reason?this.ConnectionError("CONNECTION ERROR: The connection got closed with the close code `"+e.code+"` and the following reason string `"+e.reason+"`",e):new Error("CONNECTION ERROR: The connection closed unexpectedly")},MaxAttemptsReachedOnReconnectingError:function(){return new Error("Maximum number of reconnect attempts reached!")},PendingRequestsOnReconnectingError:function(){return new Error("CONNECTION ERROR: Provider started to reconnect before the response got received!")},ConnectionError:function(e,t){const r=new Error(e);return t&&(r.code=t.code,r.reason=t.reason),r},RevertInstructionError:function(e,t){var r=new Error("Your request got reverted with the following reason string: "+e);return r.reason=e,r.signature=t,r},TransactionRevertInstructionError:function(e,t,r){var a=new Error("Transaction has been reverted by the EVM:\n"+JSON.stringify(r,null,2));return a.reason=e,a.signature=t,a.receipt=r,a},TransactionError:function(e,t){var r=new Error(e);return r.receipt=t,r},NoContractAddressFoundError:function(e){return this.TransactionError("The transaction receipt didn't contain a contract address.",e)},ContractCodeNotStoredError:function(e){return this.TransactionError("The contract code couldn't be stored, please check your gas limit.",e)},TransactionRevertedWithoutReasonError:function(e){return this.TransactionError("Transaction has been reverted by the EVM:\n"+JSON.stringify(e,null,2),e)},TransactionOutOfGasError:function(e){return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n"+JSON.stringify(e,null,2),e)},ResolverMethodMissingError:function(e,t){return new Error("The resolver at "+e+'does not implement requested method: "'+t+'".')},ContractMissingABIError:function(){return new Error("You must provide the json interface of the contract when instantiating a contract object.")},ContractOnceRequiresCallbackError:function(){return new Error("Once requires a callback as the second parameter.")},ContractEventDoesNotExistError:function(e){return new Error('Event "'+e+"\" doesn't exist in this contract.")},ContractReservedEventError:function(e){return new Error('The event "'+e+"\" is a reserved event name, you can't use it.")},ContractMissingDeployDataError:function(){return new Error('No "data" specified in neither the given options, nor the default options.')},ContractNoAddressDefinedError:function(){return new Error("This contract object doesn't have address set yet, please set an address first.")},ContractNoFromAddressDefinedError:function(){return new Error('No "from" address specified in neither the given options, nor the default options.')}}},74965:function(e,t,r){"use strict";r(21703);var a=r(77802),n=r(80188),i=function(e){return e.map(a.numberToHex)},c=function(e){return e.address=a.toChecksumAddress(e.address),e.nonce=a.hexToNumberString(e.nonce),e.balance=a.hexToNumberString(e.balance),e},f=function(e){return a.toBN(e).toString(10)},o=function(e){return"latest"===e||"pending"===e||"earliest"===e},d=function(e){return s(!this||void 0!==e&&null!==e?e:this.defaultBlock)},s=function(e){if(void 0!==e)return o(e)?e:"genesis"===e?"0x0":a.isHexStrict(e)?"string"===typeof e?e.toLowerCase():e:a.numberToHex(e)},u=function(e){if(e.to&&(e.to=M(e.to)),e.data&&e.input)throw new Error('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');if(!e.data&&e.input&&(e.data=e.input,delete e.input),e.data&&!e.data.startsWith("0x")&&(e.data="0x"+e.data),e.data&&!a.isHex(e.data))throw new Error("The data field must be HEX encoded data.");return(e.gas||e.gasLimit)&&(e.gas=e.gas||e.gasLimit),(e.maxPriorityFeePerGas||e.maxFeePerGas)&&delete e.gasPrice,["gasPrice","gas","value","maxPriorityFeePerGas","maxFeePerGas","nonce"].filter((function(t){return void 0!==e[t]})).forEach((function(t){e[t]=a.numberToHex(e[t])})),e},b=function(e){e=u(e);var t=e.from||(this?this.defaultAccount:null);return t&&(e.from=M(t)),e},h=function(e){if(e=u(e),"number"!==typeof e.from&&(!e.from||"object"!==typeof e.from)){if(e.from=e.from||(this?this.defaultAccount:null),!e.from&&"number"!==typeof e.from)throw new Error('The send transactions "from" field must be defined!');e.from=M(e.from)}return e},l=function(e){return a.isHexStrict(e)?e:a.utf8ToHex(e)},p=function(e){return null!==e.blockNumber&&(e.blockNumber=a.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=a.hexToNumber(e.transactionIndex)),e.nonce=a.hexToNumber(e.nonce),e.gas=a.hexToNumber(e.gas),e.gasPrice&&(e.gasPrice=f(e.gasPrice)),e.maxFeePerGas&&(e.maxFeePerGas=f(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=f(e.maxPriorityFeePerGas)),e.type&&(e.type=a.hexToNumber(e.type)),e.value=f(e.value),e.to&&a.isAddress(e.to)?e.to=a.toChecksumAddress(e.to):e.to=null,e.from&&(e.from=a.toChecksumAddress(e.from)),e},x=function(e){if("object"!==typeof e)throw new Error("Received receipt is invalid: "+e);return null!==e.blockNumber&&(e.blockNumber=a.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=a.hexToNumber(e.transactionIndex)),e.cumulativeGasUsed=a.hexToNumber(e.cumulativeGasUsed),e.gasUsed=a.hexToNumber(e.gasUsed),Array.isArray(e.logs)&&(e.logs=e.logs.map(g)),e.effectiveGasPrice&&(e.effectiveGasPrice=a.hexToNumber(e.effectiveGasPrice)),e.contractAddress&&(e.contractAddress=a.toChecksumAddress(e.contractAddress)),"undefined"!==typeof e.status&&null!==e.status&&(e.status=Boolean(parseInt(e.status))),e},m=function(e){return e.gasLimit=a.hexToNumber(e.gasLimit),e.gasUsed=a.hexToNumber(e.gasUsed),e.size=a.hexToNumber(e.size),e.timestamp=a.hexToNumber(e.timestamp),null!==e.number&&(e.number=a.hexToNumber(e.number)),e.difficulty&&(e.difficulty=f(e.difficulty)),e.totalDifficulty&&(e.totalDifficulty=f(e.totalDifficulty)),Array.isArray(e.transactions)&&e.transactions.forEach((function(e){if("string"!==typeof e)return p(e)})),e.miner&&(e.miner=a.toChecksumAddress(e.miner)),e.baseFeePerGas&&(e.baseFeePerGas=a.hexToNumber(e.baseFeePerGas)),e},v=function(e){var t=function(e){return null===e||"undefined"===typeof e?null:(e=String(e),0===e.indexOf("0x")?e:a.fromUtf8(e))};return void 0===e&&(e={}),void 0===e.fromBlock&&(e={...e,fromBlock:"latest"}),(e.fromBlock||0===e.fromBlock)&&(e.fromBlock=s(e.fromBlock)),(e.toBlock||0===e.toBlock)&&(e.toBlock=s(e.toBlock)),e.topics=e.topics||[],e.topics=e.topics.map((function(e){return Array.isArray(e)?e.map(t):t(e)})),t=null,e.address&&(e.address=Array.isArray(e.address)?e.address.map((function(e){return M(e)})):M(e.address)),e},g=function(e){if("string"===typeof e.blockHash&&"string"===typeof e.transactionHash&&"string"===typeof e.logIndex){var t=a.sha3(e.blockHash.replace("0x","")+e.transactionHash.replace("0x","")+e.logIndex.replace("0x",""));e.id="log_"+t.replace("0x","").substr(0,8)}else e.id||(e.id=null);return null!==e.blockNumber&&(e.blockNumber=a.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=a.hexToNumber(e.transactionIndex)),null!==e.logIndex&&(e.logIndex=a.hexToNumber(e.logIndex)),e.address&&(e.address=a.toChecksumAddress(e.address)),e},y=function(e){return e.ttl&&(e.ttl=a.numberToHex(e.ttl)),e.workToProve&&(e.workToProve=a.numberToHex(e.workToProve)),e.priority&&(e.priority=a.numberToHex(e.priority)),Array.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map((function(e){return 0===e.indexOf("0x")?e:a.fromUtf8(e)})),e},w=function(e){return e.expiry=a.hexToNumber(e.expiry),e.sent=a.hexToNumber(e.sent),e.ttl=a.hexToNumber(e.ttl),e.workProved=a.hexToNumber(e.workProved),e.topics||(e.topics=[]),e.topics=e.topics.map((function(e){return a.toUtf8(e)})),e},M=function(e){var t=new n(e);if(t.isValid()&&t.isDirect())return t.toAddress().toLowerCase();if(a.isAddress(e))return"0x"+e.toLowerCase().replace("0x","");throw new Error(`Provided address ${e} is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted.`)},_=function(e){return e.startingBlock=a.hexToNumber(e.startingBlock),e.currentBlock=a.hexToNumber(e.currentBlock),e.highestBlock=a.hexToNumber(e.highestBlock),e.knownStates&&(e.knownStates=a.hexToNumber(e.knownStates),e.pulledStates=a.hexToNumber(e.pulledStates)),e};e.exports={inputDefaultBlockNumberFormatter:d,inputBlockNumberFormatter:s,inputCallFormatter:b,inputTransactionFormatter:h,inputAddressFormatter:M,inputPostFormatter:y,inputLogFormatter:v,inputSignFormatter:l,inputStorageKeysFormatter:i,outputProofFormatter:c,outputBigNumberFormatter:f,outputTransactionFormatter:p,outputTransactionReceiptFormatter:x,outputBlockFormatter:m,outputLogFormatter:g,outputPostFormatter:w,outputSyncingFormatter:_}},11205:function(e,t,r){"use strict";var a=r(64),n=r(74965);e.exports={errors:a,formatters:n}},79021:function(e,t,r){"use strict";r(21703);var a=r(11205).errors,n=r(11205).formatters,i=r(77802),c=r(80165),f=r(84598).subscriptions,o=r(68775),d=function(e){if(!e.call||!e.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.abiCoder=e.abiCoder,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.transactionBlockTimeout=e.transactionBlockTimeout||50,this.transactionConfirmationBlocks=e.transactionConfirmationBlocks||24,this.transactionPollingTimeout=e.transactionPollingTimeout||750,this.transactionPollingInterval=e.transactionPollingInterval||1e3,this.blockHeaderTimeout=e.blockHeaderTimeout||10,this.defaultCommon=e.defaultCommon,this.defaultChain=e.defaultChain,this.defaultHardfork=e.defaultHardfork,this.handleRevert=e.handleRevert};d.prototype.setRequestManager=function(e,t){this.requestManager=e,t&&(this.accounts=t)},d.prototype.createFunction=function(e,t){var r=this.buildCall();return r.call=this.call,this.setRequestManager(e||this.requestManager,t||this.accounts),r},d.prototype.attachToObject=function(e){var t=this.buildCall();t.call=this.call;var r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},d.prototype.getCall=function(e){return"function"===typeof this.call?this.call(e):this.call},d.prototype.extractCallback=function(e){if("function"===typeof e[e.length-1])return e.pop()},d.prototype.validateArgs=function(e){if(e.length!==this.params)throw a.InvalidNumberOfParams(e.length,this.params,this.name)},d.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(r,a){return r?r.call(t,e[a]):e[a]})):e},d.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},d.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),a=this.formatInput(e);this.validateArgs(a);var n={method:t,params:a,callback:r};return this.transformPayload&&(n=this.transformPayload(n)),n},d.prototype._confirmTransaction=function(e,t,r){var s=this,u=!1,b=!0,h=0,l=0,p=null,x=null,m=null,v=r.params[0]&&"object"===typeof r.params[0]&&r.params[0].gas?r.params[0].gas:null,g=!!r.params[0]&&"object"===typeof r.params[0]&&r.params[0].data&&r.params[0].from&&!r.params[0].to,y=g&&r.params[0].data.length>2,w=[new d({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[n.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:n.outputBlockFormatter}),new d({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:n.outputTransactionReceiptFormatter}),new d({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[n.inputAddressFormatter,n.inputDefaultBlockNumberFormatter]}),new d({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,d,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(),u=!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 r;if(void 0===f||0!==l){var a=await M.getBlockByNumber("latest"),n=a?a.hash:null;d?m?(r=await M.getBlockByNumber(m.number+1),r&&(m=r,e.eventEmitter.emit("confirmation",l,t,n))):(r=await M.getBlockByNumber(t.blockNumber),m=r,e.eventEmitter.emit("confirmation",l,t,n)):e.eventEmitter.emit("confirmation",l,t,n)}(d&&r||!d)&&l++,b=!1,l===s.transactionConfirmationBlocks+1&&(k.unsubscribe(),e.eventEmitter.removeAllListeners())}return t})).then((async function(t){if(g&&!u){if(!t.contractAddress)return b&&(k.unsubscribe(),u=!0),void i._fireError(a.NoContractAddressFoundError(t),e.eventEmitter,e.reject,null,t);var r;try{r=await M.getCode(t.contractAddress)}catch(w){}if(!r)return;var n=!0===t.status&&y;n||r.length>2?(e.eventEmitter.emit("receipt",t),s.extraFormatters&&s.extraFormatters.contractDeployFormatter?e.resolve(s.extraFormatters.contractDeployFormatter(t)):e.resolve(t),b&&e.eventEmitter.removeAllListeners()):i._fireError(a.ContractCodeNotStoredError(t),e.eventEmitter,e.reject,null,t),b&&k.unsubscribe(),u=!0}return t})).then((async function(t){if(!g&&!u){if(t.outOfGas||v&&v===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=r.params[0];if("eth_sendRawTransaction"===s.call){var d=r.params[0],h=o.parse(d);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(a.TransactionRevertInstructionError(c.reason,c.signature,t),e.eventEmitter,e.reject,null,t)}catch(l){i._fireError(a.TransactionRevertedWithoutReasonError(t),e.eventEmitter,e.reject,null,t)}else i._fireError(a.TransactionOutOfGasError(t),e.eventEmitter,e.reject,null,t);else e.eventEmitter.emit("receipt",t),e.resolve(t),b&&e.eventEmitter.removeAllListeners();b&&k.unsubscribe(),u=!0}})).catch((function(){h++,d?h-1>=s.transactionPollingTimeout&&(k.unsubscribe(),u=!0,i._fireError(a.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(),u=!0,i._fireError(a.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(),u=!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 r=()=>{p=setInterval(_.bind(null,e,!0),s.transactionPollingInterval)};if(!this.requestManager.provider.on)return r();M.subscribe("newBlockHeaders",(function(a,n,i){if(t=!0,a||!n)return r();_(e,!1,a,n,i)})),x=setTimeout((()=>{t||r()}),1e3*this.blockHeaderTimeout)}.bind(this);M.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&k(t),_(t,!1)):u||k()})).catch((function(){u||k()}))};var s=function(e,t){var r=null;return r="number"===typeof e?t.wallet[e]:e&&"object"===typeof e&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()],r};function u(e,t){return new Promise(((r,a)=>{try{var n=new d({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?i.toHex(e):"latest"},function(){return!1}]}).createFunction(e.requestManager),c=new d({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);Promise.all([n(),c()]).then((e=>{const[a,n]=e;if(("0x2"===t.type||void 0===t.type)&&a&&a.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(a.baseFeePerGas).mul(i.toBN(2)).add(i.toBN(e)))),r({maxFeePerGas:n,maxPriorityFeePerGas:e})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:n})}}))}catch(f){a(f)}}))}d.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r="eth_call"===e.call,n=function(){var n=c(!t),f=e.toPayload(Array.prototype.slice.call(arguments)),o=function(c,o){var d;if(e.handleRevert&&r&&e.abiCoder&&(!c&&e.isRevertReasonString(o)?d=o.substring(10):c&&c.data&&(d=c.data.substring(10)),d)){var s=e.abiCoder.decodeParameter("string","0x"+d),u="Error(String)";return void i._fireError(a.RevertInstructionError(s,u),n.eventEmitter,n.reject,f.callback,{reason:s,signature:u})}try{o=e.formatOutput(o)}catch(b){c=b}if(o instanceof Error&&(c=o),c)return c.error&&(c=c.error),i._fireError(c,n.eventEmitter,n.reject,f.callback);f.callback&&f.callback(null,o),t?(n.eventEmitter.emit("transactionHash",o),e._confirmTransaction(n,o,f)):c||n.resolve(o)},d=function(t){var r={...f,method:"eth_sendRawTransaction",params:[t.rawTransaction]};e.requestManager.send(r,o)},b=function(e,t){var r;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var a=e.params[0];if(r=s(a&&"object"===typeof a?a.from:null,t.accounts),r&&r.privateKey){a=JSON.parse(JSON.stringify(a));return delete a.from,t.defaultChain&&!a.chain&&(a.chain=t.defaultChain),t.defaultHardfork&&!a.hardfork&&(a.hardfork=t.defaultHardfork),t.defaultCommon&&!a.common&&(a.common=t.defaultCommon),void t.accounts.signTransaction(a,r.privateKey).then(d).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(r=s(e.params[0],t.accounts),r&&r.privateKey){var c=t.accounts.sign(i,r.privateKey);return e.callback&&e.callback(null,c.signature),void n.resolve(c.signature)}}return t.requestManager.send(e,o)};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)?u(e,f.params[0]).then((r=>{void 0!==r.gasPrice?f.params[0].gasPrice=r.gasPrice:void 0!==r.maxPriorityFeePerGas&&void 0!==r.maxFeePerGas&&(f.params[0].maxPriorityFeePerGas=r.maxPriorityFeePerGas,f.params[0].maxFeePerGas=r.maxFeePerGas),t&&setTimeout((()=>{n.eventEmitter.emit("sending",f)}),0),b(f,e)})):(t&&setTimeout((()=>{n.eventEmitter.emit("sending",f)}),0),b(f,e)),t&&setTimeout((()=>{n.eventEmitter.emit("sent",f)}),0),n.eventEmitter};return n.method=e,n.request=this.request.bind(this),n},d.prototype.getRevertReason=function(e,t){var r=this;return new Promise((function(a,n){new d({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(e,i.numberToHex(t)).then((function(){a(!1)})).catch((function(e){e.reason?a({reason:e.reason,signature:e.signature}):n(e)}))}))},d.prototype.isRevertReasonString=function(e){return"string"===typeof e&&(e.length-2)/2%32===4&&"0x08c379a0"===e.substring(0,10)},d.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=d},80165:function(e,t,r){"use strict";var a=r(35669),n=function(e){var t,r,n=new Promise((function(){t=arguments[0],r=arguments[1]}));if(e)return{resolve:t,reject:r,eventEmitter:n};var i=new a;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:r,eventEmitter:n}};n.resolve=function(e){var t=n(!0);return t.resolve(e),t.eventEmitter},e.exports=n},35669:function(e,t,r){"use strict";r(21703);var a=Object.prototype.hasOwnProperty,n="~";function i(){}function c(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function f(e,t,r,a,i){if("function"!==typeof r)throw new TypeError("The listener must be a function");var f=new c(r,a||e,i),o=n?n+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],f]:e._events[o].push(f):(e._events[o]=f,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),d.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)a.call(e,t)&&r.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},d.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,i=r.length,c=new Array(i);ae.id-t.id))},e.exports=i},6863:function(e,t,r){"use strict";r(21703);var a=null,n="object"===typeof globalThis?globalThis:void 0;if(!n)try{n=Function("return this")()}catch(i){n=self}"undefined"!==typeof n.ethereum?a=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 r="";e=e.toString();try{r=JSON.parse(e)}catch(i){return t(new Error("Couldn't parse response data"+e))}r.id||-1===r.method.indexOf("_subscription")||t(null,r)}));break;default:this.connection.on(e,t);break}}),a=n.web3.currentProvider),e.exports=a},37073:function(e,t,r){"use strict";r(21703);const{callbackify:a}=r(9242);var n=r(11205).errors,i=r(65675),c=r(11494),f=r(6863),o=function e(t,r){this.provider=null,this.providers=e.providers,this.setProvider(t,r),this.subscriptions=new Map};o.givenProvider=f,o.providers={WebsocketProvider:r(62990),HttpProvider:r(78170),IpcProvider:r(9510)},o.prototype.setProvider=function(e,t){var r=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&&r.subscriptions.has(t.subscription)&&r.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&&r.subscriptions.has(e.params.subscription)&&r.subscriptions.get(e.params.subscription).callback(null,e.params.result)})),this.provider.on("connect",(function(){r.subscriptions.forEach((function(e){e.subscription.resubscribe()}))})),this.provider.on("error",(function(e){r.subscriptions.forEach((function(t){t.callback(e)}))}));const t=function(e){r._isCleanCloseEvent(e)&&!r._isIpcCloseError(e)||(r.subscriptions.forEach((function(t){t.callback(n.ConnectionCloseError(e)),r.subscriptions.delete(t.subscription.id)})),r.provider&&r.provider.emit&&r.provider.emit("error",n.ConnectionCloseError(e))),r.provider&&r.provider.emit&&r.provider.emit("end",e)};this.provider.on("close",t),this.provider.on("disconnect",t)}},o.prototype.send=function(e,t){if(t=t||function(){},!this.provider)return t(n.InvalidProvider());const{method:r,params:c}=e,f=i.toPayload(r,c),o=this._jsonrpcResultCallback(t,f);if(this.provider.request){const e=a(this.provider.request.bind(this.provider)),n={method:r,params:c};e(n,t)}else if(this.provider.sendAsync)this.provider.sendAsync(f,o);else{if(!this.provider.send)throw new Error("Provider does not have a request or send method to use.");this.provider.send(f,o)}},o.prototype.sendBatch=function(e,t){if(!this.provider)return t(n.InvalidProvider());var r=i.toBatchPayload(e);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(e,r){return e?t(e):Array.isArray(r)?void t(null,r):t(n.InvalidResponse(r))}))},o.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})},o.prototype.removeSubscription=function(e,t){if(this.subscriptions.has(e)){var r=this.subscriptions.get(e).subscription.options.type;return this.subscriptions.delete(e),void this.send({method:r+"_unsubscribe",params:[e]},t)}"function"===typeof t&&t(null)},o.prototype.clearSubscriptions=function(e){try{var t=this;return this.subscriptions.size>0&&this.subscriptions.forEach((function(r,a){e&&"syncing"===r.name||t.removeSubscription(a)})),this.provider.reset&&this.provider.reset(),!0}catch(r){throw new Error(`Error while clearing subscriptions: ${r}`)}},o.prototype._isCleanCloseEvent=function(e){return"object"===typeof e&&([1e3].includes(e.code)||!0===e.wasClean)},o.prototype._isIpcCloseError=function(e){return"boolean"===typeof e&&e},o.prototype._jsonrpcResultCallback=function(e,t){return function(r,a){return a&&a.id&&t.id!==a.id?e(new Error(`Wrong response id ${a.id} (expected: ${t.id}) in ${JSON.stringify(t)}`)):r?e(r):a&&a.error?e(n.ErrorResponse(a)):i.isValidResponse(a)?void e(null,a.result):e(n.InvalidResponse(a))}},e.exports={Manager:o,BatchManager:c}},65675:function(e,t,r){"use strict";r(21703);var a={messageId:0,toPayload:function(e,t){if(!e)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(t)+'"!');return a.messageId++,{jsonrpc:"2.0",id:a.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 a.toPayload(e.method,e.params)}))}};e.exports=a},84598:function(e,t,r){"use strict";var a=r(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(),r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[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 a({subscription:e.subscriptions[arguments[0]]||{},requestManager:e.requestManager,type:e.type});return t.subscribe.apply(t,arguments)}},e.exports={subscriptions:n,subscription:a}},1123:function(e,t,r){"use strict";r(21703);var a=r(11205).errors,n=r(85592),i=r(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 a.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 r=t.inputFormatter.map((function(t,r){return t?t(e[r]):e[r]}));return r},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),r=this._toPayload(t);if(!r)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&&(r.params[1]=this.options.params,r.params[1].fromBlock=i.inputBlockNumberFormatter(this.lastBlock+1)),this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&r.params[1]&&"object"===typeof r.params[1]&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)){var a=Object.assign({},r.params[1]);this.options.requestManager.send({method:"eth_getLogs",params:[a]},(function(t,r){t?setTimeout((function(){e.callback(t,null,e),e.emit("error",t)}),0):r.forEach((function(t){var r=e._formatOutput(t);e.callback(null,r,e),e.emit("data",r)}))}))}return"object"===typeof r.params[1]&&delete r.params[1].fromBlock,this.options.requestManager.send(r,(function(t,a){!t&&a?(e.id=a,e.method=r.params[0],e.options.requestManager.addSubscription(e,(function(t,r){t?(e.callback(t,!1,e),e.emit("error",t)):(Array.isArray(r)||(r=[r]),r.forEach((function(t){var r=e._formatOutput(t);if(e.lastBlock=r&&"object"===typeof r?r.blockNumber:null,"function"===typeof e.options.subscription.subscriptionHandler)return e.options.subscription.subscriptionHandler.call(e,r);e.emit("data",r),e.callback(null,r,e)})))})),e.emit("connected",a)):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,r){"use strict";r(21703);var a=Object.prototype.hasOwnProperty,n="~";function i(){}function c(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function f(e,t,r,a,i){if("function"!==typeof r)throw new TypeError("The listener must be a function");var f=new c(r,a||e,i),o=n?n+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],f]:e._events[o].push(f):(e._events[o]=f,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),d.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)a.call(e,t)&&r.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},d.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,i=r.length,c=new Array(i);a{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 a.Manager(t[0],t[1]),e.givenProvider=a.Manager.givenProvider,e.providers=a.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=(t,r)=>(e._requestManager.setProvider(t,r),e._provider=e._requestManager.provider,!0)),e.setRequestManager=t=>{e._requestManager=t,e._provider=t.provider},e.BatchRequest=a.BatchManager.bind(null,e._requestManager),e.extend=n(e)},c=e=>{e.givenProvider=a.Manager.givenProvider,e.providers=a.Manager.providers};e.exports={packageInit:i,addProviders:c}},90056:function(e,t,r){r(21703);var a=r(15361).Buffer,n=r(77802),i=r(50534).RQ,c=r(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 o(){}var d=function(){};d.prototype.encodeFunctionSignature=function(e){return("function"===typeof e||"object"===typeof e&&e)&&(e=n._jsonInterfaceMethodToString(e)),n.sha3(e).slice(0,10)},d.prototype.encodeEventSignature=function(e){return("function"===typeof e||"object"===typeof e&&e)&&(e=n._jsonInterfaceMethodToString(e)),n.sha3(e)},d.prototype.encodeParameter=function(e,t){return this.encodeParameters([e],[t])},d.prototype.encodeParameters=function(e,t){var r=this;return e=r.mapTypes(e),t=t.map((function(t,a){let n=e[a];if("object"===typeof n&&n.type&&(n=n.type),t=r.formatParam(n,t),"string"===typeof n&&n.includes("tuple")){const e=f._getCoder(c.from(n)),a=(e,t)=>{if("array"===e.name)return t.map((t=>a(f._getCoder(c.from(e.type.replace("[]",""))),t)));e.coders.forEach(((e,n)=>{"tuple"===e.name?a(e,t[n]):t[n]=r.formatParam(e.name,t[n])}))};a(e,t)}return t})),f.encode(e,t)},d.prototype.mapTypes=function(e){var t=this,r=[];return e.forEach((function(e){if("object"===typeof e&&"function"===e.type&&(e=Object.assign({},e,{type:"bytes24"})),t.isSimplifiedStructFormat(e)){var a=Object.keys(e)[0];r.push(Object.assign(t.mapStructNameAndType(a),{components:t.mapStructToCoderFormat(e[a])}))}else r.push(e)})),r},d.prototype.isSimplifiedStructFormat=function(e){return"object"===typeof e&&"undefined"===typeof e.components&&"undefined"===typeof e.name},d.prototype.mapStructNameAndType=function(e){var t="tuple";return e.indexOf("[]")>-1&&(t="tuple[]",e=e.slice(0,-2)),{type:t,name:e}},d.prototype.mapStructToCoderFormat=function(e){var t=this,r=[];return Object.keys(e).forEach((function(a){"object"!==typeof e[a]?r.push({name:a,type:e[a]}):r.push(Object.assign(t.mapStructNameAndType(a),{components:t.mapStructToCoderFormat(e[a])}))})),r},d.prototype.formatParam=function(e,t){const r=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 o=e.match(c);if(o){let e=parseInt(o[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 a=f.decode(this.mapTypes(e),"0x"+t.replace(/0x/i,""),r),n=new o;return n.__length__=0,e.forEach((function(e,t){var r=a[n.__length__];const i="object"===typeof e&&e.type&&"string"===e.type,c="string"===typeof e&&"string"===e;r="0x"!==r||i||c?r:null,n[t]=r,("function"===typeof e||e&&"object"===typeof e)&&e.name&&(n[e.name]=r),n.__length__++})),n},d.prototype.decodeLog=function(e,t,r){var a=this;r=Array.isArray(r)?r:[r],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)}))?a.decodeParameter(e.type,r[c]):r[c],c++):n[t]=e}));var f=t,d=f?this.decodeParametersWith(n,f,!0):[],s=new o;return s.__length__=0,e.forEach((function(e,t){s[t]="string"===e.type?"":null,"undefined"!==typeof d[t]&&(s[t]=d[t]),"undefined"!==typeof i[t]&&(s[t]=i[t]),e.name&&(s[e.name]=s[t]),s.__length__++})),s};var s=new d;e.exports=s},73519:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=r(36603),i=r(79021),c=r(33053),f="undefined"===typeof r.g?r(59821):r(11875),o=r(80014),d=r(48109),s=r(77802),u=r(11205),{TransactionFactory:b}=r(89883),h=r(82099)["default"],l=r(82099).Hardfork,p=r(96380),x=function(e){return"undefined"===typeof e||null===e},m=function(e){return"undefined"!==typeof e&&null!==e},v=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 g(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 r;if(void 0!==e.type?r=s.toHex(e.type):void 0===e.type&&t&&(r="0x2"),void 0!==e.gasPrice&&("0x2"===r||t))throw Error("eip-1559 transactions don't support gasPrice");if(("0x1"===r||"0x0"===r)&&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?r="0x2":(e.accessList||e.common&&e.common.hardfork&&e.common.hardfork.toLowerCase()===l.Berlin||e.hardfork&&e.hardfork.toLowerCase()===l.Berlin)&&(r="0x1"),r}function w(e,t){return new Promise(((r,a)=>{try{(void 0===t.type||t.type<"0x2")&&void 0!==t.gasPrice?r({gasPrice:t.gasPrice}):Promise.all([e._ethereumCall.getBlockByNumber(),e._ethereumCall.getGasPrice()]).then((e=>{const[a,n]=e;if("0x2"===t.type&&a&&a.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(a.baseFeePerGas).mul(s.toBN(2)).add(s.toBN(e)))),r({maxFeePerGas:n,maxPriorityFeePerGas:e})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:n})}}))}catch(n){a(n)}}))}function M(e){this._accounts=e,this.length=0,this.defaultKeyName="web3js_wallet"}function _(e){var t;try{t=self[e];var r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(a){return a&&(22===a.code||1014===a.code||"QuotaExceededError"===a.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.name)&&t&&0!==t.length}}v.prototype._addAccountFunctions=function(e){var t=this;return e.signTransaction=function(r,a){return t.signTransaction(r,e.privateKey,a)},e.sign=function(r){return t.sign(r,e.privateKey)},e.encrypt=function(r,a){return t.encrypt(e.privateKey,r,a)},e},v.prototype.create=function(e){return this._addAccountFunctions(c.create(e||s.randomHex(32)))},v.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))},v.prototype.signTransaction=function(e,t,r){var n=this,i=!1,c={},f=!(!e||!(e.chain&&e.hardfork||e.common));if(r=r||function(){},!e)return i=new Error("No transaction object given!"),r(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"),r(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"),r(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"),r(i),Promise.reject(i);function o(e){const n=g(e);if(n)return r(n),Promise.reject(n);try{var i=u.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 o=b.fromTxData(i,c),d=o.sign(a.from(t,"hex")),p=d.validate(!0);if(p.length>0){let e="Signer Error: ";for(const t of p)e+=`${e} ${t}.`;throw new Error(e)}var x=d.serialize().toString("hex"),m="0x"+x,v=s.keccak256(m),y={messageHash:"0x"+a.from(d.getMessageToSign(!0)).toString("hex"),v:"0x"+d.v.toString("hex"),r:"0x"+d.r.toString("hex"),s:"0x"+d.s.toString("hex"),rawTransaction:m,transactionHash:v};return r(null,y),y}catch(w){return r(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(o(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[r,a,n,i]=t;if(x(r)&&x(e.common)&&x(e.common.customChain.chainId)||x(a)||x(n)||x(i))throw new Error('One of the values "chainId", "networkId", "gasPrice", or "nonce" couldn\'t be fetched: '+JSON.stringify(t));return o({...e,...x(e.common)||x(e.common.customChain.chainId)?{chainId:r}:{},nonce:a,networkId:n,...i})}))},v.prototype.recoverTransaction=function(e,t={}){const r=a.from(e.slice(2),"hex"),n=b.fromSerializedData(r);return s.toChecksumAddress(n.getSenderAddress().toString("hex"))},v.prototype.hashMessage=function(e){var t=s.isHexStrict(e)?e:s.utf8ToHex(e),r=s.hexToBytes(t),n=a.from(r),i="Ethereum Signed Message:\n"+r.length,c=a.from(i),f=a.concat([c,n]);return p.bufferToHex(p.keccak256(f))},v.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 r=this.hashMessage(e),a=c.sign(r,t),n=c.decodeSignature(a);return{message:e,messageHash:r,v:n[0],r:n[1],s:n[2],signature:a}},v.prototype.recover=function(e,t,r){var a=[].slice.apply(arguments);return e&&"object"===typeof e?this.recover(e.messageHash,c.encodeSignature([e.v,e.r,e.s]),!0):(r||(e=this.hashMessage(e)),a.length>=4?(r=a.slice(-1)[0],r="boolean"===typeof r&&!!r,this.recover(e,c.encodeSignature(a.slice(1,4)),r)):c.recover(e,t))},v.prototype.decrypt=function(e,t,r){if("string"!==typeof t)throw new Error("No password given.");var n,i,c=e&&"object"===typeof e?e:JSON.parse(r?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=o.syncScrypt(a.from(t),a.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(a.from(t),a.from(i.salt,"hex"),i.c,i.dklen,"sha256")}var d=a.from(c.crypto.ciphertext,"hex"),u=s.sha3(a.from([...n.slice(16,32),...d])).replace("0x","");if(u!==c.crypto.mac)throw new Error("Key derivation failed - possibly wrong password");var b=f.createDecipheriv(c.crypto.cipher,n.slice(0,16),a.from(c.crypto.cipherparams.iv,"hex")),h="0x"+a.from([...b.update(d),...b.final()]).toString("hex");return this.privateKeyToAccount(h,!0)},v.prototype.encrypt=function(e,t,r){var n=this.privateKeyToAccount(e,!0);r=r||{};var i,c=r.salt||f.randomBytes(32),u=r.iv||f.randomBytes(16),b=r.kdf||"scrypt",h={dklen:r.dklen||32,salt:c.toString("hex")};if("pbkdf2"===b)h.c=r.c||262144,h.prf="hmac-sha256",i=f.pbkdf2Sync(a.from(t),a.from(h.salt,"hex"),h.c,h.dklen,"sha256");else{if("scrypt"!==b)throw new Error("Unsupported kdf");h.n=r.n||8192,h.r=r.r||8,h.p=r.p||1,i=o.syncScrypt(a.from(t),a.from(h.salt,"hex"),h.n,h.r,h.p,h.dklen)}var l=f.createCipheriv(r.cipher||"aes-128-ctr",i.slice(0,16),u);if(!l)throw new Error("Unsupported cipher");var p=a.from([...l.update(a.from(n.privateKey.replace("0x",""),"hex")),...l.final()]),x=s.sha3(a.from([...i.slice(16,32),...p])).replace("0x","");return{version:3,id:d.v4({random:r.uuid||f.randomBytes(16)}),address:n.address.toLowerCase().replace("0x",""),crypto:{ciphertext:p.toString("hex"),cipherparams:{iv:u.toString("hex")},cipher:r.cipher||"aes-128-ctr",kdf:b,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 r=0;r{const t=o(n.concat(n.random(32),e||n.random(32))),r=n.concat(n.concat(n.random(32),t),n.random(32)),a=o(r);return b(a)},u=e=>{const t=d(e.slice(2));let r="0x";for(let a=0;a<40;a++)r+=parseInt(t[a+2],16)>7?e[a+2].toUpperCase():e[a+2];return r},b=e=>{const t=new a(e.slice(2),"hex"),r=f.keyFromPrivate(t),n="0x"+r.getPublic(!1,"hex").slice(2),i=o(n),c=u("0x"+i.slice(-40));return{address:c,privateKey:e}},h=([e,t,r])=>n.flatten([t,r,e]),l=e=>[n.slice(64,n.length(e),e),n.slice(0,32,e),n.slice(32,64,e)],p=e=>(t,r)=>{const c=f.keyFromPrivate(new a(r.slice(2),"hex")).sign(new a(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 r=l(t),i={v:n.toNumber(r[0]),r:r[1].slice(2),s:r[2].slice(2)},c=f.recoverPubKey(new a(e.slice(2),"hex"),i,i.v<2?i.v:1-i.v%2),d="0x"+c.encode("hex",!1).slice(2),s=o(d),b=u("0x"+s.slice(-40));return b};e.exports={create:s,toChecksum:u,fromPrivate:b,sign:x,makeSigner:p,recover:m,encodeSignature:h,decodeSignature:l}},94187:function(e){const t=(e,t)=>{let r=[];for(var a=0;at(e,(()=>r)),a=(e,t)=>e.concat(t),n=e=>{let t=[];for(let r=0,a=e.length;r{let r=[];for(let a=0,n=t.length;aparseInt(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)):r(12449).randomBytes(e);let a="0x";for(let r=0;r(e.length-2)/2,c=e=>"0x"+e.reduce(((e,t)=>e+t.slice(2)),""),f=(e,t,r)=>"0x"+r.slice(2*e+2,2*t+2),o=e=>{let t="0x";for(let r=0,a=i(e);rt.length===2*e+2?t:d(e,"0x0"+t.slice(2)),s=(e,t)=>t.length===2*e+2?t:s(e,t+"0"),u=e=>{let t=[];for(let r=2,a=e.length;r{let t="0x";for(let r=0,a=e.length;rnew Uint8Array(u(e)),l=e=>b([].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)),v=e=>"0x0"===e?"0x":e.length%2===0?e:"0x0"+e.slice(2),g=e=>"0"===e[2]?"0x"+e.slice(3):e,y=e=>{let t="0x";for(let r=0;r{let t="";for(let r=2;r{const t=e=>{const t=e.toString(16);return t.length<2?"0"+t:t};let r="0x";for(let a=0;a!=e.length;a++){let n=e.charCodeAt(a);if(n<128)r+=t(n);else{if(n<2048)r+=t(n>>6|192);else{if(n>55295&&n<56320){if(++a==e.length)return null;let i=e.charCodeAt(a);if(i<56320||i>57343)return null;n=65536+((1023&n)<<10)+(1023&i),r+=t(n>>18|240),r+=t(n>>12&63|128)}else r+=t(n>>12|224);r+=t(n>>6&63|128)}r+=t(63&n|128)}}return r},_=e=>{let t="",r=0,n=i(e);while(r127){if(i>191&&i<224){if(r>=n)return null;i=(31&i)<<6|63&a(e,r)}else if(i>223&&i<240){if(r+1>=n)return null;i=(15&i)<<12|(63&a(e,r))<<6|63&a(e,++r)}else{if(!(i>239&&i<248))return null;if(r+2>=n)return null;i=(7&i)<<18|(63&a(e,r))<<12|(63&a(e,++r))<<6|63&a(e,++r)}++r}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:o,pad:d,padRight:s,fromAscii:y,toAscii:w,fromString:M,toString:_,fromNumber:p,toNumber:x,fromNat:v,toNat:g,fromArray:b,toArray:u,fromUint8Array:l,toUint8Array:h}},15844:function(e){const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],a=[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,o=e.blocks,d=e.blockCount<<2,s=e.blockCount,u=e.outputBlocks,b=e.s,h=0;while(h>2]|=n[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[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)<=d){for(e.start=x-d,e.block=o[s],x=0;x>2]|=r[3&x],e.lastByteIndex===d)for(o[0]=o[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(b),x=0)}return"0x"+p},f=e=>{var t,r,a,i,c,f,o,d,s,u,b,h,l,p,x,m,v,g,y,w,M,_,k,A,S,E,T,P,I,B,C,O,R,N,L,U,j,F,D,H,q,z,K,W,G,V,Z,$,J,Y,X,Q,ee,te,re,ae,ne,ie,ce,fe,oe,de,se;for(a=0;a<48;a+=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],o=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],s=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],b=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|o>>>31),r=l^(o<<1|f>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|s>>>31),r=c^(s<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=f^(u<<1|b>>>31),r=o^(b<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(h<<1|l>>>31),r=s^(l<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(i<<1|c>>>31),r=b^(c<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],x=e[1],V=e[11]<<4|e[10]>>>28,Z=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,fe=e[31]<<9|e[30]>>>23,oe=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,L=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,C=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,se=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,g=e[25]<<11|e[24]>>>21,y=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,A=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,ae=e[17]<<23|e[16]>>>9,ne=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,D=e[27]<<25|e[26]>>>7,w=e[36]<<21|e[37]>>>11,M=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,W=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,ce=e[28]<<7|e[29]>>>25,H=e[38]<<8|e[39]>>>24,q=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=p^~m&g,e[1]=x^~v&y,e[10]=A^~E&P,e[11]=S^~T&I,e[20]=N^~U&F,e[21]=L^~j&D,e[30]=W^~V&$,e[31]=G^~Z&J,e[40]=te^~ae&ie,e[41]=re^~ne&ce,e[2]=m^~g&w,e[3]=v^~y&M,e[12]=E^~P&B,e[13]=T^~I&C,e[22]=U^~F&H,e[23]=j^~D&q,e[32]=V^~$&Y,e[33]=Z^~J&X,e[42]=ae^~ie&fe,e[43]=ne^~ce&oe,e[4]=g^~w&_,e[5]=y^~M&k,e[14]=P^~B&O,e[15]=I^~C&R,e[24]=F^~H&z,e[25]=D^~q&K,e[34]=$^~Y&Q,e[35]=J^~X&ee,e[44]=ie^~fe&de,e[45]=ce^~oe&se,e[6]=w^~_&p,e[7]=M^~k&x,e[16]=B^~O&A,e[17]=C^~R&S,e[26]=H^~z&N,e[27]=q^~K&L,e[36]=Y^~Q&W,e[37]=X^~ee&G,e[46]=fe^~de&te,e[47]=oe^~se&re,e[8]=_^~p&m,e[9]=k^~x&v,e[18]=O^~A&E,e[19]=R^~S&T,e[28]=z^~N&U,e[29]=K^~L&j,e[38]=Q^~W&V,e[39]=ee^~G&Z,e[48]=de^~te&ae,e[49]=se^~re&ne,e[0]^=n[a],e[1]^=n[a+1]},o=e=>t=>{var r;if("0x"===t.slice(0,2)){r=[];for(var a=2,n=t.length;a"0x"+e.toString("hex"),c=e=>new a(e.slice(2),16),f=e=>{const t="0x"+("0x"===e.slice(0,2)?new a(e.slice(2),16):new a(e,10)).toString("hex");return"0x0"===t?"0x":t},o=e=>b(m(e,f("10000000000")))/1e8,d=e=>x(u(Math.floor(1e8*e)),f("10000000000")),s=e=>c(e).toString(10),u=e=>"string"===typeof e?/^0x/.test(e)?e:"0x"+e:"0x"+new a(e).toString("hex"),b=e=>c(e).toNumber(),h=e=>n.pad(32,e),l=e=>(t,r)=>i(c(t)[e](c(r))),p=l("add"),x=l("mul"),m=l("div"),v=l("sub");e.exports={toString:s,fromString:f,toNumber:b,fromNumber:u,toEther:o,fromEther:d,toUint256:h,add:p,mul:x,div:m,sub:v}},29724:function(e){const t=e=>{const t=e=>e.length%2===0?e:"0"+e,r=e=>t(e.toString(16)),a=(e,t)=>e<56?r(t+e):r(t+r(e).length/2+55)+r(e),n=e=>{if("string"===typeof e){const t=e.slice(2),r=2!=t.length||t>="80"?a(t.length/2,128):"";return r+t}{const t=e.map(n).join(""),r=a(t.length/2,192);return r+t}};return"0x"+n(e)},r=e=>{let t=2;const r=()=>{if(t>=e.length)throw"";const r=e.slice(t,t+2);return r<"80"?(t+=2,"0x"+r):r<"c0"?n():i()},a=()=>{const r=parseInt(e.slice(t,t+=2),16)%64;return r<56?r:parseInt(e.slice(t,t+=2*(r-55)),16)},n=()=>{const r=a();return"0x"+e.slice(t,t+=2*r)},i=()=>{const e=2*a()+t;let n=[];while(t0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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(r(83941)),f=r(31131),o=r(52010),d=r(24199),s=r(2674),u=r(44965),b=r(13726),h=r(33823),l=r(91384),p=function(){function e(e,t,r,a){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===r&&(r=s.KECCAK256_RLP),void 0===a&&(a=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=a,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,a=t.balance,n=t.stateRoot,i=t.codeHash;return new e(r?new f.BN((0,u.toBuffer)(r)):void 0,a?new f.BN((0,u.toBuffer)(a)):void 0,n?(0,u.toBuffer)(n):void 0,i?(0,u.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 r=n(t,4),a=r[0],i=r[1],c=r[2],o=r[3];return new e(new f.BN(a),new f.BN(i),c,o)},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 r=(0,d.stripHexPrefix)(e).toLowerCase(),a="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);a=n.toString()+"0x"}for(var i=(0,b.keccakFromString)(a+r).toString("hex"),c="0x",f=0;f=8?c+=r[f].toUpperCase():c+=r[f];return c};t.toChecksumAddress=m;var v=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.isValidChecksumAddress=v;var g=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new f.BN(t);return r.isZero()?(0,b.rlphash)([e,null]).slice(-20):(0,b.rlphash)([e,a.from(r.toArray())]).slice(-20)};t.generateAddress=g;var y=function(e,t,r){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,b.keccak256)(a.concat([a.from("ff","hex"),e,t,(0,b.keccak256)(r)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,o.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,o.publicKeyVerify)(a.concat([a.from([4]),e])):!!t&&(0,o.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,b.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),a.from((0,o.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=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,u.zeros)(e);return(0,u.bufferToHex)(t)};t.zeroAddress=E;var T=function(e){try{(0,h.assertIsString)(e)}catch(a){return!1}var r=(0,t.zeroAddress)();return r===e};t.isZeroAddress=T},56878:function(e,t,r){"use strict";var a=r(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(r(83941)),c=r(31131),f=r(44965),o=r(63867),d=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,o.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(a.isBuffer(t),"Public key should be Buffer");var r=(0,o.pubToAddress)(t);return new e(r)},e.fromPrivateKey=function(t){(0,i.default)(a.isBuffer(t),"Private key should be Buffer");var r=(0,o.privateToAddress)(t);return new e(r)},e.generate=function(t,r){return(0,i.default)(c.BN.isBN(r)),new e((0,o.generateAddress)(t.buf,r.toArrayLike(a)))},e.generate2=function(t,r,n){return(0,i.default)(a.isBuffer(r)),(0,i.default)(a.isBuffer(n)),new e((0,o.generateAddress2)(t.buf,r,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),r=new c.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return a.from(this.buf)},e}();t.Address=d},44965:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),r(48675),r(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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=r(31131),f=r(24199),o=r(33823),d=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=d;var s=function(e){var r=(0,t.intToHex)(e);return a.from((0,f.padToEven)(r.slice(2)),"hex")};t.intToBuffer=s;var u=function(e){return a.allocUnsafe(e).fill(0)};t.zeros=u;var b=function(e,r,a){var n=(0,t.zeros)(r);return a?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,o.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,o.assertIsArray)(e),p(e)};t.unpadArray=m;var v=function(e){return(0,o.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=v;var g=function(e){if(null===e||void 0===e)return a.allocUnsafe(0);if(a.isBuffer(e))return a.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return a.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 a.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(a)}if(e.toArray)return a.from(e.toArray());if(e.toBuffer)return a.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=g;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 a.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 r=a.from(e.replace(t,""),"hex");return r.toString("utf8")};t.toUtf8=A;var S=function(e){if(a.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],n=0;n0&&0===d[0])throw new Error("".concat(o," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}};function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):a.from(e)}function P(e){return Array.isArray(e)?e.map((function(e){return P(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=T,t.bufArrToArr=P},2674:function(e,t,r){"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 a=r(15361),n=r(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=a.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=a.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=a.Buffer.from(t.KECCAK256_RLP_S,"hex")},31131:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);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(r(56956));t.BN=f.default;var o=i(r(98217));t.rlp=o},13726:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(92802),i=r(65443),c=r(31131),f=r(44965),o=r(33823),d=function(e,t){switch(void 0===t&&(t=256),(0,o.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=d;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var u=function(e,r){void 0===r&&(r=256),(0,o.assertIsString)(e);var n=a.from(e,"utf8");return(0,t.keccak)(n,r)};t.keccakFromString=u;var b=function(e,r){return void 0===r&&(r=256),(0,o.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromHexString=b;var h=function(e,r){return void 0===r&&(r=256),(0,o.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,o.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,o.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,o.assertIsArray)(e),l(e)};t.sha256FromArray=m;var v=function(e,t){e=(0,f.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(r,32):r},g=function(e,t){return(0,o.assertIsBuffer)(e),v(e,t)};t.ripemd160=g;var y=function(e,t){return(0,o.assertIsString)(e),v(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,o.assertIsArray)(e),v(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},33823:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=r(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(!a.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 o=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=o},96380:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};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(r(2674),t),n(r(63867),t),n(r(56878),t),n(r(13726),t),n(r(86779),t),n(r(44965),t),n(r(56936),t),n(r(31131),t),n(r(91384),t);var i=r(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,r){"use strict";var a=r(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]}r(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 a.byteLength(e,"utf8")}function o(e,t,r){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[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function d(e){var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);r=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[r]=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})})),r)if("string"===typeof r&&(r=a.from((0,c.stripHexPrefix)(r),"hex")),a.isBuffer(r)&&(r=f.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,o.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var n=Object.keys(r);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}};t.defineProperties=d},86779:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(52010),i=r(31131),c=r(44965),f=r(13726),o=r(33823),d=r(91384);function s(e,t,r){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,o=a.from(c.slice(0,32)),s=a.from(c.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var u=r?f+(2*r+35):f+27;return{r:o,s:s,v:u}}var b=(0,d.toType)(r,d.TypeOutput.BN),h=b.muln(2).addn(35).addn(f).toArrayLike(a);return{r:o,s:s,v:h}}function u(e,t){var r=(0,d.toType)(e,d.TypeOutput.BN);if(!t)return r.subn(27);var a=(0,d.toType)(t,d.TypeOutput.BN);return r.sub(a.muln(2).addn(35))}function b(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,r,i,f){var o=a.concat([(0,c.setLengthLeft)(r,32),(0,c.setLengthLeft)(i,32)],64),d=u(t,f);if(!b(d))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(o,d.toNumber(),e);return a.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(r,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");var f=(0,d.toType)(e,d.TypeOutput.Number),o=r;return(f>28&&f%2===1||1===f||28===f)&&(o=a.from(r),o[0]|=128),(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(o,32)]))};t.toCompactSig=p;var x=function(e){var t,r,a,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(32,33))>>7,r[0]&=127}return a<27&&(a+=27),{v:a,r:t,s:r}};t.fromRpcSig=x;var m=function(e,t,r,a,n){void 0===a&&(a=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!b(u(e,n)))return!1;var o=new i.BN(t),d=new i.BN(r);return!(o.isZero()||o.gt(f)||d.isZero()||d.gt(f))&&(!a||1!==d.cmp(c))};t.isValidSignature=m;var v=function(e){(0,o.assertIsBuffer)(e);var t=a.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(a.concat([t,e]))};t.hashPersonalMessage=v},91384:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=r(31131),c=r(24199),f=r(44965);function o(e){return"0x".concat(e.toString(16))}function d(e){return(0,f.unpadBuffer)(e.toArrayLike(a))}function s(e){return d(e)}function u(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 r=(0,f.toBuffer)(e);if(t===n.Buffer)return r;if(t===n.BN)return new i.BN(r);if(t===n.Number){var a=new i.BN(r),o=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(a.gt(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return a.toNumber()}return"0x".concat(r.toString("hex"))}}t.bnToHex=o,t.bnToUnpaddedBuffer=d,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=u},56956:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(56773).Buffer}catch(I){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){var a=r(26368),n=r(95358),i=n;i.v1=a,i.v4=n,e.exports=i},14385:function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);function a(e,r){var a=r||0,n=t;return[n[e[a++]],n[e[a++]],n[e[a++]],n[e[a++]],"-",n[e[a++]],n[e[a++]],"-",n[e[a++]],n[e[a++]],"-",n[e[a++]],n[e[a++]],"-",n[e[a++]],n[e[a++]],n[e[a++]],n[e[a++]],n[e[a++]],n[e[a++]]].join("")}e.exports=a},80624:function(e,t,r){r(48675),r(3462);var a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(a){var n=new Uint8Array(16);e.exports=function(){return a(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,r){r(21703);var a,n,i=r(80624),c=r(14385),f=0,o=0;function d(e,t,r){var d=t&&r||0,s=t||[];e=e||{};var u=e.node||a,b=void 0!==e.clockseq?e.clockseq:n;if(null==u||null==b){var h=i();null==u&&(u=a=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==b&&(b=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:o+1,x=l-f+(p-o)/1e4;if(x<0&&void 0===e.clockseq&&(b=b+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,o=p,n=b,l+=122192928e5;var m=(1e4*(268435455&l)+p)%4294967296;s[d++]=m>>>24&255,s[d++]=m>>>16&255,s[d++]=m>>>8&255,s[d++]=255&m;var v=l/4294967296*1e4&268435455;s[d++]=v>>>8&255,s[d++]=255&v,s[d++]=v>>>24&15|16,s[d++]=v>>>16&255,s[d++]=b>>>8|128,s[d++]=255&b;for(var g=0;g<6;++g)s[d+g]=u[g];return t||c(s)}e.exports=d},95358:function(e,t,r){var a=r(80624),n=r(14385);function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),e=e||{};var c=e.random||(e.rng||a)();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,r){"use strict";r(21703);var a=r(36603),n=r(79021),i=r(77802),c=r(84598).subscription,f=r(11205).formatters,o=r(11205).errors,d=r(80165),s=r(90056),u=function e(t,r,n){var c=this,d=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(){a.packageInit(c,arguments),c.clearSubscriptions=c._requestManager.clearSubscriptions},a.packageInit(this,[this.constructor]),this.clearSubscriptions=this._requestManager.clearSubscriptions,!t||!Array.isArray(t))throw o.ContractMissingABIError();this.options={};var u=d[d.length-1];u&&"object"===typeof u&&!Array.isArray(u)&&(n=u,this.options={...this.options,...this._getOrSetDefaultOptions(n)},r&&"object"===typeof r&&(r=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,r;if(e.constant="view"===e.stateMutability||"pure"===e.stateMutability||e.constant,e.payable="payable"===e.stateMutability||e.payable,e.name&&(r=i._jsonInterfaceMethodToString(e)),"function"===e.type){if(e.signature=s.encodeFunctionSignature(r),t=c._createTxObject.bind({method:e,parent:c}),c.methods[e.name]){var a=c._createTxObject.bind({method:e,parent:c,nextMethod:c.methods[e.name]});c.methods[e.name]=a}else c.methods[e.name]=t;c.methods[e.signature]=t,c.methods[r]=t}else if("event"===e.type){e.signature=s.encodeEventSignature(r);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[r]=n}return e})),c.events.allEvents=c._on.bind(c,"allevents"),c._jsonInterface},get:function(){return c._jsonInterface},enumerable:!0});var b=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 b},set:function(e){return e&&(b=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=r,this.options.jsonInterface=t};u.setProvider=function(e,t){a.packageInit(this,[e]),this._ethAccounts=t},u.prototype._getCallback=function(e){if(e&&e[e.length-1]&&"function"===typeof e[e.length-1])return e.pop()},u.prototype._checkListener=function(e,t){if(t===e)throw o.ContractReservedEventError(e)},u.prototype._getOrSetDefaultOptions=function(e){var t=e.gasPrice?String(e.gasPrice):null,r=e.from?i.toChecksumAddress(f.inputAddressFormatter(e.from)):null;return e.data=e.data||this.options.data,e.from=r||this.options.from,e.gasPrice=t||this.options.gasPrice,e.gas=e.gas||e.gasLimit||this.options.gas,delete e.gasLimit,e},u.prototype._encodeEventABI=function(e,t){t=t||{};var r=t.filter||{},a={};if(["fromBlock","toBlock"].filter((function(e){return void 0!==t[e]})).forEach((function(e){a[e]=f.inputBlockNumberFormatter(t[e])})),Array.isArray(t.topics))a.topics=t.topics;else{if(a.topics=[],e&&!e.anonymous&&"ALLEVENTS"!==e.name&&a.topics.push(e.signature),"ALLEVENTS"!==e.name){var n=e.inputs.filter((function(e){return!0===e.indexed})).map((function(e){var t=r[e.name];return t?Array.isArray(t)?t.map((function(t){return s.encodeParameter(e.type,t)})):s.encodeParameter(e.type,t):null}));a.topics=a.topics.concat(n)}a.topics.length||delete a.topics}return this.options.address&&(a.address=this.options.address.toLowerCase()),a},u.prototype._decodeEventABI=function(e){var t=this;e.data=e.data||"",e.topics=e.topics||[];var r=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 r=0;t.inputs.forEach((e=>e.indexed?r++:null)),r>0&&e.topics.length!==r+1&&(t={anonymous:!0,inputs:[]})}var a=t.anonymous?e.topics:e.topics.slice(1);return r.returnValues=s.decodeLog(t.inputs,e.data,a),delete r.returnValues.__length__,r.event=t.name,r.signature=t.anonymous||!e.topics[0]?null:e.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},u.prototype._encodeMethodABI=function(){var e=this._method.signature,t=this.arguments||[],r=!1,a=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 a=Array.isArray(e.inputs)?e.inputs.length:0;if(a!==t.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+a+" arguments.");return"function"===e.type&&(r=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+a}var n=r?r+a:a;if(!n)throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".');return n},u.prototype._decodeMethodReturn=function(e,t){if(!t)return null;t=t.length>=2?t.slice(2):t;var r=s.decodeParameters(e,t);return 1===r.__length__?r[0]:(delete r.__length__,r)},u.prototype.deploy=function(e,t){if(e=e||{},e.arguments=e.arguments||[],e=this._getOrSetDefaultOptions(e),!e.data){if("function"===typeof t)return t(o.ContractMissingDeployDataError());throw o.ContractMissingDeployDataError()}var r=this.options.jsonInterface.find((e=>"constructor"===e.type))||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:e.data,_ethAccounts:this.constructor._ethAccounts},e.arguments)},u.prototype._generateEventOptions=function(){var e=Array.prototype.slice.call(arguments),t=this._getCallback(e),r="object"===(!!e[e.length-1]&&typeof e[e.length-1])?e.pop():{},a="string"===typeof e[0]?e[0]:"allevents",n="allevents"===a.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find((function(e){return"event"===e.type&&(e.name===a||e.signature==="0x"+a.replace("0x",""))}));if(!n)throw o.ContractEventDoesNotExistError(a);if(!i.isAddress(this.options.address))throw o.ContractNoAddressDefinedError();return{params:this._encodeEventABI(n,r),event:n,callback:t}},u.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},u.prototype.once=function(e,t,r){var a=Array.prototype.slice.call(arguments);if(r=this._getCallback(a),!r)throw o.ContractOnceRequiresCallbackError();t&&delete t.fromBlock,this._on(e,t,(function(e,t,a){a.unsubscribe(),"function"===typeof r&&r(e,t,a)}))},u.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},u.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 r=t.buildCall();return t=null,r(e.params,e.callback)},u.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 o.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},u.prototype._processExecuteArguments=function(e,t){var r={};if(r.type=e.shift(),r.callback=this._parent._getCallback(e),"call"!==r.type||!0===e[e.length-1]||"string"!==typeof e[e.length-1]&&!isFinite(e[e.length-1])||(r.defaultBlock=e.pop()),r.options="object"===(!!e[e.length-1]&&typeof e[e.length-1])?e.pop():{},r.generateRequest=!0===e[e.length-1]&&e.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!i.isAddress(this._parent.options.address))throw o.ContractNoAddressDefinedError();return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:i._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),t.eventEmitter,t.reject,r.callback)},u.prototype._executeMethod=function(){var e=this,t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=d("send"!==t.type),a=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(o.ContractNoFromAddressDefinedError(),r.eventEmitter,r.reject,t.callback);var u=new n({name:"createAccessList",call:"eth_createAccessList",params:2,inputFormatter:[f.inputTransactionFormatter,f.inputDefaultBlockNumberFormatter],requestManager:e._parent._requestManager,accounts:a,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return u(t.options,t.callback);case"estimate":var b=new n({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[f.inputCallFormatter],outputFormatter:i.hexToNumber,requestManager:e._parent._requestManager,accounts:a,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return b(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:a,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(o.ContractNoFromAddressDefinedError(),r.eventEmitter,r.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"),r.eventEmitter,r.reject,t.callback);var l={receiptFormatter:function(t){if(Array.isArray(t.logs)){var r=t.logs.map((t=>e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)));t.events={};var a=0;r.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[a]=e,a++)})),delete t.logs}return t},contractDeployFormatter:function(t){var r=e._parent.clone();return r.options.address=t.contractAddress,r}},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=u},99996:function(e,t,r){"use strict";r(21703);var a=r(36130),n=r(11205).formatters,i=r(77802),c=r(10162),f=r(38771),o=r(53913);function d(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})}d.prototype.supportsInterface=function(e,t,r){return this.getResolver(e).then((function(e){return i.isHexStrict(t)||(t=i.sha3(t).slice(0,10)),e.methods.supportsInterface(t).call(r)})).catch((function(e){if("function"!==typeof r)throw e;r(e,null)}))},d.prototype.resolver=function(e,t){return this.registry.resolver(e,t)},d.prototype.getResolver=function(e,t){return this.registry.getResolver(e,t)},d.prototype.setResolver=function(e,t,r,a){return this.registry.setResolver(e,t,r,a)},d.prototype.setRecord=function(e,t,r,a,n,i){return this.registry.setRecord(e,t,r,a,n,i)},d.prototype.setSubnodeRecord=function(e,t,r,a,n,i,c){return this.registry.setSubnodeRecord(e,t,r,a,n,i,c)},d.prototype.setApprovalForAll=function(e,t,r,a){return this.registry.setApprovalForAll(e,t,r,a)},d.prototype.isApprovedForAll=function(e,t,r){return this.registry.isApprovedForAll(e,t,r)},d.prototype.recordExists=function(e,t){return this.registry.recordExists(e,t)},d.prototype.setSubnodeOwner=function(e,t,r,a,n){return this.registry.setSubnodeOwner(e,t,r,a,n)},d.prototype.getTTL=function(e,t){return this.registry.getTTL(e,t)},d.prototype.setTTL=function(e,t,r,a){return this.registry.setTTL(e,t,r,a)},d.prototype.getOwner=function(e,t){return this.registry.getOwner(e,t)},d.prototype.setOwner=function(e,t,r,a){return this.registry.setOwner(e,t,r,a)},d.prototype.getAddress=function(e,t){return this.resolverMethodHandler.method(e,"addr",[]).call(t)},d.prototype.setAddress=function(e,t,r,a){return this.resolverMethodHandler.method(e,"setAddr",[t]).send(r,a)},d.prototype.getPubkey=function(e,t){return this.resolverMethodHandler.method(e,"pubkey",[],null,t).call(t)},d.prototype.setPubkey=function(e,t,r,a,n){return this.resolverMethodHandler.method(e,"setPubkey",[t,r]).send(a,n)},d.prototype.getContent=function(e,t){return this.resolverMethodHandler.method(e,"content",[]).call(t)},d.prototype.setContent=function(e,t,r,a){return this.resolverMethodHandler.method(e,"setContent",[t]).send(r,a)},d.prototype.getContenthash=function(e,t){return this.resolverMethodHandler.method(e,"contenthash",[],o.decode).call(t)},d.prototype.setContenthash=function(e,t,r,a){var n;try{n=o.encode(t)}catch(c){var i=new Error("Could not encode "+t+". See docs for supported hash protocols.");if("function"===typeof a)return void a(i,null);throw i}return this.resolverMethodHandler.method(e,"setContenthash",[n]).send(r,a)},d.prototype.getMultihash=function(e,t){return this.resolverMethodHandler.method(e,"multihash",[]).call(t)},d.prototype.setMultihash=function(e,t,r,a){return this.resolverMethodHandler.method(e,"multihash",[t]).send(r,a)},d.prototype.checkNetwork=async function(){var e=new Date/1e3;if(!this._lastSyncCheck||e-this._lastSyncCheck>3600){var t=await this.eth.getBlock("latest"),r=e-t.timestamp;if(r>3600)throw new Error("Network not synced; last block was "+r+" seconds ago");this._lastSyncCheck=e}if(this.registryAddress)return this.registryAddress;if(!this._detectedAddress){var n=await this.eth.net.getNetworkType(),i=a.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=d},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,r){"use strict";var a=r(93135),n=r(20591),i=r(80165),c=r(11205).formatters,f=r(77802),o=r(28178),d=r(73589);function s(e){var t=this;this.ens=e,this.contract=e.checkNetwork().then((function(e){var r=new a(o,e);return r.setProvider(t.ens.eth.currentProvider),r}))}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 r=new i(!0);return this.contract.then((function(t){return t.methods.owner(n.hash(e)).call()})).then((function(e){"function"!==typeof t?r.resolve(e):t(e,e)})).catch((function(e){"function"!==typeof t?r.reject(e):t(e,null)})),r.eventEmitter},s.prototype.setOwner=function(e,t,r,a){var f=new i(!0);return this.contract.then((function(a){return a.methods.setOwner(n.hash(e),c.inputAddressFormatter(t)).send(r)})).then((function(e){"function"!==typeof a?f.resolve(e):a(e,e)})).catch((function(e){"function"!==typeof a?f.reject(e):a(e,null)})),f.eventEmitter},s.prototype.getTTL=function(e,t){var r=new i(!0);return this.contract.then((function(t){return t.methods.ttl(n.hash(e)).call()})).then((function(e){"function"!==typeof t?r.resolve(e):t(e,e)})).catch((function(e){"function"!==typeof t?r.reject(e):t(e,null)})),r.eventEmitter},s.prototype.setTTL=function(e,t,r,a){var c=new i(!0);return this.contract.then((function(a){return a.methods.setTTL(n.hash(e),t).send(r)})).then((function(e){"function"!==typeof a?c.resolve(e):a(e,e)})).catch((function(e){"function"!==typeof a?c.reject(e):a(e,null)})),c.eventEmitter},s.prototype.setSubnodeOwner=function(e,t,r,a,o){var d=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(r)).send(a)})).then((function(e){"function"!==typeof o?d.resolve(e):o(e,e)})).catch((function(e){"function"!==typeof o?d.reject(e):o(e,null)})),d.eventEmitter},s.prototype.setRecord=function(e,t,r,a,f,o){var d=new i(!0);return this.contract.then((function(i){return i.methods.setRecord(n.hash(e),c.inputAddressFormatter(t),c.inputAddressFormatter(r),a).send(f)})).then((function(e){"function"!==typeof o?d.resolve(e):o(e,e)})).catch((function(e){"function"!==typeof o?d.reject(e):o(e,null)})),d.eventEmitter},s.prototype.setSubnodeRecord=function(e,t,r,a,o,d,s){var u=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(r),c.inputAddressFormatter(a),o).send(d)})).then((function(e){"function"!==typeof s?u.resolve(e):s(e,e)})).catch((function(e){"function"!==typeof s?u.reject(e):s(e,null)})),u.eventEmitter},s.prototype.setApprovalForAll=function(e,t,r,a){var n=new i(!0);return this.contract.then((function(a){return a.methods.setApprovalForAll(c.inputAddressFormatter(e),t).send(r)})).then((function(e){"function"!==typeof a?n.resolve(e):a(e,e)})).catch((function(e){"function"!==typeof a?n.reject(e):a(e,null)})),n.eventEmitter},s.prototype.isApprovedForAll=function(e,t,r){var a=new i(!0);return this.contract.then((function(r){return r.methods.isApprovedForAll(c.inputAddressFormatter(e),c.inputAddressFormatter(t)).call()})).then((function(e){"function"!==typeof r?a.resolve(e):r(e,e)})).catch((function(e){"function"!==typeof r?a.reject(e):r(e,null)})),a.eventEmitter},s.prototype.recordExists=function(e,t){var r=new i(!0);return this.contract.then((function(t){return t.methods.recordExists(n.hash(e)).call()})).then((function(e){"function"!==typeof t?r.resolve(e):t(e,e)})).catch((function(e){"function"!==typeof t?r.reject(e):t(e,null)})),r.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 r=this;return this.contract.then((function(t){return t.methods.resolver(n.hash(e)).call()})).then((function(e){var n=new a(d,e);if(n.setProvider(r.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,r,a){var f=new i(!0);return this.contract.then((function(a){return a.methods.setResolver(n.hash(e),c.inputAddressFormatter(t)).send(r)})).then((function(e){"function"!==typeof a?f.resolve(e):a(e,e)})).catch((function(e){"function"!==typeof a?f.reject(e):a(e,null)})),f.eventEmitter},e.exports=s},65303:function(e,t,r){"use strict";var a=r(99996);e.exports=a},38771:function(e,t,r){"use strict";var a=r(80165),n=r(20591),i=r(11205).errors,c=r(36130).interfaceIds;function f(e){this.registry=e}f.prototype.method=function(e,t,r,a,n){return{call:this.call.bind({ensName:e,methodName:t,methodArguments:r,callback:n,parent:this,outputFormatter:a}),send:this.send.bind({ensName:e,methodName:t,methodArguments:r,callback:n,parent:this})}},f.prototype.call=function(e){var t=this,r=new a,n=this.parent.prepareArguments(this.ensName,this.methodArguments),i=this.outputFormatter||null;return this.parent.registry.getResolver(this.ensName).then((async function(a){await t.parent.checkInterfaceSupport(a,t.methodName),t.parent.handleCall(r,a.methods[t.methodName],n,i,e)})).catch((function(t){"function"!==typeof e?r.reject(t):e(t,null)})),r.eventEmitter},f.prototype.send=function(e,t){var r=this,n=new a,i=this.parent.prepareArguments(this.ensName,this.methodArguments);return this.parent.registry.getResolver(this.ensName).then((async function(a){await r.parent.checkInterfaceSupport(a,r.methodName),r.parent.handleSend(n,a.methods[r.methodName],i,e,t)})).catch((function(e){"function"!==typeof t?n.reject(e):t(e,null)})),n.eventEmitter},f.prototype.handleCall=function(e,t,r,a,n){return t.apply(this,r).call().then((function(t){a&&(t=a(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,r,a,n){return t.apply(this,r).send(a).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,r){e.eventEmitter.emit("confirmation",t,r)})).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 r=n.hash(e);return t.length>0?(t.unshift(r),t):[r]},f.prototype.checkInterfaceSupport=async function(e,t){if(c[t]){var r=!1;try{r=await e.methods.supportsInterface(c[t]).call()}catch(a){console.warn('Could not verify interface of resolver contract at "'+e.options.address+'". ')}if(!r)throw i.ResolverMethodMissingError(e.options.address,t)}},e.exports=f},53913:function(e,t,r){r(21703);var a=r(72624);function n(e){var t=null,r=null,n=null;if(e&&e.error)return{protocolType:null,decoded:e.error};if(e)try{t=a.decode(e);var i=a.getCodec(e);"ipfs-ns"===i?r="ipfs":"swarm-ns"===i?r="bzz":"onion"===i?r="onion":"onion3"===i?r="onion3":t=e}catch(c){n=c.message}return{protocolType:r,decoded:t,error:n}}function i(e){var t,r,n=!1;if(e){var i=e.match(/^(ipfs|bzz|onion|onion3):\/\/(.*)/)||e.match(/\/(ipfs)\/(.*)/);i&&(r=i[1],t=i[2]);try{if("ipfs"===r)t.length>=4&&(n="0x"+a.fromIpfs(t));else if("bzz"===r)t.length>=4&&(n="0x"+a.fromSwarm(t));else if("onion"===r)16===t.length&&(n="0x"+a.encode("onion",t));else{if("onion3"!==r)throw new Error("Could not encode content hash: unsupported content type");56===t.length&&(n="0x"+a.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,r){"use strict";r(21703);const a=r(77802),n=r(83239),i=function(e,t){let r=e;while(r.length<2*t)r="0"+r;return r},c=function(e){const t="A".charCodeAt(0),r="Z".charCodeAt(0);return e=e.toUpperCase(),e=e.substr(4)+e.substr(0,4),e.split("").map((function(e){const a=e.charCodeAt(0);return a>=t&&a<=r?a-t+10:e})).join("")},f=function(e){let t,r=e;while(r.length>2)t=r.slice(0,9),r=parseInt(t,10)%97+r.slice(t.length);return parseInt(r,10)%97};class o{constructor(e){this._iban=e}static toAddress(e){if(e=new o(e),!e.isDirect())throw new Error("IBAN is indirect and can't be converted");return e.toAddress()}static toIban(e){return o.fromAddress(e).toString()}static fromAddress(e){if(!a.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),r=t.toString(36),c=i(r,15);return o.fromBban(c.toUpperCase())}static fromBban(e){const t="XE",r=f(c(t+"00"+e)),a=("0"+(98-r)).slice(-2);return new o(t+a+e)}static createIndirect(e){return o.fromBban("ETH"+e.institution+e.identifier)}static isValid(e){const t=new o(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 a.toChecksumAddress(t.toString(16,20))}return""}toString(){return this._iban}}e.exports=o},83239:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(55896).Buffer}catch(E){}function f(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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"],u=[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 h(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function l(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?s[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:s[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function m(e,t,r){var a=new v;return a.mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):a<63?l(this,e,t):a<1024?x(this,e,t):m(this,e,t),r},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},v.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 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 a(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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 g[e]=t,t},A.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){"use strict";var a=r(36603),n=r(79021),i=r(77802),c=r(329),f=r(11205).formatters,o=function(){var e=this;a.packageInit(this,arguments),this.net=new c(this);var t=null,r="latest";Object.defineProperty(this,"defaultAccount",{get:function(){return t},set:function(e){return e&&(t=i.toChecksumAddress(f.inputAddressFormatter(e))),o.forEach((function(e){e.defaultAccount=t})),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return r},set:function(e){return r=e,o.forEach((function(e){e.defaultBlock=r})),e},enumerable:!0});var o=[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]})];o.forEach((function(t){t.attachToObject(e),t.setRequestManager(e._requestManager),t.defaultBlock=e.defaultBlock,t.defaultAccount=e.defaultAccount}))};a.addProviders(o),e.exports=o},7663:function(e){"use strict";var t=function(e){var t,r=this;return this.net.getId().then((function(e){return t=e,r.getBlock(0)})).then((function(r){var a="private";return"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"===r.hash&&1===t&&(a="main"),"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"===r.hash&&3===t&&(a="ropsten"),"0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"===r.hash&&4===t&&(a="rinkeby"),"0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a"===r.hash&&5===t&&(a="goerli"),"0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9"===r.hash&&42===t&&(a="kovan"),"function"===typeof e&&e(null,a),a})).catch((function(t){if("function"!==typeof e)throw t;e(t)}))};e.exports=t},50170:function(e,t,r){"use strict";var a=r(36603),n=r(11205),i=r(84598).subscriptions,c=r(79021),f=r(77802),o=r(329),d=r(65303),s=r(98662),u=r(93135),b=r(80188),h=r(73519),l=r(90056),p=r(7663),x=n.formatters,m=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},v=function(e){return"string"===typeof e[0]&&0===e[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},g=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;a.packageInit(this,arguments);var t=this.setRequestManager;this.setRequestManager=function(r){return t(r),e.net.setRequestManager(r),e.personal.setRequestManager(r),e.accounts.setRequestManager(r),e.Contract._requestManager=e._requestManager,e.Contract.currentProvider=e._provider,!0};var r=this.setProvider;this.setProvider=function(){r.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,T=24,P=750,I=1e3,B=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 P},set:function(t){P=t,e.Contract.transactionPollingTimeout=P,N.forEach((function(e){e.transactionPollingTimeout=P}))},enumerable:!0}),Object.defineProperty(this,"transactionPollingInterval",{get:function(){return I},set:function(t){I=t,e.Contract.transactionPollingInterval=I,N.forEach((function(e){e.transactionPollingInterval=I}))},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return T},set:function(t){T=t,e.Contract.transactionConfirmationBlocks=T,N.forEach((function(e){e.transactionConfirmationBlocks=T}))},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 B},set:function(t){B=t,e.Contract.blockHeaderTimeout=B,N.forEach((function(e){e.blockHeaderTimeout=B}))},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 o(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 O=this,R=function(){u.apply(this,arguments);var e=this,t=O.setProvider;O.setProvider=function(){t.apply(O,arguments),a.packageInit(e,[O])}};R.setProvider=function(){u.setProvider.apply(this,arguments)},R.prototype=Object.create(u.prototype),R.prototype.constructor=R,this.Contract=R,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=b,this.abi=l,this.ens=new d(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:g,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:v,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}))};a.addProviders(M),e.exports=M},329:function(e,t,r){"use strict";var a=r(36603),n=r(79021),i=r(77802),c=function(){var e=this;a.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)}))};a.addProviders(c),e.exports=c},79948:function(e,t,r){r(21703);const a=r(43793).EventEmitter,n=r(9242).inherits,i=r(60345),c=r(97965),f=r(26458),o=r(48981),d=r(4208),s=(r(67046),r(72070)),u=function(){};function b(e){const t=this;a.call(t),t.setMaxListeners(30),e=e||{};const r={sendAsync:t._handleAsync.bind(t)},n=e.blockTrackerProvider||r;t._blockTracker=e.blockTracker||new c({provider:n,pollingInterval:e.pollingInterval||4e3,setSkipCacheFlag:!0}),t._ready=new d,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=b,n(b,a),b.prototype.start=function(e=u){const t=this;t._ready.go(),t._blockTracker.on("latest",(e=>{t._getBlockByNumberWithRetry(e,((e,r)=>{if(e)return void this.emit("error",e);if(!r)return console.log(r),void this.emit("error",new Error("Could not find block"));const a=h(r);t._setCurrentBlock(a),t.emit("rawBlock",r),t.emit("latest",r)}))})),t._blockTracker.on("sync",t.emit.bind(t,"sync")),t._blockTracker.on("error",t.emit.bind(t,"error")),t._running=!0,t.emit("start")},b.prototype.stop=function(){const e=this;e._blockTracker.removeAllListeners(),e._running=!1,e.emit("stop")},b.prototype.isRunning=function(){const e=this;return e._running},b.prototype.addProvider=function(e,t){const r=this;"number"===typeof t?r._providers.splice(t,0,e):r._providers.push(e),e.setEngine(this)},b.prototype.removeProvider=function(e){const t=this,r=t._providers.indexOf(e);if(r<0)throw new Error("Provider not found.");t._providers.splice(r,1)},b.prototype.send=function(e){throw new Error("Web3ProviderEngine does not support synchronous requests.")},b.prototype.sendAsync=function(e,t){const r=this;r._ready.await((function(){Array.isArray(e)?f(e,r._handleAsync.bind(r),t):r._handleAsync(e,t)}))},b.prototype._getBlockByNumberWithRetry=function(e,t){const r=this;let a=5;return void n();function n(){r._getBlockByNumber(e,i)}function i(e,r){return e?t(e):r?void t(null,r):a>0?(a--,void setTimeout((function(){n()}),1e3)):void t(null,null)}},b.prototype._getBlockByNumber=function(e,t){const r=s({method:"eth_getBlockByNumber",params:[e,!1],skipCache:!0});this._handleAsync(r,((e,r)=>e?t(e):t(null,r.result)))},b.prototype._handleAsync=function(e,t){var r=this,a=-1,n=null,i=null,c=[];function f(t){if(a+=1,c.unshift(t),a>=r._providers.length)d(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=r._providers[a];n.handleRequest(e,f,d)}catch(i){d(i)}}function d(r,a){i=r,n=a,o(c,(function(e,t){e?e(i,n,t):t()}),(function(){var r={id:e.id,jsonrpc:e.jsonrpc,result:n};null!=i?(r.error={message:i.stack||i.message||i,code:-32e3},t(i,r)):t(null,r)}))}f()},b.prototype._setCurrentBlock=function(e){const t=this;t.currentBlock=e,t.emit("block",e)}},91501:function(e,t,r){const a=r(8569),n=r(47322);class i extends a{constructor(e){super((({blockTracker:t})=>n(Object.assign({blockTracker:t},e))))}}e.exports=i},23220:function(e,t,r){const a=r(8569),n=r(56615);class i extends a{constructor(){super((({blockTracker:e,provider:t,engine:r})=>n({blockTracker:e,provider:t})))}}e.exports=i},51080:function(e,t,r){const a=r(9242).inherits,n=r(5484);function i(e){const t=this;e=e||{},t.staticResponses=e}e.exports=i,a(i,n),i.prototype.handleRequest=function(e,t,r){const a=this;var n=a.staticResponses[e.method];"function"===typeof n?n(e,t,r):void 0!==n?setTimeout((()=>r(null,n))):t()}},49537:function(e,t,r){r(21703);const a=r(93344),n=r(92172),i=r(9242).inherits,c=r(60345),f=r(98013),o=r(57636),d=r(46941),s=r(5484),u=r(84084),b=/^[0-9A-Fa-f]+$/g;function h(e){const t=this;t.nonceLock=d(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||g("signTransaction")),e.signMessage&&(t.signMessage=e.signMessage||g("signMessage")),e.signPersonalMessage&&(t.signPersonalMessage=e.signPersonalMessage||g("signPersonalMessage")),e.decryptMessage&&(t.decryptMessage=e.decryptMessage||g("decryptMessage")),e.encryptionPublicKey&&(t.encryptionPublicKey=e.encryptionPublicKey||g("encryptionPublicKey")),e.signTypedMessage&&(t.signTypedMessage=e.signTypedMessage||g("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),r=c.isValidAddress(t);return r}function m(e){const t=c.addHexPrefix(e),r=c.isValidAddress(t);return!r&&v(e)}function v(e){const t="string"===typeof e;if(!t)return!1;const r="0x"===e.slice(0,2);if(!r)return!1;const a=e.slice(2),n=a.match(b);return n}function g(e){return function(t,r){r(new Error('ProviderEngine - HookedWalletSubprovider - Must provide "'+e+'" fn in constructor options'))}}e.exports=h,i(h,s),h.prototype.handleRequest=function(e,t,r){const n=this;let i,c,f,d,s;switch(n._parityRequests={},n._parityRequestCount=0,e.method){case"eth_coinbase":return void n.getAccounts((function(e,t){if(e)return r(e);let a=t[0]||null;r(null,a)}));case"eth_accounts":return void n.getAccounts((function(e,t){if(e)return r(e);r(null,t)}));case"eth_sendTransaction":return i=e.params[0],void a([e=>n.validateTransaction(i,e),e=>n.processTransaction(i,e)],r);case"eth_signTransaction":return i=e.params[0],void a([e=>n.validateTransaction(i,e),e=>n.processSignTransaction(i,e)],r);case"eth_sign":return s=e.params[0],d=e.params[1],f=e.params[2]||{},c=o(f,{from:s,data:d}),void a([e=>n.validateMessage(c,e),e=>n.processMessage(c,e)],r);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],d=e.params[1]}else d=e.params[0],s=e.params[1];f=e.params[2]||{},c=o(f,{from:s,data:d}),a([e=>n.validatePersonalMessage(c,e),e=>n.processPersonalMessage(c,e)],r)}();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],d=e.params[1]}else d=e.params[0],s=e.params[1];f=e.params[2]||{},c=o(f,{from:s,data:d}),a([e=>n.validateDecryptMessage(c,e),e=>n.processDecryptMessage(c,e)],r)}();case"encryption_public_key":return function(){const t=e.params[0];a([e=>n.validateEncryptionPublicKey(t,e),e=>n.processEncryptionPublicKey(t,e)],r)}();case"personal_ecRecover":return function(){d=e.params[0];let t=e.params[1];f=e.params[2]||{},c=o(f,{sig:t,data:d}),n.recoverPersonalSignature(c,r)}();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,d=i):(d=t,s=i),f=e.params[2]||{},c=o(f,{from:s,data:d}),a([e=>n.validateTypedMessage(c,e),e=>n.processTypedMessage(c,e)],r)}();case"parity_postTransaction":return i=e.params[0],void n.parityPostTransaction(i,r);case"parity_postSign":return s=e.params[0],d=e.params[1],void n.parityPostSign(s,d,r);case"parity_checkRequest":return function(){const t=e.params[0];n.parityCheckRequest(t,r)}();case"parity_defaultAccount":return void n.getAccounts((function(e,t){if(e)return r(e);const a=t[0]||null;r(null,a)}));default:return void t()}},h.prototype.getAccounts=function(e){e(null,[])},h.prototype.processTransaction=function(e,t){const r=this;a([t=>r.approveTransaction(e,t),(e,t)=>r.checkApproval("transaction",e,t),t=>r.finalizeAndSubmitTx(e,t)],t)},h.prototype.processSignTransaction=function(e,t){const r=this;a([t=>r.approveTransaction(e,t),(e,t)=>r.checkApproval("transaction",e,t),t=>r.finalizeTx(e,t)],t)},h.prototype.processMessage=function(e,t){const r=this;a([t=>r.approveMessage(e,t),(e,t)=>r.checkApproval("message",e,t),t=>r.signMessage(e,t)],t)},h.prototype.processPersonalMessage=function(e,t){const r=this;a([t=>r.approvePersonalMessage(e,t),(e,t)=>r.checkApproval("message",e,t),t=>r.signPersonalMessage(e,t)],t)},h.prototype.processDecryptMessage=function(e,t){const r=this;a([t=>r.approveDecryptMessage(e,t),(e,t)=>r.checkApproval("decryptMessage",e,t),t=>r.decryptMessage(e,t)],t)},h.prototype.processEncryptionPublicKey=function(e,t){const r=this;a([t=>r.approveEncryptionPublicKey(e,t),(e,t)=>r.checkApproval("encryptionPublicKey",e,t),t=>r.encryptionPublicKey(e,t)],t)},h.prototype.processTypedMessage=function(e,t){const r=this;a([t=>r.approveTypedMessage(e,t),(e,t)=>r.checkApproval("message",e,t),t=>r.signTypedMessage(e,t)],t)},h.prototype.autoApprove=function(e,t){t(null,!0)},h.prototype.checkApproval=function(e,t,r){r(t?null:new Error("User denied "+e+" signature."))},h.prototype.parityPostTransaction=function(e,t){const r=this,a=r._parityRequestCount,n=`0x${a.toString(16)}`;r._parityRequestCount++,r.emitPayload({method:"eth_sendTransaction",params:[e]},(function(e,t){if(e)return void(r._parityRequests[n]={error:e});const a=t.result;r._parityRequests[n]=a})),t(null,n)},h.prototype.parityPostSign=function(e,t,r){const a=this,n=a._parityRequestCount,i=`0x${n.toString(16)}`;a._parityRequestCount++,a.emitPayload({method:"eth_sign",params:[e,t]},(function(e,t){if(e)return void(a._parityRequests[i]={error:e});const r=t.result;a._parityRequests[i]=r})),r(null,i)},h.prototype.parityCheckRequest=function(e,t){const r=this,a=r._parityRequests[e]||null;return a?a.error?t(a.error):void t(null,a):t(null,null)},h.prototype.recoverPersonalSignature=function(e,t){let r;try{r=f.recoverPersonalSignature(e)}catch(a){return t(a)}t(null,r)},h.prototype.validateTransaction=function(e,t){const r=this;if(void 0===e.from)return t(new Error("Undefined address - from address required to sign transaction."));r.validateSender(e.from,(function(r,a){return r?t(r):a?void t():t(new Error(`Unknown address - unable to sign transaction for this address: "${e.from}"`))}))},h.prototype.validateMessage=function(e,t){const r=this;if(void 0===e.from)return t(new Error("Undefined address - from address required to sign message."));r.validateSender(e.from,(function(r,a){return r?t(r):a?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))}))},h.prototype.validatePersonalMessage=function(e,t){const r=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.")):v(e.data)?void r.validateSender(e.from,(function(r,a){return r?t(r):a?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 r=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.")):v(e.data)?void r.validateSender(e.from,(function(r,a){return r?t(r):a?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 r=this;r.validateSender(e,(function(r,a){return r?t(r):a?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(r,a){return r?t(r):a?void t():t(new Error(`Unknown address - unable to sign message for this address: "${e.from}"`))}))},h.prototype.validateSender=function(e,t){const r=this;if(!e)return t(null,!1);r.getAccounts((function(r,a){if(r)return t(r);const n=-1!==a.map(p).indexOf(e.toLowerCase());t(null,n)}))},h.prototype.finalizeAndSubmitTx=function(e,t){const r=this;r.nonceLock.take((function(){a([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r),r.publishTransaction.bind(r)],(function(e,a){if(r.nonceLock.leave(),e)return t(e);t(null,a)}))}))},h.prototype.finalizeTx=function(e,t){const r=this;r.nonceLock.take((function(){a([r.fillInTxExtras.bind(r,e),r.signTransaction.bind(r)],(function(a,n){if(r.nonceLock.leave(),a)return t(a);t(null,{raw:n,tx:e})}))}))},h.prototype.publishTransaction=function(e,t){const r=this;r.emitPayload({method:"eth_sendRawTransaction",params:[e]},(function(e,r){if(e)return t(e);t(null,r.result)}))},h.prototype.estimateGas=function(e,t){const r=this;u(r.engine,e,t)},h.prototype.getGasPrice=function(e){const t=this;t.emitPayload({method:"eth_gasPrice",params:[]},(function(t,r){if(t)return e(t);e(null,r.result)}))},h.prototype.fillInTxExtras=function(e,t){const r=this,a=e.from,i={};void 0===e.gasPrice&&(i.gasPrice=r.getGasPrice.bind(r)),void 0===e.nonce&&(i.nonce=r.emitPayload.bind(r,{method:"eth_getTransactionCount",params:[a,"pending"]})),void 0===e.gas&&(i.gas=r.estimateGas.bind(r,l(e))),n(i,(function(r,a){if(r)return t(r);const n={};a.gasPrice&&(n.gasPrice=a.gasPrice),a.nonce&&(n.nonce=a.nonce.result),a.gas&&(n.gas=a.gas),t(null,o(e,n))}))}},8569:function(e,t,r){r(21703);const a=r(5484);class n extends a{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,r=this._constructorFn({engine:e,provider:e,blockTracker:t});if(!r)throw new Error("JsonRpcEngineMiddlewareSubprovider - _constructorFn did not return middleware");if("function"!==typeof r)throw new Error("JsonRpcEngineMiddlewareSubprovider - specified middleware is not a function");this.middleware=r}handleRequest(e,t,r){const a={id:e.id};function n(e){t(((t,r,n)=>{t?(delete a.result,a.error={message:t.message||t}):a.result=r,e?e(n):n()}))}function i(e){if(e)return r(e);r(null,a.result)}this.middleware(e,a,n,i)}}e.exports=n},50822:function(e,t,r){var a=r(15361)["Buffer"];const n=r(9242).inherits,i=r(60253),c=r(60345),f=r(5484),o=r(67046).blockTagForPayload;function d(e){const t=this;t.nonceCache={}}e.exports=d,n(d,f),d.prototype.handleRequest=function(e,t,r){const n=this;switch(e.method){case"eth_getTransactionCount":var f=o(e),d=e.params[0].toLowerCase(),s=n.nonceCache[d];return void("pending"===f?s?r(null,s):t((function(e,t,r){if(e)return r();void 0===n.nonceCache[d]&&(n.nonceCache[d]=t),r()})):t());case"eth_sendRawTransaction":return void t((function(t,r,f){if(t)return f();var o=e.params[0],d=(c.stripHexPrefix(o),a.from(c.stripHexPrefix(o),"hex"),new i(a.from(c.stripHexPrefix(o),"hex"))),s="0x"+d.getSenderAddress().toString("hex").toLowerCase(),u=c.bufferToInt(d.nonce);u++;var b=u.toString(16);b.length%2&&(b="0"+b),b="0x"+b,n.nonceCache[s]=b,f()}));case"evm_revert":return n.nonceCache={},void t();default:return void t()}}},5484:function(e,t,r){r(21703);const a=r(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,r){throw new Error("Subproviders should override `handleRequest`.")},n.prototype.emitPayload=function(e,t){const r=this;r.engine.sendAsync(a(e),t)},n.prototype.stop=function(){},n.prototype.start=function(){}},95905:function(e,t,r){const a=r(8569),n=r(67234);class i extends a{constructor(){super((({blockTracker:e,provider:t,engine:r})=>{const{events:a,middleware:i}=n({blockTracker:e,provider:t});return a.on("notification",(e=>r.emit("data",null,e))),i}))}}e.exports=i},72070:function(e,t,r){const a=r(75482),n=r(57636);function i(e){return n({id:a(),jsonrpc:"2.0",params:[]},e)}e.exports=i},84084:function(e,t,r){const a=r(72070);function n(e,t,r){e.sendAsync(a({method:"eth_estimateGas",params:[t]}),(function(e,t){if(e)return"no contract code at given address"===e.message?r(null,"0xcf08"):r(e);r(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,r){const a=r(40391);function n(e,t={}){if(!i(e))return null;const{includeBlockRef:r}=t,n=r?e.params:f(e);return e.method+":"+a(n)}function i(e){return"never"!==d(e)}function c(e){var t=o(e);return t>=e.params.length?null:e.params[t]}function f(e){var t=o(e);return t>=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function o(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 d(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:o,cacheTypeForPayload:d}},4208:function(e,t,r){const a=r(43793).EventEmitter,n=r(9242).inherits;function i(){const e=this;a.call(e),e.isLocked=!0}e.exports=i,n(i,a),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,r){var a=r(11205).errors,n=r(51283).XMLHttpRequest,i=r(57463),c=r(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 r=!1!==t.keepAlive;this.host=e||"http://localhost:8545",this.agent||("https"===this.host.substring(0,5)?this.httpsAgent=new c.Agent({keepAlive:r}):this.httpAgent=new i.Agent({keepAlive:r}))};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 r=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=a.InvalidResponse(n.responseText)}r.connected=!0,t(i,e)}},n.ontimeout=function(){r.connected=!1,t(a.ConnectionTimeout(this.timeout))};try{n.send(JSON.stringify(e))}catch(i){this.connected=!1,t(a.InvalidConnection(this.host))}},f.prototype.disconnect=function(){},f.prototype.supportsSubscriptions=function(){return!1},e.exports=f},9510:function(e,t,r){"use strict";r(21703);var a=r(11205).errors,n=r(43373),i=function(e,t){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=e,this.connected=!1,this.connection=t.connect({path:this.path}),this.addDefaultEvents();var a=function(e){var t=null;Array.isArray(e)?e.forEach((function(e){r.responseCallbacks[e.id]&&(t=e.id)})):t=e.id,t||-1===e.method.indexOf("_subscription")?r.responseCallbacks[t]&&(r.responseCallbacks[t](null,e),delete r.responseCallbacks[t]):r.notificationCallbacks.forEach((function(t){"function"===typeof t&&t(e)}))};"Socket"===t.constructor.name?n(this.connection).done(a):this.connection.on("data",(function(e){r._parseResponse(e.toString()).forEach(a)}))};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,r=[],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(),a.InvalidResponse(e)}),15e3))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&r.push(n)})),r},i.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,a=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=a},i.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](a.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 r=this;switch(e){case"data":this.notificationCallbacks.forEach((function(e,a){e===t&&r.notificationCallbacks.splice(a,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,r){var a=r(96027),n=r(15361)["Buffer"];r(82801);var i="[object process]"===Object.prototype.toString.call("undefined"!==typeof a?a:0),c="undefined"!==typeof navigator&&"ReactNative"===navigator.product,f=null,o=null;if(i||c){f=function(e){return n.from(e).toString("base64")};var d=r(8185);if(d.URL){var s=d.URL;o=function(e){return new s(e)}}else o=r(8185).parse}else f=btoa.bind("object"===typeof globalThis?globalThis:self),o=function(e){return new URL(e)};e.exports={parseURL:o,btoa:f}},62990:function(e,t,r){"use strict";var a=r(96266),n=r(7503),i=r(11205).errors,c=r(13977).w3cwebsocket,f=function(e,t){a.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 r=n.parseURL(e);r.username&&r.password&&(this.headers.authorization="Basic "+n.btoa(r.username+":"+r.password)),r.auth&&(this.headers.authorization="Basic "+n.btoa(r.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};f.prototype=Object.create(a.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 r=e.id;Array.isArray(e)&&(r=e[0].id),t.responseQueue.has(r)&&(void 0!==t.responseQueue.get(r).callback&&t.responseQueue.get(r).callback(!1,e),t.responseQueue.delete(r))}}))},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,r){e.send(t.payload,t.callback),e.requestQueue.delete(r)}))}},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(r,a){r.callback(i.ConnectionNotOpenError(e)),t.requestQueue.delete(a)})),this.responseQueue.size>0&&this.responseQueue.forEach((function(r,a){r.callback(i.InvalidConnection("on WS",e)),t.responseQueue.delete(a)})),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,r=[],a=e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return a.forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);var a=null;try{a=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,r){e.callback(i.ConnectionTimeout(t._customTimeout)),t.requestQueue.delete(r)})))}),t._customTimeout))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,a&&r.push(a)})),r},f.prototype.send=function(e,t){var r=this,a=e.id,n={payload:e,callback:t};if(Array.isArray(e)&&(a=e[0].id),this.connection.readyState===this.connection.CONNECTING||this.reconnecting)this.requestQueue.set(a,n);else{if(this.connection.readyState!==this.connection.OPEN)return this.requestQueue.delete(a),this.emit(this.ERROR,i.ConnectionNotOpenError()),void n.callback(i.ConnectionNotOpenError());this.responseQueue.set(a,n),this.requestQueue.delete(a);try{this.connection.send(JSON.stringify(n.payload))}catch(c){n.callback(c),r.responseQueue.delete(a)}}},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,r){t.callback(i.PendingRequestsOnReconnectingError()),e.responseQueue.delete(r)})),!this.reconnectOptions.maxAttempts||this.reconnectAttempts0&&this.requestQueue.forEach((function(t,r){t.callback(i.MaxAttemptsReachedOnReconnectingError()),e.requestQueue.delete(r)})))},e.exports=f},96266:function(e,t,r){"use strict";r(21703);var a=Object.prototype.hasOwnProperty,n="~";function i(){}function c(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function f(e,t,r,a,i){if("function"!==typeof r)throw new TypeError("The listener must be a function");var f=new c(r,a||e,i),o=n?n+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],f]:e._events[o].push(f):(e._events[o]=f,e._eventsCount++),e}function o(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function d(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),d.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)a.call(e,t)&&r.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},d.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,i=r.length,c=new Array(i);a=0&&(a=t.type.substring(n));var i=s(e,t.components);Array.isArray(i)&&e?r.push("tuple("+i.join(",")+")"+a):e?r.push("("+i+")"):r.push("("+i.join(",")+")"+a)}else r.push(t.type)})),r},u=function(e){return"0x"+c(e).toString("hex")},b=function(e){if(!n.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[a].toUpperCase():r+=e[a];return r},v=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 r=new f(e),a=new f(t);return r.lt(a)?-1:r.eq(a)?0:1}}return 0};e.exports={_fireError:o,_jsonInterfaceMethodToString:d,_flattenTypes:s,randomHex:u,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:b,toAscii:b,asciiToHex:h,fromAscii:h,unitMap:a.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:v,toNumber:n.toNumber}},49884:function(e,t,r){r(21703);var a=r(36854),n=r(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},o=function(e){var t=typeof e;if("string"===t)return n.isHexStrict(e)?new a(e.replace(/0x/i,""),16):new a(e,10);if("number"===t)return new a(e);if(n.isBigNumber(e))return new a(e.toString(10));if(n.isBN(e))return e;throw new Error(e+" is not a number")},d=function(e,t,r){var f,d;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=r?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(r&&(f=32),f<1||f>32||f256)throw new Error("Invalid uint"+f+" size");if(d=o(t),d.bitLength()>f)throw new Error("Supplied uint exceeds width: "+f+" vs "+d.bitLength());if(d.lt(new a(0)))throw new Error("Supplied uint "+d.toString()+" is negative");return f?n.leftPad(d.toString("hex"),f/8*2):d}if(e.startsWith("int")){if(f%8||f<8||f>256)throw new Error("Invalid int"+f+" size");if(d=o(t),d.bitLength()>f)throw new Error("Supplied int exceeds width: "+f+" vs "+d.bitLength());return d.lt(new a(0))?d.toTwos(f).toString("hex"):f?n.leftPad(d.toString("hex"),f/8*2):d}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,r,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 a(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)?(r=c.map((function(e){return d(t,e,i).toString("hex").replace("0x","")})),r.join("")):(r=d(t,c,i),r.toString("hex").replace("0x",""))},u=function(){var e=Array.prototype.slice.call(arguments),t=e.map(s);return n.sha3("0x"+t.join(""))},b=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:u,soliditySha3Raw:b,encodePacked:h}},87785:function(e,t,r){var a=r(15361)["Buffer"];r(21703);var n=r(36854),i=r(70594),c=r(62059),f=r(48859),o=r(16101),d=function(e){return n.isBN(e)},s=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},u=function(e){try{return i.apply(null,arguments)}catch(t){throw new Error(t+' Given value: "'+e+'"')}},b=function(e){return"0x"+u(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,""),r=0;r<40;r++)if(parseInt(t[r],16)>7&&e[r].toUpperCase()!==e[r]||parseInt(t[r],16)<=7&&e[r].toLowerCase()!==e[r])return!1;return!0},p=function(e,t,r){var a=/^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(a?"0x":"")+new Array(n).join(r||"0")+e},x=function(e,t,r){var a=/^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(a?"0x":"")+e+new Array(n).join(r||"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 r=0;r>>4).toString(16)),t.push((15&e[r]).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=[],r=0;r=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,a){for(var n=0,i=Math.min(e.length,r),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,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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"],u=[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 h(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}function l(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?s[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h),r=l.isZero()?p+r:s[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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 a("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,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var c,f,o="le"===t,d=new e(i),s=this.clone();if(o){for(f=0;!s.isZero();f++)c=s.andln(255),s.iushrn(8),d[f]=c;for(;f=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function x(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r.strip()}function m(e,t,r){var a=new v;return a.mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):a<63?l(this,e,t):a<1024?x(this,e,t):m(this,e,t),r},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},v.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this.strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o.strip(),a.strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},i.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 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 a(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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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 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 g[e]=t,t},A.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=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 r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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 r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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,r){"use strict";var a=r(15361)["Buffer"];r(21703);var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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(r(89455)),f=r(10211),o=r(52010),d=r(60660),s=r(54703),u=r(54796),b=r(66117),h=r(91914),l=r(49003),p=function(){function e(e,t,r,a){void 0===e&&(e=new f.BN(0)),void 0===t&&(t=new f.BN(0)),void 0===r&&(r=s.KECCAK256_RLP),void 0===a&&(a=s.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=a,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,a=t.balance,n=t.stateRoot,i=t.codeHash;return new e(r?new f.BN((0,u.toBuffer)(r)):void 0,a?new f.BN((0,u.toBuffer)(a)):void 0,n?(0,u.toBuffer)(n):void 0,i?(0,u.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 r=n(t,4),a=r[0],i=r[1],c=r[2],o=r[3];return new e(new f.BN(a),new f.BN(i),c,o)},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 r=(0,d.stripHexPrefix)(e).toLowerCase(),a="";if(t){var n=(0,l.toType)(t,l.TypeOutput.BN);a=n.toString()+"0x"}for(var i=(0,b.keccakFromString)(a+r).toString("hex"),c="0x",f=0;f=8?c+=r[f].toUpperCase():c+=r[f];return c};t.toChecksumAddress=m;var v=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.isValidChecksumAddress=v;var g=function(e,t){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t);var r=new f.BN(t);return r.isZero()?(0,b.rlphash)([e,null]).slice(-20):(0,b.rlphash)([e,a.from(r.toArray())]).slice(-20)};t.generateAddress=g;var y=function(e,t,r){(0,h.assertIsBuffer)(e),(0,h.assertIsBuffer)(t),(0,h.assertIsBuffer)(r),(0,c.default)(20===e.length),(0,c.default)(32===t.length);var n=(0,b.keccak256)(a.concat([a.from("ff","hex"),e,t,(0,b.keccak256)(r)]));return n.slice(-20)};t.generateAddress2=y;var w=function(e){return(0,o.privateKeyVerify)(e)};t.isValidPrivate=w;var M=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),64===e.length?(0,o.publicKeyVerify)(a.concat([a.from([4]),e])):!!t&&(0,o.publicKeyVerify)(e)};t.isValidPublic=M;var _=function(e,t){return void 0===t&&(t=!1),(0,h.assertIsBuffer)(e),t&&64!==e.length&&(e=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),(0,c.default)(64===e.length),(0,b.keccak)(e).slice(-20)};t.pubToAddress=_,t.publicToAddress=t.pubToAddress;var k=function(e){return(0,h.assertIsBuffer)(e),a.from((0,o.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=a.from((0,o.publicKeyConvert)(e,!1).slice(1))),e};t.importPublic=S;var E=function(){var e=20,t=(0,u.zeros)(e);return(0,u.bufferToHex)(t)};t.zeroAddress=E;var T=function(e){try{(0,h.assertIsString)(e)}catch(a){return!1}var r=(0,t.zeroAddress)();return r===e};t.isZeroAddress=T},69194:function(e,t,r){"use strict";var a=r(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(r(89455)),c=r(10211),f=r(54796),o=r(7907),d=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,o.isValidAddress)(t),"Invalid address"),new e((0,f.toBuffer)(t))},e.fromPublicKey=function(t){(0,i.default)(a.isBuffer(t),"Public key should be Buffer");var r=(0,o.pubToAddress)(t);return new e(r)},e.fromPrivateKey=function(t){(0,i.default)(a.isBuffer(t),"Private key should be Buffer");var r=(0,o.privateToAddress)(t);return new e(r)},e.generate=function(t,r){return(0,i.default)(c.BN.isBN(r)),new e((0,o.generateAddress)(t.buf,r.toArrayLike(a)))},e.generate2=function(t,r,n){return(0,i.default)(a.isBuffer(r)),(0,i.default)(a.isBuffer(n)),new e((0,o.generateAddress2)(t.buf,r,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),r=new c.BN("ffff","hex");return e.gte(t)&&e.lte(r)},e.prototype.toString=function(){return"0x"+this.buf.toString("hex")},e.prototype.toBuffer=function(){return a.from(this.buf)},e}();t.Address=d},54796:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),r(48675),r(3462);var n=this&&this.__values||function(e){var t="function"===typeof Symbol&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&"number"===typeof e.length)return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var a,n,i=r.call(e),c=[];try{while((void 0===t||t-- >0)&&!(a=i.next()).done)c.push(a.value)}catch(f){n={error:f}}finally{try{a&&!a.done&&(r=i["return"])&&r.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=r(10211),f=r(60660),o=r(91914),d=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=d;var s=function(e){var r=(0,t.intToHex)(e);return a.from((0,f.padToEven)(r.slice(2)),"hex")};t.intToBuffer=s;var u=function(e){return a.allocUnsafe(e).fill(0)};t.zeros=u;var b=function(e,r,a){var n=(0,t.zeros)(r);return a?e.length0&&"0"===t.toString())e=e.slice(1),t=e[0];return e},x=function(e){return(0,o.assertIsBuffer)(e),p(e)};t.unpadBuffer=x;var m=function(e){return(0,o.assertIsArray)(e),p(e)};t.unpadArray=m;var v=function(e){return(0,o.assertIsHexString)(e),e=(0,f.stripHexPrefix)(e),p(e)};t.unpadHexString=v;var g=function(e){if(null===e||void 0===e)return a.allocUnsafe(0);if(a.isBuffer(e))return a.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return a.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 a.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(a)}if(e.toArray)return a.from(e.toArray());if(e.toBuffer)return a.from(e.toBuffer());throw new Error("invalid type")};t.toBuffer=g;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 a.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 r=a.from(e.replace(t,""),"hex");return r.toString("utf8")};t.toUtf8=A;var S=function(e){if(a.isBuffer(e))return"0x".concat(e.toString("hex"));if(e instanceof Array){for(var r=[],n=0;n0&&0===d[0])throw new Error("".concat(o," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(s){t={error:s}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}};function T(e){return Array.isArray(e)?e.map((function(e){return T(e)})):a.from(e)}function P(e){return Array.isArray(e)?e.map((function(e){return P(e)})):Uint8Array.from(null!==e&&void 0!==e?e:[])}t.validateNoLeadingZeroes=E,t.arrToBufArr=T,t.bufArrToArr=P},54703:function(e,t,r){"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 a=r(15361),n=r(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=a.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=a.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=a.Buffer.from(t.KECCAK256_RLP_S,"hex")},10211:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),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 r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&a(t,e,r);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(r(59149));t.BN=f.default;var o=i(r(98217));t.rlp=o},66117:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(92802),i=r(65443),c=r(10211),f=r(54796),o=r(91914),d=function(e,t){switch(void 0===t&&(t=256),(0,o.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=d;var s=function(e){return(0,t.keccak)(e)};t.keccak256=s;var u=function(e,r){void 0===r&&(r=256),(0,o.assertIsString)(e);var n=a.from(e,"utf8");return(0,t.keccak)(n,r)};t.keccakFromString=u;var b=function(e,r){return void 0===r&&(r=256),(0,o.assertIsHexString)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromHexString=b;var h=function(e,r){return void 0===r&&(r=256),(0,o.assertIsArray)(e),(0,t.keccak)((0,f.toBuffer)(e),r)};t.keccakFromArray=h;var l=function(e){return e=(0,f.toBuffer)(e),i("sha256").update(e).digest()},p=function(e){return(0,o.assertIsBuffer)(e),l(e)};t.sha256=p;var x=function(e){return(0,o.assertIsString)(e),l(e)};t.sha256FromString=x;var m=function(e){return(0,o.assertIsArray)(e),l(e)};t.sha256FromArray=m;var v=function(e,t){e=(0,f.toBuffer)(e);var r=i("rmd160").update(e).digest();return!0===t?(0,f.setLengthLeft)(r,32):r},g=function(e,t){return(0,o.assertIsBuffer)(e),v(e,t)};t.ripemd160=g;var y=function(e,t){return(0,o.assertIsString)(e),v(e,t)};t.ripemd160FromString=y;var w=function(e,t){return(0,o.assertIsArray)(e),v(e,t)};t.ripemd160FromArray=w;var M=function(e){return(0,t.keccak)(c.rlp.encode(e))};t.rlphash=M},91914:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.assertIsString=t.assertIsArray=t.assertIsBuffer=t.assertIsHexString=void 0;var n=r(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(!a.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 o=function(e){if("string"!==typeof e){var t="This method only supports strings but input was: ".concat(e);throw new Error(t)}};t.assertIsString=o},48859:function(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};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(r(54703),t),n(r(7907),t),n(r(69194),t),n(r(66117),t),n(r(81069),t),n(r(54796),t),n(r(64581),t),n(r(10211),t),n(r(49003),t);var i=r(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,r){"use strict";var a=r(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]}r(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 a.byteLength(e,"utf8")}function o(e,t,r){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[r?"some":"every"]((function(t){return e.indexOf(t)>=0}))}function d(e){var t="",r=0,a=e.length;for("0x"===e.substring(0,2)&&(r=2);r=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[r]=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})})),r)if("string"===typeof r&&(r=a.from((0,c.stripHexPrefix)(r),"hex")),a.isBuffer(r)&&(r=f.rlp.decode(r)),Array.isArray(r)){if(r.length>e._fields.length)throw new Error("wrong number of fields in data");r.forEach((function(t,r){e[e._fields[r]]=(0,o.toBuffer)(t)}))}else{if("object"!==typeof r)throw new Error("invalid data");var n=Object.keys(r);t.forEach((function(t){-1!==n.indexOf(t.name)&&(e[t.name]=r[t.name]),-1!==n.indexOf(t.alias)&&(e[t.alias]=r[t.alias])}))}};t.defineProperties=d},81069:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(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=r(52010),i=r(10211),c=r(54796),f=r(66117),o=r(91914),d=r(49003);function s(e,t,r){var i=(0,n.ecdsaSign)(e,t),c=i.signature,f=i.recid,o=a.from(c.slice(0,32)),s=a.from(c.slice(32,64));if(!r||"number"===typeof r){if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");var u=r?f+(2*r+35):f+27;return{r:o,s:s,v:u}}var b=(0,d.toType)(r,d.TypeOutput.BN),h=b.muln(2).addn(35).addn(f).toArrayLike(a);return{r:o,s:s,v:h}}function u(e,t){var r=(0,d.toType)(e,d.TypeOutput.BN);if(!t)return r.subn(27);var a=(0,d.toType)(t,d.TypeOutput.BN);return r.sub(a.muln(2).addn(35))}function b(e){var t=new i.BN(e);return t.eqn(0)||t.eqn(1)}t.ecsign=s;var h=function(e,t,r,i,f){var o=a.concat([(0,c.setLengthLeft)(r,32),(0,c.setLengthLeft)(i,32)],64),d=u(t,f);if(!b(d))throw new Error("Invalid signature v value");var s=(0,n.ecdsaRecover)(o,d.toNumber(),e);return a.from((0,n.publicKeyConvert)(s,!1).slice(1))};t.ecrecover=h;var l=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");return(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(r,32),(0,c.toBuffer)(e)]))};t.toRpcSig=l;var p=function(e,t,r,n){var i=u(e,n);if(!b(i))throw new Error("Invalid signature v value");var f=(0,d.toType)(e,d.TypeOutput.Number),o=r;return(f>28&&f%2===1||1===f||28===f)&&(o=a.from(r),o[0]|=128),(0,c.bufferToHex)(a.concat([(0,c.setLengthLeft)(t,32),(0,c.setLengthLeft)(o,32)]))};t.toCompactSig=p;var x=function(e){var t,r,a,n=(0,c.toBuffer)(e);if(n.length>=65)t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(64));else{if(64!==n.length)throw new Error("Invalid signature length");t=n.slice(0,32),r=n.slice(32,64),a=(0,c.bufferToInt)(n.slice(32,33))>>7,r[0]&=127}return a<27&&(a+=27),{v:a,r:t,s:r}};t.fromRpcSig=x;var m=function(e,t,r,a,n){void 0===a&&(a=!0);var c=new i.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),f=new i.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!b(u(e,n)))return!1;var o=new i.BN(t),d=new i.BN(r);return!(o.isZero()||o.gt(f)||d.isZero()||d.gt(f))&&(!a||1!==d.cmp(c))};t.isValidSignature=m;var v=function(e){(0,o.assertIsBuffer)(e);var t=a.from("Ethereum Signed Message:\n".concat(e.length),"utf-8");return(0,f.keccak)(a.concat([t,e]))};t.hashPersonalMessage=v},49003:function(e,t,r){"use strict";var a=r(15361)["Buffer"];r(21703),Object.defineProperty(t,"__esModule",{value:!0}),t.toType=t.TypeOutput=t.bnToRlp=t.bnToUnpaddedBuffer=t.bnToHex=void 0;var n,i=r(10211),c=r(60660),f=r(54796);function o(e){return"0x".concat(e.toString(16))}function d(e){return(0,f.unpadBuffer)(e.toArrayLike(a))}function s(e){return d(e)}function u(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 r=(0,f.toBuffer)(e);if(t===n.Buffer)return r;if(t===n.BN)return new i.BN(r);if(t===n.Number){var a=new i.BN(r),o=new i.BN(Number.MAX_SAFE_INTEGER.toString());if(a.gt(o))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return a.toNumber()}return"0x".concat(r.toString("hex"))}}t.bnToHex=o,t.bnToUnpaddedBuffer=d,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=u},59149:function(e,t,r){e=r.nmd(e),r(21703),function(e,t){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:r(33557).Buffer}catch(I){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function o(e,t,r){var a=f(e,r);return r-1>=t&&(a|=f(e,r-1)<<4),a}function d(e,t,r,n){for(var i=0,c=0,f=Math.min(e.length,r),o=t;o=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&c0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),a(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"===r)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var a=0;a=t;a-=2)n=o(e,t,a)<=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8;else{var f=e.length-t;for(a=f%2===0?t+1:t;a=18?(i-=18,c+=1,this.words[c]|=n>>>26):i+=8}this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var a=0,n=1;n<=67108863;n*=t)a++;a--,n=n/t|0;for(var i=e.length-r,c=i%a,f=Math.min(i,i-c)+r,o=0,s=r;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")]=u}catch(I){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?""}var b=["","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 r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var n=0,i=0,c=0;c>>24-n&16777215,r=0!==i||c!==this.length-1?b[6-o.length]+o+r:o+r,n+=2,n>=26&&(n-=26,c--)}0!==i&&(r=i.toString(16)+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],s=l[e];r="";var u=this.clone();u.negative=0;while(!u.isZero()){var p=u.modrn(s).toString(e);u=u.idivn(s),r=u.isZero()?p+r:b[d-p.length]+p+r}this.isZero()&&(r="0"+r);while(r.length%t!==0)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!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&&a(!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()),r=0;r>>n&1}return t}function m(e,t,r){r.negative=t.negative^e.negative;var a=e.length+t.length|0;r.length=a,a=a-1|0;var n=0|e.words[0],i=0|t.words[0],c=n*i,f=67108863&c,o=c/67108864|0;r.words[0]=f;for(var d=1;d>>26,u=67108863&o,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;n=0|e.words[l],i=0|t.words[h],c=n*i+u,s+=c/67108864|0,u=67108863&c}r.words[d]=0|u,o=0|s}return 0!==o?r.words[d]=0|o:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(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 r=0,a=0,n=0,i=0;n>8&255),r>16&255),6===i?(r>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r=0&&(e[r--]=c>>8&255),r>=0&&(e[r--]=c>>16&255),6===i?(r>=0&&(e[r--]=c>>24&255),a=0,i=0):(a=c>>>24,i+=2)}if(r>=0){e[r--]=a;while(r>=0)e[r--]=0}},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},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 r=0;re.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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var a=0;ae.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){a("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){a("number"===typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,a=e):(r=e,a=this);for(var n=0,i=0;i>>26;for(;0!==n&&i>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==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 r,a,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,a=e):(r=e,a=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,v=x>>>13,g=0|c[3],y=8191&g,w=g>>>13,M=0|c[4],_=8191&M,k=M>>>13,A=0|c[5],S=8191&A,E=A>>>13,T=0|c[6],P=8191&T,I=T>>>13,B=0|c[7],C=8191&B,O=B>>>13,R=0|c[8],N=8191&R,L=R>>>13,U=0|c[9],j=8191&U,F=U>>>13,D=0|f[0],H=8191&D,q=D>>>13,z=0|f[1],K=8191&z,W=z>>>13,G=0|f[2],V=8191&G,Z=G>>>13,$=0|f[3],J=8191&$,Y=$>>>13,X=0|f[4],Q=8191&X,ee=X>>>13,te=0|f[5],re=8191&te,ae=te>>>13,ne=0|f[6],ie=8191&ne,ce=ne>>>13,fe=0|f[7],oe=8191&fe,de=fe>>>13,se=0|f[8],ue=8191&se,be=se>>>13,he=0|f[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19,a=Math.imul(u,H),n=Math.imul(u,q),n=n+Math.imul(b,H)|0,i=Math.imul(b,q);var xe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,a=Math.imul(l,H),n=Math.imul(l,q),n=n+Math.imul(p,H)|0,i=Math.imul(p,q),a=a+Math.imul(u,K)|0,n=n+Math.imul(u,W)|0,n=n+Math.imul(b,K)|0,i=i+Math.imul(b,W)|0;var me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(me>>>26)|0,me&=67108863,a=Math.imul(m,H),n=Math.imul(m,q),n=n+Math.imul(v,H)|0,i=Math.imul(v,q),a=a+Math.imul(l,K)|0,n=n+Math.imul(l,W)|0,n=n+Math.imul(p,K)|0,i=i+Math.imul(p,W)|0,a=a+Math.imul(u,V)|0,n=n+Math.imul(u,Z)|0,n=n+Math.imul(b,V)|0,i=i+Math.imul(b,Z)|0;var ve=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,a=Math.imul(y,H),n=Math.imul(y,q),n=n+Math.imul(w,H)|0,i=Math.imul(w,q),a=a+Math.imul(m,K)|0,n=n+Math.imul(m,W)|0,n=n+Math.imul(v,K)|0,i=i+Math.imul(v,W)|0,a=a+Math.imul(l,V)|0,n=n+Math.imul(l,Z)|0,n=n+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0,a=a+Math.imul(u,J)|0,n=n+Math.imul(u,Y)|0,n=n+Math.imul(b,J)|0,i=i+Math.imul(b,Y)|0;var ge=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,a=Math.imul(_,H),n=Math.imul(_,q),n=n+Math.imul(k,H)|0,i=Math.imul(k,q),a=a+Math.imul(y,K)|0,n=n+Math.imul(y,W)|0,n=n+Math.imul(w,K)|0,i=i+Math.imul(w,W)|0,a=a+Math.imul(m,V)|0,n=n+Math.imul(m,Z)|0,n=n+Math.imul(v,V)|0,i=i+Math.imul(v,Z)|0,a=a+Math.imul(l,J)|0,n=n+Math.imul(l,Y)|0,n=n+Math.imul(p,J)|0,i=i+Math.imul(p,Y)|0,a=a+Math.imul(u,Q)|0,n=n+Math.imul(u,ee)|0,n=n+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var ye=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,a=Math.imul(S,H),n=Math.imul(S,q),n=n+Math.imul(E,H)|0,i=Math.imul(E,q),a=a+Math.imul(_,K)|0,n=n+Math.imul(_,W)|0,n=n+Math.imul(k,K)|0,i=i+Math.imul(k,W)|0,a=a+Math.imul(y,V)|0,n=n+Math.imul(y,Z)|0,n=n+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,a=a+Math.imul(m,J)|0,n=n+Math.imul(m,Y)|0,n=n+Math.imul(v,J)|0,i=i+Math.imul(v,Y)|0,a=a+Math.imul(l,Q)|0,n=n+Math.imul(l,ee)|0,n=n+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0,a=a+Math.imul(u,re)|0,n=n+Math.imul(u,ae)|0,n=n+Math.imul(b,re)|0,i=i+Math.imul(b,ae)|0;var we=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(we>>>26)|0,we&=67108863,a=Math.imul(P,H),n=Math.imul(P,q),n=n+Math.imul(I,H)|0,i=Math.imul(I,q),a=a+Math.imul(S,K)|0,n=n+Math.imul(S,W)|0,n=n+Math.imul(E,K)|0,i=i+Math.imul(E,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(_,Z)|0,n=n+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,a=a+Math.imul(y,J)|0,n=n+Math.imul(y,Y)|0,n=n+Math.imul(w,J)|0,i=i+Math.imul(w,Y)|0,a=a+Math.imul(m,Q)|0,n=n+Math.imul(m,ee)|0,n=n+Math.imul(v,Q)|0,i=i+Math.imul(v,ee)|0,a=a+Math.imul(l,re)|0,n=n+Math.imul(l,ae)|0,n=n+Math.imul(p,re)|0,i=i+Math.imul(p,ae)|0,a=a+Math.imul(u,ie)|0,n=n+Math.imul(u,ce)|0,n=n+Math.imul(b,ie)|0,i=i+Math.imul(b,ce)|0;var Me=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,a=Math.imul(C,H),n=Math.imul(C,q),n=n+Math.imul(O,H)|0,i=Math.imul(O,q),a=a+Math.imul(P,K)|0,n=n+Math.imul(P,W)|0,n=n+Math.imul(I,K)|0,i=i+Math.imul(I,W)|0,a=a+Math.imul(S,V)|0,n=n+Math.imul(S,Z)|0,n=n+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,a=a+Math.imul(_,J)|0,n=n+Math.imul(_,Y)|0,n=n+Math.imul(k,J)|0,i=i+Math.imul(k,Y)|0,a=a+Math.imul(y,Q)|0,n=n+Math.imul(y,ee)|0,n=n+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,a=a+Math.imul(m,re)|0,n=n+Math.imul(m,ae)|0,n=n+Math.imul(v,re)|0,i=i+Math.imul(v,ae)|0,a=a+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,a=a+Math.imul(u,oe)|0,n=n+Math.imul(u,de)|0,n=n+Math.imul(b,oe)|0,i=i+Math.imul(b,de)|0;var _e=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,a=Math.imul(N,H),n=Math.imul(N,q),n=n+Math.imul(L,H)|0,i=Math.imul(L,q),a=a+Math.imul(C,K)|0,n=n+Math.imul(C,W)|0,n=n+Math.imul(O,K)|0,i=i+Math.imul(O,W)|0,a=a+Math.imul(P,V)|0,n=n+Math.imul(P,Z)|0,n=n+Math.imul(I,V)|0,i=i+Math.imul(I,Z)|0,a=a+Math.imul(S,J)|0,n=n+Math.imul(S,Y)|0,n=n+Math.imul(E,J)|0,i=i+Math.imul(E,Y)|0,a=a+Math.imul(_,Q)|0,n=n+Math.imul(_,ee)|0,n=n+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,a=a+Math.imul(y,re)|0,n=n+Math.imul(y,ae)|0,n=n+Math.imul(w,re)|0,i=i+Math.imul(w,ae)|0,a=a+Math.imul(m,ie)|0,n=n+Math.imul(m,ce)|0,n=n+Math.imul(v,ie)|0,i=i+Math.imul(v,ce)|0,a=a+Math.imul(l,oe)|0,n=n+Math.imul(l,de)|0,n=n+Math.imul(p,oe)|0,i=i+Math.imul(p,de)|0,a=a+Math.imul(u,ue)|0,n=n+Math.imul(u,be)|0,n=n+Math.imul(b,ue)|0,i=i+Math.imul(b,be)|0;var ke=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,a=Math.imul(j,H),n=Math.imul(j,q),n=n+Math.imul(F,H)|0,i=Math.imul(F,q),a=a+Math.imul(N,K)|0,n=n+Math.imul(N,W)|0,n=n+Math.imul(L,K)|0,i=i+Math.imul(L,W)|0,a=a+Math.imul(C,V)|0,n=n+Math.imul(C,Z)|0,n=n+Math.imul(O,V)|0,i=i+Math.imul(O,Z)|0,a=a+Math.imul(P,J)|0,n=n+Math.imul(P,Y)|0,n=n+Math.imul(I,J)|0,i=i+Math.imul(I,Y)|0,a=a+Math.imul(S,Q)|0,n=n+Math.imul(S,ee)|0,n=n+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,a=a+Math.imul(_,re)|0,n=n+Math.imul(_,ae)|0,n=n+Math.imul(k,re)|0,i=i+Math.imul(k,ae)|0,a=a+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,a=a+Math.imul(m,oe)|0,n=n+Math.imul(m,de)|0,n=n+Math.imul(v,oe)|0,i=i+Math.imul(v,de)|0,a=a+Math.imul(l,ue)|0,n=n+Math.imul(l,be)|0,n=n+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0,a=a+Math.imul(u,le)|0,n=n+Math.imul(u,pe)|0,n=n+Math.imul(b,le)|0,i=i+Math.imul(b,pe)|0;var Ae=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,a=Math.imul(j,K),n=Math.imul(j,W),n=n+Math.imul(F,K)|0,i=Math.imul(F,W),a=a+Math.imul(N,V)|0,n=n+Math.imul(N,Z)|0,n=n+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,a=a+Math.imul(C,J)|0,n=n+Math.imul(C,Y)|0,n=n+Math.imul(O,J)|0,i=i+Math.imul(O,Y)|0,a=a+Math.imul(P,Q)|0,n=n+Math.imul(P,ee)|0,n=n+Math.imul(I,Q)|0,i=i+Math.imul(I,ee)|0,a=a+Math.imul(S,re)|0,n=n+Math.imul(S,ae)|0,n=n+Math.imul(E,re)|0,i=i+Math.imul(E,ae)|0,a=a+Math.imul(_,ie)|0,n=n+Math.imul(_,ce)|0,n=n+Math.imul(k,ie)|0,i=i+Math.imul(k,ce)|0,a=a+Math.imul(y,oe)|0,n=n+Math.imul(y,de)|0,n=n+Math.imul(w,oe)|0,i=i+Math.imul(w,de)|0,a=a+Math.imul(m,ue)|0,n=n+Math.imul(m,be)|0,n=n+Math.imul(v,ue)|0,i=i+Math.imul(v,be)|0,a=a+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=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,a=Math.imul(j,V),n=Math.imul(j,Z),n=n+Math.imul(F,V)|0,i=Math.imul(F,Z),a=a+Math.imul(N,J)|0,n=n+Math.imul(N,Y)|0,n=n+Math.imul(L,J)|0,i=i+Math.imul(L,Y)|0,a=a+Math.imul(C,Q)|0,n=n+Math.imul(C,ee)|0,n=n+Math.imul(O,Q)|0,i=i+Math.imul(O,ee)|0,a=a+Math.imul(P,re)|0,n=n+Math.imul(P,ae)|0,n=n+Math.imul(I,re)|0,i=i+Math.imul(I,ae)|0,a=a+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,a=a+Math.imul(_,oe)|0,n=n+Math.imul(_,de)|0,n=n+Math.imul(k,oe)|0,i=i+Math.imul(k,de)|0,a=a+Math.imul(y,ue)|0,n=n+Math.imul(y,be)|0,n=n+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0,a=a+Math.imul(m,le)|0,n=n+Math.imul(m,pe)|0,n=n+Math.imul(v,le)|0,i=i+Math.imul(v,pe)|0;var Ee=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,a=Math.imul(j,J),n=Math.imul(j,Y),n=n+Math.imul(F,J)|0,i=Math.imul(F,Y),a=a+Math.imul(N,Q)|0,n=n+Math.imul(N,ee)|0,n=n+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,a=a+Math.imul(C,re)|0,n=n+Math.imul(C,ae)|0,n=n+Math.imul(O,re)|0,i=i+Math.imul(O,ae)|0,a=a+Math.imul(P,ie)|0,n=n+Math.imul(P,ce)|0,n=n+Math.imul(I,ie)|0,i=i+Math.imul(I,ce)|0,a=a+Math.imul(S,oe)|0,n=n+Math.imul(S,de)|0,n=n+Math.imul(E,oe)|0,i=i+Math.imul(E,de)|0,a=a+Math.imul(_,ue)|0,n=n+Math.imul(_,be)|0,n=n+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0,a=a+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 Te=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,a=Math.imul(j,Q),n=Math.imul(j,ee),n=n+Math.imul(F,Q)|0,i=Math.imul(F,ee),a=a+Math.imul(N,re)|0,n=n+Math.imul(N,ae)|0,n=n+Math.imul(L,re)|0,i=i+Math.imul(L,ae)|0,a=a+Math.imul(C,ie)|0,n=n+Math.imul(C,ce)|0,n=n+Math.imul(O,ie)|0,i=i+Math.imul(O,ce)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(P,de)|0,n=n+Math.imul(I,oe)|0,i=i+Math.imul(I,de)|0,a=a+Math.imul(S,ue)|0,n=n+Math.imul(S,be)|0,n=n+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0,a=a+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 Pe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,a=Math.imul(j,re),n=Math.imul(j,ae),n=n+Math.imul(F,re)|0,i=Math.imul(F,ae),a=a+Math.imul(N,ie)|0,n=n+Math.imul(N,ce)|0,n=n+Math.imul(L,ie)|0,i=i+Math.imul(L,ce)|0,a=a+Math.imul(C,oe)|0,n=n+Math.imul(C,de)|0,n=n+Math.imul(O,oe)|0,i=i+Math.imul(O,de)|0,a=a+Math.imul(P,ue)|0,n=n+Math.imul(P,be)|0,n=n+Math.imul(I,ue)|0,i=i+Math.imul(I,be)|0,a=a+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 Ie=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,a=Math.imul(j,ie),n=Math.imul(j,ce),n=n+Math.imul(F,ie)|0,i=Math.imul(F,ce),a=a+Math.imul(N,oe)|0,n=n+Math.imul(N,de)|0,n=n+Math.imul(L,oe)|0,i=i+Math.imul(L,de)|0,a=a+Math.imul(C,ue)|0,n=n+Math.imul(C,be)|0,n=n+Math.imul(O,ue)|0,i=i+Math.imul(O,be)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(P,pe)|0,n=n+Math.imul(I,le)|0,i=i+Math.imul(I,pe)|0;var Be=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,a=Math.imul(j,oe),n=Math.imul(j,de),n=n+Math.imul(F,oe)|0,i=Math.imul(F,de),a=a+Math.imul(N,ue)|0,n=n+Math.imul(N,be)|0,n=n+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0,a=a+Math.imul(C,le)|0,n=n+Math.imul(C,pe)|0,n=n+Math.imul(O,le)|0,i=i+Math.imul(O,pe)|0;var Ce=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,a=Math.imul(j,ue),n=Math.imul(j,be),n=n+Math.imul(F,ue)|0,i=Math.imul(F,be),a=a+Math.imul(N,le)|0,n=n+Math.imul(N,pe)|0,n=n+Math.imul(L,le)|0,i=i+Math.imul(L,pe)|0;var Oe=(d+a|0)+((8191&n)<<13)|0;d=(i+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,a=Math.imul(j,le),n=Math.imul(j,pe),n=n+Math.imul(F,le)|0,i=Math.imul(F,pe);var Re=(d+a|0)+((8191&n)<<13)|0;return d=(i+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,o[0]=xe,o[1]=me,o[2]=ve,o[3]=ge,o[4]=ye,o[5]=we,o[6]=Me,o[7]=_e,o[8]=ke,o[9]=Ae,o[10]=Se,o[11]=Ee,o[12]=Te,o[13]=Pe,o[14]=Ie,o[15]=Be,o[16]=Ce,o[17]=Oe,o[18]=Re,0!==d&&(o[19]=d,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var a=0,n=0,i=0;i>>26)|0,n+=c>>>26,c&=67108863}r.words[i]=f,a=c,c=n}return 0!==a?r.words[i]=a:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(v=m),i.prototype.mulTo=function(e,t){var r,a=this.length+e.length;return r=10===this.length&&10===e.length?v(this,e,t):a<63?m(this,e,t):a<1024?g(this,e,t):y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,a=0;a>=1;return a},w.prototype.permute=function(e,t,r,a,n,i){for(var c=0;c>>=1)n++;return 1<>>=13,r[2*c+1]=8191&i,i>>>=13;for(c=2*t;c>=26,r+=i/67108864|0,r+=c>>>26,this.words[n]=67108863&c}return 0!==r&&(this.words[n]=r,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 r=this,a=0;a=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var c=0;for(t=0;t>>26-r}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,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&f}return o&&0!==s&&(o.words[o.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},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){a("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,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(a("number"===typeof e),a(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)-(o/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===f)return this._strip();for(a(-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 r=this.length-e.length,a=this.clone(),n=e,c=0|n.words[n.length-1],f=this._countBits(c);r=26-f,0!==r&&(n=n.ushln(r),a.iushln(r),c=0|n.words[n.length-1]);var o,d=a.length-n.length;if("mod"!==t){o=new i(null),o.length=d+1,o.words=new Array(o.length);for(var s=0;s=0;b--){var h=67108864*(0|a.words[n.length+b])+(0|a.words[n.length+b-1]);h=Math.min(h/c|0,67108863),a._ishlnsubmul(n,h,b);while(0!==a.negative)h--,a.negative=0,a._ishlnsubmul(n,1,b),a.isZero()||(a.negative^=1);o&&(o.words[b]=h)}return o&&o._strip(),a._strip(),"div"!==t&&0!==r&&a.iushrn(r),{div:o||null,mod:a}},i.prototype.divmod=function(e,t,r){return a(!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(),r&&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(),r&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,a=e.ushrn(1),n=e.andln(1),i=r.cmp(a);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),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*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),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n=new i(1),c=new i(0),f=new i(0),o=new i(1),d=0;while(t.isEven()&&r.isEven())t.iushrn(1),r.iushrn(1),++d;var s=r.clone(),u=t.clone();while(!t.isZero()){for(var b=0,h=1;0===(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0){t.iushrn(b);while(b-- >0)(n.isOdd()||c.isOdd())&&(n.iadd(s),c.isub(u)),n.iushrn(1),c.iushrn(1)}for(var l=0,p=1;0===(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0){r.iushrn(l);while(l-- >0)(f.isOdd()||o.isOdd())&&(f.iadd(s),o.isub(u)),f.iushrn(1),o.iushrn(1)}t.cmp(r)>=0?(t.isub(r),n.isub(f),c.isub(o)):(r.isub(t),f.isub(n),o.isub(c))}return{a:f,b:o,gcd:r.iushln(d)}},i.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();var n,c=new i(1),f=new i(0),o=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var d=0,s=1;0===(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0){t.iushrn(d);while(d-- >0)c.isOdd()&&c.iadd(o),c.iushrn(1)}for(var u=0,b=1;0===(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0){r.iushrn(u);while(u-- >0)f.isOdd()&&f.iadd(o),f.iushrn(1)}t.cmp(r)>=0?(t.isub(r),c.isub(f)):(r.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(),r=e.clone();t.negative=0,r.negative=0;for(var a=0;t.isEven()&&r.isEven();a++)t.iushrn(1),r.iushrn(1);do{while(t.isEven())t.iushrn(1);while(r.isEven())r.iushrn(1);var n=t.cmp(r);if(n<0){var i=t;t=r,r=i}else if(0===n||0===r.cmpn(1))break;t.isub(r)}while(1);return r.iushln(a)},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){a("number"===typeof e);var t=e%26,r=(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,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var a=0|this.words[r],n=0|e.words[r];if(a!==n){an&&(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 T(e)},i.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return a(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 a(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return a(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 T(e){if("string"===typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){T.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,r=e;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),t=r.bitLength()}while(t>this.n);var a=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.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 r=4194303,a=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,r=0;r>>=26,e.words[r]=n,t=a}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},T.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){a(0===(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(s(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2===1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1),c=0;while(!n.isZero()&&0===n.andln(1))c++,n.iushrn(1);a(!n.isZero());var f=new i(1).toRed(this),o=f.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();s=new i(2*s*s).toRed(this);while(0!==this.pow(s,d).cmp(o))s.redIAdd(o);var u=this.pow(s,n),b=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();a(x=0;n--){for(var s=t.words[n],u=d-1;u>=0;u--){var b=s>>u&1;c!==a[0]&&(c=this.sqr(c)),0!==b||0!==f?(f<<=1,f|=b,o++,(o===r||0===n&&0===u)&&(c=this.mul(c,a[f]),o=0,f=0)):o=0}d=26}return c},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new P(e)},n(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),a=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(a).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)},P.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,r){"use strict";var a=r(44328).i8,n=r(36603),i=r(50170),c=r(329),f=r(98662),o=r(65579),d=r(92062),s=r(77802),u=function(){var e=this;n.packageInit(this,arguments),this.version=a,this.utils=s,this.eth=new i(this),this.shh=new o(this),this.bzz=new d(this);var t=this.setProvider;this.setProvider=function(r,a){return t.apply(e,arguments),e.eth.setRequestManager(e._requestManager),e.shh.setRequestManager(e._requestManager),e.bzz.setProvider(r),!0}};u.version=a,u.utils=s,u.modules={Eth:i,Net:c,Personal:f,Shh:o,Bzz:d},n.addProviders(u),e.exports=u},13977:function(e,t,r){var a;if(r(21703),"object"===typeof globalThis)a=globalThis;else try{a=r(7179)}catch(f){}finally{if(a||"undefined"===typeof window||(a=window),!a)throw new Error("Could not determine global this")}var n=a.WebSocket||a.MozWebSocket,i=r(6824);function c(e,t){var r;return r=t?new n(e,t):new n(e),r}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,r){e.exports=r(19794).version},12591:function(e,t,r){"use strict";var a=r(98625),n=r(24647),i=r(15477),c=i("Object.prototype.toString"),f=r(92582)(),o="undefined"===typeof globalThis?r.g:globalThis,d=n(),s=i("String.prototype.slice"),u={},b=r(82762),h=Object.getPrototypeOf;f&&b&&h&&a(d,(function(e){if("function"===typeof o[e]){var t=new o[e];if(Symbol.toStringTag in t){var r=h(t),a=b(r,Symbol.toStringTag);if(!a){var n=h(r);a=b(n,Symbol.toStringTag)}u[e]=a.get}}}));var l=function(e){var t=!1;return a(u,(function(r,a){if(!t)try{var n=r.call(e);n===a&&(t=n)}catch(i){}})),t},p=r(18300);e.exports=function(e){return!!p(e)&&(f&&Symbol.toStringTag in e?l(e):s(c(e),8,-1))}},13123:function(e,t,r){r(21703);var a=r(52606),n=r(27285),i=r(67293),c=r(3732),f=r(18196),o="application/json",d=function(){};function s(e,t,r){if(!e||"string"!==typeof e)throw new TypeError("must specify a URL");if("function"===typeof t&&(r=t,t={}),r&&"function"!==typeof r)throw new TypeError("expected cb to be undefined or a function");r=r||d,t=t||{};var s=t.json?"json":"text";t=i({responseType:s},t);var u=t.headers||{},b=(t.method||"GET").toUpperCase(),h=t.query;return h&&("string"!==typeof h&&(h=a.stringify(h)),e=n(e,h)),"json"===t.responseType&&c(u,"Accept",o),t.json&&"GET"!==b&&"HEAD"!==b&&(c(u,"Content-Type",o),t.body=JSON.stringify(t.body)),t.method=b,t.url=e,t.headers=u,delete t.query,delete t.json,f(t,r)}e.exports=s},3732:function(e){function t(e,t,r){var a=t.toLowerCase();e[t]||e[a]||(e[t]=r)}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,r){r(21703);var a=r(28470),n=r(18289),i=function(){};function c(e,t){delete e.uri;var r=!1;"json"===e.responseType&&(e.responseType="text",r=!0);var c=a(e,(function(a,c,f){if(r&&!a)try{var o=c.rawRequest.responseText;f=JSON.parse(o)}catch(d){a=d}c=n(e,c),t(a,a?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,r){"use strict";var a=r(58959),n=r(67293),i=r(52386);function c(e){switch(e.arrayFormat){case"index":return function(t,r,a){return null===r?[o(t,e),"[",a,"]"].join(""):[o(t,e),"[",o(a,e),"]=",o(r,e)].join("")};case"bracket":return function(t,r){return null===r?o(t,e):[o(t,e),"[]=",o(r,e)].join("")};default:return function(t,r){return null===r?o(t,e):[o(t,e),"=",o(r,e)].join("")}}}function f(e){var t;switch(e.arrayFormat){case"index":return function(e,r,a){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===a[e]&&(a[e]={}),a[e][t[1]]=r):a[e]=r};case"bracket":return function(e,r,a){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==a[e]?a[e]=[].concat(a[e],r):a[e]=[r]:a[e]=r};default:return function(e,t,r){void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}function o(e,t){return t.encode?t.strict?a(e):encodeURIComponent(e):e}function d(e){return Array.isArray(e)?e.sort():"object"===typeof e?d(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 u(e,t){t=n({arrayFormat:"none"},t);var r=f(t),a=Object.create(null);return"string"!==typeof e?a:(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),r(i(n),c,a)})),Object.keys(a).sort().reduce((function(e,t){var r=a[t];return Boolean(r)&&"object"===typeof r&&!Array.isArray(r)?e[t]=d(r):e[t]=r,e}),Object.create(null))):a)}t.extract=s,t.parse=u,t.stringify=function(e,t){var r={encode:!0,strict:!0,arrayFormat:"none"};t=n(r,t),!1===t.sort&&(t.sort=function(){});var a=c(t);return e?Object.keys(e).sort(t.sort).map((function(r){var n=e[r];if(void 0===n)return"";if(null===n)return o(r,t);if(Array.isArray(n)){var i=[];return n.slice().forEach((function(e){void 0!==e&&i.push(a(r,e,i.length))})),i.join("&")}return o(r,t)+"="+o(n,t)})).filter((function(e){return e.length>0})).join("&"):""},t.parseUrl=function(e,t){return{url:e.split("?")[0]||"",query:u(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,r){"use strict";r(21703);var a=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}}();Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t}(Error);t.SecurityError=n;var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t}(Error);t.InvalidStateError=i;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t}(Error);t.NetworkError=c;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t}(Error);t.SyntaxError=f},51283:function(e,t,r){"use strict";function a(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),a(r(78642));var n=r(43012);t.XMLHttpRequestEventTarget=n.XMLHttpRequestEventTarget},29810:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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=r},43012:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=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 r=this.listeners[e].indexOf(t.handleEvent||t);r<0||this.listeners[e].splice(r,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var r=0,a=this.listeners[t];r=0)return this._url=this._parseUrl(r.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=r,this._response.on("data",(function(e){return a._onHttpResponseData(r,e)})),this._response.on("end",(function(){return a._onHttpResponseEnd(r)})),this._response.on("close",(function(){return a._onHttpResponseClose(r)})),this.responseUrl=this._url.href.split("#")[0],this.status=r.statusCode,this.statusText=f.STATUS_CODES[this.status],this._parseResponseHeaders(r);var n=this._responseHeaders["content-length"]||"";this._totalBytes=+n,this._lengthComputable=!!n,this._setReadyState(t.HEADERS_RECEIVED)}},t.prototype._onHttpResponseData=function(e,r){this._response===e&&(this._responseParts.push(new n(r)),this._loadedBytes+=r.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 r=this._request;this._setError(),r.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,r){this._request===e&&(this._setError(),e.abort(),this._setReadyState(t.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},t.prototype._dispatchProgress=function(e){var r=new t.ProgressEvent(e);r.lengthComputable=this._lengthComputable,r.loaded=this._loadedBytes,r.total=this._totalBytes,this.dispatchEvent(r)},t.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},t.prototype._parseUrl=function(e,t,r){var a=null==this.nodejsBaseUrl?e:s.resolve(this.nodejsBaseUrl,e),n=s.parse(a,!1,!0);n.hash=null;var i=(n.auth||"").split(":"),c=i[0],f=i[1];return(c||f||t||r)&&(n.auth=(t||c||"")+":"+(r||f||"")),n},t.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var r=t.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=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),r=new Uint8Array(t),a=0;a0&&(l=setTimeout((function(){if(!u){u=!0,h.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",c(e)}}),e.timeout)),h.setRequestHeader)for(d in v)v.hasOwnProperty(d)&&h.setRequestHeader(d,v[d]);else if(e.headers&&!o(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 b(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(r){}return null}function h(){}e.exports=s,e.exports["default"]=s,s.XMLHttpRequest=a.XMLHttpRequest||h,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:a.XDomainRequest,f(["get","put","post","patch","head","delete"],(function(e){s["delete"===e?"del":e]=function(t,r,a){return r=d(t,r,a),r.method=e.toUpperCase(),u(r)}}))},57636:function(e){e.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var e={},r=0;r