PageSourceSearch

https://app.aevo.xyz/assets/ethers-chunk-C-GQfwuV.js

js aevo.xyz collected 2026-09-25 14:53:32 UTC 1,312,994 bytes, 12 lines download raw bytes

1var bi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function E6(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var a=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:function(){return r[n]}})}),e}const cd=globalThis||void 0||self;function A6(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var C2={exports:{}},yr=C2.exports={},_o,So;function dd(){throw new Error("setTimeout has not been defined")}function pd(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_o=setTimeout:_o=dd}catch{_o=dd}try{typeof clearTimeout=="function"?So=clearTimeout:So=pd}catch{So=pd}})();function O2(r){if(_o===setTimeout)return setTimeout(r,0);if((_o===dd||!_o)&&setTimeout)return _o=setTimeout,setTimeout(r,0);try{return _o(r,0)}catch{try{return _o.call(null,r,0)}catch{return _o.call(this,r,0)}}}function M6(r){if(So===clearTimeout)return clearTimeout(r);if((So===pd||!So)&&clearTimeout)return So=clearTimeout,clearTimeout(r);try{return So(r)}catch{try{return So.call(null,r)}catch{return So.call(this,r)}}}var nf=[],qs=!1,fs,hh=-1;function N6(){!qs||!fs||(qs=!1,fs.length?nf=fs.concat(nf):hh=-1,nf.length&&k2())}function k2(){if(!qs){var r=O2(N6);qs=!0;for(var t=nf.length;t;){for(fs=nf,nf=[];++hh<t;)fs&&fs[hh].run();hh=-1,t=nf.length}fs=null,qs=!1,M6(r)}}yr.nextTick=function(r){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];nf.push(new B2(r,t)),nf.length===1&&!qs&&O2(k2)};function B2(r,t){this.fun=r,this.array=t}B2.prototype.run=function(){this.fun.apply(null,this.array)};yr.title="browser";yr.browser=!0;yr.env={};yr.argv=[];yr.version="";yr.versions={};function gf(){}yr.on=gf;yr.addListener=gf;yr.once=gf;yr.off=gf;yr.removeListener=gf;yr.removeAllListeners=gf;yr.emit=gf;yr.prependListener=gf;yr.prependOnceListener=gf;yr.listeners=function(r){return[]};yr.binding=function(r){throw new Error("process.binding is not supported")};yr.cwd=function(){return"/"};yr.chdir=function(r){throw new Error("process.chdir is not supported")};yr.umask=function(){return 0};var _6=C2.exports;const xr=A6(_6);var Hr={},Wu={};Wu.byteLength=R6;Wu.toByteArray=P6;Wu.fromByteArray=k6;var Oo=[],hn=[],S6=typeof Uint8Array<"u"?Uint8Array:Array,Ul="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ns=0,I6=Ul.length;Ns<I6;++Ns)Oo[Ns]=Ul[Ns],hn[Ul.charCodeAt(Ns)]=Ns;hn[45]=62;hn[95]=63;function U2(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function R6(r){var t=U2(r),e=t[0],n=t[1];return(e+n)*3/4-n}function T6(r,t,e){return(t+e)*3/4-e}function P6(r){var t,e=U2(r),n=e[0],a=e[1],f=new S6(T6(r,n,a)),c=0,y=a>0?n-4:n,b;for(b=0;b<y;b+=4)t=hn[r.charCodeAt(b)]<<18|hn[r.charCodeAt(b+1)]<<12|hn[r.charCodeAt(b+2)]<<6|hn[r.charCodeAt(b+3)],f[c++]=t>>16&255,f[c++]=t>>8&255,f[c++]=t&255;return a===2&&(t=hn[r.charCodeAt(b)]<<2|hn[r.charCodeAt(b+1)]>>4,f[c++]=t&255),a===1&&(t=hn[r.charCodeAt(b)]<<10|hn[r.charCodeAt(b+1)]<<4|hn[r.charCodeAt(b+2)]>>2,f[c++]=t>>8&255,f[c++]=t&255),f}function C6(r){return Oo[r>>18&63]+Oo[r>>12&63]+Oo[r>>6&63]+Oo[r&63]}function O6(r,t,e){for(var n,a=[],f=t;f<e;f+=3)n=(r[f]<<16&16711680)+(r[f+1]<<8&65280)+(r[f+2]&255),a.push(C6(n));return a.join("")}function k6(r){for(var t,e=r.length,n=e%3,a=[],f=16383,c=0,y=e-n;c<y;c+=f)a.push(O6(r,c,c+f>y?y:c+f));return n===1?(t=r[e-1],a.push(Oo[t>>2]+Oo[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],a.push(Oo[t>>10]+Oo[t>>4&63]+Oo[t<<2&63]+"=")),a.join("")}var cp={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */cp.read=function(r,t,e,n,a){var f,c,y=a*8-n-1,b=(1<<y)-1,w=b>>1,E=-7,M=e?a-1:0,O=e?-1:1,F=r[t+M];for(M+=O,f=F&(1<<-E)-1,F>>=-E,E+=y;E>0;f=f*256+r[t+M],M+=O,E-=8);for(c=f&(1<<-E)-1,f>>=-E,E+=n;E>0;c=c*256+r[t+M],M+=O,E-=8);if(f===0)f=1-w;else{if(f===b)return c?NaN:(F?-1:1)*(1/0);c=c+Math.pow(2,n),f=f-w}return(F?-1:1)*c*Math.pow(2,f-n)};cp.write=function(r,t,e,n,a,f){var c,y,b,w=f*8-a-1,E=(1<<w)-1,M=E>>1,O=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:f-1,B=n?1:-1,L=t<0||t===0&&1
1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(y=isNaN(t)?1:0,c=E):(c=Math.floor(Math.log(t)/Math.LN2),t*(b=Math.pow(2,-c))<1&&(c--,b*=2),c+M>=1?t+=O/b:t+=O*Math.pow(2,1-M),t*b>=2&&(c++,b/=2),c+M>=E?(y=0,c=E):c+M>=1?(y=(t*b-1)*Math.pow(2,a),c=c+M):(y=t*Math.pow(2,M-1)*Math.pow(2,a),c=0));a>=8;r[e+F]=y&255,F+=B,y/=256,a-=8);for(c=c<<a|y,w+=a;w>0;r[e+F]=c&255,F+=B,c/=256,w-=8);r[e+F-B]|=L*128};/*!
2 * The buffer module from node.js, for the browser.
3 *
4 * @author   Feross Aboukhadijeh <https://feross.org>
5 * @license  MIT
6 */(function(r){const t=Wu,e=cp,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=E,r.SlowBuffer=Z,r.INSPECT_MAX_BYTES=50;const a=2147483647;r.kMaxLength=a;const{Uint8Array:f,ArrayBuffer:c,SharedArrayBuffer:y}=globalThis;E.TYPED_ARRAY_SUPPORT=b(),!E.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function b(){try{const k=new f(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,f.prototype),Object.setPrototypeOf(k,T),k.foo()===42}catch{return!1}}Object.defineProperty(E.prototype,"parent",{enumerable:!0,get:function(){if(E.isBuffer(this))return this.buffer}}),Object.defineProperty(E.prototype,"offset",{enumerable:!0,get:function(){if(E.isBuffer(this))return this.byteOffset}});function w(k){if(k>a)throw new RangeError('The value "'+k+'" is invalid for option "size"');const T=new f(k);return Object.setPrototypeOf(T,E.prototype),T}function E(k,T,R){if(typeof k=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(k)}return M(k,T,R)}E.poolSize=8192;function M(k,T,R){if(typeof k=="string")return L(k,T);if(c.isView(k))return q(k);if(k==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(Lt(k,c)||k&&Lt(k.buffer,c)||typeof y<"u"&&(Lt(k,y)||k&&Lt(k.buffer,y)))return V(k,T,R);if(typeof k=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const D=k.valueOf&&k.valueOf();if(D!=null&&D!==k)return E.from(D,T,R);const j=At(k);if(j)return j;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]=="function")return E.from(k[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 k)}E.from=function(k,T,R){return M(k,T,R)},Object.setPrototypeOf(E.prototype,f.prototype),Object.setPrototypeOf(E,f);function O(k){if(typeof k!="number")throw new TypeError('"size" argument must be of type number');if(k<0)throw new RangeError('The value "'+k+'" is invalid for option "size"')}function F(k,T,R){return O(k),k<=0?w(k):T!==void 0?typeof R=="string"?w(k).fill(T,R):w(k).fill(T):w(k)}E.alloc=function(k,T,R){return F(k,T,R)};function B(k){return O(k),w(k<0?0:St(k)|0)}E.allocUnsafe=function(k){return B(k)},E.allocUnsafeSlow=function(k){return B(k)};function L(k,T){if((typeof T!="string"||T==="")&&(T="utf8"),!E.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const R=Y(k,T)|0;let D=w(R);const j=D.write(k,T);return j!==R&&(D=D.slice(0,j)),D}function z(k){const T=k.length<0?0:St(k.length)|0,R=w(T);for(let D=0;D<T;D+=1)R[D]=k[D]&255;return R}function q(k){if(Lt(k,f)){const T=new f(k);return V(T.buffer,T.byteOffset,T.byteLength)}return z(k)}function V(k,T,R){if(T<0||k.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(k.byteLength<T+(R||0))throw new RangeError('"length" is outside of buffer bounds');let D;return T===void 0&&R===void 0?D=new f(k):R===void 0?D=new f(k,T):D=new f(k,T,R),Object.setPrototypeOf(D,E.prototype),D}function At(k){if(E.isBuffer(k)){const T=St(k.length)|0,R=w(T);return R.length===0||k.copy(R,0,0,T),R}if(k.length!==void 0)return typeof k.length!="number"||pt(k.length)?w(0):z(k);if(k.type==="Buffer"&&Array.isArray(k.data))return z(k.data)}function St(k){if(k>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return k|0}function Z(k){return+k!=k&&(k=0),E.alloc(+k)}E.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==E.prototype},E.compare=function(T,R){if(Lt(T,f)&&(T=E.from(T,T.offset,T.byteLength)),Lt(R,f)&&(R=E.from(R,R.offset,R.byteLength)),!E.isBuffer(T)||!E.isBuffer(R))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===R)return 0;let D=T.length,j=R.length;for(let H=0,W=Math.min(D,j);H<W;++H)if(T[H]!==R[H]){D=T[H],j=R[H];break}return D<j?-1:j<D?1:0},E.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},E.concat=function(T,R){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return E.alloc(0);let D;if(R===void 0)for(R=0,D=0;D<T.length;++D)R+=T[D].length;const j=E.allocUnsafe(R);let H=0;for(D=0;D<T.length;
6++D){let W=T[D];if(Lt(W,f))H+W.length>j.length?(E.isBuffer(W)||(W=E.from(W)),W.copy(j,H)):f.prototype.set.call(j,W,H);else if(E.isBuffer(W))W.copy(j,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return j};function Y(k,T){if(E.isBuffer(k))return k.length;if(c.isView(k)||Lt(k,c))return k.byteLength;if(typeof k!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);const R=k.length,D=arguments.length>2&&arguments[2]===!0;if(!D&&R===0)return 0;let j=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return R;case"utf8":case"utf-8":return dt(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R*2;case"hex":return R>>>1;case"base64":return gt(k).length;default:if(j)return D?-1:dt(k).length;T=(""+T).toLowerCase(),j=!0}}E.byteLength=Y;function Ct(k,T,R){let D=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((R===void 0||R>this.length)&&(R=this.length),R<=0)||(R>>>=0,T>>>=0,R<=T))return"";for(k||(k="utf8");;)switch(k){case"hex":return o(this,T,R);case"utf8":case"utf-8":return p(this,T,R);case"ascii":return x(this,T,R);case"latin1":case"binary":return l(this,T,R);case"base64":return h(this,T,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,T,R);default:if(D)throw new TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),D=!0}}E.prototype._isBuffer=!0;function Tt(k,T,R){const D=k[T];k[T]=k[R],k[R]=D}E.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let R=0;R<T;R+=2)Tt(this,R,R+1);return this},E.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let R=0;R<T;R+=4)Tt(this,R,R+3),Tt(this,R+1,R+2);return this},E.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let R=0;R<T;R+=8)Tt(this,R,R+7),Tt(this,R+1,R+6),Tt(this,R+2,R+5),Tt(this,R+3,R+4);return this},E.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?p(this,0,T):Ct.apply(this,arguments)},E.prototype.toLocaleString=E.prototype.toString,E.prototype.equals=function(T){if(!E.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:E.compare(this,T)===0},E.prototype.inspect=function(){let T="";const R=r.INSPECT_MAX_BYTES;return T=this.toString("hex",0,R).replace(/(.{2})/g,"$1 ").trim(),this.length>R&&(T+=" ... "),"<Buffer "+T+">"},n&&(E.prototype[n]=E.prototype.inspect),E.prototype.compare=function(T,R,D,j,H){if(Lt(T,f)&&(T=E.from(T,T.offset,T.byteLength)),!E.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(R===void 0&&(R=0),D===void 0&&(D=T?T.length:0),j===void 0&&(j=0),H===void 0&&(H=this.length),R<0||D>T.length||j<0||H>this.length)throw new RangeError("out of range index");if(j>=H&&R>=D)return 0;if(j>=H)return-1;if(R>=D)return 1;if(R>>>=0,D>>>=0,j>>>=0,H>>>=0,this===T)return 0;let W=H-j,Bt=D-R;const et=Math.min(W,Bt),X=this.slice(j,H),Ft=T.slice(R,D);for(let Q=0;Q<et;++Q)if(X[Q]!==Ft[Q]){W=X[Q],Bt=Ft[Q];break}return W<Bt?-1:Bt<W?1:0};function Rt(k,T,R,D,j){if(k.length===0)return-1;if(typeof R=="string"?(D=R,R=0):R>2147483647?R=2147483647:R<-2147483648&&(R=-2147483648),R=+R,pt(R)&&(R=j?0:k.length-1),R<0&&(R=k.length+R),R>=k.length){if(j)return-1;R=k.length-1}else if(R<0)if(j)R=0;else return-1;if(typeof T=="string"&&(T=E.from(T,D)),E.isBuffer(T))return T.length===0?-1:Dt(k,T,R,D,j);if(typeof T=="number")return T=T&255,typeof f.prototype.indexOf=="function"?j?f.prototype.indexOf.call(k,T,R):f.prototype.lastIndexOf.call(k,T,R):Dt(k,[T],R,D,j);throw new TypeError("val must be string, number or Buffer")}function Dt(k,T,R,D,j){let H=1,W=k.length,Bt=T.length;if(D!==void 0&&(D=String(D).toLowerCase(),D==="ucs2"||D==="ucs-2"||D==="utf16le"||D==="utf-16le")){if(k.length<2||T.length<2)return-1;H=2,W/=2,Bt/=2,R/=2}function et(Ft,Q){return H===1?Ft[Q]:Ft.readUInt16BE(Q*H)}let X;if(j){let Ft=-1;for(X=R;X<W;X++)if(et(k,X)===et(T,Ft===-1?0:X-Ft)){if(Ft===-1&&(Ft=X),X-Ft+1===Bt)return Ft*H}else Ft!==-1&&(X-=X-Ft),Ft=-1}else for(R+Bt>W&&(R=W-Bt),X=R;X>=0;X--){let Ft=!0;for(let Q=0;Q<Bt;Q++)if(et(k,X+Q)!==et(T,Q)){Ft=!1;break}if(Ft)return X}return-1}E.prototype.includes=function(T,R,D){return this.indexOf(T,R,D)!==-1},E.prototype.indexOf=function(T,R,D){return Rt(this,T,R,D,!0)},E.prototype.lastIndexOf=function(T,R,D){return Rt(this,T,R,D,!1)};function I(k,T,R,D){R=Number(R)||0;const j=k.length-R;D?(D=Number(D),D>j&&(D=j)):D=j;const H=T.length;D>H/2&&(D=H/2);let W;for(W=0;W<D;++W){const Bt=parseInt(T.substr(W*2,2),16);if(pt(Bt))return W;k[R+W]=Bt}return W}function N(k,T,R,D){return tt(dt(T,k.length-R),k,R,D)}function d(k,T,R,D){return tt(it(T),k,R,D)}function i(k,T,R,D){return tt(gt(T),k,R,D)}function s(k,T,R,D){return tt(Kt(T,k.length-R),k,R,D)}
6E.prototype.write=function(T,R,D,j){if(R===void 0)j="utf8",D=this.length,R=0;else if(D===void 0&&typeof R=="string")j=R,D=this.length,R=0;else if(isFinite(R))R=R>>>0,isFinite(D)?(D=D>>>0,j===void 0&&(j="utf8")):(j=D,D=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const H=this.length-R;if((D===void 0||D>H)&&(D=H),T.length>0&&(D<0||R<0)||R>this.length)throw new RangeError("Attempt to write outside buffer bounds");j||(j="utf8");let W=!1;for(;;)switch(j){case"hex":return I(this,T,R,D);case"utf8":case"utf-8":return N(this,T,R,D);case"ascii":case"latin1":case"binary":return d(this,T,R,D);case"base64":return i(this,T,R,D);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,R,D);default:if(W)throw new TypeError("Unknown encoding: "+j);j=(""+j).toLowerCase(),W=!0}},E.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h(k,T,R){return T===0&&R===k.length?t.fromByteArray(k):t.fromByteArray(k.slice(T,R))}function p(k,T,R){R=Math.min(k.length,R);const D=[];let j=T;for(;j<R;){const H=k[j];let W=null,Bt=H>239?4:H>223?3:H>191?2:1;if(j+Bt<=R){let et,X,Ft,Q;switch(Bt){case 1:H<128&&(W=H);break;case 2:et=k[j+1],(et&192)===128&&(Q=(H&31)<<6|et&63,Q>127&&(W=Q));break;case 3:et=k[j+1],X=k[j+2],(et&192)===128&&(X&192)===128&&(Q=(H&15)<<12|(et&63)<<6|X&63,Q>2047&&(Q<55296||Q>57343)&&(W=Q));break;case 4:et=k[j+1],X=k[j+2],Ft=k[j+3],(et&192)===128&&(X&192)===128&&(Ft&192)===128&&(Q=(H&15)<<18|(et&63)<<12|(X&63)<<6|Ft&63,Q>65535&&Q<1114112&&(W=Q))}}W===null?(W=65533,Bt=1):W>65535&&(W-=65536,D.push(W>>>10&1023|55296),W=56320|W&1023),D.push(W),j+=Bt}return v(D)}const m=4096;function v(k){const T=k.length;if(T<=m)return String.fromCharCode.apply(String,k);let R="",D=0;for(;D<T;)R+=String.fromCharCode.apply(String,k.slice(D,D+=m));return R}function x(k,T,R){let D="";R=Math.min(k.length,R);for(let j=T;j<R;++j)D+=String.fromCharCode(k[j]&127);return D}function l(k,T,R){let D="";R=Math.min(k.length,R);for(let j=T;j<R;++j)D+=String.fromCharCode(k[j]);return D}function o(k,T,R){const D=k.length;(!T||T<0)&&(T=0),(!R||R<0||R>D)&&(R=D);let j="";for(let H=T;H<R;++H)j+=nt[k[H]];return j}function g(k,T,R){const D=k.slice(T,R);let j="";for(let H=0;H<D.length-1;H+=2)j+=String.fromCharCode(D[H]+D[H+1]*256);return j}E.prototype.slice=function(T,R){const D=this.length;T=~~T,R=R===void 0?D:~~R,T<0?(T+=D,T<0&&(T=0)):T>D&&(T=D),R<0?(R+=D,R<0&&(R=0)):R>D&&(R=D),R<T&&(R=T);const j=this.subarray(T,R);return Object.setPrototypeOf(j,E.prototype),j};function C(k,T,R){if(k%1!==0||k<0)throw new RangeError("offset is not uint");if(k+T>R)throw new RangeError("Trying to access beyond buffer length")}E.prototype.readUintLE=E.prototype.readUIntLE=function(T,R,D){T=T>>>0,R=R>>>0,D||C(T,R,this.length);let j=this[T],H=1,W=0;for(;++W<R&&(H*=256);)j+=this[T+W]*H;return j},E.prototype.readUintBE=E.prototype.readUIntBE=function(T,R,D){T=T>>>0,R=R>>>0,D||C(T,R,this.length);let j=this[T+--R],H=1;for(;R>0&&(H*=256);)j+=this[T+--R]*H;return j},E.prototype.readUint8=E.prototype.readUInt8=function(T,R){return T=T>>>0,R||C(T,1,this.length),this[T]},E.prototype.readUint16LE=E.prototype.readUInt16LE=function(T,R){return T=T>>>0,R||C(T,2,this.length),this[T]|this[T+1]<<8},E.prototype.readUint16BE=E.prototype.readUInt16BE=function(T,R){return T=T>>>0,R||C(T,2,this.length),this[T]<<8|this[T+1]},E.prototype.readUint32LE=E.prototype.readUInt32LE=function(T,R){return T=T>>>0,R||C(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},E.prototype.readUint32BE=E.prototype.readUInt32BE=function(T,R){return T=T>>>0,R||C(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},E.prototype.readBigUInt64LE=$t(function(T){T=T>>>0,Gt(T,"offset");const R=this[T],D=this[T+7];(R===void 0||D===void 0)&&ct(T,this.length-8);const j=R+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+D*2**24;return BigInt(j)+(BigInt(H)<<BigInt(32))}),E.prototype.readBigUInt64BE=$t(function(T){T=T>>>0,Gt(T,"offset");const R=this[T],D=this[T+7];(R===void 0||D===void 0)&&ct(T,this.length-8);const j=R*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+D;return(BigInt(j)<<BigInt(32))+BigInt(H)}),E.prototype.readIntLE=function(T,R,D){T=T>>>0,R=R>>>0,D||C(T,R,this.length);let j=this[T],H=1,W=0;for(;
6++W<R&&(H*=256);)j+=this[T+W]*H;return H*=128,j>=H&&(j-=Math.pow(2,8*R)),j},E.prototype.readIntBE=function(T,R,D){T=T>>>0,R=R>>>0,D||C(T,R,this.length);let j=R,H=1,W=this[T+--j];for(;j>0&&(H*=256);)W+=this[T+--j]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*R)),W},E.prototype.readInt8=function(T,R){return T=T>>>0,R||C(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},E.prototype.readInt16LE=function(T,R){T=T>>>0,R||C(T,2,this.length);const D=this[T]|this[T+1]<<8;return D&32768?D|4294901760:D},E.prototype.readInt16BE=function(T,R){T=T>>>0,R||C(T,2,this.length);const D=this[T+1]|this[T]<<8;return D&32768?D|4294901760:D},E.prototype.readInt32LE=function(T,R){return T=T>>>0,R||C(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},E.prototype.readInt32BE=function(T,R){return T=T>>>0,R||C(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},E.prototype.readBigInt64LE=$t(function(T){T=T>>>0,Gt(T,"offset");const R=this[T],D=this[T+7];(R===void 0||D===void 0)&&ct(T,this.length-8);const j=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(D<<24);return(BigInt(j)<<BigInt(32))+BigInt(R+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),E.prototype.readBigInt64BE=$t(function(T){T=T>>>0,Gt(T,"offset");const R=this[T],D=this[T+7];(R===void 0||D===void 0)&&ct(T,this.length-8);const j=(R<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(j)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+D)}),E.prototype.readFloatLE=function(T,R){return T=T>>>0,R||C(T,4,this.length),e.read(this,T,!0,23,4)},E.prototype.readFloatBE=function(T,R){return T=T>>>0,R||C(T,4,this.length),e.read(this,T,!1,23,4)},E.prototype.readDoubleLE=function(T,R){return T=T>>>0,R||C(T,8,this.length),e.read(this,T,!0,52,8)},E.prototype.readDoubleBE=function(T,R){return T=T>>>0,R||C(T,8,this.length),e.read(this,T,!1,52,8)};function u(k,T,R,D,j,H){if(!E.isBuffer(k))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>j||T<H)throw new RangeError('"value" argument is out of bounds');if(R+D>k.length)throw new RangeError("Index out of range")}E.prototype.writeUintLE=E.prototype.writeUIntLE=function(T,R,D,j){if(T=+T,R=R>>>0,D=D>>>0,!j){const Bt=Math.pow(2,8*D)-1;u(this,T,R,D,Bt,0)}let H=1,W=0;for(this[R]=T&255;++W<D&&(H*=256);)this[R+W]=T/H&255;return R+D},E.prototype.writeUintBE=E.prototype.writeUIntBE=function(T,R,D,j){if(T=+T,R=R>>>0,D=D>>>0,!j){const Bt=Math.pow(2,8*D)-1;u(this,T,R,D,Bt,0)}let H=D-1,W=1;for(this[R+H]=T&255;--H>=0&&(W*=256);)this[R+H]=T/W&255;return R+D},E.prototype.writeUint8=E.prototype.writeUInt8=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,1,255,0),this[R]=T&255,R+1},E.prototype.writeUint16LE=E.prototype.writeUInt16LE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,2,65535,0),this[R]=T&255,this[R+1]=T>>>8,R+2},E.prototype.writeUint16BE=E.prototype.writeUInt16BE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,2,65535,0),this[R]=T>>>8,this[R+1]=T&255,R+2},E.prototype.writeUint32LE=E.prototype.writeUInt32LE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,4,4294967295,0),this[R+3]=T>>>24,this[R+2]=T>>>16,this[R+1]=T>>>8,this[R]=T&255,R+4},E.prototype.writeUint32BE=E.prototype.writeUInt32BE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,4,4294967295,0),this[R]=T>>>24,this[R+1]=T>>>16,this[R+2]=T>>>8,this[R+3]=T&255,R+4};function A(k,T,R,D,j){J(T,D,j,k,R,7);let H=Number(T&BigInt(4294967295));k[R++]=H,H=H>>8,k[R++]=H,H=H>>8,k[R++]=H,H=H>>8,k[R++]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return k[R++]=W,W=W>>8,k[R++]=W,W=W>>8,k[R++]=W,W=W>>8,k[R++]=W,R}function S(k,T,R,D,j){J(T,D,j,k,R,7);let H=Number(T&BigInt(4294967295));k[R+7]=H,H=H>>8,k[R+6]=H,H=H>>8,k[R+5]=H,H=H>>8,k[R+4]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return k[R+3]=W,W=W>>8,k[R+2]=W,W=W>>8,k[R+1]=W,W=W>>8,k[R]=W,R+8}E.prototype.writeBigUInt64LE=$t(function(T,R=0){return A(this,T,R,BigInt(0),BigInt("0xffffffffffffffff"))}),E.prototype.writeBigUInt64BE=$t(function(T,R=0){return S(this,T,R,BigInt(0),BigInt("0xffffffffffffffff"))}),E.prototype.writeIntLE=function(T,R,D,j){if(T=+T,R=R>>>0,!j){const et=Math.pow(2,8*D-1);u(this,T,R,D,et-1,-et)}let H=0,W=1,Bt=0;for(this[R]=T&255;++H<D&&(W*=256);)T<0&&Bt===0&&this[R+H-1]!==0&&(Bt=1),this[R+H]=(T/W>>0)-Bt&255;return R+D}
6,E.prototype.writeIntBE=function(T,R,D,j){if(T=+T,R=R>>>0,!j){const et=Math.pow(2,8*D-1);u(this,T,R,D,et-1,-et)}let H=D-1,W=1,Bt=0;for(this[R+H]=T&255;--H>=0&&(W*=256);)T<0&&Bt===0&&this[R+H+1]!==0&&(Bt=1),this[R+H]=(T/W>>0)-Bt&255;return R+D},E.prototype.writeInt8=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,1,127,-128),T<0&&(T=255+T+1),this[R]=T&255,R+1},E.prototype.writeInt16LE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,2,32767,-32768),this[R]=T&255,this[R+1]=T>>>8,R+2},E.prototype.writeInt16BE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,2,32767,-32768),this[R]=T>>>8,this[R+1]=T&255,R+2},E.prototype.writeInt32LE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,4,2147483647,-2147483648),this[R]=T&255,this[R+1]=T>>>8,this[R+2]=T>>>16,this[R+3]=T>>>24,R+4},E.prototype.writeInt32BE=function(T,R,D){return T=+T,R=R>>>0,D||u(this,T,R,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[R]=T>>>24,this[R+1]=T>>>16,this[R+2]=T>>>8,this[R+3]=T&255,R+4},E.prototype.writeBigInt64LE=$t(function(T,R=0){return A(this,T,R,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),E.prototype.writeBigInt64BE=$t(function(T,R=0){return S(this,T,R,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function _(k,T,R,D,j,H){if(R+D>k.length)throw new RangeError("Index out of range");if(R<0)throw new RangeError("Index out of range")}function P(k,T,R,D,j){return T=+T,R=R>>>0,j||_(k,T,R,4),e.write(k,T,R,D,23,4),R+4}E.prototype.writeFloatLE=function(T,R,D){return P(this,T,R,!0,D)},E.prototype.writeFloatBE=function(T,R,D){return P(this,T,R,!1,D)};function K(k,T,R,D,j){return T=+T,R=R>>>0,j||_(k,T,R,8),e.write(k,T,R,D,52,8),R+8}E.prototype.writeDoubleLE=function(T,R,D){return K(this,T,R,!0,D)},E.prototype.writeDoubleBE=function(T,R,D){return K(this,T,R,!1,D)},E.prototype.copy=function(T,R,D,j){if(!E.isBuffer(T))throw new TypeError("argument should be a Buffer");if(D||(D=0),!j&&j!==0&&(j=this.length),R>=T.length&&(R=T.length),R||(R=0),j>0&&j<D&&(j=D),j===D||T.length===0||this.length===0)return 0;if(R<0)throw new RangeError("targetStart out of bounds");if(D<0||D>=this.length)throw new RangeError("Index out of range");if(j<0)throw new RangeError("sourceEnd out of bounds");j>this.length&&(j=this.length),T.length-R<j-D&&(j=T.length-R+D);const H=j-D;return this===T&&typeof f.prototype.copyWithin=="function"?this.copyWithin(R,D,j):f.prototype.set.call(T,this.subarray(D,j),R),H},E.prototype.fill=function(T,R,D,j){if(typeof T=="string"){if(typeof R=="string"?(j=R,R=0,D=this.length):typeof D=="str
6ing"&&(j=D,D=this.length),j!==void 0&&typeof j!="string")throw new TypeError("encoding must be a string");if(typeof j=="string"&&!E.isEncoding(j))throw new TypeError("Unknown encoding: "+j);if(T.length===1){const W=T.charCodeAt(0);(j==="utf8"&&W<128||j==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(R<0||this.length<R||this.length<D)throw new RangeError("Out of range index");if(D<=R)return this;R=R>>>0,D=D===void 0?this.length:D>>>0,T||(T=0);let H;if(typeof T=="number")for(H=R;H<D;++H)this[H]=T;else{const W=E.isBuffer(T)?T:E.from(T,j),Bt=W.length;if(Bt===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<D-R;++H)this[H+R]=W[H%Bt]}return this};const $={};function U(k,T,R){$[k]=class extends R{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${k}]`,this.stack,delete this.name}get code(){return k}set code(j){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:j,writable:!0})}toString(){return`${this.name} [${k}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(k){return k?`${k} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(k,T){return`The "${k}" argument must be of type number. Received type ${typeof T}`},TypeError),U("ERR_OUT_OF_RANGE",function(k,T,R){let D=`The value of "${k}" is out of range.`,j=R;return Number.isInteger(R)&&Math.abs(R)>2**32?j=It(String(R)):typeof R=="bigint"&&(j=String(R),(R>BigInt(2)**BigInt(32)||R<-(BigInt(2)**BigInt(32)))&&(j=It(j)),j+="n"),D+=` It must be ${T}. Received ${j}`,D},RangeError);function It(k){let T="",R=k.length;const D=k[0]==="-"?1:0;for(;R>=D+4;R-=3)T=`_${k.slice(R-3,R)}${T}`;return`${k.slice(0,R)}${T}`}function G(k,T,R){Gt(T,"offset"),(k[T]===void 0||k[T+R]===void 0)&&ct(T,k.length-(R+1))}function J(k,T,R,D,j,H){if(k>R||k<T){const W=typeof T=="bigint"?"n":"";let Bt;throw T===0||T===BigInt(0)?Bt=`>= 0${W} and < 2${W} ** ${(H+1)*8}${W}`:Bt=`>= -(2${W} ** ${(H+1)*8-1}${W}) and < 2 ** ${(H+1)*8-1}${W}`,new $.ERR_OUT_OF_RANGE("value",Bt,k)}G(D,j,H)}function Gt(k,T){if(typeof k!="number")throw new $.ERR_INVALID_ARG_TYPE(T,"number",k)}function ct(k,T,R){throw Math.floor(k)!==k?(Gt(k,R),new $.ERR_OUT_OF_RANGE("offset","an integer",k)):T<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${T}`,k)}const rt=/[^+/0-9A-Za-z-_]/g;function qt(k){if(k=k.split("=")[0],k=k.trim().replace(rt,""),k.length<2)return"";for(;k.length%4!==0;)k=k+"=";return k}function dt(k,T){T=T||1/0;let R;const D=k.length;let j=null;const H=[];for(let W=0;W<D;++W){if(R=k.charCodeAt(W),R>
655295&&R<57344){if(!j){if(R>56319){(T-=3)>-1&&H.push(239,191,189);continue}else if(W+1===D){(T-=3)>-1&&H.push(239,191,189);continue}j=R;continue}if(R<56320){(T-=3)>-1&&H.push(239,191,189),j=R;continue}R=(j-55296<<10|R-56320)+65536}else j&&(T-=3)>-1&&H.push(239,191,189);if(j=null,R<128){if((T-=1)<0)break;H.push(R)}else if(R<2048){if((T-=2)<0)break;H.push(R>>6|192,R&63|128)}else if(R<65536){if((T-=3)<0)break;H.push(R>>12|224,R>>6&63|128,R&63|128)}else if(R<1114112){if((T-=4)<0)break;H.push(R>>18|240,R>>12&63|128,R>>6&63|128,R&63|128)}else throw new Error("Invalid code point")}return H}function it(k){const T=[];for(let R=0;R<k.length;++R)T.push(k.charCodeAt(R)&255);return T}function Kt(k,T){let R,D,j;const H=[];for(let W=0;W<k.length&&!((T-=2)<0);++W)R=k.charCodeAt(W),D=R>>8,j=R%256,H.push(j),H.push(D);return H}function gt(k){return t.toByteArray(qt(k))}function tt(k,T,R,D){let j;for(j=0;j<D&&!(j+R>=T.length||j>=k.length);++j)T[j+R]=k[j];return j}function Lt(k,T){return k instanceof T||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===T.name}function pt(k){return k!==k}const nt=function(){const k="0123456789abcdef",T=new Array(256);for(let R=0;R<16;++R){const D=R*16;for(let j=0;j<16;++j)T[D+j]=k[R]+k[j]}return T}();function $t(k){return typeof BigInt>"u"?mt:k}function mt(){throw new Error("BigInt not supported")}})(Hr);const B6=Hr.Buffer,U6=Hr.Blob,F6=Hr.BlobOptions,D6=Hr.Buffer,L6=Hr.File,$6=Hr.FileOptions,G6=Hr.INSPECT_MAX_BYTES,z6=Hr.SlowBuffer,q6=Hr.TranscodeEncoding,K6=Hr.atob,H6=Hr.btoa,W6=Hr.constants,J6=Hr.isAscii,V6=Hr.isUtf8,j6=Hr.kMaxLength,X6=Hr.kStringMaxLength,Z6=Hr.resolveObjectURL,Q6=Hr.transcode,Y6=Object.freeze(Object.defineProperty({__proto__:null,Blob:U6,BlobOptions:F6,Buffer:D6,File:L6,FileOptions:$6,INSPECT_MAX_BYTES:G6,SlowBuffer:z6,TranscodeEncoding:q6,atob:K6,btoa:H6,constants:W6,default:B6,isAscii:J6,isUtf8:V6,kMaxLength:j6,kStringMaxLength:X6,resolveObjectURL:Z6,transcode:Q6},Symbol.toStringTag,{value:"Module"}));var dp={exports:{}};const mf=E6(Y6);dp.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};
vendor: 36,417 bytes, line 6
6function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
6function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(dp);var tE=dp.exports;const eE=Nr(tE),rE="logger/5.7.0";let eg=!1,rg=!1;const uh={debug:1,default:2,info:2,warning:3,error:4,off:5};let ig=uh.default,Fl=null;function iE(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const ng=iE();var gd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(gd||(gd={}));var Jn;
6(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Jn||(Jn={}));const og="0123456789abcdef";let _t=class _r{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();uh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(ig>uh[n])&&console.log.apply(console,e)}debug(...t){this._log(_r.levels.DEBUG,t)}info(...t){this._log(_r.levels.INFO,t)}warn(...t){this._log(_r.levels.WARNING,t)}makeError(t,e,n){if(rg)return this.makeError("censored error",e,{});e||(e=_r.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=og[w[M]>>4],E+=og[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case Jn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Jn.CALL_EXCEPTION:case Jn.INSUFFICIENT_FUNDS:case Jn.MISSING_NEW:case Jn.NONCE_EXPIRED:case Jn.REPLACEMENT_UNDERPRICED:case Jn.TRANSACTION_REPLACED:case Jn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,_r.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){ng&&this.throwError("platform missing String.prototype.normalize",_r.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ng})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,_r.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,_r.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,_r.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,_r.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",_r.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",_r.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",_r.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Fl||(Fl=new _r(rE)),Fl}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",_r.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),eg){if(!t)return;this.globalLogger().throwError("error censorship permanent",_r.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}rg=!!t,eg=!!e}static setLogLevel(t){const e=uh[t.toLowerCase()];if(e==null){_r.globalLogger().warn("invalid log level - "+t);return}ig=e}static from(t){return new _r(t)}};_t.errors=Jn;_t.levels=gd;const nE="bytes/5.7.0",hr=new _t(nE);function F2(r){return!!r.toHexString}function Ks(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Ks(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function Ju(r){return xe(r)&&!(r.length%2)||c0(r)}function fg(r){return typeof r=="number"&&r==r&&r%1===0}function c0(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
6if(typeof r=="string"||!fg(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!fg(e)||e<0||e>=256)return!1}return!0}function kt(r,t){if(t||(t={}),typeof r=="number"){hr.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Ks(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),F2(r)&&(r=r.toHexString()),xe(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":hr.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Ks(new Uint8Array(n))}return c0(r)?Ks(new Uint8Array(r)):hr.throwArgumentError("invalid arrayify value","value",r)}function Ve(r){const t=r.map(a=>kt(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),Ks(n)}function hf(r){let t=kt(r);if(t.length===0)return t;let e=0;for(;e<t.length&&t[e]===0;)e++;return e&&(t=t.slice(e)),t}function lh(r,t){r=kt(r),r.length>t&&hr.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),Ks(e)}function xe(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const Dl="0123456789abcdef";function Ut(r,t){if(t||(t={}),typeof r=="number"){hr.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Dl[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),F2(r))return r.toHexString();if(xe(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":hr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(c0(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Dl[(a&240)>>4]+Dl[a&15]}return e}return hr.throwArgumentError("invalid hexlify value","value",r)}function cs(r){if(typeof r!="string")r=Ut(r);else if(!xe(r)||r.length%2)return null;return(r.length-2)/2}function Ar(r,t,e){return typeof r!="string"?r=Ut(r):(!xe(r)||r.length%2)&&hr.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function Mi(r){let t="0x";return r.forEach(e=>{t+=Ut(e).substring(2)}),t}function pp(r){const t=oE(Ut(r,{hexPad:"left"}));return t==="0x"?"0x0":t}function oE(r){typeof r!="string"&&(r=Ut(r)),xe(r)||hr.throwArgumentError("invalid hex string","value",r),r=r.substring(2);let t=0;for(;t<r.length&&r[t]==="0";)t++;return"0x"+r.substring(t)}function Qe(r,t){for(typeof r!="string"?r=Ut(r):xe(r)||hr.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&hr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function d0(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ju(r)){let e=kt(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=Ut(e.slice(0,32)),t.s=Ut(e.slice(32,64))):e.length===65?(t.r=Ut(e.slice(0,32)),t.s=Ut(e.slice(32,64)),t.v=e[64]):hr.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:hr.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=Ut(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const a=lh(kt(t._vs),32);t._vs=Ut(a);const f=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=f:t.recoveryParam!==f&&hr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),a[0]&=127;const c=Ut(a);t.s==null?t.s=c:t.s!==c&&hr.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?hr.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&hr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!xe(t.r)?hr.throwArgumentError("signature missing or invalid r","signature",r):t.r=Qe(t.r,32),t.s==null||!xe(t.s)?hr.throwArgumentError("signature missing or invalid s","signature",r):t.s=Qe(t.s,32);const e=kt(t.s);e[0]>=128&&hr.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=Ut(e);t._vs&&(xe(t._vs)||hr.throwArgumentError("signature invalid _vs","signature",r),t._vs=Qe(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&hr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function sg(r){return r=d0(r),Ut(Ve([r.r,r.s,r.recoveryParam?"0x1c":"0x1b"]))}const D2="bignumber/5.7.0";var ou=eE.BN;const Wo=new _t(D2),Ll={},ag=9007199254740991;function fE(r){return r!=null&&(zt.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||xe(r)||typeof r=="bigint"||c0(r))}let hg=!1,zt=class Fn{constructor(t,e){t!==Ll&&Wo.throwError("cannot call constructor directly; use BigNumber.from",_t.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return _i(ye(this).fromTwos(t))}toTwos(t){return _i(ye(this).toTwos(t))}abs(){return this._hex[0]==="-"?Fn.from(this._hex.substring(1)):this}add(t){return _i(ye(this).add(ye(t)))}sub(t){return _i(ye(this).sub(ye(t)))}div(t){return Fn.from(t).isZero()&&Qi("division-by-zero","div"),_i(ye(this).div(ye(t)))}mul(t){return _i(ye(this).mul(ye(t)))}mod(t){const e=ye(t);return e.isNeg()&&Qi("division-by-zero","mod"),_i(ye(this).umod(e))}pow(t){const e=ye(t);return e.isNeg()&&Qi("negative-power","pow"),_i(ye(this).pow(e))}and(t){const e=ye(t);return(this.isNegative()||e.isNeg())&&Qi("unbound-bitwise-result","and"),_i(ye(this).and(e))}or(t){const e=ye(t);return(this.isNegative()||e.isNeg())&&Qi("unbound-bitwise-result","or"),_i(ye(this).or(e))}xor(t){const e=ye(t);return(this.isNegative()||e.isNeg())&&Qi("unbound-bitwise-result","xor"),_i(ye(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&Qi("negative-width","mask"),_i(ye(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Qi("negative-width","shl"),_i(ye(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Qi("negative-width","shr"),_i(ye(this).shrn(t))}eq(t){return ye(this).eq(ye(t))}lt(t){return ye(this).lt(ye(t))}lte(t){return ye(this).lte(ye(t))}gt(t){return ye(this).gt(ye(t))}gte(t){return ye(this).gte(ye(t))}isNegative(){return this._hex[0]==="-"}isZero(){return ye(this).isZero()}toNumber(){try{return ye(this).toNumber()}catch{Qi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Wo.throwError("this platform does not support BigInt",_t.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?hg||(hg=!0,Wo.warn("BigNumber.toString does not accept any parameters;
6 base-10 is assumed")):arguments[0]===16?Wo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",_t.errors.UNEXPECTED_ARGUMENT,{}):Wo.throwError("BigNumber.toString does not accept parameters",_t.errors.UNEXPECTED_ARGUMENT,{})),ye(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Fn)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new Fn(Ll,aa(t)):t.match(/^-?[0-9]+$/)?new Fn(Ll,aa(new ou(t))):Wo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&Qi("underflow","BigNumber.from",t),(t>=ag||t<=-ag)&&Qi("overflow","BigNumber.from",t),Fn.from(String(t));const e=t;if(typeof e=="bigint")return Fn.from(e.toString());if(c0(e))return Fn.from(Ut(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return Fn.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(xe(n)||n[0]==="-"&&xe(n.substring(1))))return Fn.from(n)}return Wo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function aa(r){if(typeof r!="string")return aa(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Wo.throwArgumentError("invalid hex","value",r),r=aa(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function _i(r){return zt.from(aa(r))}function ye(r){const t=zt.from(r).toHexString();return t[0]==="-"?new ou("-"+t.substring(3),16):new ou(t.substring(2),16)}function Qi(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),Wo.throwError(r,_t.errors.NUMERIC_FAULT,n)}function sE(r){return new ou(r,36).toString(16)}const Ni=new _t(D2),X0={},L2=zt.from(0),$2=zt.from(-1);function G2(r,t,e,n){const a={fault:t,operation:e};return n!==void 0&&(a.value=n),Ni.throwError(r,_t.errors.NUMERIC_FAULT,a)}let Z0="0";for(;Z0.length<256;)Z0+=Z0;function gp(r){if(typeof r!="number")try{r=zt.from(r).toNumber()}catch{}return typeof r=="number"&&r>=0&&r<=256&&!(r%1)?"1"+Z0.substring(0,r):Ni.throwArgumentError("invalid decimal size","decimals",r)}function ch(r,t){t==null&&(t=0);const e=gp(t);r=zt.from(r);const n=r.lt(L2);
6n&&(r=r.mul($2));let a=r.mod(e).toString();for(;a.length<e.length-1;)a="0"+a;a=a.match(/^([0-9]*[1-9]|0)(0*)/)[1];const f=r.div(e).toString();return e.length===1?r=f:r=f+"."+a,n&&(r="-"+r),r}function Ao(r,t){t==null&&(t=0);const e=gp(t);(typeof r!="string"||!r.match(/^-?[0-9.]+$/))&&Ni.throwArgumentError("invalid decimal value","value",r);const n=r.substring(0,1)==="-";n&&(r=r.substring(1)),r==="."&&Ni.throwArgumentError("missing value","value",r);const a=r.split(".");a.length>2&&Ni.throwArgumentError("too many decimal points","value",r);let f=a[0],c=a[1];for(f||(f="0"),c||(c="0");c[c.length-1]==="0";)c=c.substring(0,c.length-1);for(c.length>e.length-1&&G2("fractional component exceeds decimals","underflow","parseFixed"),c===""&&(c="0");c.length<e.length-1;)c+="0";const y=zt.from(f),b=zt.from(c);let w=y.mul(e).add(b);return n&&(w=w.mul($2)),w}class Hs{constructor(t,e,n,a){t!==X0&&Ni.throwError("cannot use FixedFormat constructor; use FixedFormat.from",_t.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=e,this.width=n,this.decimals=a,this.name=(e?"":"u")+"fixed"+String(n)+"x"+String(a),this._multiplier=gp(a),Object.freeze(this)}static from(t){if(t instanceof Hs)return t;typeof t=="number"&&(t=`fixed128x${t}`);let e=!0,n=128,a=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")e=!1;else{const f=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);f||Ni.throwArgumentError("invalid fixed format","format",t),e=f[1]!=="u",n=parseInt(f[2]),a=parseInt(f[3])}}else if(t){const f=(c,y,b)=>t[c]==null?b:(typeof t[c]!==y&&Ni.throwArgumentError("invalid fixed format ("+c+" not "+y+")","format."+c,t[c]),t[c]);e=f("signed","boolean",e),n=f("width","number",n),a=f("decimals","number",a)}return n%8&&Ni.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),a>80&&Ni.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",a),new Hs(X0,e,n,a)}}class Yr{constructor(t,e,n,a){t!==X0&&Ni.throwError("cannot use FixedNumber constructor; use FixedNumber.from",_t.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=a,this._hex=e,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&Ni.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const e=Ao(this._value,this.format.decimals),n=Ao(t._value,t.format.decimals);return Yr.fromValue(e.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const e=Ao(this._value,this.format.decimals),n=Ao(t._value,t.format.decimals);return Yr.fromValue(e.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const e=Ao(this._value,this.format.decimals),n=Ao(t._value,t.format.decimals);return Yr.fromValue(e.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const e=Ao(this._value,this.format.decimals),n=Ao(t._value,t.format.decimals);return Yr.fromValue(e.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");t.length===1&&t.push("0");let e=Yr.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(e=e.subUnsafe(ug.toFormat(e.format))),e}ceiling(){const t=this.toString().split(".");t.length===1&&t.push("0");let e=Yr.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(e=e.addUnsafe(ug.toFormat(e.format))),e}round(t){t==null&&(t=0);const e=this.toString().split(".");if(e.length===1&&e.push("0"),(t<0||t>80||t%1)&&Ni.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;const n=Yr.from("1"+Z0.substring(0,t),this.format),a=aE.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(a).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(t){if(t==null)return this._hex;t%8&&Ni.throwArgumentError("invalid byte width","width",t);const e=zt.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return Qe(e,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return Yr.fromString(this._value,t)}static fromValue(t,e,n){return n==null&&e!=null&&!fE(e)&&(n=e,e=null),e==null&&(e=0),n==null&&(n="fixed"),Yr.fromString(ch(t,e),Hs.from(n))}static fromString(t,e){e==null&&(e="fixed");const n=Hs.from(e),a=Ao(t,n.decimals);!n.signed&&a.lt(L2)&&G2("unsigned value cannot be negative","overflow","value",t);let f=null;n.signed?f=a.toTwos(n.width).toHexString():(f=a.toHexString(),f=Qe(f,n.width/8));const c=ch(a,n.decimals);return new Yr(X0,f,c,n)}static fromBytes(t,e){e==null&&(e="fixed");const n=Hs.from(e);if(kt(t).length>n.width/8)throw new Error("overflow");let a=zt.from(t);n.signed&&(a=a.fromTwos(n.width));const f=a.toTwos((n.signed?0:1)+n.width).toHexString(),c=ch(a,n.decimals);return new Yr(X0,f,c,n)}static from(t,e){if(typeof t=="string")return Yr.fromString(t,e);if(c0(t))return Yr.fromBytes(t,e);try{return Yr.fromValue(t,0,e)}catch(n){if(n.code!==_t.errors.INVALID_ARGUMENT)throw n}return Ni.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}const ug=Yr.from(1),aE=Yr.from("0.5"),hE="properties/5.7.0";var uE=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const fu=new _t(hE);function Pt(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function Bi(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}function gr(r){return uE(this,void 0,void 0,function*(){const t=Object.keys(r).map(n=>{const a=r[n];return Promise.resolve(a).then(f=>({key:n,value:f}))});return(yield Promise.all(t)).reduce((n,a)=>(n[a.key]=a.value,n),{})})}function z2(r,t){(!r||typeof r!="object")&&fu.throwArgumentError("invalid object","object",r),Object.keys(r).forEach(e
6=>{t[e]||fu.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)})}function Jr(r){const t={};for(const e in r)t[e]=r[e];return t}const lE={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function q2(r){if(r==null||lE[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!q2(n))return!1}return!0}return fu.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function cE(r){if(q2(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>lf(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&Pt(t,e,lf(n))}return t}return fu.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function lf(r){return cE(r)}let Wi=class{constructor(t){for(const e in t)this[e]=lf(t[e])}};const Fa="abi/5.4.0",Ge=new _t(Fa),ds={};let lg={calldata:!0,memory:!0,storage:!0},dE={calldata:!0,memory:!0};function Xa(r,t){if(r==="bytes"||r==="string"){if(lg[t])return!0}else if(r==="address"){if(t==="payable")return!0}else if((r.indexOf("[")>=0||r==="tuple")&&dE[t])return!0;return(lg[t]||t==="payable")&&Ge.throwArgumentError("invalid modifier","name",t),!1}function pE(r,t){let e=r;function n(y){Ge.throwArgumentError(`unexpected character at position ${y}`,"param",r)}r=r.replace(/\s/g," ");function a(y){let b={type:"",name:"",parent:y,state:{allowType:!0}};return t&&(b.indexed=!1),b}let f={type:"",name:"",state:{allowType:!0}},c=f;for(let y=0;y<r.length;y++){let b=r[y];switch(b){case"(":c.state.allowType&&c.type===""?c.type="tuple":c.state.allowParams||n(y),c.state.allowType=!1,c.type=Bs(c.type),c.components=[a(c)],c=c.components[0];break;case")":delete c.state,c.name==="indexed"&&(t||n(y),c.indexed=!0,c.name=""),Xa(c.type,c.name)&&(c.name=""),c.type=Bs(c.type);let w=c;c=c.parent,c||n(y),delete w.parent,c.state.allowParams=!1,c.state.allowName=!0,c.state.allowArray=!0;break;case",":delete c.state,c.name==="indexed"&&(t||n(y),c.indexed=!0,c.name=""),Xa(c.type,c.name)&&(c.name=""),c.type=Bs(c.type);let E=a(c.parent);c.parent.components.push(E),delete c.parent,c=E;break;case" ":c.state.allowType&&c.type!==""&&(c.type=Bs(c.type),delete c.state.allowType,c.state.allowName=!0,c.state.allowParams=!0),c.state.allowName&&c.name!==""&&(c.name==="indexed"?(t||n(y),c.indexed&&n(y),c.indexed=!0,c.name=""):Xa(c.type,c.name)?c.name="":c.state.allowName=!1);break;case"[":c.state.allowArray||n(y),c.type+=b,c.state.allowArray=!1,c.state.allowName=!1,c.state.readArray=!0;break;case"]":c.state.readArray||n(y),c.type+=b,c.state.readArray=!1,c.state.allowArray=!0,c.state.allowName=!0;break;default:c.state.allowType?(c.type+=b,c.state.allowParams=!0,c.state.allowArray=!0):c.state.allowName?(c.name+=b,delete c.state.allowArray):c.state.readArray?c.type+=b:n(y)}}return c.parent&&Ge.throwArgumentError("unexpected eof","param",r),delete f.state,c.name==="indexed"?(t||n(e.length-7),c.indexed&&n(e.length-7),c.indexed=!0,c.name=""):Xa(c.type,c.name)&&(c.name=""),f.type=Bs(f.type),f}function dh(r,t){for(let e in t)Pt(r,e,t[e])}const qe=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),gE=new RegExp(/^(.*)\[([0-9]*)\]$/);let dn=class Nf{constructor(t,e){t!==ds&&Ge.throwError("use fromString",_t.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),dh(this,e);let n=this.type.match(gE);n?dh(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Nf.fromObject({type:n[1],components:this.components}),baseType:"array"}):dh(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=qe.sighash),qe[t]||Ge.throwArgumentError("invalid format type","format",t),t===qe.json){let n={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(n)}let e="";return this.baseType==="array"?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(t!==qe.sighash&&(e+=this.type),e+="("+this.components.map(n=>n.format(t)).join(t===qe.full?", ":",")+")"):e+=this.type,t!==qe.sighash&&(this.indexed===!0&&(e+=" indexed"),t===qe.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return typeof t=="string"?Nf.fromString(t,e):Nf.fromObject(t)}static fromObject(t){return Nf.isParamType(t)?t:new Nf(ds,{name:t.name||null,type:Bs(t.type),indexed:t.indexed==null?null:!!t.indexed,components:t.components?t.components.map(Nf.fromObject):null})}static fromString(t,e){function n(a){return Nf.fromObject({name:a.name,type:a.type,indexed:a.indexed,components:a.components})}return n(pE(t,!!e))}static isParamType(t){return!!(t!=null&&t._isParamType)}};function ha(r,t){return vE(r).map(e=>dn.fromString(e,t))}let p0=class G0{constructor(t,e){t!==ds&&Ge.throwError("use a static from method",_t.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),dh(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return G0.isFragment(t)?t:typeof t=="string"?G0.fromString(t):G0.fromObject(t)}static fromObject(t){if(G0.isFragment(t))return t;switch(t.type){case"function":return n0.fromObject(t);case"event":return ua.fromObject(t);case"constructor":return i0.fromObject(t);case"error":return su.fromObject(t);case"fallback":case"receive":return null}return Ge.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return t=t.replace(/\s/g," "),t=t.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),t=t.trim(),t.split(" ")[0]==="event"?ua.fromString(t.substring(5).trim()):t.split(" ")[0]==="function"?n0.fromString(t.substring(8).trim()):t.split("(")[0].trim()==="constructor"?i0.fromString(t.trim()):t.split(" ")[0]==="error"?su.fromString(t.substring(5).trim()):Ge.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}},ua=class Ps extends p0{format(t){if(t||(t=qe.sighash),qe[t]||Ge.throwArgumentError("invalid format type","format",t),t===qe.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let e="";return t!==qe.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===qe.full?", ":",")+") ",t!==qe.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return typeof t=="string"?Ps.fromString(t):Ps.fromObject(t)}static fromObject(t){if(Ps.isEventFragment(t))return t;t.type!=="event"&&Ge.throwArgumentError("invalid event object","value",t);const e={name:la(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(dn.fromObject):[],type:"event"};return new Ps(ds,e)}static fromString(t){let e=t.match(ca);e||Ge.throwArgumentError("invalid event string","value",t);let n=!1;return e[3].split(" ").forEach(a=>{switch(a.trim()){case"anonymous":n=!0;break;case"":break;default:Ge.warn("unknown modifier: "+a)}}),Ps.fromObject({name:e[1].trim(),anonymous:n,inputs:ha(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&t.type==="event"}};function K2(r,t){t.gas=null;let e=r.split("@");return e.length!==1?(e.length>2&&Ge.throwArgumentError("invalid human-readable ABI signature","value",r),e[1].match(/^[0-9]+$/)||Ge.throwArgumentError("invalid human-readable ABI signature gas","value",r),t.gas=zt.from(e[1]),e[0]):r}function H2(r,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",r.split(" ").forEach(e
6=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:""+e}})}function W2(r){let t={constant:!1,payable:!0,stateMutability:"payable"};return r.stateMutability!=null?(t.stateMutability=r.stateMutability,t.constant=t.stateMutability==="view"||t.stateMutability==="pure",r.constant!=null&&!!r.constant!==t.constant&&Ge.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",r),t.payable=t.stateMutability==="payable",r.payable!=null&&!!r.payable!==t.payable&&Ge.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",r)):r.payable!=null?(t.payable=!!r.payable,r.constant==null&&!t.payable&&r.type!=="constructor"&&Ge.throwArgumentError("unable to determine stateMutability","value",r),t.constant=!!r.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Ge.throwArgumentError("cannot have constant payable function","value",r)):r.constant!=null?(t.constant=!!r.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):r.type!=="constructor"&&Ge.throwArgumentError("unable to determine stateMutability","value",r),t}let i0=class Cs extends p0{format(t){if(t||(t=qe.sighash),qe[t]||Ge.throwArgumentError("invalid format type","format",t),t===qe.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});t===qe.sighash&&Ge.throwError("cannot format a constructor for sighash",_t.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map(n=>n.format(t)).join(t===qe.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(e+=this.stateMutability+" "),e.trim()}static from(t){return typeof t=="string"?Cs.fromString(t):Cs.fromObject(t)}static fromObject(t){if(Cs.isConstructorFragment(t))return t;t.type!=="constructor"&&Ge.throwArgumentError("invalid constructor object","value",t);let e=W2(t);e.constant&&Ge.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(dn.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?zt.from(t.gas):null};return new Cs(ds,n)}static fromString(t){let e={type:"constructor"};t=K2(t,e);let n=t.match(ca);return(!n||n[1].trim()!=="constructor")&&Ge.throwArgumentError("invalid constructor string","value",t),e.inputs=ha(n[2].trim(),!1),H2(n[3].trim(),e),Cs.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&t.type==="constructor"}},n0=class Os extends i0{format(t){if(t||(t=qe.sighash),qe[t]||Ge.throwArgumentError("invalid format type","format",t),t===qe.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t))),outputs:this.outputs.map(n=>JSON.parse(n.format(t)))});let e="";return t!==qe.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===qe.full?", ":",")+") ",t!==qe.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map(n=>n.format(t)).join(", ")+") "),this.gas!=null&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return typeof t=="string"?Os.fromString(t):Os.fromObject(t)}static fromObject(t){if(Os.isFunctionFragment(t))return t;t.type!=="function"&&Ge.throwArgumentError("invalid function object","value",t);let e=W2(t);const n={type:t.type,name:la(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(dn.fromObject):[],outputs:t.outputs?t.outputs.map(dn.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?zt.from(t.gas):null};return new Os(ds,n)}static fromString(t){let e={type:"function"};t=K2(t,e);let n=t.split(" returns ");n.length>2&&Ge.throwArgumentError("invalid function string","value",t);let a=n[0].match(ca);if(a||Ge.throwArgumentError("invalid function signature","value",t),e.name=a[1].trim(),e.name&&la(e.name),e.inputs=ha(a[2],!1),H2(a[3].trim(),e),n.length>1){let f=n[1].match(ca);(f[1].trim()!=""||f[3].trim()!="")&&Ge.throwArgumentError("unexpected tokens","value",t),e.outputs=ha(f[2],!1)}else e.outputs=[];return Os.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&t.type==="function"}};function cg(r){const t=r.format();return(t==="Error(string)"||t==="Panic(uint256)")&&Ge.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",r),r}let su=class ks extends p0{format(t){if(t||(t=qe.sighash),qe[t]||Ge.throwArgumentError("invalid format type","format",t),t===qe.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let e="";return t!==qe.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===qe.full?", ":",")+") ",e.trim()}static from(t){return typeof t=="string"?ks.fromString(t):ks.fromObject(t)}static fromObject(t){if(ks.isErrorFragment(t))return t;t.type!=="error"&&Ge.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:la(t.name),inputs:t.inputs?t.inputs.map(dn.fromObject):[]};return cg(new ks(ds,e))}static fromString(t){let e={type:"error"},n=t.match(ca);return n||Ge.throwArgumentError("invalid error signature","value",t),e.name=n[1].trim(),e.name&&la(e.name),e.inputs=ha(n[2],!1),cg(ks.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&t.type==="error"}};function Bs(r){return r.match(/^uint($|[^1-9])/)?r="uint256"+r.substring(4):r.match(/^int($|[^1-9])/)&&(r="int256"+r.substring(3)),r}const mE=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function la(r){return(!r||!r.match(mE))&&Ge.throwArgumentError(`invalid identifier "${r}"`,"value",r),r}const ca=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function vE(r){r=r.trim();let t=[],e="",n=0;for(let a=0;a<r.length;a++){let f=r[a];f===","&&n===0?(t.push(e),e=""):(e+=f,f==="("?n++:f===")"&&(n--,n===-1&&Ge.throwArgumentError("unbalanced parenthesis","value",r)))}return e&&t.push(e),t}const mp=new _t(Fa);function J2(r){const t=[],e=function(n,a){if(Array.isArray(a))for(let f in a){const c=n.slice();c.push(f);try{e(c,a[f])}catch(y){t.push({path:c,error:y})}}};return e([],r),t}let vf=class{constructor(t,e,n,a){this.name=t,this.type=e,this.localName=n,this.dynamic=a}_throwError(t,e){mp.throwArgumentError(t,this.localName,e)}},md=class{constructor(t){Pt(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return Mi(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(Ve(t._data))}writeBytes(t){let e=kt(t);const n=e.length%this.wordSize;
6return n&&(e=Ve([e,this._padding.slice(n)])),this._writeData(e)}_getValue(t){let e=kt(zt.from(t));return e.length>this.wordSize&&mp.throwError("value out-of-bounds",_t.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Ve([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}},xE=class vd{constructor(t,e,n,a){Pt(this,"_data",kt(t)),Pt(this,"wordSize",e||32),Pt(this,"_coerceFunc",n),Pt(this,"allowLoose",a),this._offset=0}get data(){return Ut(this._data)}get consumed(){return this._offset}static coerce(t,e){let n=t.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):vd.coerce(t,e)}_peekBytes(t,e,n){let a=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+a>this._data.length&&(this.allowLoose&&n&&this._offset+e<=this._data.length?a=e:mp.throwError("data out-of-bounds",_t.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+a})),this._data.slice(this._offset,this._offset+a)}subReader(t){return new vd(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let n=this._peekBytes(0,t,!!e);return this._offset+=n.length,n.slice(0,t)}readValue(){return zt.from(this.readBytes(this.wordSize))}};var V2={exports:{}};(function(r){(function(){var t="input is invalid type",e="finalize already called",n=typeof window=="object",a=n?window:{};a.JS_SHA3_NO_WINDOW&&(n=!1);var f=!n&&typeof self=="object",c=!a.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;c?a=bi:f&&(a=self);var y=!a.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!a.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",w="0123456789abcdef".split(""),E=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],O=[1,256,65536,16777216],F=[6,1536,393216,100663296],B=[0,8,16,24],L=[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],z=[224,256,384,512],q=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],At={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),b&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var St=function(u,A,S){return function(_){return new o(u,A,u).update(_)[S]()}},Z=function(u,A,S){return function(_,P){return new o(u,A,P).update(_)[S]()}},Y=function(u,A,S){return function(_,P,K,$){return i["cshake"+u].update(_,P,K,$)[S]()}},Ct=function(u,A,S){return function(_,P,K,$){return i["kmac"+u].update(_,P,K,$)[S]()}},Tt=function(u,A,S,_){for(var P=0;P<V.length;++P){var K=V[P];u[K]=A(S,_,K)}return u},Rt=function(u,A){var S=St(u,A,"hex");return S.create=function(){return new o(u,A,u)},S.update=function(_){return S.create().update(_)},Tt(S,St,u,A)},Dt=function(u,A){var S=Z(u,A,"hex");return S.create=function(_){return new o(u,A,_)},S.update=function(_,P){return S.create(P).update(_)},Tt(S,Z,u,A)},I=function(u,A){var S=At[u],_=Y(u,A,"hex");return _.create=function(P,K,$){return!K&&!$?i["shake"+u].create(P):new o(u,A,P).bytepad([K,$],S)},_.update=function(P,K,$,U){return _.create(K,$,U).update(P)},Tt(_,Y,u,A)},N=function(u,A){var S=At[u],_=Ct(u,A,"hex");return _.create=function(P,K,$){return new g(u,A,K).bytepad(["KMAC",$],S).bytepad([P],S)},_.update=function(P,K,$,U){return _.create(P,$,U).update(K)},Tt(_,Ct,u,A)},d=[{name:"keccak",padding:O,bits:z,createMethod:Rt},{name:"sha3",padding:F,bits:z,createMethod:Rt},{name:"shake",padding:E,bits:q,createMethod:Dt},{name:"cshake",padding:M,bits:q,createMethod:I},{name:"kmac",padding:M,bits:q,createMethod:N}],i={},s=[],h=0;h<d.length;++h)for(var p=d[h],m=p.bits,v=0;v<m.length;++v){var x=p.name+"_"+m[v];if(s.push(x),i[x]=p.createMethod(m[v],p.padding),p.name!=="sha3"){var l=p.name+m[v];s.push(l),i[l]=i[x]}}function o(u,A,S){this.blocks=[],this.s=[],this.padding=A,this.outputBits=S,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(u<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var _=0;_<50;++_)this.s[_]=0}o.prototype.update=function(u){if(this.finalized)throw new Error(e);var A,S=typeof u;
6if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}for(var _=this.blocks,P=this.byteCount,K=u.length,$=this.blockCount,U=0,It=this.s,G,J;U<K;){if(this.reset)for(this.reset=!1,_[0]=this.block,G=1;G<$+1;++G)_[G]=0;if(A)for(G=this.start;U<K&&G<P;++U)_[G>>2]|=u[U]<<B[G++&3];else for(G=this.start;U<K&&G<P;++U)J=u.charCodeAt(U),J<128?_[G>>2]|=J<<B[G++&3]:J<2048?(_[G>>2]|=(192|J>>6)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):J<55296||J>=57344?(_[G>>2]|=(224|J>>12)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):(J=65536+((J&1023)<<10|u.charCodeAt(++U)&1023),_[G>>2]|=(240|J>>18)<<B[G++&3],_[G>>2]|=(128|J>>12&63)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]);if(this.lastByteIndex=G,G>=P){for(this.start=G-P,this.block=_[$],G=0;G<$;++G)It[G]^=_[G];C(It),this.reset=!0}else this.start=G}return this},o.prototype.encode=function(u,A){var S=u&255,_=1,P=[S];for(u=u>>8,S=u&255;S>0;)P.unshift(S),u=u>>8,S=u&255,++_;return A?P.push(_):P.unshift(_),this.update(P),P.length},o.prototype.encodeString=function(u){var A,S=typeof u;if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}var _=0,P=u.length;if(A)_=P;else for(var K=0;K<u.length;++K){var $=u.charCodeAt(K);$<128?_+=1:$<2048?_+=2:$<55296||$>=57344?_+=3:($=65536+(($&1023)<<10|u.charCodeAt(++K)&1023),_+=4)}return _+=this.encode(_*8),this.update(u),_},o.prototype.bytepad=function(u,A){for(var S=this.encode(A),_=0;_<u.length;++_)S+=this.encodeString(u[_]);var P=A-S%A,K=[];return K.length=P,this.update(K),this},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,A=this.lastByteIndex,S=this.blockCount,_=this.s;if(u[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(u[0]=u[S],A=1;A<S+1;++A)u[A]=0;for(u[S-1]|=2147483648,A=0;A<S;++A)_[A]^=u[A];C(_)}},o.prototype.toString=o.prototype.hex=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$="",U;K<S;){for(P=0;P<u&&K<S;++P,++K)U=A[P],$+=w[U>>4&15]+w[U&15]+w[U>>12&15]+w[U>>8&15]+w[U>>20&15]+w[U>>16&15]+w[U>>28&15]+w[U>>24&15];K%u===0&&(C(A),P=0)}return _&&(U=A[P],$+=w[U>>4&15]+w[U&15],_>1&&($+=w[U>>12&15]+w[U>>8&15]),_>2&&($+=w[U>>20&15]+w[U>>16&15])),$},o.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=this.outputBits>>3,U;_?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer($);for(var It=new Uint32Array(U);K<S;){for(P=0;P<u&&K<S;++P,++K)It[K]=A[P];K%u===0&&C(A)}return _&&(It[P]=A[P],U=U.slice(0,$)),U},o.prototype.buffer=o.prototype.arrayBuffer,o.prototype.digest=o.prototype.array=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=[],U,It;K<S;){for(P=0;P<u&&K<S;++P,++K)U=K<<2,It=A[P],$[U]=It&255,$[U+1]=It>>8&255,$[U+2]=It>>16&255,$[U+3]=It>>24&255;K%u===0&&C(A)}return _&&(U=K<<2,It=A[P],$[U]=It&255,_>1&&($[U+1]=It>>8&255),_>2&&($[U+2]=It>>16&255)),$};function g(u,A,S){o.call(this,u,A,S)}g.prototype=new o,g.prototype.finalize=function(){return this.encode(this.outputBits,!0),o.prototype.finalize.call(this)};var C=function(u){var A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht,jt,Mt,ut,Xt,Nt,lt,Zt,wt,Et,Qt,Yt,te,ee,re;for(_=0;_<48;_+=2)P=u[0]^u[10]^u[20]^u[30]^u[40],K=u[1]^u[11]^u[21]^u[31]^u[41],$=u[2]^u[12]^u[22]^u[32]^u[42],U=u[3]^u[13]^u[23]^u[33]^u[43],It=u[4]^u[14]^u[24]^u[34]^u[44],G=u[5]^u[15]^u[25]^u[35]^u[45],J=u[6]^u[16]^u[26]^u[36]^u[46],Gt=u[7]^u[17]^u[27]^u[37]^u[47],ct=u[8]^u[18]^u[28]^u[38]^u[48],rt=u[9]^u[19]^u[29]^u[39]^u[49],A=ct^($<<1|U>>>31),S=rt^(U<<1|$>>>31),u[0]^=A,u[1]^=S,u[10]^=A,u[11]^=S,u[20]^=A,u[21]^=S,u[30]^=A,u[31]^=S,u[40]^=A,u[41]^=S,A=P^(It<<1|G>>>31),S=K^(G<<1|It>>>31),u[2]^=A,u[3]^=S,u[12]^=A,u[13]^=S,u[22]^=A,u[23]^=S,u[32]^=A,u[33]^=S,u[42]^=A,u[43]^=S,A=$^(J<<1|Gt>>>31),S=U^(Gt<<1|J>>>31),u[4]^=A,u[5]^=S,u[14]^=A,u[15]^=S,u[24]^=A,u[25]^=S,u[34]^=A,u[35]^=S,u[44]^=A,u[45]^=S,A=It^(ct<<1|rt>>>31),S=G^(rt<<1|ct>>>31),u[6]^=A,u[7]^=S,u[16]^=A,u[17]^=S,u[26]^=A,u[27]^=S,u[36]^=A,u[37]^=S,u[46]^=A,u[47]^=S,A=J^(P<<1|K>>>31),S=Gt^(K<<1|P>>>31),u[8]^=A,u[9]^=S,u[18]^=A,u[19]^=S,u[28]^=A,u[29]^=S,u[38]^=A,u[39]^=S,u[48]^=A,u[49]^=S,qt=u[0],dt=u[1],at=u[11]<<4|u[10]>>>28,Vt=u[10]<<4|u[11]>>>28,D=u[20]<<3|u[21]>>>29,j=u[21]<<3|u[20]>>>29,Yt=u[31]<<9|u[30]>>>23,te=u[30]<<9|u[31]>>>23,xt=u[40]<<18|u[41]>>>14,st=u[41]<<18|u[40]>>>14,X=u[2]<<1|u[3]>>>31,Ft=u[3]<<1|u[2]>>>31,it=u[13]<<12|u[12]>>>20,Kt=u[12]<<12|u[13]>>>20,bt=u[22]<<10|u[23]>>>22,ht=u[23]<<10|u[22]>>>22,H=u[33]<<13|u[32]>>>19,W=u[32]<<13|u[33]>>>19,ee=u[42]<<2|u[43]>>>30,re=u[43]<<2|u[42]>>>30,Nt=u[5]<<30|u[4]>>>2,lt=u[4]<<30|u[5]>>>2,Q=u[14]<<6|u[15]>>>26,ot=u[15]<<6|u[14]>>>26,gt=u[25]<<11|u[24]>>>21,tt=u[24]<<11|u[25]>>>21,jt=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,Bt=u[45]<<29|u[44]>>>3,et=u[44]<<29|u[45]>>>3,mt=u[6]<<28|u[7]>>>4,k=u[7]<<28|u[6]>>>4,Zt=u[17]<<23|u[16]>>>
69,wt=u[16]<<23|u[17]>>>9,Ht=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Lt=u[36]<<21|u[37]>>>11,pt=u[37]<<21|u[36]>>>11,ut=u[47]<<24|u[46]>>>8,Xt=u[46]<<24|u[47]>>>8,Jt=u[8]<<27|u[9]>>>5,yt=u[9]<<27|u[8]>>>5,T=u[18]<<20|u[19]>>>12,R=u[19]<<20|u[18]>>>12,Et=u[29]<<7|u[28]>>>25,Qt=u[28]<<7|u[29]>>>25,ft=u[38]<<8|u[39]>>>24,Wt=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,$t=u[49]<<14|u[48]>>>18,u[0]=qt^~it&gt,u[1]=dt^~Kt&tt,u[10]=mt^~T&D,u[11]=k^~R&j,u[20]=X^~Q&Ht,u[21]=Ft^~ot&vt,u[30]=Jt^~at&bt,u[31]=yt^~Vt&ht,u[40]=Nt^~Zt&Et,u[41]=lt^~wt&Qt,u[2]=it^~gt&Lt,u[3]=Kt^~tt&pt,u[12]=T^~D&H,u[13]=R^~j&W,u[22]=Q^~Ht&ft,u[23]=ot^~vt&Wt,u[32]=at^~bt&jt,u[33]=Vt^~ht&Mt,u[42]=Zt^~Et&Yt,u[43]=wt^~Qt&te,u[4]=gt^~Lt&nt,u[5]=tt^~pt&$t,u[14]=D^~H&Bt,u[15]=j^~W&et,u[24]=Ht^~ft&xt,u[25]=vt^~Wt&st,u[34]=bt^~jt&ut,u[35]=ht^~Mt&Xt,u[44]=Et^~Yt&ee,u[45]=Qt^~te&re,u[6]=Lt^~nt&qt,u[7]=pt^~$t&dt,u[16]=H^~Bt&mt,u[17]=W^~et&k,u[26]=ft^~xt&X,u[27]=Wt^~st&Ft,u[36]=jt^~ut&Jt,u[37]=Mt^~Xt&yt,u[46]=Yt^~ee&Nt,u[47]=te^~re&lt,u[8]=nt^~qt&it,u[9]=$t^~dt&Kt,u[18]=Bt^~mt&T,u[19]=et^~k&R,u[28]=xt^~X&Q,u[29]=st^~Ft&ot,u[38]=ut^~Jt&at,u[39]=Xt^~yt&Vt,u[48]=ee^~Nt&Zt,u[49]=re^~lt&wt,u[0]^=L[_],u[1]^=L[_+1]};if(y)r.exports=i;else for(h=0;h<s.length;++h)a[s[h]]=i[s[h]]})()})(V2);var yE=V2.exports;const bE=Nr(yE);function Je(r){return"0x"+bE.keccak_256(kt(r))}const wE="rlp/5.7.0",Io=new _t(wE);function dg(r){const t=[];for(;r;)t.unshift(r&255),r>>=8;return t}function pg(r,t,e){let n=0;for(let a=0;a<e;a++)n=n*256+r[t+a];return n}function j2(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(f){n=n.concat(j2(f))}),n.length<=55)return n.unshift(192+n.length),n;const a=dg(n.length);return a.unshift(247+a.length),a.concat(n)}Ju(r)||Io.throwArgumentError("RLP object must be BytesLike","object",r);const t=Array.prototype.slice.call(kt(r));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const e=dg(t.length);return e.unshift(183+e.length),e.concat(t)}function o0(r){return Ut(j2(r))}function gg(r,t,e,n){const a=[];for(;e<t+1+n;){const f=X2(r,e);a.push(f.result),e+=f.consumed,e>t+1+n&&Io.throwError("child data too short",_t.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function X2(r,t){if(r.length===0&&Io.throwError("data too short",_t.errors.BUFFER_OVERRUN,{}),r[t]>=248){const e=r[t]-247;t+1+e>r.length&&Io.throwError("data short segment too short",_t.errors.BUFFER_OVERRUN,{});const n=pg(r,t+1,e);return t+1+e+n>r.length&&Io.throwError("data long segment too short",_t.errors.BUFFER_OVERRUN,{}),gg(r,t,t+1+e,e+n)}else if(r[t]>=192){const e=r[t]-192;return t+1+e>r.length&&Io.throwError("data array too short",_t.errors.BUFFER_OVERRUN,{}),gg(r,t,t+1,e)}else if(r[t]>=184){const e=r[t]-183;t+1+e>r.length&&Io.throwError("data array too short",_t.errors.BUFFER_OVERRUN,{});const n=pg(r,t+1,e);t+1+e+n>r.length&&Io.throwError("data array too short",_t.errors.BUFFER_OVERRUN,{});const a=Ut(r.slice(t+1+e,t+1+e+n));return{consumed:1+e+n,result:a}}else if(r[t]>=128){const e=r[t]-128;t+1+e>r.length&&Io.throwError("data too short",_t.errors.BUFFER_OVERRUN,{});const n=Ut(r.slice(t+1,t+1+e));return{consumed:1+e,result:n}}return{consumed:1,result:Ut(r[t])}}function vp(r){const t=kt(r),e=X2(t,0);return e.consumed!==t.length&&Io.throwArgumentError("invalid rlp data","data",r),e.result}const EE="address/5.7.0",Ds=new _t(EE);function mg(r){xe(r,20)||Ds.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let a=0;a<40;a++)e[a]=t[a].charCodeAt(0);const n=kt(Je(e));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const AE=9007199254740991;function ME(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const xp={};for(let r=0;r<10;r++)xp[String(r)]=String(r);for(let r=0;r<26;r++)xp[String.fromCharCode(65+r)]=String(10+r);const vg=Math.floor(ME(AE));function NE(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>xp[n]).join("");for(;t.length>=vg;){let n=t.substring(0,vg);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function je(r){let t=null;if(typeof r!="string"&&Ds.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=mg(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&Ds.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==NE(r)&&Ds.throwArgumentError("bad icap checksum","address",r),t=sE(r.substring(4));t.length<40;)t="0"+t;t=mg("0x"+t)}else Ds.throwArgumentError("invalid address","address",r);return t}function Z2(r){let t=null;try{t=je(r.from)}catch{Ds.throwArgumentError("missing from address","transaction",r)}const e=hf(kt(zt.from(r.nonce).toHexString()));return je(Ar(Je(o0([t,e])),12))}let _E=class extends vf{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{je(e)}catch(n){this._throwError(n.message,e)}return t.writeValue(e)}decode(t){return je(Qe(t.readValue().toHexString(),20))}},SE=class extends vf{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}
6defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}};const Ls=new _t(Fa);function Q2(r,t,e){let n=null;if(Array.isArray(e))n=e;else if(e&&typeof e=="object"){let b={};n=t.map(w=>{const E=w.localName;return E||Ls.throwError("cannot encode object for signature with missing names",_t.errors.INVALID_ARGUMENT,{argument:"values",coder:w,value:e}),b[E]&&Ls.throwError("cannot encode object for signature with duplicate names",_t.errors.INVALID_ARGUMENT,{argument:"values",coder:w,value:e}),b[E]=!0,e[E]})}else Ls.throwArgumentError("invalid tuple value","tuple",e);t.length!==n.length&&Ls.throwArgumentError("types/value length mismatch","tuple",e);let a=new md(r.wordSize),f=new md(r.wordSize),c=[];t.forEach((b,w)=>{let E=n[w];if(b.dynamic){let M=f.length;b.encode(f,E);let O=a.writeUpdatableValue();c.push(F=>{O(F+M)})}else b.encode(a,E)}),c.forEach(b=>{b(a.length)});let y=r.appendWriter(a);return y+=r.appendWriter(f),y}function Y2(r,t){let e=[],n=r.subReader(0);t.forEach(f=>{let c=null;if(f.dynamic){let y=r.readValue(),b=n.subReader(y.toNumber());try{c=f.decode(b)}catch(w){if(w.code===_t.errors.BUFFER_OVERRUN)throw w;c=w,c.baseType=f.name,c.name=f.localName,c.type=f.type}}else try{c=f.decode(r)}catch(y){if(y.code===_t.errors.BUFFER_OVERRUN)throw y;c=y,c.baseType=f.name,c.name=f.localName,c.type=f.type}c!=null&&e.push(c)});const a=t.reduce((f,c)=>{const y=c.localName;return y&&(f[y]||(f[y]=0),f[y]++),f},{});t.forEach((f,c)=>{let y=f.localName;if(!y||a[y]!==1||(y==="length"&&(y="_length"),e[y]!=null))return;const b=e[c];b instanceof Error?Object.defineProperty(e,y,{get:()=>{throw b}}):e[y]=b});for(let f=0;f<e.length;f++){const c=e[f];c instanceof Error&&Object.defineProperty(e,f,{get:()=>{throw c}})}return Object.freeze(e)}let IE=class extends vf{constructor(t,e,n){const a=t.type+"["+(e>=0?e:"")+"]",f=e===-1||t.dynamic;super("array",a,n,f),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let n=this.length;n===-1&&(n=e.length,t.writeValue(e.length)),Ls.checkArgumentCount(e.length,n,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let f=0;f<e.length;f++)a.push(this.coder);return Q2(t,a,e)}decode(t){let e=this.length;e===-1&&(e=t.readValue().toNumber(),e*32>t._data.length&&Ls.throwError("insufficient data length",_t.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let a=0;a<e;a++)n.push(new SE(this.coder));return t.coerce(this.name,Y2(t,n))}},RE=class extends vf{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}},ty=class extends vf{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=kt(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}},TE=class extends ty{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,Ut(super.decode(t)))}},PE=class extends vf{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,e){let n=kt(e);return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return t.coerce(this.name,Ut(t.readBytes(this.size)))}},CE=class extends vf{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}};const OE="0x0000000000000000000000000000000000000000",ey=zt.from(-1),yp=zt.from(0),ry=zt.from(1),iy=zt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),kE="0x0000000000000000000000000000000000000000000000000000000000000000";let BE=class extends vf{constructor(t,e,n){const a=(e?"int":"uint")+t*8;super(a,a,n,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let n=zt.from(e),a=iy.mask(t.wordSize*8);if(this.signed){let f=a.mask(this.size*8-1);(n.gt(f)||n.lt(f.add(ry).mul(ey)))&&this._throwError("value out-of-bounds",e)}else(n.lt(yp)||n.gt(a.mask(this.size*8)))&&this._throwError("value out-of-bounds",e);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let e=t.readValue().mask(this.size*8);return this.signed&&(e=e.fromTwos(this.size*8)),t.coerce(this.name,e)}};const UE="strings/5.7.0",ny=new _t(UE);var cf;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(cf||(cf={}));var Li;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(Li||(Li={}));function FE(r,t,e,n,a){return ny.throwArgumentError(`invalid codepoint at offset ${t}; ${r}`,"bytes",e)}function oy(r,t,e,n,a){if(r===Li.BAD_PREFIX||r===Li.UNEXPECTED_CONTINUE){let f=0;for(let c=t+1;c<e.length&&e[c]>>6===2;c++)f++;return f}return r===Li.OVERRUN?e.length-t-1:0}function DE(r,t,e,n,a){return r===Li.OVERLONG?(n.push(a),0):(n.push(65533),oy(r,t,e))}const LE=Object.freeze({error:FE,ignore:oy,replace:DE});function fy(r,t){t==null&&(t=LE.error),r=kt(r);const e=[];let n=0;for(;n<r.length;){const a=r[n++];if(!(a>>7)){e.push(a);continue}let f=null,c=null;if((a&224)===192)f=1,c=127;else if((a&240)===224)f=2,c=2047;else if((a&248)===240)f=3,c=65535;else{(a&192)===128?n+=t(Li.UNEXPECTED_CONTINUE,n-1,r,e):n+=t(Li.BAD_PREFIX,n-1,r,e);continue}if(n-1+f>=r.length){n+=t(Li.OVERRUN,n-1,r,e);continue}let y=a&(1<<8-f-1)-1;for(let b=0;b<f;b++){let w=r[n];if((w&192)!=128){n+=t(Li.MISSING_CONTINUE,n,r,e),y=null;break}y=y<<6|w&63,n++}if(y!==null){if(y>1114111){n+=t(Li.OUT_OF_RANGE,n-1-f,r,e,y);continue}if(y>=55296&&y<=57343){n+=t(Li.UTF16_SURROGATE,n-1-f,r,e,y);continue}if(y<=c){n+=t(Li.OVERLONG,n-1-f,r,e,y);continue}e.push(y)}}return e}function cr(r,t=cf.current){t!=cf.current&&(ny.checkNormalize(),r=r.normalize(t));let e=[];for(let n=0;n<r.length;n++){const a=r.charCodeAt(n);if(a<128)e.push(a);else if(a<2048)e.push(a>>6|192),e.push(a&63|128);else if((a&64512)==55296){n++;const f=r.charCodeAt(n);if(n>=r.length||(f&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((a&1023)<<10)+(f&1023);e.push(c>>18|240),e.push(c>>12&63|128),e.push(c>>6&63|128),e.push(c&63|128)}else e.push(a>>12|224),e.push(a>>6&63|128),e.push(a&63|128)}return kt(e)}function $E(r){return r.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function g0(r,t){return $E(fy(r,t))}function GE(r,t=cf.current){return fy(cr(r,t))}let zE=class extends ty{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,cr(e))}decode(t){return g0(super.decode(t))}},Za=class extends vf{constructor(t,e){let n=!1;const a=[];t.forEach(c=>{c.dynamic&&(n=!0),a.push(c.type)});const f="tuple("+a.join(",")+")";super("tuple",f,e,n),this.coders=t}defaultValue(){const t=[];
6this.coders.forEach(n=>{t.push(n.defaultValue())});const e=this.coders.reduce((n,a)=>{const f=a.localName;return f&&(n[f]||(n[f]=0),n[f]++),n},{});return this.coders.forEach((n,a)=>{let f=n.localName;!f||e[f]!==1||(f==="length"&&(f="_length"),t[f]==null&&(t[f]=t[a]))}),Object.freeze(t)}encode(t,e){return Q2(t,this.coders,e)}decode(t){return t.coerce(this.name,Y2(t,this.coders))}};const I0=new _t(Fa),qE=new RegExp(/^bytes([0-9]*)$/),KE=new RegExp(/^(u?int)([0-9]*)$/);let bp=class sy{constructor(t){I0.checkNew(new.target,sy),Pt(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new _E(t.name);case"bool":return new RE(t.name);case"string":return new zE(t.name);case"bytes":return new TE(t.name);case"array":return new IE(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new Za((t.components||[]).map(n=>this._getCoder(n)),t.name);case"":return new CE(t.name)}let e=t.type.match(KE);if(e){let n=parseInt(e[2]||"256");return(n===0||n>256||n%8!==0)&&I0.throwArgumentError("invalid "+e[1]+" bit length","param",t),new BE(n/8,e[1]==="int",t.name)}if(e=t.type.match(qE),e){let n=parseInt(e[1]);return(n===0||n>32)&&I0.throwArgumentError("invalid bytes length","param",t),new PE(n,t.name)}return I0.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new xE(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new md(this._getWordSize())}getDefaultValue(t){const e=t.map(a=>this._getCoder(dn.from(a)));return new Za(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&I0.throwError("types/values length mismatch",_t.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map(c=>this._getCoder(dn.from(c))),a=new Za(n,"_"),f=this._getWriter();return a.encode(f,e),f.data}decode(t,e,n){const a=t.map(c=>this._getCoder(dn.from(c)));return new Za(a,"_").decode(this._getReader(kt(e),n))}};const wp=new bp;function po(r){return Je(cr(r))}const ay="hash/5.7.0";function hy(r){r=atob(r);const t=[];for(let e=0;e<r.length;e++)t.push(r.charCodeAt(e));return kt(t)}function uy(r){r=kt(r);let t="";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return btoa(t)}function ly(r,t){t==null&&(t=1);const e=[],n=e.forEach,a=function(f,c){n.call(f,function(y){c>0&&Array.isArray(y)?a(y,c-1):e.push(y)})};return a(r,t),e}function HE(r){const t={};for(let e=0;e<r.length;e++){const n=r[e];t[n[0]]=n[1]}return t}function WE(r){let t=0;function e(){return r[t++]<<8|r[t++]}let n=e(),a=1,f=[0,1];for(let Z=1;Z<n;Z++)f.push(a+=e());let c=e(),y=t;t+=c;let b=0,w=0;function E(){return b==0&&(w=w<<8|r[t++],b=8),w>>--b&1}const M=31,O=Math.pow(2,M),F=O>>>1,B=F>>1,L=O-1;let z=0;for(let Z=0;Z<M;Z++)z=z<<1|E();let q=[],V=0,At=O;for(;;){let Z=Math.floor(((z-V+1)*a-1)/At),Y=0,Ct=n;for(;Ct-Y>1;){let Dt=Y+Ct>>>1;Z<f[Dt]?Ct=Dt:Y=Dt}if(Y==0)break;q.push(Y);
6let Tt=V+Math.floor(At*f[Y]/a),Rt=V+Math.floor(At*f[Y+1]/a)-1;for(;!((Tt^Rt)&F);)z=z<<1&L|E(),Tt=Tt<<1&L,Rt=Rt<<1&L|1;for(;Tt&~Rt&B;)z=z&F|z<<1&L>>>1|E(),Tt=Tt<<1^F,Rt=(Rt^F)<<1|F|1;V=Tt,At=1+Rt-Tt}let St=n-4;return q.map(Z=>{switch(Z-St){case 3:return St+65792+(r[y++]<<16|r[y++]<<8|r[y++]);case 2:return St+256+(r[y++]<<8|r[y++]);case 1:return St+r[y++];default:return Z-1}})}function JE(r){let t=0;return()=>r[t++]}function VE(r){return JE(WE(r))}function jE(r){return r&1?~r>>1:r>>1}function XE(r,t){let e=Array(r);for(let n=0;n<r;n++)e[n]=1+t();return e}function xg(r,t){let e=Array(r);for(let n=0,a=-1;n<r;n++)e[n]=a+=1+t();return e}function ZE(r,t){let e=Array(r);for(let n=0,a=0;n<r;n++)e[n]=a+=jE(t());return e}function au(r,t){let e=xg(r(),r),n=r(),a=xg(n,r),f=XE(n,r);for(let c=0;c<n;c++)for(let y=0;y<f[c];y++)e.push(a[c]+y);return t?e.map(c=>t[c]):e}function QE(r){let t=[];for(;;){let e=r();if(e==0)break;t.push(tA(e,r))}for(;;){let e=r()-1;if(e<0)break;t.push(eA(e,r))}return HE(ly(t))}function YE(r){let t=[];for(;;){let e=r();if(e==0)break;t.push(e)}return t}function cy(r,t,e){let n=Array(r).fill(void 0).map(()=>[]);for(let a=0;a<t;a++)ZE(r,e).forEach((f,c)=>n[c].push(f));return n}function tA(r,t){let e=1+t(),n=t(),a=YE(t),f=cy(a.length,1+r,t);return ly(f.map((c,y)=>{const b=c[0],w=c.slice(1);return Array(a[y]).fill(void 0).map((E,M)=>{let O=M*n;return[b+M*e,w.map(F=>F+O)]})}))}function eA(r,t){let e=1+t();return cy(e,1+r,t).map(a=>[a[0],a.slice(1)])}function rA(r){let t=au(r).sort((n,a)=>n-a);return e();function e(){let n=[];for(;;){let w=au(r,t);if(w.length==0)break;n.push({set:new Set(w),node:e()})}n.sort((w,E)=>E.set.size-w.set.size);let a=r(),f=a%3;a=a/3|0;let c=!!(a&1);a>>=1;let y=a==1,b=a==2;return{branches:n,valid:f,fe0f:c,save:y,check:b}}}function iA(){return VE(hy("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKL
6QAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl
6+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Vu=iA(),nA=new Set(au(Vu)),oA=new Set(au(Vu)),fA=QE(Vu),sA=rA(Vu),yg=45,bg=95;function dy(r){return GE(r)}function aA(r){return r.filter(t=>t!=65039)}function py(r){for(let t of r.split(".")){let e=dy(t);try{for(let n=e.lastIndexOf(bg)-1;n>=0;n--)if(e[n]!==bg)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every(n=>n<128)&&e[2]===yg&&e[3]===yg)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${t}": ${n.message}`)}}return r}function hA(r){return py(uA(r,aA))}function uA(r,t){let e=dy(r).reverse(),n=[];for(;e.length;){let a=cA(e);if(a){n.push(...t(a));continue}let f=e.pop();if(nA.has(f)){n.push(f);continue}if(oA.has(f))continue;let c=fA[f];if(c){n.push(...c);continue}throw new Error(`Disallowed codepoint: 0x${f.toString(16).toUpperCase()}`)}return py(lA(String.fromCodePoint(...n)))}function lA(r){return r.normalize("NFC")}function cA(r,t){var e;let n=sA,a,f,c=[],y=r.length;for(;y;){let b=r[--y];if(n=(e=n.branches.find(w=>w.set.has(b)))===null||e===void 0?void 0:e.node,!n)break;if(n.save)f=b;else if(n.check&&b===f)break;
6c.push(b),n.fe0f&&(c.push(65039),y>0&&r[y-1]==65039&&y--),n.valid&&(a=c.slice(),n.valid==2&&a.splice(1,1),r.length=y)}return a}const dA=new _t(ay),gy=new Uint8Array(32);gy.fill(0);function wg(r){if(r.length===0)throw new Error("invalid ENS name; empty component");return r}function my(r){const t=cr(hA(r)),e=[];if(r.length===0)return e;let n=0;for(let a=0;a<t.length;a++)t[a]===46&&(e.push(wg(t.slice(n,a))),n=a+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return e.push(wg(t.slice(n))),e}function ph(r){typeof r!="string"&&dA.throwArgumentError("invalid ENS name; not a string","name",r);let t=gy;const e=my(r);for(;e.length;)t=Je(Ve([t,Je(e.pop())]));return Ut(t)}function pA(r){return Ut(Ve(my(r).map(t=>{if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const e=new Uint8Array(t.length+1);return e.set(t,1),e[0]=e.length-1,e})))+"00"}const gA=`�Ethereum Signed Message:
7`;function vy(r){return typeof r=="string"&&(r=cr(r)),Je(Ve([cr(gA),cr(String(r.length)),r]))}var mA=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const fr=new _t(ay),xy=new Uint8Array(32);xy.fill(0);const vA=zt.from(-1),yy=zt.from(0),by=zt.from(1),xA=zt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function yA(r){const t=kt(r),e=t.length%32;return e?Mi([t,xy.slice(e)]):Ut(t)}const bA=Qe(by.toHexString(),32),wA=Qe(yy.toHexString(),32),Eg={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},$l=["name","version","chainId","verifyingContract","salt"];function Ag(r){return function(t){return typeof t!="string"&&fr.throwArgumentError(`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,t),t}}const EA={name:Ag("name"),version:Ag("version"),chainId:function(r){try{return zt.from(r).toString()}catch{}return fr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",r)},verifyingContract:function(r){try{return je(r).toLowerCase()}catch{}return fr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){try{const t=kt(r);if(t.length!==32)throw new Error("bad length");return Ut(t)}catch{}return fr.throwArgumentError('invalid domain value "salt"',"domain.salt",r)}};function Gl(r){{const t=r.match(/^(u?)int(\d*)$/);if(t){const e=t[1]==="",n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&fr.throwArgumentError("invalid numeric width","type",r);const a=xA.mask(e?n-1:n),f=e?a.add(by).mul(vA):yy;return function(c){const y=zt.from(c);return(y.lt(f)||y.gt(a))&&fr.throwArgumentError(`value out-of-bounds for ${r}`,"value",c),Qe(y.toTwos(256).toHexString(),32)}}}{const t=r.match(/^bytes(\d+)$/);if(t){const e=parseInt(t[1]);return(e===0||e>32||t[1]!==String(e))&&fr.throwArgumentError("invalid bytes width","type",r),function(n){return kt(n).length!==e&&fr.throwArgumentError(`invalid length for ${r}`,"value",n),yA(n)}}}switch(r){case"address":return function(t){return Qe(je(t),32)};case"bool":return function(t){return t?bA:wA};case"bytes":return function(t){return Je(t)};case"string":return function(t){return po(t)}}return null}function Mg(r,t){return`${r}(${t.map(({name:e,type:n})=>n+" "+e).join(",")})`}let da=class Dn{constructor(t){Pt(this,"types",Object.freeze(lf(t))),Pt(this,"_encoderCache",{}),Pt(this,"_types",{});const e={},n={},a={};Object.keys(t).forEach(y=>{e[y]={},n[y]=[],a[y]={}});for(const y in t){const b={};t[y].forEach(w=>{b[w.name]&&fr.throwArgumentError(`duplicate variable name ${JSON.stringify(w.name)} in ${JSON.stringify(y)}`,"types",t),b[w.name]=!0;const E=w.type.match(/^([^\x5b]*)(\x5b|$)/)[1];E===y&&fr.throwArgumentError(`circular type reference to ${JSON.stringify(E)}`,"types",t),!Gl(E)&&(n[E]||fr.throwArgumentError(`unknown type ${JSON.stringify(E)}`,"types",t),n[E].push(y),e[y][E]=!0)})}const f=Object.keys(n).filter(y=>n[y].length===0);f.length===0?fr.throwArgumentError("missing primary type","types",t):f.length>1&&fr.throwArgumentError(`ambiguous primary types or unused types: ${f.map(y=>
7JSON.stringify(y)).join(", ")}`,"types",t),Pt(this,"primaryType",f[0]);function c(y,b){b[y]&&fr.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",t),b[y]=!0,Object.keys(e[y]).forEach(w=>{n[w]&&(c(w,b),Object.keys(b).forEach(E=>{a[E][w]=!0}))}),delete b[y]}c(this.primaryType,{});for(const y in a){const b=Object.keys(a[y]);b.sort(),this._types[y]=Mg(y,t[y])+b.map(w=>Mg(w,t[w])).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const a=Gl(t);if(a)return a}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const a=e[1],f=this.getEncoder(a),c=parseInt(e[3]);return y=>{c>=0&&y.length!==c&&fr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",y);let b=y.map(f);return this._types[a]&&(b=b.map(Je)),Je(Mi(b))}}const n=this.types[t];if(n){const a=po(this._types[t]);return f=>{const c=n.map(({name:y,type:b})=>{const w=this.getEncoder(b)(f[y]);return this._types[b]?Je(w):w});return c.unshift(a),Mi(c)}}return fr.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||fr.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return Je(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(Gl(t))return n(t,e);const a=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(a){const c=a[1],y=parseInt(a[3]);return y>=0&&e.length!==y&&fr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map(b=>this._visit(c,b,n))}const f=this.types[t];return f?f.reduce((c,{name:y,type:b})=>(c[y]=this._visit(b,e[y],n),c),{}):fr.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Dn(t)}static getPrimaryType(t){return Dn.from(t).primaryType}static hashStruct(t,e,n){return Dn.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const a=Eg[n];a||fr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:a})}return e.sort((n,a)=>$l.indexOf(n.name)-$l.indexOf(a.name)),Dn.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return Mi(["0x1901",Dn.hashDomain(t),Dn.from(e).hash(n)])}static hash(t,e,n){return Je(Dn.encode(t,e,n))}static resolveNames(t,e,n,a){return mA(this,void 0,void 0,function*(){t=Jr(t);const f={};t.verifyingContract&&!xe(t.verifyingContract,20)&&(f[t.verifyingContract]="0x");const c=Dn.from(e);c.visit(n,(y,b)=>(y==="address"&&!xe(b,20)&&(f[b]="0x"),b));for(const y in f)f[y]=yield a(y);return t.verifyingContract&&f[t.verifyingContract]&&(t.verifyingContract=f[t.verifyingContract]),n=c.visit(n,(y,b)=>y==="address"&&f[b]?f[b]:b),{domain:t,value:n}})}static getPayload(t,e,n){Dn.hashDomain(t);const a={},f=[];$l.forEach(b=>{const w=t[b];w!=null&&(a[b]=EA[b](w),f.push({name:b,type:Eg[b]}))});const c=Dn.from(e),y=Jr(e);return y.EIP712Domain?fr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):y.EIP712Domain=f,c.encode(n),{types:y,domain:a,primaryType:c.primaryType,message:c.visit(n,(b,w)=>{if(b.match(/^bytes(\d*)/))return Ut(kt(w));if(b.match(/^u?int/))return zt.from(w).toString();switch(b){case"address":return w.toLowerCase();case"bool":return!!w;case"string":return typeof w!="string"&&fr.throwArgumentError("invalid string","value",w),w}return fr.throwArgumentError("unsupported type","type",b)})}}};const ir=new _t(Fa);let Ep=class extends Wi{},Ap=class extends Wi{},AA=class extends Wi{},hu=class extends Wi{static isIndexed(t){return!!(t&&t._isIndexed)}};const MA={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Ng(r,t){const e=new Error(`deferred error during ABI decoding triggered accessing ${r}`);return e.error=t,e}let wy=class Ey{constructor(t){ir.checkNew(new.target,Ey);let e=[];typeof t=="string"?e=JSON.parse(t):e=t,Pt(this,"fragments",e.map(n=>p0.from(n)).filter(n=>n!=null)),Pt(this,"_abiCoder",Bi(new.target,"getAbiCoder")()),Pt(this,"functions",{}),Pt(this,"errors",{}),Pt(this,"events",{}),Pt(this,"structs",{}
7),this.fragments.forEach(n=>{let a=null;switch(n.type){case"constructor":if(this.deploy){ir.warn("duplicate definition - constructor");return}Pt(this,"deploy",n);return;case"function":a=this.functions;break;case"event":a=this.events;break;case"error":a=this.errors;break;default:return}let f=n.format();if(a[f]){ir.warn("duplicate definition - "+f);return}a[f]=n}),this.deploy||Pt(this,"deploy",i0.from({payable:!1,type:"constructor"})),Pt(this,"_isInterface",!0)}format(t){t||(t=qe.full),t===qe.sighash&&ir.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map(n=>n.format(t));return t===qe.json?JSON.stringify(e.map(n=>JSON.parse(n))):e}static getAbiCoder(){return wp}static getAddress(t){return je(t)}static getSighash(t){return Ar(po(t.format()),0,4)}static getEventTopic(t){return po(t.format())}getFunction(t){if(xe(t)){for(const n in this.functions)if(t===this.getSighash(n))return this.functions[n];ir.throwArgumentError("no matching function","sighash",t)}if(t.indexOf("(")===-1){const n=t.trim(),a=Object.keys(this.functions).filter(f=>f.split("(")[0]===n);return a.length===0?ir.throwArgumentError("no matching function","name",n):a.length>1&&ir.throwArgumentError("multiple matching functions","name",n),this.functions[a[0]]}const e=this.functions[n0.fromString(t).format()];return e||ir.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(xe(t)){const n=t.toLowerCase();for(const a in this.events)if(n===this.getEventTopic(a))return this.events[a];ir.throwArgumentError("no matching event","topichash",n)}if(t.indexOf("(")===-1){const n=t.trim(),a=Object.keys(this.events).filter(f=>f.split("(")[0]===n);return a.length===0?ir.throwArgumentError("no matching event","name",n):a.length>1&&ir.throwArgumentError("multiple matching events","name",n),this.events[a[0]]}const e=this.events[ua.fromString(t).format()];return e||ir.throwArgumentError("no matching event","signature",t),e}getError(t){if(xe(t)){const n=Bi(this.constructor,"getSighash");for(const a in this.errors){const f=this.errors[a];if(t===n(f))return this.errors[a]}ir.throwArgumentError("no matching error","sighash",t)}if(t.indexOf("(")===-1){const n=t.trim(),a=Object.keys(this.errors).filter(f=>f.split("(")[0]===n);return a.length===0?ir.throwArgumentError("no matching error","name",n):a.length>1&&ir.throwArgumentError("multiple matching errors","name",n),this.errors[a[0]]}const e=this.errors[n0.fromString(t).format()];return e||ir.throwArgumentError("no matching error","signature",t),e}getSighash(t){if(typeof t=="string")try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch{throw e}}return Bi(this.constructor,"getSighash")(t)}getEventTopic(t){return typeof t=="string"&&(t=this.getEvent(t)),Bi(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){typeof t=="string"&&(t=this.getError(t));const n=kt(e);return Ut(n.slice(0,4))!==this.getSighash(t)&&ir.throwArgumentError(`data signature does not match error ${t.name}.`,"data",Ut(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return typeof t=="string"&&(t=this.getError(t)),Ut(Ve([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){typeof t=="string"&&(t=this.getFunction(t));const n=kt(e);return Ut(n.slice(0,4))!==this.getSighash(t)&&ir.throwArgumentError(`data signature does not match function ${t.name}.`,"data",Ut(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return typeof t=="string"&&(t=this.getFunction(t)),Ut(Ve([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){typeof t=="string"&&(t=this.getFunction(t));let n=kt(e),a=null,f=null,c=null,y=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch{}break;case 4:{const b=Ut(n.slice(0,4)),w=MA[b];if(w)f=this._abiCoder.decode(w.inputs,n.slice(4)),c=w.name,y=w.signature,w.reason&&(a=f[0]);else try{const E=this.getError(b);f=this._abiCoder.decode(E.inputs,n.slice(4)),c=E.name,y=E.format()}catch(E){}break}}return ir.throwError("call revert exception",_t.errors.CALL_EXCEPTION,{method:t.format(),errorArgs:f,errorName:c,errorSignature:y,reason:a})}encodeFunctionResult(t,e){return typeof t=="string"&&(t=this.getFunction(t)),Ut(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){typeof t=="string"&&(t=this.getEvent(t)),e.length>t.inputs.length&&ir.throwError("too many arguments for "+t.format(),_t.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const a=(f,c)=>f.type==="string"?po(c):f.type==="bytes"?Je(Ut(c)):(f.type==="address"&&this._abiCoder.encode(["address"],[c]),Qe(Ut(c),32));for(e.forEach((f,c)=>{let y=t.inputs[c];if(!y.indexed){f!=null&&ir.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+y.name,f);return}f==null?n.push(null):y.baseType==="array"||y.baseType==="tuple"?ir.throwArgumentError("filtering with tuples or arrays not supported","contract."+y.name,f):Array.isArray(f)?n.push(f.map(b=>a(y,b))):n.push(a(y,f))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(t,e){typeof t=="string"&&(t=this.getEvent(t));const n=[],a=[],f=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&ir.throwArgumentError("event arguments/values mismatch","values",e),t.input
7s.forEach((c,y)=>{const b=e[y];if(c.indexed)if(c.type==="string")n.push(po(b));else if(c.type==="bytes")n.push(Je(b));else{if(c.baseType==="tuple"||c.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([c.type],[b]))}else a.push(c),f.push(b)}),{data:this._abiCoder.encode(a,f),topics:n}}decodeEventLog(t,e,n){if(typeof t=="string"&&(t=this.getEvent(t)),n!=null&&!t.anonymous){let O=this.getEventTopic(t);(!xe(n[0],32)||n[0].toLowerCase()!==O)&&ir.throwError("fragment/topic mismatch",_t.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:O,value:n[0]}),n=n.slice(1)}let a=[],f=[],c=[];t.inputs.forEach((O,F)=>{O.indexed?O.type==="string"||O.type==="bytes"||O.baseType==="tuple"||O.baseType==="array"?(a.push(dn.fromObject({type:"bytes32",name:O.name})),c.push(!0)):(a.push(O),c.push(!1)):(f.push(O),c.push(!1))});let y=n!=null?this._abiCoder.decode(a,Ve(n)):null,b=this._abiCoder.decode(f,e,!0),w=[],E=0,M=0;t.inputs.forEach((O,F)=>{if(O.indexed)if(y==null)w[F]=new hu({_isIndexed:!0,hash:null});else if(c[F])w[F]=new hu({_isIndexed:!0,hash:y[M++]});else try{w[F]=y[M++]}catch(B){w[F]=B}else try{w[F]=b[E++]}catch(B){w[F]=B}if(O.name&&w[O.name]==null){const B=w[F];B instanceof Error?Object.defineProperty(w,O.name,{get:()=>{throw Ng(`property ${JSON.stringify(O.name)}`,B)}}):w[O.name]=B}});for(let O=0;O<w.length;O++){const F=w[O];F instanceof Error&&Object.defineProperty(w,O,{get:()=>{throw Ng(`index ${O}`,F)}})}return Object.freeze(w)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new Ap({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:zt.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Ep({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=Ut(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new AA({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!!(t&&t._isInterface)}};const iT=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:bp,ConstructorFragment:i0,ErrorFragment:su,EventFragment:ua,FormatTypes:qe,Fragment:p0,FunctionFragment:n0,Indexed:hu,Interface:wy,LogDescription:Ep,ParamType:dn,TransactionDescription:Ap,checkResultErrors:J2,defaultAbiCoder:wp},Symbol.toStringTag,{value:"Module"})),NA="logger/5.7.0";let _g=!1,Sg=!1;const gh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ig=gh.default,zl=null;function _A(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Rg=_A();var xd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(xd||(xd={}));var Vn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Vn||(Vn={}));const Tg="0123456789abcdef";let go=class Sr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();gh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Ig>gh[n])&&console.log.apply(console,e)}debug(...t){this._log(Sr.levels.DEBUG,t)}info(...t){this._log(Sr.levels.INFO,t)}warn(...t){this._log(Sr.levels.WARNING,t)}makeError(t,e,n){if(Sg)return this.makeError("censored error",e,{});e||(e=Sr.errors.UNKNOWN_ERROR),n||(n={});const a=[];
7Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Tg[w[M]>>4],E+=Tg[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case Vn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Vn.CALL_EXCEPTION:case Vn.INSUFFICIENT_FUNDS:case Vn.MISSING_NEW:case Vn.NONCE_EXPIRED:case Vn.REPLACEMENT_UNDERPRICED:case Vn.TRANSACTION_REPLACED:case Vn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Sr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Rg&&this.throwError("platform missing String.prototype.normalize",Sr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Rg})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Sr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Sr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Sr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Sr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Sr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Sr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Sr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return zl||(zl=new Sr(NA)),zl}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Sr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_g){if(!t)return;this.globalLogger().throwError("error censorship permanent",Sr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Sg=!!t,_g=!!e}static setLogLevel(t){const e=gh[t.toLowerCase()];if(e==null){Sr.globalLogger().warn("invalid log level - "+t);return}Ig=e}static from(t){return new Sr(t)}};go.errors=Vn;go.levels=xd;const SA="bytes/5.7.0",ss=new go(SA);function Ay(r){return!!r.toHexString}function Q0(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Q0(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function IA(r){return Lf(r)&&!(r.length%2)||ju(r)}function Pg(r){return typeof r=="number"&&r==r&&r%1===0}function ju(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!Pg(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Pg(e)||e<0||e>=256)return!1}return!0}function m0(r,t){if(t||(t={}),typeof r=="number"){ss.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Q0(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Ay(r)&&(r=r.toHexString()),Lf(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":ss.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Q0(new Uint8Array(n))}return ju(r)?Q0(new Uint8Array(r)):ss.throwArgumentError("invalid arrayify value","value",r)}function RA(r){const t=r.map(a=>m0(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),Q0(n)}function TA(r){let t=m0(r);if(t.length===0)return t;let e=0;for(;e<t.length&&t[e]===0;)e++;return e&&(t=t.slice(e)),t}function Lf(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const ql="0123456789abcdef";function Xu(r,t){if(t||(t={}
7),typeof r=="number"){ss.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=ql[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Ay(r))return r.toHexString();if(Lf(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":ss.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(ju(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=ql[(a&240)>>4]+ql[a&15]}return e}return ss.throwArgumentError("invalid hexlify value","value",r)}function Cg(r){if(typeof r!="string")r=Xu(r);else if(!Lf(r)||r.length%2)return null;return(r.length-2)/2}function My(r,t,e){return typeof r!="string"?r=Xu(r):(!Lf(r)||r.length%2)&&ss.throwArgumentError("invalid hexData","value",r),t=2+2*t,"0x"+r.substring(t)}var Mp={exports:{}};Mp.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};
vendor: 35,743 bytes, line 7
7function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
7function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(Mp);var PA=Mp.exports;const CA=Nr(PA),OA="bignumber/5.7.0";var pa=CA.BN;const Jo=new go(OA),Kl={},Og=9007199254740991;let kg=!1,Np=class Ln{constructor(t,e){t!==Kl&&Jo.throwError("cannot call constructor directly; use BigNumber.from",go.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Si(be(this).fromTwos(t))}toTwos(t){return Si(be(this).toTwos(t))}abs(){return this._hex[0]==="-"?Ln.from(this._hex.substring(1)):this}add(t){return Si(be(this).add(be(t)))}sub(t){return Si(be(this).sub(be(t)))}div(t){return Ln.from(t).isZero()&&Yi("division-by-zero","div"),Si(be(this).div(be(t)))}mul(t){return Si(be(this).mul(be(t)))}mod(t){const e=be(t);return e.isNeg()&&Yi("division-by-zero","mod"),Si(be(this).umod(e))}pow(t){const e=be(t);return e.isNeg()&&Yi("negative-power","pow"),Si(be(this).pow(e))}and(t){const e=be(t);return(this.isNegative()||e.isNeg())&&Yi("unbound-bitwise-result","and"),Si(be(this).and(e))}or(t){const e=be(t);return(this.isNegative()||e.isNeg())&&Yi("unbound-bitwise-result","or"),Si(be(this).or(e))}xor(t){const e=be(t);return(this.isNegative()||e.isNeg())&&Yi("unbound-bitwise-result","xor"),Si(be(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&Yi("negative-width","mask"),Si(be(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Yi("negative-width","shl"),Si(be(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Yi("negative-width","shr"),Si(be(this).shrn(t))}eq(t){return be(this).eq(be(t))}lt(t){return be(this).lt(be(t))}lte(t){return be(this).lte(be(t))}gt(t){return be(this).gt(be(t))}gte(t){return be(this).gte(be(t))}isNegative(){return this._hex[0]==="-"}isZero(){return be(this).isZero()}toNumber(){try{return be(this).toNumber()}catch{Yi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Jo.throwError("this platform does not support BigInt",go.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kg||(kg=!0,Jo.warn("BigNumber.toString does not accept any parameters;
7 base-10 is assumed")):arguments[0]===16?Jo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",go.errors.UNEXPECTED_ARGUMENT,{}):Jo.throwError("BigNumber.toString does not accept parameters",go.errors.UNEXPECTED_ARGUMENT,{})),be(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Ln)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new Ln(Kl,ga(t)):t.match(/^-?[0-9]+$/)?new Ln(Kl,ga(new pa(t))):Jo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&Yi("underflow","BigNumber.from",t),(t>=Og||t<=-Og)&&Yi("overflow","BigNumber.from",t),Ln.from(String(t));const e=t;if(typeof e=="bigint")return Ln.from(e.toString());if(ju(e))return Ln.from(Xu(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return Ln.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(Lf(n)||n[0]==="-"&&Lf(n.substring(1))))return Ln.from(n)}return Jo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function ga(r){if(typeof r!="string")return ga(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Jo.throwArgumentError("invalid hex","value",r),r=ga(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Si(r){return Np.from(ga(r))}function be(r){const t=Np.from(r).toHexString();return t[0]==="-"?new pa("-"+t.substring(3),16):new pa(t.substring(2),16)}function Yi(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),Jo.throwError(r,go.errors.NUMERIC_FAULT,n)}function kA(r){return new pa(r,36).toString(16)}function BA(r){return new pa(r,16).toString(36)}var Ny={exports:{}};(function(r){(function(){var t="input is invalid type",e="finalize already called",n=typeof window=="object",a=n?window:{};a.JS_SHA3_NO_WINDOW&&(n=!1);var f=!n&&typeof self=="object",c=!a.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;c?a=bi:f&&(a=self);var y=!a.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!a.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",w="0123456789abcdef".split(""),E=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],O=[1,256,65536,16777216],F=[6,1536,393216,100663296],B=[0,8,16,24],L=[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],z=[224,256,384,512],q=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],At={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),b&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var St=function(u,A,S){return function(_){return new o(u,A,u).update(_)[S]()}},Z=function(u,A,S){return function(_,P){return new o(u,A,P).update(_)[S]()}},Y=function(u,A,S){return function(_,P,K,$){return i["cshake"+u].update(_,P,K,$)[S]()}},Ct=function(u,A,S){return function(_,P,K,$){return i["kmac"+u].update(_,P,K,$)[S]()}},Tt=function(u,A,S,_){for(var P=0;P<V.length;++P){var K=V[P];u[K]=A(S,_,K)}return u},Rt=function(u,A){var S=St(u,A,"hex");return S.create=function(){return new o(u,A,u)},S.update=function(_){return S.create().update(_)},Tt(S,St,u,A)},Dt=function(u,A){var S=Z(u,A,"hex");return S.create=function(_){return new o(u,A,_)},S.update=function(_,P){return S.create(P).update(_)},Tt(S,Z,u,A)},I=function(u,A){var S=At[u],_=Y(u,A,"hex");return _.create=function(P,K,$){return!K&&!$?i["shake"+u].create(P):new o(u,A,P).bytepad([K,$],S)},_.update=function(P,K,$,U){return _.create(K,$,U).update(P)},Tt(_,Y,u,A)},N=function(u,A){var S=At[u],_=Ct(u,A,"hex");return _.create=function(P,K,$){return new g(u,A,K).bytepad(["KMAC",$],S).bytepad([P],S)},_.update=function(P,K,$,U){return _.create(P,$,U).update(K)},Tt(_,Ct,u,A)},d=[{name:"keccak",padding:O,bits:z,createMethod:Rt},{name:"sha3",padding:F,bits:z,createMethod:Rt},{name:"shake",padding:E,bits:q,createMethod:Dt},{name:"cshake",padding:M,bits:q,createMethod:I},{name:"kmac",padding:M,bits:q,createMethod:N}],i={},s=[],h=0;h<d.length;++h)for(var p=d[h],m=p.bits,v=0;v<m.length;++v){var x=p.name+"_"+m[v];if(s.push(x),i[x]=p.createMethod(m[v],p.padding),p.name!=="sha3"){var l=p.name+m[v];s.push(l),i[l]=i[x]}}function o(u,A,S){this.blocks=[],this.s=[],this.padding=A,this.outputBits=S,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(u<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var _=0;_<50;++_)this.s[_]=0}o.prototype.update=function(u){if(this.finalized)throw new Error(e);var A,S=typeof u;
7if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}for(var _=this.blocks,P=this.byteCount,K=u.length,$=this.blockCount,U=0,It=this.s,G,J;U<K;){if(this.reset)for(this.reset=!1,_[0]=this.block,G=1;G<$+1;++G)_[G]=0;if(A)for(G=this.start;U<K&&G<P;++U)_[G>>2]|=u[U]<<B[G++&3];else for(G=this.start;U<K&&G<P;++U)J=u.charCodeAt(U),J<128?_[G>>2]|=J<<B[G++&3]:J<2048?(_[G>>2]|=(192|J>>6)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):J<55296||J>=57344?(_[G>>2]|=(224|J>>12)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):(J=65536+((J&1023)<<10|u.charCodeAt(++U)&1023),_[G>>2]|=(240|J>>18)<<B[G++&3],_[G>>2]|=(128|J>>12&63)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]);if(this.lastByteIndex=G,G>=P){for(this.start=G-P,this.block=_[$],G=0;G<$;++G)It[G]^=_[G];C(It),this.reset=!0}else this.start=G}return this},o.prototype.encode=function(u,A){var S=u&255,_=1,P=[S];for(u=u>>8,S=u&255;S>0;)P.unshift(S),u=u>>8,S=u&255,++_;return A?P.push(_):P.unshift(_),this.update(P),P.length},o.prototype.encodeString=function(u){var A,S=typeof u;if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}var _=0,P=u.length;if(A)_=P;else for(var K=0;K<u.length;++K){var $=u.charCodeAt(K);$<128?_+=1:$<2048?_+=2:$<55296||$>=57344?_+=3:($=65536+(($&1023)<<10|u.charCodeAt(++K)&1023),_+=4)}return _+=this.encode(_*8),this.update(u),_},o.prototype.bytepad=function(u,A){for(var S=this.encode(A),_=0;_<u.length;++_)S+=this.encodeString(u[_]);var P=A-S%A,K=[];return K.length=P,this.update(K),this},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,A=this.lastByteIndex,S=this.blockCount,_=this.s;if(u[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(u[0]=u[S],A=1;A<S+1;++A)u[A]=0;for(u[S-1]|=2147483648,A=0;A<S;++A)_[A]^=u[A];C(_)}},o.prototype.toString=o.prototype.hex=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$="",U;K<S;){for(P=0;P<u&&K<S;++P,++K)U=A[P],$+=w[U>>4&15]+w[U&15]+w[U>>12&15]+w[U>>8&15]+w[U>>20&15]+w[U>>16&15]+w[U>>28&15]+w[U>>24&15];K%u===0&&(C(A),P=0)}return _&&(U=A[P],$+=w[U>>4&15]+w[U&15],_>1&&($+=w[U>>12&15]+w[U>>8&15]),_>2&&($+=w[U>>20&15]+w[U>>16&15])),$},o.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=this.outputBits>>3,U;_?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer($);for(var It=new Uint32Array(U);K<S;){for(P=0;P<u&&K<S;++P,++K)It[K]=A[P];K%u===0&&C(A)}return _&&(It[P]=A[P],U=U.slice(0,$)),U},o.prototype.buffer=o.prototype.arrayBuffer,o.prototype.digest=o.prototype.array=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=[],U,It;K<S;){for(P=0;P<u&&K<S;++P,++K)U=K<<2,It=A[P],$[U]=It&255,$[U+1]=It>>8&255,$[U+2]=It>>16&255,$[U+3]=It>>24&255;K%u===0&&C(A)}return _&&(U=K<<2,It=A[P],$[U]=It&255,_>1&&($[U+1]=It>>8&255),_>2&&($[U+2]=It>>16&255)),$};function g(u,A,S){o.call(this,u,A,S)}g.prototype=new o,g.prototype.finalize=function(){return this.encode(this.outputBits,!0),o.prototype.finalize.call(this)};var C=function(u){var A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht,jt,Mt,ut,Xt,Nt,lt,Zt,wt,Et,Qt,Yt,te,ee,re;for(_=0;_<48;_+=2)P=u[0]^u[10]^u[20]^u[30]^u[40],K=u[1]^u[11]^u[21]^u[31]^u[41],$=u[2]^u[12]^u[22]^u[32]^u[42],U=u[3]^u[13]^u[23]^u[33]^u[43],It=u[4]^u[14]^u[24]^u[34]^u[44],G=u[5]^u[15]^u[25]^u[35]^u[45],J=u[6]^u[16]^u[26]^u[36]^u[46],Gt=u[7]^u[17]^u[27]^u[37]^u[47],ct=u[8]^u[18]^u[28]^u[38]^u[48],rt=u[9]^u[19]^u[29]^u[39]^u[49],A=ct^($<<1|U>>>31),S=rt^(U<<1|$>>>31),u[0]^=A,u[1]^=S,u[10]^=A,u[11]^=S,u[20]^=A,u[21]^=S,u[30]^=A,u[31]^=S,u[40]^=A,u[41]^=S,A=P^(It<<1|G>>>31),S=K^(G<<1|It>>>31),u[2]^=A,u[3]^=S,u[12]^=A,u[13]^=S,u[22]^=A,u[23]^=S,u[32]^=A,u[33]^=S,u[42]^=A,u[43]^=S,A=$^(J<<1|Gt>>>31),S=U^(Gt<<1|J>>>31),u[4]^=A,u[5]^=S,u[14]^=A,u[15]^=S,u[24]^=A,u[25]^=S,u[34]^=A,u[35]^=S,u[44]^=A,u[45]^=S,A=It^(ct<<1|rt>>>31),S=G^(rt<<1|ct>>>31),u[6]^=A,u[7]^=S,u[16]^=A,u[17]^=S,u[26]^=A,u[27]^=S,u[36]^=A,u[37]^=S,u[46]^=A,u[47]^=S,A=J^(P<<1|K>>>31),S=Gt^(K<<1|P>>>31),u[8]^=A,u[9]^=S,u[18]^=A,u[19]^=S,u[28]^=A,u[29]^=S,u[38]^=A,u[39]^=S,u[48]^=A,u[49]^=S,qt=u[0],dt=u[1],at=u[11]<<4|u[10]>>>28,Vt=u[10]<<4|u[11]>>>28,D=u[20]<<3|u[21]>>>29,j=u[21]<<3|u[20]>>>29,Yt=u[31]<<9|u[30]>>>23,te=u[30]<<9|u[31]>>>23,xt=u[40]<<18|u[41]>>>14,st=u[41]<<18|u[40]>>>14,X=u[2]<<1|u[3]>>>31,Ft=u[3]<<1|u[2]>>>31,it=u[13]<<12|u[12]>>>20,Kt=u[12]<<12|u[13]>>>20,bt=u[22]<<10|u[23]>>>22,ht=u[23]<<10|u[22]>>>22,H=u[33]<<13|u[32]>>>19,W=u[32]<<13|u[33]>>>19,ee=u[42]<<2|u[43]>>>30,re=u[43]<<2|u[42]>>>30,Nt=u[5]<<30|u[4]>>>2,lt=u[4]<<30|u[5]>>>2,Q=u[14]<<6|u[15]>>>26,ot=u[15]<<6|u[14]>>>26,gt=u[25]<<11|u[24]>>>21,tt=u[24]<<11|u[25]>>>21,jt=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,Bt=u[45]<<29|u[44]>>>3,et=u[44]<<29|u[45]>>>3,mt=u[6]<<28|u[7]>>>4,k=u[7]<<28|u[6]>>>4,Zt=u[17]<<23|u[16]>>>
79,wt=u[16]<<23|u[17]>>>9,Ht=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Lt=u[36]<<21|u[37]>>>11,pt=u[37]<<21|u[36]>>>11,ut=u[47]<<24|u[46]>>>8,Xt=u[46]<<24|u[47]>>>8,Jt=u[8]<<27|u[9]>>>5,yt=u[9]<<27|u[8]>>>5,T=u[18]<<20|u[19]>>>12,R=u[19]<<20|u[18]>>>12,Et=u[29]<<7|u[28]>>>25,Qt=u[28]<<7|u[29]>>>25,ft=u[38]<<8|u[39]>>>24,Wt=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,$t=u[49]<<14|u[48]>>>18,u[0]=qt^~it&gt,u[1]=dt^~Kt&tt,u[10]=mt^~T&D,u[11]=k^~R&j,u[20]=X^~Q&Ht,u[21]=Ft^~ot&vt,u[30]=Jt^~at&bt,u[31]=yt^~Vt&ht,u[40]=Nt^~Zt&Et,u[41]=lt^~wt&Qt,u[2]=it^~gt&Lt,u[3]=Kt^~tt&pt,u[12]=T^~D&H,u[13]=R^~j&W,u[22]=Q^~Ht&ft,u[23]=ot^~vt&Wt,u[32]=at^~bt&jt,u[33]=Vt^~ht&Mt,u[42]=Zt^~Et&Yt,u[43]=wt^~Qt&te,u[4]=gt^~Lt&nt,u[5]=tt^~pt&$t,u[14]=D^~H&Bt,u[15]=j^~W&et,u[24]=Ht^~ft&xt,u[25]=vt^~Wt&st,u[34]=bt^~jt&ut,u[35]=ht^~Mt&Xt,u[44]=Et^~Yt&ee,u[45]=Qt^~te&re,u[6]=Lt^~nt&qt,u[7]=pt^~$t&dt,u[16]=H^~Bt&mt,u[17]=W^~et&k,u[26]=ft^~xt&X,u[27]=Wt^~st&Ft,u[36]=jt^~ut&Jt,u[37]=Mt^~Xt&yt,u[46]=Yt^~ee&Nt,u[47]=te^~re&lt,u[8]=nt^~qt&it,u[9]=$t^~dt&Kt,u[18]=Bt^~mt&T,u[19]=et^~k&R,u[28]=xt^~X&Q,u[29]=st^~Ft&ot,u[38]=ut^~Jt&at,u[39]=Xt^~yt&Vt,u[48]=ee^~Nt&Zt,u[49]=re^~lt&wt,u[0]^=L[_],u[1]^=L[_+1]};if(y)r.exports=i;else for(h=0;h<s.length;++h)a[s[h]]=i[s[h]]})()})(Ny);var UA=Ny.exports;const FA=Nr(UA);function _p(r){return"0x"+FA.keccak_256(m0(r))}const DA="rlp/5.7.0",LA=new go(DA);function Bg(r){const t=[];for(;r;)t.unshift(r&255),r>>=8;return t}function _y(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(f){n=n.concat(_y(f))}),n.length<=55)return n.unshift(192+n.length),n;const a=Bg(n.length);return a.unshift(247+a.length),a.concat(n)}IA(r)||LA.throwArgumentError("RLP object must be BytesLike","object",r);const t=Array.prototype.slice.call(m0(r));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const e=Bg(t.length);return e.unshift(183+e.length),e.concat(t)}function $A(r){return Xu(_y(r))}const GA="address/5.4.0",Cf=new go(GA);function Ug(r){Lf(r,20)||Cf.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let a=0;a<40;a++)e[a]=t[a].charCodeAt(0);const n=m0(_p(e));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const zA=9007199254740991;function qA(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const Sp={};for(let r=0;r<10;r++)Sp[String(r)]=String(r);for(let r=0;r<26;r++)Sp[String.fromCharCode(65+r)]=String(10+r);const Fg=Math.floor(qA(zA));function Sy(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>Sp[n]).join("");for(;t.length>=Fg;){let n=t.substring(0,Fg);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function $f(r){let t=null;if(typeof r!="string"&&Cf.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=Ug(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&Cf.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==Sy(r)&&Cf.throwArgumentError("bad icap checksum","address",r),t=kA(r.substring(4));t.length<40;)t="0"+t;t=Ug("0x"+t)}else Cf.throwArgumentError("invalid address","address",r);return t}function Iy(r){try{return $f(r),!0}catch{}return!1}function Ry(r){let t=BA($f(r).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+Sy("XE00"+t)+t}function Ty(r){let t=null;try{t=$f(r.from)}catch{Cf.throwArgumentError("missing from address","transaction",r)}const e=TA(m0(Np.from(r.nonce).toHexString()));return $f(My(_p($A([t,e])),12))}function Py(r,t,e){return Cg(t)!==32&&Cf.throwArgumentError("salt must be 32 bytes","salt",t),Cg(e)!==32&&Cf.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",e),$f(My(_p(RA(["0xff",$f(r),t,e])),12))}const nT=Object.freeze(Object.defineProperty({__proto__:null,getAddress:$f,getContractAddress:Ty,getCreate2Address:Py,getIcapAddress:Ry,isAddress:Iy},Symbol.toStringTag,{value:"Module"})),KA="logger/5.7.0";let Dg=!1,Lg=!1;const mh={debug:1,default:2,info:2,warning:3,error:4,off:5};let $g=mh.default,Hl=null;function HA(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Gg=HA();var yd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(yd||(yd={}));var jn;
7(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(jn||(jn={}));const zg="0123456789abcdef";let Ip=class Ir{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();mh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!($g>mh[n])&&console.log.apply(console,e)}debug(...t){this._log(Ir.levels.DEBUG,t)}info(...t){this._log(Ir.levels.INFO,t)}warn(...t){this._log(Ir.levels.WARNING,t)}makeError(t,e,n){if(Lg)return this.makeError("censored error",e,{});e||(e=Ir.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=zg[w[M]>>4],E+=zg[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case jn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case jn.CALL_EXCEPTION:case jn.INSUFFICIENT_FUNDS:case jn.MISSING_NEW:case jn.NONCE_EXPIRED:case jn.REPLACEMENT_UNDERPRICED:case jn.TRANSACTION_REPLACED:case jn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Ir.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Gg&&this.throwError("platform missing String.prototype.normalize",Ir.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Gg})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Ir.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Ir.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Ir.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Ir.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Ir.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Ir.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Ir.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Hl||(Hl=new Ir(KA)),Hl}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Ir.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Dg){if(!t)return;this.globalLogger().throwError("error censorship permanent",Ir.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Lg=!!t,Dg=!!e}static setLogLevel(t){const e=mh[t.toLowerCase()];if(e==null){Ir.globalLogger().warn("invalid log level - "+t);return}$g=e}static from(t){return new Ir(t)}};Ip.errors=jn;Ip.levels=yd;const WA="bytes/5.7.0",Wl=new Ip(WA);function JA(r){return!!r.toHexString}function vh(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return vh(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function qg(r){return typeof r=="number"&&r==r&&r%1===0}function VA(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
7if(typeof r=="string"||!qg(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!qg(e)||e<0||e>=256)return!1}return!0}function Cy(r,t){if(t||(t={}),typeof r=="number"){Wl.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),vh(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),JA(r)&&(r=r.toHexString()),jA(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":Wl.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return vh(new Uint8Array(n))}return VA(r)?vh(new Uint8Array(r)):Wl.throwArgumentError("invalid arrayify value","value",r)}function jA(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}function XA(r){r=atob(r);const t=[];for(let e=0;e<r.length;e++)t.push(r.charCodeAt(e));return Cy(t)}function ZA(r){r=Cy(r);let t="";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return btoa(t)}const QA=Object.freeze(Object.defineProperty({__proto__:null,decode:XA,encode:ZA},Symbol.toStringTag,{value:"Module"})),YA="logger/5.7.0";let Kg=!1,Hg=!1;const xh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Wg=xh.default,Jl=null;function tM(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Jg=tM();var bd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(bd||(bd={}));var Xn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Xn||(Xn={}));const Vg="0123456789abcdef";let Rp=class Rr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();xh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Wg>xh[n])&&console.log.apply(console,e)}debug(...t){this._log(Rr.levels.DEBUG,t)}info(...t){this._log(Rr.levels.INFO,t)}warn(...t){this._log(Rr.levels.WARNING,t)}makeError(t,e,n){if(Hg)return this.makeError("censored error",e,{});e||(e=Rr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Vg[w[M]>>4],E+=Vg[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case Xn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Xn.CALL_EXCEPTION:case Xn.INSUFFICIENT_FUNDS:case Xn.MISSING_NEW:case Xn.NONCE_EXPIRED:case Xn.REPLACEMENT_UNDERPRICED:case Xn.TRANSACTION_REPLACED:case Xn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Rr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Jg&&this.throwError("platform missing String.prototype.normalize",Rr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Jg})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Rr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Rr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Rr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Rr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Rr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Rr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Rr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Jl||(Jl=new Rr(YA)),Jl}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Rr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Kg){if(!t)return;this.globalLogger().throwError("error censorship permanent",Rr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Hg=!!t,Kg=!!e}static setLogLevel(t){const e=xh[t.toLowerCase()];if(e==null){Rr.globalLogger().warn("invalid log level - "+t);return}Wg=e}static from(t){return new Rr(t)}};Rp.errors=Xn;Rp.levels=bd;
7const eM="bytes/5.7.0",Vl=new Rp(eM);function rM(r){return!!r.toHexString}function yh(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return yh(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function jg(r){return typeof r=="number"&&r==r&&r%1===0}function iM(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!jg(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!jg(e)||e<0||e>=256)return!1}return!0}function Xg(r,t){if(t||(t={}),typeof r=="number"){Vl.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),yh(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),rM(r)&&(r=r.toHexString()),nM(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":Vl.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return yh(new Uint8Array(n))}return iM(r)?yh(new Uint8Array(r)):Vl.throwArgumentError("invalid arrayify value","value",r)}function nM(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}function Qa(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}let Tp=class{constructor(t){Qa(this,"alphabet",t),Qa(this,"base",t.length),Qa(this,"_alphabetMap",{}),Qa(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=Xg(t);if(e.length===0)return"";let n=[0];for(let f=0;f<e.length;++f){let c=e[f];for(let y=0;y<n.length;++y)c+=n[y]<<8,n[y]=c%this.base,c=c/this.base|0;for(;c>0;)n.push(c%this.base),c=c/this.base|0}let a="";for(let f=0;e[f]===0&&f<e.length-1;++f)a+=this._leader;for(let f=n.length-1;f>=0;--f)a+=this.alphabet[n[f]];return a}decode(t){if(typeof t!="string")throw new TypeError("Expected String");let e=[];
7if(t.length===0)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let a=this._alphabetMap[t[n]];if(a===void 0)throw new Error("Non-base"+this.base+" character");let f=a;for(let c=0;c<e.length;++c)f+=e[c]*this.base,e[c]=f&255,f>>=8;for(;f>0;)e.push(f&255),f>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return Xg(new Uint8Array(e.reverse()))}};const oM=new Tp("abcdefghijklmnopqrstuvwxyz234567"),Oy=new Tp("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),fT=Object.freeze(Object.defineProperty({__proto__:null,Base32:oM,Base58:Oy,BaseX:Tp},Symbol.toStringTag,{value:"Module"})),fM="logger/5.7.0";let Zg=!1,Qg=!1;const bh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Yg=bh.default,jl=null;function sM(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const tm=sM();var wd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(wd||(wd={}));var Zn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Zn||(Zn={}));const em="0123456789abcdef";let Pp=class Tr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();bh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Yg>bh[n])&&console.log.apply(console,e)}debug(...t){this._log(Tr.levels.DEBUG,t)}info(...t){this._log(Tr.levels.INFO,t)}warn(...t){this._log(Tr.levels.WARNING,t)}makeError(t,e,n){if(Qg)return this.makeError("censored error",e,{});e||(e=Tr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=em[w[M]>>4],E+=em[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case Zn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Zn.CALL_EXCEPTION:case Zn.INSUFFICIENT_FUNDS:case Zn.MISSING_NEW:case Zn.NONCE_EXPIRED:case Zn.REPLACEMENT_UNDERPRICED:case Zn.TRANSACTION_REPLACED:case Zn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Tr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){tm&&this.throwError("platform missing String.prototype.normalize",Tr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:tm})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Tr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Tr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Tr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Tr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Tr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Tr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Tr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return jl||(jl=new Tr(fM)),jl}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Tr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Zg){if(!t)return;this.globalLogger().throwError("error censorship permanent",Tr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Qg=!!t,Zg=!!e}static setLogLevel(t){const e=bh[t.toLowerCase()];if(e==null){Tr.globalLogger().warn("invalid log level - "+t);return}Yg=e}static from(t){return new Tr(t)}};Pp.errors=Zn;Pp.levels=wd;const aM="bytes/5.4.0",ur=new Pp(aM);function ky(r){return!!r.toHexString}function Ws(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Ws(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function Cp(r){return pn(r)&&!(r.length%2)||Da(r)}function Da(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
7if(typeof r=="string"||r.length==null)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(typeof e!="number"||e<0||e>=256||e%1)return!1}return!0}function kf(r,t){if(t||(t={}),typeof r=="number"){ur.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Ws(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),ky(r)&&(r=r.toHexString()),pn(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":ur.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Ws(new Uint8Array(n))}return Da(r)?Ws(new Uint8Array(r)):ur.throwArgumentError("invalid arrayify value","value",r)}function Op(r){const t=r.map(a=>kf(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),Ws(n)}function By(r){let t=kf(r);if(t.length===0)return t;let e=0;for(;e<t.length&&t[e]===0;)e++;return e&&(t=t.slice(e)),t}function kp(r,t){r=kf(r),r.length>t&&ur.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),Ws(e)}function pn(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const Xl="0123456789abcdef";function Ai(r,t){if(t||(t={}),typeof r=="number"){ur.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Xl[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),ky(r))return r.toHexString();if(pn(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":ur.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Da(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Xl[(a&240)>>4]+Xl[a&15]}return e}return ur.throwArgumentError("invalid hexlify value","value",r)}function Uy(r){if(typeof r!="string")r=Ai(r);else if(!pn(r)||r.length%2)return null;return(r.length-2)/2}function Fy(r,t,e){return typeof r!="string"?r=Ai(r):(!pn(r)||r.length%2)&&ur.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function Dy(r){let t="0x";return r.forEach(e=>{t+=Ai(e).substring(2)}),t}function Ly(r){const t=Bp(Ai(r,{hexPad:"left"}));return t==="0x"?"0x0":t}function Bp(r){typeof r!="string"&&(r=Ai(r)),pn(r)||ur.throwArgumentError("invalid hex string","value",r),r=r.substring(2);let t=0;for(;t<r.length&&r[t]==="0";)t++;return"0x"+r.substring(t)}function Y0(r,t){for(typeof r!="string"?r=Ai(r):pn(r)||ur.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&ur.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function Up(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(Cp(r)){const e=kf(r);e.length!==65&&ur.throwArgumentError("invalid signature string; must be 65 bytes","signature",r),t.r=Ai(e.slice(0,32)),t.s=Ai(e.slice(32,64)),t.v=e[64],t.v<27&&(t.v===0||t.v===1?t.v+=27:ur.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=Ai(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const a=kp(kf(t._vs),32);t._vs=Ai(a);const f=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=f:t.recoveryParam!==f&&ur.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),a[0]&=127;const c=Ai(a);t.s==null?t.s=c:t.s!==c&&ur.throwArgumentError("signature v mismatch _vs","signature",r)}t.recoveryParam==null?t.v==null?ur.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2:t.v==null?t.v=27+t.recoveryParam:t.recoveryParam!==1-t.v%2&&ur.throwArgumentError("signature recoveryParam mismatch v","signature",r),t.r==null||!pn(t.r)?ur.throwArgumentError("signature missing or invalid r","signature",r):t.r=Y0(t.r,32),t.s==null||!pn(t.s)?ur.throwArgumentError("signature missing or invalid s","signature",r):t.s=Y0(t.s,32);const e=kf(t.s);e[0]>=128&&ur.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=Ai(e);t._vs&&(pn(t._vs)||ur.throwArgumentError("signature invalid _vs","signature",r),t._vs=Y0(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&ur.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t}function $y(r){return r=Up(r),Ai(Op([r.r,r.s,r.recoveryParam?"0x1c":"0x1b"]))}const sT=Object.freeze(Object.defineProperty({__proto__:null,arrayify:kf,concat:Op,hexConcat:Dy,hexDataLength:Uy,hexDataSlice:Fy,hexStripZeros:Bp,hexValue:Ly,hexZeroPad:Y0,hexlify:Ai,isBytes:Da,isBytesLike:Cp,isHexString:pn,joinSignature:$y,splitSignature:Up,stripZeros:By,zeroPad:kp},Symbol.toStringTag,{value:"Module"}));var Gy={exports:{}};
7(function(r){(function(){var t="input is invalid type",e="finalize already called",n=typeof window=="object",a=n?window:{};a.JS_SHA3_NO_WINDOW&&(n=!1);var f=!n&&typeof self=="object",c=!a.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;c?a=bi:f&&(a=self);var y=!a.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!a.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",w="0123456789abcdef".split(""),E=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],O=[1,256,65536,16777216],F=[6,1536,393216,100663296],B=[0,8,16,24],L=[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],z=[224,256,384,512],q=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],At={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),b&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var St=function(u,A,S){return function(_){return new o(u,A,u).update(_)[S]()}},Z=function(u,A,S){return function(_,P){return new o(u,A,P).update(_)[S]()}},Y=function(u,A,S){return function(_,P,K,$){return i["cshake"+u].update(_,P,K,$)[S]()}},Ct=function(u,A,S){return function(_,P,K,$){return i["kmac"+u].update(_,P,K,$)[S]()}},Tt=function(u,A,S,_){for(var P=0;P<V.length;++P){var K=V[P];u[K]=A(S,_,K)}return u},Rt=function(u,A){var S=St(u,A,"hex");return S.create=function(){return new o(u,A,u)},S.update=function(_){return S.create().update(_)},Tt(S,St,u,A)},Dt=function(u,A){var S=Z(u,A,"hex");return S.create=function(_){return new o(u,A,_)},S.update=function(_,P){return S.create(P).update(_)},Tt(S,Z,u,A)},I=function(u,A){var S=At[u],_=Y(u,A,"hex");return _.create=function(P,K,$){return!K&&!$?i["shake"+u].create(P):new o(u,A,P).bytepad([K,$],S)},_.update=function(P,K,$,U){return _.create(K,$,U).update(P)},Tt(_,Y,u,A)},N=function(u,A){var S=At[u],_=Ct(u,A,"hex");return _.create=function(P,K,$){return new g(u,A,K).bytepad(["KMAC",$],S).bytepad([P],S)},_.update=function(P,K,$,U){return _.create(P,$,U).update(K)},Tt(_,Ct,u,A)},d=[{name:"keccak",padding:O,bits:z,createMethod:Rt},{name:"sha3",padding:F,bits:z,createMethod:Rt},{name:"shake",padding:E,bits:q,createMethod:Dt},{name:"cshake",padding:M,bits:q,createMethod:I},{name:"kmac",padding:M,bits:q,createMethod:N}],i={},s=[],h=0;h<d.length;++h)for(var p=d[h],m=p.bits,v=0;v<m.length;++v){var x=p.name+"_"+m[v];if(s.push(x),i[x]=p.createMethod(m[v],p.padding),p.name!=="sha3"){var l=p.name+m[v];s.push(l),i[l]=i[x]}}function o(u,A,S){this.blocks=[],this.s=[],this.padding=A,this.outputBits=S,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(u<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var _=0;_<50;++_)this.s[_]=0}o.prototype.update=function(u){if(this.finalized)throw new Error(e);var A,S=typeof u;if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}for(var _=this.blocks,P=this.byteCount,K=u.length,$=this.blockCount,U=0,It=this.s,G,J;U<K;){if(this.reset)for(this.reset=!1,_[0]=this.block,G=1;G<$+1;++G)_[G]=0;if(A)for(G=this.start;U<K&&G<P;++U)_[G>>2]|=u[U]<<B[G++&3];else for(G=this.start;U<K&&G<P;++U)J=u.charCodeAt(U),J<128?_[G>>2]|=J<<B[G++&3]:J<2048?(_[G>>2]|=(192|J>>6)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):J<55296||J>=57344?(_[G>>2]|=(224|J>>12)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):(J=65536+((J&1023)<<10|u.charCodeAt(++U)&1023),_[G>>2]|=(240|J>>18)<<B[G++&3],_[G>>2]|=(128|J>>12&63)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]);if(this.lastByteIndex=G,G>=P){for(this.start=G-P,this.block=_[$],G=0;G<$;++G)It[G]^=_[G];C(It),this.reset=!0}else this.start=G}return this},o.prototype.encode=function(u,A){var S=u&255,_=1,P=[S];for(u=u>>8,S=u&255;S>0;)P.unshift(S),u=u>>8,S=u&255,++_;return A?P.push(_):P.unshift(_),this.update(P),P.length},o.prototype.encodeString=function(u){var A,S=typeof u;
7if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}var _=0,P=u.length;if(A)_=P;else for(var K=0;K<u.length;++K){var $=u.charCodeAt(K);$<128?_+=1:$<2048?_+=2:$<55296||$>=57344?_+=3:($=65536+(($&1023)<<10|u.charCodeAt(++K)&1023),_+=4)}return _+=this.encode(_*8),this.update(u),_},o.prototype.bytepad=function(u,A){for(var S=this.encode(A),_=0;_<u.length;++_)S+=this.encodeString(u[_]);var P=A-S%A,K=[];return K.length=P,this.update(K),this},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,A=this.lastByteIndex,S=this.blockCount,_=this.s;if(u[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(u[0]=u[S],A=1;A<S+1;++A)u[A]=0;for(u[S-1]|=2147483648,A=0;A<S;++A)_[A]^=u[A];C(_)}},o.prototype.toString=o.prototype.hex=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$="",U;K<S;){for(P=0;P<u&&K<S;++P,++K)U=A[P],$+=w[U>>4&15]+w[U&15]+w[U>>12&15]+w[U>>8&15]+w[U>>20&15]+w[U>>16&15]+w[U>>28&15]+w[U>>24&15];K%u===0&&(C(A),P=0)}return _&&(U=A[P],$+=w[U>>4&15]+w[U&15],_>1&&($+=w[U>>12&15]+w[U>>8&15]),_>2&&($+=w[U>>20&15]+w[U>>16&15])),$},o.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=this.outputBits>>3,U;_?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer($);for(var It=new Uint32Array(U);K<S;){for(P=0;P<u&&K<S;++P,++K)It[K]=A[P];K%u===0&&C(A)}return _&&(It[P]=A[P],U=U.slice(0,$)),U},o.prototype.buffer=o.prototype.arrayBuffer,o.prototype.digest=o.prototype.array=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=[],U,It;K<S;){for(P=0;P<u&&K<S;++P,++K)U=K<<2,It=A[P],$[U]=It&255,$[U+1]=It>>8&255,$[U+2]=It>>16&255,$[U+3]=It>>24&255;K%u===0&&C(A)}return _&&(U=K<<2,It=A[P],$[U]=It&255,_>1&&($[U+1]=It>>8&255),_>2&&($[U+2]=It>>16&255)),$};function g(u,A,S){o.call(this,u,A,S)}g.prototype=new o,g.prototype.finalize=function(){return this.encode(this.outputBits,!0),o.prototype.finalize.call(this)};var C=function(u){var A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht,jt,Mt,ut,Xt,Nt,lt,Zt,wt,Et,Qt,Yt,te,ee,re;for(_=0;_<48;_+=2)P=u[0]^u[10]^u[20]^u[30]^u[40],K=u[1]^u[11]^u[21]^u[31]^u[41],$=u[2]^u[12]^u[22]^u[32]^u[42],U=u[3]^u[13]^u[23]^u[33]^u[43],It=u[4]^u[14]^u[24]^u[34]^u[44],G=u[5]^u[15]^u[25]^u[35]^u[45],J=u[6]^u[16]^u[26]^u[36]^u[46],Gt=u[7]^u[17]^u[27]^u[37]^u[47],ct=u[8]^u[18]^u[28]^u[38]^u[48],rt=u[9]^u[19]^u[29]^u[39]^u[49],A=ct^($<<1|U>>>31),S=rt^(U<<1|$>>>31),u[0]^=A,u[1]^=S,u[10]^=A,u[11]^=S,u[20]^=A,u[21]^=S,u[30]^=A,u[31]^=S,u[40]^=A,u[41]^=S,A=P^(It<<1|G>>>31),S=K^(G<<1|It>>>31),u[2]^=A,u[3]^=S,u[12]^=A,u[13]^=S,u[22]^=A,u[23]^=S,u[32]^=A,u[33]^=S,u[42]^=A,u[43]^=S,A=$^(J<<1|Gt>>>31),S=U^(Gt<<1|J>>>31),u[4]^=A,u[5]^=S,u[14]^=A,u[15]^=S,u[24]^=A,u[25]^=S,u[34]^=A,u[35]^=S,u[44]^=A,u[45]^=S,A=It^(ct<<1|rt>>>31),S=G^(rt<<1|ct>>>31),u[6]^=A,u[7]^=S,u[16]^=A,u[17]^=S,u[26]^=A,u[27]^=S,u[36]^=A,u[37]^=S,u[46]^=A,u[47]^=S,A=J^(P<<1|K>>>31),S=Gt^(K<<1|P>>>31),u[8]^=A,u[9]^=S,u[18]^=A,u[19]^=S,u[28]^=A,u[29]^=S,u[38]^=A,u[39]^=S,u[48]^=A,u[49]^=S,qt=u[0],dt=u[1],at=u[11]<<4|u[10]>>>28,Vt=u[10]<<4|u[11]>>>28,D=u[20]<<3|u[21]>>>29,j=u[21]<<3|u[20]>>>29,Yt=u[31]<<9|u[30]>>>23,te=u[30]<<9|u[31]>>>23,xt=u[40]<<18|u[41]>>>14,st=u[41]<<18|u[40]>>>14,X=u[2]<<1|u[3]>>>31,Ft=u[3]<<1|u[2]>>>31,it=u[13]<<12|u[12]>>>20,Kt=u[12]<<12|u[13]>>>20,bt=u[22]<<10|u[23]>>>22,ht=u[23]<<10|u[22]>>>22,H=u[33]<<13|u[32]>>>19,W=u[32]<<13|u[33]>>>19,ee=u[42]<<2|u[43]>>>30,re=u[43]<<2|u[42]>>>30,Nt=u[5]<<30|u[4]>>>2,lt=u[4]<<30|u[5]>>>2,Q=u[14]<<6|u[15]>>>26,ot=u[15]<<6|u[14]>>>26,gt=u[25]<<11|u[24]>>>21,tt=u[24]<<11|u[25]>>>21,jt=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,Bt=u[45]<<29|u[44]>>>3,et=u[44]<<29|u[45]>>>3,mt=u[6]<<28|u[7]>>>4,k=u[7]<<28|u[6]>>>4,Zt=u[17]<<23|u[16]>>>
79,wt=u[16]<<23|u[17]>>>9,Ht=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Lt=u[36]<<21|u[37]>>>11,pt=u[37]<<21|u[36]>>>11,ut=u[47]<<24|u[46]>>>8,Xt=u[46]<<24|u[47]>>>8,Jt=u[8]<<27|u[9]>>>5,yt=u[9]<<27|u[8]>>>5,T=u[18]<<20|u[19]>>>12,R=u[19]<<20|u[18]>>>12,Et=u[29]<<7|u[28]>>>25,Qt=u[28]<<7|u[29]>>>25,ft=u[38]<<8|u[39]>>>24,Wt=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,$t=u[49]<<14|u[48]>>>18,u[0]=qt^~it&gt,u[1]=dt^~Kt&tt,u[10]=mt^~T&D,u[11]=k^~R&j,u[20]=X^~Q&Ht,u[21]=Ft^~ot&vt,u[30]=Jt^~at&bt,u[31]=yt^~Vt&ht,u[40]=Nt^~Zt&Et,u[41]=lt^~wt&Qt,u[2]=it^~gt&Lt,u[3]=Kt^~tt&pt,u[12]=T^~D&H,u[13]=R^~j&W,u[22]=Q^~Ht&ft,u[23]=ot^~vt&Wt,u[32]=at^~bt&jt,u[33]=Vt^~ht&Mt,u[42]=Zt^~Et&Yt,u[43]=wt^~Qt&te,u[4]=gt^~Lt&nt,u[5]=tt^~pt&$t,u[14]=D^~H&Bt,u[15]=j^~W&et,u[24]=Ht^~ft&xt,u[25]=vt^~Wt&st,u[34]=bt^~jt&ut,u[35]=ht^~Mt&Xt,u[44]=Et^~Yt&ee,u[45]=Qt^~te&re,u[6]=Lt^~nt&qt,u[7]=pt^~$t&dt,u[16]=H^~Bt&mt,u[17]=W^~et&k,u[26]=ft^~xt&X,u[27]=Wt^~st&Ft,u[36]=jt^~ut&Jt,u[37]=Mt^~Xt&yt,u[46]=Yt^~ee&Nt,u[47]=te^~re&lt,u[8]=nt^~qt&it,u[9]=$t^~dt&Kt,u[18]=Bt^~mt&T,u[19]=et^~k&R,u[28]=xt^~X&Q,u[29]=st^~Ft&ot,u[38]=ut^~Jt&at,u[39]=Xt^~yt&Vt,u[48]=ee^~Nt&Zt,u[49]=re^~lt&wt,u[0]^=L[_],u[1]^=L[_+1]};if(y)r.exports=i;else for(h=0;h<s.length;++h)a[s[h]]=i[s[h]]})()})(Gy);var hM=Gy.exports;const uM=Nr(hM),lM="logger/5.7.0";let rm=!1,im=!1;const wh={debug:1,default:2,info:2,warning:3,error:4,off:5};let nm=wh.default,Zl=null;function cM(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const om=cM();var Ed;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Ed||(Ed={}));var Qn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Qn||(Qn={}));const fm="0123456789abcdef";let Ui=class Pr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();wh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(nm>wh[n])&&console.log.apply(console,e)}debug(...t){this._log(Pr.levels.DEBUG,t)}info(...t){this._log(Pr.levels.INFO,t)}warn(...t){this._log(Pr.levels.WARNING,t)}makeError(t,e,n){if(im)return this.makeError("censored error",e,{});e||(e=Pr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=fm[w[M]>>4],E+=fm[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case Qn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Qn.CALL_EXCEPTION:case Qn.INSUFFICIENT_FUNDS:case Qn.MISSING_NEW:case Qn.NONCE_EXPIRED:case Qn.REPLACEMENT_UNDERPRICED:case Qn.TRANSACTION_REPLACED:case Qn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Pr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){om&&this.throwError("platform missing String.prototype.normalize",Pr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:om})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Pr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Pr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Pr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Pr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Pr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Pr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Pr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Zl||(Zl=new Pr(lM)),Zl}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Pr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),rm){if(!t)return;this.globalLogger().throwError("error censorship permanent",Pr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}im=!!t,rm=!!e}static setLogLevel(t){const e=wh[t.toLowerCase()];if(e==null){Pr.globalLogger().warn("invalid log level - "+t);return}nm=e}static from(t){return new Pr(t)}};Ui.errors=Qn;Ui.levels=Ed;const dM="bytes/5.7.0",Bf=new Ui(dM);function zy(r){return!!r.toHexString}function ta(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return ta(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function sm(r){return typeof r=="number"&&r==r&&r%1===0}function Fp(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
7if(typeof r=="string"||!sm(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!sm(e)||e<0||e>=256)return!1}return!0}function xf(r,t){if(t||(t={}),typeof r=="number"){Bf.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),ta(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),zy(r)&&(r=r.toHexString()),Gf(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":Bf.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return ta(new Uint8Array(n))}return Fp(r)?ta(new Uint8Array(r)):Bf.throwArgumentError("invalid arrayify value","value",r)}function qy(r){const t=r.map(a=>xf(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),ta(n)}function Gf(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const Ql="0123456789abcdef";function xs(r,t){if(t||(t={}),typeof r=="number"){Bf.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Ql[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),zy(r))return r.toHexString();if(Gf(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":Bf.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Fp(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Ql[(a&240)>>4]+Ql[a&15]}return e}return Bf.throwArgumentError("invalid hexlify value","value",r)}function Eh(r){let t="0x";return r.forEach(e=>{t+=xs(e).substring(2)}),t}function uu(r,t){for(typeof r!="string"?r=xs(r):Gf(r)||Bf.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&Bf.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function co(r){return"0x"+uM.keccak_256(xf(r))}var Dp={exports:{}};Dp.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};
vendor: 36,417 bytes, line 7
7function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
7function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(Dp);var pM=Dp.exports;const gM=Nr(pM),mM="bignumber/5.7.0";var lu=gM.BN;const Vo=new Ui(mM),Yl={},am=9007199254740991;let hm=!1,yf=class $n{constructor(t,e){t!==Yl&&Vo.throwError("cannot call constructor directly; use BigNumber.from",Ui.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Ii(we(this).fromTwos(t))}toTwos(t){return Ii(we(this).toTwos(t))}abs(){return this._hex[0]==="-"?$n.from(this._hex.substring(1)):this}add(t){return Ii(we(this).add(we(t)))}sub(t){return Ii(we(this).sub(we(t)))}div(t){return $n.from(t).isZero()&&tn("division-by-zero","div"),Ii(we(this).div(we(t)))}mul(t){return Ii(we(this).mul(we(t)))}mod(t){const e=we(t);return e.isNeg()&&tn("division-by-zero","mod"),Ii(we(this).umod(e))}pow(t){const e=we(t);return e.isNeg()&&tn("negative-power","pow"),Ii(we(this).pow(e))}and(t){const e=we(t);return(this.isNegative()||e.isNeg())&&tn("unbound-bitwise-result","and"),Ii(we(this).and(e))}or(t){const e=we(t);return(this.isNegative()||e.isNeg())&&tn("unbound-bitwise-result","or"),Ii(we(this).or(e))}xor(t){const e=we(t);return(this.isNegative()||e.isNeg())&&tn("unbound-bitwise-result","xor"),Ii(we(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&tn("negative-width","mask"),Ii(we(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&tn("negative-width","shl"),Ii(we(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&tn("negative-width","shr"),Ii(we(this).shrn(t))}eq(t){return we(this).eq(we(t))}lt(t){return we(this).lt(we(t))}lte(t){return we(this).lte(we(t))}gt(t){return we(this).gt(we(t))}gte(t){return we(this).gte(we(t))}isNegative(){return this._hex[0]==="-"}isZero(){return we(this).isZero()}toNumber(){try{return we(this).toNumber()}catch{tn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Vo.throwError("this platform does not support BigInt",Ui.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?hm||(hm=!0,Vo.warn("BigNumber.toString does not accept any parameters;
7 base-10 is assumed")):arguments[0]===16?Vo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ui.errors.UNEXPECTED_ARGUMENT,{}):Vo.throwError("BigNumber.toString does not accept parameters",Ui.errors.UNEXPECTED_ARGUMENT,{})),we(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof $n)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new $n(Yl,ma(t)):t.match(/^-?[0-9]+$/)?new $n(Yl,ma(new lu(t))):Vo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&tn("underflow","BigNumber.from",t),(t>=am||t<=-am)&&tn("overflow","BigNumber.from",t),$n.from(String(t));const e=t;if(typeof e=="bigint")return $n.from(e.toString());if(Fp(e))return $n.from(xs(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return $n.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(Gf(n)||n[0]==="-"&&Gf(n.substring(1))))return $n.from(n)}return Vo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function ma(r){if(typeof r!="string")return ma(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Vo.throwArgumentError("invalid hex","value",r),r=ma(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Ii(r){return yf.from(ma(r))}function we(r){const t=yf.from(r).toHexString();return t[0]==="-"?new lu("-"+t.substring(3),16):new lu(t.substring(2),16)}function tn(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),Vo.throwError(r,Ui.errors.NUMERIC_FAULT,n)}function vM(r){return new lu(r,36).toString(16)}const xM="strings/5.7.0",Ky=new Ui(xM);var f0;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(f0||(f0={}));var $i;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})($i||($i={}));function yM(r,t,e,n,a){return Ky.throwArgumentError(`invalid codepoint at offset ${t}; ${r}`,"bytes",e)}function Hy(r,t,e,n,a){if(r===$i.BAD_PREFIX||r===$i.UNEXPECTED_CONTINUE){let f=0;for(let c=t+1;c<e.length&&e[c]>>6===2;c++)f++;return f}return r===$i.OVERRUN?e.length-t-1:0}function bM(r,t,e,n,a){return r===$i.OVERLONG?(n.push(a),0):(n.push(65533),Hy(r,t,e))}const wM=Object.freeze({error:yM,ignore:Hy,replace:bM});function EM(r,t){t==null&&(t=wM.error),r=xf(r);const e=[];let n=0;for(;n<r.length;){const a=r[n++];if(!(a>>7)){e.push(a);continue}let f=null,c=null;if((a&224)===192)f=1,c=127;else if((a&240)===224)f=2,c=2047;else if((a&248)===240)f=3,c=65535;else{(a&192)===128?n+=t($i.UNEXPECTED_CONTINUE,n-1,r,e):n+=t($i.BAD_PREFIX,n-1,r,e);continue}if(n-1+f>=r.length){n+=t($i.OVERRUN,n-1,r,e);continue}let y=a&(1<<8-f-1)-1;for(let b=0;b<f;b++){let w=r[n];if((w&192)!=128){n+=t($i.MISSING_CONTINUE,n,r,e),y=null;break}y=y<<6|w&63,n++}if(y!==null){if(y>1114111){n+=t($i.OUT_OF_RANGE,n-1-f,r,e,y);continue}if(y>=55296&&y<=57343){n+=t($i.UTF16_SURROGATE,n-1-f,r,e,y);continue}if(y<=c){n+=t($i.OVERLONG,n-1-f,r,e,y);continue}e.push(y)}}return e}function Js(r,t=f0.current){t!=f0.current&&(Ky.checkNormalize(),r=r.normalize(t));let e=[];for(let n=0;n<r.length;n++){const a=r.charCodeAt(n);if(a<128)e.push(a);else if(a<2048)e.push(a>>6|192),e.push(a&63|128);else if((a&64512)==55296){n++;const f=r.charCodeAt(n);if(n>=r.length||(f&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((a&1023)<<10)+(f&1023);e.push(c>>18|240),e.push(c>>12&63|128),e.push(c>>6&63|128),e.push(c&63|128)}else e.push(a>>12|224),e.push(a>>6&63|128),e.push(a&63|128)}return xf(e)}function um(r){return r.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function lm(r,t=f0.current){return EM(Js(r,t))}function AM(r){if(r.length%4!==0)throw new Error("bad data");let t=[];for(let e=0;e<r.length;e+=4)t.push(parseInt(r.substring(e,e+4),16));return t}function Lp(r,t){t||(t=function(a){return[parseInt(a,16)]});let e=0,n={};return r.split(",").forEach(a=>{let f=a.split(":");
7e+=parseInt(f[0],16),n[e]=t(f[1])}),n}function Wy(r){let t=0;return r.split(",").map(e=>{let n=e.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let a=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:a,h:t}})}function $p(r,t){let e=0;for(let n=0;n<t.length;n++){let a=t[n];if(e+=a.l,r>=e&&r<=e+a.h&&(r-e)%(a.d||1)===0){if(a.e&&a.e.indexOf(r-e)!==-1)continue;return a}}return null}const MM=Wy("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),NM="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),_M=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],SM=Lp("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),IM=Lp("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),RM=Lp("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",AM),TM=Wy("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function PM(r){return r.reduce((t,e)=>(e.forEach(n=>{t.push(n)}),t),[])}function CM(r){return!!$p(r,MM)}function OM(r){let t=$p(r,_M);if(t)return[r+t.s];let e=SM[r];if(e)return e;let n=IM[r];if(n)return[r+n[0]];let a=RM[r];return a||null}function kM(r){return!!$p(r,TM)}function Jy(r){if(r.match(/^[a-z0-9-]*$/i)&&r.length<=59)return r.toLowerCase();let t=lm(r);t=PM(t.map(n=>{if(NM.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let a=OM(n);return a||[n]})),t=lm(um(t),f0.NFKC),t.forEach(n=>{if(kM(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(n=>{if(CM(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let e=um(t);if(e.substring(0,1)==="-"||e.substring(2,4)==="--"||e.substring(e.length-1)==="-")throw new Error("invalid hyphen");return e}function Zu(r){return co(Js(r))}const Vy="hash/5.4.0",cm=new Ui(Vy),jy=new Uint8Array(32);jy.fill(0);const BM=new RegExp("^((.*)\\.)?([^.]+)$");function Xy(r){try{const t=r.split(".");for(let e=0;e<t.length;e++)if(Jy(t[e]).length===0)throw new Error("empty");return!0}catch{}return!1}function Zy(r){typeof r!="string"&&cm.throwArgumentError("invalid ENS name; not a string","name",r);let t=r,e=jy;for(;t.length;){const n=t.match(BM);(n==null||n[2]==="")&&cm.throwArgumentError("invalid ENS address; missing component","name",r);const a=Js(Jy(n[3]));e=co(qy([e,co(a)])),t=n[2]||""}return xs(e)}const Qy=`�Ethereum Signed Message:
8`;function Yy(r){return typeof r=="string"&&(r=Js(r)),co(qy([Js(Qy),Js(String(r.length)),r]))}const UM="address/5.7.0",z0=new Ui(UM);function dm(r){Gf(r,20)||z0.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let a=0;a<40;
8a++)e[a]=t[a].charCodeAt(0);const n=xf(co(e));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const FM=9007199254740991;function DM(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const Gp={};for(let r=0;r<10;r++)Gp[String(r)]=String(r);for(let r=0;r<26;r++)Gp[String.fromCharCode(65+r)]=String(10+r);const pm=Math.floor(DM(FM));function LM(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>Gp[n]).join("");for(;t.length>=pm;){let n=t.substring(0,pm);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function tb(r){let t=null;if(typeof r!="string"&&z0.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=dm(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&z0.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==LM(r)&&z0.throwArgumentError("bad icap checksum","address",r),t=vM(r.substring(4));t.length<40;)t="0"+t;t=dm("0x"+t)}else z0.throwArgumentError("invalid address","address",r);return t}const $M="properties/5.7.0",eb=new Ui($M);function q0(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function gm(r){const t={};for(const e in r)t[e]=r[e];return t}const GM={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function rb(r){if(r==null||GM[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!rb(n))return!1}return!0}return eb.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function zM(r){if(rb(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>Ad(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&q0(t,e,Ad(n))}return t}return eb.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function Ad(r){return zM(r)}var qM=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const sr=new Ui(Vy),ib=new Uint8Array(32);ib.fill(0);const KM=yf.from(-1),nb=yf.from(0),ob=yf.from(1),HM=yf.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function WM(r){const t=xf(r),e=t.length%32;return e?Eh([t,ib.slice(e)]):xs(t)}const JM=uu(ob.toHexString(),32),VM=uu(nb.toHexString(),32),mm={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},tc=["name","version","chainId","verifyingContract","salt"];function vm(r){return function(t){return typeof t!="string"&&sr.throwArgumentError(`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,t),t}}const jM={name:vm("name"),version:vm("version"),chainId:function(r){try{return yf.from(r).toString()}catch{}return sr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",r)},verifyingContract:function(r){try{return tb(r).toLowerCase()}catch{}return sr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){try{const t=xf(r);if(t.length!==32)throw new Error("bad length");return xs(t)}catch{}return sr.throwArgumentError('invalid domain value "salt"',"domain.salt",r)}};function ec(r){{const t=r.match(/^(u?)int(\d*)$/);if(t){const e=t[1]==="",n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&sr.throwArgumentError("invalid numeric width","type",r);const a=HM.mask(e?n-1:n),f=e?a.add(ob).mul(KM):nb;return function(c){const y=yf.from(c);return(y.lt(f)||y.gt(a))&&sr.throwArgumentError(`value out-of-bounds for ${r}`,"value",c),uu(y.toTwos(256).toHexString(),32)}}}{const t=r.match(/^bytes(\d+)$/);if(t){const e=parseInt(t[1]);return(e===0||e>32||t[1]!==String(e))&&sr.throwArgumentError("invalid bytes width","type",r),function(n){return xf(n).length!==e&&sr.throwArgumentError(`invalid length for ${r}`,"value",n),WM(n)}}}switch(r){case"address":return function(t){return uu(tb(t),32)};case"bool":return function(t){return t?JM:VM};case"bytes":return function(t){return co(t)};case"string":return function(t){return Zu(t)}}return null}function xm(r,t){return`${r}(${t.map(({name:e,type:n})=>n+" "+e).join(",")})`}let fb=class Gn{constructor(t){q0(this,"types",Object.freeze(Ad(t))),q0(this,"_encoderCache",{}),q0(this,"_types",{});const e={},n={},a={};Object.keys(t).forEach(y=>{e[y]={},n[y]=[],a[y]={}});for(const y in t){const b={};
8t[y].forEach(w=>{b[w.name]&&sr.throwArgumentError(`duplicate variable name ${JSON.stringify(w.name)} in ${JSON.stringify(y)}`,"types",t),b[w.name]=!0;const E=w.type.match(/^([^\x5b]*)(\x5b|$)/)[1];E===y&&sr.throwArgumentError(`circular type reference to ${JSON.stringify(E)}`,"types",t),!ec(E)&&(n[E]||sr.throwArgumentError(`unknown type ${JSON.stringify(E)}`,"types",t),n[E].push(y),e[y][E]=!0)})}const f=Object.keys(n).filter(y=>n[y].length===0);f.length===0?sr.throwArgumentError("missing primary type","types",t):f.length>1&&sr.throwArgumentError(`ambiguous primary types or unused types: ${f.map(y=>JSON.stringify(y)).join(", ")}`,"types",t),q0(this,"primaryType",f[0]);function c(y,b){b[y]&&sr.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",t),b[y]=!0,Object.keys(e[y]).forEach(w=>{n[w]&&(c(w,b),Object.keys(b).forEach(E=>{a[E][w]=!0}))}),delete b[y]}c(this.primaryType,{});for(const y in a){const b=Object.keys(a[y]);b.sort(),this._types[y]=xm(y,t[y])+b.map(w=>xm(w,t[w])).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const a=ec(t);if(a)return a}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const a=e[1],f=this.getEncoder(a),c=parseInt(e[3]);return y=>{c>=0&&y.length!==c&&sr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",y);let b=y.map(f);return this._types[a]&&(b=b.map(co)),co(Eh(b))}}const n=this.types[t];if(n){const a=Zu(this._types[t]);return f=>{const c=n.map(({name:y,type:b})=>{const w=this.getEncoder(b)(f[y]);return this._types[b]?co(w):w});return c.unshift(a),Eh(c)}}return sr.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||sr.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return co(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(ec(t))return n(t,e);const a=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(a){const c=a[1],y=parseInt(a[3]);return y>=0&&e.length!==y&&sr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map(b=>this._visit(c,b,n))}const f=this.types[t];return f?f.reduce((c,{name:y,type:b})=>(c[y]=this._visit(b,e[y],n),c),{}):sr.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Gn(t)}static getPrimaryType(t){return Gn.from(t).primaryType}static hashStruct(t,e,n){return Gn.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const a=mm[n];a||sr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:a})}return e.sort((n,a)=>tc.indexOf(n.name)-tc.indexOf(a.name)),Gn.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return Eh(["0x1901",Gn.hashDomain(t),Gn.from(e).hash(n)])}static hash(t,e,n){return co(Gn.encode(t,e,n))}static resolveNames(t,e,n,a){return qM(this,void 0,void 0,function*(){t=gm(t);const f={};t.verifyingContract&&!Gf(t.verifyingContract,20)&&(f[t.verifyingContract]="0x");const c=Gn.from(e);c.visit(n,(y,b)=>(y==="address"&&!Gf(b,20)&&(f[b]="0x"),b));for(const y in f)f[y]=yield a(y);return t.verifyingContract&&f[t.verifyingContract]&&(t.verifyingContract=f[t.verifyingContract]),n=c.visit(n,(y,b)=>y==="address"&&f[b]?f[b]:b),{domain:t,value:n}})}static getPayload(t,e,n){Gn.hashDomain(t);const a={},f=[];tc.forEach(b=>{const w=t[b];w!=null&&(a[b]=jM[b](w),f.push({name:b,type:mm[b]}))});const c=Gn.from(e),y=gm(e);return y.EIP712Domain?sr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):y.EIP712Domain=f,c.encode(n),{types:y,domain:a,primaryType:c.primaryType,message:c.visit(n,(b,w)=>{if(b.match(/^bytes(\d*)/))return xs(xf(w));if(b.match(/^u?int/))return yf.from(w).toString();switch(b){case"address":return w.toLowerCase();case"bool":return!!w;case"string":return typeof w!="string"&&sr.throwArgumentError("invalid string","value",w),w}return sr.throwArgumentError("unsupported type","type",b)})}}};const aT=Object.freeze(Object.defineProperty({__proto__:null,_TypedDataEncoder:fb,hashMessage:Yy,id:Zu,isValidName:Xy,messagePrefix:Qy,namehash:Zy},Symbol.toStringTag,{value:"Module"})),XM="logger/5.7.0";let ym=!1,bm=!1;const Ah={debug:1,default:2,info:2,warning:3,error:4,off:5};let wm=Ah.default,rc=null;function ZM(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Em=ZM();var Md;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Md||(Md={}));var Yn;
8(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Yn||(Yn={}));const Am="0123456789abcdef";let pi=class Cr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Ah[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(wm>Ah[n])&&console.log.apply(console,e)}debug(...t){this._log(Cr.levels.DEBUG,t)}info(...t){this._log(Cr.levels.INFO,t)}warn(...t){this._log(Cr.levels.WARNING,t)}makeError(t,e,n){if(bm)return this.makeError("censored error",e,{});e||(e=Cr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Am[w[M]>>4],E+=Am[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case Yn.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case Yn.CALL_EXCEPTION:case Yn.INSUFFICIENT_FUNDS:case Yn.MISSING_NEW:case Yn.NONCE_EXPIRED:case Yn.REPLACEMENT_UNDERPRICED:case Yn.TRANSACTION_REPLACED:case Yn.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Cr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Em&&this.throwError("platform missing String.prototype.normalize",Cr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Em})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Cr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Cr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Cr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Cr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Cr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Cr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Cr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return rc||(rc=new Cr(XM)),rc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Cr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ym){if(!t)return;this.globalLogger().throwError("error censorship permanent",Cr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}bm=!!t,ym=!!e}static setLogLevel(t){const e=Ah[t.toLowerCase()];if(e==null){Cr.globalLogger().warn("invalid log level - "+t);return}wm=e}static from(t){return new Cr(t)}};pi.errors=Yn;pi.levels=Md;const QM="bytes/5.7.0",dr=new pi(QM);
8function sb(r){return!!r.toHexString}function Vs(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Vs(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function YM(r){return gn(r)&&!(r.length%2)||Qu(r)}function Mm(r){return typeof r=="number"&&r==r&&r%1===0}function Qu(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!Mm(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Mm(e)||e<0||e>=256)return!1}return!0}function Se(r,t){if(t||(t={}),typeof r=="number"){dr.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Vs(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),sb(r)&&(r=r.toHexString()),gn(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":dr.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Vs(new Uint8Array(n))}return Qu(r)?Vs(new Uint8Array(r)):dr.throwArgumentError("invalid arrayify value","value",r)}function Nd(r){const t=r.map(a=>Se(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),Vs(n)}function t4(r,t){r=Se(r),r.length>t&&dr.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),Vs(e)}function gn(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const ic="0123456789abcdef";function Ye(r,t){if(t||(t={}),typeof r=="number"){dr.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=ic[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),sb(r))return r.toHexString();if(gn(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":dr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Qu(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=ic[(a&240)>>4]+ic[a&15]}return e}return dr.throwArgumentError("invalid hexlify value","value",r)}function e4(r){if(typeof r!="string")r=Ye(r);else if(!gn(r)||r.length%2)return null;return(r.length-2)/2}function cu(r,t,e){return typeof r!="string"?r=Ye(r):(!gn(r)||r.length%2)&&dr.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function Uf(r,t){for(typeof r!="string"?r=Ye(r):gn(r)||dr.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&dr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function r4(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(YM(r)){let e=Se(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=Ye(e.slice(0,32)),t.s=Ye(e.slice(32,64))):e.length===65?(t.r=Ye(e.slice(0,32)),t.s=Ye(e.slice(32,64)),t.v=e[64]):dr.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:dr.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=Ye(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const a=t4(Se(t._vs),32);t._vs=Ye(a);const f=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=f:t.recoveryParam!==f&&dr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),a[0]&=127;const c=Ye(a);t.s==null?t.s=c:t.s!==c&&dr.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?dr.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&dr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!gn(t.r)?dr.throwArgumentError("signature missing or invalid r","signature",r):t.r=Uf(t.r,32),t.s==null||!gn(t.s)?dr.throwArgumentError("signature missing or invalid s","signature",r):t.s=Uf(t.s,32);const e=Se(t.s);e[0]>=128&&dr.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=Ye(e);t._vs&&(gn(t._vs)||dr.throwArgumentError("signature invalid _vs","signature",r),t._vs=Uf(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&dr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function tr(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}let ab=class{constructor(t){tr(this,"alphabet",t),tr(this,"base",t.length),tr(this,"_alphabetMap",{}),tr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=Se(t);if(e.length===0)return"";let n=[0];for(let f=0;f<e.length;++f){let c=e[f];for(let y=0;y<n.length;++y)c+=n[y]<<8,n[y]=c%this.base,c=c/this.base|0;for(;c>0;)n.push(c%this.base),c=c/this.base|0}let a="";for(let f=0;e[f]===0&&f<e.length-1;++f)a+=this._leader;for(let f=n.length-1;f>=0;
8--f)a+=this.alphabet[n[f]];return a}decode(t){if(typeof t!="string")throw new TypeError("Expected String");let e=[];if(t.length===0)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let a=this._alphabetMap[t[n]];if(a===void 0)throw new Error("Non-base"+this.base+" character");let f=a;for(let c=0;c<e.length;++c)f+=e[c]*this.base,e[c]=f&255,f>>=8;for(;f>0;)e.push(f&255),f>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return Se(new Uint8Array(e.reverse()))}};new ab("abcdefghijklmnopqrstuvwxyz234567");const hb=new ab("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var zp={exports:{}};zp.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};
vendor: 35,743 bytes, line 8
8function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
8function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(zp);var i4=zp.exports;const he=Nr(i4),n4="bignumber/5.7.0";var du=he.BN;const jo=new pi(n4),nc={},Nm=9007199254740991;let _m=!1,Yu=class zn{constructor(t,e){t!==nc&&jo.throwError("cannot call constructor directly; use BigNumber.from",pi.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Ri(Ee(this).fromTwos(t))}toTwos(t){return Ri(Ee(this).toTwos(t))}abs(){return this._hex[0]==="-"?zn.from(this._hex.substring(1)):this}add(t){return Ri(Ee(this).add(Ee(t)))}sub(t){return Ri(Ee(this).sub(Ee(t)))}div(t){return zn.from(t).isZero()&&en("division-by-zero","div"),Ri(Ee(this).div(Ee(t)))}mul(t){return Ri(Ee(this).mul(Ee(t)))}mod(t){const e=Ee(t);return e.isNeg()&&en("division-by-zero","mod"),Ri(Ee(this).umod(e))}pow(t){const e=Ee(t);return e.isNeg()&&en("negative-power","pow"),Ri(Ee(this).pow(e))}and(t){const e=Ee(t);return(this.isNegative()||e.isNeg())&&en("unbound-bitwise-result","and"),Ri(Ee(this).and(e))}or(t){const e=Ee(t);return(this.isNegative()||e.isNeg())&&en("unbound-bitwise-result","or"),Ri(Ee(this).or(e))}xor(t){const e=Ee(t);return(this.isNegative()||e.isNeg())&&en("unbound-bitwise-result","xor"),Ri(Ee(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&en("negative-width","mask"),Ri(Ee(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&en("negative-width","shl"),Ri(Ee(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&en("negative-width","shr"),Ri(Ee(this).shrn(t))}eq(t){return Ee(this).eq(Ee(t))}lt(t){return Ee(this).lt(Ee(t))}lte(t){return Ee(this).lte(Ee(t))}gt(t){return Ee(this).gt(Ee(t))}gte(t){return Ee(this).gte(Ee(t))}isNegative(){return this._hex[0]==="-"}isZero(){return Ee(this).isZero()}toNumber(){try{return Ee(this).toNumber()}catch{en("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return jo.throwError("this platform does not support BigInt",pi.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?_m||(_m=!0,jo.warn("BigNumber.toString does not accept any parameters;
8 base-10 is assumed")):arguments[0]===16?jo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",pi.errors.UNEXPECTED_ARGUMENT,{}):jo.throwError("BigNumber.toString does not accept parameters",pi.errors.UNEXPECTED_ARGUMENT,{})),Ee(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof zn)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new zn(nc,va(t)):t.match(/^-?[0-9]+$/)?new zn(nc,va(new du(t))):jo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&en("underflow","BigNumber.from",t),(t>=Nm||t<=-Nm)&&en("overflow","BigNumber.from",t),zn.from(String(t));const e=t;if(typeof e=="bigint")return zn.from(e.toString());if(Qu(e))return zn.from(Ye(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return zn.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(gn(n)||n[0]==="-"&&gn(n.substring(1))))return zn.from(n)}return jo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function va(r){if(typeof r!="string")return va(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&jo.throwArgumentError("invalid hex","value",r),r=va(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Ri(r){return Yu.from(va(r))}function Ee(r){const t=Yu.from(r).toHexString();return t[0]==="-"?new du("-"+t.substring(3),16):new du(t.substring(2),16)}function en(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),jo.throwError(r,pi.errors.NUMERIC_FAULT,n)}function o4(r){return new du(r,36).toString(16)}const f4="strings/5.7.0",s4=new pi(f4);var s0;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(s0||(s0={}));var Sm;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(Sm||(Sm={}));function pu(r,t=s0.current){t!=s0.current&&(s4.checkNormalize(),r=r.normalize(t));let e=[];for(let n=0;n<r.length;n++){const a=r.charCodeAt(n);if(a<128)e.push(a);else if(a<2048)e.push(a>>6|192),e.push(a&63|128);else if((a&64512)==55296){n++;const f=r.charCodeAt(n);if(n>=r.length||(f&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((a&1023)<<10)+(f&1023);e.push(c>>18|240),e.push(c>>12&63|128),e.push(c>>6&63|128),e.push(c&63|128)}else e.push(a>>12|224),e.push(a>>6&63|128),e.push(a&63|128)}return Se(e)}var ub={},Ie={},La=lb;function lb(r,t){if(!r)throw new Error(t||"Assertion failed")}lb.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var _d={exports:{}};typeof Object.create=="function"?_d.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:_d.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}};var a4=_d.exports,h4=La,u4=a4;Ie.inherits=u4;function l4(r,t){return(r.charCodeAt(t)&64512)!==55296||t<0||t+1>=r.length?!1:(r.charCodeAt(t+1)&64512)===56320}function c4(r,t){if(Array.isArray(r))return r.slice();if(!r)return[];var e=[];if(typeof r=="string")if(t){if(t==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),a=0;a<r.length;a+=2)e.push(parseInt(r[a]+r[a+1],16))}else for(var n=0,a=0;a<r.length;a++){var f=r.charCodeAt(a);f<128?e[n++]=f:f<2048?(e[n++]=f>>6|192,e[n++]=f&63|128):l4(r,a)?(f=65536+((f&1023)<<10)+(r.charCodeAt(++a)&1023),e[n++]=f>>18|240,e[n++]=f>>12&63|128,e[n++]=f>>6&63|128,e[n++]=f&63|128):(e[n++]=f>>12|224,e[n++]=f>>6&63|128,e[n++]=f&63|128)}else for(a=0;a<r.length;a++)e[a]=r[a]|0;return e}Ie.toArray=c4;function d4(r){for(var t="",e=0;e<r.length;e++)t+=db(r[e].toString(16));return t}Ie.toHex=d4;function cb(r){var t=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return t>>>0}Ie.htonl=cb;function p4(r,t){for(var e="",n=0;n<r.length;n++){var a=r[n];t==="little"&&(a=cb(a)),e+=pb(a.toString(16))}return e}Ie.toHex32=p4;function db(r){return r.length===1?"0"+r:r}Ie.zero2=db;function pb(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}Ie.zero8=pb;function g4(r,t,e,n){var a=e-t;h4(a%4===0);for(var f=new Array(a/4),c=0,y=t;c<f.length;c++,y+=4){var b;n==="big"?b=r[y]<<24|r[y+1]<<16|r[y+2]<<8|r[y+3]:b=r[y+3]<<24|r[y+2]<<16|r[y+1]<<8|r[y],f[c]=b>>>0}return f}Ie.join32=g4;function m4(r,t){for(var e=new Array(r.length*4),n=0,a=0;n<r.length;n++,a+=4){var f=r[n];t==="big"?(e[a]=f>>>24,e[a+1]=f>>>16&255,e[a+2]=f>>>8&255,e[a+3]=f&255):(e[a+3]=f>>>24,e[a+2]=f>>>16&255,e[a+1]=f>>>8&255,e[a]=f&255)}return e}Ie.split32=m4;function v4(r,t){return r>>>t|r<<32-t}Ie.rotr32=v4;function x4(r,t){return r<<t|r>>>32-t}Ie.rotl32=x4;function y4(r,t){return r+t>>>0}Ie.sum32=y4;function b4(r,t,e){return r+t+e>>>0}Ie.sum32_3=b4;function w4(r,t,e,n){return r+t+e+n>>>0}Ie.sum32_4=w4;function E4(r,t,e,n,a){return r+t+e+n+a>>>0}Ie.sum32_5=E4;
8function A4(r,t,e,n){var a=r[t],f=r[t+1],c=n+f>>>0,y=(c<n?1:0)+e+a;r[t]=y>>>0,r[t+1]=c}Ie.sum64=A4;function M4(r,t,e,n){var a=t+n>>>0,f=(a<t?1:0)+r+e;return f>>>0}Ie.sum64_hi=M4;function N4(r,t,e,n){var a=t+n;return a>>>0}Ie.sum64_lo=N4;function _4(r,t,e,n,a,f,c,y){var b=0,w=t;w=w+n>>>0,b+=w<t?1:0,w=w+f>>>0,b+=w<f?1:0,w=w+y>>>0,b+=w<y?1:0;var E=r+e+a+c+b;return E>>>0}Ie.sum64_4_hi=_4;function S4(r,t,e,n,a,f,c,y){var b=t+n+f+y;return b>>>0}Ie.sum64_4_lo=S4;function I4(r,t,e,n,a,f,c,y,b,w){var E=0,M=t;M=M+n>>>0,E+=M<t?1:0,M=M+f>>>0,E+=M<f?1:0,M=M+y>>>0,E+=M<y?1:0,M=M+w>>>0,E+=M<w?1:0;var O=r+e+a+c+b+E;return O>>>0}Ie.sum64_5_hi=I4;function R4(r,t,e,n,a,f,c,y,b,w){var E=t+n+f+y+w;return E>>>0}Ie.sum64_5_lo=R4;function T4(r,t,e){var n=t<<32-e|r>>>e;return n>>>0}Ie.rotr64_hi=T4;function P4(r,t,e){var n=r<<32-e|t>>>e;return n>>>0}Ie.rotr64_lo=P4;function C4(r,t,e){return r>>>e}Ie.shr64_hi=C4;function O4(r,t,e){var n=r<<32-e|t>>>e;return n>>>0}Ie.shr64_lo=O4;var v0={},Im=Ie,k4=La;function tl(){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}v0.BlockHash=tl;tl.prototype.update=function(t,e){if(t=Im.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var n=t.length%this._delta8;this.pending=t.slice(t.length-n,t.length),this.pending.length===0&&(this.pending=null),t=Im.join32(t,0,t.length-n,this.endian);for(var a=0;a<t.length;a+=this._delta32)this._update(t,a,a+this._delta32)}return this};tl.prototype.digest=function(t){return this.update(this._pad()),k4(this.pending===null),this._digest(t)};tl.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,a=new Array(n+this.padLength);a[0]=128;for(var f=1;f<n;f++)a[f]=0;if(t<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)a[f++]=0;a[f++]=0,a[f++]=0,a[f++]=0,a[f++]=0,a[f++]=t>>>24&255,a[f++]=t>>>16&255,a[f++]=t>>>8&255,a[f++]=t&255}else for(a[f++]=t&255,a[f++]=t>>>8&255,a[f++]=t>>>16&255,a[f++]=t>>>24&255,a[f++]=0,a[f++]=0,a[f++]=0,a[f++]=0,c=8;c<this.padLength;c++)a[f++]=0;return a};var x0={},Ko={},B4=Ie,Uo=B4.rotr32;function U4(r,t,e,n){if(r===0)return gb(t,e,n);if(r===1||r===3)return vb(t,e,n);if(r===2)return mb(t,e,n)}Ko.ft_1=U4;function gb(r,t,e){return r&t^~r&e}Ko.ch32=gb;function mb(r,t,e){return r&t^r&e^t&e}Ko.maj32=mb;function vb(r,t,e){return r^t^e}Ko.p32=vb;function F4(r){return Uo(r,2)^Uo(r,13)^Uo(r,22)}Ko.s0_256=F4;function D4(r){return Uo(r,6)^Uo(r,11)^Uo(r,25)}Ko.s1_256=D4;function L4(r){return Uo(r,7)^Uo(r,18)^r>>>3}Ko.g0_256=L4;function $4(r){return Uo(r,17)^Uo(r,19)^r>>>10}Ko.g1_256=$4;var a0=Ie,G4=v0,z4=Ko,oc=a0.rotl32,R0=a0.sum32,q4=a0.sum32_5,K4=z4.ft_1,xb=G4.BlockHash,H4=[1518500249,1859775393,2400959708,3395469782];function Go(){if(!(this instanceof Go))return new Go;xb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}a0.inherits(Go,xb);var W4=Go;Go.blockSize=512;Go.outSize=160;Go.hmacStrength=80;Go.padLength=64;Go.prototype._update=function(t,e){for(var n=this.W,a=0;a<16;a++)n[a]=t[e+a];for(;a<n.length;a++)n[a]=oc(n[a-3]^n[a-8]^n[a-14]^n[a-16],1);var f=this.h[0],c=this.h[1],y=this.h[2],b=this.h[3],w=this.h[4];for(a=0;a<n.length;a++){var E=~~(a/20),M=q4(oc(f,5),K4(E,c,y,b),w,n[a],H4[E]);w=b,b=y,y=oc(c,30),c=f,f=M}this.h[0]=R0(this.h[0],f),this.h[1]=R0(this.h[1],c),this.h[2]=R0(this.h[2],y),this.h[3]=R0(this.h[3],b),this.h[4]=R0(this.h[4],w)};Go.prototype._digest=function(t){return t==="hex"?a0.toHex32(this.h,"big"):a0.split32(this.h,"big")};var h0=Ie,J4=v0,y0=Ko,V4=La,On=h0.sum32,j4=h0.sum32_4,X4=h0.sum32_5,Z4=y0.ch32,Q4=y0.maj32,Y4=y0.s0_256,t8=y0.s1_256,e8=y0.g0_256,r8=y0.g1_256,yb=J4.BlockHash,i8=[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,2756
8734187,3204031479,3329325298];function zo(){if(!(this instanceof zo))return new zo;yb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=i8,this.W=new Array(64)}h0.inherits(zo,yb);var bb=zo;zo.blockSize=512;zo.outSize=256;zo.hmacStrength=192;zo.padLength=64;zo.prototype._update=function(t,e){for(var n=this.W,a=0;a<16;a++)n[a]=t[e+a];for(;a<n.length;a++)n[a]=j4(r8(n[a-2]),n[a-7],e8(n[a-15]),n[a-16]);var f=this.h[0],c=this.h[1],y=this.h[2],b=this.h[3],w=this.h[4],E=this.h[5],M=this.h[6],O=this.h[7];for(V4(this.k.length===n.length),a=0;a<n.length;a++){var F=X4(O,t8(w),Z4(w,E,M),this.k[a],n[a]),B=On(Y4(f),Q4(f,c,y));O=M,M=E,E=w,w=On(b,F),b=y,y=c,c=f,f=On(F,B)}this.h[0]=On(this.h[0],f),this.h[1]=On(this.h[1],c),this.h[2]=On(this.h[2],y),this.h[3]=On(this.h[3],b),this.h[4]=On(this.h[4],w),this.h[5]=On(this.h[5],E),this.h[6]=On(this.h[6],M),this.h[7]=On(this.h[7],O)};zo.prototype._digest=function(t){return t==="hex"?h0.toHex32(this.h,"big"):h0.split32(this.h,"big")};var Sd=Ie,wb=bb;function df(){if(!(this instanceof df))return new df;wb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Sd.inherits(df,wb);var n8=df;df.blockSize=512;df.outSize=224;df.hmacStrength=192;df.padLength=64;df.prototype._digest=function(t){return t==="hex"?Sd.toHex32(this.h.slice(0,7),"big"):Sd.split32(this.h.slice(0,7),"big")};var Fi=Ie,o8=v0,f8=La,Fo=Fi.rotr64_hi,Do=Fi.rotr64_lo,Eb=Fi.shr64_hi,Ab=Fi.shr64_lo,Ef=Fi.sum64,fc=Fi.sum64_hi,sc=Fi.sum64_lo,s8=Fi.sum64_4_hi,a8=Fi.sum64_4_lo,h8=Fi.sum64_5_hi,u8=Fi.sum64_5_lo,Mb=o8.BlockHash,l8=[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,
81126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function wo(){if(!(this instanceof wo))return new wo;Mb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=l8,this.W=new Array(160)}Fi.inherits(wo,Mb);var Nb=wo;wo.blockSize=1024;wo.outSize=512;wo.hmacStrength=192;wo.padLength=128;wo.prototype._prepareBlock=function(t,e){for(var n=this.W,a=0;a<32;a++)n[a]=t[e+a];for(;a<n.length;a+=2){var f=E8(n[a-4],n[a-3]),c=A8(n[a-4],n[a-3]),y=n[a-14],b=n[a-13],w=b8(n[a-30],n[a-29]),E=w8(n[a-30],n[a-29]),M=n[a-32],O=n[a-31];n[a]=s8(f,c,y,b,w,E,M,O),n[a+1]=a8(f,c,y,b,w,E,M,O)}};wo.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,a=this.h[0],f=this.h[1],c=this.h[2],y=this.h[3],b=this.h[4],w=this.h[5],E=this.h[6],M=this.h[7],O=this.h[8],F=this.h[9],B=this.h[10],L=this.h[11],z=this.h[12],q=this.h[13],V=this.h[14],At=this.h[15];f8(this.k.length===n.length);for(var St=0;St<n.length;St+=2){var Z=V,Y=At,Ct=x8(O,F),Tt=y8(O,F),Rt=c8(O,F,B,L,z),Dt=d8(O,F,B,L,z,q),I=this.k[St],N=this.k[St+1],d=n[St],i=n[St+1],s=h8(Z,Y,Ct,Tt,Rt,Dt,I,N,d,i),h=u8(Z,Y,Ct,Tt,Rt,Dt,I,N,d,i);Z=m8(a,f),Y=v8(a,f),Ct=p8(a,f,c,y,b),Tt=g8(a,f,c,y,b,w);var p=fc(Z,Y,Ct,Tt),m=sc(Z,Y,Ct,Tt);V=z,At=q,z=B,q=L,B=O,L=F,O=fc(E,M,s,h),F=sc(M,M,s,h),E=b,M=w,b=c,w=y,c=a,y=f,a=fc(s,h,p,m),f=sc(s,h,p,m)}Ef(this.h,0,a,f),Ef(this.h,2,c,y),Ef(this.h,4,b,w),Ef(this.h,6,E,M),Ef(this.h,8,O,F),Ef(this.h,10,B,L),Ef(this.h,12,z,q),Ef(this.h,14,V,At)};wo.prototype._digest=function(t){return t==="hex"?Fi.toHex32(this.h,"big"):Fi.split32(this.h,"big")};function c8(r,t,e,n,a){var f=r&e^~r&a;return f<0&&(f+=4294967296),f}function d8(r,t,e,n,a,f){var c=t&n^~t&f;return c<0&&(c+=4294967296),c}function p8(r,t,e,n,a){var f=r&e^r&a^e&a;return f<0&&(f+=4294967296),f}function g8(r,t,e,n,a,f){var c=t&n^t&f^n&f;return c<0&&(c+=4294967296),c}function m8(r,t){var e=Fo(r,t,28),n=Fo(t,r,2),a=Fo(t,r,7),f=e^n^a;return f<0&&(f+=4294967296),f}function v8(r,t){var e=Do(r,t,28),n=Do(t,r,2),a=Do(t,r,7),f=e^n^a;return f<0&&(f+=4294967296),f}function x8(r,t){var e=Fo(r,t,14),n=Fo(r,t,18),a=Fo(t,r,9),f=e^n^a;return f<0&&(f+=4294967296),f}function y8(r,t){var e=Do(r,t,14),n=Do(r,t,18),a=Do(t,r,9),f=e^n^a;return f<0&&(f+=4294967296),f}function b8(r,t){var e=Fo(r,t,1),n=Fo(r,t,8),a=Eb(r,t,7),f=e^n^a;return f<0&&(f+=4294967296),f}function w8(r,t){var e=Do(r,t,1),n=Do(r,t,8),a=Ab(r,t,7),f=e^n^a;return f<0&&(f+=4294967296),f}function E8(r,t){var e=Fo(r,t,19),n=Fo(t,r,29),a=Eb(r,t,6),f=e^n^a;return f<0&&(f+=4294967296),f}function A8(r,t){var e=Do(r,t,19),n=Do(t,r,29),a=Ab(r,t,6),f=e^n^a;return f<0&&(f+=4294967296),f}var Id=Ie,_b=Nb;function pf(){if(!(this instanceof pf))return new pf;_b.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Id.inherits(pf,_b);var M8=pf;pf.blockSize=1024;pf.outSize=384;pf.hmacStrength=192;pf.padLength=128;pf.prototype._digest=function(t){return t==="hex"?Id.toHex32(this.h.slice(0,12),"big"):Id.split32(this.h.slice(0,12),"big")};x0.sha1=W4;x0.sha224=n8;x0.sha256=bb;x0.sha384=M8;x0.sha512=Nb;var Sb={},ps=Ie,N8=v0,Ya=ps.rotl32,Rm=ps.sum32,T0=ps.sum32_3,Tm=ps.sum32_4,Ib=N8.BlockHash;function qo(){if(!(this instanceof qo))return new qo;Ib.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}ps.inherits(qo,Ib);Sb.ripemd160=qo;qo.blockSize=512;qo.outSize=160;qo.hmacStrength=192;qo.padLength=64;qo.prototype._update=function(t,e){for(var n=this.h[0],a=this.h[1],f=this.h[2],c=this.h[3],y=this.h[4],b=n,w=a,E=f,M=c,O=y,F=0;F<80;F++){var B=Rm(Ya(Tm(n,Pm(F,a,f,c),t[I8[F]+e],_8(F)),T8[F]),y);n=y,y=c,c=Ya(f,10),f=a,a=B,B=Rm(Ya(Tm(b,Pm(79-F,w,E,M),t[R8[F]+e],S8(F)),P8[F]),O),b=O,O=M,M=Ya(E,10),E=w,w=B}B=T0(this.h[1],f,M),this.h[1]=T0(this.h[2],c,O),this.h[2]=T0(this.h[3],y,b),this.h[3]=T0(this.h[4],n,w),this.h[4]=T0(this.h[0],a,E),this.h[0]=B};qo.prototype._digest=function(t){return t==="hex"?ps.toHex32(this.h,"little"):ps.split32(this.h,"little")};function Pm(r,t,e,n){return r<=15?t^e^n:r<=31?t&e|~t&n:r<=47?(t|~e)^n:r<=63?t&n|e&~n:t^(e|~n)}function _8(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}function S8(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}var I8=[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],R8=[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],T8=[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],P8=[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],C8=Ie,O8=La;function u0(r,t,e){if(!(this instanceof u0))return new u0(r,t,e);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(C8.toArray(t,e))}var k8=u0;u0.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),O8(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=new this.Hash().update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=new this.Hash().update(t)};u0.prototype.update=function(t,e){return this.inner.update(t,e),this};u0.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};(function(r){var t=r;t.utils=Ie,t.common=v0,t.sha=x0,t.ripemd=Sb,t.hmac=k8,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})(ub);const oe=Nr(ub);var xa;(function(r){r.sha256="sha256",r.sha512="sha512"})(xa||(xa={}));const B8="sha2/5.7.0",U8=new pi(B8);function F8(r){return"0x"+oe.ripemd160().update(Se(r)).digest("hex")}function ya(r){return"0x"+oe.sha256().update(Se(r)).digest("hex")}function gu(r,t,e){return xa[r]||U8.throwError("unsupported algorithm "+r,pi.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:r}),"0x"+oe.hmac(oe[r],Se(t)).update(Se(e)).digest("hex")}function D8(r,t,e,n,a){r=Se(r),t=Se(t);let f,c=1;const y=new Uint8Array(n),b=new Uint8Array(t.length+4);b.set(t);let w,E;for(let M=1;M<=c;M++){b[t.length]=M>>24&255,b[t.length+1]=M>>16&255,b[t.length+2]=M>>8&255,b[t.length+3]=M&255;let O=Se(gu(a,r,b));
8f||(f=O.length,E=new Uint8Array(f),c=Math.ceil(n/f),w=n-(c-1)*f),E.set(O);for(let L=1;L<e;L++){O=Se(gu(a,r,O));for(let z=0;z<f;z++)E[z]^=O[z]}const F=(M-1)*f,B=M===c?w:f;y.set(Se(E).slice(0,B),F)}return Ye(y)}function b0(r,t,e){return e={path:t,exports:{},require:function(n,a){return L8(n,a??e.path)}},r(e,e.exports),e.exports}function L8(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var qp=Rb;function Rb(r,t){if(!r)throw new Error(t||"Assertion failed")}Rb.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var mo=b0(function(r,t){var e=t;function n(c,y){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var w=0;w<c.length;w++)b[w]=c[w]|0;return b}if(y==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var w=0;w<c.length;w+=2)b.push(parseInt(c[w]+c[w+1],16))}else for(var w=0;w<c.length;w++){var E=c.charCodeAt(w),M=E>>8,O=E&255;M?b.push(M,O):b.push(O)}return b}e.toArray=n;function a(c){return c.length===1?"0"+c:c}e.zero2=a;function f(c){for(var y="",b=0;b<c.length;b++)y+=a(c[b].toString(16));return y}e.toHex=f,e.encode=function(y,b){return b==="hex"?f(y):y}}),Ji=b0(function(r,t){var e=t;e.assert=qp,e.toArray=mo.toArray,e.zero2=mo.zero2,e.toHex=mo.toHex,e.encode=mo.encode;function n(b,w,E){var M=new Array(Math.max(b.bitLength(),E)+1);M.fill(0);for(var O=1<<w+1,F=b.clone(),B=0;B<M.length;B++){var L,z=F.andln(O-1);F.isOdd()?(z>(O>>1)-1?L=(O>>1)-z:L=z,F.isubn(L)):L=0,M[B]=L,F.iushrn(1)}return M}e.getNAF=n;function a(b,w){var E=[[],[]];b=b.clone(),w=w.clone();for(var M=0,O=0,F;b.cmpn(-M)>0||w.cmpn(-O)>0;){var B=b.andln(3)+M&3,L=w.andln(3)+O&3;B===3&&(B=-1),L===3&&(L=-1);var z;B&1?(F=b.andln(7)+M&7,(F===3||F===5)&&L===2?z=-B:z=B):z=0,E[0].push(z);var q;L&1?(F=w.andln(7)+O&7,(F===3||F===5)&&B===2?q=-L:q=L):q=0,E[1].push(q),2*M===z+1&&(M=1-M),2*O===q+1&&(O=1-O),b.iushrn(1),w.iushrn(1)}return E}e.getJSF=a;function f(b,w,E){var M="_"+w;b.prototype[w]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}e.cachedProperty=f;function c(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=c;function y(b){return new he(b,"hex","le")}e.intFromLE=y}),mu=Ji.getNAF,$8=Ji.getJSF,vu=Ji.assert;function Xf(r,t){this.type=r,this.p=new he(t.p,16),this.red=t.prime?he.red(t.prime):he.mont(this.p),this.zero=new he(0).toRed(this.red),this.one=new he(1).toRed(this.red),this.two=new he(2).toRed(this.red),this.n=t.n&&new he(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 e=this.n&&this.p.div(this.n);!e||e.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ys=Xf;Xf.prototype.point=function(){throw new Error("Not implemented")};Xf.prototype.validate=function(){throw new Error("Not implemented")};Xf.prototype._fixedNafMul=function(t,e){vu(t.precomputed);var n=t._getDoubles(),a=mu(e,1,this._bitLength),f=(1<<n.step+1)-(n.step%2===0?2:1);f/=3;var c=[],y,b;for(y=0;y<a.length;y+=n.step){b=0;for(var w=y+n.step-1;w>=y;w--)b=(b<<1)+a[w];c.push(b)}for(var E=this.jpoint(null,null,null),M=this.jpoint(null,null,null),O=f;O>0;O--){for(y=0;y<c.length;y++)b=c[y],b===O?M=M.mixedAdd(n.points[y]):b===-O&&(M=M.mixedAdd(n.points[y].neg()));E=E.add(M)}return E.toP()};Xf.prototype._wnafMul=function(t,e){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var f=a.points,c=mu(e,n,this._bitLength),y=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var w=0;b>=0&&c[b]===0;b--)w++;if(b>=0&&w++,y=y.dblp(w),b<0)break;var E=c[b];vu(E!==0),t.type==="affine"?E>0?y=y.mixedAdd(f[E-1>>1]):y=y.mixedAdd(f[-E-1>>1].neg()):E>0?y=y.add(f[E-1>>1]):y=y.add(f[-E-1>>1].neg())}return t.type==="affine"?y.toP():y};Xf.prototype._wnafMulAdd=function(t,e,n,a,f){var c=this._wnafT1,y=this._wnafT2,b=this._wnafT3,w=0,E,M,O;for(E=0;E<a;E++){O=e[E];var F=O._getNAFPoints(t);c[E]=F.wnd,y[E]=F.points}for(E=a-1;E>=1;E-=2){var B=E-1,L=E;if(c[B]!==1||c[L]!==1){b[B]=mu(n[B],c[B],this._bitLength),b[L]=mu(n[L],c[L],this._bitLength),w=Math.max(b[B].length,w),w=Math.max(b[L].length,w);continue}var z=[e[B],null,null,e[L]];
8e[B].y.cmp(e[L].y)===0?(z[1]=e[B].add(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg())):e[B].y.cmp(e[L].y.redNeg())===0?(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].add(e[L].neg())):(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],V=$8(n[B],n[L]);for(w=Math.max(V[0].length,w),b[B]=new Array(w),b[L]=new Array(w),M=0;M<w;M++){var At=V[0][M]|0,St=V[1][M]|0;b[B][M]=q[(At+1)*3+(St+1)],b[L][M]=0,y[B]=z}}var Z=this.jpoint(null,null,null),Y=this._wnafT4;for(E=w;E>=0;E--){for(var Ct=0;E>=0;){var Tt=!0;for(M=0;M<a;M++)Y[M]=b[M][E]|0,Y[M]!==0&&(Tt=!1);if(!Tt)break;Ct++,E--}if(E>=0&&Ct++,Z=Z.dblp(Ct),E<0)break;for(M=0;M<a;M++){var Rt=Y[M];Rt!==0&&(Rt>0?O=y[M][Rt-1>>1]:Rt<0&&(O=y[M][-Rt-1>>1].neg()),O.type==="affine"?Z=Z.mixedAdd(O):Z=Z.add(O))}}for(E=0;E<a;E++)y[E]=null;return f?Z:Z.toP()};function An(r,t){this.curve=r,this.type=t,this.precomputed=null}Xf.BasePoint=An;An.prototype.eq=function(){throw new Error("Not implemented")};An.prototype.validate=function(){return this.curve.validate(this)};Xf.prototype.decodePoint=function(t,e){t=Ji.toArray(t,e);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?vu(t[t.length-1]%2===0):t[0]===7&&vu(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};An.prototype.encodeCompressed=function(t){return this.encode(t,!0)};An.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))};An.prototype.encode=function(t,e){return Ji.encode(this._encode(e),t)};An.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this};An.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1};An.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,f=0;f<e;f+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}};An.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),f=1;f<n;f++)e[f]=e[f-1].add(a);return{wnd:t,points:e}};An.prototype._getBeta=function(){return null};An.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var Kp=b0(function(r){typeof Object.create=="function"?r.exports=function(e,n){
8n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,n){if(n){e.super_=n;var a=function(){};a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e}}}),G8=Ji.assert;function Mn(r){ys.call(this,"short",r),this.a=new he(r.a,16).toRed(this.red),this.b=new he(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Kp(Mn,ys);var z8=Mn;Mn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,n;if(t.beta)e=new he(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);e=a[0].cmp(a[1])<0?a[0]:a[1],e=e.toRed(this.red)}if(t.lambda)n=new he(t.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))===0?n=f[0]:(n=f[1],G8(this.g.mul(n).x.cmp(this.g.x.redMul(e))===0))}var c;return t.basis?c=t.basis.map(function(y){return{a:new he(y.a,16),b:new he(y.b,16)}}):c=this._getEndoBasis(n),{beta:e,lambda:n,basis:c}}};Mn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:he.mont(t),n=new he(2).toRed(e).redInvm(),a=n.redNeg(),f=new he(3).toRed(e).redNeg().redSqrt().redMul(n),c=a.redAdd(f).fromRed(),y=a.redSub(f).fromRed();return[c,y]};Mn.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),f=new he(1),c=new he(0),y=new he(0),b=new he(1),w,E,M,O,F,B,L,z=0,q,V;n.cmpn(0)!==0;){var At=a.div(n);q=a.sub(At.mul(n)),V=y.sub(At.mul(f));var St=b.sub(At.mul(c));if(!M&&q.cmp(e)<0)w=L.neg(),E=f,M=q.neg(),O=V;else if(M&&++z===2)break;L=q,a=n,n=q,y=f,f=V,b=c,c=St}F=q.neg(),B=V;var Z=M.sqr().add(O.sqr()),Y=F.sqr().add(B.sqr());return Y.cmp(Z)>=0&&(F=w,B=E),M.negative&&(M=M.neg(),O=O.neg()),F.negative&&(F=F.neg(),B=B.neg()),[{a:M,b:O},{a:F,b:B}]};Mn.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],a=e[1],f=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),y=f.mul(n.a),b=c.mul(a.a),w=f.mul(n.b),E=c.mul(a.b),M=t.sub(y).sub(b),O=w.add(E).neg();return{k1:M,k2:O}};Mn.prototype.pointFromX=function(t,e){t=new he(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)};Mn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,a=this.a.redMul(e),f=e.redSqr().redMul(e).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(f).cmpn(0)===0};Mn.prototype._endoWnafMulAdd=function(t,e,n){for(var a=this._endoWnafT1,f=this._endoWnafT2,c=0;c<t.length;c++){var y=this._endoSplit(e[c]),b=t[c],w=b._getBeta();y.k1.negative&&(y.k1.ineg(),b=b.neg(!0)),y.k2.negative&&(y.k2.ineg(),w=w.neg(!0)),a[c*2]=b,a[c*2+1]=w,f[c*2]=y.k1,f[c*2+1]=y.k2}for(var E=this._wnafMulAdd(1,a,f,c*2,n),M=0;M<c*2;M++)a[M]=null,f[M]=null;return E};function Vr(r,t,e,n){ys.BasePoint.call(this,r,"affine"),t===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new he(t,16),this.y=new he(e,16),n&&(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)}Kp(Vr,ys.BasePoint);Mn.prototype.point=function(t,e,n){return new Vr(this,t,e,n)};Mn.prototype.pointFromJSON=function(t,e){return Vr.fromJSON(this,t,e)};Vr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,a=function(f){return n.point(f.x.redMul(n.endo.beta),f.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return e}};Vr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.prec
8omputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Vr.fromJSON=function(t,e,n){typeof e=="string"&&(e=JSON.parse(e));var a=t.point(e[0],e[1],n);if(!e[2])return a;function f(y){return t.point(y[0],y[1],n)}var c=e[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(f))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(f))}},a};Vr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Vr.prototype.isInfinity=function(){return this.inf};Vr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),a=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)};Vr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),a=t.redInvm(),f=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(a),c=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,y)};Vr.prototype.getX=function(){return this.x.fromRed()};Vr.prototype.getY=function(){return this.y.fromRed()};Vr.prototype.mul=function(t){return t=new he(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Vr.prototype.mulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f):this.curve._wnafMulAdd(1,a,f,2)};Vr.prototype.jmulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f,!0):this.curve._wnafMulAdd(1,a,f,2,!0)};Vr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Vr.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
8if(t&&this.precomputed){var n=this.precomputed,a=function(f){return f.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return e};Vr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function ni(r,t,e,n){ys.BasePoint.call(this,r,"jacobian"),t===null&&e===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new he(0)):(this.x=new he(t,16),this.y=new he(e,16),this.z=new he(n,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}Kp(ni,ys.BasePoint);Mn.prototype.jpoint=function(t,e,n){return new ni(this,t,e,n)};ni.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),a=this.y.redMul(e).redMul(t);return this.curve.point(n,a)};ni.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ni.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(e),f=t.x.redMul(n),c=this.y.redMul(e.redMul(t.z)),y=t.y.redMul(n.redMul(this.z)),b=a.redSub(f),w=c.redSub(y);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=b.redSqr(),M=E.redMul(b),O=a.redMul(E),F=w.redSqr().redIAdd(M).redISub(O).redISub(O),B=w.redMul(O.redISub(F)).redISub(c.redMul(M)),L=this.z.redMul(t.z).redMul(b);return this.curve.jpoint(F,B,L)};ni.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,a=t.x.redMul(e),f=this.y,c=t.y.redMul(e).redMul(this.z),y=n.redSub(a),b=f.redSub(c);if(y.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=y.redSqr(),E=w.redMul(y),M=n.redMul(w),O=b.redSqr().redIAdd(E).redISub(M).redISub(M),F=b.redMul(M.redISub(O)).redISub(f.redMul(E)),B=this.z.redMul(y);return this.curve.jpoint(O,F,B)};ni.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var a=this.curve.a,f=this.curve.tinv,c=this.x,y=this.y,b=this.z,w=b.redSqr().redSqr(),E=y.redAdd(y);for(e=0;e<t;e++){var M=c.redSqr(),O=E.redSqr(),F=O.redSqr(),B=M.redAdd(M).redIAdd(M).redIAdd(a.redMul(w)),L=c.redMul(O),z=B.redSqr().redISub(L.redAdd(L)),q=L.redISub(z),V=B.redMul(q);V=V.redIAdd(V).redISub(F);var At=E.redMul(b);e+1<t&&(w=w.redMul(F)),c=z,b=At,E=V}return this.curve.jpoint(c,E.redMul(f),b)};ni.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ni.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a),w=b.redSqr().redISub(y).redISub(y),E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),t=w,e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),O=this.y.redSqr(),F=O.redSqr(),B=this.x.redAdd(O).redSqr().redISub(M).redISub(F);B=B.redIAdd(B);var L=M.redAdd(M).redIAdd(M),z=L.redSqr(),q=F.redIAdd(F);q=q.redIAdd(q),q=q.redIAdd(q),t=z.redISub(B).redISub(B),e=L.redMul(B.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,e,n)};ni.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),w=b.redSqr().redISub(y).redISub(y);t=w;var E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),O=this.y.redSqr(),F=this.x.redMul(O),B=this.x.redSub(M).redMul(this.x.redAdd(M));B=B.redAdd(B).redIAdd(B);var L=F.redIAdd(F);L=L.redIAdd(L);var z=L.redAdd(L);t=B.redSqr().redISub(z),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(M);var q=O.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),e=B.redMul(L.redISub(t)).redISub(q)}return this.curve.jpoint(t,e,n)};ni.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,a=this.z,f=a.redSqr().redSqr(),c=e.redSqr(),y=n.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(f)),w=e.redAdd(e);w=w.redIAdd(w);var E=w.redMul(y),M=b.redSqr().redISub(E.redAdd(E)),O=E.redISub(M),F=y.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=b.redMul(O).redISub(F),L=n.redAdd(n).redMul(a);return this.curve.jpoint(M,B,L)};ni.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),a=e.redSqr(),f=t.redAdd(t).redIAdd(t),
8c=f.redSqr(),y=this.x.redAdd(e).redSqr().redISub(t).redISub(a);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(c);var b=y.redSqr(),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=f.redIAdd(y).redSqr().redISub(c).redISub(b).redISub(w),M=e.redMul(E);M=M.redIAdd(M),M=M.redIAdd(M);var O=this.x.redMul(b).redISub(M);O=O.redIAdd(O),O=O.redIAdd(O);var F=this.y.redMul(E.redMul(w.redISub(E)).redISub(y.redMul(b)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=this.z.redAdd(y).redSqr().redISub(n).redISub(b);return this.curve.jpoint(O,F,B)};ni.prototype.mul=function(t,e){return t=new he(t,e),this.curve._wnafMul(this,t)};ni.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var a=e.redMul(this.z),f=n.redMul(t.z);return this.y.redMul(f).redISub(t.y.redMul(a)).cmpn(0)===0};ni.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(n)===0)return!0;for(var a=t.clone(),f=this.curve.redN.redMul(e);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(f),this.x.cmp(n)===0)return!0}};ni.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ni.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Mh=b0(function(r,t){var e=t;e.base=ys,e.short=z8,e.mont=null,e.edwards=null}),Nh=b0(function(r,t){var e=t,n=Ji.assert;function a(y){y.type==="short"?this.curve=new Mh.short(y):y.type==="edwards"?this.curve=new Mh.edwards(y):this.curve=new Mh.mont(y),this.g=this.curve.g,this.n=this.curve.n,this.hash=y.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function f(y,b){Object.defineProperty(e,y,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,y,{configurable:!0,enumerable:!0,value:w}),w}})}f("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:oe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:oe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:oe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:oe.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"]}),f("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:oe.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oe.sha256,gRed:!1,g:["9"]}),f("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:oe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}f("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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
8,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function zf(r){if(!(this instanceof zf))return new zf(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=mo.toArray(r.entropy,r.entropyEnc||"hex"),e=mo.toArray(r.nonce,r.nonceEnc||"hex"),n=mo.toArray(r.pers,r.persEnc||"hex");qp(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,e,n)}var Tb=zf;zf.prototype._init=function(t,e,n){var a=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656};zf.prototype._hmac=function(){return new oe.hmac(this.hash,this.K)};zf.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};zf.prototype.reseed=function(t,e,n,a){typeof e!="string"&&(a=n,n=e,e=null),t=mo.toArray(t,e),n=mo.toArray(n,a),qp(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};zf.prototype.generate=function(t,e,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(a=n,n=e,e=null),n&&(n=mo.toArray(n,a||"hex"),this._update(n));for(var f=[];f.length<t;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,t);return this._update(n),this._reseed++,mo.encode(c,e)};var Rd=Ji.assert;function gi(r,t){this.ec=r,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Hp=gi;gi.fromPublic=function(t,e,n){return e instanceof gi?e:new gi(t,{pub:e,pubEnc:n})};gi.fromPrivate=function(t,e,n){return e instanceof gi?e:new gi(t,{priv:e,privEnc:n})};gi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}};gi.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub};gi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};gi.prototype._importPrivate=function(t,e){this.priv=new he(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)};gi.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?Rd(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Rd(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)};gi.prototype.derive=function(t){return t.validate()||Rd(t.validate(),"public point not validated"),t.mul(this.priv).getX()};gi.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)};gi.prototype.verify=function(t,e){return this.ec.verify(t,e,this)};gi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var q8=Ji.assert;function el(r,t){if(r instanceof el)return r;this._importDER(r,t)||(q8(r.r&&r.s,"Signature without r or s"),this.r=new he(r.r,16),this.s=new he(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var rl=el;function K8(){this.place=0}function ac(r,t){var e=r[t.place++];if(!(e&128))return e;var n=e&15;if(n===0||n>4)return!1;for(var a=0,f=0,c=t.place;f<n;f++,c++)a<<=8,a|=r[c],a>>>=0;return a<=127?!1:(t.place=c,a)}function Cm(r){for(var t=0,e=r.length-1;!r[t]&&!(r[t+1]&128)&&t<e;)t++;return t===0?r:r.slice(t)}el.prototype._importDER=function(t,e){t=Ji.toArray(t,e);var n=new K8;if(t[n.place++]!==48)return!1;var a=ac(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var f=ac(t,n);if(f===!1)return!1;var c=t.slice(n.place,f+n.place);if(n.place+=f,t[n.place++]!==2)return!1;var y=ac(t,n);if(y===!1||t.length!==y+n.place)return!1;var b=t.slice(n.place,y+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new he(c),this.s=new he(b),this.recoveryParam=null,!0};function hc(r,t){if(t<128){r.push(t);return}var e=1+(Math.log(t)/Math.LN2>>>3);for(r.push(e|128);--e;)r.push(t>>>(e<<3)&255);r.push(t)}el.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();
8for(e[0]&128&&(e=[0].concat(e)),n[0]&128&&(n=[0].concat(n)),e=Cm(e),n=Cm(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];hc(a,e.length),a=a.concat(e),a.push(2),hc(a,n.length);var f=a.concat(n),c=[48];return hc(c,f.length),c=c.concat(f),Ji.encode(c,t)};var H8=function(){throw new Error("unsupported")},Pb=Ji.assert;function vn(r){if(!(this instanceof vn))return new vn(r);typeof r=="string"&&(Pb(Object.prototype.hasOwnProperty.call(Nh,r),"Unknown curve "+r),r=Nh[r]),r instanceof Nh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var W8=vn;vn.prototype.keyPair=function(t){return new Hp(this,t)};vn.prototype.keyFromPrivate=function(t,e){return Hp.fromPrivate(this,t,e)};vn.prototype.keyFromPublic=function(t,e){return Hp.fromPublic(this,t,e)};vn.prototype.genKeyPair=function(t){t||(t={});for(var e=new Tb({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||H8(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new he(2));;){var f=new he(e.generate(n));if(!(f.cmp(a)>0))return f.iaddn(1),this.keyFromPrivate(f)}};vn.prototype._truncateToN=function(t,e){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t};vn.prototype.sign=function(t,e,n,a){typeof n=="object"&&(a=n,n=null),a||(a={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new he(t,16));for(var f=this.n.byteLength(),c=e.getPrivate().toArray("be",f),y=t.toArray("be",f),b=new Tb({hash:this.hash,entropy:c,nonce:y,pers:a.pers,persEnc:a.persEnc||"utf8"}),w=this.n.sub(new he(1)),E=0;;E++){var M=a.k?a.k(E):new he(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(w)>=0)){var O=this.g.mul(M);if(!O.isInfinity()){var F=O.getX(),B=F.umod(this.n);if(B.cmpn(0)!==0){var L=M.invm(this.n).mul(B.mul(e.getPrivate()).iadd(t));if(L=L.umod(this.n),L.cmpn(0)!==0){var z=(O.getY().isOdd()?1:0)|(F.cmp(B)!==0?2:0);return a.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),z^=1),new rl({r:B,s:L,recoveryParam:z})}}}}}};vn.prototype.verify=function(t,e,n,a){t=this._truncateToN(new he(t,16)),n=this.keyFromPublic(n,a),e=new rl(e,"hex");var f=e.r,c=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var y=c.invm(this.n),b=y.mul(t).umod(this.n),w=y.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)};vn.prototype.recoverPubKey=function(r,t,e,n){Pb((3&e)===e,"The recovery param is more than two bits"),t=new rl(t,n);var a=this.n,f=new he(r),c=t.r,y=t.s,b=e&1,w=e>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var E=t.r.invm(a),M=a.sub(f).mul(E).umod(a),O=y.mul(E).umod(a);return this.g.mulAdd(M,c,O)};vn.prototype.getKeyRecoveryParam=function(r,t,e,n){if(t=new rl(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var f;try{f=this.recoverPubKey(r,t,a)}catch{continue}if(f.eq(e))return a}throw new Error("Unable to find valid recovery factor")};var J8=b0(function(r,t){var e=t;e.version="6.5.4",e.utils=Ji,e.rand=function(){throw new Error("unsupported")},e.curve=Mh,e.curves=Nh,e.ec=W8,e.eddsa=null}),V8=J8.ec;const j8="signing-key/5.7.0",Td=new pi(j8);let uc=null;function ns(){return uc||(uc=new V8("secp256k1")),uc}let Pd=class{constructor(t){tr(this,"curve","secp256k1"),tr(this,"privateKey",Ye(t)),e4(this.privateKey)!==32&&Td.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=ns().keyFromPrivate(Se(this.privateKey));tr(this,"publicKey","0x"+e.getPublic(!1,"hex")),tr(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),tr(this,"_isSigningKey",!0)}_addPoint(t){const e=ns().keyFromPublic(Se(this.publicKey)),n=ns().keyFromPublic(Se(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}
8signDigest(t){const e=ns().keyFromPrivate(Se(this.privateKey)),n=Se(t);n.length!==32&&Td.throwArgumentError("bad digest length","digest",t);const a=e.sign(n,{canonical:!0});return r4({recoveryParam:a.recoveryParam,r:Uf("0x"+a.r.toString(16),32),s:Uf("0x"+a.s.toString(16),32)})}computeSharedSecret(t){const e=ns().keyFromPrivate(Se(this.privateKey)),n=ns().keyFromPublic(Se(Cb(t)));return Uf("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}};function Cb(r,t){const e=Se(r);return e.length===32?new Pd(e).publicKey:e.length===33?"0x"+ns().keyFromPublic(e).getPublic(!1,"hex"):e.length===65?Ye(e):Td.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Ob={exports:{}};(function(r){(function(){var t="input is invalid type",e="finalize already called",n=typeof window=="object",a=n?window:{};a.JS_SHA3_NO_WINDOW&&(n=!1);var f=!n&&typeof self=="object",c=!a.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;c?a=bi:f&&(a=self);var y=!a.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!a.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",w="0123456789abcdef".split(""),E=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],O=[1,256,65536,16777216],F=[6,1536,393216,100663296],B=[0,8,16,24],L=[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],z=[224,256,384,512],q=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],At={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),b&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var St=function(u,A,S){return function(_){return new o(u,A,u).update(_)[S]()}},Z=function(u,A,S){return function(_,P){return new o(u,A,P).update(_)[S]()}},Y=function(u,A,S){return function(_,P,K,$){return i["cshake"+u].update(_,P,K,$)[S]()}},Ct=function(u,A,S){return function(_,P,K,$){return i["kmac"+u].update(_,P,K,$)[S]()}},Tt=function(u,A,S,_){for(var P=0;P<V.length;++P){var K=V[P];u[K]=A(S,_,K)}return u},Rt=function(u,A){var S=St(u,A,"hex");return S.create=function(){return new o(u,A,u)},S.update=function(_){return S.create().update(_)},Tt(S,St,u,A)},Dt=function(u,A){var S=Z(u,A,"hex");return S.create=function(_){return new o(u,A,_)},S.update=function(_,P){return S.create(P).update(_)},Tt(S,Z,u,A)},I=function(u,A){var S=At[u],_=Y(u,A,"hex");return _.create=function(P,K,$){return!K&&!$?i["shake"+u].create(P):new o(u,A,P).bytepad([K,$],S)},_.update=function(P,K,$,U){return _.create(K,$,U).update(P)},Tt(_,Y,u,A)},N=function(u,A){var S=At[u],_=Ct(u,A,"hex");return _.create=function(P,K,$){return new g(u,A,K).bytepad(["KMAC",$],S).bytepad([P],S)},_.update=function(P,K,$,U){return _.create(P,$,U).update(K)},Tt(_,Ct,u,A)},d=[{name:"keccak",padding:O,bits:z,createMethod:Rt},{name:"sha3",padding:F,bits:z,createMethod:Rt},{name:"shake",padding:E,bits:q,createMethod:Dt},{name:"cshake",padding:M,bits:q,createMethod:I},{name:"kmac",padding:M,bits:q,createMethod:N}],i={},s=[],h=0;h<d.length;++h)for(var p=d[h],m=p.bits,v=0;v<m.length;++v){var x=p.name+"_"+m[v];if(s.push(x),i[x]=p.createMethod(m[v],p.padding),p.name!=="sha3"){var l=p.name+m[v];s.push(l),i[l]=i[x]}}function o(u,A,S){this.blocks=[],this.s=[],this.padding=A,this.outputBits=S,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(u<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var _=0;_<50;++_)this.s[_]=0}o.prototype.update=function(u){if(this.finalized)throw new Error(e);var A,S=typeof u;if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}for(var _=this.blocks,P=this.byteCount,K=u.length,$=this.blockCount,U=0,It=this.s,G,J;U<K;){if(this.reset)for(this.reset=!1,_[0]=this.block,G=1;G<$+1;++G)_[G]=0;if(A)for(G=this.start;U<K&&G<P;++U)_[G>>2]|=u[U]<<B[G++&3];else for(G=this.start;U<K&&G<P;++U)J=u.charCodeAt(U),J<128?_[G>>2]|=J<<B[G++&3]:J<2048?(_[G>>2]|=(192|J>>6)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):J<55296||J>=57344?(_[G>>2]|=(224|J>>12)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):(J=65536+((J&1023)<<10|u.charCodeAt(++U)&1023),_[G>>2]|=(240|J>>18)<<B[G++&3],_[G>>2]|=(128|J>>12&63)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]);if(this.lastByteIndex=G,G>=P){for(this.start=G-P,this.block=_[$],G=0;G<$;++G)It[G]^=_[G];C(It),this.reset=!0}else this.start=G}return this},o.prototype.encode=function(u,A){var S=u&255,_=1,P=[S];for(u=u>>8,S=u&255;S>0;)P.unshift(S),u=u>>8,S=u&255,++_;return A?P.push(_):P.unshift(_),this.update(P),P.length},o.prototype.encodeString=function(u){var A,S=typeof u;
8if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}var _=0,P=u.length;if(A)_=P;else for(var K=0;K<u.length;++K){var $=u.charCodeAt(K);$<128?_+=1:$<2048?_+=2:$<55296||$>=57344?_+=3:($=65536+(($&1023)<<10|u.charCodeAt(++K)&1023),_+=4)}return _+=this.encode(_*8),this.update(u),_},o.prototype.bytepad=function(u,A){for(var S=this.encode(A),_=0;_<u.length;++_)S+=this.encodeString(u[_]);var P=A-S%A,K=[];return K.length=P,this.update(K),this},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,A=this.lastByteIndex,S=this.blockCount,_=this.s;if(u[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(u[0]=u[S],A=1;A<S+1;++A)u[A]=0;for(u[S-1]|=2147483648,A=0;A<S;++A)_[A]^=u[A];C(_)}},o.prototype.toString=o.prototype.hex=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$="",U;K<S;){for(P=0;P<u&&K<S;++P,++K)U=A[P],$+=w[U>>4&15]+w[U&15]+w[U>>12&15]+w[U>>8&15]+w[U>>20&15]+w[U>>16&15]+w[U>>28&15]+w[U>>24&15];K%u===0&&(C(A),P=0)}return _&&(U=A[P],$+=w[U>>4&15]+w[U&15],_>1&&($+=w[U>>12&15]+w[U>>8&15]),_>2&&($+=w[U>>20&15]+w[U>>16&15])),$},o.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=this.outputBits>>3,U;_?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer($);for(var It=new Uint32Array(U);K<S;){for(P=0;P<u&&K<S;++P,++K)It[K]=A[P];K%u===0&&C(A)}return _&&(It[P]=A[P],U=U.slice(0,$)),U},o.prototype.buffer=o.prototype.arrayBuffer,o.prototype.digest=o.prototype.array=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=[],U,It;K<S;){for(P=0;P<u&&K<S;++P,++K)U=K<<2,It=A[P],$[U]=It&255,$[U+1]=It>>8&255,$[U+2]=It>>16&255,$[U+3]=It>>24&255;K%u===0&&C(A)}return _&&(U=K<<2,It=A[P],$[U]=It&255,_>1&&($[U+1]=It>>8&255),_>2&&($[U+2]=It>>16&255)),$};function g(u,A,S){o.call(this,u,A,S)}g.prototype=new o,g.prototype.finalize=function(){return this.encode(this.outputBits,!0),o.prototype.finalize.call(this)};var C=function(u){var A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht,jt,Mt,ut,Xt,Nt,lt,Zt,wt,Et,Qt,Yt,te,ee,re;for(_=0;_<48;_+=2)P=u[0]^u[10]^u[20]^u[30]^u[40],K=u[1]^u[11]^u[21]^u[31]^u[41],$=u[2]^u[12]^u[22]^u[32]^u[42],U=u[3]^u[13]^u[23]^u[33]^u[43],It=u[4]^u[14]^u[24]^u[34]^u[44],G=u[5]^u[15]^u[25]^u[35]^u[45],J=u[6]^u[16]^u[26]^u[36]^u[46],Gt=u[7]^u[17]^u[27]^u[37]^u[47],ct=u[8]^u[18]^u[28]^u[38]^u[48],rt=u[9]^u[19]^u[29]^u[39]^u[49],A=ct^($<<1|U>>>31),S=rt^(U<<1|$>>>31),u[0]^=A,u[1]^=S,u[10]^=A,u[11]^=S,u[20]^=A,u[21]^=S,u[30]^=A,u[31]^=S,u[40]^=A,u[41]^=S,A=P^(It<<1|G>>>31),S=K^(G<<1|It>>>31),u[2]^=A,u[3]^=S,u[12]^=A,u[13]^=S,u[22]^=A,u[23]^=S,u[32]^=A,u[33]^=S,u[42]^=A,u[43]^=S,A=$^(J<<1|Gt>>>31),S=U^(Gt<<1|J>>>31),u[4]^=A,u[5]^=S,u[14]^=A,u[15]^=S,u[24]^=A,u[25]^=S,u[34]^=A,u[35]^=S,u[44]^=A,u[45]^=S,A=It^(ct<<1|rt>>>31),S=G^(rt<<1|ct>>>31),u[6]^=A,u[7]^=S,u[16]^=A,u[17]^=S,u[26]^=A,u[27]^=S,u[36]^=A,u[37]^=S,u[46]^=A,u[47]^=S,A=J^(P<<1|K>>>31),S=Gt^(K<<1|P>>>31),u[8]^=A,u[9]^=S,u[18]^=A,u[19]^=S,u[28]^=A,u[29]^=S,u[38]^=A,u[39]^=S,u[48]^=A,u[49]^=S,qt=u[0],dt=u[1],at=u[11]<<4|u[10]>>>28,Vt=u[10]<<4|u[11]>>>28,D=u[20]<<3|u[21]>>>29,j=u[21]<<3|u[20]>>>29,Yt=u[31]<<9|u[30]>>>23,te=u[30]<<9|u[31]>>>23,xt=u[40]<<18|u[41]>>>14,st=u[41]<<18|u[40]>>>14,X=u[2]<<1|u[3]>>>31,Ft=u[3]<<1|u[2]>>>31,it=u[13]<<12|u[12]>>>20,Kt=u[12]<<12|u[13]>>>20,bt=u[22]<<10|u[23]>>>22,ht=u[23]<<10|u[22]>>>22,H=u[33]<<13|u[32]>>>19,W=u[32]<<13|u[33]>>>19,ee=u[42]<<2|u[43]>>>30,re=u[43]<<2|u[42]>>>30,Nt=u[5]<<30|u[4]>>>2,lt=u[4]<<30|u[5]>>>2,Q=u[14]<<6|u[15]>>>26,ot=u[15]<<6|u[14]>>>26,gt=u[25]<<11|u[24]>>>21,tt=u[24]<<11|u[25]>>>21,jt=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,Bt=u[45]<<29|u[44]>>>3,et=u[44]<<29|u[45]>>>3,mt=u[6]<<28|u[7]>>>4,k=u[7]<<28|u[6]>>>4,Zt=u[17]<<23|u[16]>>>
89,wt=u[16]<<23|u[17]>>>9,Ht=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Lt=u[36]<<21|u[37]>>>11,pt=u[37]<<21|u[36]>>>11,ut=u[47]<<24|u[46]>>>8,Xt=u[46]<<24|u[47]>>>8,Jt=u[8]<<27|u[9]>>>5,yt=u[9]<<27|u[8]>>>5,T=u[18]<<20|u[19]>>>12,R=u[19]<<20|u[18]>>>12,Et=u[29]<<7|u[28]>>>25,Qt=u[28]<<7|u[29]>>>25,ft=u[38]<<8|u[39]>>>24,Wt=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,$t=u[49]<<14|u[48]>>>18,u[0]=qt^~it&gt,u[1]=dt^~Kt&tt,u[10]=mt^~T&D,u[11]=k^~R&j,u[20]=X^~Q&Ht,u[21]=Ft^~ot&vt,u[30]=Jt^~at&bt,u[31]=yt^~Vt&ht,u[40]=Nt^~Zt&Et,u[41]=lt^~wt&Qt,u[2]=it^~gt&Lt,u[3]=Kt^~tt&pt,u[12]=T^~D&H,u[13]=R^~j&W,u[22]=Q^~Ht&ft,u[23]=ot^~vt&Wt,u[32]=at^~bt&jt,u[33]=Vt^~ht&Mt,u[42]=Zt^~Et&Yt,u[43]=wt^~Qt&te,u[4]=gt^~Lt&nt,u[5]=tt^~pt&$t,u[14]=D^~H&Bt,u[15]=j^~W&et,u[24]=Ht^~ft&xt,u[25]=vt^~Wt&st,u[34]=bt^~jt&ut,u[35]=ht^~Mt&Xt,u[44]=Et^~Yt&ee,u[45]=Qt^~te&re,u[6]=Lt^~nt&qt,u[7]=pt^~$t&dt,u[16]=H^~Bt&mt,u[17]=W^~et&k,u[26]=ft^~xt&X,u[27]=Wt^~st&Ft,u[36]=jt^~ut&Jt,u[37]=Mt^~Xt&yt,u[46]=Yt^~ee&Nt,u[47]=te^~re&lt,u[8]=nt^~qt&it,u[9]=$t^~dt&Kt,u[18]=Bt^~mt&T,u[19]=et^~k&R,u[28]=xt^~X&Q,u[29]=st^~Ft&ot,u[38]=ut^~Jt&at,u[39]=Xt^~yt&Vt,u[48]=ee^~Nt&Zt,u[49]=re^~lt&wt,u[0]^=L[_],u[1]^=L[_+1]};if(y)r.exports=i;else for(h=0;h<s.length;++h)a[s[h]]=i[s[h]]})()})(Ob);var X8=Ob.exports;const Z8=Nr(X8);function Wp(r){return"0x"+Z8.keccak_256(Se(r))}const Q8="address/5.7.0",K0=new pi(Q8);function Om(r){gn(r,20)||K0.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let a=0;a<40;a++)e[a]=t[a].charCodeAt(0);const n=Se(Wp(e));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const Y8=9007199254740991;function t5(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const Jp={};for(let r=0;r<10;r++)Jp[String(r)]=String(r);for(let r=0;r<26;r++)Jp[String.fromCharCode(65+r)]=String(10+r);const km=Math.floor(t5(Y8));function e5(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>Jp[n]).join("");for(;t.length>=km;){let n=t.substring(0,km);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function r5(r){let t=null;if(typeof r!="string"&&K0.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=Om(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&K0.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==e5(r)&&K0.throwArgumentError("bad icap checksum","address",r),t=o4(r.substring(4));t.length<40;)t="0"+t;t=Om("0x"+t)}else K0.throwArgumentError("invalid address","address",r);return t}var Bm;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Bm||(Bm={}));function i5(r){const t=Cb(r);return r5(cu(Wp(cu(t,1)),12))}function n5(r){return Wp(pu(r))}const o5="wordlists/5.7.0",f5=new pi(o5);let Vp=class kb{constructor(t){f5.checkAbstract(new.target,kb),tr(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){const e=[];for(let n=0;n<2048;n++){const a=t.getWord(n);if(n!==t.getWordIndex(a))return"0x";e.push(a)}
8return n5(e.join(`
9`)+`
10`)}static register(t,e){e||(e=t.locale)}};const s5="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductC
10onfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMu
10seumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThe
10nTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let ea=null;function Um(r){if(ea==null&&(ea=s5.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Vp.check(r)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw ea=null,new Error("BIP39 Wordlist for en (English) FAILED")}let a5=class extends Vp{constructor(){super("en")}getWord(t){return Um(this),ea[t]}getWordIndex(t){return Um(this),ea.indexOf(t)}};const Bb=new a5;Vp.register(Bb);const Fm={en:Bb},h5="hdnode/5.4.0",js=new pi(h5),u5=Yu.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l5=pu("Bitcoin seed"),Us=2147483648;function Ub(r){return(1<<r)-1<<8-r}function c5(r){return(1<<r)-1}function th(r){return Uf(Ye(r),32)}function Dm(r){return hb.encode(Nd([r,cu(ya(ya(r)),0,4)]))}function jp(r){if(r==null)return Fm.en;if(typeof r=="string"){const t=Fm[r];return t==null&&js.throwArgumentError("unknown locale","wordlist",r),t}return r}const _s={},Fb="m/44'/60'/0'/0/0";let Db=class Ho{constructor(t,e,n,a,f,c,y,b){if(js.checkNew(new.target,Ho),t!==_s)throw new Error("HDNode constructor cannot be called directly");if(e){const w=new Pd(e);tr(this,"privateKey",w.privateKey),tr(this,"publicKey",w.compressedPublicKey)}else tr(this,"privateKey",null),tr(this,"publicKey",Ye(n));tr(this,"parentFingerprint",a),tr(this,"fingerprint",cu(F8(ya(this.publicKey)),0,4)),tr(this,"address",i5(this.publicKey)),tr(this,"chainCode",f),tr(this,"index",c),tr(this,"depth",y),b==null?(tr(this,"mnemonic",null),tr(this,"path",null)):typeof b=="string"?(tr(this,"mnemonic",null),tr(this,"path",b)):(tr(this,"mnemonic",b),tr(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Dm(Nd([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Ye(this.depth),this.parentFingerprint,Uf(Ye(this.index),4),this.chainCode,this.privateKey!=null?Nd(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Ho(_s,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw new Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(t&~Us));const n=new Uint8Array(37);if(t&Us){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Se(this.privateKey),1),e&&(e+="'")}else n.set(Se(this.publicKey));for(let M=24;M>=0;M-=8)n[33+(M>>3)]=t>>24-M&255;const a=Se(gu(xa.sha512,this.chainCode,n)),f=a.slice(0,32),c=a.slice(32);let y=null,b=null;this.privateKey?y=th(Yu.from(f).add(this.privateKey).mod(u5)):b=new Pd(Ye(f))._addPoint(this.publicKey);let w=e;const E=this.mnemonic;return E&&(w=Object.freeze({phrase:E.phrase,path:e,locale:E.locale||"en"})),new Ho(_s,y,b,this.fingerprint,th(c),t,this.depth+1,w)}derivePath(t){const e=t.split("/");if(e.length===0||e[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+t);e[0]==="m"&&e.shift();let n=this;for(let a=0;a<e.length;a++){const f=e[a];if(f.match(/^[0-9]+'$/)){const c=parseInt(f.substring(0,f.length-1));if(c>=Us)throw new Error("invalid path index - "+f);n=n._derive(Us+c)}else if(f.match(/^[0-9]+$/)){const c=parseInt(f);if(c>=Us)throw new Error("invalid path index - "+f);n=n._derive(c)}else throw new Error("invalid path component - "+f)}return n}static _fromSeed(t,e){const n=Se(t);if(n.length<16||n.length>64)throw new Error("invalid seed");const a=Se(gu(xa.sha512,l5,n));return new Ho(_s,th(a.slice(0,32)),null,"0x00000000",th(a.slice(32)),0,0,e)}static fromMnemonic(t,e,n){return n=jp(n),t=Zp(il(t,n),n),Ho._fromSeed(Xp(t,e),{phrase:t,path:"m",locale:n.locale})}static fromSeed(t){return Ho._fromSeed(t,null)}static fromExtendedKey(t){const e=hb.decode(t);(e.length!==82||Dm(e.slice(0,78))!==t)&&js.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=e[4],a=Ye(e.slice(5,9)),f=parseInt(Ye(e.slice(9,13)).substring(2),16),c=Ye(e.slice(13,45)),y=e.slice(45,78);switch(Ye(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Ho(_s,null,Ye(y),a,c,f,n,null);case"0x0488ade4":case"0x04358394 ":if(y[0]!==0)break;return new Ho(_s,Ye(y.slice(1)),null,a,c,f,n,null)}return js.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function Xp(r,t){t||(t="");const e=pu("mnemonic"+t,s0.NFKD);return D8(pu(r,s0.NFKD),e,2048,64,"sha512")}function il(r,t){t=jp(t),js.checkNormalize();const e=t.split(r);if(e.length%3!==0)throw new Error("invalid mnemonic");const n=Se(new Uint8Array(Math.ceil(11*e.length/8)));let a=0;for(let w=0;w<e.length;w++){let E=t.getWordIndex(e[w].normalize("NFKD"));if(E===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)E&1<<10-M&&(n[a>>3]|=1<<7-a%8),a++}const f=32*e.length/3,c=e.length/3,y=Ub(c);if((Se(ya(n.slice(0,f/8)))[0]&y)!==(n[n.length-1]&y))throw new Error("invalid checksum");return Ye(n.slice(0,f/8))}function Zp(r,t){if(t=jp(t),r=Se(r),r.length%4!==0||r.length<16||r.length>32)throw new Error("invalid entropy");const e=[0];let n=11;for(let c=0;c<r.length;c++)n>8?(e[e.length-1]<<=8,e[e.length-1]|=r[c],n-=8):(e[e.length-1]<<=n,e[e.length-1]|=r[c]>>8-n,e.push(r[c]&c5(8-n)),n+=3);const a=r.length/4,f=Se(ya(r))[0]&Ub(a);return e[e.length-1]<<=a,e[e.length-1]|=f>>8-a,t.join(e.map(c=>t.getWord(c)))}
10function Lb(r,t){try{return il(r,t),!0}catch{}return!1}function $b(r){return(typeof r!="number"||r<0||r>=Us||r%1)&&js.throwArgumentError("invalid account index","index",r),`m/44'/60'/${r}'/0/0`}const cT=Object.freeze(Object.defineProperty({__proto__:null,HDNode:Db,defaultPath:Fb,entropyToMnemonic:Zp,getAccountPath:$b,isValidMnemonic:Lb,mnemonicToEntropy:il,mnemonicToSeed:Xp},Symbol.toStringTag,{value:"Module"}));var Gb={exports:{}};(function(r,t){(function(e){function n(l){return parseInt(l)===l}function a(l){if(!n(l.length))return!1;for(var o=0;o<l.length;o++)if(!n(l[o])||l[o]<0||l[o]>255)return!1;return!0}function f(l,o){if(l.buffer&&ArrayBuffer.isView(l)&&l.name==="Uint8Array")return o&&(l.slice?l=l.slice():l=Array.prototype.slice.call(l)),l;if(Array.isArray(l)){if(!a(l))throw new Error("Array contains invalid value: "+l);return new Uint8Array(l)}if(n(l.length)&&a(l))return new Uint8Array(l);throw new Error("unsupported array-like object")}function c(l){return new Uint8Array(l)}function y(l,o,g,C,u){(C!=null||u!=null)&&(l.slice?l=l.slice(C,u):l=Array.prototype.slice.call(l,C,u)),o.set(l,g)}var b=function(){function l(g){var C=[],u=0;for(g=encodeURI(g);u<g.length;){var A=g.charCodeAt(u++);A===37?(C.push(parseInt(g.substr(u,2),16)),u+=2):C.push(A)}return f(C)}function o(g){for(var C=[],u=0;u<g.length;){var A=g[u];A<128?(C.push(String.fromCharCode(A)),u++):A>191&&A<224?(C.push(String.fromCharCode((A&31)<<6|g[u+1]&63)),u+=2):(C.push(String.fromCharCode((A&15)<<12|(g[u+1]&63)<<6|g[u+2]&63)),u+=3)}return C.join("")}return{toBytes:l,fromBytes:o}}(),w=function(){function l(C){for(var u=[],A=0;A<C.length;A+=2)u.push(parseInt(C.substr(A,2),16));return u}var o="0123456789abcdef";function g(C){for(var u=[],A=0;A<C.length;A++){var S=C[A];u.push(o[(S&240)>>4]+o[S&15])}return u.join("")}return{toBytes:l,fromBytes:g}}(),E={16:10,24:12,32:14},M=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],O=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],F=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],B=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3
10025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],L=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,111
105438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],z=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],q=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428
10677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],V=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],At=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,18625348
1068,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],St=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Z=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,6454
1001037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Y=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ct=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,12
1001765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Tt=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Rt=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861
10748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Dt(l){for(var o=[],g=0;g<l.length;g+=4)o.push(l[g]<<24|l[g+1]<<16|l[g+2]<<8|l[g+3]);return o}var I=function(l){if(!(this instanceof I))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:f(l,!0)}),this._prepare()};I.prototype._prepare=function(){var l=E[this.key.length];if(l==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var o=0;o<=l;o++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var g=(l+1)*4,C=this.key.length/4,u=Dt(this.key),A,o=0;o<C;o++)A=o>>2,this._Ke[A][o%4]=u[o],this._Kd[l-A][o%4]=u[o];for(var S=0,_=C,P;_<g;){if(P=u[C-1],u[0]^=O[P>>16&255]<<24^O[P>>8&255]<<16^O[P&255]<<8^O[P>>24&255]^M[S]<<24,S+=1,C!=8)for(var o=1;o<C;o++)u[o]^=u[o-1];else{for(var o=1;o<C/2;o++)u[o]^=u[o-1];P=u[C/2-1],u[C/2]^=O[P&255]^O[P>>8&255]<<8^O[P>>16&255]<<16^O[P>>24&255]<<24;for(var o=C/2+1;o<C;o++)u[o]^=u[o-1]}for(var o=0,K,$;o<C&&_<g;)K=_>>2,$=_%4,this._Ke[K][$]=u[o],this._Kd[l-K][$]=u[o++],_++}for(var K=1;K<l;K++)for(var $=0;$<4;$++)P=this._Kd[K][$],this._Kd[K][$]=Y[P>>24&255]^Ct[P>>16&255]^Tt[P>>8&255]^Rt[P&255]},I.prototype.encrypt=function(l){if(l.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var o=this._Ke.length-1,g=[0,0,0,0],C=Dt(l),u=0;u<4;u++)C[u]^=this._Ke[0][u];for(var A=1;A<o;A++){for(var u=0;u<4;u++)g[u]=B[C[u]>>24&255]^L[C[(u+1)%4]>>16&255]^z[C[(u+2)%4]>>8&255]^q[C[(u+3)%4]&255]^this._Ke[A][u];C=g.slice()}for(var S=c(16),_,u=0;u<4;u++)_=this._Ke[o][u],S[4*u]=(O[C[u]>>24&255]^_>>24)&255,S[4*u+1]=(O[C[(u+1)%4]>>16&255]^_>>16)&255,S[4*u+2]=(O[C[(u+2)%4]>>8&255]^_>>8)&255,S[4*u+3]=(O[C[(u+3)%4]&255]^_)&255;return S},I.prototype.decrypt=function(l){if(l.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");
10for(var o=this._Kd.length-1,g=[0,0,0,0],C=Dt(l),u=0;u<4;u++)C[u]^=this._Kd[0][u];for(var A=1;A<o;A++){for(var u=0;u<4;u++)g[u]=V[C[u]>>24&255]^At[C[(u+3)%4]>>16&255]^St[C[(u+2)%4]>>8&255]^Z[C[(u+1)%4]&255]^this._Kd[A][u];C=g.slice()}for(var S=c(16),_,u=0;u<4;u++)_=this._Kd[o][u],S[4*u]=(F[C[u]>>24&255]^_>>24)&255,S[4*u+1]=(F[C[(u+3)%4]>>16&255]^_>>16)&255,S[4*u+2]=(F[C[(u+2)%4]>>8&255]^_>>8)&255,S[4*u+3]=(F[C[(u+1)%4]&255]^_)&255;return S};var N=function(l){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new I(l)};N.prototype.encrypt=function(l){if(l=f(l),l.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var o=c(l.length),g=c(16),C=0;C<l.length;C+=16)y(l,g,0,C,C+16),g=this._aes.encrypt(g),y(g,o,C);return o},N.prototype.decrypt=function(l){if(l=f(l),l.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var o=c(l.length),g=c(16),C=0;C<l.length;C+=16)y(l,g,0,C,C+16),g=this._aes.decrypt(g),y(g,o,C);return o};var d=function(l,o){if(!(this instanceof d))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!o)o=c(16);else if(o.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=f(o,!0),this._aes=new I(l)};d.prototype.encrypt=function(l){if(l=f(l),l.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var o=c(l.length),g=c(16),C=0;C<l.length;C+=16){y(l,g,0,C,C+16);for(var u=0;u<16;u++)g[u]^=this._lastCipherblock[u];this._lastCipherblock=this._aes.encrypt(g),y(this._lastCipherblock,o,C)}return o},d.prototype.decrypt=function(l){if(l=f(l),l.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var o=c(l.length),g=c(16),C=0;C<l.length;C+=16){y(l,g,0,C,C+16),g=this._aes.decrypt(g);for(var u=0;u<16;u++)o[C+u]=g[u]^this._lastCipherblock[u];y(l,this._lastCipherblock,0,C,C+16)}return o};var i=function(l,o,g){if(!(this instanceof i))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!o)o=c(16);else if(o.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");g||(g=1),this.segmentSize=g,this._shiftRegister=f(o,!0),this._aes=new I(l)};i.prototype.encrypt=function(l){if(l.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var o=f(l,!0),g,C=0;C<o.length;C+=this.segmentSize){g=this._aes.encrypt(this._shiftRegister);for(var u=0;u<this.segmentSize;u++)o[C+u]^=g[u];y(this._shiftRegister,this._shiftRegister,0,this.segmentSize),y(o,this._shiftRegister,16-this.segmentSize,C,C+this.segmentSize)}return o},i.prototype.decrypt=function(l){if(l.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var o=f(l,!0),g,C=0;C<o.length;C+=this.segmentSize){g=this._aes.encrypt(this._shiftRegister);for(var u=0;u<this.segmentSize;u++)o[C+u]^=g[u];y(this._shiftRegister,this._shiftRegister,0,this.segmentSize),y(l,this._shiftRegister,16-this.segmentSize,C,C+this.segmentSize)}return o};var s=function(l,o){if(!(this instanceof s))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!o)o=c(16);else if(o.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=f(o,!0),this._lastPrecipherIndex=16,this._aes=new I(l)};s.prototype.encrypt=function(l){for(var o=f(l,!0),g=0;g<o.length;g++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),o[g]^=this._lastPrecipher[this._lastPrecipherIndex++];return o},s.prototype.decrypt=s.prototype.encrypt;var h=function(l){if(!(this instanceof h))throw Error("Counter must be instanitated with `new`");l!==0&&!l&&(l=1),typeof l=="number"?(this._counter=c(16),this.setValue(l)):this.setBytes(l)};h.prototype.setValue=function(l){if(typeof l!="number"||parseInt(l)!=l)throw new Error("invalid counter value (must be an integer)");for(var o=15;o>=0;--o)this._counter[o]=l%256,l=l>>8},h.prototype.setBytes=function(l){if(l=f(l,!0),l.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=l},h.prototype.increment=function(){for(var l=15;l>=0;l--)if(this._counter[l]===255)this._counter[l]=0;else{this._counter[l]++;break}};var p=function(l,o){if(!(this instanceof p))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",o instanceof h||(o=new h(o)),this._counter=o,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new I(l)};p.prototype.encrypt=function(l){for(var o=f(l,!0),g=0;g<o.length;g++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt
10(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),o[g]^=this._remainingCounter[this._remainingCounterIndex++];return o},p.prototype.decrypt=p.prototype.encrypt;function m(l){l=f(l,!0);var o=16-l.length%16,g=c(l.length+o);y(l,g);for(var C=l.length;C<g.length;C++)g[C]=o;return g}function v(l){if(l=f(l,!0),l.length<16)throw new Error("PKCS#7 invalid length");var o=l[l.length-1];if(o>16)throw new Error("PKCS#7 padding byte out of range");for(var g=l.length-o,C=0;C<o;C++)if(l[g+C]!==o)throw new Error("PKCS#7 invalid padding byte");var u=c(g);return y(l,u,0,0,g),u}var x={AES:I,Counter:h,ModeOfOperation:{ecb:N,cbc:d,cfb:i,ofb:s,ctr:p},utils:{hex:w,utf8:b},padding:{pkcs7:{pad:m,strip:v}},_arrayTest:{coerceArray:f,createArray:c,copyArray:y}};r.exports=x})()})(Gb);var d5=Gb.exports;const Mr=Nr(d5);var ba;(function(r){r.sha256="sha256",r.sha512="sha512"})(ba||(ba={}));const p5="sha2/5.7.0",g5=new _t(p5);function m5(r){return"0x"+oe.ripemd160().update(kt(r)).digest("hex")}function qf(r){return"0x"+oe.sha256().update(kt(r)).digest("hex")}function xu(r,t,e){return ba[r]||g5.throwError("unsupported algorithm "+r,_t.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:r}),"0x"+oe.hmac(oe[r],kt(t)).update(kt(e)).digest("hex")}function $a(r,t,e,n,a){r=kt(r),t=kt(t);let f,c=1;const y=new Uint8Array(n),b=new Uint8Array(t.length+4);b.set(t);let w,E;for(let M=1;M<=c;M++){b[t.length]=M>>24&255,b[t.length+1]=M>>16&255,b[t.length+2]=M>>8&255,b[t.length+3]=M&255;let O=kt(xu(a,r,b));f||(f=O.length,E=new Uint8Array(f),c=Math.ceil(n/f),w=n-(c-1)*f),E.set(O);for(let L=1;L<e;L++){O=kt(xu(a,r,O));for(let z=0;z<f;z++)E[z]^=O[z]}const F=(M-1)*f,B=M===c?w:f;y.set(kt(E).slice(0,B),F)}return Ut(y)}const zb="json-wallets/5.4.0";function as(r){return typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),kt(r)}function P0(r,t){for(r=String(r);r.length<t;)r="0"+r;return r}function Qp(r){return typeof r=="string"?cr(r,cf.NFKC):kt(r)}function mr(r,t){let e=r;const n=t.toLowerCase().split("/");for(let a=0;a<n.length;a++){let f=null;for(const c in e)if(c.toLowerCase()===n[a]){f=e[c];break}if(f===null)return null;e=f}return e}function v5(r){const t=kt(r);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=Ut(t);return[e.substring(2,10),e.substring(10,14),e.substring(14,18),e.substring(18,22),e.substring(22,34)].join("-")}const x5=new _t(zb);let y5=class extends Wi{isCrowdsaleAccount(t){return!!(t&&t._isCrowdsaleAccount)}};function Yp(r,t){const e=JSON.parse(r);t=Qp(t);const n=je(mr(e,"ethaddr")),a=as(mr(e,"encseed"));(!a||a.length%16!==0)&&x5.throwArgumentError("invalid encseed","json",r);const f=kt($a(t,t,2e3,32,"sha256")).slice(0,16),c=a.slice(0,16),y=a.slice(16),b=new Mr.ModeOfOperation.cbc(f,c),w=Mr.padding.pkcs7.strip(kt(b.decrypt(y)));let E="";for(let F=0;F<w.length;F++)E+=String.fromCharCode(w[F]);const M=cr(E),O=Je(M);return new y5({_isCrowdsaleAccount:!0,address:n,privateKey:O})}function nl(r){let t=null;try{t=JSON.parse(r)}catch{return!1}return t.encseed&&t.ethaddr}function ol(r){let t=null;try{t=JSON.parse(r)}catch{return!1}return!(!t.version||parseInt(t.version)!==t.version||parseInt(t.version)!==3)}function qb(r){if(nl(r))try{return je(JSON.parse(r).ethaddr)}catch{return null}if(ol(r))try{return je(JSON.parse(r).address)}catch{return null}return null}var Kb={exports:{}};(function(r,t){(function(e){function a(L){const z=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 q=1779033703,V=3144134277,At=1013904242,St=2773480762,Z=1359893119,Y=2600822924,Ct=528734635,Tt=1541459225;const Rt=new Uint32Array(64);function Dt(p){let m=0,v=p.length;for(;v>=64;){let x=q,l=V,o=At,g=St,C=Z,u=Y,A=Ct,S=Tt,_,P,K,$,U;for(P=0;P<16;P++)K=m+P*4,Rt[P]=(p[K]&255)<<24|(p[K+1]&255)<<16|(p[K+2]&255)<<8|p[K+3]&255;for(P=16;P<64;P++)_=Rt[P-2],$=(_>>>17|_<<15)^(_>>>19|_<<13)^_>>>10,_=Rt[P-15],U=(_>>>7|_<<25)^(_>>>18|_<<14)^_>>>3,Rt[P]=($+Rt[P-7]|0)+(U+Rt[P-16]|0)|0;for(P=0;P<64;P++)$=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&u^~C&A)|0)+(S+(z[P]+Rt[P]|0)|0)|0,U=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))+(x&l^x&o^l&o)|0,S=A,A=u,u=C,C=g+$|0,g=o,o=l,l=x,x=$+U|0;q=q+x|0,V=V+l|0,At=At+o|0,St=St+g|0,Z=Z+C|0,Y=Y+u|0,Ct=Ct+A|0,Tt=Tt+S|0,m+=64,v-=64}}Dt(L);let I,N=L.length%64,d=L.length/536870912|0,i=L.length<<3,s=N<56?56:120,h=L.slice(L.length-N,L.length);for(h.push(128),I=N+1;I<s;I++)h.push(0);return h.push(d>>>24&255),h.push(d>>>16&255),h.push(d>>>8&255),h.push(d>>>0&255),h.push(i>>>24&255),h.push(i>>>16&255),h.push(i>>>8&255),h.push(i>>>0&255),Dt(h),[q>>>24&255,q>>>16&255,q>>>8&255,q>>>0&255,V>>>24&255,V>>>16&255,V>>>8&255,V>>>0&255,At>>>24&255,At>>>16&255,At>>>8&255,At>>>0&255,St>>>24&255,St>>>16&255,St>>>8&255,St>>>0&255,Z>>>24&255,Z>>>16&255,Z>>>8&255,Z>>>0&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y>>>0&255,Ct>>>24&255,Ct>>>16&255,Ct>>>
108&255,Ct>>>0&255,Tt>>>24&255,Tt>>>16&255,Tt>>>8&255,Tt>>>0&255]}function f(L,z,q){L=L.length<=64?L:a(L);const V=64+z.length+4,At=new Array(V),St=new Array(64);let Z,Y=[];for(Z=0;Z<64;Z++)At[Z]=54;for(Z=0;Z<L.length;Z++)At[Z]^=L[Z];for(Z=0;Z<z.length;Z++)At[64+Z]=z[Z];for(Z=V-4;Z<V;Z++)At[Z]=0;for(Z=0;Z<64;Z++)St[Z]=92;for(Z=0;Z<L.length;Z++)St[Z]^=L[Z];function Ct(){for(let Tt=V-1;Tt>=V-4;Tt--){if(At[Tt]++,At[Tt]<=255)return;At[Tt]=0}}for(;q>=32;)Ct(),Y=Y.concat(a(St.concat(a(At)))),q-=32;return q>0&&(Ct(),Y=Y.concat(a(St.concat(a(At))).slice(0,q))),Y}function c(L,z,q,V,At){let St;for(E(L,(2*q-1)*16,At,0,16),St=0;St<2*q;St++)w(L,St*16,At,16),b(At,V),E(At,0,L,z+St*16,16);for(St=0;St<q;St++)E(L,z+St*2*16,L,St*16,16);for(St=0;St<q;St++)E(L,z+(St*2+1)*16,L,(St+q)*16,16)}function y(L,z){return L<<z|L>>>32-z}function b(L,z){E(L,0,z,0,16);for(let q=8;q>0;q-=2)z[4]^=y(z[0]+z[12],7),z[8]^=y(z[4]+z[0],9),z[12]^=y(z[8]+z[4],13),z[0]^=y(z[12]+z[8],18),z[9]^=y(z[5]+z[1],7),z[13]^=y(z[9]+z[5],9),z[1]^=y(z[13]+z[9],13),z[5]^=y(z[1]+z[13],18),z[14]^=y(z[10]+z[6],7),z[2]^=y(z[14]+z[10],9),z[6]^=y(z[2]+z[14],13),z[10]^=y(z[6]+z[2],18),z[3]^=y(z[15]+z[11],7),z[7]^=y(z[3]+z[15],9),z[11]^=y(z[7]+z[3],13),z[15]^=y(z[11]+z[7],18),z[1]^=y(z[0]+z[3],7),z[2]^=y(z[1]+z[0],9),z[3]^=y(z[2]+z[1],13),z[0]^=y(z[3]+z[2],18),z[6]^=y(z[5]+z[4],7),z[7]^=y(z[6]+z[5],9),z[4]^=y(z[7]+z[6],13),z[5]^=y(z[4]+z[7],18),z[11]^=y(z[10]+z[9],7),z[8]^=y(z[11]+z[10],9),z[9]^=y(z[8]+z[11],13),z[10]^=y(z[9]+z[8],18),z[12]^=y(z[15]+z[14],7),z[13]^=y(z[12]+z[15],9),z[14]^=y(z[13]+z[12],13),z[15]^=y(z[14]+z[13],18);for(let q=0;q<16;++q)L[q]+=z[q]}function w(L,z,q,V){for(let At=0;At<V;At++)q[At]^=L[z+At]}function E(L,z,q,V,At){for(;At--;)q[V++]=L[z++]}function M(L){if(!L||typeof L.length!="number")return!1;for(let z=0;z<L.length;z++){const q=L[z];if(typeof q!="number"||q%1||q<0||q>=256)return!1}return!0}function O(L,z){if(typeof L!="number"||L%1)throw new Error("invalid "+z);return L}function F(L,z,q,V,At,St,Z){if(q=O(q,"N"),V=O(V,"r"),At=O(At,"p"),St=O(St,"dkLen"),q===0||q&q-1)throw new Error("N must be power of 2");if(q>2147483647/128/V)throw new Error("N too large");if(V>2147483647/128/At)throw new Error("r too large");if(!M(L))throw new Error("password must be an array or buffer");if(L=Array.prototype.slice.call(L),!M(z))throw new Error("salt must be an array or buffer");z=Array.prototype.slice.call(z);let Y=f(L,z,At*128*V);const Ct=new Uint32Array(At*32*V);for(let C=0;C<Ct.length;C++){const u=C*4;Ct[C]=(Y[u+3]&255)<<24|(Y[u+2]&255)<<16|(Y[u+1]&255)<<8|(Y[u+0]&255)<<0}const Tt=new Uint32Array(64*V),Rt=new Uint32Array(32*V*q),Dt=32*V,I=new Uint32Array(16),N=new Uint32Array(16),d=At*q*2;let i=0,s=null,h=!1,p=0,m=0,v,x;const l=Z?parseInt(1e3/V):4294967295,o=typeof setImmediate<"u"?setImmediate:setTimeout,g=function(){if(h)return Z(new Error("cancelled"),i/d);let C;switch(p){case 0:x=m*32*V,E(Ct,x,Tt,0,Dt),p=1,v=0;case 1:C=q-v,C>l&&(C=l);for(let A=0;A<C;A++)E(Tt,0,Rt,(v+A)*Dt,Dt),c(Tt,Dt,V,I,N);if(v+=C,i+=C,Z){const A=parseInt(1e3*i/d);if(A!==s){if(h=Z(null,i/d),h)break;s=A}}if(v<q)break;v=0,p=2;case 2:C=q-v,C>l&&(C=l);for(let A=0;A<C;A++){const S=(2*V-1)*16,_=Tt[S]&q-1;w(Rt,_*Dt,Tt,Dt),c(Tt,Dt,V,I,N)}if(v+=C,i+=C,Z){const A=parseInt(1e3*i/d);if(A!==s){if(h=Z(null,i/d),h)break;s=A}}if(v<q)break;if(E(Tt,0,Ct,x,Dt),m++,m<At){p=0;break}Y=[];for(let A=0;A<Ct.length;A++)Y.push(Ct[A]>>0&255),Y.push(Ct[A]>>8&255),Y.push(Ct[A]>>16&255),Y.push(Ct[A]>>24&255);const u=f(L,Y,St);return Z&&Z(null,1,u),u}Z&&o(g)};if(!Z)for(;;){const C=g();if(C!=null)return C}g()}const B={scrypt:function(L,z,q,V,At,St,Z){return new Promise(function(Y,Ct){let Tt=0;Z&&Z(0),F(L,z,q,V,At,St,function(Rt,Dt,I){if(Rt)Ct(Rt);
10else if(I)Z&&Tt!==1&&Z(1),Y(new Uint8Array(I));else if(Z&&Dt!==Tt)return Tt=Dt,Z(Dt)})})},syncScrypt:function(L,z,q,V,At,St){return new Uint8Array(F(L,z,q,V,At,St))}};r.exports=B})()})(Kb);var b5=Kb.exports;const w0=Nr(b5);let Hb=class{constructor(t){Pt(this,"alphabet",t),Pt(this,"base",t.length),Pt(this,"_alphabetMap",{}),Pt(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=kt(t);if(e.length===0)return"";let n=[0];for(let f=0;f<e.length;++f){let c=e[f];for(let y=0;y<n.length;++y)c+=n[y]<<8,n[y]=c%this.base,c=c/this.base|0;for(;c>0;)n.push(c%this.base),c=c/this.base|0}let a="";for(let f=0;e[f]===0&&f<e.length-1;++f)a+=this._leader;for(let f=n.length-1;f>=0;--f)a+=this.alphabet[n[f]];return a}decode(t){if(typeof t!="string")throw new TypeError("Expected String");let e=[];if(t.length===0)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let a=this._alphabetMap[t[n]];if(a===void 0)throw new Error("Non-base"+this.base+" character");let f=a;for(let c=0;c<e.length;++c)f+=e[c]*this.base,e[c]=f&255,f>>=8;for(;f>0;)e.push(f&255),f>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return kt(new Uint8Array(e.reverse()))}};new Hb("abcdefghijklmnopqrstuvwxyz234567");const wa=new Hb("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var t1={exports:{}};t1.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};
vendor: 35,743 bytes, line 10
10function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
10function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(t1);var w5=t1.exports;const de=Nr(w5);function E0(r,t,e){return e={path:t,exports:{},require:function(n,a){return E5(n,a??e.path)}},r(e,e.exports),e.exports}function E5(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var e1=Wb;function Wb(r,t){if(!r)throw new Error(t||"Assertion failed")}Wb.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var vo=E0(function(r,t){var e=t;function n(c,y){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var w=0;w<c.length;w++)b[w]=c[w]|0;return b}if(y==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var w=0;w<c.length;w+=2)b.push(parseInt(c[w]+c[w+1],16))}else for(var w=0;w<c.length;w++){var E=c.charCodeAt(w),M=E>>8,O=E&255;M?b.push(M,O):b.push(O)}return b}e.toArray=n;function a(c){return c.length===1?"0"+c:c}e.zero2=a;function f(c){for(var y="",b=0;b<c.length;b++)y+=a(c[b].toString(16));return y}e.toHex=f,e.encode=function(y,b){return b==="hex"?f(y):y}}),Vi=E0(function(r,t){var e=t;e.assert=e1,e.toArray=vo.toArray,e.zero2=vo.zero2,e.toHex=vo.toHex,e.encode=vo.encode;function n(b,w,E){var M=new Array(Math.max(b.bitLength(),E)+1);M.fill(0);for(var O=1<<w+1,F=b.clone(),B=0;B<M.length;B++){var L,z=F.andln(O-1);F.isOdd()?(z>(O>>1)-1?L=(O>>1)-z:L=z,F.isubn(L)):L=0,M[B]=L,F.iushrn(1)}return M}e.getNAF=n;function a(b,w){var E=[[],[]];b=b.clone(),w=w.clone();for(var M=0,O=0,F;b.cmpn(-M)>0||w.cmpn(-O)>0;){var B=b.andln(3)+M&3,L=w.andln(3)+O&3;B===3&&(B=-1),L===3&&(L=-1);var z;B&1?(F=b.andln(7)+M&7,(F===3||F===5)&&L===2?z=-B:z=B):z=0,E[0].push(z);var q;L&1?(F=w.andln(7)+O&7,(F===3||F===5)&&B===2?q=-L:q=L):q=0,E[1].push(q),2*M===z+1&&(M=1-M),2*O===q+1&&(O=1-O),b.iushrn(1),w.iushrn(1)}return E}e.getJSF=a;function f(b,w,E){var M="_"+w;b.prototype[w]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}e.cachedProperty=f;function c(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=c;function y(b){return new de(b,"hex","le")}e.intFromLE=y}),yu=Vi.getNAF,A5=Vi.getJSF,bu=Vi.assert;function Zf(r,t){this.type=r,this.p=new de(t.p,16),this.red=t.prime?de.red(t.prime):de.mont(this.p),this.zero=new de(0).toRed(this.red),this.one=new de(1).toRed(this.red),this.two=new de(2).toRed(this.red),this.n=t.n&&new de(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 e=this.n&&this.p.div(this.n);!e||e.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var bs=Zf;Zf.prototype.point=function(){throw new Error("Not implemented")};Zf.prototype.validate=function(){throw new Error("Not implemented")};Zf.prototype._fixedNafMul=function(t,e){bu(t.precomputed);var n=t._getDoubles(),a=yu(e,1,this._bitLength),f=(1<<n.step+1)-(n.step%2===0?2:1);f/=3;var c=[],y,b;for(y=0;y<a.length;y+=n.step){b=0;for(var w=y+n.step-1;w>=y;w--)b=(b<<1)+a[w];c.push(b)}for(var E=this.jpoint(null,null,null),M=this.jpoint(null,null,null),O=f;O>0;O--){for(y=0;y<c.length;y++)b=c[y],b===O?M=M.mixedAdd(n.points[y]):b===-O&&(M=M.mixedAdd(n.points[y].neg()));E=E.add(M)}return E.toP()};Zf.prototype._wnafMul=function(t,e){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var f=a.points,c=yu(e,n,this._bitLength),y=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var w=0;b>=0&&c[b]===0;b--)w++;if(b>=0&&w++,y=y.dblp(w),b<0)break;var E=c[b];bu(E!==0),t.type==="affine"?E>0?y=y.mixedAdd(f[E-1>>1]):y=y.mixedAdd(f[-E-1>>1].neg()):E>0?y=y.add(f[E-1>>1]):y=y.add(f[-E-1>>1].neg())}return t.type==="affine"?y.toP():y};Zf.prototype._wnafMulAdd=function(t,e,n,a,f){var c=this._wnafT1,y=this._wnafT2,b=this._wnafT3,w=0,E,M,O;for(E=0;E<a;E++){O=e[E];var F=O._getNAFPoints(t);c[E]=F.wnd,y[E]=F.points}for(E=a-1;E>=1;E-=2){var B=E-1,L=E;if(c[B]!==1||c[L]!==1){b[B]=yu(n[B],c[B],this._bitLength),b[L]=yu(n[L],c[L],this._bitLength),w=Math.max(b[B].length,w),w=Math.max(b[L].length,w);continue}var z=[e[B],null,null,e[L]];
10e[B].y.cmp(e[L].y)===0?(z[1]=e[B].add(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg())):e[B].y.cmp(e[L].y.redNeg())===0?(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].add(e[L].neg())):(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],V=A5(n[B],n[L]);for(w=Math.max(V[0].length,w),b[B]=new Array(w),b[L]=new Array(w),M=0;M<w;M++){var At=V[0][M]|0,St=V[1][M]|0;b[B][M]=q[(At+1)*3+(St+1)],b[L][M]=0,y[B]=z}}var Z=this.jpoint(null,null,null),Y=this._wnafT4;for(E=w;E>=0;E--){for(var Ct=0;E>=0;){var Tt=!0;for(M=0;M<a;M++)Y[M]=b[M][E]|0,Y[M]!==0&&(Tt=!1);if(!Tt)break;Ct++,E--}if(E>=0&&Ct++,Z=Z.dblp(Ct),E<0)break;for(M=0;M<a;M++){var Rt=Y[M];Rt!==0&&(Rt>0?O=y[M][Rt-1>>1]:Rt<0&&(O=y[M][-Rt-1>>1].neg()),O.type==="affine"?Z=Z.mixedAdd(O):Z=Z.add(O))}}for(E=0;E<a;E++)y[E]=null;return f?Z:Z.toP()};function Nn(r,t){this.curve=r,this.type=t,this.precomputed=null}Zf.BasePoint=Nn;Nn.prototype.eq=function(){throw new Error("Not implemented")};Nn.prototype.validate=function(){return this.curve.validate(this)};Zf.prototype.decodePoint=function(t,e){t=Vi.toArray(t,e);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?bu(t[t.length-1]%2===0):t[0]===7&&bu(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};Nn.prototype.encodeCompressed=function(t){return this.encode(t,!0)};Nn.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))};Nn.prototype.encode=function(t,e){return Vi.encode(this._encode(e),t)};Nn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this};Nn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1};Nn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,f=0;f<e;f+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}};Nn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),f=1;f<n;f++)e[f]=e[f-1].add(a);return{wnd:t,points:e}};Nn.prototype._getBeta=function(){return null};Nn.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var r1=E0(function(r){typeof Object.create=="function"?r.exports=function(e,n){
10n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,n){if(n){e.super_=n;var a=function(){};a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e}}}),M5=Vi.assert;function _n(r){bs.call(this,"short",r),this.a=new de(r.a,16).toRed(this.red),this.b=new de(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}r1(_n,bs);var N5=_n;_n.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,n;if(t.beta)e=new de(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);e=a[0].cmp(a[1])<0?a[0]:a[1],e=e.toRed(this.red)}if(t.lambda)n=new de(t.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))===0?n=f[0]:(n=f[1],M5(this.g.mul(n).x.cmp(this.g.x.redMul(e))===0))}var c;return t.basis?c=t.basis.map(function(y){return{a:new de(y.a,16),b:new de(y.b,16)}}):c=this._getEndoBasis(n),{beta:e,lambda:n,basis:c}}};_n.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:de.mont(t),n=new de(2).toRed(e).redInvm(),a=n.redNeg(),f=new de(3).toRed(e).redNeg().redSqrt().redMul(n),c=a.redAdd(f).fromRed(),y=a.redSub(f).fromRed();return[c,y]};_n.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),f=new de(1),c=new de(0),y=new de(0),b=new de(1),w,E,M,O,F,B,L,z=0,q,V;n.cmpn(0)!==0;){var At=a.div(n);q=a.sub(At.mul(n)),V=y.sub(At.mul(f));var St=b.sub(At.mul(c));if(!M&&q.cmp(e)<0)w=L.neg(),E=f,M=q.neg(),O=V;else if(M&&++z===2)break;L=q,a=n,n=q,y=f,f=V,b=c,c=St}F=q.neg(),B=V;var Z=M.sqr().add(O.sqr()),Y=F.sqr().add(B.sqr());return Y.cmp(Z)>=0&&(F=w,B=E),M.negative&&(M=M.neg(),O=O.neg()),F.negative&&(F=F.neg(),B=B.neg()),[{a:M,b:O},{a:F,b:B}]};_n.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],a=e[1],f=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),y=f.mul(n.a),b=c.mul(a.a),w=f.mul(n.b),E=c.mul(a.b),M=t.sub(y).sub(b),O=w.add(E).neg();return{k1:M,k2:O}};_n.prototype.pointFromX=function(t,e){t=new de(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)};_n.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,a=this.a.redMul(e),f=e.redSqr().redMul(e).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(f).cmpn(0)===0};_n.prototype._endoWnafMulAdd=function(t,e,n){for(var a=this._endoWnafT1,f=this._endoWnafT2,c=0;c<t.length;c++){var y=this._endoSplit(e[c]),b=t[c],w=b._getBeta();y.k1.negative&&(y.k1.ineg(),b=b.neg(!0)),y.k2.negative&&(y.k2.ineg(),w=w.neg(!0)),a[c*2]=b,a[c*2+1]=w,f[c*2]=y.k1,f[c*2+1]=y.k2}for(var E=this._wnafMulAdd(1,a,f,c*2,n),M=0;M<c*2;M++)a[M]=null,f[M]=null;return E};function jr(r,t,e,n){bs.BasePoint.call(this,r,"affine"),t===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new de(t,16),this.y=new de(e,16),n&&(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)}r1(jr,bs.BasePoint);_n.prototype.point=function(t,e,n){return new jr(this,t,e,n)};_n.prototype.pointFromJSON=function(t,e){return jr.fromJSON(this,t,e)};jr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,a=function(f){return n.point(f.x.redMul(n.endo.beta),f.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return e}};jr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.prec
10omputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};jr.fromJSON=function(t,e,n){typeof e=="string"&&(e=JSON.parse(e));var a=t.point(e[0],e[1],n);if(!e[2])return a;function f(y){return t.point(y[0],y[1],n)}var c=e[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(f))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(f))}},a};jr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};jr.prototype.isInfinity=function(){return this.inf};jr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),a=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)};jr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),a=t.redInvm(),f=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(a),c=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,y)};jr.prototype.getX=function(){return this.x.fromRed()};jr.prototype.getY=function(){return this.y.fromRed()};jr.prototype.mul=function(t){return t=new de(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};jr.prototype.mulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f):this.curve._wnafMulAdd(1,a,f,2)};jr.prototype.jmulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f,!0):this.curve._wnafMulAdd(1,a,f,2,!0)};jr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};jr.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
10if(t&&this.precomputed){var n=this.precomputed,a=function(f){return f.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return e};jr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function oi(r,t,e,n){bs.BasePoint.call(this,r,"jacobian"),t===null&&e===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new de(0)):(this.x=new de(t,16),this.y=new de(e,16),this.z=new de(n,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}r1(oi,bs.BasePoint);_n.prototype.jpoint=function(t,e,n){return new oi(this,t,e,n)};oi.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),a=this.y.redMul(e).redMul(t);return this.curve.point(n,a)};oi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};oi.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(e),f=t.x.redMul(n),c=this.y.redMul(e.redMul(t.z)),y=t.y.redMul(n.redMul(this.z)),b=a.redSub(f),w=c.redSub(y);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=b.redSqr(),M=E.redMul(b),O=a.redMul(E),F=w.redSqr().redIAdd(M).redISub(O).redISub(O),B=w.redMul(O.redISub(F)).redISub(c.redMul(M)),L=this.z.redMul(t.z).redMul(b);return this.curve.jpoint(F,B,L)};oi.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,a=t.x.redMul(e),f=this.y,c=t.y.redMul(e).redMul(this.z),y=n.redSub(a),b=f.redSub(c);if(y.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=y.redSqr(),E=w.redMul(y),M=n.redMul(w),O=b.redSqr().redIAdd(E).redISub(M).redISub(M),F=b.redMul(M.redISub(O)).redISub(f.redMul(E)),B=this.z.redMul(y);return this.curve.jpoint(O,F,B)};oi.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var a=this.curve.a,f=this.curve.tinv,c=this.x,y=this.y,b=this.z,w=b.redSqr().redSqr(),E=y.redAdd(y);for(e=0;e<t;e++){var M=c.redSqr(),O=E.redSqr(),F=O.redSqr(),B=M.redAdd(M).redIAdd(M).redIAdd(a.redMul(w)),L=c.redMul(O),z=B.redSqr().redISub(L.redAdd(L)),q=L.redISub(z),V=B.redMul(q);V=V.redIAdd(V).redISub(F);var At=E.redMul(b);e+1<t&&(w=w.redMul(F)),c=z,b=At,E=V}return this.curve.jpoint(c,E.redMul(f),b)};oi.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};oi.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a),w=b.redSqr().redISub(y).redISub(y),E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),t=w,e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),O=this.y.redSqr(),F=O.redSqr(),B=this.x.redAdd(O).redSqr().redISub(M).redISub(F);B=B.redIAdd(B);var L=M.redAdd(M).redIAdd(M),z=L.redSqr(),q=F.redIAdd(F);q=q.redIAdd(q),q=q.redIAdd(q),t=z.redISub(B).redISub(B),e=L.redMul(B.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,e,n)};oi.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),w=b.redSqr().redISub(y).redISub(y);t=w;var E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),O=this.y.redSqr(),F=this.x.redMul(O),B=this.x.redSub(M).redMul(this.x.redAdd(M));B=B.redAdd(B).redIAdd(B);var L=F.redIAdd(F);L=L.redIAdd(L);var z=L.redAdd(L);t=B.redSqr().redISub(z),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(M);var q=O.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),e=B.redMul(L.redISub(t)).redISub(q)}return this.curve.jpoint(t,e,n)};oi.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,a=this.z,f=a.redSqr().redSqr(),c=e.redSqr(),y=n.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(f)),w=e.redAdd(e);w=w.redIAdd(w);var E=w.redMul(y),M=b.redSqr().redISub(E.redAdd(E)),O=E.redISub(M),F=y.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=b.redMul(O).redISub(F),L=n.redAdd(n).redMul(a);return this.curve.jpoint(M,B,L)};oi.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),a=e.redSqr(),f=t.redAdd(t).redIAdd(t),
10c=f.redSqr(),y=this.x.redAdd(e).redSqr().redISub(t).redISub(a);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(c);var b=y.redSqr(),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=f.redIAdd(y).redSqr().redISub(c).redISub(b).redISub(w),M=e.redMul(E);M=M.redIAdd(M),M=M.redIAdd(M);var O=this.x.redMul(b).redISub(M);O=O.redIAdd(O),O=O.redIAdd(O);var F=this.y.redMul(E.redMul(w.redISub(E)).redISub(y.redMul(b)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=this.z.redAdd(y).redSqr().redISub(n).redISub(b);return this.curve.jpoint(O,F,B)};oi.prototype.mul=function(t,e){return t=new de(t,e),this.curve._wnafMul(this,t)};oi.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var a=e.redMul(this.z),f=n.redMul(t.z);return this.y.redMul(f).redISub(t.y.redMul(a)).cmpn(0)===0};oi.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(n)===0)return!0;for(var a=t.clone(),f=this.curve.redN.redMul(e);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(f),this.x.cmp(n)===0)return!0}};oi.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};oi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var _h=E0(function(r,t){var e=t;e.base=bs,e.short=N5,e.mont=null,e.edwards=null}),Sh=E0(function(r,t){var e=t,n=Vi.assert;function a(y){y.type==="short"?this.curve=new _h.short(y):y.type==="edwards"?this.curve=new _h.edwards(y):this.curve=new _h.mont(y),this.g=this.curve.g,this.n=this.curve.n,this.hash=y.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function f(y,b){Object.defineProperty(e,y,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,y,{configurable:!0,enumerable:!0,value:w}),w}})}f("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:oe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:oe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:oe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:oe.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"]}),f("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:oe.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oe.sha256,gRed:!1,g:["9"]}),f("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:oe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}f("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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
10,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Kf(r){if(!(this instanceof Kf))return new Kf(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=vo.toArray(r.entropy,r.entropyEnc||"hex"),e=vo.toArray(r.nonce,r.nonceEnc||"hex"),n=vo.toArray(r.pers,r.persEnc||"hex");e1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,e,n)}var Jb=Kf;Kf.prototype._init=function(t,e,n){var a=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656};Kf.prototype._hmac=function(){return new oe.hmac(this.hash,this.K)};Kf.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};Kf.prototype.reseed=function(t,e,n,a){typeof e!="string"&&(a=n,n=e,e=null),t=vo.toArray(t,e),n=vo.toArray(n,a),e1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};Kf.prototype.generate=function(t,e,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(a=n,n=e,e=null),n&&(n=vo.toArray(n,a||"hex"),this._update(n));for(var f=[];f.length<t;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,t);return this._update(n),this._reseed++,vo.encode(c,e)};var Cd=Vi.assert;function mi(r,t){this.ec=r,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var i1=mi;mi.fromPublic=function(t,e,n){return e instanceof mi?e:new mi(t,{pub:e,pubEnc:n})};mi.fromPrivate=function(t,e,n){return e instanceof mi?e:new mi(t,{priv:e,privEnc:n})};mi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}};mi.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub};mi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};mi.prototype._importPrivate=function(t,e){this.priv=new de(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)};mi.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?Cd(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Cd(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)};mi.prototype.derive=function(t){return t.validate()||Cd(t.validate(),"public point not validated"),t.mul(this.priv).getX()};mi.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)};mi.prototype.verify=function(t,e){return this.ec.verify(t,e,this)};mi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var _5=Vi.assert;function fl(r,t){if(r instanceof fl)return r;this._importDER(r,t)||(_5(r.r&&r.s,"Signature without r or s"),this.r=new de(r.r,16),this.s=new de(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var sl=fl;function S5(){this.place=0}function lc(r,t){var e=r[t.place++];if(!(e&128))return e;var n=e&15;if(n===0||n>4)return!1;for(var a=0,f=0,c=t.place;f<n;f++,c++)a<<=8,a|=r[c],a>>>=0;return a<=127?!1:(t.place=c,a)}function Lm(r){for(var t=0,e=r.length-1;!r[t]&&!(r[t+1]&128)&&t<e;)t++;return t===0?r:r.slice(t)}fl.prototype._importDER=function(t,e){t=Vi.toArray(t,e);var n=new S5;if(t[n.place++]!==48)return!1;var a=lc(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var f=lc(t,n);if(f===!1)return!1;var c=t.slice(n.place,f+n.place);if(n.place+=f,t[n.place++]!==2)return!1;var y=lc(t,n);if(y===!1||t.length!==y+n.place)return!1;var b=t.slice(n.place,y+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new de(c),this.s=new de(b),this.recoveryParam=null,!0};function cc(r,t){if(t<128){r.push(t);return}var e=1+(Math.log(t)/Math.LN2>>>3);for(r.push(e|128);--e;)r.push(t>>>(e<<3)&255);r.push(t)}fl.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();
10for(e[0]&128&&(e=[0].concat(e)),n[0]&128&&(n=[0].concat(n)),e=Lm(e),n=Lm(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];cc(a,e.length),a=a.concat(e),a.push(2),cc(a,n.length);var f=a.concat(n),c=[48];return cc(c,f.length),c=c.concat(f),Vi.encode(c,t)};var I5=function(){throw new Error("unsupported")},Vb=Vi.assert;function xn(r){if(!(this instanceof xn))return new xn(r);typeof r=="string"&&(Vb(Object.prototype.hasOwnProperty.call(Sh,r),"Unknown curve "+r),r=Sh[r]),r instanceof Sh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var R5=xn;xn.prototype.keyPair=function(t){return new i1(this,t)};xn.prototype.keyFromPrivate=function(t,e){return i1.fromPrivate(this,t,e)};xn.prototype.keyFromPublic=function(t,e){return i1.fromPublic(this,t,e)};xn.prototype.genKeyPair=function(t){t||(t={});for(var e=new Jb({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||I5(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new de(2));;){var f=new de(e.generate(n));if(!(f.cmp(a)>0))return f.iaddn(1),this.keyFromPrivate(f)}};xn.prototype._truncateToN=function(t,e){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t};xn.prototype.sign=function(t,e,n,a){typeof n=="object"&&(a=n,n=null),a||(a={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new de(t,16));for(var f=this.n.byteLength(),c=e.getPrivate().toArray("be",f),y=t.toArray("be",f),b=new Jb({hash:this.hash,entropy:c,nonce:y,pers:a.pers,persEnc:a.persEnc||"utf8"}),w=this.n.sub(new de(1)),E=0;;E++){var M=a.k?a.k(E):new de(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(w)>=0)){var O=this.g.mul(M);if(!O.isInfinity()){var F=O.getX(),B=F.umod(this.n);if(B.cmpn(0)!==0){var L=M.invm(this.n).mul(B.mul(e.getPrivate()).iadd(t));if(L=L.umod(this.n),L.cmpn(0)!==0){var z=(O.getY().isOdd()?1:0)|(F.cmp(B)!==0?2:0);return a.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),z^=1),new sl({r:B,s:L,recoveryParam:z})}}}}}};xn.prototype.verify=function(t,e,n,a){t=this._truncateToN(new de(t,16)),n=this.keyFromPublic(n,a),e=new sl(e,"hex");var f=e.r,c=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var y=c.invm(this.n),b=y.mul(t).umod(this.n),w=y.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)};xn.prototype.recoverPubKey=function(r,t,e,n){Vb((3&e)===e,"The recovery param is more than two bits"),t=new sl(t,n);var a=this.n,f=new de(r),c=t.r,y=t.s,b=e&1,w=e>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var E=t.r.invm(a),M=a.sub(f).mul(E).umod(a),O=y.mul(E).umod(a);return this.g.mulAdd(M,c,O)};xn.prototype.getKeyRecoveryParam=function(r,t,e,n){if(t=new sl(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var f;try{f=this.recoverPubKey(r,t,a)}catch{continue}if(f.eq(e))return a}throw new Error("Unable to find valid recovery factor")};var T5=E0(function(r,t){var e=t;e.version="6.5.4",e.utils=Vi,e.rand=function(){throw new Error("unsupported")},e.curve=_h,e.curves=Sh,e.ec=R5,e.eddsa=null}),P5=T5.ec;const C5="signing-key/5.7.0",Od=new _t(C5);let dc=null;function _f(){return dc||(dc=new P5("secp256k1")),dc}let Xs=class{constructor(t){Pt(this,"curve","secp256k1"),Pt(this,"privateKey",Ut(t)),cs(this.privateKey)!==32&&Od.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=_f().keyFromPrivate(kt(this.privateKey));Pt(this,"publicKey","0x"+e.getPublic(!1,"hex")),Pt(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),Pt(this,"_isSigningKey",!0)}_addPoint(t){const e=_f().keyFromPublic(kt(this.publicKey)),n=_f().keyFromPublic(kt(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}
10signDigest(t){const e=_f().keyFromPrivate(kt(this.privateKey)),n=kt(t);n.length!==32&&Od.throwArgumentError("bad digest length","digest",t);const a=e.sign(n,{canonical:!0});return d0({recoveryParam:a.recoveryParam,r:Qe("0x"+a.r.toString(16),32),s:Qe("0x"+a.s.toString(16),32)})}computeSharedSecret(t){const e=_f().keyFromPrivate(kt(this.privateKey)),n=_f().keyFromPublic(kt(jb(t)));return Qe("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}};function O5(r,t){const e=d0(t),n={r:kt(e.r),s:kt(e.s)};return"0x"+_f().recoverPubKey(kt(r),n,e.recoveryParam).encode("hex",!1)}function jb(r,t){const e=kt(r);return e.length===32?new Xs(e).publicKey:e.length===33?"0x"+_f().keyFromPublic(e).getPublic(!1,"hex"):e.length===65?Ut(e):Od.throwArgumentError("invalid public or private key","key","[REDACTED]")}const k5="transactions/5.7.0",ci=new _t(k5);var $m;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})($m||($m={}));function n1(r){return r==="0x"?null:je(r)}function hi(r){return r==="0x"?yp:zt.from(r)}const B5=[{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"}],U5={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function uf(r){const t=jb(r);return je(Ar(Je(Ar(t,1)),12))}function al(r,t){return uf(O5(kt(r),t))}function Gi(r,t){const e=hf(zt.from(r).toHexString());return e.length>32&&ci.throwArgumentError("invalid length for "+t,"transaction:"+t,r),e}function pc(r,t){return{address:je(r),storageKeys:(t||[]).map((e,n)=>(cs(e)!==32&&ci.throwArgumentError("invalid access list storageKey",`accessList[${r}:${n}]`,e),e.toLowerCase()))}}function A0(r){if(Array.isArray(r))return r.map((e,n)=>Array.isArray(e)?(e.length>2&&ci.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,e),pc(e[0],e[1])):pc(e.address,e.storageKeys));const t=Object.keys(r).map(e=>{const n=r[e].reduce((a,f)=>(a[f]=!0,a),{});return pc(e,Object.keys(n).sort())});return t.sort((e,n)=>e.address.localeCompare(n.address)),t}function Xb(r){return A0(r).map(t=>[t.address,t.storageKeys])}function Zb(r,t){if(r.gasPrice!=null){const n=zt.from(r.gasPrice),a=zt.from(r.maxFeePerGas||0);n.eq(a)||ci.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:a})}const e=[Gi(r.chainId||0,"chainId"),Gi(r.nonce||0,"nonce"),Gi(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Gi(r.maxFeePerGas||0,"maxFeePerGas"),Gi(r.gasLimit||0,"gasLimit"),r.to!=null?je(r.to):"0x",Gi(r.value||0,"value"),r.data||"0x",Xb(r.accessList||[])];if(t){const n=d0(t);e.push(Gi(n.recoveryParam,"recoveryParam")),e.push(hf(n.r)),e.push(hf(n.s))}return Mi(["0x02",o0(e)])}function Qb(r,t){const e=[Gi(r.chainId||0,"chainId"),Gi(r.nonce||0,"nonce"),Gi(r.gasPrice||0,"gasPrice"),Gi(r.gasLimit||0,"gasLimit"),r.to!=null?je(r.to):"0x",Gi(r.value||0,"value"),r.data||"0x",Xb(r.accessList||[])];if(t){const n=d0(t);e.push(Gi(n.recoveryParam,"recoveryParam")),e.push(hf(n.r)),e.push(hf(n.s))}return Mi(["0x01",o0(e)])}function F5(r,t){z2(r,U5);const e=[];B5.forEach(function(c){let y=r[c.name]||[];const b={};c.numeric&&(b.hexPad="left"),y=kt(Ut(y,b)),c.length&&y.length!==c.length&&y.length>0&&ci.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,y),c.maxLength&&(y=hf(y),y.length>c.maxLength&&ci.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,y)),e.push(Ut(y))});let n=0;if(r.chainId!=null?(n=r.chainId,typeof n!="number"&&ci.throwArgumentError("invalid transaction.chainId","transaction",r)):t&&!Ju(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),n!==0&&(e.push(Ut(n)),e.push("0x"),e.push("0x")),!t)return o0(e);const a=d0(t);let f=27+a.recoveryParam;return n!==0?(e.pop(),e.pop(),e.pop(),f+=n*2+8,a.v>28&&a.v!==f&&ci.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):a.v!==f&&ci.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),e.push(Ut(f)),e.push(hf(kt(a.r))),e.push(hf(kt(a.s))),o0(e)}function Gm(r,t){if(r.type==null||r.type===0)return r.accessList!=null&&ci.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",r),F5(r,t);switch(r.type){case 1:return Qb(r,t);case 2:return Zb(r,t)}return ci.throwError(`unsupported transaction type: ${r.type}`,_t.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:r.type})}function Yb(r,t,e){try{const n=hi(t[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");r.v=n}catch{ci.throwArgumentError("invalid v for transaction type: 1","v",t[0])}r.r=Qe(t[1],32),r.s=Qe(t[2],32);try{const n=Je(e(r));r.from=al(n,{r:r.r,s:r.s,recoveryParam:r.v})}catch{}}function D5(r){const t=vp(r.slice(1));t.length!==9&&t.length!==12&&ci.throwArgumentError("invalid component count for transaction type: 2","payload",Ut(r));const e=hi(t[2]),n=hi(t[3]),a={type:2,chainId:hi(t[0]).toNumber(),nonce:hi(t[1]).toNumber(),maxPriorityFeePerGas:e,maxFeePerGas:n,gasPrice:null,gasLimit:hi(t[4]),to:n1(t[5]),value:hi(t[6]),data:t[7],accessList:A0(t[8])};return t.length===9||(a.hash=Je(r),Yb(a,t.slice(9),Zb)),a}function L5(r){const t=vp(r.slice(1));t.length!==8&&t.length!==11&&ci.throwArgumentError("invalid component count for transaction type: 1","payload",Ut(r));const e={type:1,chainId:hi(t[0]).toNumber(),nonce:hi(t[1]).toNumber(),gasPrice:hi(t[2]),gasLimit:hi(t[3]),to:n1(t[4]),value:hi(t[5]),data:t[6],accessList:A0(t[7])};return t.length===8||(e.hash=Je(r),Yb(e,t.slice(8),Qb)),e}function $5(r){const t=vp(r);t.length!==9&&t.length!==6&&ci.throwArgumentError("invalid raw transaction","rawTransaction",r);const e={nonce:hi(t[0]).toNumber(),gasPrice:hi(t[1]),gasLimit:hi(t[2]),to:n1(t[3]),value:hi(t[4]),data:t[5],chainId:0};if(t.length===6)return e;try{e.v=zt.from(t[6]).toNumber()}catch{return e}if(e.r=Qe(t[7],32),e.s=Qe(t[8],32),zt.from(e.r).isZero()&&zt.from(e.s).isZero())e.chainId=e.v,e.v=0;else{e.chainId=Math.floor((e.v-35)/2),e.chainId<0&&(e.chainId=0);let n=e.v-27;const a=t.slice(0,6);e.chainId!==0&&(a.push(Ut(e.chainId)),a.push("0x"),a.push("0x"),n-=e.chainId*2+8);const f=Je(o0(a));try{e.from=al(f,{r:Ut(e.r),s:Ut(e.s),recoveryParam:n})}catch{}e.hash=Je(r)}return e.type=null,e}function G5(r){const t=kt(r);if(t[0]>127)return $5(t);switch(t[0]){case 1:return L5(t);case 2:return D5(t)}return ci.throwError(`unsupported transaction type: ${t[0]}`,_t.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}const z5="wordlists/5.7.0",q5=new _t(z5);class Ga{constructor(t){q5.checkAbstract(new.target,Ga),Pt(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){const e=[];for(let n=0;n<2048;n++){const a=t.getWord(n);if(n!==t.getWordIndex(a))return"0x";e.push(a)}return po(e.join(`
11`)+`
12`)}static register(t,e){e||(e=t.locale)}}const K5="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCat
12chCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobster
12LocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThe
12nTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let ra=null;function zm(r){if(ra==null&&(ra=K5.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Ga.check(r)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw ra=null,new Error("BIP39 Wordlist for en (English) FAILED")}class H5 extends Ga{constructor(){super("en")}getWord(t){return zm(this),ra[t]}getWordIndex(t){return zm(this),ra.indexOf(t)}}const tw=new H5;Ga.register(tw);const qm={en:tw},W5="hdnode/5.7.0",wu=new _t(W5),J5=zt.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),V5=cr("Bitcoin seed"),C0=2147483648;function ew(r){return(1<<r)-1<<8-r}function j5(r){return(1<<r)-1}function eh(r){return Qe(Ut(r),32)}function Km(r){return wa.encode(Ve([r,Ar(qf(qf(r)),0,4)]))}function o1(r){if(r==null)return qm.en;if(typeof r=="string"){const t=qm[r];return t==null&&wu.throwArgumentError("unknown locale","wordlist",r),t}return r}const Ss={},Hf="m/44'/60'/0'/0/0";class ki{constructor(t,e,n,a,f,c,y,b){if(t!==Ss)throw new Error("HDNode constructor cannot be called directly");if(e){const w=new Xs(e);Pt(this,"privateKey",w.privateKey),Pt(this,"publicKey",w.compressedPublicKey)}else Pt(this,"privateKey",null),Pt(this,"publicKey",Ut(n));Pt(this,"parentFingerprint",a),Pt(this,"fingerprint",Ar(m5(qf(this.publicKey)),0,4)),Pt(this,"address",uf(this.publicKey)),Pt(this,"chainCode",f),Pt(this,"index",c),Pt(this,"depth",y),b==null?(Pt(this,"mnemonic",null),Pt(this,"path",null)):typeof b=="string"?(Pt(this,"mnemonic",null),Pt(this,"path",b)):(Pt(this,"mnemonic",b),Pt(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Km(Ve([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Ut(this.depth),this.parentFingerprint,Qe(Ut(this.index),4),this.chainCode,this.privateKey!=null?Ve(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new ki(Ss,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw new Error("invalid index - "+String(t));let e=this.path;e&&(e+="/"+(t&~C0));const n=new Uint8Array(37);if(t&C0){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(kt(this.privateKey),1),e&&(e+="'")}else n.set(kt(this.publicKey));for(let M=24;M>=0;M-=8)n[33+(M>>3)]=t>>24-M&255;const a=kt(xu(ba.sha512,this.chainCode,n)),f=a.slice(0,32),c=a.slice(32);let y=null,b=null;this.privateKey?y=eh(zt.from(f).add(this.privateKey).mod(J5)):b=new Xs(Ut(f))._addPoint(this.publicKey);let w=e;const E=this.mnemonic;return E&&(w=Object.freeze({phrase:E.phrase,path:e,locale:E.locale||"en"})),new ki(Ss,y,b,this.fingerprint,eh(c),t,this.depth+1,w)}derivePath(t){const e=t.split("/");if(e.length===0||e[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+t);e[0]==="m"&&e.shift();let n=this;for(let a=0;a<e.length;a++){const f=e[a];if(f.match(/^[0-9]+'$/)){const c=parseInt(f.substring(0,f.length-1));if(c>=C0)throw new Error("invalid path index - "+f);n=n._derive(C0+c)}else if(f.match(/^[0-9]+$/)){const c=parseInt(f);if(c>=C0)throw new Error("invalid path index - "+f);n=n._derive(c)}else throw new Error("invalid path component - "+f)}return n}static _fromSeed(t,e){const n=kt(t);if(n.length<16||n.length>64)throw new Error("invalid seed");const a=kt(xu(ba.sha512,V5,n));return new ki(Ss,eh(a.slice(0,32)),null,"0x00000000",eh(a.slice(32)),0,0,e)}static fromMnemonic(t,e,n){return n=o1(n),t=hl(f1(t,n),n),ki._fromSeed(X5(t,e),{phrase:t,path:"m",locale:n.locale})}static fromSeed(t){return ki._fromSeed(t,null)}static fromExtendedKey(t){const e=wa.decode(t);(e.length!==82||Km(e.slice(0,78))!==t)&&wu.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=e[4],a=Ut(e.slice(5,9)),f=parseInt(Ut(e.slice(9,13)).substring(2),16),c=Ut(e.slice(13,45)),y=e.slice(45,78);switch(Ut(e.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new ki(Ss,null,Ut(y),a,c,f,n,null);case"0x0488ade4":case"0x04358394 ":if(y[0]!==0)break;
12return new ki(Ss,Ut(y.slice(1)),null,a,c,f,n,null)}return wu.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function X5(r,t){t||(t="");const e=cr("mnemonic"+t,cf.NFKD);return $a(cr(r,cf.NFKD),e,2048,64,"sha512")}function f1(r,t){t=o1(t),wu.checkNormalize();const e=t.split(r);if(e.length%3!==0)throw new Error("invalid mnemonic");const n=kt(new Uint8Array(Math.ceil(11*e.length/8)));let a=0;for(let w=0;w<e.length;w++){let E=t.getWordIndex(e[w].normalize("NFKD"));if(E===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)E&1<<10-M&&(n[a>>3]|=1<<7-a%8),a++}const f=32*e.length/3,c=e.length/3,y=ew(c);if((kt(qf(n.slice(0,f/8)))[0]&y)!==(n[n.length-1]&y))throw new Error("invalid checksum");return Ut(n.slice(0,f/8))}function hl(r,t){if(t=o1(t),r=kt(r),r.length%4!==0||r.length<16||r.length>32)throw new Error("invalid entropy");const e=[0];let n=11;for(let c=0;c<r.length;c++)n>8?(e[e.length-1]<<=8,e[e.length-1]|=r[c],n-=8):(e[e.length-1]<<=n,e[e.length-1]|=r[c]>>8-n,e.push(r[c]&j5(8-n)),n+=3);const a=r.length/4,f=kt(qf(r))[0]&ew(a);return e[e.length-1]<<=a,e[e.length-1]|=f>>8-a,t.join(e.map(c=>t.getWord(c)))}const Z5="random/5.7.0",kd=new _t(Z5);function Q5(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof cd<"u")return cd;throw new Error("unable to locate global object")}const Hm=Q5();let Ih=Hm.crypto||Hm.msCrypto;(!Ih||!Ih.getRandomValues)&&(kd.warn("WARNING: Missing strong random number source"),Ih={getRandomValues:function(r){return kd.throwError("no secure random source avaialble",_t.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function of(r){(r<=0||r>1024||r%1||r!=r)&&kd.throwArgumentError("invalid length","length",r);const t=new Uint8Array(r);return Ih.getRandomValues(t),kt(t)}var Y5=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Bd=new _t(zb);function Wm(r){return r!=null&&r.mnemonic&&r.mnemonic.phrase}let tN=class extends Wi{isKeystoreAccount(t){return!!(t&&t._isKeystoreAccount)}};function eN(r,t,e){if(mr(r,"crypto/cipher")==="aes-128-ctr"){const a=as(mr(r,"crypto/cipherparams/iv")),f=new Mr.Counter(a),c=new Mr.ModeOfOperation.ctr(t,f);return kt(c.decrypt(e))}return null}function rw(r,t){const e=as(mr(r,"crypto/ciphertext"));if(Ut(Je(Ve([t.slice(16,32),e]))).substring(2)!==mr(r,"crypto/mac").toLowerCase())throw new Error("invalid password");const a=eN(r,t.slice(0,16),e);a||Bd.throwError("unsupported cipher",_t.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const f=t.slice(32,64),c=uf(a);if(r.address){let b=r.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),je(b)!==c)throw new Error("address mismatch")}const y={_isKeystoreAccount:!0,address:c,privateKey:Ut(a)};if(mr(r,"x-ethers/version")==="0.1"){const b=as(mr(r,"x-ethers/mnemonicCiphertext")),w=as(mr(r,"x-ethers/mnemonicCounter")),E=new Mr.Counter(w),M=new Mr.ModeOfOperation.ctr(f,E),O=mr(r,"x-ethers/path")||Hf,F=mr(r,"x-ethers/locale")||"en",B=kt(M.decrypt(b));try{const L=hl(B,F),z=ki.fromMnemonic(L,null,F).derivePath(O);if(z.privateKey!=y.privateKey)throw new Error("mnemonic mismatch");y.mnemonic=z.mnemonic}catch(L){if(L.code!==_t.errors.INVALID_ARGUMENT||L.argument!=="wordlist")throw L}}return new tN(y)}function iw(r,t,e,n,a){return kt($a(r,t,e,n,a))}function rN(r,t,e,n,a){return Promise.resolve(iw(r,t,e,n,a))}function nw(r,t,e,n,a){const f=Qp(t),c=mr(r,"crypto/kdf");if(c&&typeof c=="string"){const y=function(b,w){return Bd.throwArgumentError("invalid key-derivation function parameters",b,w)};if(c.toLowerCase()==="scrypt"){const b=as(mr(r,"crypto/kdfparams/salt")),w=parseInt(mr(r,"crypto/kdfparams/n")),E=parseInt(mr(r,"crypto/kdfparams/r")),M=parseInt(mr(r,"crypto/kdfparams/p"));(!w||!E||!M)&&y("kdf",c),w&w-1&&y("N",w);const O=parseInt(mr(r,"crypto/kdfparams/dklen"));return O!==32&&y("dklen",O),n(f,b,w,E,M,64,a)}else if(c.toLowerCase()==="pbkdf2"){const b=as(mr(r,"crypto/kdfparams/salt"));let w=null;const E=mr(r,"crypto/kdfparams/prf");E==="hmac-sha256"?w="sha256":E==="hmac-sha512"?w="sha512":y("prf",E);const M=parseInt(mr(r,"crypto/kdfparams/c")),O=parseInt(mr(r,"crypto/kdfparams/dklen"));return O!==32&&y("dklen",O),e(f,b,M,O,w)}}return Bd.throwArgumentError("unsupported key-derivation function","kdf",c)}function ow(r,t){const e=JSON.parse(r),n=nw(e,t,iw,w0.syncScrypt);return rw(e,n)}function fw(r,t,e){return Y5(this,void 0,void 0,function*(){const n=JSON.parse(r),a=yield nw(n,t,rN,w0.scrypt,e);return rw(n,a)})}function iN(r,t,e,n){try{if(je(r.address)!==uf(r.privateKey))throw new Error("address/privateKey mismatch");if(Wm(r)){const z=r.mnemonic;if(ki.fromMnemonic(z.phrase,null,z.locale).derivePath(z.path||Hf).privateKey!=r.privateKey)throw new Error("mnemonic mismatch")}}catch(z){return Promise.reject(z)}typeof e=="function"&&!n&&(n=e,e={}),e||(e={});const a=kt(r.privateKey),f=Qp(t);let c=null,y=null,b=null;if(Wm(r)){const z=r.mnemonic;c=kt(f1(z.phrase,z.locale||"en")),y=z.path||Hf,b=z.locale||"en"}let w=e.client;w||(w="ethers.js");let E=null;e.salt?E=kt(e.salt):E=of(32);let M=null;if(e.iv){if(M=kt(e.iv),M.length!==16)throw new Error("invalid iv")}else M=of(16);let O=null;if(e.uuid){if(O=kt(e.uuid),O.length!==16)throw new Error("invalid uuid")}else O=of(16);let F=1<<17,B=8,L=1;return e.scrypt&&(e.scrypt.N&&(F=e.scrypt.N),e.scrypt.r&&(B=e.scrypt.r),e.scrypt.p&&(L=e.scrypt.p)),w0.scrypt(f,E,F,B,L,64,n).then(z=>{z=kt(z);const q=z.slice(0,16),V=z.slice(16,32),At=z.slice(32,64),St=new Mr.Counter(M),Z=new Mr.ModeOfOperation.ctr(q,St),Y=kt(Z.encrypt
12(a)),Ct=Je(Ve([V,Y])),Tt={address:r.address.substring(2).toLowerCase(),id:v5(O),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ut(M).substring(2)},ciphertext:Ut(Y).substring(2),kdf:"scrypt",kdfparams:{salt:Ut(E).substring(2),n:F,dklen:32,p:L,r:B},mac:Ct.substring(2)}};if(c){const Rt=of(16),Dt=new Mr.Counter(Rt),I=new Mr.ModeOfOperation.ctr(At,Dt),N=kt(I.encrypt(c)),d=new Date,i=d.getUTCFullYear()+"-"+P0(d.getUTCMonth()+1,2)+"-"+P0(d.getUTCDate(),2)+"T"+P0(d.getUTCHours(),2)+"-"+P0(d.getUTCMinutes(),2)+"-"+P0(d.getUTCSeconds(),2)+".0Z";Tt["x-ethers"]={client:w,gethFilename:"UTC--"+i+"--"+Tt.address,mnemonicCounter:Ut(Rt).substring(2),mnemonicCiphertext:Ut(N).substring(2),path:y,locale:b,version:"0.1"}}return JSON.stringify(Tt)})}function nN(r,t,e){if(nl(r)){e&&e(0);const n=Yp(r,t);return e&&e(1),Promise.resolve(n)}return ol(r)?fw(r,t,e):Promise.reject(new Error("invalid JSON wallet"))}function oN(r,t){if(nl(r))return Yp(r,t);if(ol(r))return ow(r,t);throw new Error("invalid JSON wallet")}const vT=Object.freeze(Object.defineProperty({__proto__:null,decryptCrowdsale:Yp,decryptJsonWallet:nN,decryptJsonWalletSync:oN,decryptKeystore:fw,decryptKeystoreSync:ow,encryptKeystore:iN,getJsonWalletAddress:qb,isCrowdsaleWallet:nl,isKeystoreWallet:ol},Symbol.toStringTag,{value:"Module"}));var sw={exports:{}};(function(r){(function(){var t=typeof window=="object"?window:{},e=!t.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;e&&(t=bi);for(var n=!t.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,a="0123456789abcdef".split(""),f=[31,7936,2031616,520093696],c=[1,256,65536,16777216],y=[6,1536,393216,100663296],b=[0,8,16,24],w=[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],E=[224,256,384,512],M=[128,256],O=["hex","buffer","arrayBuffer","array"],F=function(I,N,d){return function(i){return new Rt(I,N,I).update(i)[d]()}},B=function(I,N,d){return function(i,s){return new Rt(I,N,s).update(i)[d]()}},L=function(I,N){var d=F(I,N,"hex");d.create=function(){return new Rt(I,N,I)},d.update=function(h){return d.create().update(h)};for(var i=0;i<O.length;++i){var s=O[i];d[s]=F(I,N,s)}return d},z=function(I,N){var d=B(I,N,"hex");d.create=function(h){return new Rt(I,N,h)},d.update=function(h,p){return d.create(p).update(h)};for(var i=0;i<O.length;++i){var s=O[i];d[s]=B(I,N,s)}return d},q=[{name:"keccak",padding:c,bits:E,createMethod:L},{name:"sha3",padding:y,bits:E,createMethod:L},{name:"shake",padding:f,bits:M,createMethod:z}],V={},At=[],St=0;St<q.length;++St)for(var Z=q[St],Y=Z.bits,Ct=0;Ct<Y.length;++Ct){var Tt=Z.name+"_"+Y[Ct];At.push(Tt),V[Tt]=Z.createMethod(Y[Ct],Z.padding)}function Rt(I,N,d){this.blocks=[],this.s=[],this.padding=N,this.outputBits=d,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(I<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=d>>5,this.extraBytes=(d&31)>>3;for(var i=0;i<50;++i)this.s[i]=0}Rt.prototype.update=function(I){var N=typeof I!="string";N&&I.constructor===ArrayBuffer&&(I=new Uint8Array(I));for(var d=I.length,i=this.blocks,s=this.byteCount,h=this.blockCount,p=0,m=this.s,v,x;p<d;){if(this.reset)for(this.reset=!1,i[0]=this.block,v=1;v<h+1;++v)i[v]=0;if(N)for(v=this.start;p<d&&v<s;++p)i[v>>2]|=I[p]<<b[v++&3];else for(v=this.start;p<d&&v<s;++p)x=I.charCodeAt(p),x<128?i[v>>2]|=x<<b[v++&3]:x<2048?(i[v>>2]|=(192|x>>6)<<b[v++&3],i[v>>2]|=(128|x&63)<<b[v++&3]):x<55296||x>=57344?(i[v>>2]|=(224|x>>12)<<b[v++&3],i[v>>2]|=(128|x>>6&63)<<b[v++&3],i[v>>2]|=(128|x&63)<<b[v++&3]):(x=65536+((x&1023)<<10|I.charCodeAt(++p)&1023),i[v>>2]|=(240|x>>18)<<b[v++&3],i[v>>2]|=(128|x>>12&63)<<b[v++&3],i[v>>2]|=(128|x>>6&63)<<b[v++&3],i[v>>2]|=(128|x&63)<<b[v++&3]);if(this.lastByteIndex=v,v>=s){for(this.start=v-s,this.block=i[h],v=0;v<h;++v)m[v]^=i[v];Dt(m),this.reset=!0}else this.start=v}return this},Rt.prototype.finalize=function(){var I=this.blocks,N=this.lastByteIndex,d=this.blockCount,i=this.s;if(I[N>>2]|=this.padding[N&3],this.lastByteIndex===this.byteCount)for(I[0]=I[d],N=1;N<d+1;++N)I[N]=0;for(I[d-1]|=2147483648,N=0;N<d;++N)i[N]^=I[N];Dt(i)},Rt.prototype.toString=Rt.prototype.hex=function(){this.finalize();for(var I=this.blockCount,N=this.s,d=this.outputBlocks,i=this.extraBytes,s=0,h=0,p="",m;h<d;){for(s=0;s<I&&h<d;++s,++h)m=N[s],p+=a[m>>4&15]+a[m&15]+a[m>>12&15]+a[m>>8&15]+a[m>>20&15]+a[m>>16&15]+a[m>>28&15]+a[m>>24&15];h%I===0&&(Dt(N),s=0)}return i&&(m=N[s],i>0&&(p+=a[m>>4&15]+a[m&15]),i>1&&(p+=a[m>>12&15]+a[m>>8&15]),i>2&&(p+=a[m>>20&15]+a[m>>16&15])),p},Rt.prototype.arrayBuffer=function(){this.finalize();var I=this.blockCount,N=this.s,d=this.outputBlocks,i=this.extraBytes,s=0,h=0,p=this.outputBits>>3,m;i?m=new ArrayBuffer(d+1<<2):m=new ArrayBuffer(p);for(var v=new Uint32Array(m);h<d;){for(s=0;s<I&&h<d;++s,++h)v[h]=N[s];h%I===0&&Dt(N)}
12return i&&(v[s]=N[s],m=m.slice(0,p)),m},Rt.prototype.buffer=Rt.prototype.arrayBuffer,Rt.prototype.digest=Rt.prototype.array=function(){this.finalize();for(var I=this.blockCount,N=this.s,d=this.outputBlocks,i=this.extraBytes,s=0,h=0,p=[],m,v;h<d;){for(s=0;s<I&&h<d;++s,++h)m=h<<2,v=N[s],p[m]=v&255,p[m+1]=v>>8&255,p[m+2]=v>>16&255,p[m+3]=v>>24&255;h%I===0&&Dt(N)}return i&&(m=h<<2,v=N[s],i>0&&(p[m]=v&255),i>1&&(p[m+1]=v>>8&255),i>2&&(p[m+2]=v>>16&255)),p};var Dt=function(I){var N,d,i,s,h,p,m,v,x,l,o,g,C,u,A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht;for(i=0;i<48;i+=2)s=I[0]^I[10]^I[20]^I[30]^I[40],h=I[1]^I[11]^I[21]^I[31]^I[41],p=I[2]^I[12]^I[22]^I[32]^I[42],m=I[3]^I[13]^I[23]^I[33]^I[43],v=I[4]^I[14]^I[24]^I[34]^I[44],x=I[5]^I[15]^I[25]^I[35]^I[45],l=I[6]^I[16]^I[26]^I[36]^I[46],o=I[7]^I[17]^I[27]^I[37]^I[47],g=I[8]^I[18]^I[28]^I[38]^I[48],C=I[9]^I[19]^I[29]^I[39]^I[49],N=g^(p<<1|m>>>31),d=C^(m<<1|p>>>31),I[0]^=N,I[1]^=d,I[10]^=N,I[11]^=d,I[20]^=N,I[21]^=d,I[30]^=N,I[31]^=d,I[40]^=N,I[41]^=d,N=s^(v<<1|x>>>31),d=h^(x<<1|v>>>31),I[2]^=N,I[3]^=d,I[12]^=N,I[13]^=d,I[22]^=N,I[23]^=d,I[32]^=N,I[33]^=d,I[42]^=N,I[43]^=d,N=p^(l<<1|o>>>31),d=m^(o<<1|l>>>31),I[4]^=N,I[5]^=d,I[14]^=N,I[15]^=d,I[24]^=N,I[25]^=d,I[34]^=N,I[35]^=d,I[44]^=N,I[45]^=d,N=v^(g<<1|C>>>31),d=x^(C<<1|g>>>31),I[6]^=N,I[7]^=d,I[16]^=N,I[17]^=d,I[26]^=N,I[27]^=d,I[36]^=N,I[37]^=d,I[46]^=N,I[47]^=d,N=l^(s<<1|h>>>31),d=o^(h<<1|s>>>31),I[8]^=N,I[9]^=d,I[18]^=N,I[19]^=d,I[28]^=N,I[29]^=d,I[38]^=N,I[39]^=d,I[48]^=N,I[49]^=d,u=I[0],A=I[1],Bt=I[11]<<4|I[10]>>>28,et=I[10]<<4|I[11]>>>28,qt=I[20]<<3|I[21]>>>29,dt=I[21]<<3|I[20]>>>29,at=I[31]<<9|I[30]>>>23,Vt=I[30]<<9|I[31]>>>23,D=I[40]<<18|I[41]>>>14,j=I[41]<<18|I[40]>>>14,Lt=I[2]<<1|I[3]>>>31,pt=I[3]<<1|I[2]>>>31,S=I[13]<<12|I[12]>>>20,_=I[12]<<12|I[13]>>>20,X=I[22]<<10|I[23]>>>22,Ft=I[23]<<10|I[22]>>>22,it=I[33]<<13|I[32]>>>19,Kt=I[32]<<13|I[33]>>>19,bt=I[42]<<2|I[43]>>>30,ht=I[43]<<2|I[42]>>>30,ft=I[5]<<30|I[4]>>>2,Wt=I[4]<<30|I[5]>>>2,nt=I[14]<<6|I[15]>>>26,$t=I[15]<<6|I[14]>>>26,P=I[25]<<11|I[24]>>>21,K=I[24]<<11|I[25]>>>21,Q=I[34]<<15|I[35]>>>17,ot=I[35]<<15|I[34]>>>17,gt=I[45]<<29|I[44]>>>3,tt=I[44]<<29|I[45]>>>3,J=I[6]<<28|I[7]>>>4,Gt=I[7]<<28|I[6]>>>4,xt=I[17]<<23|I[16]>>>9,st=I[16]<<23|I[17]>>>9,mt=I[26]<<25|I[27]>>>7,k=I[27]<<25|I[26]>>>7,$=I[36]<<21|I[37]>>>11,U=I[37]<<21|I[36]>>>11,Ht=I[47]<<24|I[46]>>>8,vt=I[46]<<24|I[47]>>>8,H=I[8]<<27|I[9]>>>5,W=I[9]<<27|I[8]>>>5,ct=I[18]<<20|I[19]>>>12,rt=I[19]<<20|I[18]>>>12,Jt=I[29]<<7|I[28]>>>25,yt=I[28]<<7|I[29]>>>25,T=I[38]<<8|I[39]>>>24,R=I[39]<<8|I[38]>>>24,It=I[48]<<14|I[49]>>>18,G=I[49]<<14|I[48]>>>18,I[0]=u^~S&P,I[1]=A^~_&K,I[10]=J^~ct&qt,I[11]=Gt^~rt&dt,I[20]=Lt^~nt&mt,I[21]=pt^~$t&k,I[30]=H^~Bt&X,I[31]=W^~et&Ft,I[40]=ft^~xt&Jt,I[41]=Wt^~st&yt,I[2]=S^~P&$,I[3]=_^~K&U,I[12]=ct^~qt&it,I[13]=rt^~dt&Kt,I[22]=nt^~mt&T,I[23]=$t^~k&R,I[32]=Bt^~X&Q,I[33]=et^~Ft&ot,I[42]=xt^~Jt&at,I[43]=st^~yt&Vt,I[4]=P^~$&It,I[5]=K^~U&G,I[14]=qt^~it&gt,I[15]=dt^~Kt&tt,I[24]=mt^~T&D,I[25]=k^~R&j,I[34]=X^~Q&Ht,I[35]=Ft^~ot&vt,I[44]=Jt^~at&bt,I[45]=yt^~Vt&ht,I[6]=$^~It&u,I[7]=U^~G&A,I[16]=it^~gt&J,I[17]=Kt^~tt&Gt,I[26]=T^~D&Lt,I[27]=R^~j&pt,I[36]=Q^~Ht&H,I[37]=ot^~vt&W,I[46]=at^~bt&ft,I[47]=Vt^~ht&Wt,I[8]=It^~u&S,I[9]=G^~A&_,I[18]=gt^~J&ct,I[19]=tt^~Gt&rt,I[28]=D^~Lt&nt,I[29]=j^~pt&$t,I[38]=Ht^~H&Bt,I[39]=vt^~W&et,I[48]=bt^~ft&xt,I[49]=ht^~Wt&st,I[0]^=w[i],I[1]^=w[i+1]};if(n)r.exports=V;else for(var St=0;St<At.length;++St)t[At[St]]=V[At[St]]})()})(sw);var fN=sw.exports;const sN=Nr(fN),aN="logger/5.7.0";let Jm=!1,Vm=!1;const Rh={debug:1,default:2,info:2,warning:3,error:4,off:5};let jm=Rh.default,gc=null;function hN(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Xm=hN();var Ud;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Ud||(Ud={}));var to;
12(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(to||(to={}));const Zm="0123456789abcdef";let s1=class Or{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Rh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(jm>Rh[n])&&console.log.apply(console,e)}debug(...t){this._log(Or.levels.DEBUG,t)}info(...t){this._log(Or.levels.INFO,t)}warn(...t){this._log(Or.levels.WARNING,t)}makeError(t,e,n){if(Vm)return this.makeError("censored error",e,{});e||(e=Or.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Zm[w[M]>>4],E+=Zm[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case to.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case to.CALL_EXCEPTION:case to.INSUFFICIENT_FUNDS:case to.MISSING_NEW:case to.NONCE_EXPIRED:case to.REPLACEMENT_UNDERPRICED:case to.TRANSACTION_REPLACED:case to.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Or.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Xm&&this.throwError("platform missing String.prototype.normalize",Or.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Xm})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Or.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Or.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Or.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Or.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Or.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Or.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Or.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return gc||(gc=new Or(aN)),gc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Or.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Jm){if(!t)return;this.globalLogger().throwError("error censorship permanent",Or.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Vm=!!t,Jm=!!e}static setLogLevel(t){const e=Rh[t.toLowerCase()];if(e==null){Or.globalLogger().warn("invalid log level - "+t);return}jm=e}static from(t){return new Or(t)}};s1.errors=to;s1.levels=Ud;const uN="bytes/5.7.0",mc=new s1(uN);function lN(r){return!!r.toHexString}function Th(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Th(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function Qm(r){return typeof r=="number"&&r==r&&r%1===0}function cN(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!Qm(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Qm(e)||e<0||e>=256)return!1}return!0}function dN(r,t){if(t||(t={}),typeof r=="number"){mc.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Th(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),lN(r)&&(r=r.toHexString()),pN(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":mc.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Th(new Uint8Array(n))}return cN(r)?Th(new Uint8Array(r)):mc.throwArgumentError("invalid arrayify value","value",r)}function pN(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}function aw(r){return"0x"+sN.keccak_256(dN(r))}const xT=Object.freeze(Object.defineProperty({__proto__:null,keccak256:aw},Symbol.toStringTag,{value:"Module"})),gN="logger/5.4.0";let Ym=!1,tv=!1;const Ph={debug:1,default:2,info:2,warning:3,error:4,off:5};let ev=Ph.default,vc=null;function mN(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const rv=mN();var Eu;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Eu||(Eu={}));var Au;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(Au||(Au={}));let ul=class kr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Ph[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(ev>Ph[n])&&console.log.apply(console,e)}debug(...t){this._log(kr.levels.DEBUG,t)}info(...t){this._log(kr.levels.INFO,t)}warn(...t){this._log(kr.levels.WARNING,t)}makeError(t,e,n){if(tv)return this.makeError("censored error",e,{});e||(e=kr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(y=>{try{a.push(y+"="+JSON.stringify(n[y]))}catch{a.push(y+"="+JSON.stringify(n[y].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;a.length&&(t+=" ("+a.join(", ")+")");const c=new Error(t);return c.reason=f,c.code=e,Object.keys(n).forEach(function(y){c[y]=n[y]}),c}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,kr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){rv&&this.throwError("platform missing String.prototype.normalize",kr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:rv})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,kr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,kr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,kr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,kr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",kr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",kr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",kr.errors.MISSING_NEW,{name:e.name})}
12static globalLogger(){return vc||(vc=new kr(gN)),vc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",kr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ym){if(!t)return;this.globalLogger().throwError("error censorship permanent",kr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}tv=!!t,Ym=!!e}static setLogLevel(t){const e=Ph[t.toLowerCase()];if(e==null){kr.globalLogger().warn("invalid log level - "+t);return}ev=e}static from(t){return new kr(t)}};ul.errors=Au;ul.levels=Eu;const yT=Object.freeze(Object.defineProperty({__proto__:null,get ErrorCode(){return Au},get LogLevel(){return Eu},Logger:ul},Symbol.toStringTag,{value:"Module"})),vN="logger/5.7.0";let iv=!1,nv=!1;const Ch={debug:1,default:2,info:2,warning:3,error:4,off:5};let ov=Ch.default,xc=null;function xN(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const fv=xN();var Fd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Fd||(Fd={}));var eo;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(eo||(eo={}));const sv="0123456789abcdef";let za=class Br{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Ch[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(ov>Ch[n])&&console.log.apply(console,e)}debug(...t){this._log(Br.levels.DEBUG,t)}info(...t){this._log(Br.levels.INFO,t)}warn(...t){this._log(Br.levels.WARNING,t)}makeError(t,e,n){if(nv)return this.makeError("censored error",e,{});e||(e=Br.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=sv[w[M]>>4],E+=sv[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case eo.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case eo.CALL_EXCEPTION:case eo.INSUFFICIENT_FUNDS:case eo.MISSING_NEW:case eo.NONCE_EXPIRED:case eo.REPLACEMENT_UNDERPRICED:case eo.TRANSACTION_REPLACED:case eo.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Br.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){fv&&this.throwError("platform missing String.prototype.normalize",Br.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:fv})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Br.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Br.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Br.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Br.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Br.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Br.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Br.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return xc||(xc=new Br(vN)),xc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Br.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),iv){if(!t)return;this.globalLogger().throwError("error censorship permanent",Br.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}nv=!!t,iv=!!e}static setLogLevel(t){const e=Ch[t.toLowerCase()];if(e==null){Br.globalLogger().warn("invalid log level - "+t);return}ov=e}static from(t){return new Br(t)}};za.errors=eo;za.levels=Fd;
12const yN="bytes/5.7.0",yc=new za(yN);function bN(r){return!!r.toHexString}function Oh(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Oh(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function av(r){return typeof r=="number"&&r==r&&r%1===0}function wN(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!av(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!av(e)||e<0||e>=256)return!1}return!0}function Ea(r,t){if(t||(t={}),typeof r=="number"){yc.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Oh(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),bN(r)&&(r=r.toHexString()),EN(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":yc.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Oh(new Uint8Array(n))}return wN(r)?Oh(new Uint8Array(r)):yc.throwArgumentError("invalid arrayify value","value",r)}function EN(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}var Aa;(function(r){r.sha256="sha256",r.sha512="sha512"})(Aa||(Aa={}));const AN="sha2/5.4.0",MN=new za(AN);function hw(r){return"0x"+oe.ripemd160().update(Ea(r)).digest("hex")}function uw(r){return"0x"+oe.sha256().update(Ea(r)).digest("hex")}function lw(r){return"0x"+oe.sha512().update(Ea(r)).digest("hex")}function cw(r,t,e){return Aa[r]||MN.throwError("unsupported algorithm "+r,za.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:r}),"0x"+oe.hmac(oe[r],Ea(t)).update(Ea(e)).digest("hex")}const bT=Object.freeze(Object.defineProperty({__proto__:null,get SupportedAlgorithm(){return Aa},computeHmac:cw,ripemd160:hw,sha256:uw,sha512:lw},Symbol.toStringTag,{value:"Module"})),NN=new RegExp("^bytes([0-9]+)$"),_N=new RegExp("^(u?int)([0-9]*)$"),SN=new RegExp("^(.*)\\[([0-9]*)\\]$"),IN="0000000000000000000000000000000000000000000000000000000000000000";function dw(r,t,e){switch(r){case"address":return e?lh(t,32):kt(t);case"string":return cr(t);case"bytes":return kt(t);case"bool":return t=t?"0x01":"0x00",e?lh(t,32):kt(t)}let n=r.match(_N);if(n){let a=parseInt(n[2]||"256");if(n[2]&&String(a)!==n[2]||a%8!==0||a===0||a>256)throw new Error("invalid number type - "+r);return e&&(a=256),t=zt.from(t).toTwos(a),lh(t,a/8)}if(n=r.match(NN),n){const a=parseInt(n[1]);if(String(a)!==n[1]||a===0||a>32)throw new Error("invalid bytes type - "+r);if(kt(t).byteLength!==a)throw new Error("invalid value for "+r);return e?kt((t+IN).substring(0,66)):t}if(n=r.match(SN),n&&Array.isArray(t)){const a=n[1];if(parseInt(n[2]||String(t.length))!=t.length)throw new Error("invalid value for "+r);const c=[];return t.forEach(function(y){c.push(dw(a,y,!0))}),Ve(c)}throw new Error("invalid type - "+r)}function ll(r,t){if(r.length!=t.length)throw new Error("type/value count mismatch");const e=[];return r.forEach(function(n,a){e.push(dw(n,t[a]))}),Ut(Ve(e))}function pw(r,t){return Je(ll(r,t))}function gw(r,t){return qf(ll(r,t))}const wT=Object.freeze(Object.defineProperty({__proto__:null,keccak256:pw,pack:ll,sha256:gw},Symbol.toStringTag,{value:"Module"})),RN="logger/5.7.0";let hv=!1,uv=!1;const kh={debug:1,default:2,info:2,warning:3,error:4,off:5};let lv=kh.default,bc=null;function TN(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const cv=TN();var Dd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Dd||(Dd={}));var ro;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(ro||(ro={}));const dv="0123456789abcdef";
12let qa=class Ur{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();kh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(lv>kh[n])&&console.log.apply(console,e)}debug(...t){this._log(Ur.levels.DEBUG,t)}info(...t){this._log(Ur.levels.INFO,t)}warn(...t){this._log(Ur.levels.WARNING,t)}makeError(t,e,n){if(uv)return this.makeError("censored error",e,{});e||(e=Ur.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=dv[w[M]>>4],E+=dv[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case ro.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case ro.CALL_EXCEPTION:case ro.INSUFFICIENT_FUNDS:case ro.MISSING_NEW:case ro.NONCE_EXPIRED:case ro.REPLACEMENT_UNDERPRICED:case ro.TRANSACTION_REPLACED:case ro.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Ur.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){cv&&this.throwError("platform missing String.prototype.normalize",Ur.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:cv})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Ur.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Ur.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Ur.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Ur.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Ur.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Ur.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Ur.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return bc||(bc=new Ur(RN)),bc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Ur.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),hv){if(!t)return;this.globalLogger().throwError("error censorship permanent",Ur.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}uv=!!t,hv=!!e}static setLogLevel(t){const e=kh[t.toLowerCase()];if(e==null){Ur.globalLogger().warn("invalid log level - "+t);return}lv=e}static from(t){return new Ur(t)}};qa.errors=ro;qa.levels=Dd;const PN="bytes/5.7.0",wc=new qa(PN);function CN(r){return!!r.toHexString}function Bh(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Bh(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function pv(r){return typeof r=="number"&&r==r&&r%1===0}function ON(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!pv(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!pv(e)||e<0||e>=256)return!1}return!0}function kN(r,t){if(t||(t={}),typeof r=="number"){wc.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Bh(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),CN(r)&&(r=r.toHexString()),BN(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":wc.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Bh(new Uint8Array(n))}return ON(r)?Bh(new Uint8Array(r)):wc.throwArgumentError("invalid arrayify value","value",r)}function BN(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const UN="random/5.4.0",Ld=new qa(UN);let os=null;try{if(os=window,os==null)throw new Error("try next")}catch{try{if(os=cd,os==null)throw new Error("try next")}catch{os={}}}let Uh=os.crypto||os.msCrypto;(!Uh||!Uh.getRandomValues)&&(Ld.warn("WARNING: Missing strong random number source"),Uh={getRandomValues:function(r){return Ld.throwError("no secure random source avaialble",qa.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function mw(r){(r<=0||r>1024||r%1)&&Ld.throwArgumentError("invalid length","length",r);const t=new Uint8Array(r);return Uh.getRandomValues(t),kN(t)}function vw(r){r=r.slice();for(let t=r.length-1;t>0;t--){const e=Math.floor(Math.random()*(t+1)),n=r[t];r[t]=r[e],r[e]=n}return r}const ET=Object.freeze(Object.defineProperty({__proto__:null,randomBytes:mw,shuffled:vw},Symbol.toStringTag,{value:"Module"})),FN="logger/5.7.0";let gv=!1,mv=!1;const Fh={debug:1,default:2,info:2,warning:3,error:4,off:5};let vv=Fh.default,Ec=null;function DN(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const xv=DN();var $d;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})($d||($d={}));var io;
12(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(io||(io={}));const yv="0123456789abcdef";let a1=class Fr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Fh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(vv>Fh[n])&&console.log.apply(console,e)}debug(...t){this._log(Fr.levels.DEBUG,t)}info(...t){this._log(Fr.levels.INFO,t)}warn(...t){this._log(Fr.levels.WARNING,t)}makeError(t,e,n){if(mv)return this.makeError("censored error",e,{});e||(e=Fr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=yv[w[M]>>4],E+=yv[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case io.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case io.CALL_EXCEPTION:case io.INSUFFICIENT_FUNDS:case io.MISSING_NEW:case io.NONCE_EXPIRED:case io.REPLACEMENT_UNDERPRICED:case io.TRANSACTION_REPLACED:case io.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Fr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){xv&&this.throwError("platform missing String.prototype.normalize",Fr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:xv})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Fr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Fr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Fr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Fr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Fr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Fr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Fr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Ec||(Ec=new Fr(FN)),Ec}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Fr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),gv){if(!t)return;this.globalLogger().throwError("error censorship permanent",Fr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}mv=!!t,gv=!!e}static setLogLevel(t){const e=Fh[t.toLowerCase()];if(e==null){Fr.globalLogger().warn("invalid log level - "+t);return}vv=e}static from(t){return new Fr(t)}};a1.errors=io;a1.levels=$d;const LN="properties/5.4.0";var $N=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Mu=new a1(LN);function h1(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function xw(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}function yw(r){return $N(this,void 0,void 0,function*(){const t=Object.keys(r).map(n=>{const a=r[n];return Promise.resolve(a).then(f=>({key:n,value:f}))});return(yield Promise.all(t)).reduce((n,a)=>(n[a.key]=a.value,n),{})})}function bw(r,t){(!r||typeof r!="object")&&Mu.throwArgumentError("invalid object","object",r),Object.keys(r).forEach(e
12=>{t[e]||Mu.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)})}function ww(r){const t={};for(const e in r)t[e]=r[e];return t}const GN={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Ew(r){if(r==null||GN[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++)if(!Ew(r[t[e]]))return!1;return!0}return Mu.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function zN(r){if(Ew(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>Ma(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&h1(t,e,Ma(n))}return t}return Mu.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function Ma(r){return zN(r)}let qN=class{constructor(t){for(const e in t)this[e]=Ma(t[e])}};const MT=Object.freeze(Object.defineProperty({__proto__:null,Description:qN,checkProperties:bw,deepCopy:Ma,defineReadOnly:h1,getStatic:xw,resolveProperties:yw,shallowCopy:ww},Symbol.toStringTag,{value:"Module"})),KN="logger/5.7.0";let bv=!1,wv=!1;const Dh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Ev=Dh.default,Ac=null;function HN(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Av=HN();var Gd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Gd||(Gd={}));var no;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(no||(no={}));const Mv="0123456789abcdef";let ln=class Dr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Dh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Ev>Dh[n])&&console.log.apply(console,e)}debug(...t){this._log(Dr.levels.DEBUG,t)}info(...t){this._log(Dr.levels.INFO,t)}warn(...t){this._log(Dr.levels.WARNING,t)}makeError(t,e,n){if(wv)return this.makeError("censored error",e,{});e||(e=Dr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Mv[w[M]>>4],E+=Mv[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case no.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case no.CALL_EXCEPTION:case no.INSUFFICIENT_FUNDS:case no.MISSING_NEW:case no.NONCE_EXPIRED:case no.REPLACEMENT_UNDERPRICED:case no.TRANSACTION_REPLACED:case no.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Dr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Av&&this.throwError("platform missing String.prototype.normalize",Dr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Av})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Dr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Dr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Dr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Dr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Dr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Ac||(Ac=new Dr(KN)),Ac}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),bv){if(!t)return;this.globalLogger().throwError("error censorship permanent",Dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}wv=!!t,bv=!!e}static setLogLevel(t){const e=Dh[t.toLowerCase()];if(e==null){Dr.globalLogger().warn("invalid log level - "+t);return}Ev=e}static from(t){return new Dr(t)}};ln.errors=no;ln.levels=Gd;const WN="bytes/5.7.0",Zs=new ln(WN);function Aw(r){return!!r.toHexString}function Lh(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return Lh(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function JN(r){return l1(r)&&!(r.length%2)||u1(r)}function Nv(r){return typeof r=="number"&&r==r&&r%1===0}function u1(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!Nv(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Nv(e)||e<0||e>=256)return!1}return!0}function Mw(r,t){if(t||(t={}),typeof r=="number"){Zs.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),Lh(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Aw(r)&&(r=r.toHexString()),l1(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":Zs.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return Lh(new Uint8Array(n))}return u1(r)?Lh(new Uint8Array(r)):Zs.throwArgumentError("invalid arrayify value","value",r)}function l1(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const Mc="0123456789abcdef";function $h(r,t){if(t||(t={}),typeof r=="number"){Zs.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Mc[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Aw(r))return r.toHexString();if(l1(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":Zs.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(u1(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Mc[(a&240)>>4]+Mc[a&15]}return e}return Zs.throwArgumentError("invalid hexlify value","value",r)}const VN="rlp/5.4.0",Ro=new ln(VN);function _v(r){const t=[];for(;r;)t.unshift(r&255),r>>=8;return t}function Sv(r,t,e){let n=0;for(let a=0;a<e;a++)n=n*256+r[t+a];return n}function Nw(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(f){n=n.concat(Nw(f))}),n.length<=55)return n.unshift(192+n.length),n;const a=_v(n.length);return a.unshift(247+a.length),a.concat(n)}JN(r)||Ro.throwArgumentError("RLP object must be BytesLike","object",r);const t=Array.prototype.slice.call(Mw(r));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const e=_v(t.length);return e.unshift(183+e.length),e.concat(t)}function jN(r){return $h(Nw(r))}function Iv(r,t,e,n){const a=[];for(;e<t+1+n;){const f=_w(r,e);a.push(f.result),e+=f.consumed,e>t+1+n&&Ro.throwError("child data too short",ln.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function _w(r,t){if(r.length===0&&Ro.throwError("data too short",ln.errors.BUFFER_OVERRUN,{}),r[t]>=248){const e=r[t]-247;t+1+e>r.length&&Ro.throwError("data short segment too short",ln.errors.BUFFER_OVERRUN,{});const n=Sv(r,t+1,e);return t+1+e+n>r.length&&Ro.throwError("data long segment too short",ln.errors.BUFFER_OVERRUN,{}),Iv(r,t,t+1+e,e+n)}else if(r[t]>=192){const e=r[t]-192;return t+1+e>r.length&&Ro.throwError("data array too short",ln.errors.BUFFER_OVERRUN,{}),Iv(r,t,t+1,e)}else if(r[t]>=184){const e=r[t]-183;t+1+e>r.length&&Ro.throwError("data array too short",ln.errors.BUFFER_OVERRUN,{});const n=Sv(r,t+1,e);t+1+e+n>r.length&&Ro.throwError("data array too short",ln.errors.BUFFER_OVERRUN,{});const a=$h(r.slice(t+1+e,t+1+e+n));return{consumed:1+e+n,result:a}}else if(r[t]>=128){const e=r[t]-128;t+1+e>r.length&&Ro.throwError("data too short",ln.errors.BUFFER_OVERRUN,{});const n=$h(r.slice(t+1,t+1+e));return{consumed:1+e,result:n}}return{consumed:1,result:$h(r[t])}}function XN(r){const t=Mw(r),e=_w(t,0);return e.consumed!==t.length&&Ro.throwArgumentError("invalid rlp data","data",r),e.result}const ZN=Object.freeze(Object.defineProperty({__proto__:null,decode:XN,encode:jN},Symbol.toStringTag,{value:"Module"}));var c1={exports:{}};c1.exports;(function(r){(function(t,e){function n(I,N){if(!I)throw new Error(N||"Assertion failed")}function a(I,N){I.super_=N;var d=function(){};d.prototype=N.prototype,I.prototype=new d,I.prototype.constructor=I}function f(I,N,d){if(f.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((N==="le"||N==="be")&&(d=N,N=10),this._init(I||0,N||10,d||"be"))}
vendor: 9,968 bytes, line 12
12typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(N){return N instanceof f?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===f.wordSize&&Array.isArray(N.words)},f.max=function(N,d){return N.cmp(d)>0?N:d},f.min=function(N,d){return N.cmp(d)<0?N:d},f.prototype._init=function(N,d,i){if(typeof N=="number")return this._initNumber(N,d,i);if(typeof N=="object")return this._initArray(N,d,i);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),N=N.toString().replace(/\s+/g,"");var s=0;N[0]==="-"&&(s++,this.negative=1),s<N.length&&(d===16?this._parseHex(N,s,i):(this._parseBase(N,d,s),i==="le"&&this._initArray(this.toArray(),d,i)))},f.prototype._initNumber=function(N,d,i){N<0&&(this.negative=1,N=-N),N<67108864?(this.words=[N&67108863],this.length=1):N<4503599627370496?(this.words=[N&67108863,N/67108864&67108863],this.length=2):(n(N<9007199254740992),this.words=[N&67108863,N/67108864&67108863,1],this.length=3),i==="le"&&this._initArray(this.toArray(),d,i)},f.prototype._initArray=function(N,d,i){if(n(typeof N.length=="number"),N.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(N.length/3),this.words=new Array(this.length);for(var s=0;s<this.length;s++)this.words[s]=0;var h,p,m=0;if(i==="be")for(s=N.length-1,h=0;s>=0;s-=3)p=N[s]|N[s-1]<<8|N[s-2]<<16,this.words[h]|=p<<m&67108863,this.words[h+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,h++);else if(i==="le")for(s=0,h=0;s<N.length;s+=3)p=N[s]|N[s+1]<<8|N[s+2]<<16,this.words[h]|=p<<m&67108863,this.words[h+1]=p>>>26-m&67108863,m+=24,m>=26&&(m-=26,h++);return this.strip()};function y(I,N){var d=I.charCodeAt(N);return d>=65&&d<=70?d-55:d>=97&&d<=102?d-87:d-48&15}function b(I,N,d){var i=y(I,d);return d-1>=N&&(i|=y(I,d-1)<<4),i}f.prototype._parseHex=function(N,d,i){this.length=Math.ceil((N.length-d)/6),this.words=new Array(this.length);for(var s=0;s<this.length;s++)this.words[s]=0;var h=0,p=0,m;if(i==="be")for(s=N.length-1;s>=d;s-=2)m=b(N,d,s)<<h,this.words[p]|=m&67108863,h>=18?(h-=18,p+=1,this.words[p]|=m>>>26):h+=8;else{var v=N.length-d;for(s=v%2===0?d+1:d;s<N.length;s+=2)m=b(N,d,s)<<h,this.words[p]|=m&67108863,h>=18?(h-=18,p+=1,this.words[p]|=m>>>26):h+=8}this.strip()};function w(I,N,d,i){for(var s=0,h=Math.min(I.length,d),p=N;p<h;p++){var m=I.charCodeAt(p)-48;s*=i,m>=49?s+=m-49+10:m>=17?s+=m-17+10:s+=m}return s}f.prototype._parseBase=function(N,d,i){this.words=[0],this.length=1;for(var s=0,h=1;h<=67108863;h*=d)s++;s--,h=h/d|0;for(var p=N.length-i,m=p%s,v=Math.min(p,p-m)+i,x=0,l=i;l<v;l+=s)x=w(N,l,l+s,d),this.imuln(h),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(m!==0){var o=1;for(x=w(N,l,N.length,d),l=0;l<m;l++)o*=d;this.imuln(o),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this.strip()},f.prototype.copy=function(N){N.words=new Array(this.length);for(var d=0;d<this.length;d++)N.words[d]=this.words[d];N.length=this.length,N.negative=this.negative,N.red=this.red},f.prototype.clone=function(){var N=new f(null);return this.copy(N),N},f.prototype._expand=function(N){for(;this.length<N;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[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];f.prototype.toString=function(N,d){N=N||10,d=d|0||1;var i;if(N===16||N==="hex"){i="";for(var s=0,h=0,p=0;p<this.length;p++){var m=this.words[p],v=((m<<s|h)&16777215).toString(16);h=m>>>24-s&16777215,h!==0||p!==this.length-1?i=E[6-v.length]+v+i:i=v+i,s+=2,s>=26&&(s-=26,p--)}for(h!==0&&(i=h.toString(16)+i);i.length%d!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}if(N===(N|0)&&N>=2&&N<=36){var x=M[N],l=O[N];i="";var o=this.clone();for(o.negative=0;!o.isZero();){var g=o.modn(l).toString(N);o=o.idivn(l),o.isZero()?i=g+i:i=E[x-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%d!==0;)i="0"+i;return this.negative!==0&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(N,d){return n(typeof c<"u"),this.toArrayLike(c,N,d)},f.prototype.toArray=function(N,d){return this.toArrayLike(Array,N,d)},f.prototype.toArrayLike=function(N,d,i){var s=this.byteLength(),h=i||Math.max(1,s);n(s<=h,"byte array longer than desired length"),n(h>0,"Requested array length <= 0"),this.strip();var p=d==="le",m=new N(h),v,x,l=this.clone();if(p){for(x=0;!l.isZero();x++)v=l.andln(255),l.iushrn(8),m[x]=v;for(;x<h;x++)m[x]=0}else{for(x=0;x<h-s;x++)m[x]=0;for(x=0;!l.isZero();x++)v=l.andln(255),l.iushrn(8),m[h-x-1]=v}return m},Math.clz32?f.prototype._countBits=function(N){return 32-Math.clz32(N)}:f.prototype._countBits=function(N){var d=N,i=0;return d>=4096&&(i+=13,d>>>=13),d>=64&&(i+=7,d>>>=7),d>=8&&(i+=4,d>>>=4),d>=2&&(i+=2,d>>>=2),i+d},f.prototype._zeroBits=function(N){if(N===0)return 26;var d=N,i=0;return d&8191||(i+=13,d>>>=13),d&127||(i+=7,d>>>=7),d&15||(i+=4,d>>>=4),d&3||(i+=2,d>>>=2),d&1||i++,i},f.prototype.bitLength=function(){var N=this.words[this.length-1],d=this._countBits(N);return(this.length-1)*26+d};function F(I){for(var N=new Array(I.bitLength()),d=0;d<N.length;d++){var i=d/26|0,s=d%26;N[d]=(I.words[i]&1<<s)>>>s}return N}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,d=0;d<this.length;d++){var i=this._zeroBits(this.words[d]);if(N+=i,i!==26)break}return N},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(N){return this.negative!==0?this.abs().inotn(N).iaddn(1):this.clone()},f.prototype.fromTwos=function(N){return this.testn(N-1)?this.notn(N).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(N){for(;this.length<N.length;)this.words[this.length++]=0;for(var d=0;d<N.length;d++)this.words[d]=this.words[d]|N.words[d];return this.strip()},f.prototype.ior=function(N){return n((this.negative|N.negative)===0),this.iuor(N)},f.prototype.or=function(N){return this.length>N.length?this.clone().ior(N):N.clone().ior(this)},f.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},f.prototype.iuand=function(N){var d;this.length>N.length?d=N:d=this;for(var i=0;i<d.length;i++)this.words[i]=this.words[i]&N.words[i];return this.length=d.length,this.strip()},f.prototype.iand=function(N){return n((this.negative|N.negative)===0),this.iuand(N)},f.prototype.and=function(N){return this.length>N.length?this.clone().iand(N):N.clone().iand(this)},f.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},f.prototype.iuxor=function(N){var d,i;this.length>N.length?(d=this,i=N):(d=N,i=this);for(var s=0;s<i.length;s++)this.words[s]=d.words[s]^i.words[s];if(this!==d)for(;s<d.length;s++)this.words[s]=d.words[s];return this.length=d.length,this.strip()},f.prototype.ixor=function(N){return n((this.negative|N.negative)===0),this.iuxor(N)},f.prototype.xor=function(N){return this.length>N.length?this.clone().ixor(N):N.clone().ixor(this)},f.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},f.prototype.inotn=function(N){n(typeof N=="number"&&N>=0);var d=Math.ceil(N/26)|0,i=N%26;this._expand(d),i>0&&d--;for(var s=0;s<d;s++)this.words[s]=~this.words[s]&67108863;return i>0&&(this.words[s]=~this.words[s]&67108863>>26-i),this.strip()},f.prototype.notn=function(N){return this.clone().inotn(N)},f.prototype.setn=function(N,d){n(typeof N=="number"&&N>=0);var i=N/26|0,s=N%26;return this._expand(i+1),d?this.words[i]=this.words[i]|1<<s:this.words[i]=this.words[i]&~(1<<s),this.strip()},f.prototype.iadd=function(N){var d;if(this.negative!==0&&N.negative===0)return this.negative=0,d=this.isub(N),this.negative^=1,this._normSign();if(this.negative===0&&N.negative!==0)return N.negative=0,d=this.isub(N),N.negative=1,d._normSign();var i,s;this.length>N.length?(i=this,s=N):(i=N,s=this);for(var h=0,p=0;p<s.length;p++)d=(i.words[p]|0)+(s.words[p]|0)+h,this.words[p]=d&67108863,h=d>>>26;for(;h!==0&&p<i.length;p++)d=(i.words[p]|0)+h,this.words[p]=d&67108863,h=d>>>26;if(this.length=i.length,h!==0)this.words[this.length]=h,this.length++;else if(i!==this)for(;p<i.length;p++)this.words[p]=i.words[p];return this},f.prototype.add=function(N){var d;return N.negative!==0&&this.negative===0?(N.negative=0,d=this.sub(N),N.negative^=1,d):N.negative===0&&this.negative!==0?(this.negative=0,d=N.sub(this),this.negative=1,d):this.length>N.length?this.clone().iadd(N):N.clone().iadd(this)},f.prototype.isub=function(N){if(N.negative!==0){N.negative=0;
vendor: 8,082 bytes, line 12
12var d=this.iadd(N);return N.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var i=this.cmp(N);if(i===0)return this.negative=0,this.length=1,this.words[0]=0,this;var s,h;i>0?(s=this,h=N):(s=N,h=this);for(var p=0,m=0;m<h.length;m++)d=(s.words[m]|0)-(h.words[m]|0)+p,p=d>>26,this.words[m]=d&67108863;for(;p!==0&&m<s.length;m++)d=(s.words[m]|0)+p,p=d>>26,this.words[m]=d&67108863;if(p===0&&m<s.length&&s!==this)for(;m<s.length;m++)this.words[m]=s.words[m];return this.length=Math.max(this.length,m),s!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(N){return this.clone().isub(N)};function B(I,N,d){d.negative=N.negative^I.negative;var i=I.length+N.length|0;d.length=i,i=i-1|0;var s=I.words[0]|0,h=N.words[0]|0,p=s*h,m=p&67108863,v=p/67108864|0;d.words[0]=m;for(var x=1;x<i;x++){for(var l=v>>>26,o=v&67108863,g=Math.min(x,N.length-1),C=Math.max(0,x-I.length+1);C<=g;C++){var u=x-C|0;s=I.words[u]|0,h=N.words[C]|0,p=s*h+o,l+=p/67108864|0,o=p&67108863}d.words[x]=o|0,v=l|0}return v!==0?d.words[x]=v|0:d.length--,d.strip()}var L=function(N,d,i){var s=N.words,h=d.words,p=i.words,m=0,v,x,l,o=s[0]|0,g=o&8191,C=o>>>13,u=s[1]|0,A=u&8191,S=u>>>13,_=s[2]|0,P=_&8191,K=_>>>13,$=s[3]|0,U=$&8191,It=$>>>13,G=s[4]|0,J=G&8191,Gt=G>>>13,ct=s[5]|0,rt=ct&8191,qt=ct>>>13,dt=s[6]|0,it=dt&8191,Kt=dt>>>13,gt=s[7]|0,tt=gt&8191,Lt=gt>>>13,pt=s[8]|0,nt=pt&8191,$t=pt>>>13,mt=s[9]|0,k=mt&8191,T=mt>>>13,R=h[0]|0,D=R&8191,j=R>>>13,H=h[1]|0,W=H&8191,Bt=H>>>13,et=h[2]|0,X=et&8191,Ft=et>>>13,Q=h[3]|0,ot=Q&8191,Ht=Q>>>13,vt=h[4]|0,ft=vt&8191,Wt=vt>>>13,xt=h[5]|0,st=xt&8191,Jt=xt>>>13,yt=h[6]|0,at=yt&8191,Vt=yt>>>13,bt=h[7]|0,ht=bt&8191,jt=bt>>>13,Mt=h[8]|0,ut=Mt&8191,Xt=Mt>>>13,Nt=h[9]|0,lt=Nt&8191,Zt=Nt>>>13;i.negative=N.negative^d.negative,i.length=19,v=Math.imul(g,D),x=Math.imul(g,j),x=x+Math.imul(C,D)|0,l=Math.imul(C,j);var wt=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(wt>>>26)|0,wt&=67108863,v=Math.imul(A,D),x=Math.imul(A,j),x=x+Math.imul(S,D)|0,l=Math.imul(S,j),v=v+Math.imul(g,W)|0,x=x+Math.imul(g,Bt)|0,x=x+Math.imul(C,W)|0,l=l+Math.imul(C,Bt)|0;var Et=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Et>>>26)|0,Et&=67108863,v=Math.imul(P,D),x=Math.imul(P,j),x=x+Math.imul(K,D)|0,l=Math.imul(K,j),v=v+Math.imul(A,W)|0,x=x+Math.imul(A,Bt)|0,x=x+Math.imul(S,W)|0,l=l+Math.imul(S,Bt)|0,v=v+Math.imul(g,X)|0,x=x+Math.imul(g,Ft)|0,x=x+Math.imul(C,X)|0,l=l+Math.imul(C,Ft)|0;var Qt=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,v=Math.imul(U,D),x=Math.imul(U,j),x=x+Math.imul(It,D)|0,l=Math.imul(It,j),v=v+Math.imul(P,W)|0,x=x+Math.imul(P,Bt)|0,x=x+Math.imul(K,W)|0,l=l+Math.imul(K,Bt)|0,v=v+Math.imul(A,X)|0,x=x+Math.imul(A,Ft)|0,x=x+Math.imul(S,X)|0,l=l+Math.imul(S,Ft)|0,v=v+Math.imul(g,ot)|0,x=x+Math.imul(g,Ht)|0,x=x+Math.imul(C,ot)|0,l=l+Math.imul(C,Ht)|0;var Yt=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,v=Math.imul(J,D),x=Math.imul(J,j),x=x+Math.imul(Gt,D)|0,l=Math.imul(Gt,j),v=v+Math.imul(U,W)|0,x=x+Math.imul(U,Bt)|0,x=x+Math.imul(It,W)|0,l=l+Math.imul(It,Bt)|0,v=v+Math.imul(P,X)|0,x=x+Math.imul(P,Ft)|0,x=x+Math.imul(K,X)|0,l=l+Math.imul(K,Ft)|0,v=v+Math.imul(A,ot)|0,x=x+Math.imul(A,Ht)|0,x=x+Math.imul(S,ot)|0,l=l+Math.imul(S,Ht)|0,v=v+Math.imul(g,ft)|0,x=x+Math.imul(g,Wt)|0,x=x+Math.imul(C,ft)|0,l=l+Math.imul(C,Wt)|0;var te=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(te>>>26)|0,te&=67108863,v=Math.imul(rt,D),x=Math.imul(rt,j),x=x+Math.imul(qt,D)|0,l=Math.imul(qt,j),v=v+Math.imul(J,W)|0,x=x+Math.imul(J,Bt)|0,x=x+Math.imul(Gt,W)|0,l=l+Math.imul(Gt,Bt)|0,v=v+Math.imul(U,X)|0,x=x+Math.imul(U,Ft)|0,x=x+Math.imul(It,X)|0,l=l+Math.imul(It,Ft)|0,v=v+Math.imul(P,ot)|0,x=x+Math.imul(P,Ht)|0,x=x+Math.imul(K,ot)|0,l=l+Math.imul(K,Ht)|0,v=v+Math.imul(A,ft)|0,x=x+Math.imul(A,Wt)|0,x=x+Math.imul(S,ft)|0,l=l+Math.imul(S,Wt)|0,v=v+Math.imul(g,st)|0,x=x+Math.imul(g,Jt)|0,x=x+Math.imul(C,st)|0,l=l+Math.imul(C,Jt)|0;var ee=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(ee>>>26)|0,ee&=67108863,v=Math.imul(it,D),x=Math.imul(it,j),x=x+Math.imul(Kt,D)|0,l=Math.imul(Kt,j),v=v+Math.imul(rt,W)|0,x=x+Math.imul(rt,Bt)|0,x=x+Math.imul(qt,W)|0,l=l+Math.imul(qt,Bt)|0,v=v+Math.imul(J,X)|0,x=x+Math.imul(J,Ft)|0,x=x+Math.imul(Gt,X)|0,l=l+Math.imul(Gt,Ft)|0,v=v+Math.imul(U,ot)|0,x=x+Math.imul(U,Ht)|0,x=x+Math.imul(It,ot)|0,l=l+Math.imul(It,Ht)|0,v=v+Math.imul(P,ft)|0,x=x+Math.imul(P,Wt)|0,x=x+Math.imul(K,ft)|0,l=l+Math.imul(K,Wt)|0,v=v+Math.imul(A,st)|0,x=x+Math.imul(A,Jt)|0,x=x+Math.imul(S,st)|0,l=l+Math.imul(S,Jt)|0,v=v+Math.imul(g,at)|0,x=x+Math.imul(g,Vt)|0,x=x+Math.imul(C,at)|0,l=l+Math.imul(C,Vt)|0;var re=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(re>>>26)|0,re&=67108863,v=Math.imul(tt,D),x=Math.imul(tt,j),x=x+Math.imul(Lt,D)|0,l=Math.imul(Lt,j),v=v+Math.imul(it,W)|0,x=x+Math.imul(it,Bt)|0,x=x+Math.imul(Kt,W)|0,l=l+Math.imul(Kt,Bt)|0,v=v+Math.imul(rt,X)|0,x=x+Math.imul(rt,Ft)|0,x=x+Math.imul(qt,X)|0,l=l+Math.imul(qt,Ft)|0,v=v+Math.imul(J,ot)|0,x=x+Math.imul(J,Ht)|0,x=x+Math.imul(Gt,ot)|0,l=l+Math.imul(Gt,Ht)|0,v=v+Math.imul(U,ft)|0,x=x+Math.imul(U,Wt)|0,x=x+Math.imul(It,ft)|0,l=l+Math.imul(It,Wt)|0,v=v+Math.imul(P,st)|0,x=x+Math.imul(P,Jt)|0,x=x+Math.imul(K,st)|0,l=l+Math.imul(K,Jt)|0,v=v+Math.imul(A,at)|0,x=x+Math.imul(A,Vt)|0,x=x+Math.imul(S,at)|0,l=l+Math.imul(S,Vt)|0,v=v+Math.imul(g,ht)|0,x=x+Math.imul(g,jt)|0,x=x+Math.imul(C,ht)|0,l=l+Math.imul(C,jt)|0;var Re=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Re>>>26)|0,Re&=67108863,v=Math.imul(nt,D),x=Math.imul(nt,j),x=x+Math.imul($t,D)|0,l=Math.imul($t,j),v=v+Math.imul(tt,W)|0,x=x+Math.imul(tt,Bt)|0,x=x+Math.imul(Lt,W)|0,l=l+Math.imul(Lt,Bt)|0,v=v+Math.imul(it,X)|0,x=x+Math.imul(it,Ft)|0,x=x+Math.imul(Kt,X)|0,l=l+Math.imul(Kt,Ft)|0,v=v+Math.imul(rt,ot)|0,x=x+Math.imul(rt,Ht)|0,x=x+Math.imul(qt,ot)|0,l=l+Math.imul(qt,Ht)|0,v=v+Math.imul(J,ft)|0,x=x+Math.imul(J,Wt)|0,x=x+Math.imul(Gt,ft)|0,l=l+Math.imul(Gt,Wt)|0,v=v+Math.imul(U,st)|0,x=x+Math.imul(U,Jt)|0,x=x+Math.imul(It,st)|0,l=l+Math.imul(It,Jt)|0,v=v+Math.imul(P,at)|0,x=x+Math.imul(P,Vt)|0,x=x+Math.imul(K,at)|0,l=l+Math.imul(K,Vt)|0,v=v+Math.imul(A,ht)|0,x=x+Math.imul(A,jt)|0,x=x+Math.imul(S,ht)|0,l=l+Math.imul(S,jt)|0,v=v+Math.imul(g,ut)|0,x=x+Math.imul(g,Xt)|0,x=x+Math.imul(C,ut)|0,l=l+Math.imul(C,Xt)|0;var Te=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Te>>>26)|0,Te&=67108863,v=Math.imul(k,D),x=Math.imul(k,j),x=x+Math.imul(T,D)|0,l=Math.imul(T,j),v=v+Math.imul(nt,W)|0,x=x+Math.imul(nt,Bt)|0,x=x+Math.imul($t,W)|0,l=l+Math.imul($t,Bt)|0,v=v+Math.imul(tt,X)|0,x=x+Math.imul(tt,Ft)|0,x=x+Math.imul(Lt,X)|0,l=l+Math.imul(Lt,Ft)|0,v=v+Math.imul(it,ot)|0,x=x+Math.imul(it,Ht)|0,x=x+Math.imul(Kt,ot)|0,l=l+Math.imul(Kt,Ht)|0,v=v+Math.imul(rt,ft)|0,x=x+Math.imul(rt,Wt)|0,x=x+Math.imul(qt,ft)|0,l=l+Math.imul(qt,Wt)|0,v=v+Math.imul(J,st)|0,x=x+Math.imul(J,Jt)|0,x=x+Math.imul(Gt,st)|0,l=l+Math.imul(Gt,Jt)|0,v=v+Math.imul(U,at)|0,x=x+Math.imul(U,Vt)|0,x=x+Math.imul(It,at)|0,l=l+Math.imul(It,Vt)|0,v=v+Math.imul(P,ht)|0,x=x+Math.imul(P,jt)|0,x=x+Math.imul(K,ht)|0,l=l+Math.imul(K,jt)|0,v=v+Math.imul(A,ut)|0,x=x+Math.imul(A,Xt)|0,x=x+Math.imul(S,ut)|0,l=l+Math.imul(S,Xt)|0,v=v+Math.imul(g,lt)|0,x=x+Math.imul(g,Zt)|0,x=x+Math.imul(C,lt)|0,l=l+Math.imul(C,Zt)|0;var Pe=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,v=Math.imul(k,W),x=Math.imul(k,Bt),x=x+Math.imul(T,W)|0,l=Math.imul(T,Bt),v=v+Math.imul(nt,X)|0,x=x+Math.imul(nt,Ft)|0,x=x+Math.imul($t,X)|0,l=l+Math.imul($t,Ft)|0,v=v+Math.imul(tt,ot)|0,x=x+Math.imul(tt,Ht)|0,x=x+Math.imul(Lt,ot)|0,l=l+Math.imul(Lt,Ht)|0,v=v+Math.imul(it,ft)|0,x=x+Math.imul(it,Wt)|0,x=x+Math.imul(Kt,ft)|0,l=l+Math.imul(Kt,Wt)|0,v=v+Math.imul(rt,st)|0,x=x+Math.imul(rt,Jt)|0,x=x+Math.imul(qt,st)|0,l=l+Math.imul(qt,Jt)|0,v=v+Math.imul(J,at)|0,x=x+Math.imul(J,Vt)|0,x=x+Math.imul(Gt,at)|0,l=l+Math.imul(Gt,Vt)|0,v=v+Math.imul(U,ht)|0,x=x+Math.imul(U,jt)|0,x=x+Math.imul(It,ht)|0,l=l+Math.imul(It,jt)|0,v=v+Math.imul(P,ut)|0,x=x+Math.imul(P,Xt)|0,x=x+Math.imul(K,ut)|0,l=l+Math.imul(K,Xt)|0,v=v+Math.imul(A,lt)|0,x=x+Math.imul(A,Zt)|0,x=x+Math.imul(S,lt)|0,l=l+Math.imul(S,Zt)|0;
vendor: 5,147 bytes, line 12
12var Ce=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,v=Math.imul(k,X),x=Math.imul(k,Ft),x=x+Math.imul(T,X)|0,l=Math.imul(T,Ft),v=v+Math.imul(nt,ot)|0,x=x+Math.imul(nt,Ht)|0,x=x+Math.imul($t,ot)|0,l=l+Math.imul($t,Ht)|0,v=v+Math.imul(tt,ft)|0,x=x+Math.imul(tt,Wt)|0,x=x+Math.imul(Lt,ft)|0,l=l+Math.imul(Lt,Wt)|0,v=v+Math.imul(it,st)|0,x=x+Math.imul(it,Jt)|0,x=x+Math.imul(Kt,st)|0,l=l+Math.imul(Kt,Jt)|0,v=v+Math.imul(rt,at)|0,x=x+Math.imul(rt,Vt)|0,x=x+Math.imul(qt,at)|0,l=l+Math.imul(qt,Vt)|0,v=v+Math.imul(J,ht)|0,x=x+Math.imul(J,jt)|0,x=x+Math.imul(Gt,ht)|0,l=l+Math.imul(Gt,jt)|0,v=v+Math.imul(U,ut)|0,x=x+Math.imul(U,Xt)|0,x=x+Math.imul(It,ut)|0,l=l+Math.imul(It,Xt)|0,v=v+Math.imul(P,lt)|0,x=x+Math.imul(P,Zt)|0,x=x+Math.imul(K,lt)|0,l=l+Math.imul(K,Zt)|0;var Oe=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,v=Math.imul(k,ot),x=Math.imul(k,Ht),x=x+Math.imul(T,ot)|0,l=Math.imul(T,Ht),v=v+Math.imul(nt,ft)|0,x=x+Math.imul(nt,Wt)|0,x=x+Math.imul($t,ft)|0,l=l+Math.imul($t,Wt)|0,v=v+Math.imul(tt,st)|0,x=x+Math.imul(tt,Jt)|0,x=x+Math.imul(Lt,st)|0,l=l+Math.imul(Lt,Jt)|0,v=v+Math.imul(it,at)|0,x=x+Math.imul(it,Vt)|0,x=x+Math.imul(Kt,at)|0,l=l+Math.imul(Kt,Vt)|0,v=v+Math.imul(rt,ht)|0,x=x+Math.imul(rt,jt)|0,x=x+Math.imul(qt,ht)|0,l=l+Math.imul(qt,jt)|0,v=v+Math.imul(J,ut)|0,x=x+Math.imul(J,Xt)|0,x=x+Math.imul(Gt,ut)|0,l=l+Math.imul(Gt,Xt)|0,v=v+Math.imul(U,lt)|0,x=x+Math.imul(U,Zt)|0,x=x+Math.imul(It,lt)|0,l=l+Math.imul(It,Zt)|0;var ke=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(ke>>>26)|0,ke&=67108863,v=Math.imul(k,ft),x=Math.imul(k,Wt),x=x+Math.imul(T,ft)|0,l=Math.imul(T,Wt),v=v+Math.imul(nt,st)|0,x=x+Math.imul(nt,Jt)|0,x=x+Math.imul($t,st)|0,l=l+Math.imul($t,Jt)|0,v=v+Math.imul(tt,at)|0,x=x+Math.imul(tt,Vt)|0,x=x+Math.imul(Lt,at)|0,l=l+Math.imul(Lt,Vt)|0,v=v+Math.imul(it,ht)|0,x=x+Math.imul(it,jt)|0,x=x+Math.imul(Kt,ht)|0,l=l+Math.imul(Kt,jt)|0,v=v+Math.imul(rt,ut)|0,x=x+Math.imul(rt,Xt)|0,x=x+Math.imul(qt,ut)|0,l=l+Math.imul(qt,Xt)|0,v=v+Math.imul(J,lt)|0,x=x+Math.imul(J,Zt)|0,x=x+Math.imul(Gt,lt)|0,l=l+Math.imul(Gt,Zt)|0;var Be=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Be>>>26)|0,Be&=67108863,v=Math.imul(k,st),x=Math.imul(k,Jt),x=x+Math.imul(T,st)|0,l=Math.imul(T,Jt),v=v+Math.imul(nt,at)|0,x=x+Math.imul(nt,Vt)|0,x=x+Math.imul($t,at)|0,l=l+Math.imul($t,Vt)|0,v=v+Math.imul(tt,ht)|0,x=x+Math.imul(tt,jt)|0,x=x+Math.imul(Lt,ht)|0,l=l+Math.imul(Lt,jt)|0,v=v+Math.imul(it,ut)|0,x=x+Math.imul(it,Xt)|0,x=x+Math.imul(Kt,ut)|0,l=l+Math.imul(Kt,Xt)|0,v=v+Math.imul(rt,lt)|0,x=x+Math.imul(rt,Zt)|0,x=x+Math.imul(qt,lt)|0,l=l+Math.imul(qt,Zt)|0;var Ue=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,v=Math.imul(k,at),x=Math.imul(k,Vt),x=x+Math.imul(T,at)|0,l=Math.imul(T,Vt),v=v+Math.imul(nt,ht)|0,x=x+Math.imul(nt,jt)|0,x=x+Math.imul($t,ht)|0,l=l+Math.imul($t,jt)|0,v=v+Math.imul(tt,ut)|0,x=x+Math.imul(tt,Xt)|0,x=x+Math.imul(Lt,ut)|0,l=l+Math.imul(Lt,Xt)|0,v=v+Math.imul(it,lt)|0,x=x+Math.imul(it,Zt)|0,x=x+Math.imul(Kt,lt)|0,l=l+Math.imul(Kt,Zt)|0;var Fe=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,v=Math.imul(k,ht),x=Math.imul(k,jt),x=x+Math.imul(T,ht)|0,l=Math.imul(T,jt),v=v+Math.imul(nt,ut)|0,x=x+Math.imul(nt,Xt)|0,x=x+Math.imul($t,ut)|0,l=l+Math.imul($t,Xt)|0,v=v+Math.imul(tt,lt)|0,x=x+Math.imul(tt,Zt)|0,x=x+Math.imul(Lt,lt)|0,l=l+Math.imul(Lt,Zt)|0;var De=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(De>>>26)|0,De&=67108863,v=Math.imul(k,ut),x=Math.imul(k,Xt),x=x+Math.imul(T,ut)|0,l=Math.imul(T,Xt),v=v+Math.imul(nt,lt)|0,x=x+Math.imul(nt,Zt)|0,x=x+Math.imul($t,lt)|0,l=l+Math.imul($t,Zt)|0;var Le=(m+v|0)+((x&8191)<<13)|0;m=(l+(x>>>13)|0)+(Le>>>26)|0,Le&=67108863,v=Math.imul(k,lt),x=Math.imul(k,Zt),x=x+Math.imul(T,lt)|0,l=Math.imul(T,Zt);var $e=(m+v|0)+((x&8191)<<13)|0;return m=(l+(x>>>13)|0)+($e>>>26)|0,$e&=67108863,p[0]=wt,p[1]=Et,p[2]=Qt,p[3]=Yt,p[4]=te,p[5]=ee,p[6]=re,p[7]=Re,p[8]=Te,p[9]=Pe,p[10]=Ce,p[11]=Oe,p[12]=ke,p[13]=Be,p[14]=Ue,p[15]=Fe,p[16]=De,p[17]=Le,p[18]=$e,m!==0&&(p[19]=m,i.length++),i};Math.imul||(L=B);function z(I,N,d){d.negative=N.negative^I.negative,d.length=I.length+N.length;for(var i=0,s=0,h=0;h<d.length-1;h++){var p=s;s=0;for(var m=i&67108863,v=Math.min(h,N.length-1),x=Math.max(0,h-I.length+1);x<=v;x++){var l=h-x,o=I.words[l]|0,g=N.words[x]|0,C=o*g,u=C&67108863;p=p+(C/67108864|0)|0,u=u+m|0,m=u&67108863,p=p+(u>>>26)|0,s+=p>>>26,p&=67108863}d.words[h]=m,i=p,p=s}return i!==0?d.words[h]=i:d.length--,d.strip()}function q(I,N,d){var i=new V;return i.mulp(I,N,d)}f.prototype.mulTo=function(N,d){var i,s=this.length+N.length;return this.length===10&&N.length===10?i=L(this,N,d):s<63?i=B(this,N,d):s<1024?i=z(this,N,d):i=q(this,N,d),i};function V(I,N){this.x=I,this.y=N}V.prototype.makeRBT=function(N){for(var d=new Array(N),i=f.prototype._countBits(N)-1,s=0;s<N;s++)d[s]=this.revBin(s,i,N);return d},V.prototype.revBin=function(N,d,i){if(N===0||N===i-1)return N;for(var s=0,h=0;h<d;h++)s|=(N&1)<<d-h-1,N>>=1;return s},V.prototype.permute=function(N,d,i,s,h,p){for(var m=0;m<p;m++)s[m]=d[N[m]],h[m]=i[N[m]]},V.prototype.transform=function(N,d,i,s,h,p){this.permute(p,N,d,i,s,h);for(var m=1;m<h;
vendor: 14,864 bytes, line 12
12m<<=1)for(var v=m<<1,x=Math.cos(2*Math.PI/v),l=Math.sin(2*Math.PI/v),o=0;o<h;o+=v)for(var g=x,C=l,u=0;u<m;u++){var A=i[o+u],S=s[o+u],_=i[o+u+m],P=s[o+u+m],K=g*_-C*P;P=g*P+C*_,_=K,i[o+u]=A+_,s[o+u]=S+P,i[o+u+m]=A-_,s[o+u+m]=S-P,u!==v&&(K=x*g-l*C,C=x*C+l*g,g=K)}},V.prototype.guessLen13b=function(N,d){var i=Math.max(d,N)|1,s=i&1,h=0;for(i=i/2|0;i;i=i>>>1)h++;return 1<<h+1+s},V.prototype.conjugate=function(N,d,i){if(!(i<=1))for(var s=0;s<i/2;s++){var h=N[s];N[s]=N[i-s-1],N[i-s-1]=h,h=d[s],d[s]=-d[i-s-1],d[i-s-1]=-h}},V.prototype.normalize13b=function(N,d){for(var i=0,s=0;s<d/2;s++){var h=Math.round(N[2*s+1]/d)*8192+Math.round(N[2*s]/d)+i;N[s]=h&67108863,h<67108864?i=0:i=h/67108864|0}return N},V.prototype.convert13b=function(N,d,i,s){for(var h=0,p=0;p<d;p++)h=h+(N[p]|0),i[2*p]=h&8191,h=h>>>13,i[2*p+1]=h&8191,h=h>>>13;for(p=2*d;p<s;++p)i[p]=0;n(h===0),n((h&-8192)===0)},V.prototype.stub=function(N){for(var d=new Array(N),i=0;i<N;i++)d[i]=0;return d},V.prototype.mulp=function(N,d,i){var s=2*this.guessLen13b(N.length,d.length),h=this.makeRBT(s),p=this.stub(s),m=new Array(s),v=new Array(s),x=new Array(s),l=new Array(s),o=new Array(s),g=new Array(s),C=i.words;C.length=s,this.convert13b(N.words,N.length,m,s),this.convert13b(d.words,d.length,l,s),this.transform(m,p,v,x,s,h),this.transform(l,p,o,g,s,h);for(var u=0;u<s;u++){var A=v[u]*o[u]-x[u]*g[u];x[u]=v[u]*g[u]+x[u]*o[u],v[u]=A}return this.conjugate(v,x,s),this.transform(v,x,C,p,s,h),this.conjugate(C,p,s),this.normalize13b(C,s),i.negative=N.negative^d.negative,i.length=N.length+d.length,i.strip()},f.prototype.mul=function(N){var d=new f(null);return d.words=new Array(this.length+N.length),this.mulTo(N,d)},f.prototype.mulf=function(N){var d=new f(null);return d.words=new Array(this.length+N.length),q(this,N,d)},f.prototype.imul=function(N){return this.clone().mulTo(N,this)},f.prototype.imuln=function(N){n(typeof N=="number"),n(N<67108864);for(var d=0,i=0;i<this.length;i++){var s=(this.words[i]|0)*N,h=(s&67108863)+(d&67108863);d>>=26,d+=s/67108864|0,d+=h>>>26,this.words[i]=h&67108863}return d!==0&&(this.words[i]=d,this.length++),this},f.prototype.muln=function(N){return this.clone().imuln(N)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(N){var d=F(N);if(d.length===0)return new f(1);for(var i=this,s=0;s<d.length&&d[s]===0;s++,i=i.sqr());if(++s<d.length)for(var h=i.sqr();s<d.length;s++,h=h.sqr())d[s]!==0&&(i=i.mul(h));return i},f.prototype.iushln=function(N){n(typeof N=="number"&&N>=0);var d=N%26,i=(N-d)/26,s=67108863>>>26-d<<26-d,h;if(d!==0){var p=0;for(h=0;h<this.length;h++){var m=this.words[h]&s,v=(this.words[h]|0)-m<<d;this.words[h]=v|p,p=m>>>26-d}p&&(this.words[h]=p,this.length++)}if(i!==0){for(h=this.length-1;h>=0;h--)this.words[h+i]=this.words[h];for(h=0;h<i;h++)this.words[h]=0;this.length+=i}return this.strip()},f.prototype.ishln=function(N){return n(this.negative===0),this.iushln(N)},f.prototype.iushrn=function(N,d,i){n(typeof N=="number"&&N>=0);var s;d?s=(d-d%26)/26:s=0;var h=N%26,p=Math.min((N-h)/26,this.length),m=67108863^67108863>>>h<<h,v=i;if(s-=p,s=Math.max(0,s),v){for(var x=0;x<p;x++)v.words[x]=this.words[x];v.length=p}if(p!==0)if(this.length>p)for(this.length-=p,x=0;x<this.length;x++)this.words[x]=this.words[x+p];else this.words[0]=0,this.length=1;var l=0;for(x=this.length-1;x>=0&&(l!==0||x>=s);x--){var o=this.words[x]|0;this.words[x]=l<<26-h|o>>>h,l=o&m}return v&&l!==0&&(v.words[v.length++]=l),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(N,d,i){return n(this.negative===0),this.iushrn(N,d,i)},f.prototype.shln=function(N){return this.clone().ishln(N)},f.prototype.ushln=function(N){return this.clone().iushln(N)},f.prototype.shrn=function(N){return this.clone().ishrn(N)},f.prototype.ushrn=function(N){return this.clone().iushrn(N)},f.prototype.testn=function(N){n(typeof N=="number"&&N>=0);var d=N%26,i=(N-d)/26,s=1<<d;if(this.length<=i)return!1;var h=this.words[i];return!!(h&s)},f.prototype.imaskn=function(N){n(typeof N=="number"&&N>=0);var d=N%26,i=(N-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=i)return this;if(d!==0&&i++,this.length=Math.min(i,this.length),d!==0){var s=67108863^67108863>>>d<<d;this.words[this.length-1]&=s}return this.strip()},f.prototype.maskn=function(N){return this.clone().imaskn(N)},f.prototype.iaddn=function(N){return n(typeof N=="number"),n(N<67108864),N<0?this.isubn(-N):this.negative!==0?this.length===1&&(this.words[0]|0)<N?(this.words[0]=N-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(N),this.negative=1,this):this._iaddn(N)},f.prototype._iaddn=function(N){this.words[0]+=N;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},f.prototype.isubn=function(N){if(n(typeof N=="number"),n(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this.strip()},f.prototype.addn=function(N){return this.clone().iaddn(N)},f.prototype.subn=function(N){return this.clone().isubn(N)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(N,d,i){var s=N.length+i,h;this._expand(s);var p,m=0;for(h=0;h<N.length;h++){p=(this.words[h+i]|0)+m;var v=(N.words[h]|0)*d;p-=v&67108863,m=(p>>26)-(v/67108864|0),this.words[h+i]=p&67108863}for(;h<this.length-i;h++)p=(this.words[h+i]|0)+m,m=p>>26,this.words[h+i]=p&67108863;if(m===0)return this.strip();for(n(m===-1),m=0,h=0;h<this.length;h++)p=-(this.words[h]|0)+m,m=p>>26,this.words[h]=p&67108863;return this.negative=1,this.strip()},f.prototype._wordDiv=function(N,d){var i=this.length-N.length,s=this.clone(),h=N,p=h.words[h.length-1]|0,m=this._countBits(p);i=26-m,i!==0&&(h=h.ushln(i),s.iushln(i),p=h.words[h.length-1]|0);var v=s.length-h.length,x;if(d!=="mod"){x=new f(null),x.length=v+1,x.words=new Array(x.length);for(var l=0;l<x.length;l++)x.words[l]=0}var o=s.clone()._ishlnsubmul(h,1,v);o.negative===0&&(s=o,x&&(x.words[v]=1));for(var g=v-1;g>=0;g--){var C=(s.words[h.length+g]|0)*67108864+(s.words[h.length+g-1]|0);for(C=Math.min(C/p|0,67108863),s._ishlnsubmul(h,C,g);s.negative!==0;)C--,s.negative=0,s._ishlnsubmul(h,1,g),s.isZero()||(s.negative^=1);x&&(x.words[g]=C)}return x&&x.strip(),s.strip(),d!=="div"&&i!==0&&s.iushrn(i),{div:x||null,mod:s}},f.prototype.divmod=function(N,d,i){if(n(!N.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var s,h,p;return this.negative!==0&&N.negative===0?(p=this.neg().divmod(N,d),d!=="mod"&&(s=p.div.neg()),d!=="div"&&(h=p.mod.neg(),i&&h.negative!==0&&h.iadd(N)),{div:s,mod:h}):this.negative===0&&N.negative!==0?(p=this.divmod(N.neg(),d),d!=="mod"&&(s=p.div.neg()),{div:s,mod:p.mod}):this.negative&N.negative?(p=this.neg().divmod(N.neg(),d),d!=="div"&&(h=p.mod.neg(),i&&h.negative!==0&&h.isub(N)),{div:p.div,mod:h}):N.length>this.length||this.cmp(N)<0?{div:new f(0),mod:this}:N.length===1?d==="div"?{div:this.divn(N.words[0]),mod:null}:d==="mod"?{div:null,mod:new f(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new f(this.modn(N.words[0]))}:this._wordDiv(N,d)},f.prototype.div=function(N){return this.divmod(N,"div",!1).div},f.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},f.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},f.prototype.divRound=function(N){var d=this.divmod(N);if(d.mod.isZero())return d.div;var i=d.div.negative!==0?d.mod.isub(N):d.mod,s=N.ushrn(1),h=N.andln(1),p=i.cmp(s);return p<0||h===1&&p===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},f.prototype.modn=function(N){n(N<=67108863);for(var d=(1<<26)%N,i=0,s=this.length-1;s>=0;s--)i=(d*i+(this.words[s]|0))%N;return i},f.prototype.idivn=function(N){n(N<=67108863);for(var d=0,i=this.length-1;i>=0;i--){var s=(this.words[i]|0)+d*67108864;this.words[i]=s/N|0,d=s%N}return this.strip()},f.prototype.divn=function(N){return this.clone().idivn(N)},f.prototype.egcd=function(N){n(N.negative===0),n(!N.isZero());var d=this,i=N.clone();d.negative!==0?d=d.umod(N):d=d.clone();for(var s=new f(1),h=new f(0),p=new f(0),m=new f(1),v=0;d.isEven()&&i.isEven();)d.iushrn(1),i.iushrn(1),++v;for(var x=i.clone(),l=d.clone();!d.isZero();){for(var o=0,g=1;!(d.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(d.iushrn(o);o-- >0;)(s.isOdd()||h.isOdd())&&(s.iadd(x),h.isub(l)),s.iushrn(1),h.iushrn(1);for(var C=0,u=1;!(i.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(i.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(x),m.isub(l)),p.iushrn(1),m.iushrn(1);d.cmp(i)>=0?(d.isub(i),s.isub(p),h.isub(m)):(i.isub(d),p.isub(s),m.isub(h))}return{a:p,b:m,gcd:i.iushln(v)}},f.prototype._invmp=function(N){n(N.negative===0),n(!N.isZero());var d=this,i=N.clone();d.negative!==0?d=d.umod(N):d=d.clone();for(var s=new f(1),h=new f(0),p=i.clone();d.cmpn(1)>0&&i.cmpn(1)>0;){for(var m=0,v=1;!(d.words[0]&v)&&m<26;++m,v<<=1);if(m>0)for(d.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(p),s.iushrn(1);for(var x=0,l=1;!(i.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(i.iushrn(x);x-- >0;)h.isOdd()&&h.iadd(p),h.iushrn(1);d.cmp(i)>=0?(d.isub(i),s.isub(h)):(i.isub(d),h.isub(s))}var o;return d.cmpn(1)===0?o=s:o=h,o.cmpn(0)<0&&o.iadd(N),o},f.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var d=this.clone(),i=N.clone();d.negative=0,i.negative=0;for(var s=0;d.isEven()&&i.isEven();s++)d.iushrn(1),i.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;i.isEven();)i.iushrn(1);var h=d.cmp(i);if(h<0){var p=d;d=i,i=p}else if(h===0||i.cmpn(1)===0)break;d.isub(i)}while(!0);return i.iushln(s)},f.prototype.invm=function(N){return this.egcd(N).a.umod(N)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(N){return this.words[0]&N},f.prototype.bincn=function(N){n(typeof N=="number");var d=N%26,i=(N-d)/26,s=1<<d;if(this.length<=i)return this._expand(i+1),this.words[i]|=s,this;for(var h=s,p=i;h!==0&&p<this.length;p++){var m=this.words[p]|0;m+=h,h=m>>>26,m&=67108863,this.words[p]=m}return h!==0&&(this.words[p]=h,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(N){var d=N<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this.strip();var i;if(this.length>1)i=1;else{d&&(N=-N),n(N<=67108863,"Number is too big");var s=this.words[0]|0;i=s===N?0:s<N?-1:1}return this.negative!==0?-i|0:i},f.prototype.cmp=function(N){if(this.negative!==0&&N.negative===0)return-1;if(this.negative===0&&N.negative!==0)return 1;var d=this.ucmp(N);return this.negative!==0?-d|0:d},f.prototype.ucmp=function(N){if(this.length>N.length)return 1;if(this.length<N.length)return-1;for(var d=0,i=this.length-1;i>=0;i--){var s=this.words[i]|0,h=N.words[i]|0;if(s!==h){s<h?d=-1:s>h&&(d=1);break}}return d},f.prototype.gtn=function(N){return this.cmpn(N)===1},f.prototype.gt=function(N){return this.cmp(N)===1},f.prototype.gten=function(N){return this.cmpn(N)>=0},f.prototype.gte=function(N){return this.cmp(N)>=0},f.prototype.ltn=function(N){return this.cmpn(N)===-1},f.prototype.lt=function(N){return this.cmp(N)===-1},f.prototype.lten=function(N){return this.cmpn(N)<=0},f.prototype.lte=function(N){return this.cmp(N)<=0},f.prototype.eqn=function(N){return this.cmpn(N)===0},f.prototype.eq=function(N){return this.cmp(N)===0},f.red=function(N){return new Rt(N)},f.prototype.toRed=function(N){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(N){return this.red=N,this},f.prototype.forceRed=function(N){return n(!this.red,"Already a number in reduction context"),this._forceRed(N)},f.prototype.redAdd=function(N){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},f.prototype.redIAdd=function(N){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},f.prototype.redSub=function(N){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},f.prototype.redISub=function(N){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},f.prototype.redShl=function(N){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},f.prototype.redMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},f.prototype.redIMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(N){return n(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var At={k256:null,p224:null,p192:null,p25519:null};function St(I,N){this.name=I,this.p=new f(N,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}St.prototype._tmp=function(){var N=new f(null);return N.words=new Array(Math.ceil(this.n/13)),N},St.prototype.ireduce=function(N){var d=N,i;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),i=d.bitLength();while(i>this.n);var s=i<this.n?-1:d.ucmp(this.p);return s===0?(d.words[0]=0,d.length=1):s>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},St.prototype.split=function(N,d){N.iushrn(this.n,0,d)},St.prototype.imulK=function(N){return N.imul(this.k)};function Z(){St.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Z,St),Z.prototype.split=function(N,d){for(var i=4194303,s=Math.min(N.length,9),h=0;h<s;h++)d.words[h]=N.words[h];if(d.length=s,N.length<=9){N.words[0]=0,N.length=1;return}var p=N.words[9];for(d.words[d.length++]=p&i,h=10;h<N.length;h++){var m=N.words[h]|0;N.words[h-10]=(m&i)<<4|p>
12>>22,p=m}p>>>=22,N.words[h-10]=p,p===0&&N.length>10?N.length-=10:N.length-=9},Z.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var d=0,i=0;i<N.length;i++){var s=N.words[i]|0;d+=s*977,N.words[i]=d&67108863,d=s*64+(d/67108864|0)}return N.words[N.length-1]===0&&(N.length--,N.words[N.length-1]===0&&N.length--),N};function Y(){St.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Y,St);function Ct(){St.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Ct,St);function Tt(){St.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Tt,St),Tt.prototype.imulK=function(N){for(var d=0,i=0;i<N.length;i++){var s=(N.words[i]|0)*19+d,h=s&67108863;s>>>=26,N.words[i]=h,d=s}return d!==0&&(N.words[N.length++]=d),N},f._prime=function(N){if(At[N])return At[N];var d;if(N==="k256")d=new Z;else if(N==="p224")d=new Y;else if(N==="p192")d=new Ct;else if(N==="p25519")d=new Tt;else throw new Error("Unknown prime "+N);return At[N]=d,d};function Rt(I){if(typeof I=="string"){var N=f._prime(I);this.m=N.p,this.prime=N}else n(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}Rt.prototype._verify1=function(N){n(N.negative===0,"red works only with positives"),n(N.red,"red works only with red numbers")},Rt.prototype._verify2=function(N,d){n((N.negative|d.negative)===0,"red works only with positives"),n(N.red&&N.red===d.red,"red works only with red numbers")},Rt.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},Rt.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},Rt.prototype.add=function(N,d){this._verify2(N,d);var i=N.add(d);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},Rt.prototype.iadd=function(N,d){this._verify2(N,d);var i=N.iadd(d);return i.cmp(this.m)>=0&&i.isub(this.m),i},Rt.prototype.sub=function(N,d){this._verify2(N,d);var i=N.sub(d);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},Rt.prototype.isub=function(N,d){this._verify2(N,d);var i=N.isub(d);return i.cmpn(0)<0&&i.iadd(this.m),i},Rt.prototype.shl=function(N,d){return this._verify1(N),this.imod(N.ushln(d))},Rt.prototype.imul=function(N,d){return this._verify2(N,d),this.imod(N.imul(d))},Rt.prototype.mul=function(N,d){return this._verify2(N,d),this.imod(N.mul(d))},Rt.prototype.isqr=function(N){return this.imul(N,N.clone())},Rt.prototype.sqr=function(N){return this.mul(N,N)},Rt.prototype.sqrt=function(N){if(N.isZero())return N.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var i=this.m.add(new f(1)).iushrn(2);return this.pow(N,i)}for(var s=this.m.subn(1),h=0;!s.isZero()&&s.andln(1)===0;)h++,s.iushrn(1);n(!s.isZero());var p=new f(1).toRed(this),m=p.redNeg(),v=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new f(2*x*x).toRed(this);this.pow(x,v).cmp(m)!==0;)x.redIAdd(m);for(var l=this.pow(x,s),o=this.pow(N,s.addn(1).iushrn(1)),g=this.pow(N,s),C=h;g.cmp(p)!==0;){for(var u=g,A=0;u.cmp(p)!==0;A++)u=u.redSqr();n(A<C);var S=this.pow(l,new f(1).iushln(C-A-1));o=o.redMul(S),l=S.redSqr(),g=g.redMul(l),C=A}return o},Rt.prototype.invm=function(N){var d=N._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},Rt.prototype.pow=function(N,d){if(d.isZero())return new f(1).toRed(this);if(d.cmpn(1)===0)return N.clone();var i=4,s=new Array(1<<i);s[0]=new f(1).toRed(this),s[1]=N;for(var h=2;h<s.length;h++)s[h]=this.mul(s[h-1],N);var p=s[0],m=0,v=0,x=d.bitLength()%26;for(x===0&&(x=26),h=d.length-1;h>=0;h--){for(var l=d.words[h],o=x-1;o>=0;o--){var g=l>>o&1;if(p!==s[0]&&(p=this.sqr(p)),g===0&&m===0){v=0;continue}m<<=1,m|=g,v++,!(v!==i&&(h!==0||o!==0))&&(p=this.mul(p,s[m]),v=0,m=0)}x=26}return p},Rt.prototype.convertTo=function(N){var d=N.umod(this.m);return d===N?d.clone():d},Rt.prototype.convertFrom=function(N){var d=N.clone();return d.red=null,d},f.mont=function(N){return new Dt(N)};function Dt(I){Rt.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(Dt,Rt),Dt.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},Dt.prototype.convertFrom=function(N){var d=this.imod(N.mul(this.rinv));return d.red=null,d},Dt.prototype.imul=function(N,d){if(N.isZero()||d.isZero())return N.words[0]=0,N.length=1,N;var i=N.imul(d),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(s).iushrn(this.shift),p=h;return h.cmp(this.m)>=0?p=h.isub(this.m):h.cmpn(0)<0&&(p=h.iadd(this.m)),p._forceRed(this)},Dt.prototype.mul=function(N,d){if(N.isZero()||d.isZero())return new f(0)._forceRed(this);var i=N.mul(d),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),h=i.isub(s).iushrn(this.shift),p=h;return h.cmp(this.m)>=0?p=h.isub(this.m):h.cmpn(0)<0&&(p=h.iadd(this.m)),p._forceRed(this)},Dt.prototype.invm=function(N){var d=this.imod(N._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(r,bi)})(c1);var QN=c1.exports;const ue=Nr(QN);function M0(r,t,e){return e={path:t,exports:{},require:function(n,a){return YN(n,a??e.path)}},r(e,e.exports),e.exports}function YN(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var d1=Sw;function Sw(r,t){if(!r)throw new Error(t||"Assertion failed")}Sw.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var xo=M0(function(r,t){var e=t;function n(c,y){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var w=0;w<c.length;w++)b[w]=c[w]|0;return b}if(y==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var w=0;w<c.length;w+=2)b.push(parseInt(c[w]+c[w+1],16))}else for(var w=0;w<c.length;w++){var E=c.charCodeAt(w),M=E>>8,O=E&255;M?b.push(M,O):b.push(O)}return b}e.toArray=n;function a(c){return c.length===1?"0"+c:c}e.zero2=a;function f(c){for(var y="",b=0;b<c.length;b++)y+=a(c[b].toString(16));return y}e.toHex=f,e.encode=function(y,b){return b==="hex"?f(y):y}}),ji=M0(function(r,t){var e=t;e.assert=d1,e.toArray=xo.toArray,e.zero2=xo.zero2,e.toHex=xo.toHex,e.encode=xo.encode;function n(b,w,E){var M=new Array(Math.max(b.bitLength(),E)+1);M.fill(0);for(var O=1<<w+1,F=b.clone(),B=0;B<M.length;B++){var L,z=F.andln(O-1);F.isOdd()?(z>(O>>1)-1?L=(O>>1)-z:L=z,F.isubn(L)):L=0,M[B]=L,F.iushrn(1)}return M}e.getNAF=n;function a(b,w){var E=[[],[]];b=b.clone(),w=w.clone();for(var M=0,O=0,F;b.cmpn(-M)>0||w.cmpn(-O)>0;){var B=b.andln(3)+M&3,L=w.andln(3)+O&3;B===3&&(B=-1),L===3&&(L=-1);var z;B&1?(F=b.andln(7)+M&7,(F===3||F===5)&&L===2?z=-B:z=B):z=0,E[0].push(z);var q;L&1?(F=w.andln(7)+O&7,(F===3||F===5)&&B===2?q=-L:q=L):q=0,E[1].push(q),2*M===z+1&&(M=1-M),2*O===q+1&&(O=1-O),b.iushrn(1),w.iushrn(1)}return E}e.getJSF=a;function f(b,w,E){var M="_"+w;b.prototype[w]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}e.cachedProperty=f;function c(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=c;function y(b){return new ue(b,"hex","le")}e.intFromLE=y}),Nu=ji.getNAF,t_=ji.getJSF,_u=ji.assert;function Qf(r,t){this.type=r,this.p=new ue(t.p,16),this.red=t.prime?ue.red(t.prime):ue.mont(this.p),this.zero=new ue(0).toRed(this.red),this.one=new ue(1).toRed(this.red),this.two=new ue(2).toRed(this.red),this.n=t.n&&new ue(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 e=this.n&&this.p.div(this.n);!e||e.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ws=Qf;Qf.prototype.point=function(){throw new Error("Not implemented")};Qf.prototype.validate=function(){throw new Error("Not implemented")};Qf.prototype._fixedNafMul=function(t,e){_u(t.precomputed);var n=t._getDoubles(),a=Nu(e,1,this._bitLength),f=(1<<n.step+1)-(n.step%2===0?2:1);f/=3;var c=[],y,b;for(y=0;y<a.length;y+=n.step){b=0;for(var w=y+n.step-1;w>=y;w--)b=(b<<1)+a[w];c.push(b)}for(var E=this.jpoint(null,null,null),M=this.jpoint(null,null,null),O=f;O>0;O--){for(y=0;y<c.length;y++)b=c[y],b===O?M=M.mixedAdd(n.points[y]):b===-O&&(M=M.mixedAdd(n.points[y].neg()));E=E.add(M)}return E.toP()};Qf.prototype._wnafMul=function(t,e){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var f=a.points,c=Nu(e,n,this._bitLength),y=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var w=0;b>=0&&c[b]===0;b--)w++;if(b>=0&&w++,y=y.dblp(w),b<0)break;var E=c[b];_u(E!==0),t.type==="affine"?E>0?y=y.mixedAdd(f[E-1>>1]):y=y.mixedAdd(f[-E-1>>1].neg()):E>0?y=y.add(f[E-1>>1]):y=y.add(f[-E-1>>1].neg())}return t.type==="affine"?y.toP():y};Qf.prototype._wnafMulAdd=function(t,e,n,a,f){var c=this._wnafT1,y=this._wnafT2,b=this._wnafT3,w=0,E,M,O;for(E=0;E<a;E++){O=e[E];var F=O._getNAFPoints(t);c[E]=F.wnd,y[E]=F.points}for(E=a-1;E>=1;E-=2){var B=E-1,L=E;if(c[B]!==1||c[L]!==1){b[B]=Nu(n[B],c[B],this._bitLength),b[L]=Nu(n[L],c[L],this._bitLength),w=Math.max(b[B].length,w),w=Math.max(b[L].length,w);continue}var z=[e[B],null,null,e[L]];
12e[B].y.cmp(e[L].y)===0?(z[1]=e[B].add(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg())):e[B].y.cmp(e[L].y.redNeg())===0?(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].add(e[L].neg())):(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],V=t_(n[B],n[L]);for(w=Math.max(V[0].length,w),b[B]=new Array(w),b[L]=new Array(w),M=0;M<w;M++){var At=V[0][M]|0,St=V[1][M]|0;b[B][M]=q[(At+1)*3+(St+1)],b[L][M]=0,y[B]=z}}var Z=this.jpoint(null,null,null),Y=this._wnafT4;for(E=w;E>=0;E--){for(var Ct=0;E>=0;){var Tt=!0;for(M=0;M<a;M++)Y[M]=b[M][E]|0,Y[M]!==0&&(Tt=!1);if(!Tt)break;Ct++,E--}if(E>=0&&Ct++,Z=Z.dblp(Ct),E<0)break;for(M=0;M<a;M++){var Rt=Y[M];Rt!==0&&(Rt>0?O=y[M][Rt-1>>1]:Rt<0&&(O=y[M][-Rt-1>>1].neg()),O.type==="affine"?Z=Z.mixedAdd(O):Z=Z.add(O))}}for(E=0;E<a;E++)y[E]=null;return f?Z:Z.toP()};function Sn(r,t){this.curve=r,this.type=t,this.precomputed=null}Qf.BasePoint=Sn;Sn.prototype.eq=function(){throw new Error("Not implemented")};Sn.prototype.validate=function(){return this.curve.validate(this)};Qf.prototype.decodePoint=function(t,e){t=ji.toArray(t,e);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?_u(t[t.length-1]%2===0):t[0]===7&&_u(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};Sn.prototype.encodeCompressed=function(t){return this.encode(t,!0)};Sn.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))};Sn.prototype.encode=function(t,e){return ji.encode(this._encode(e),t)};Sn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this};Sn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1};Sn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,f=0;f<e;f+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}};Sn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),f=1;f<n;f++)e[f]=e[f-1].add(a);return{wnd:t,points:e}};Sn.prototype._getBeta=function(){return null};Sn.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var p1=M0(function(r){typeof Object.create=="function"?r.exports=function(e,n){
12n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,n){if(n){e.super_=n;var a=function(){};a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e}}}),e_=ji.assert;function In(r){ws.call(this,"short",r),this.a=new ue(r.a,16).toRed(this.red),this.b=new ue(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}p1(In,ws);var r_=In;In.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,n;if(t.beta)e=new ue(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);e=a[0].cmp(a[1])<0?a[0]:a[1],e=e.toRed(this.red)}if(t.lambda)n=new ue(t.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))===0?n=f[0]:(n=f[1],e_(this.g.mul(n).x.cmp(this.g.x.redMul(e))===0))}var c;return t.basis?c=t.basis.map(function(y){return{a:new ue(y.a,16),b:new ue(y.b,16)}}):c=this._getEndoBasis(n),{beta:e,lambda:n,basis:c}}};In.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:ue.mont(t),n=new ue(2).toRed(e).redInvm(),a=n.redNeg(),f=new ue(3).toRed(e).redNeg().redSqrt().redMul(n),c=a.redAdd(f).fromRed(),y=a.redSub(f).fromRed();return[c,y]};In.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),f=new ue(1),c=new ue(0),y=new ue(0),b=new ue(1),w,E,M,O,F,B,L,z=0,q,V;n.cmpn(0)!==0;){var At=a.div(n);q=a.sub(At.mul(n)),V=y.sub(At.mul(f));var St=b.sub(At.mul(c));if(!M&&q.cmp(e)<0)w=L.neg(),E=f,M=q.neg(),O=V;else if(M&&++z===2)break;L=q,a=n,n=q,y=f,f=V,b=c,c=St}F=q.neg(),B=V;var Z=M.sqr().add(O.sqr()),Y=F.sqr().add(B.sqr());return Y.cmp(Z)>=0&&(F=w,B=E),M.negative&&(M=M.neg(),O=O.neg()),F.negative&&(F=F.neg(),B=B.neg()),[{a:M,b:O},{a:F,b:B}]};In.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],a=e[1],f=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),y=f.mul(n.a),b=c.mul(a.a),w=f.mul(n.b),E=c.mul(a.b),M=t.sub(y).sub(b),O=w.add(E).neg();return{k1:M,k2:O}};In.prototype.pointFromX=function(t,e){t=new ue(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)};In.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,a=this.a.redMul(e),f=e.redSqr().redMul(e).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(f).cmpn(0)===0};In.prototype._endoWnafMulAdd=function(t,e,n){for(var a=this._endoWnafT1,f=this._endoWnafT2,c=0;c<t.length;c++){var y=this._endoSplit(e[c]),b=t[c],w=b._getBeta();y.k1.negative&&(y.k1.ineg(),b=b.neg(!0)),y.k2.negative&&(y.k2.ineg(),w=w.neg(!0)),a[c*2]=b,a[c*2+1]=w,f[c*2]=y.k1,f[c*2+1]=y.k2}for(var E=this._wnafMulAdd(1,a,f,c*2,n),M=0;M<c*2;M++)a[M]=null,f[M]=null;return E};function Xr(r,t,e,n){ws.BasePoint.call(this,r,"affine"),t===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ue(t,16),this.y=new ue(e,16),n&&(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)}p1(Xr,ws.BasePoint);In.prototype.point=function(t,e,n){return new Xr(this,t,e,n)};In.prototype.pointFromJSON=function(t,e){return Xr.fromJSON(this,t,e)};Xr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,a=function(f){return n.point(f.x.redMul(n.endo.beta),f.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return e}};Xr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.prec
12omputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Xr.fromJSON=function(t,e,n){typeof e=="string"&&(e=JSON.parse(e));var a=t.point(e[0],e[1],n);if(!e[2])return a;function f(y){return t.point(y[0],y[1],n)}var c=e[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(f))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(f))}},a};Xr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Xr.prototype.isInfinity=function(){return this.inf};Xr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),a=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)};Xr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),a=t.redInvm(),f=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(a),c=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,y)};Xr.prototype.getX=function(){return this.x.fromRed()};Xr.prototype.getY=function(){return this.y.fromRed()};Xr.prototype.mul=function(t){return t=new ue(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Xr.prototype.mulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f):this.curve._wnafMulAdd(1,a,f,2)};Xr.prototype.jmulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f,!0):this.curve._wnafMulAdd(1,a,f,2,!0)};Xr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Xr.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
12if(t&&this.precomputed){var n=this.precomputed,a=function(f){return f.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return e};Xr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function fi(r,t,e,n){ws.BasePoint.call(this,r,"jacobian"),t===null&&e===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ue(0)):(this.x=new ue(t,16),this.y=new ue(e,16),this.z=new ue(n,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}p1(fi,ws.BasePoint);In.prototype.jpoint=function(t,e,n){return new fi(this,t,e,n)};fi.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),a=this.y.redMul(e).redMul(t);return this.curve.point(n,a)};fi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};fi.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(e),f=t.x.redMul(n),c=this.y.redMul(e.redMul(t.z)),y=t.y.redMul(n.redMul(this.z)),b=a.redSub(f),w=c.redSub(y);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=b.redSqr(),M=E.redMul(b),O=a.redMul(E),F=w.redSqr().redIAdd(M).redISub(O).redISub(O),B=w.redMul(O.redISub(F)).redISub(c.redMul(M)),L=this.z.redMul(t.z).redMul(b);return this.curve.jpoint(F,B,L)};fi.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,a=t.x.redMul(e),f=this.y,c=t.y.redMul(e).redMul(this.z),y=n.redSub(a),b=f.redSub(c);if(y.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=y.redSqr(),E=w.redMul(y),M=n.redMul(w),O=b.redSqr().redIAdd(E).redISub(M).redISub(M),F=b.redMul(M.redISub(O)).redISub(f.redMul(E)),B=this.z.redMul(y);return this.curve.jpoint(O,F,B)};fi.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var a=this.curve.a,f=this.curve.tinv,c=this.x,y=this.y,b=this.z,w=b.redSqr().redSqr(),E=y.redAdd(y);for(e=0;e<t;e++){var M=c.redSqr(),O=E.redSqr(),F=O.redSqr(),B=M.redAdd(M).redIAdd(M).redIAdd(a.redMul(w)),L=c.redMul(O),z=B.redSqr().redISub(L.redAdd(L)),q=L.redISub(z),V=B.redMul(q);V=V.redIAdd(V).redISub(F);var At=E.redMul(b);e+1<t&&(w=w.redMul(F)),c=z,b=At,E=V}return this.curve.jpoint(c,E.redMul(f),b)};fi.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};fi.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a),w=b.redSqr().redISub(y).redISub(y),E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),t=w,e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),O=this.y.redSqr(),F=O.redSqr(),B=this.x.redAdd(O).redSqr().redISub(M).redISub(F);B=B.redIAdd(B);var L=M.redAdd(M).redIAdd(M),z=L.redSqr(),q=F.redIAdd(F);q=q.redIAdd(q),q=q.redIAdd(q),t=z.redISub(B).redISub(B),e=L.redMul(B.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,e,n)};fi.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),w=b.redSqr().redISub(y).redISub(y);t=w;var E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),O=this.y.redSqr(),F=this.x.redMul(O),B=this.x.redSub(M).redMul(this.x.redAdd(M));B=B.redAdd(B).redIAdd(B);var L=F.redIAdd(F);L=L.redIAdd(L);var z=L.redAdd(L);t=B.redSqr().redISub(z),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(M);var q=O.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),e=B.redMul(L.redISub(t)).redISub(q)}return this.curve.jpoint(t,e,n)};fi.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,a=this.z,f=a.redSqr().redSqr(),c=e.redSqr(),y=n.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(f)),w=e.redAdd(e);w=w.redIAdd(w);var E=w.redMul(y),M=b.redSqr().redISub(E.redAdd(E)),O=E.redISub(M),F=y.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=b.redMul(O).redISub(F),L=n.redAdd(n).redMul(a);return this.curve.jpoint(M,B,L)};fi.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),a=e.redSqr(),f=t.redAdd(t).redIAdd(t),
12c=f.redSqr(),y=this.x.redAdd(e).redSqr().redISub(t).redISub(a);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(c);var b=y.redSqr(),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=f.redIAdd(y).redSqr().redISub(c).redISub(b).redISub(w),M=e.redMul(E);M=M.redIAdd(M),M=M.redIAdd(M);var O=this.x.redMul(b).redISub(M);O=O.redIAdd(O),O=O.redIAdd(O);var F=this.y.redMul(E.redMul(w.redISub(E)).redISub(y.redMul(b)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=this.z.redAdd(y).redSqr().redISub(n).redISub(b);return this.curve.jpoint(O,F,B)};fi.prototype.mul=function(t,e){return t=new ue(t,e),this.curve._wnafMul(this,t)};fi.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var a=e.redMul(this.z),f=n.redMul(t.z);return this.y.redMul(f).redISub(t.y.redMul(a)).cmpn(0)===0};fi.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(n)===0)return!0;for(var a=t.clone(),f=this.curve.redN.redMul(e);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(f),this.x.cmp(n)===0)return!0}};fi.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};fi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Gh=M0(function(r,t){var e=t;e.base=ws,e.short=r_,e.mont=null,e.edwards=null}),zh=M0(function(r,t){var e=t,n=ji.assert;function a(y){y.type==="short"?this.curve=new Gh.short(y):y.type==="edwards"?this.curve=new Gh.edwards(y):this.curve=new Gh.mont(y),this.g=this.curve.g,this.n=this.curve.n,this.hash=y.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function f(y,b){Object.defineProperty(e,y,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,y,{configurable:!0,enumerable:!0,value:w}),w}})}f("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:oe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:oe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:oe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:oe.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"]}),f("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:oe.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oe.sha256,gRed:!1,g:["9"]}),f("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:oe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}f("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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
12,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Wf(r){if(!(this instanceof Wf))return new Wf(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=xo.toArray(r.entropy,r.entropyEnc||"hex"),e=xo.toArray(r.nonce,r.nonceEnc||"hex"),n=xo.toArray(r.pers,r.persEnc||"hex");d1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,e,n)}var Iw=Wf;Wf.prototype._init=function(t,e,n){var a=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656};Wf.prototype._hmac=function(){return new oe.hmac(this.hash,this.K)};Wf.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};Wf.prototype.reseed=function(t,e,n,a){typeof e!="string"&&(a=n,n=e,e=null),t=xo.toArray(t,e),n=xo.toArray(n,a),d1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};Wf.prototype.generate=function(t,e,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(a=n,n=e,e=null),n&&(n=xo.toArray(n,a||"hex"),this._update(n));for(var f=[];f.length<t;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,t);return this._update(n),this._reseed++,xo.encode(c,e)};var zd=ji.assert;function vi(r,t){this.ec=r,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var g1=vi;vi.fromPublic=function(t,e,n){return e instanceof vi?e:new vi(t,{pub:e,pubEnc:n})};vi.fromPrivate=function(t,e,n){return e instanceof vi?e:new vi(t,{priv:e,privEnc:n})};vi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}};vi.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub};vi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};vi.prototype._importPrivate=function(t,e){this.priv=new ue(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)};vi.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?zd(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&zd(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)};vi.prototype.derive=function(t){return t.validate()||zd(t.validate(),"public point not validated"),t.mul(this.priv).getX()};vi.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)};vi.prototype.verify=function(t,e){return this.ec.verify(t,e,this)};vi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var i_=ji.assert;function cl(r,t){if(r instanceof cl)return r;this._importDER(r,t)||(i_(r.r&&r.s,"Signature without r or s"),this.r=new ue(r.r,16),this.s=new ue(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var dl=cl;function n_(){this.place=0}function Nc(r,t){var e=r[t.place++];if(!(e&128))return e;var n=e&15;if(n===0||n>4)return!1;for(var a=0,f=0,c=t.place;f<n;f++,c++)a<<=8,a|=r[c],a>>>=0;return a<=127?!1:(t.place=c,a)}function Rv(r){for(var t=0,e=r.length-1;!r[t]&&!(r[t+1]&128)&&t<e;)t++;return t===0?r:r.slice(t)}cl.prototype._importDER=function(t,e){t=ji.toArray(t,e);var n=new n_;if(t[n.place++]!==48)return!1;var a=Nc(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var f=Nc(t,n);if(f===!1)return!1;var c=t.slice(n.place,f+n.place);if(n.place+=f,t[n.place++]!==2)return!1;var y=Nc(t,n);if(y===!1||t.length!==y+n.place)return!1;var b=t.slice(n.place,y+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new ue(c),this.s=new ue(b),this.recoveryParam=null,!0};function _c(r,t){if(t<128){r.push(t);return}var e=1+(Math.log(t)/Math.LN2>>>3);for(r.push(e|128);--e;)r.push(t>>>(e<<3)&255);r.push(t)}cl.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();
12for(e[0]&128&&(e=[0].concat(e)),n[0]&128&&(n=[0].concat(n)),e=Rv(e),n=Rv(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];_c(a,e.length),a=a.concat(e),a.push(2),_c(a,n.length);var f=a.concat(n),c=[48];return _c(c,f.length),c=c.concat(f),ji.encode(c,t)};var o_=function(){throw new Error("unsupported")},Rw=ji.assert;function yn(r){if(!(this instanceof yn))return new yn(r);typeof r=="string"&&(Rw(Object.prototype.hasOwnProperty.call(zh,r),"Unknown curve "+r),r=zh[r]),r instanceof zh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var f_=yn;yn.prototype.keyPair=function(t){return new g1(this,t)};yn.prototype.keyFromPrivate=function(t,e){return g1.fromPrivate(this,t,e)};yn.prototype.keyFromPublic=function(t,e){return g1.fromPublic(this,t,e)};yn.prototype.genKeyPair=function(t){t||(t={});for(var e=new Iw({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o_(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new ue(2));;){var f=new ue(e.generate(n));if(!(f.cmp(a)>0))return f.iaddn(1),this.keyFromPrivate(f)}};yn.prototype._truncateToN=function(t,e){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t};yn.prototype.sign=function(t,e,n,a){typeof n=="object"&&(a=n,n=null),a||(a={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new ue(t,16));for(var f=this.n.byteLength(),c=e.getPrivate().toArray("be",f),y=t.toArray("be",f),b=new Iw({hash:this.hash,entropy:c,nonce:y,pers:a.pers,persEnc:a.persEnc||"utf8"}),w=this.n.sub(new ue(1)),E=0;;E++){var M=a.k?a.k(E):new ue(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(w)>=0)){var O=this.g.mul(M);if(!O.isInfinity()){var F=O.getX(),B=F.umod(this.n);if(B.cmpn(0)!==0){var L=M.invm(this.n).mul(B.mul(e.getPrivate()).iadd(t));if(L=L.umod(this.n),L.cmpn(0)!==0){var z=(O.getY().isOdd()?1:0)|(F.cmp(B)!==0?2:0);return a.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),z^=1),new dl({r:B,s:L,recoveryParam:z})}}}}}};yn.prototype.verify=function(t,e,n,a){t=this._truncateToN(new ue(t,16)),n=this.keyFromPublic(n,a),e=new dl(e,"hex");var f=e.r,c=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var y=c.invm(this.n),b=y.mul(t).umod(this.n),w=y.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)};yn.prototype.recoverPubKey=function(r,t,e,n){Rw((3&e)===e,"The recovery param is more than two bits"),t=new dl(t,n);var a=this.n,f=new ue(r),c=t.r,y=t.s,b=e&1,w=e>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var E=t.r.invm(a),M=a.sub(f).mul(E).umod(a),O=y.mul(E).umod(a);return this.g.mulAdd(M,c,O)};yn.prototype.getKeyRecoveryParam=function(r,t,e,n){if(t=new dl(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var f;try{f=this.recoverPubKey(r,t,a)}catch{continue}if(f.eq(e))return a}throw new Error("Unable to find valid recovery factor")};var s_=M0(function(r,t){var e=t;e.version="6.5.4",e.utils=ji,e.rand=function(){throw new Error("unsupported")},e.curve=Gh,e.curves=zh,e.ec=f_,e.eddsa=null}),a_=s_.ec;const h_="logger/5.7.0";let Tv=!1,Pv=!1;const qh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Cv=qh.default,Sc=null;function u_(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Ov=u_();var qd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(qd||(qd={}));var oo;
12(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(oo||(oo={}));const kv="0123456789abcdef";let pl=class Lr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();qh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Cv>qh[n])&&console.log.apply(console,e)}debug(...t){this._log(Lr.levels.DEBUG,t)}info(...t){this._log(Lr.levels.INFO,t)}warn(...t){this._log(Lr.levels.WARNING,t)}makeError(t,e,n){if(Pv)return this.makeError("censored error",e,{});e||(e=Lr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=kv[w[M]>>4],E+=kv[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case oo.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case oo.CALL_EXCEPTION:case oo.INSUFFICIENT_FUNDS:case oo.MISSING_NEW:case oo.NONCE_EXPIRED:case oo.REPLACEMENT_UNDERPRICED:case oo.TRANSACTION_REPLACED:case oo.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Lr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Ov&&this.throwError("platform missing String.prototype.normalize",Lr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Ov})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Lr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Lr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Lr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Lr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Lr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Lr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Lr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Sc||(Sc=new Lr(h_)),Sc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Lr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Tv){if(!t)return;this.globalLogger().throwError("error censorship permanent",Lr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Pv=!!t,Tv=!!e}static setLogLevel(t){const e=qh[t.toLowerCase()];if(e==null){Lr.globalLogger().warn("invalid log level - "+t);return}Cv=e}static from(t){return new Lr(t)}};pl.errors=oo;pl.levels=qd;const l_="bytes/5.7.0",br=new pl(l_);function Tw(r){return!!r.toHexString}function ia(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return ia(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function c_(r){return hs(r)&&!(r.length%2)||m1(r)}function Bv(r){return typeof r=="number"&&r==r&&r%1===0}function m1(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!Bv(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Bv(e)||e<0||e>=256)return!1}return!0}function wi(r,t){if(t||(t={}),typeof r=="number"){br.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),ia(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Tw(r)&&(r=r.toHexString()),hs(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":br.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return ia(new Uint8Array(n))}return m1(r)?ia(new Uint8Array(r)):br.throwArgumentError("invalid arrayify value","value",r)}function d_(r,t){r=wi(r),r.length>t&&br.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),ia(e)}function hs(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const Ic="0123456789abcdef";function un(r,t){if(t||(t={}),typeof r=="number"){br.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Ic[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Tw(r))return r.toHexString();if(hs(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":br.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(m1(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Ic[(a&240)>>4]+Ic[a&15]}return e}return br.throwArgumentError("invalid hexlify value","value",r)}function Qs(r,t){for(typeof r!="string"?r=un(r):hs(r)||br.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&br.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function Pw(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(c_(r)){let e=wi(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=un(e.slice(0,32)),t.s=un(e.slice(32,64))):e.length===65?(t.r=un(e.slice(0,32)),t.s=un(e.slice(32,64)),t.v=e[64]):br.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:br.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=un(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const a=d_(wi(t._vs),32);t._vs=un(a);const f=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=f:t.recoveryParam!==f&&br.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),a[0]&=127;const c=un(a);t.s==null?t.s=c:t.s!==c&&br.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?br.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&br.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!hs(t.r)?br.throwArgumentError("signature missing or invalid r","signature",r):t.r=Qs(t.r,32),t.s==null||!hs(t.s)?br.throwArgumentError("signature missing or invalid s","signature",r):t.s=Qs(t.s,32);const e=wi(t.s);e[0]>=128&&br.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=un(e);t._vs&&(hs(t._vs)||br.throwArgumentError("signature invalid _vs","signature",r),t._vs=Qs(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&br.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function O0(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}const p_="signing-key/5.4.0",Cw=new pl(p_);let Rc=null;function Co(){return Rc||(Rc=new a_("secp256k1")),Rc}let v1=class{constructor(t){O0(this,"curve","secp256k1"),O0(this,"privateKey",un(t));const e=Co().keyFromPrivate(wi(this.privateKey));O0(this,"publicKey","0x"+e.getPublic(!1,"hex")),O0(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),O0(this,"_isSigningKey",!0)}_addPoint(t){const e=Co().keyFromPublic(wi(this.publicKey)),n=Co().keyFromPublic(wi(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}
12signDigest(t){const e=Co().keyFromPrivate(wi(this.privateKey)),n=wi(t);n.length!==32&&Cw.throwArgumentError("bad digest length","digest",t);const a=e.sign(n,{canonical:!0});return Pw({recoveryParam:a.recoveryParam,r:Qs("0x"+a.r.toString(16),32),s:Qs("0x"+a.s.toString(16),32)})}computeSharedSecret(t){const e=Co().keyFromPrivate(wi(this.privateKey)),n=Co().keyFromPublic(wi(x1(t)));return Qs("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}};function Ow(r,t){const e=Pw(t),n={r:wi(e.r),s:wi(e.s)};return"0x"+Co().recoverPubKey(wi(r),n,e.recoveryParam).encode("hex",!1)}function x1(r,t){const e=wi(r);if(e.length===32){const n=new v1(e);return t?"0x"+Co().keyFromPrivate(e).getPublic(!0,"hex"):n.publicKey}else{if(e.length===33)return t?un(e):"0x"+Co().keyFromPublic(e).getPublic(!1,"hex");if(e.length===65)return t?"0x"+Co().keyFromPublic(e).getPublic(!0,"hex"):un(e)}return Cw.throwArgumentError("invalid public or private key","key","[REDACTED]")}const _T=Object.freeze(Object.defineProperty({__proto__:null,SigningKey:v1,computePublicKey:x1,recoverPublicKey:Ow},Symbol.toStringTag,{value:"Module"})),g_="logger/5.7.0";let Uv=!1,Fv=!1;const Kh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Dv=Kh.default,Tc=null;function m_(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Lv=m_();var Kd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Kd||(Kd={}));var fo;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(fo||(fo={}));const $v="0123456789abcdef";let gl=class $r{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Kh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Dv>Kh[n])&&console.log.apply(console,e)}debug(...t){this._log($r.levels.DEBUG,t)}info(...t){this._log($r.levels.INFO,t)}warn(...t){this._log($r.levels.WARNING,t)}makeError(t,e,n){if(Fv)return this.makeError("censored error",e,{});e||(e=$r.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=$v[w[M]>>4],E+=$v[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case fo.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case fo.CALL_EXCEPTION:case fo.INSUFFICIENT_FUNDS:case fo.MISSING_NEW:case fo.NONCE_EXPIRED:case fo.REPLACEMENT_UNDERPRICED:case fo.TRANSACTION_REPLACED:case fo.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,$r.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Lv&&this.throwError("platform missing String.prototype.normalize",$r.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Lv})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,$r.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,$r.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,$r.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,$r.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",$r.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",$r.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",$r.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Tc||(Tc=new $r(g_)),Tc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",$r.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Uv){if(!t)return;this.globalLogger().throwError("error censorship permanent",$r.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Fv=!!t,Uv=!!e}static setLogLevel(t){const e=Kh[t.toLowerCase()];if(e==null){$r.globalLogger().warn("invalid log level - "+t);return}Dv=e}static from(t){return new $r(t)}};gl.errors=fo;gl.levels=Kd;const v_="bytes/5.7.0",Ys=new gl(v_);function kw(r){return!!r.toHexString}function na(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return na(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function Gv(r){return typeof r=="number"&&r==r&&r%1===0}function Bw(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!Gv(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Gv(e)||e<0||e>=256)return!1}return!0}function ml(r,t){if(t||(t={}),typeof r=="number"){Ys.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),na(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),kw(r)&&(r=r.toHexString()),Uw(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":Ys.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return na(new Uint8Array(n))}return Bw(r)?na(new Uint8Array(r)):Ys.throwArgumentError("invalid arrayify value","value",r)}function x_(r){const t=r.map(a=>ml(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),na(n)}function Uw(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const Pc="0123456789abcdef";function y_(r,t){if(t||(t={}),typeof r=="number"){Ys.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Pc[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),kw(r))return r.toHexString();if(Uw(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":Ys.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Bw(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Pc[(a&240)>>4]+Pc[a&15]}return e}return Ys.throwArgumentError("invalid hexlify value","value",r)}const b_="0x0000000000000000000000000000000000000000000000000000000000000000",w_="strings/5.4.0",Fw=new gl(w_);var Jf;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(Jf||(Jf={}));var Ei;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(Ei||(Ei={}));function E_(r,t,e,n,a){return Fw.throwArgumentError(`invalid codepoint at offset ${t}; ${r}`,"bytes",e)}function Dw(r,t,e,n,a){if(r===Ei.BAD_PREFIX||r===Ei.UNEXPECTED_CONTINUE){let f=0;for(let c=t+1;c<e.length&&e[c]>>6===2;c++)f++;return f}return r===Ei.OVERRUN?e.length-t-1:0}function A_(r,t,e,n,a){return r===Ei.OVERLONG?(n.push(a),0):(n.push(65533),Dw(r,t,e))}const y1=Object.freeze({error:E_,ignore:Dw,replace:A_});function b1(r,t){t==null&&(t=y1.error),r=ml(r);const e=[];let n=0;for(;n<r.length;){const a=r[n++];if(!(a>>7)){e.push(a);continue}let f=null,c=null;if((a&224)===192)f=1,c=127;else if((a&240)===224)f=2,c=2047;else if((a&248)===240)f=3,c=65535;else{(a&192)===128?n+=t(Ei.UNEXPECTED_CONTINUE,n-1,r,e):n+=t(Ei.BAD_PREFIX,n-1,r,e);continue}if(n-1+f>=r.length){n+=t(Ei.OVERRUN,n-1,r,e);continue}let y=a&(1<<8-f-1)-1;for(let b=0;b<f;b++){let w=r[n];if((w&192)!=128){n+=t(Ei.MISSING_CONTINUE,n,r,e),y=null;break}y=y<<6|w&63,n++}if(y!==null){if(y>1114111){n+=t(Ei.OUT_OF_RANGE,n-1-f,r,e,y);continue}if(y>=55296&&y<=57343){n+=t(Ei.UTF16_SURROGATE,n-1-f,r,e,y);continue}if(y<=c){n+=t(Ei.OVERLONG,n-1-f,r,e,y);continue}e.push(y)}}return e}function vl(r,t=Jf.current){t!=Jf.current&&(Fw.checkNormalize(),r=r.normalize(t));let e=[];for(let n=0;n<r.length;n++){const a=r.charCodeAt(n);if(a<128)e.push(a);else if(a<2048)e.push(a>>6|192),e.push(a&63|128);else if((a&64512)==55296){n++;const f=r.charCodeAt(n);if(n>=r.length||(f&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((a&1023)<<10)+(f&1023);e.push(c>>18|240),e.push(c>>12&63|128),e.push(c>>6&63|128),e.push(c&63|128)}else e.push(a>>12|224),e.push(a>>6&63|128),e.push(a&63|128)}return ml(e)}function Cc(r){const t="0000"+r.toString(16);return"\\u"+t.substring(t.length-4)}function Lw(r,t){return'"'+b1(r,t).map(e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Cc(e):(e-=65536,Cc((e>>10&1023)+55296)+Cc((e&1023)+56320))}).join("")+'"'}function Hd(r){return r.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function w1(r,t){return Hd(b1(r,t))}
12function Su(r,t=Jf.current){return b1(vl(r,t))}function $w(r){const t=vl(r);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return y_(x_([t,b_]).slice(0,32))}function Gw(r){const t=ml(r);if(t.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(t[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let e=31;for(;t[e-1]===0;)e--;return w1(t.slice(0,e))}function M_(r){if(r.length%4!==0)throw new Error("bad data");let t=[];for(let e=0;e<r.length;e+=4)t.push(parseInt(r.substring(e,e+4),16));return t}function E1(r,t){t||(t=function(a){return[parseInt(a,16)]});let e=0,n={};return r.split(",").forEach(a=>{let f=a.split(":");e+=parseInt(f[0],16),n[e]=t(f[1])}),n}function zw(r){let t=0;return r.split(",").map(e=>{let n=e.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let a=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:a,h:t}})}function A1(r,t){let e=0;for(let n=0;n<t.length;n++){let a=t[n];if(e+=a.l,r>=e&&r<=e+a.h&&(r-e)%(a.d||1)===0){if(a.e&&a.e.indexOf(r-e)!==-1)continue;return a}}return null}const N_=zw("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),__="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),S_=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],I_=E1("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),R_=E1("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),T_=E1("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",M_),P_=zw("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function C_(r){return r.reduce((t,e)=>(e.forEach(n=>{t.push(n)}),t),[])}function O_(r){return!!A1(r,N_)}function k_(r){let t=A1(r,S_);if(t)return[r+t.s];let e=I_[r];if(e)return e;let n=R_[r];if(n)return[r+n[0]];let a=T_[r];return a||null}function B_(r){return!!A1(r,P_)}function qw(r){if(r.match(/^[a-z0-9-]*$/i)&&r.length<=59)return r.toLowerCase();let t=Su(r);t=C_(t.map(n=>{if(__.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let a=k_(n);return a||[n]}
12)),t=Su(Hd(t),Jf.NFKC),t.forEach(n=>{if(B_(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(n=>{if(O_(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let e=Hd(t);if(e.substring(0,1)==="-"||e.substring(2,4)==="--"||e.substring(e.length-1)==="-")throw new Error("invalid hyphen");if(e.length>63)throw new Error("too long");return e}const ST=Object.freeze(Object.defineProperty({__proto__:null,get UnicodeNormalizationForm(){return Jf},Utf8ErrorFuncs:y1,get Utf8ErrorReason(){return Ei},_toEscapedUtf8String:Lw,formatBytes32String:$w,nameprep:qw,parseBytes32String:Gw,toUtf8Bytes:vl,toUtf8CodePoints:Su,toUtf8String:w1},Symbol.toStringTag,{value:"Module"})),U_="logger/5.7.0";let zv=!1,qv=!1;const Hh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Kv=Hh.default,Oc=null;function F_(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Hv=F_();var Wd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Wd||(Wd={}));var so;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(so||(so={}));const Wv="0123456789abcdef";let nr=class Gr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Hh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Kv>Hh[n])&&console.log.apply(console,e)}debug(...t){this._log(Gr.levels.DEBUG,t)}info(...t){this._log(Gr.levels.INFO,t)}warn(...t){this._log(Gr.levels.WARNING,t)}makeError(t,e,n){if(qv)return this.makeError("censored error",e,{});e||(e=Gr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Wv[w[M]>>4],E+=Wv[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case so.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case so.CALL_EXCEPTION:case so.INSUFFICIENT_FUNDS:case so.MISSING_NEW:case so.NONCE_EXPIRED:case so.REPLACEMENT_UNDERPRICED:case so.TRANSACTION_REPLACED:case so.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Gr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Hv&&this.throwError("platform missing String.prototype.normalize",Gr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Hv})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Gr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Gr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Gr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Gr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Gr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Oc||(Oc=new Gr(U_)),Oc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),zv){if(!t)return;this.globalLogger().throwError("error censorship permanent",Gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}qv=!!t,zv=!!e}static setLogLevel(t){const e=Hh[t.toLowerCase()];if(e==null){Gr.globalLogger().warn("invalid log level - "+t);return}Kv=e}static from(t){return new Gr(t)}};nr.errors=so;nr.levels=Wd;const D_="bytes/5.7.0",pr=new nr(D_);function Kw(r){return!!r.toHexString}function oa(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return oa(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function M1(r){return mn(r)&&!(r.length%2)||xl(r)}function Jv(r){return typeof r=="number"&&r==r&&r%1===0}function xl(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!Jv(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Jv(e)||e<0||e>=256)return!1}return!0}function er(r,t){if(t||(t={}),typeof r=="number"){pr.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),oa(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Kw(r)&&(r=r.toHexString()),mn(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":pr.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return oa(new Uint8Array(n))}return xl(r)?oa(new Uint8Array(r)):pr.throwArgumentError("invalid arrayify value","value",r)}function Ff(r){let t=er(r);if(t.length===0)return t;let e=0;for(;e<t.length&&t[e]===0;)e++;return e&&(t=t.slice(e)),t}function L_(r,t){r=er(r),r.length>t&&pr.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),oa(e)}function mn(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const kc="0123456789abcdef";function Ze(r,t){if(t||(t={}),typeof r=="number"){pr.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=kc[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),Kw(r))return r.toHexString();if(mn(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":pr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(xl(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=kc[(a&240)>>4]+kc[a&15]}return e}return pr.throwArgumentError("invalid hexlify value","value",r)}function Hw(r){if(typeof r!="string")r=Ze(r);else if(!mn(r)||r.length%2)return null;return(r.length-2)/2}function Vv(r,t,e){return typeof r!="string"?r=Ze(r):(!mn(r)||r.length%2)&&pr.throwArgumentError("invalid hexData","value",r),t=2+2*t,"0x"+r.substring(t)}function Ww(r){let t="0x";return r.forEach(e=>{t+=Ze(e).substring(2)}),t}function Lo(r,t){for(typeof r!="string"?r=Ze(r):mn(r)||pr.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&pr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function Ka(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(M1(r)){let e=er(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=Ze(e.slice(0,32)),t.s=Ze(e.slice(32,64))):e.length===65?(t.r=Ze(e.slice(0,32)),t.s=Ze(e.slice(32,64)),t.v=e[64]):pr.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:pr.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=Ze(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const a=L_(er(t._vs),32);t._vs=Ze(a);const f=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=f:t.recoveryParam!==f&&pr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),a[0]&=127;const c=Ze(a);t.s==null?t.s=c:t.s!==c&&pr.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?pr.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&pr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!mn(t.r)?pr.throwArgumentError("signature missing or invalid r","signature",r):t.r=Lo(t.r,32),t.s==null||!mn(t.s)?pr.throwArgumentError("signature missing or invalid s","signature",r):t.s=Lo(t.s,32);const e=er(t.s);e[0]>=128&&pr.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=Ze(e);t._vs&&(mn(t._vs)||pr.throwArgumentError("signature invalid _vs","signature",r),t._vs=Lo(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&pr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var N1={exports:{}};N1.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}
vendor: 38,081 bytes, line 12
12typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
12function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(N1);var $_=N1.exports;const le=Nr($_),G_="bignumber/5.7.0";var Iu=le.BN;const Xo=new nr(G_),Bc={},jv=9007199254740991;let Xv=!1,$o=class qn{constructor(t,e){t!==Bc&&Xo.throwError("cannot call constructor directly; use BigNumber.from",nr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Ti(Ae(this).fromTwos(t))}toTwos(t){return Ti(Ae(this).toTwos(t))}abs(){return this._hex[0]==="-"?qn.from(this._hex.substring(1)):this}add(t){return Ti(Ae(this).add(Ae(t)))}sub(t){return Ti(Ae(this).sub(Ae(t)))}div(t){return qn.from(t).isZero()&&rn("division-by-zero","div"),Ti(Ae(this).div(Ae(t)))}mul(t){return Ti(Ae(this).mul(Ae(t)))}mod(t){const e=Ae(t);return e.isNeg()&&rn("division-by-zero","mod"),Ti(Ae(this).umod(e))}pow(t){const e=Ae(t);return e.isNeg()&&rn("negative-power","pow"),Ti(Ae(this).pow(e))}and(t){const e=Ae(t);return(this.isNegative()||e.isNeg())&&rn("unbound-bitwise-result","and"),Ti(Ae(this).and(e))}or(t){const e=Ae(t);return(this.isNegative()||e.isNeg())&&rn("unbound-bitwise-result","or"),Ti(Ae(this).or(e))}xor(t){const e=Ae(t);return(this.isNegative()||e.isNeg())&&rn("unbound-bitwise-result","xor"),Ti(Ae(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&rn("negative-width","mask"),Ti(Ae(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&rn("negative-width","shl"),Ti(Ae(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&rn("negative-width","shr"),Ti(Ae(this).shrn(t))}eq(t){return Ae(this).eq(Ae(t))}lt(t){return Ae(this).lt(Ae(t))}lte(t){return Ae(this).lte(Ae(t))}gt(t){return Ae(this).gt(Ae(t))}gte(t){return Ae(this).gte(Ae(t))}isNegative(){return this._hex[0]==="-"}isZero(){return Ae(this).isZero()}toNumber(){try{return Ae(this).toNumber()}catch{rn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Xo.throwError("this platform does not support BigInt",nr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Xv||(Xv=!0,Xo.warn("BigNumber.toString does not accept any parameters;
12 base-10 is assumed")):arguments[0]===16?Xo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",nr.errors.UNEXPECTED_ARGUMENT,{}):Xo.throwError("BigNumber.toString does not accept parameters",nr.errors.UNEXPECTED_ARGUMENT,{})),Ae(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof qn)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new qn(Bc,Na(t)):t.match(/^-?[0-9]+$/)?new qn(Bc,Na(new Iu(t))):Xo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&rn("underflow","BigNumber.from",t),(t>=jv||t<=-jv)&&rn("overflow","BigNumber.from",t),qn.from(String(t));const e=t;if(typeof e=="bigint")return qn.from(e.toString());if(xl(e))return qn.from(Ze(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return qn.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(mn(n)||n[0]==="-"&&mn(n.substring(1))))return qn.from(n)}return Xo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function Na(r){if(typeof r!="string")return Na(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Xo.throwArgumentError("invalid hex","value",r),r=Na(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Ti(r){return $o.from(Na(r))}function Ae(r){const t=$o.from(r).toHexString();return t[0]==="-"?new Iu("-"+t.substring(3),16):new Iu(t.substring(2),16)}function rn(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),Xo.throwError(r,nr.errors.NUMERIC_FAULT,n)}function z_(r){return new Iu(r,36).toString(16)}var Jw={exports:{}};(function(r){(function(){var t="input is invalid type",e="finalize already called",n=typeof window=="object",a=n?window:{};a.JS_SHA3_NO_WINDOW&&(n=!1);var f=!n&&typeof self=="object",c=!a.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;c?a=bi:f&&(a=self);var y=!a.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!a.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",w="0123456789abcdef".split(""),E=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],O=[1,256,65536,16777216],F=[6,1536,393216,100663296],B=[0,8,16,24],L=[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],z=[224,256,384,512],q=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],At={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),b&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var St=function(u,A,S){return function(_){return new o(u,A,u).update(_)[S]()}},Z=function(u,A,S){return function(_,P){return new o(u,A,P).update(_)[S]()}},Y=function(u,A,S){return function(_,P,K,$){return i["cshake"+u].update(_,P,K,$)[S]()}},Ct=function(u,A,S){return function(_,P,K,$){return i["kmac"+u].update(_,P,K,$)[S]()}},Tt=function(u,A,S,_){for(var P=0;P<V.length;++P){var K=V[P];u[K]=A(S,_,K)}return u},Rt=function(u,A){var S=St(u,A,"hex");return S.create=function(){return new o(u,A,u)},S.update=function(_){return S.create().update(_)},Tt(S,St,u,A)},Dt=function(u,A){var S=Z(u,A,"hex");return S.create=function(_){return new o(u,A,_)},S.update=function(_,P){return S.create(P).update(_)},Tt(S,Z,u,A)},I=function(u,A){var S=At[u],_=Y(u,A,"hex");return _.create=function(P,K,$){return!K&&!$?i["shake"+u].create(P):new o(u,A,P).bytepad([K,$],S)},_.update=function(P,K,$,U){return _.create(K,$,U).update(P)},Tt(_,Y,u,A)},N=function(u,A){var S=At[u],_=Ct(u,A,"hex");return _.create=function(P,K,$){return new g(u,A,K).bytepad(["KMAC",$],S).bytepad([P],S)},_.update=function(P,K,$,U){return _.create(P,$,U).update(K)},Tt(_,Ct,u,A)},d=[{name:"keccak",padding:O,bits:z,createMethod:Rt},{name:"sha3",padding:F,bits:z,createMethod:Rt},{name:"shake",padding:E,bits:q,createMethod:Dt},{name:"cshake",padding:M,bits:q,createMethod:I},{name:"kmac",padding:M,bits:q,createMethod:N}],i={},s=[],h=0;h<d.length;++h)for(var p=d[h],m=p.bits,v=0;v<m.length;++v){var x=p.name+"_"+m[v];if(s.push(x),i[x]=p.createMethod(m[v],p.padding),p.name!=="sha3"){var l=p.name+m[v];s.push(l),i[l]=i[x]}}function o(u,A,S){this.blocks=[],this.s=[],this.padding=A,this.outputBits=S,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(u<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var _=0;_<50;++_)this.s[_]=0}o.prototype.update=function(u){if(this.finalized)throw new Error(e);var A,S=typeof u;
12if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}for(var _=this.blocks,P=this.byteCount,K=u.length,$=this.blockCount,U=0,It=this.s,G,J;U<K;){if(this.reset)for(this.reset=!1,_[0]=this.block,G=1;G<$+1;++G)_[G]=0;if(A)for(G=this.start;U<K&&G<P;++U)_[G>>2]|=u[U]<<B[G++&3];else for(G=this.start;U<K&&G<P;++U)J=u.charCodeAt(U),J<128?_[G>>2]|=J<<B[G++&3]:J<2048?(_[G>>2]|=(192|J>>6)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):J<55296||J>=57344?(_[G>>2]|=(224|J>>12)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):(J=65536+((J&1023)<<10|u.charCodeAt(++U)&1023),_[G>>2]|=(240|J>>18)<<B[G++&3],_[G>>2]|=(128|J>>12&63)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]);if(this.lastByteIndex=G,G>=P){for(this.start=G-P,this.block=_[$],G=0;G<$;++G)It[G]^=_[G];C(It),this.reset=!0}else this.start=G}return this},o.prototype.encode=function(u,A){var S=u&255,_=1,P=[S];for(u=u>>8,S=u&255;S>0;)P.unshift(S),u=u>>8,S=u&255,++_;return A?P.push(_):P.unshift(_),this.update(P),P.length},o.prototype.encodeString=function(u){var A,S=typeof u;if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}var _=0,P=u.length;if(A)_=P;else for(var K=0;K<u.length;++K){var $=u.charCodeAt(K);$<128?_+=1:$<2048?_+=2:$<55296||$>=57344?_+=3:($=65536+(($&1023)<<10|u.charCodeAt(++K)&1023),_+=4)}return _+=this.encode(_*8),this.update(u),_},o.prototype.bytepad=function(u,A){for(var S=this.encode(A),_=0;_<u.length;++_)S+=this.encodeString(u[_]);var P=A-S%A,K=[];return K.length=P,this.update(K),this},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,A=this.lastByteIndex,S=this.blockCount,_=this.s;if(u[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(u[0]=u[S],A=1;A<S+1;++A)u[A]=0;for(u[S-1]|=2147483648,A=0;A<S;++A)_[A]^=u[A];C(_)}},o.prototype.toString=o.prototype.hex=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$="",U;K<S;){for(P=0;P<u&&K<S;++P,++K)U=A[P],$+=w[U>>4&15]+w[U&15]+w[U>>12&15]+w[U>>8&15]+w[U>>20&15]+w[U>>16&15]+w[U>>28&15]+w[U>>24&15];K%u===0&&(C(A),P=0)}return _&&(U=A[P],$+=w[U>>4&15]+w[U&15],_>1&&($+=w[U>>12&15]+w[U>>8&15]),_>2&&($+=w[U>>20&15]+w[U>>16&15])),$},o.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=this.outputBits>>3,U;_?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer($);for(var It=new Uint32Array(U);K<S;){for(P=0;P<u&&K<S;++P,++K)It[K]=A[P];K%u===0&&C(A)}return _&&(It[P]=A[P],U=U.slice(0,$)),U},o.prototype.buffer=o.prototype.arrayBuffer,o.prototype.digest=o.prototype.array=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=[],U,It;K<S;){for(P=0;P<u&&K<S;++P,++K)U=K<<2,It=A[P],$[U]=It&255,$[U+1]=It>>8&255,$[U+2]=It>>16&255,$[U+3]=It>>24&255;K%u===0&&C(A)}return _&&(U=K<<2,It=A[P],$[U]=It&255,_>1&&($[U+1]=It>>8&255),_>2&&($[U+2]=It>>16&255)),$};function g(u,A,S){o.call(this,u,A,S)}g.prototype=new o,g.prototype.finalize=function(){return this.encode(this.outputBits,!0),o.prototype.finalize.call(this)};var C=function(u){var A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht,jt,Mt,ut,Xt,Nt,lt,Zt,wt,Et,Qt,Yt,te,ee,re;for(_=0;_<48;_+=2)P=u[0]^u[10]^u[20]^u[30]^u[40],K=u[1]^u[11]^u[21]^u[31]^u[41],$=u[2]^u[12]^u[22]^u[32]^u[42],U=u[3]^u[13]^u[23]^u[33]^u[43],It=u[4]^u[14]^u[24]^u[34]^u[44],G=u[5]^u[15]^u[25]^u[35]^u[45],J=u[6]^u[16]^u[26]^u[36]^u[46],Gt=u[7]^u[17]^u[27]^u[37]^u[47],ct=u[8]^u[18]^u[28]^u[38]^u[48],rt=u[9]^u[19]^u[29]^u[39]^u[49],A=ct^($<<1|U>>>31),S=rt^(U<<1|$>>>31),u[0]^=A,u[1]^=S,u[10]^=A,u[11]^=S,u[20]^=A,u[21]^=S,u[30]^=A,u[31]^=S,u[40]^=A,u[41]^=S,A=P^(It<<1|G>>>31),S=K^(G<<1|It>>>31),u[2]^=A,u[3]^=S,u[12]^=A,u[13]^=S,u[22]^=A,u[23]^=S,u[32]^=A,u[33]^=S,u[42]^=A,u[43]^=S,A=$^(J<<1|Gt>>>31),S=U^(Gt<<1|J>>>31),u[4]^=A,u[5]^=S,u[14]^=A,u[15]^=S,u[24]^=A,u[25]^=S,u[34]^=A,u[35]^=S,u[44]^=A,u[45]^=S,A=It^(ct<<1|rt>>>31),S=G^(rt<<1|ct>>>31),u[6]^=A,u[7]^=S,u[16]^=A,u[17]^=S,u[26]^=A,u[27]^=S,u[36]^=A,u[37]^=S,u[46]^=A,u[47]^=S,A=J^(P<<1|K>>>31),S=Gt^(K<<1|P>>>31),u[8]^=A,u[9]^=S,u[18]^=A,u[19]^=S,u[28]^=A,u[29]^=S,u[38]^=A,u[39]^=S,u[48]^=A,u[49]^=S,qt=u[0],dt=u[1],at=u[11]<<4|u[10]>>>28,Vt=u[10]<<4|u[11]>>>28,D=u[20]<<3|u[21]>>>29,j=u[21]<<3|u[20]>>>29,Yt=u[31]<<9|u[30]>>>23,te=u[30]<<9|u[31]>>>23,xt=u[40]<<18|u[41]>>>14,st=u[41]<<18|u[40]>>>14,X=u[2]<<1|u[3]>>>31,Ft=u[3]<<1|u[2]>>>31,it=u[13]<<12|u[12]>>>20,Kt=u[12]<<12|u[13]>>>20,bt=u[22]<<10|u[23]>>>22,ht=u[23]<<10|u[22]>>>22,H=u[33]<<13|u[32]>>>19,W=u[32]<<13|u[33]>>>19,ee=u[42]<<2|u[43]>>>30,re=u[43]<<2|u[42]>>>30,Nt=u[5]<<30|u[4]>>>2,lt=u[4]<<30|u[5]>>>2,Q=u[14]<<6|u[15]>>>26,ot=u[15]<<6|u[14]>>>26,gt=u[25]<<11|u[24]>>>21,tt=u[24]<<11|u[25]>>>21,jt=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,Bt=u[45]<<29|u[44]>>>3,et=u[44]<<29|u[45]>>>3,mt=u[6]<<28|u[7]>>>4,k=u[7]<<28|u[6]>>>4,Zt=u[17]<<23|u[16]>>>
129,wt=u[16]<<23|u[17]>>>9,Ht=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Lt=u[36]<<21|u[37]>>>11,pt=u[37]<<21|u[36]>>>11,ut=u[47]<<24|u[46]>>>8,Xt=u[46]<<24|u[47]>>>8,Jt=u[8]<<27|u[9]>>>5,yt=u[9]<<27|u[8]>>>5,T=u[18]<<20|u[19]>>>12,R=u[19]<<20|u[18]>>>12,Et=u[29]<<7|u[28]>>>25,Qt=u[28]<<7|u[29]>>>25,ft=u[38]<<8|u[39]>>>24,Wt=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,$t=u[49]<<14|u[48]>>>18,u[0]=qt^~it&gt,u[1]=dt^~Kt&tt,u[10]=mt^~T&D,u[11]=k^~R&j,u[20]=X^~Q&Ht,u[21]=Ft^~ot&vt,u[30]=Jt^~at&bt,u[31]=yt^~Vt&ht,u[40]=Nt^~Zt&Et,u[41]=lt^~wt&Qt,u[2]=it^~gt&Lt,u[3]=Kt^~tt&pt,u[12]=T^~D&H,u[13]=R^~j&W,u[22]=Q^~Ht&ft,u[23]=ot^~vt&Wt,u[32]=at^~bt&jt,u[33]=Vt^~ht&Mt,u[42]=Zt^~Et&Yt,u[43]=wt^~Qt&te,u[4]=gt^~Lt&nt,u[5]=tt^~pt&$t,u[14]=D^~H&Bt,u[15]=j^~W&et,u[24]=Ht^~ft&xt,u[25]=vt^~Wt&st,u[34]=bt^~jt&ut,u[35]=ht^~Mt&Xt,u[44]=Et^~Yt&ee,u[45]=Qt^~te&re,u[6]=Lt^~nt&qt,u[7]=pt^~$t&dt,u[16]=H^~Bt&mt,u[17]=W^~et&k,u[26]=ft^~xt&X,u[27]=Wt^~st&Ft,u[36]=jt^~ut&Jt,u[37]=Mt^~Xt&yt,u[46]=Yt^~ee&Nt,u[47]=te^~re&lt,u[8]=nt^~qt&it,u[9]=$t^~dt&Kt,u[18]=Bt^~mt&T,u[19]=et^~k&R,u[28]=xt^~X&Q,u[29]=st^~Ft&ot,u[38]=ut^~Jt&at,u[39]=Xt^~yt&Vt,u[48]=ee^~Nt&Zt,u[49]=re^~lt&wt,u[0]^=L[_],u[1]^=L[_+1]};if(y)r.exports=i;else for(h=0;h<s.length;++h)a[s[h]]=i[s[h]]})()})(Jw);var q_=Jw.exports;const K_=Nr(q_);function gs(r){return"0x"+K_.keccak_256(er(r))}const H_="rlp/5.7.0",To=new nr(H_);function Zv(r){const t=[];for(;r;)t.unshift(r&255),r>>=8;return t}function Qv(r,t,e){let n=0;for(let a=0;a<e;a++)n=n*256+r[t+a];return n}function Vw(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(f){n=n.concat(Vw(f))}),n.length<=55)return n.unshift(192+n.length),n;const a=Zv(n.length);return a.unshift(247+a.length),a.concat(n)}M1(r)||To.throwArgumentError("RLP object must be BytesLike","object",r);const t=Array.prototype.slice.call(er(r));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const e=Zv(t.length);return e.unshift(183+e.length),e.concat(t)}function _a(r){return Ze(Vw(r))}function Yv(r,t,e,n){const a=[];for(;e<t+1+n;){const f=jw(r,e);a.push(f.result),e+=f.consumed,e>t+1+n&&To.throwError("child data too short",nr.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function jw(r,t){if(r.length===0&&To.throwError("data too short",nr.errors.BUFFER_OVERRUN,{}),r[t]>=248){const e=r[t]-247;t+1+e>r.length&&To.throwError("data short segment too short",nr.errors.BUFFER_OVERRUN,{});const n=Qv(r,t+1,e);return t+1+e+n>r.length&&To.throwError("data long segment too short",nr.errors.BUFFER_OVERRUN,{}),Yv(r,t,t+1+e,e+n)}else if(r[t]>=192){const e=r[t]-192;return t+1+e>r.length&&To.throwError("data array too short",nr.errors.BUFFER_OVERRUN,{}),Yv(r,t,t+1,e)}else if(r[t]>=184){const e=r[t]-183;t+1+e>r.length&&To.throwError("data array too short",nr.errors.BUFFER_OVERRUN,{});const n=Qv(r,t+1,e);t+1+e+n>r.length&&To.throwError("data array too short",nr.errors.BUFFER_OVERRUN,{});const a=Ze(r.slice(t+1+e,t+1+e+n));return{consumed:1+e+n,result:a}}else if(r[t]>=128){const e=r[t]-128;t+1+e>r.length&&To.throwError("data too short",nr.errors.BUFFER_OVERRUN,{});const n=Ze(r.slice(t+1,t+1+e));return{consumed:1+e,result:n}}return{consumed:1,result:Ze(r[t])}}function _1(r){const t=er(r),e=jw(t,0);return e.consumed!==t.length&&To.throwArgumentError("invalid rlp data","data",r),e.result}const W_="address/5.7.0",H0=new nr(W_);function tx(r){mn(r,20)||H0.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let a=0;a<40;a++)e[a]=t[a].charCodeAt(0);const n=er(gs(e));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const J_=9007199254740991;function V_(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const S1={};for(let r=0;r<10;r++)S1[String(r)]=String(r);for(let r=0;r<26;r++)S1[String.fromCharCode(65+r)]=String(10+r);const ex=Math.floor(V_(J_));function j_(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>S1[n]).join("");for(;t.length>=ex;){let n=t.substring(0,ex);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function Ha(r){let t=null;if(typeof r!="string"&&H0.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=tx(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&H0.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==j_(r)&&H0.throwArgumentError("bad icap checksum","address",r),t=z_(r.substring(4));t.length<40;)t="0"+t;t=tx("0x"+t)}else H0.throwArgumentError("invalid address","address",r);return t}
12const X_=$o.from(0),Z_="properties/5.7.0",rx=new nr(Z_);function k0(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function Q_(r,t){(!r||typeof r!="object")&&rx.throwArgumentError("invalid object","object",r),Object.keys(r).forEach(e=>{t[e]||rx.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)})}function N0(r,t,e){return e={path:t,exports:{},require:function(n,a){return Y_(n,a??e.path)}},r(e,e.exports),e.exports}function Y_(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var I1=Xw;function Xw(r,t){if(!r)throw new Error(t||"Assertion failed")}Xw.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var yo=N0(function(r,t){var e=t;function n(c,y){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var w=0;w<c.length;w++)b[w]=c[w]|0;return b}if(y==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var w=0;w<c.length;w+=2)b.push(parseInt(c[w]+c[w+1],16))}else for(var w=0;w<c.length;w++){var E=c.charCodeAt(w),M=E>>8,O=E&255;M?b.push(M,O):b.push(O)}return b}e.toArray=n;function a(c){return c.length===1?"0"+c:c}e.zero2=a;function f(c){for(var y="",b=0;b<c.length;b++)y+=a(c[b].toString(16));return y}e.toHex=f,e.encode=function(y,b){return b==="hex"?f(y):y}}),Xi=N0(function(r,t){var e=t;e.assert=I1,e.toArray=yo.toArray,e.zero2=yo.zero2,e.toHex=yo.toHex,e.encode=yo.encode;function n(b,w,E){var M=new Array(Math.max(b.bitLength(),E)+1);M.fill(0);for(var O=1<<w+1,F=b.clone(),B=0;B<M.length;B++){var L,z=F.andln(O-1);F.isOdd()?(z>(O>>1)-1?L=(O>>1)-z:L=z,F.isubn(L)):L=0,M[B]=L,F.iushrn(1)}return M}e.getNAF=n;function a(b,w){var E=[[],[]];b=b.clone(),w=w.clone();for(var M=0,O=0,F;b.cmpn(-M)>0||w.cmpn(-O)>0;){var B=b.andln(3)+M&3,L=w.andln(3)+O&3;B===3&&(B=-1),L===3&&(L=-1);var z;B&1?(F=b.andln(7)+M&7,(F===3||F===5)&&L===2?z=-B:z=B):z=0,E[0].push(z);var q;L&1?(F=w.andln(7)+O&7,(F===3||F===5)&&B===2?q=-L:q=L):q=0,E[1].push(q),2*M===z+1&&(M=1-M),2*O===q+1&&(O=1-O),b.iushrn(1),w.iushrn(1)}return E}e.getJSF=a;function f(b,w,E){var M="_"+w;b.prototype[w]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}e.cachedProperty=f;function c(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=c;function y(b){return new le(b,"hex","le")}e.intFromLE=y}),Ru=Xi.getNAF,t7=Xi.getJSF,Tu=Xi.assert;function Yf(r,t){this.type=r,this.p=new le(t.p,16),this.red=t.prime?le.red(t.prime):le.mont(this.p),this.zero=new le(0).toRed(this.red),this.one=new le(1).toRed(this.red),this.two=new le(2).toRed(this.red),this.n=t.n&&new le(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 e=this.n&&this.p.div(this.n);!e||e.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Es=Yf;Yf.prototype.point=function(){throw new Error("Not implemented")};Yf.prototype.validate=function(){throw new Error("Not implemented")};Yf.prototype._fixedNafMul=function(t,e){Tu(t.precomputed);var n=t._getDoubles(),a=Ru(e,1,this._bitLength),f=(1<<n.step+1)-(n.step%2===0?2:1);f/=3;var c=[],y,b;for(y=0;y<a.length;y+=n.step){b=0;for(var w=y+n.step-1;w>=y;w--)b=(b<<1)+a[w];c.push(b)}for(var E=this.jpoint(null,null,null),M=this.jpoint(null,null,null),O=f;O>0;O--){for(y=0;y<c.length;y++)b=c[y],b===O?M=M.mixedAdd(n.points[y]):b===-O&&(M=M.mixedAdd(n.points[y].neg()));E=E.add(M)}return E.toP()};Yf.prototype._wnafMul=function(t,e){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var f=a.points,c=Ru(e,n,this._bitLength),y=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var w=0;b>=0&&c[b]===0;b--)w++;if(b>=0&&w++,y=y.dblp(w),b<0)break;var E=c[b];Tu(E!==0),t.type==="affine"?E>0?y=y.mixedAdd(f[E-1>>1]):y=y.mixedAdd(f[-E-1>>1].neg()):E>0?y=y.add(f[E-1>>1]):y=y.add(f[-E-1>>1].neg())}return t.type==="affine"?y.toP():y};Yf.prototype._wnafMulAdd=function(t,e,n,a,f){var c=this._wnafT1,y=this._wnafT2,b=this._wnafT3,w=0,E,M,O;for(E=0;E<a;E++){O=e[E];var F=O._getNAFPoints(t);c[E]=F.wnd,y[E]=F.points}for(E=a-1;E>=1;E-=2){var B=E-1,L=E;if(c[B]!==1||c[L]!==1){b[B]=Ru(n[B],c[B],this._bitLength),b[L]=Ru(n[L],c[L],this._bitLength),w=Math.max(b[B].length,w),w=Math.max(b[L].length,w);continue}var z=[e[B],null,null,e[L]];
12e[B].y.cmp(e[L].y)===0?(z[1]=e[B].add(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg())):e[B].y.cmp(e[L].y.redNeg())===0?(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].add(e[L].neg())):(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],V=t7(n[B],n[L]);for(w=Math.max(V[0].length,w),b[B]=new Array(w),b[L]=new Array(w),M=0;M<w;M++){var At=V[0][M]|0,St=V[1][M]|0;b[B][M]=q[(At+1)*3+(St+1)],b[L][M]=0,y[B]=z}}var Z=this.jpoint(null,null,null),Y=this._wnafT4;for(E=w;E>=0;E--){for(var Ct=0;E>=0;){var Tt=!0;for(M=0;M<a;M++)Y[M]=b[M][E]|0,Y[M]!==0&&(Tt=!1);if(!Tt)break;Ct++,E--}if(E>=0&&Ct++,Z=Z.dblp(Ct),E<0)break;for(M=0;M<a;M++){var Rt=Y[M];Rt!==0&&(Rt>0?O=y[M][Rt-1>>1]:Rt<0&&(O=y[M][-Rt-1>>1].neg()),O.type==="affine"?Z=Z.mixedAdd(O):Z=Z.add(O))}}for(E=0;E<a;E++)y[E]=null;return f?Z:Z.toP()};function Rn(r,t){this.curve=r,this.type=t,this.precomputed=null}Yf.BasePoint=Rn;Rn.prototype.eq=function(){throw new Error("Not implemented")};Rn.prototype.validate=function(){return this.curve.validate(this)};Yf.prototype.decodePoint=function(t,e){t=Xi.toArray(t,e);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?Tu(t[t.length-1]%2===0):t[0]===7&&Tu(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};Rn.prototype.encodeCompressed=function(t){return this.encode(t,!0)};Rn.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))};Rn.prototype.encode=function(t,e){return Xi.encode(this._encode(e),t)};Rn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this};Rn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1};Rn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,f=0;f<e;f+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}};Rn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),f=1;f<n;f++)e[f]=e[f-1].add(a);return{wnd:t,points:e}};Rn.prototype._getBeta=function(){return null};Rn.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var R1=N0(function(r){typeof Object.create=="function"?r.exports=function(e,n){
12n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,n){if(n){e.super_=n;var a=function(){};a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e}}}),e7=Xi.assert;function Tn(r){Es.call(this,"short",r),this.a=new le(r.a,16).toRed(this.red),this.b=new le(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}R1(Tn,Es);var r7=Tn;Tn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,n;if(t.beta)e=new le(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);e=a[0].cmp(a[1])<0?a[0]:a[1],e=e.toRed(this.red)}if(t.lambda)n=new le(t.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))===0?n=f[0]:(n=f[1],e7(this.g.mul(n).x.cmp(this.g.x.redMul(e))===0))}var c;return t.basis?c=t.basis.map(function(y){return{a:new le(y.a,16),b:new le(y.b,16)}}):c=this._getEndoBasis(n),{beta:e,lambda:n,basis:c}}};Tn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:le.mont(t),n=new le(2).toRed(e).redInvm(),a=n.redNeg(),f=new le(3).toRed(e).redNeg().redSqrt().redMul(n),c=a.redAdd(f).fromRed(),y=a.redSub(f).fromRed();return[c,y]};Tn.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),f=new le(1),c=new le(0),y=new le(0),b=new le(1),w,E,M,O,F,B,L,z=0,q,V;n.cmpn(0)!==0;){var At=a.div(n);q=a.sub(At.mul(n)),V=y.sub(At.mul(f));var St=b.sub(At.mul(c));if(!M&&q.cmp(e)<0)w=L.neg(),E=f,M=q.neg(),O=V;else if(M&&++z===2)break;L=q,a=n,n=q,y=f,f=V,b=c,c=St}F=q.neg(),B=V;var Z=M.sqr().add(O.sqr()),Y=F.sqr().add(B.sqr());return Y.cmp(Z)>=0&&(F=w,B=E),M.negative&&(M=M.neg(),O=O.neg()),F.negative&&(F=F.neg(),B=B.neg()),[{a:M,b:O},{a:F,b:B}]};Tn.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],a=e[1],f=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),y=f.mul(n.a),b=c.mul(a.a),w=f.mul(n.b),E=c.mul(a.b),M=t.sub(y).sub(b),O=w.add(E).neg();return{k1:M,k2:O}};Tn.prototype.pointFromX=function(t,e){t=new le(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)};Tn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,a=this.a.redMul(e),f=e.redSqr().redMul(e).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(f).cmpn(0)===0};Tn.prototype._endoWnafMulAdd=function(t,e,n){for(var a=this._endoWnafT1,f=this._endoWnafT2,c=0;c<t.length;c++){var y=this._endoSplit(e[c]),b=t[c],w=b._getBeta();y.k1.negative&&(y.k1.ineg(),b=b.neg(!0)),y.k2.negative&&(y.k2.ineg(),w=w.neg(!0)),a[c*2]=b,a[c*2+1]=w,f[c*2]=y.k1,f[c*2+1]=y.k2}for(var E=this._wnafMulAdd(1,a,f,c*2,n),M=0;M<c*2;M++)a[M]=null,f[M]=null;return E};function Zr(r,t,e,n){Es.BasePoint.call(this,r,"affine"),t===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new le(t,16),this.y=new le(e,16),n&&(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)}R1(Zr,Es.BasePoint);Tn.prototype.point=function(t,e,n){return new Zr(this,t,e,n)};Tn.prototype.pointFromJSON=function(t,e){return Zr.fromJSON(this,t,e)};Zr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,a=function(f){return n.point(f.x.redMul(n.endo.beta),f.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return e}};Zr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.prec
12omputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Zr.fromJSON=function(t,e,n){typeof e=="string"&&(e=JSON.parse(e));var a=t.point(e[0],e[1],n);if(!e[2])return a;function f(y){return t.point(y[0],y[1],n)}var c=e[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(f))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(f))}},a};Zr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Zr.prototype.isInfinity=function(){return this.inf};Zr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),a=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)};Zr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),a=t.redInvm(),f=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(a),c=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,y)};Zr.prototype.getX=function(){return this.x.fromRed()};Zr.prototype.getY=function(){return this.y.fromRed()};Zr.prototype.mul=function(t){return t=new le(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Zr.prototype.mulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f):this.curve._wnafMulAdd(1,a,f,2)};Zr.prototype.jmulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f,!0):this.curve._wnafMulAdd(1,a,f,2,!0)};Zr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Zr.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
12if(t&&this.precomputed){var n=this.precomputed,a=function(f){return f.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return e};Zr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function si(r,t,e,n){Es.BasePoint.call(this,r,"jacobian"),t===null&&e===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new le(0)):(this.x=new le(t,16),this.y=new le(e,16),this.z=new le(n,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}R1(si,Es.BasePoint);Tn.prototype.jpoint=function(t,e,n){return new si(this,t,e,n)};si.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),a=this.y.redMul(e).redMul(t);return this.curve.point(n,a)};si.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};si.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(e),f=t.x.redMul(n),c=this.y.redMul(e.redMul(t.z)),y=t.y.redMul(n.redMul(this.z)),b=a.redSub(f),w=c.redSub(y);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=b.redSqr(),M=E.redMul(b),O=a.redMul(E),F=w.redSqr().redIAdd(M).redISub(O).redISub(O),B=w.redMul(O.redISub(F)).redISub(c.redMul(M)),L=this.z.redMul(t.z).redMul(b);return this.curve.jpoint(F,B,L)};si.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,a=t.x.redMul(e),f=this.y,c=t.y.redMul(e).redMul(this.z),y=n.redSub(a),b=f.redSub(c);if(y.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=y.redSqr(),E=w.redMul(y),M=n.redMul(w),O=b.redSqr().redIAdd(E).redISub(M).redISub(M),F=b.redMul(M.redISub(O)).redISub(f.redMul(E)),B=this.z.redMul(y);return this.curve.jpoint(O,F,B)};si.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var a=this.curve.a,f=this.curve.tinv,c=this.x,y=this.y,b=this.z,w=b.redSqr().redSqr(),E=y.redAdd(y);for(e=0;e<t;e++){var M=c.redSqr(),O=E.redSqr(),F=O.redSqr(),B=M.redAdd(M).redIAdd(M).redIAdd(a.redMul(w)),L=c.redMul(O),z=B.redSqr().redISub(L.redAdd(L)),q=L.redISub(z),V=B.redMul(q);V=V.redIAdd(V).redISub(F);var At=E.redMul(b);e+1<t&&(w=w.redMul(F)),c=z,b=At,E=V}return this.curve.jpoint(c,E.redMul(f),b)};si.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};si.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a),w=b.redSqr().redISub(y).redISub(y),E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),t=w,e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),O=this.y.redSqr(),F=O.redSqr(),B=this.x.redAdd(O).redSqr().redISub(M).redISub(F);B=B.redIAdd(B);var L=M.redAdd(M).redIAdd(M),z=L.redSqr(),q=F.redIAdd(F);q=q.redIAdd(q),q=q.redIAdd(q),t=z.redISub(B).redISub(B),e=L.redMul(B.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,e,n)};si.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),w=b.redSqr().redISub(y).redISub(y);t=w;var E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),O=this.y.redSqr(),F=this.x.redMul(O),B=this.x.redSub(M).redMul(this.x.redAdd(M));B=B.redAdd(B).redIAdd(B);var L=F.redIAdd(F);L=L.redIAdd(L);var z=L.redAdd(L);t=B.redSqr().redISub(z),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(M);var q=O.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),e=B.redMul(L.redISub(t)).redISub(q)}return this.curve.jpoint(t,e,n)};si.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,a=this.z,f=a.redSqr().redSqr(),c=e.redSqr(),y=n.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(f)),w=e.redAdd(e);w=w.redIAdd(w);var E=w.redMul(y),M=b.redSqr().redISub(E.redAdd(E)),O=E.redISub(M),F=y.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=b.redMul(O).redISub(F),L=n.redAdd(n).redMul(a);return this.curve.jpoint(M,B,L)};si.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),a=e.redSqr(),f=t.redAdd(t).redIAdd(t),
12c=f.redSqr(),y=this.x.redAdd(e).redSqr().redISub(t).redISub(a);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(c);var b=y.redSqr(),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=f.redIAdd(y).redSqr().redISub(c).redISub(b).redISub(w),M=e.redMul(E);M=M.redIAdd(M),M=M.redIAdd(M);var O=this.x.redMul(b).redISub(M);O=O.redIAdd(O),O=O.redIAdd(O);var F=this.y.redMul(E.redMul(w.redISub(E)).redISub(y.redMul(b)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=this.z.redAdd(y).redSqr().redISub(n).redISub(b);return this.curve.jpoint(O,F,B)};si.prototype.mul=function(t,e){return t=new le(t,e),this.curve._wnafMul(this,t)};si.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var a=e.redMul(this.z),f=n.redMul(t.z);return this.y.redMul(f).redISub(t.y.redMul(a)).cmpn(0)===0};si.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(n)===0)return!0;for(var a=t.clone(),f=this.curve.redN.redMul(e);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(f),this.x.cmp(n)===0)return!0}};si.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};si.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Wh=N0(function(r,t){var e=t;e.base=Es,e.short=r7,e.mont=null,e.edwards=null}),Jh=N0(function(r,t){var e=t,n=Xi.assert;function a(y){y.type==="short"?this.curve=new Wh.short(y):y.type==="edwards"?this.curve=new Wh.edwards(y):this.curve=new Wh.mont(y),this.g=this.curve.g,this.n=this.curve.n,this.hash=y.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function f(y,b){Object.defineProperty(e,y,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,y,{configurable:!0,enumerable:!0,value:w}),w}})}f("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:oe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:oe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:oe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:oe.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"]}),f("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:oe.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oe.sha256,gRed:!1,g:["9"]}),f("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:oe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}f("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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
12,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Vf(r){if(!(this instanceof Vf))return new Vf(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=yo.toArray(r.entropy,r.entropyEnc||"hex"),e=yo.toArray(r.nonce,r.nonceEnc||"hex"),n=yo.toArray(r.pers,r.persEnc||"hex");I1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,e,n)}var Zw=Vf;Vf.prototype._init=function(t,e,n){var a=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656};Vf.prototype._hmac=function(){return new oe.hmac(this.hash,this.K)};Vf.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};Vf.prototype.reseed=function(t,e,n,a){typeof e!="string"&&(a=n,n=e,e=null),t=yo.toArray(t,e),n=yo.toArray(n,a),I1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};Vf.prototype.generate=function(t,e,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(a=n,n=e,e=null),n&&(n=yo.toArray(n,a||"hex"),this._update(n));for(var f=[];f.length<t;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,t);return this._update(n),this._reseed++,yo.encode(c,e)};var Jd=Xi.assert;function xi(r,t){this.ec=r,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var T1=xi;xi.fromPublic=function(t,e,n){return e instanceof xi?e:new xi(t,{pub:e,pubEnc:n})};xi.fromPrivate=function(t,e,n){return e instanceof xi?e:new xi(t,{priv:e,privEnc:n})};xi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}};xi.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub};xi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};xi.prototype._importPrivate=function(t,e){this.priv=new le(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)};xi.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?Jd(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Jd(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)};xi.prototype.derive=function(t){return t.validate()||Jd(t.validate(),"public point not validated"),t.mul(this.priv).getX()};xi.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)};xi.prototype.verify=function(t,e){return this.ec.verify(t,e,this)};xi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var i7=Xi.assert;function yl(r,t){if(r instanceof yl)return r;this._importDER(r,t)||(i7(r.r&&r.s,"Signature without r or s"),this.r=new le(r.r,16),this.s=new le(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var bl=yl;function n7(){this.place=0}function Uc(r,t){var e=r[t.place++];if(!(e&128))return e;var n=e&15;if(n===0||n>4)return!1;for(var a=0,f=0,c=t.place;f<n;f++,c++)a<<=8,a|=r[c],a>>>=0;return a<=127?!1:(t.place=c,a)}function ix(r){for(var t=0,e=r.length-1;!r[t]&&!(r[t+1]&128)&&t<e;)t++;return t===0?r:r.slice(t)}yl.prototype._importDER=function(t,e){t=Xi.toArray(t,e);var n=new n7;if(t[n.place++]!==48)return!1;var a=Uc(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var f=Uc(t,n);if(f===!1)return!1;var c=t.slice(n.place,f+n.place);if(n.place+=f,t[n.place++]!==2)return!1;var y=Uc(t,n);if(y===!1||t.length!==y+n.place)return!1;var b=t.slice(n.place,y+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new le(c),this.s=new le(b),this.recoveryParam=null,!0};function Fc(r,t){if(t<128){r.push(t);return}var e=1+(Math.log(t)/Math.LN2>>>3);for(r.push(e|128);--e;)r.push(t>>>(e<<3)&255);r.push(t)}yl.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();
12for(e[0]&128&&(e=[0].concat(e)),n[0]&128&&(n=[0].concat(n)),e=ix(e),n=ix(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];Fc(a,e.length),a=a.concat(e),a.push(2),Fc(a,n.length);var f=a.concat(n),c=[48];return Fc(c,f.length),c=c.concat(f),Xi.encode(c,t)};var o7=function(){throw new Error("unsupported")},Qw=Xi.assert;function bn(r){if(!(this instanceof bn))return new bn(r);typeof r=="string"&&(Qw(Object.prototype.hasOwnProperty.call(Jh,r),"Unknown curve "+r),r=Jh[r]),r instanceof Jh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var f7=bn;bn.prototype.keyPair=function(t){return new T1(this,t)};bn.prototype.keyFromPrivate=function(t,e){return T1.fromPrivate(this,t,e)};bn.prototype.keyFromPublic=function(t,e){return T1.fromPublic(this,t,e)};bn.prototype.genKeyPair=function(t){t||(t={});for(var e=new Zw({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||o7(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new le(2));;){var f=new le(e.generate(n));if(!(f.cmp(a)>0))return f.iaddn(1),this.keyFromPrivate(f)}};bn.prototype._truncateToN=function(t,e){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t};bn.prototype.sign=function(t,e,n,a){typeof n=="object"&&(a=n,n=null),a||(a={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new le(t,16));for(var f=this.n.byteLength(),c=e.getPrivate().toArray("be",f),y=t.toArray("be",f),b=new Zw({hash:this.hash,entropy:c,nonce:y,pers:a.pers,persEnc:a.persEnc||"utf8"}),w=this.n.sub(new le(1)),E=0;;E++){var M=a.k?a.k(E):new le(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(w)>=0)){var O=this.g.mul(M);if(!O.isInfinity()){var F=O.getX(),B=F.umod(this.n);if(B.cmpn(0)!==0){var L=M.invm(this.n).mul(B.mul(e.getPrivate()).iadd(t));if(L=L.umod(this.n),L.cmpn(0)!==0){var z=(O.getY().isOdd()?1:0)|(F.cmp(B)!==0?2:0);return a.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),z^=1),new bl({r:B,s:L,recoveryParam:z})}}}}}};bn.prototype.verify=function(t,e,n,a){t=this._truncateToN(new le(t,16)),n=this.keyFromPublic(n,a),e=new bl(e,"hex");var f=e.r,c=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var y=c.invm(this.n),b=y.mul(t).umod(this.n),w=y.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)};bn.prototype.recoverPubKey=function(r,t,e,n){Qw((3&e)===e,"The recovery param is more than two bits"),t=new bl(t,n);var a=this.n,f=new le(r),c=t.r,y=t.s,b=e&1,w=e>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var E=t.r.invm(a),M=a.sub(f).mul(E).umod(a),O=y.mul(E).umod(a);return this.g.mulAdd(M,c,O)};bn.prototype.getKeyRecoveryParam=function(r,t,e,n){if(t=new bl(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var f;try{f=this.recoverPubKey(r,t,a)}catch{continue}if(f.eq(e))return a}throw new Error("Unable to find valid recovery factor")};var s7=N0(function(r,t){var e=t;e.version="6.5.4",e.utils=Xi,e.rand=function(){throw new Error("unsupported")},e.curve=Wh,e.curves=Jh,e.ec=f7,e.eddsa=null}),a7=s7.ec;const h7="signing-key/5.7.0",Vd=new nr(h7);let Dc=null;function Sf(){return Dc||(Dc=new a7("secp256k1")),Dc}let u7=class{constructor(t){k0(this,"curve","secp256k1"),k0(this,"privateKey",Ze(t)),Hw(this.privateKey)!==32&&Vd.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=Sf().keyFromPrivate(er(this.privateKey));k0(this,"publicKey","0x"+e.getPublic(!1,"hex")),k0(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),k0(this,"_isSigningKey",!0)}_addPoint(t){const e=Sf().keyFromPublic(er(this.publicKey)),n=Sf().keyFromPublic(er(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}
12signDigest(t){const e=Sf().keyFromPrivate(er(this.privateKey)),n=er(t);n.length!==32&&Vd.throwArgumentError("bad digest length","digest",t);const a=e.sign(n,{canonical:!0});return Ka({recoveryParam:a.recoveryParam,r:Lo("0x"+a.r.toString(16),32),s:Lo("0x"+a.s.toString(16),32)})}computeSharedSecret(t){const e=Sf().keyFromPrivate(er(this.privateKey)),n=Sf().keyFromPublic(er(Yw(t)));return Lo("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}};function l7(r,t){const e=Ka(t),n={r:er(e.r),s:er(e.s)};return"0x"+Sf().recoverPubKey(er(r),n,e.recoveryParam).encode("hex",!1)}function Yw(r,t){const e=er(r);return e.length===32?new u7(e).publicKey:e.length===33?"0x"+Sf().keyFromPublic(e).getPublic(!1,"hex"):e.length===65?Ze(e):Vd.throwArgumentError("invalid public or private key","key","[REDACTED]")}const c7="transactions/5.4.0",di=new nr(c7);var Pu;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(Pu||(Pu={}));function P1(r){return r==="0x"?null:Ha(r)}function ui(r){return r==="0x"?X_:$o.from(r)}const d7=[{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"}],p7={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function C1(r){const t=Yw(r);return Ha(Vv(gs(Vv(t,1)),12))}function wl(r,t){return C1(l7(er(r),t))}function zi(r,t){const e=Ff($o.from(r).toHexString());return e.length>32&&di.throwArgumentError("invalid length for "+t,"transaction:"+t,r),e}function Lc(r,t){return{address:Ha(r),storageKeys:(t||[]).map((e,n)=>(Hw(e)!==32&&di.throwArgumentError("invalid access list storageKey",`accessList[${r}:${n}]`,e),e.toLowerCase()))}}function Wa(r){if(Array.isArray(r))return r.map((e,n)=>Array.isArray(e)?(e.length>2&&di.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,e),Lc(e[0],e[1])):Lc(e.address,e.storageKeys));const t=Object.keys(r).map(e=>{const n=r[e].reduce((a,f)=>(a[f]=!0,a),{});return Lc(e,Object.keys(n).sort())});return t.sort((e,n)=>e.address.localeCompare(n.address)),t}function t3(r){return Wa(r).map(t=>[t.address,t.storageKeys])}function e3(r,t){if(r.gasPrice!=null){const n=$o.from(r.gasPrice),a=$o.from(r.maxFeePerGas||0);n.eq(a)||di.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:a})}const e=[zi(r.chainId||0,"chainId"),zi(r.nonce||0,"nonce"),zi(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),zi(r.maxFeePerGas||0,"maxFeePerGas"),zi(r.gasLimit||0,"gasLimit"),r.to!=null?Ha(r.to):"0x",zi(r.value||0,"value"),r.data||"0x",t3(r.accessList||[])];if(t){const n=Ka(t);e.push(zi(n.recoveryParam,"recoveryParam")),e.push(Ff(n.r)),e.push(Ff(n.s))}return Ww(["0x02",_a(e)])}function r3(r,t){const e=[zi(r.chainId||0,"chainId"),zi(r.nonce||0,"nonce"),zi(r.gasPrice||0,"gasPrice"),zi(r.gasLimit||0,"gasLimit"),r.to!=null?Ha(r.to):"0x",zi(r.value||0,"value"),r.data||"0x",t3(r.accessList||[])];if(t){const n=Ka(t);e.push(zi(n.recoveryParam,"recoveryParam")),e.push(Ff(n.r)),e.push(Ff(n.s))}return Ww(["0x01",_a(e)])}function g7(r,t){Q_(r,p7);const e=[];d7.forEach(function(c){let y=r[c.name]||[];const b={};c.numeric&&(b.hexPad="left"),y=er(Ze(y,b)),c.length&&y.length!==c.length&&y.length>0&&di.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,y),c.maxLength&&(y=Ff(y),y.length>c.maxLength&&di.throwArgumentError("invalid length for "+c.name,"transaction:"+c.name,y)),e.push(Ze(y))});let n=0;if(r.chainId!=null?(n=r.chainId,typeof n!="number"&&di.throwArgumentError("invalid transaction.chainId","transaction",r)):t&&!M1(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),n!==0&&(e.push(Ze(n)),e.push("0x"),e.push("0x")),!t)return _a(e);const a=Ka(t);let f=27+a.recoveryParam;return n!==0?(e.pop(),e.pop(),e.pop(),f+=n*2+8,a.v>28&&a.v!==f&&di.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):a.v!==f&&di.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),e.push(Ze(f)),e.push(Ff(er(a.r))),e.push(Ff(er(a.s))),_a(e)}function i3(r,t){if(r.type==null||r.type===0)return r.accessList!=null&&di.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",r),g7(r,t);switch(r.type){case 1:return r3(r,t);case 2:return e3(r,t)}return di.throwError(`unsupported transaction type: ${r.type}`,nr.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:r.type})}function n3(r,t,e){try{const n=ui(t[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");r.v=n}catch{di.throwArgumentError("invalid v for transaction type: 1","v",t[0])}r.r=Lo(t[1],32),r.s=Lo(t[2],32);try{const n=gs(e(r));r.from=wl(n,{r:r.r,s:r.s,recoveryParam:r.v})}catch(n){}}function m7(r){const t=_1(r.slice(1));t.length!==9&&t.length!==12&&di.throwArgumentError("invalid component count for transaction type: 2","payload",Ze(r));const e=ui(t[2]),n=ui(t[3]),a={type:2,chainId:ui(t[0]).toNumber(),nonce:ui(t[1]).toNumber(),maxPriorityFeePerGas:e,maxFeePerGas:n,gasPrice:null,gasLimit:ui(t[4]),to:P1(t[5]),value:ui(t[6]),data:t[7],accessList:Wa(t[8])};return t.length===9||(a.hash=gs(r),n3(a,t.slice(9),e3)),a}function v7(r){const t=_1(r.slice(1));t.length!==8&&t.length!==11&&di.throwArgumentError("invalid component count for transaction type: 1","payload",Ze(r));const e={type:1,chainId:ui(t[0]).toNumber(),nonce:ui(t[1]).toNumber(),gasPrice:ui(t[2]),gasLimit:ui(t[3]),to:P1(t[4]),value:ui(t[5]),data:t[6],accessList:Wa(t[7])};return t.length===8||(e.hash=gs(r),n3(e,t.slice(8),r3)),e}function x7(r){const t=_1(r);t.length!==9&&t.length!==6&&di.throwArgumentError("invalid raw transaction","rawTransaction",r);const e={nonce:ui(t[0]).toNumber(),gasPrice:ui(t[1]),gasLimit:ui(t[2]),to:P1(t[3]),value:ui(t[4]),data:t[5],chainId:0};if(t.length===6)return e;try{e.v=$o.from(t[6]).toNumber()}catch(n){return e}if(e.r=Lo(t[7],32),e.s=Lo(t[8],32),$o.from(e.r).isZero()&&$o.from(e.s).isZero())e.chainId=e.v,e.v=0;else{e.chainId=Math.floor((e.v-35)/2),e.chainId<0&&(e.chainId=0);let n=e.v-27;const a=t.slice(0,6);e.chainId!==0&&(a.push(Ze(e.chainId)),a.push("0x"),a.push("0x"),n-=e.chainId*2+8);const f=gs(_a(a));try{e.from=wl(f,{r:Ze(e.r),s:Ze(e.s),recoveryParam:n})}catch(c){}e.hash=gs(r)}return e.type=null,e}function o3(r){const t=er(r);if(t[0]>127)return x7(t);switch(t[0]){case 1:return v7(t);case 2:return m7(t)}return di.throwError(`unsupported transaction type: ${t[0]}`,nr.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}const RT=Object.freeze(Object.defineProperty({__proto__:null,get TransactionTypes(){return Pu},accessListify:Wa,computeAddress:C1,parse:o3,recoverAddress:wl,serialize:i3},Symbol.toStringTag,{value:"Module"})),y7="units/5.4.0",f3=new _t(y7),s3=["wei","kwei","mwei","gwei","szabo","finney","ether"];function a3(r){const t=String(r).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||r==="."||r==="-.")&&f3.throwArgumentError("invalid value","value",r);let e=t[0],n="";for(e.substring(0,1)==="-"&&(n="-",e=e.substring(1));e.substring(0,1)==="0";)e=e.substring(1);e===""&&(e="0");let a="";for(t.length===2&&(a="."+(t[1]||"0"));a.length>2&&a[a.length-1]==="0";)a=a.substring(0,a.length-1);const f=[];for(;e.length;)if(e.length<=3){f.unshift(e);break}else{const c=e.length-3;f.unshift(e.substring(c)),e=e.substring(0,c)}return n+f.join(",")+a}function O1(r,t){if(typeof t=="string"){const e=s3.indexOf(t);e!==-1&&(t=3*e)}return ch(r,t??18)}function k1(r,t){if(typeof r!="string"&&f3.throwArgumentError("value must be a string","value",r),typeof t=="string"){const e=s3.indexOf(t);e!==-1&&(t=3*e)}return Ao(r,t??18)}function h3(r){return O1(r,18)}function u3(r){return k1(r,18)}const TT=Object.freeze(Object.defineProperty({__proto__:null,commify:a3,formatEther:h3,formatUnits:O1,parseEther:u3,parseUnits:k1},Symbol.toStringTag,{value:"Module"})),b7="abstract-provider/5.7.0";var w7=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const E7=new _t(b7);let A7=class extends Wi{static isForkEvent(t){return!!(t&&t._isForkEvent)}},B1=class l3{constructor(){E7.checkAbstract(new.target,l3),Pt(this,"_isProvider",!0)}getFeeData(){return w7(this,void 0,void 0,function*(){const{block:t,gasPrice:e}=yield gr({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(c=>null)});let n=null,a=null,f=null;return t&&t.baseFeePerGas&&(n=t.baseFeePerGas,f=zt.from("1500000000"),a=t.baseFeePerGas.mul(2).add(f)),{lastBaseFeePerGas:n,maxFeePerGas:a,maxPriorityFeePerGas:f,gasPrice:e}})}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!!(t&&t._isProvider)}};const M7="abstract-signer/5.7.0";var kn=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const sn=new _t(M7),N7=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","
12nonce","to","type","value"],_7=[_t.errors.INSUFFICIENT_FUNDS,_t.errors.NONCE_EXPIRED,_t.errors.REPLACEMENT_UNDERPRICED];let El=class c3{constructor(){sn.checkAbstract(new.target,c3),Pt(this,"_isSigner",!0)}getBalance(t){return kn(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)})}getTransactionCount(t){return kn(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)})}estimateGas(t){return kn(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const e=yield gr(this.checkTransaction(t));return yield this.provider.estimateGas(e)})}call(t,e){return kn(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield gr(this.checkTransaction(t));return yield this.provider.call(n,e)})}sendTransaction(t){return kn(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)})}getChainId(){return kn(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return kn(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return kn(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(t){return kn(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)})}checkTransaction(t){for(const n in t)N7.indexOf(n)===-1&&sn.throwArgumentError("invalid transaction key: "+n,"transaction",t);const e=Jr(t);return e.from==null?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&sn.throwArgumentError("from address mismatch","transaction",t),n[0])),e}populateTransaction(t){return kn(this,void 0,void 0,function*(){const e=yield gr(this.checkTransaction(t));e.to!=null&&(e.to=Promise.resolve(e.to).then(a=>kn(this,void 0,void 0,function*(){if(a==null)return null;const f=yield this.resolveName(a);return f==null&&sn.throwArgumentError("provided ENS name resolves to null","tx.to",a),f})),e.to.catch(a=>{}));const n=e.maxFeePerGas!=null||e.maxPriorityFeePerGas!=null;if(e.gasPrice!=null&&(e.type===2||n)?sn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t):(e.type===0||e.type===1)&&n&&sn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t),(e.type===2||e.type==null)&&e.maxFeePerGas!=null&&e.maxPriorityFeePerGas!=null)e.type=2;else if(e.type===0||e.type===1)e.gasPrice==null&&(e.gasPrice=this.getGasPrice());else{const a=yield this.getFeeData();if(e.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(e.type=2,e.gasPrice!=null){const f=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=f,e.maxPriorityFeePerGas=f}else e.maxFeePerGas==null&&(e.maxFeePerGas=a.maxFeePerGas),e.maxPriorityFeePerGas==null&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(n&&sn.throwError("network does not support EIP-1559",_t.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),e.gasPrice==null&&(e.gasPrice=a.gasPrice),e.type=0):sn.throwError("failed to get consistent fee data",_t.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else e.type===2&&(e.maxFeePerGas==null&&(e.maxFeePerGas=a.maxFeePerGas),e.maxPriorityFeePerGas==null&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return e.nonce==null&&(e.nonce=this.getTransactionCount("pending")),e.gasLimit==null&&(e.gasLimit=this.estimateGas(e).catch(a=>{if(_7.indexOf(a.code)>=0)throw a;return sn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",_t.errors.UNPREDICTABLE_GAS_LIMIT,{error:a,tx:e})})),e.chainId==null?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then(a=>(a[1]!==0&&a[0]!==a[1]&&sn.throwArgumentError("chainId address mismatch","transaction",t),a[0])),yield gr(e)})}_checkProvider(t){this.provider||sn.throwError("missing provider",_t.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!!(t&&t._isSigner)}};
12class U1 extends El{constructor(t,e){super(),Pt(this,"address",t),Pt(this,"provider",e||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,e){return Promise.resolve().then(()=>{sn.throwError(t,_t.errors.UNSUPPORTED_OPERATION,{operation:e})})}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,e,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new U1(this.address,t)}}const d3="json-wallets/5.7.0";function us(r){return typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),kt(r)}function B0(r,t){for(r=String(r);r.length<t;)r="0"+r;return r}function F1(r){return typeof r=="string"?cr(r,cf.NFKC):kt(r)}function vr(r,t){let e=r;const n=t.toLowerCase().split("/");for(let a=0;a<n.length;a++){let f=null;for(const c in e)if(c.toLowerCase()===n[a]){f=e[c];break}if(f===null)return null;e=f}return e}function S7(r){const t=kt(r);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const e=Ut(t);return[e.substring(2,10),e.substring(10,14),e.substring(14,18),e.substring(18,22),e.substring(22,34)].join("-")}const I7=new _t(d3);class R7 extends Wi{isCrowdsaleAccount(t){return!!(t&&t._isCrowdsaleAccount)}}function p3(r,t){const e=JSON.parse(r);t=F1(t);const n=je(vr(e,"ethaddr")),a=us(vr(e,"encseed"));(!a||a.length%16!==0)&&I7.throwArgumentError("invalid encseed","json",r);const f=kt($a(t,t,2e3,32,"sha256")).slice(0,16),c=a.slice(0,16),y=a.slice(16),b=new Mr.ModeOfOperation.cbc(f,c),w=Mr.padding.pkcs7.strip(kt(b.decrypt(y)));let E="";for(let F=0;F<w.length;F++)E+=String.fromCharCode(w[F]);const M=cr(E),O=Je(M);return new R7({_isCrowdsaleAccount:!0,address:n,privateKey:O})}function g3(r){let t=null;try{t=JSON.parse(r)}catch{return!1}return t.encseed&&t.ethaddr}function m3(r){let t=null;try{t=JSON.parse(r)}catch{return!1}return!(!t.version||parseInt(t.version)!==t.version||parseInt(t.version)!==3)}var T7=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const jd=new _t(d3);function nx(r){return r!=null&&r.mnemonic&&r.mnemonic.phrase}class P7 extends Wi{isKeystoreAccount(t){return!!(t&&t._isKeystoreAccount)}}function C7(r,t,e){if(vr(r,"crypto/cipher")==="aes-128-ctr"){const a=us(vr(r,"crypto/cipherparams/iv")),f=new Mr.Counter(a),c=new Mr.ModeOfOperation.ctr(t,f);return kt(c.decrypt(e))}return null}function v3(r,t){const e=us(vr(r,"crypto/ciphertext"));if(Ut(Je(Ve([t.slice(16,32),e]))).substring(2)!==vr(r,"crypto/mac").toLowerCase())throw new Error("invalid password");const a=C7(r,t.slice(0,16),e);a||jd.throwError("unsupported cipher",_t.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const f=t.slice(32,64),c=uf(a);if(r.address){let b=r.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),je(b)!==c)throw new Error("address mismatch")}const y={_isKeystoreAccount:!0,address:c,privateKey:Ut(a)};if(vr(r,"x-ethers/version")==="0.1"){const b=us(vr(r,"x-ethers/mnemonicCiphertext")),w=us(vr(r,"x-ethers/mnemonicCounter")),E=new Mr.Counter(w),M=new Mr.ModeOfOperation.ctr(f,E),O=vr(r,"x-ethers/path")||Hf,F=vr(r,"x-ethers/locale")||"en",B=kt(M.decrypt(b));try{const L=hl(B,F),z=ki.fromMnemonic(L,null,F).derivePath(O);if(z.privateKey!=y.privateKey)throw new Error("mnemonic mismatch");y.mnemonic=z.mnemonic}catch(L){if(L.code!==_t.errors.INVALID_ARGUMENT||L.argument!=="wordlist")throw L}}return new P7(y)}function x3(r,t,e,n,a){return kt($a(r,t,e,n,a))}function O7(r,t,e,n,a){return Promise.resolve(x3(r,t,e,n,a))}function y3(r,t,e,n,a){const f=F1(t),c=vr(r,"crypto/kdf");if(c&&typeof c=="string"){const y=function(b,w){return jd.throwArgumentError("invalid key-derivation function parameters",b,w)};if(c.toLowerCase()==="scrypt"){const b=us(vr(r,"crypto/kdfparams/salt")),w=parseInt(vr(r,"crypto/kdfparams/n")),E=parseInt(vr(r,"crypto/kdfparams/r")),M=parseInt(vr(r,"crypto/kdfparams/p"));(!w||!E||!M)&&y("kdf",c),w&w-1&&y("N",w);const O=parseInt(vr(r,"crypto/kdfparams/dklen"));return O!==32&&y("dklen",O),n(f,b,w,E,M,64,a)}else if(c.toLowerCase()==="pbkdf2"){const b=us(vr(r,"crypto/kdfparams/salt"));let w=null;const E=vr(r,"crypto/kdfparams/prf");E==="hmac-sha256"?w="sha256":E==="hmac-sha512"?w="sha512":y("prf",E);const M=parseInt(vr(r,"crypto/kdfparams/c")),O=parseInt(vr(r,"crypto/kdfparams/dklen"));return O!==32&&y("dklen",O),e(f,b,M,O,w)}}return jd.throwArgumentError("unsupported key-derivation function","kdf",c)}function k7(r,t){const e=JSON.parse(r),n=y3(e,t,x3,w0.syncScrypt);return v3(e,n)}function B7(r,t,e){return T7(this,void 0,void 0,function*(){const n=JSON.parse(r),a=yield y3(n,t,O7,w0.scrypt,e);return v3(n,a)})}function U7(r,t,e,n){try{if(je(r.address)!==uf(r.privateKey))throw new Error("address/privateKey mismatch");if(nx(r)){const z=r.mnemonic;if(ki.fromMnemonic(z.phrase,null,z.locale).derivePath(z.path||Hf).privateKey!=r.privateKey)throw new Error("mnemonic mismatch")}}catch(z){return Promise.reject(z)}typeof e=="function"&&!n&&(n=e,e={}),e||(e={});const a=kt(r.privateKey),f=F1(t);let c=null,y=null,b=null;if(nx(r)){const z=r.mnemonic;c=kt(f1(z.phrase,z.locale||"en")),y=z.path||Hf,b=z.locale||"en"}let w=e.client;w||(w="ethers.js");let E=null;e.salt?E=kt(e.salt):E=of(32);let M=null;if(e.iv){if(M=kt(e.iv),M.length!==16)throw new Error("invalid iv")}else M=of(16);let O=null;if(e.uuid){if(O=kt(e.uuid),O.length!==16)throw new Error("invalid uuid")}else O=of(16);let F=1<<17,B=8,L=1;return e.scrypt&&(e.scrypt.N&&(F=e.scrypt.N),e.scrypt.r&&(B=e.scrypt.r),e.scrypt.p&&(L=e.scrypt.p)),w0.scrypt(f,E,F,B,L,64,n).then(z=>{z=kt(z);const q=z.slice(0,16),V=z.slice(16,32),At=z.slice(32,64),St=new Mr.Counter(M),Z=new Mr.ModeOfOperation.ctr(q,St),Y=kt(Z.encrypt
12(a)),Ct=Je(Ve([V,Y])),Tt={address:r.address.substring(2).toLowerCase(),id:S7(O),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ut(M).substring(2)},ciphertext:Ut(Y).substring(2),kdf:"scrypt",kdfparams:{salt:Ut(E).substring(2),n:F,dklen:32,p:L,r:B},mac:Ct.substring(2)}};if(c){const Rt=of(16),Dt=new Mr.Counter(Rt),I=new Mr.ModeOfOperation.ctr(At,Dt),N=kt(I.encrypt(c)),d=new Date,i=d.getUTCFullYear()+"-"+B0(d.getUTCMonth()+1,2)+"-"+B0(d.getUTCDate(),2)+"T"+B0(d.getUTCHours(),2)+"-"+B0(d.getUTCMinutes(),2)+"-"+B0(d.getUTCSeconds(),2)+".0Z";Tt["x-ethers"]={client:w,gethFilename:"UTC--"+i+"--"+Tt.address,mnemonicCounter:Ut(Rt).substring(2),mnemonicCiphertext:Ut(N).substring(2),path:y,locale:b,version:"0.1"}}return JSON.stringify(Tt)})}function F7(r,t,e){if(g3(r)){e&&e(0);const n=p3(r,t);return e&&e(1),Promise.resolve(n)}return m3(r)?B7(r,t,e):Promise.reject(new Error("invalid JSON wallet"))}function D7(r,t){if(g3(r))return p3(r,t);if(m3(r))return k7(r,t);throw new Error("invalid JSON wallet")}const L7="wallet/5.4.0";var ox=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const rs=new _t(L7);function $7(r){return r!=null&&xe(r.privateKey,32)&&r.address!=null}function G7(r){const t=r.mnemonic;return t&&t.phrase}class If extends El{constructor(t,e){if(rs.checkNew(new.target,If),super(),$7(t)){const n=new Xs(t.privateKey);if(Pt(this,"_signingKey",()=>n),Pt(this,"address",uf(this.publicKey)),this.address!==je(t.address)&&rs.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),G7(t)){const a=t.mnemonic;Pt(this,"_mnemonic",()=>({phrase:a.phrase,path:a.path||Hf,locale:a.locale||"en"}));const f=this.mnemonic,c=ki.fromMnemonic(f.phrase,null,f.locale).derivePath(f.path);uf(c.privateKey)!==this.address&&rs.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else Pt(this,"_mnemonic",()=>null)}else{if(Xs.isSigningKey(t))t.curve!=="secp256k1"&&rs.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Pt(this,"_signingKey",()=>t);else{typeof t=="string"&&t.match(/^[0-9a-f]*$/i)&&t.length===64&&(t="0x"+t);const n=new Xs(t);Pt(this,"_signingKey",()=>n)}Pt(this,"_mnemonic",()=>null),Pt(this,"address",uf(this.publicKey))}e&&!B1.isProvider(e)&&rs.throwArgumentError("invalid provider","provider",e),Pt(this,"provider",e||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(t){return new If(this,t)}signTransaction(t){return gr(t).then(e=>{e.from!=null&&(je(e.from)!==this.address&&rs.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete e.from);const n=this._signingKey().signDigest(Je(Gm(e)));return Gm(e,n)})}signMessage(t){return ox(this,void 0,void 0,function*(){return sg(this._signingKey().signDigest(vy(t)))})}_signTypedData(t,e,n){return ox(this,void 0,void 0,function*(){const a=yield da.resolveNames(t,e,n,f=>(this.provider==null&&rs.throwError("cannot resolve ENS names without a provider",_t.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:f}),this.provider.resolveName(f)));return sg(this._signingKey().signDigest(da.hash(a.domain,e,a.value)))})}encrypt(t,e,n){if(typeof e=="function"&&!n&&(n=e,e={}),n&&typeof n!="function")throw new Error("invalid callback");return e||(e={}),U7(this,t,e,n)}static createRandom(t){let e=of(16);t||(t={}),t.extraEntropy&&(e=kt(Ar(Je(Ve([e,t.extraEntropy])),0,16)));const n=hl(e,t.locale);return If.fromMnemonic(n,t.path,t.locale)}static fromEncryptedJson(t,e,n){return F7(t,e,n).then(a=>new If(a))}static fromEncryptedJsonSync(t,e){return new If(D7(t,e))}static fromMnemonic(t,e,n){return e||(e=Hf),new If(ki.fromMnemonic(t,null,n).derivePath(e))}}function b3(r,t){return al(vy(r),t)}function w3(r,t,e,n){return al(da.hash(r,t,e),n)}const CT=Object.freeze(Object.defineProperty({__proto__:null,Wallet:If,verifyMessage:b3,verifyTypedData:w3},Symbol.toStringTag,{value:"Module"})),z7="logger/5.7.0";let fx=!1,sx=!1;const Vh={debug:1,default:2,info:2,warning:3,error:4,off:5};let ax=Vh.default,$c=null;function q7(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const hx=q7();var Xd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Xd||(Xd={}));var ao;
12(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(ao||(ao={}));const ux="0123456789abcdef";let cn=class zr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Vh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(ax>Vh[n])&&console.log.apply(console,e)}debug(...t){this._log(zr.levels.DEBUG,t)}info(...t){this._log(zr.levels.INFO,t)}warn(...t){this._log(zr.levels.WARNING,t)}makeError(t,e,n){if(sx)return this.makeError("censored error",e,{});e||(e=zr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=ux[w[M]>>4],E+=ux[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case ao.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case ao.CALL_EXCEPTION:case ao.INSUFFICIENT_FUNDS:case ao.MISSING_NEW:case ao.NONCE_EXPIRED:case ao.REPLACEMENT_UNDERPRICED:case ao.TRANSACTION_REPLACED:case ao.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,zr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){hx&&this.throwError("platform missing String.prototype.normalize",zr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:hx})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,zr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,zr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,zr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,zr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",zr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",zr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",zr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return $c||($c=new zr(z7)),$c}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",zr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fx){if(!t)return;this.globalLogger().throwError("error censorship permanent",zr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}sx=!!t,fx=!!e}static setLogLevel(t){const e=Vh[t.toLowerCase()];if(e==null){zr.globalLogger().warn("invalid log level - "+t);return}ax=e}static from(t){return new zr(t)}};cn.errors=ao;cn.levels=Xd;
12const K7="bytes/5.7.0",t0=new cn(K7);function E3(r){return!!r.toHexString}function jh(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return jh(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function H7(r){return L1(r)&&!(r.length%2)||D1(r)}function lx(r){return typeof r=="number"&&r==r&&r%1===0}function D1(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!lx(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!lx(e)||e<0||e>=256)return!1}return!0}function Al(r,t){if(t||(t={}),typeof r=="number"){t0.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),jh(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),E3(r)&&(r=r.toHexString()),L1(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":t0.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return jh(new Uint8Array(n))}return D1(r)?jh(new Uint8Array(r)):t0.throwArgumentError("invalid arrayify value","value",r)}function L1(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const Gc="0123456789abcdef";function W7(r,t){if(t||(t={}),typeof r=="number"){t0.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Gc[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),E3(r))return r.toHexString();if(L1(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":t0.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(D1(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Gc[(a&240)>>4]+Gc[a&15]}return e}return t0.throwArgumentError("invalid hexlify value","value",r)}function J7(r){r=Al(r);let t="";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return btoa(t)}function Zd(r){const t={};for(const e in r)t[e]=r[e];return t}const V7="strings/5.7.0",A3=new cn(V7);var Cu;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(Cu||(Cu={}));var qi;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(qi||(qi={}));function j7(r,t,e,n,a){return A3.throwArgumentError(`invalid codepoint at offset ${t}; ${r}`,"bytes",e)}function M3(r,t,e,n,a){if(r===qi.BAD_PREFIX||r===qi.UNEXPECTED_CONTINUE){let f=0;for(let c=t+1;c<e.length&&e[c]>>6===2;c++)f++;return f}return r===qi.OVERRUN?e.length-t-1:0}function X7(r,t,e,n,a){return r===qi.OVERLONG?(n.push(a),0):(n.push(65533),M3(r,t,e))}const Z7=Object.freeze({error:j7,ignore:M3,replace:X7});function Q7(r,t){t==null&&(t=Z7.error),r=Al(r);const e=[];let n=0;for(;n<r.length;){const a=r[n++];if(!(a>>7)){e.push(a);continue}let f=null,c=null;if((a&224)===192)f=1,c=127;else if((a&240)===224)f=2,c=2047;else if((a&248)===240)f=3,c=65535;else{(a&192)===128?n+=t(qi.UNEXPECTED_CONTINUE,n-1,r,e):n+=t(qi.BAD_PREFIX,n-1,r,e);continue}if(n-1+f>=r.length){n+=t(qi.OVERRUN,n-1,r,e);continue}let y=a&(1<<8-f-1)-1;for(let b=0;b<f;b++){let w=r[n];if((w&192)!=128){n+=t(qi.MISSING_CONTINUE,n,r,e),y=null;break}y=y<<6|w&63,n++}if(y!==null){if(y>1114111){n+=t(qi.OUT_OF_RANGE,n-1-f,r,e,y);continue}if(y>=55296&&y<=57343){n+=t(qi.UTF16_SURROGATE,n-1-f,r,e,y);continue}if(y<=c){n+=t(qi.OVERLONG,n-1-f,r,e,y);continue}e.push(y)}}return e}function N3(r,t=Cu.current){t!=Cu.current&&(A3.checkNormalize(),r=r.normalize(t));let e=[];for(let n=0;n<r.length;n++){const a=r.charCodeAt(n);if(a<128)e.push(a);else if(a<2048)e.push(a>>6|192),e.push(a&63|128);else if((a&64512)==55296){n++;const f=r.charCodeAt(n);if(n>=r.length||(f&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((a&1023)<<10)+(f&1023);e.push(c>>18|240),e.push(c>>12&63|128),e.push(c>>6&63|128),e.push(c&63|128)}else e.push(a>>12|224),e.push(a>>6&63|128),e.push(a&63|128)}return Al(e)}function Y7(r){return r.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function _3(r,t){return Y7(Q7(r,t))}const tS="web/5.4.0";var eS=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};function rS(r,t){return eS(this,void 0,void 0,function*(){t==null&&(t={});const e={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0,mode:"cors",cache:"no-cache",credentials:"same-origin",redirect:"follow",referrer:"client"},n=yield fetch(r,e),a=yield n.arrayBuffer(),f={};
12return n.headers.forEach?n.headers.forEach((c,y)=>{f[y.toLowerCase()]=c}):n.headers.keys().forEach(c=>{f[c.toLowerCase()]=n.headers.get(c)}),{headers:f,statusCode:n.status,statusMessage:n.statusText,body:Al(new Uint8Array(a))}})}var iS=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Mo=new cn(tS);function cx(r){return new Promise(t=>{setTimeout(t,r)})}function is(r,t){if(r==null)return null;if(typeof r=="string")return r;if(H7(r)){if(t&&(t.split("/")[0]==="text"||t.split(";")[0].trim()==="application/json"))try{return _3(r)}catch{}return W7(r)}return r}function $1(r,t,e){const n=typeof r=="object"&&r.throttleLimit!=null?r.throttleLimit:12;Mo.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const a=typeof r=="object"?r.throttleCallback:null,f=typeof r=="object"&&typeof r.throttleSlotInterval=="number"?r.throttleSlotInterval:100;Mo.assertArgument(f>0&&f%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",f);const c={};let y=null;const b={method:"GET"};let w=!1,E=2*60*1e3;if(typeof r=="string")y=r;else if(typeof r=="object"){if((r==null||r.url==null)&&Mo.throwArgumentError("missing URL","connection.url",r),y=r.url,typeof r.timeout=="number"&&r.timeout>0&&(E=r.timeout),r.headers)for(const B in r.headers)c[B.toLowerCase()]={key:B,value:String(r.headers[B])},["if-none-match","if-modified-since"].indexOf(B.toLowerCase())>=0&&(w=!0);if(b.allowGzip=!!r.allowGzip,r.user!=null&&r.password!=null){y.substring(0,6)!=="https:"&&r.allowInsecureAuthentication!==!0&&Mo.throwError("basic authentication requires a secure https url",cn.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:r.user,password:"[REDACTED]"});const B=r.user+":"+r.password;c.authorization={key:"Authorization",value:"Basic "+J7(N3(B))}}}t&&(b.method="POST",b.body=t,c["content-type"]==null&&(c["content-type"]={key:"Content-Type",value:"application/octet-stream"}),c["content-length"]==null&&(c["content-length"]={key:"Content-Length",value:String(t.length)}));const M={};Object.keys(c).forEach(B=>{const L=c[B];M[L.key]=L.value}),b.headers=M;const O=function(){let B=null;return{promise:new Promise(function(q,V){E&&(B=setTimeout(()=>{B!=null&&(B=null,V(Mo.makeError("timeout",cn.errors.TIMEOUT,{requestBody:is(b.body,M["content-type"]),requestMethod:b.method,timeout:E,url:y})))},E))}),cancel:function(){B!=null&&(clearTimeout(B),B=null)}}}(),F=function(){return iS(this,void 0,void 0,function*(){for(let B=0;B<n;B++){let L=null;try{if(L=yield rS(y,b),L.statusCode===429&&B<n){let q=!0;if(a&&(q=yield a(B,y)),q){let V=0;const At=L.headers["retry-after"];typeof At=="string"&&At.match(/^[1-9][0-9]*$/)?V=parseInt(At)*1e3:V=f*parseInt(String(Math.random()*Math.pow(2,B))),yield cx(V);continue}}}catch(q){L=q.response,L==null&&(O.cancel(),Mo.throwError("missing response",cn.errors.SERVER_ERROR,{requestBody:is(b.body,M["content-type"]),requestMethod:b.method,serverError:q,url:y}))}let z=L.body;if(w&&L.statusCode===304?z=null:(L.statusCode<200||L.statusCode>=300)&&(O.cancel(),Mo.throwError("bad response",cn.errors.SERVER_ERROR,{status:L.statusCode,headers:L.headers,body:is(z,L.headers?L.headers["content-type"]:null),requestBody:is(b.body,M["content-type"]),requestMethod:b.method,url:y})),e)try{const q=yield e(z,L);return O.cancel(),q}catch(q){if(q.throttleRetry&&B<n){let V=!0;if(a&&(V=yield a(B,y)),V){const At=f*parseInt(String(Math.random()*Math.pow(2,B)));yield cx(At);continue}}O.cancel(),Mo.throwError("processing response error",cn.errors.SERVER_ERROR,{body:is(z,L.headers?L.headers["content-type"]:null),error:q,requestBody:is(b.body,M["content-type"]),requestMethod:b.method,url:y})}return O.cancel(),z}return Mo.throwError("failed response",cn.errors.SERVER_ERROR,{requestBody:is(b.body,M["content-type"]),requestMethod:b.method,url:y})})}();return Promise.race([O.promise,F])}function S3(r,t,e){let n=(f,c)=>{let y=null;if(f!=null)try{y=JSON.parse(_3(f))}catch(b){Mo.throwError("invalid JSON",cn.errors.SERVER_ERROR,{body:f,error:b})}return e&&(y=e(y,c)),y},a=null;if(t!=null){a=N3(t);const f=typeof r=="string"?{url:r}:Zd(r);f.headers?Object.keys(f.headers).filter(y=>y.toLowerCase()==="content-type").length!==0||(f.headers=Zd(f.headers),f.headers["content-type"]="application/json"):f.headers={"content-type":"application/json"},r=f}return $1(r,a,n)}function I3(r,t){return t||(t={}),t=Zd(t),t.floor==null&&(t.floor=0),t.ceiling==null&&(t.ceiling=1e4),t.interval==null&&(t.interval=250),new Promise(function(e,n){let a=null,f=!1;const c=()=>f?!1:(f=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout(()=>{c()&&n(new Error("timeout"))},t.timeout));const y=t.retryLimit;let b=0;function w(){return r().then(function(E){if(E!==void 0)c()&&e(E);else if(t.oncePoll)t.oncePoll.once("poll",w);else if(t.onceBlock)t.onceBlock.once("block",w);else if(!f){if(b++,b>y){c()&&n(new Error("retry limit reached"));return}let M=t.interval*parseInt(String(Math.random()*Math.pow(2,b)));M<t.floor&&(M=t.floor),M>t.ceiling&&(M=t.ceiling),setTimeout(w,M)}return null},function(E){c()&&n(E)})}w()})}const OT=Object.freeze(Object.defineProperty({__proto__:null,_fetchData:$1,fetchJson:S3,poll:I3},Symbol.toStringTag,{value:"Module"})),nS="networks/5.7.1",dx=new _t(nS);function oS(r){return r&&typeof r.renetwork=="function"}
12function tf(r){const t=function(e,n){n==null&&(n={});const a=[];if(e.InfuraProvider&&n.infura!=="-")try{a.push(new e.InfuraProvider(r,n.infura))}catch{}if(e.EtherscanProvider&&n.etherscan!=="-")try{a.push(new e.EtherscanProvider(r,n.etherscan))}catch{}if(e.AlchemyProvider&&n.alchemy!=="-")try{a.push(new e.AlchemyProvider(r,n.alchemy))}catch{}if(e.PocketProvider&&n.pocket!=="-"){const f=["goerli","ropsten","rinkeby","sepolia"];try{const c=new e.PocketProvider(r,n.pocket);c.network&&f.indexOf(c.network.name)===-1&&a.push(c)}catch{}}if(e.CloudflareProvider&&n.cloudflare!=="-")try{a.push(new e.CloudflareProvider(r))}catch{}if(e.AnkrProvider&&n.ankr!=="-")try{const f=["ropsten"],c=new e.AnkrProvider(r,n.ankr);c.network&&f.indexOf(c.network.name)===-1&&a.push(c)}catch{}if(a.length===0)return null;if(e.FallbackProvider){let f=1;return n.quorum!=null?f=n.quorum:r==="homestead"&&(f=2),new e.FallbackProvider(a,f)}return a[0]};return t.renetwork=function(e){return tf(e)},t}function Ou(r,t){const e=function(n,a){return n.JsonRpcProvider?new n.JsonRpcProvider(r,t):null};return e.renetwork=function(n){return Ou(r,n)},e}const px={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:tf("homestead")},gx={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:tf("ropsten")},mx={chainId:63,name:"classicMordor",_defaultProvider:Ou("https://www.ethercluster.com/mordor","classicMordor")},rh={unspecified:{chainId:0,name:"unspecified"},homestead:px,mainnet:px,morden:{chainId:2,name:"morden"},ropsten:gx,testnet:gx,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:tf("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:tf("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:tf("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:tf("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Ou("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:mx,classicTestnet:mx,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Ou("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:tf("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:tf("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function fS(r){if(r==null)return null;if(typeof r=="number"){for(const n in rh){const a=rh[n];if(a.chainId===r)return{name:a.name,chainId:a.chainId,ensAddress:a.ensAddress||null,_defaultProvider:a._defaultProvider||null}}return{chainId:r,name:"unknown"}}if(typeof r=="string"){const n=rh[r];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const t=rh[r.name];if(!t)return typeof r.chainId!="number"&&dx.throwArgumentError("invalid network chainId","network",r),r;r.chainId!==0&&r.chainId!==t.chainId&&dx.throwArgumentError("network chainId mismatch","network",r);let e=r._defaultProvider||null;return e==null&&t._defaultProvider&&(oS(t._defaultProvider)?e=t._defaultProvider.renetwork(r):e=t._defaultProvider),{name:r.name,chainId:t.chainId,ensAddress:r.ensAddress||t.ensAddress||null,_defaultProvider:e}}const sS="web/5.7.1";var aS=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};function hS(r,t){return aS(this,void 0,void 0,function*(){t==null&&(t={});const e={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(t.skipFetchSetup!==!0&&(e.mode="cors",e.cache="no-cache",e.credentials="same-origin",e.redirect="follow",e.referrer="client"),t.fetchOptions!=null){const c=t.fetchOptions;c.mode&&(e.mode=c.mode),c.cache&&(e.cache=c.cache),c.credentials&&(e.credentials=c.credentials),c.redirect&&(e.redirect=c.redirect),c.referrer&&(e.referrer=c.referrer)}const n=yield fetch(r,e),a=yield n.arrayBuffer(),f={};
12return n.headers.forEach?n.headers.forEach((c,y)=>{f[y.toLowerCase()]=c}):n.headers.keys().forEach(c=>{f[c.toLowerCase()]=n.headers.get(c)}),{headers:f,statusCode:n.status,statusMessage:n.statusText,body:kt(new Uint8Array(a))}})}var uS=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Kn=new _t(sS);function vx(r){return new Promise(t=>{setTimeout(t,r)})}function Af(r,t){if(r==null)return null;if(typeof r=="string")return r;if(Ju(r)){if(t&&(t.split("/")[0]==="text"||t.split(";")[0].trim()==="application/json"))try{return g0(r)}catch{}return Ut(r)}return r}function lS(r){return cr(r.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16))))}function cS(r,t,e){const n=typeof r=="object"&&r.throttleLimit!=null?r.throttleLimit:12;Kn.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const a=typeof r=="object"?r.throttleCallback:null,f=typeof r=="object"&&typeof r.throttleSlotInterval=="number"?r.throttleSlotInterval:100;Kn.assertArgument(f>0&&f%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",f);const c=typeof r=="object"?!!r.errorPassThrough:!1,y={};let b=null;const w={method:"GET"};let E=!1,M=2*60*1e3;if(typeof r=="string")b=r;else if(typeof r=="object"){if((r==null||r.url==null)&&Kn.throwArgumentError("missing URL","connection.url",r),b=r.url,typeof r.timeout=="number"&&r.timeout>0&&(M=r.timeout),r.headers)for(const q in r.headers)y[q.toLowerCase()]={key:q,value:String(r.headers[q])},["if-none-match","if-modified-since"].indexOf(q.toLowerCase())>=0&&(E=!0);if(w.allowGzip=!!r.allowGzip,r.user!=null&&r.password!=null){b.substring(0,6)!=="https:"&&r.allowInsecureAuthentication!==!0&&Kn.throwError("basic authentication requires a secure https url",_t.errors.INVALID_ARGUMENT,{argument:"url",url:b,user:r.user,password:"[REDACTED]"});const q=r.user+":"+r.password;y.authorization={key:"Authorization",value:"Basic "+uy(cr(q))}}r.skipFetchSetup!=null&&(w.skipFetchSetup=!!r.skipFetchSetup),r.fetchOptions!=null&&(w.fetchOptions=Jr(r.fetchOptions))}const O=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),F=b?b.match(O):null;if(F)try{const q={statusCode:200,statusMessage:"OK",headers:{"content-type":F[1]||"text/plain"},body:F[2]?hy(F[3]):lS(F[3])};let V=q.body;return e&&(V=e(q.body,q)),Promise.resolve(V)}catch(q){Kn.throwError("processing response error",_t.errors.SERVER_ERROR,{body:Af(F[1],F[2]),error:q,requestBody:null,requestMethod:"GET",url:b})}t&&(w.method="POST",w.body=t,y["content-type"]==null&&(y["content-type"]={key:"Content-Type",value:"application/octet-stream"}),y["content-length"]==null&&(y["content-length"]={key:"Content-Length",value:String(t.length)}));const B={};Object.keys(y).forEach(q=>{const V=y[q];B[V.key]=V.value}),w.headers=B;const L=function(){let q=null;return{promise:new Promise(function(St,Z){M&&(q=setTimeout(()=>{q!=null&&(q=null,Z(Kn.makeError("timeout",_t.errors.TIMEOUT,{requestBody:Af(w.body,B["content-type"]),requestMethod:w.method,timeout:M,url:b})))},M))}),cancel:function(){q!=null&&(clearTimeout(q),q=null)}}}(),z=function(){return uS(this,void 0,void 0,function*(){for(let q=0;q<n;q++){let V=null;try{if(V=yield hS(b,w),q<n){if(V.statusCode===301||V.statusCode===302){const St=V.headers.location||"";if(w.method==="GET"&&St.match(/^https:/)){b=V.headers.location;continue}}else if(V.statusCode===429){let St=!0;if(a&&(St=yield a(q,b)),St){let Z=0;const Y=V.headers["retry-after"];typeof Y=="string"&&Y.match(/^[1-9][0-9]*$/)?Z=parseInt(Y)*1e3:Z=f*parseInt(String(Math.random()*Math.pow(2,q))),yield vx(Z);continue}}}}catch(St){V=St.response,V==null&&(L.cancel(),Kn.throwError("missing response",_t.errors.SERVER_ERROR,{requestBody:Af(w.body,B["content-type"]),requestMethod:w.method,serverError:St,url:b}))}let At=V.body;if(E&&V.statusCode===304?At=null:!c&&(V.statusCode<200||V.statusCode>=300)&&(L.cancel(),Kn.throwError("bad response",_t.errors.SERVER_ERROR,{status:V.statusCode,headers:V.headers,body:Af(At,V.headers?V.headers["content-type"]:null),requestBody:Af(w.body,B["content-type"]),requestMethod:w.method,url:b})),e)try{const St=yield e(At,V);return L.cancel(),St}catch(St){if(St.throttleRetry&&q<n){let Z=!0;
12if(a&&(Z=yield a(q,b)),Z){const Y=f*parseInt(String(Math.random()*Math.pow(2,q)));yield vx(Y);continue}}L.cancel(),Kn.throwError("processing response error",_t.errors.SERVER_ERROR,{body:Af(At,V.headers?V.headers["content-type"]:null),error:St,requestBody:Af(w.body,B["content-type"]),requestMethod:w.method,url:b})}return L.cancel(),At}return Kn.throwError("failed response",_t.errors.SERVER_ERROR,{requestBody:Af(w.body,B["content-type"]),requestMethod:w.method,url:b})})}();return Promise.race([L.promise,z])}function G1(r,t,e){let n=(f,c)=>{let y=null;if(f!=null)try{y=JSON.parse(g0(f))}catch(b){Kn.throwError("invalid JSON",_t.errors.SERVER_ERROR,{body:f,error:b})}return e&&(y=e(y,c)),y},a=null;if(t!=null){a=cr(t);const f=typeof r=="string"?{url:r}:Jr(r);f.headers?Object.keys(f.headers).filter(y=>y.toLowerCase()==="content-type").length!==0||(f.headers=Jr(f.headers),f.headers["content-type"]="application/json"):f.headers={"content-type":"application/json"},r=f}return cS(r,a,n)}function W0(r,t){return t||(t={}),t=Jr(t),t.floor==null&&(t.floor=0),t.ceiling==null&&(t.ceiling=1e4),t.interval==null&&(t.interval=250),new Promise(function(e,n){let a=null,f=!1;const c=()=>f?!1:(f=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout(()=>{c()&&n(new Error("timeout"))},t.timeout));const y=t.retryLimit;let b=0;function w(){return r().then(function(E){if(E!==void 0)c()&&e(E);else if(t.oncePoll)t.oncePoll.once("poll",w);else if(t.onceBlock)t.onceBlock.once("block",w);else if(!f){if(b++,b>y){c()&&n(new Error("retry limit reached"));return}let M=t.interval*parseInt(String(Math.random()*Math.pow(2,b)));M<t.floor&&(M=t.floor),M>t.ceiling&&(M=t.ceiling),setTimeout(w,M)}return null},function(E){c()&&n(E)})}w()})}var ku="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Qd={};for(var ih=0;ih<ku.length;ih++){var zc=ku.charAt(ih);if(Qd[zc]!==void 0)throw new TypeError(zc+" is ambiguous");Qd[zc]=ih}function e0(r){var t=r>>25;return(r&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function R3(r){for(var t=1,e=0;e<r.length;++e){var n=r.charCodeAt(e);if(n<33||n>126)return"Invalid prefix ("+r+")";t=e0(t)^n>>5}for(t=e0(t),e=0;e<r.length;++e){var a=r.charCodeAt(e);t=e0(t)^a&31}return t}function dS(r,t,e){if(e=e||90,r.length+7+t.length>e)throw new TypeError("Exceeds length limit");r=r.toLowerCase();var n=R3(r);if(typeof n=="string")throw new Error(n);for(var a=r+"1",f=0;f<t.length;++f){var c=t[f];if(c>>5)throw new Error("Non 5-bit word");n=e0(n)^c,a+=ku.charAt(c)}for(f=0;f<6;++f)n=e0(n);for(n^=1,f=0;f<6;++f){var y=n>>(5-f)*5&31;a+=ku.charAt(y)}return a}function T3(r,t){if(t=t||90,r.length<8)return r+" too short";if(r.length>t)return"Exceeds length limit";var e=r.toLowerCase(),n=r.toUpperCase();if(r!==e&&r!==n)return"Mixed-case string "+r;r=e;var a=r.lastIndexOf("1");if(a===-1)return"No separator character for "+r;if(a===0)return"Missing prefix for "+r;var f=r.slice(0,a),c=r.slice(a+1);if(c.length<6)return"Data too short";var y=R3(f);if(typeof y=="string")return y;for(var b=[],w=0;w<c.length;++w){var E=c.charAt(w),M=Qd[E];if(M===void 0)return"Unknown character "+E;y=e0(y)^M,!(w+6>=c.length)&&b.push(M)}return y!==1?"Invalid checksum for "+r:{prefix:f,words:b}}function pS(){var r=T3.apply(null,arguments);if(typeof r=="object")return r}function gS(r){var t=T3.apply(null,arguments);if(typeof t=="object")return t;throw new Error(t)}function Ml(r,t,e,n){for(var a=0,f=0,c=(1<<e)-1,y=[],b=0;b<r.length;++b)for(a=a<<t|r[b],f+=t;f>=e;)f-=e,y.push(a>>f&c);if(n)f>0&&y.push(a<<e-f&c);else{if(f>=t)return"Excess padding";if(a<<e-f&c)return"Non-zero padding"}return y}function mS(r){var t=Ml(r,8,5,!0);if(Array.isArray(t))return t}function vS(r){var t=Ml(r,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)}function xS(r){var t=Ml(r,5,8,!1);if(Array.isArray(t))return t}function yS(r){var t=Ml(r,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}var bS={decodeUnsafe:pS,decode:gS,encode:dS,toWordsUnsafe:mS,toWords:vS,fromWordsUnsafe:xS,fromWords:yS};const Bu=Nr(bS),Ja="providers/5.7.2",U0=new _t(Ja);let xx=class ne{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),a=this.blockTag.bind(this),f=this.data.bind(this),c=this.hash.bind(this),y=this.hex.bind(this),b=this.number.bind(this),w=this.type.bind(this),E=M=>this.data(M,!0);
12return t.transaction={hash:c,type:w,accessList:ne.allowNull(this.accessList.bind(this),null),blockHash:ne.allowNull(c,null),blockNumber:ne.allowNull(b,null),transactionIndex:ne.allowNull(b,null),confirmations:ne.allowNull(b,null),from:e,gasPrice:ne.allowNull(n),maxPriorityFeePerGas:ne.allowNull(n),maxFeePerGas:ne.allowNull(n),gasLimit:n,to:ne.allowNull(e,null),value:n,nonce:b,data:f,r:ne.allowNull(this.uint256),s:ne.allowNull(this.uint256),v:ne.allowNull(b),creates:ne.allowNull(e,null),raw:ne.allowNull(f)},t.transactionRequest={from:ne.allowNull(e),nonce:ne.allowNull(b),gasLimit:ne.allowNull(n),gasPrice:ne.allowNull(n),maxPriorityFeePerGas:ne.allowNull(n),maxFeePerGas:ne.allowNull(n),to:ne.allowNull(e),value:ne.allowNull(n),data:ne.allowNull(E),type:ne.allowNull(b),accessList:ne.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:b,blockNumber:b,transactionHash:c,address:e,topics:ne.arrayOf(c),data:f,logIndex:b,blockHash:c},t.receipt={to:ne.allowNull(this.address,null),from:ne.allowNull(this.address,null),contractAddress:ne.allowNull(e,null),transactionIndex:b,root:ne.allowNull(y),gasUsed:n,logsBloom:ne.allowNull(f),blockHash:c,transactionHash:c,logs:ne.arrayOf(this.receiptLog.bind(this)),blockNumber:b,confirmations:ne.allowNull(b,null),cumulativeGasUsed:n,effectiveGasPrice:ne.allowNull(n),status:ne.allowNull(b),type:w},t.block={hash:ne.allowNull(c),parentHash:c,number:b,timestamp:b,nonce:ne.allowNull(y),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:ne.allowNull(e),extraData:f,transactions:ne.allowNull(ne.arrayOf(c)),baseFeePerGas:ne.allowNull(n)},t.blockWithTransactions=Jr(t.block),t.blockWithTransactions.transactions=ne.allowNull(ne.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:ne.allowNull(a,void 0),toBlock:ne.allowNull(a,void 0),blockHash:ne.allowNull(c,void 0),address:ne.allowNull(e,void 0),topics:ne.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:ne.allowNull(b),blockHash:ne.allowNull(c),transactionIndex:b,removed:ne.allowNull(this.boolean.bind(this)),address:e,data:ne.allowFalsish(f,"0x"),topics:ne.arrayOf(c),transactionHash:c,logIndex:b},t}accessList(t){return A0(t||[])}number(t){return t==="0x"?0:zt.from(t).toNumber()}type(t){return t==="0x"||t==null?0:zt.from(t).toNumber()}bigNumber(t){return zt.from(t)}boolean(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t=t.toLowerCase(),t==="true")return!0;if(t==="false")return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return typeof t=="string"&&(!e&&t.substring(0,2)!=="0x"&&(t="0x"+t),xe(t))?t.toLowerCase():U0.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return je(t)}callAddress(t){if(!xe(t,32))return null;const e=je(Ar(t,12));return e===OE?null:e}contractAddress(t){return Z2(t)}blockTag(t){if(t==null)return"latest";if(t==="earliest")return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if(typeof t=="number"||xe(t))return pp(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return cs(n)!==32?U0.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(t==null)return null;const e=zt.from(t);try{return e.toNumber()}catch{}return null}uint256(t){if(!xe(t))throw new Error("invalid uint256");return Qe(t,32)}_block(t,e){t.author!=null&&t.miner==null&&(t.miner=t.author);const n=t._difficulty!=null?t._difficulty:t.difficulty,a=ne.check(e,t);return a._difficulty=n==null?null:zt.from(n),a}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return ne.check(this.formats.transactionRequest,t)}transactionResponse(t){t.gas!=null&&t.gasLimit==null&&(t.gasLimit=t.gas),t.to&&zt.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),t.input!=null&&t.data==null&&(t.data=t.input),t.to==null&&t.creates==null&&(t.creates=this.contractAddress(t)),(t.type===1||t.type===2)&&t.accessList==null&&(t.accessList=[]);const e=ne.check(this.formats.transaction,t);if(t.chainId!=null){let n=t.chainId;xe(n)&&(n=zt.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;n==null&&e.v==null&&(n=t.chainId),xe(n)&&(n=zt.from(n).toNumber()),typeof n!="number"&&e.v!=null&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),e.chainId=n}return e.blockHash&&e.blockHash.replace(/0/g,"")==="x"&&(e.blockHash=null),e}transaction(t){return G5(t)}receiptLog(t){return ne.check(this.formats.receiptLog,t)}receipt(t){const e=ne.check(this.formats.receipt,t);if(e.root!=null)if(e.root.length<=4){const n=zt.from(e.root).toNumber();n===0||n===1?(e.status!=null&&e.status!==n&&U0.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=n,delete e.root):U0.throwArgumentError("invalid alt-root-status","value.root",e.root)}else e.root.length!==66&&U0.throwArgumentError("invalid root hash","value.root",e.root);return e.status!=null&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map(e=>this.topics(e)):t!=null?this.hash(t,!0):null}filter(t){return ne.check(this.formats.filter,t)}filterLog(t){return ne.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const a in t)try{const f=t[a](e[a]);f!==void 0&&(n[a]=f)}catch(f){throw f.checkKey=a,f.checkValue=e[a],f}return n}static allowNull(t,e){return function(n){return n==null?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach(function(a){n.push(t(a))}),n}}};var ae=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const me=new _t(Ja),wS=10;function yx(r){return r==null?"null":(cs(r)!==32&&me.throwArgumentError("invalid topic","topic",r),r.toLowerCase())}function bx(r){for(r=r.slice();r.length>0&&r[r.length-1]==null;)r.pop();return r.map(t=>{if(Array.isArray(t)){const e={};t.forEach(a=>{e[yx(a)]=!0});const n=Object.keys(e);return n.sort(),n.join("|")}else return yx(t)}).join("&")}function ES(r){return r===""?[]:r.split(/&/g).map(t=>{if(t==="")return[];const e=t.split("|").map(n=>n==="null"?null:n);return e.length===1?e[0]:e})}function Is(r){if(typeof r=="string"){if(r=r.toLowerCase(),cs(r)===32)return"tx:"+r;if(r.indexOf(":")===-1)return r}else{if(Array.isArray(r))return"filter:*:"+bx(r);if(A7.isForkEvent(r))throw me.warn("not implemented"),new Error("not implemented");if(r&&typeof r=="object")return"filter:"+(r.address||"*")+":"+bx(r.topics||[])}throw new Error("invalid event - "+r)}function F0(){return new Date().getTime()}function wx(r){return new Promise(t=>{setTimeout(t,r)})}const AS=["block","network","pending","poll"];let MS=class{constructor(t,e,n){Pt(this,"tag",t),Pt(this,"listener",e),Pt(this,"once",n
12),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return t[0]!=="tx"?null:t[1]}get filter(){const t=this.tag.split(":");if(t[0]!=="filter")return null;const e=t[1],n=ES(t[2]),a={};return n.length>0&&(a.topics=n),e&&e!=="*"&&(a.address=e),a}pollable(){return this.tag.indexOf(":")>=0||AS.indexOf(this.tag)>=0}};const NS={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function qc(r){return Qe(zt.from(r).toHexString(),32)}function Ex(r){return wa.encode(Ve([r,Ar(qf(qf(r)),0,4)]))}const P3=new RegExp("^(ipfs)://(.*)$","i"),Ax=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),P3,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Xh(r,t){try{return g0(Sa(r,t))}catch{}return null}function Sa(r,t){if(r==="0x")return null;const e=zt.from(Ar(r,t,t+32)).toNumber(),n=zt.from(Ar(r,e,e+32)).toNumber();return Ar(r,e+32,e+32+n)}function Kc(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):me.throwArgumentError("unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}function Mx(r){const t=kt(r);if(t.length>32)throw new Error("internal; should not happen");const e=new Uint8Array(32);return e.set(t,32-t.length),e}function _S(r){if(r.length%32===0)return r;const t=new Uint8Array(Math.ceil(r.length/32)*32);return t.set(r),t}function C3(r){const t=[];let e=0;for(let n=0;n<r.length;n++)t.push(null),e+=32;for(let n=0;n<r.length;n++){const a=kt(r[n]);t[n]=Mx(e),t.push(Mx(a.length)),t.push(_S(a)),e+=32+Math.ceil(a.length/32)*32}return Mi(t)}let Nx=class{constructor(t,e,n,a){Pt(this,"provider",t),Pt(this,"name",n),Pt(this,"address",t.formatter.address(e)),Pt(this,"_resolvedAddress",a)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(t=>zt.from(t).eq(1)).catch(t=>{if(t.code===_t.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t})),this._supportsEip2544}_fetch(t,e){return ae(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Mi([t,ph(this.name),e||"0x"])};let a=!1;(yield this.supportsWildcard())&&(a=!0,n.data=Mi(["0x9061b923",C3([pA(this.name),n.data])]));try{let f=yield this.provider.call(n);return kt(f).length%32===4&&me.throwError("resolver threw error",_t.errors.CALL_EXCEPTION,{transaction:n,data:f}),a&&(f=Sa(f,0)),f}catch(f){if(f.code===_t.errors.CALL_EXCEPTION)return null;throw f}})}_fetchBytes(t,e){return ae(this,void 0,void 0,function*(){const n=yield this._fetch(t,e);return n!=null?Sa(n,0):null})}_getAddress(t,e){const n=NS[String(t)];if(n==null&&me.throwError(`unsupported coin type: ${t}`,_t.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),n.ilk==="eth")return this.provider.formatter.address(e);const a=kt(e);if(n.p2pkh!=null){const f=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(f){const c=parseInt(f[1],16);if(f[2].length===c*2&&c>=1&&c<=75)return Ex(Ve([[n.p2pkh],"0x"+f[2]]))}}if(n.p2sh!=null){const f=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(f){const c=parseInt(f[1],16);if(f[2].length===c*2&&c>=1&&c<=75)return Ex(Ve([[n.p2sh],"0x"+f[2]]))}}if(n.prefix!=null){const f=a[1];let c=a[0];if(c===0?f!==20&&f!==32&&(c=-1):c=-1,c>=0&&a.length===2+f&&f>=1&&f<=75){const y=Bu.toWords(a.slice(2));return y.unshift(c),Bu.encode(n.prefix,y)}}return null}getAddress(t){return ae(this,void 0,void 0,function*(){if(t==null&&(t=60),t===60)try{const a=yield this._fetch("0x3b3b57de");return a==="0x"||a===kE?null:this.provider.formatter.callAddress(a)}catch(a){if(a.code===_t.errors.CALL_EXCEPTION)return null;throw a}const e=yield this._fetchBytes("0xf1cb7e06",qc(t));if(e==null||e==="0x")return null;const n=this._getAddress(t,e);return n==null&&me.throwError("invalid or unsupported coin data",_t.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n})}getAvatar(){return ae(this,void 0,void 0,function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(e==null)return null;for(let n=0;n<Ax.length;n++){const a=e.match(Ax[n]);if(a==null)continue;const f=a[1].toLowerCase();switch(f){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:Kc(e)};case"erc721":case"erc1155":{const c=f==="erc721"?"0xc87b56dd":"0x0e89341c";t.push({type:f,content:e});const y=this._resolvedAddress||(yield this.getAddress()),b=(a[2]||"").split("/");if(b.length!==2)return null;const w=yield this.provider.formatter.address(b[0]),E=Qe(zt.from(b[1]).toHexString(),32);if(f==="erc721"){const L=this.provider.formatter.callAddress(yield this.provider.call({to:w,data:Mi(["0x6352211e",E])}));if(y!==L)return null;t.push({type:"owner",content:L})}else if(f==="erc1155"){const L=zt.from(yield this.provider.call({to:w,data:Mi(["0x00fdd58e",Qe(y,32),E])}));if(L.isZero())return null;t.push({type:"balance",content:L.toString()})}const M={to:this.provider.formatter.address(b[0]),data:Mi([c,E])};let O=Xh(yield this.provider.call(M),0);if(O==null)return null;t.push({type:"metadata-url-base",content:O}),f==="erc1155"&&(O=O.replace("{id}",E.substring(2)),t.push({type:"metadata-url-expanded",content:O})),O.match(/^ipfs:/i)&&(O=Kc(O)),t.push({type:"metadata-url",content:O});const F=yield G1(O);if(!F)return null;t.push({type:"metadata",content:JSON.stringify(F)});let B=F.image;if(typeof B!="string")return null;
12if(!B.match(/^(https:\/\/|data:)/i)){if(B.match(P3)==null)return null;t.push({type:"url-ipfs",content:B}),B=Kc(B)}return t.push({type:"url",content:B}),{linkage:t,url:B}}}}}catch{}return null})}getContentHash(){return ae(this,void 0,void 0,function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(t==null||t==="0x")return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const c=parseInt(e[3],16);if(e[4].length===c*2)return"ipfs://"+wa.encode("0x"+e[1])}const n=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const c=parseInt(n[3],16);if(n[4].length===c*2)return"ipns://"+wa.encode("0x"+n[1])}const a=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(a&&a[1].length===32*2)return"bzz://"+a[1];const f=t.match(/^0x90b2c605([0-9a-f]*)$/);if(f&&f[1].length===34*2){const c={"=":"","+":"-","/":"_"};return"sia://"+uy("0x"+f[1]).replace(/[=+\/]/g,b=>c[b])}return me.throwError("invalid or unsupported content hash data",_t.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})})}getText(t){return ae(this,void 0,void 0,function*(){let e=cr(t);e=Ve([qc(64),qc(e.length),e]),e.length%32!==0&&(e=Ve([e,Qe("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Ut(e));return n==null||n==="0x"?null:g0(n)})}},Hc=null,SS=1,IS=class extends B1{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Pt(this,"anyNetwork",t==="any"),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch(e=>{}),this._ready().catch(e=>{});else{const e=Bi(new.target,"getNetwork")(t);e?(Pt(this,"_network",e),this.emit("network",e,null)):me.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ae(this,void 0,void 0,function*(){if(this._network==null){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch{}t==null&&(t=yield this.detectNetwork()),t||me.throwError("no network detected",_t.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=t:Pt(this,"_network",t),this.emit("network",t,null))}return this._network})}get ready(){return W0(()=>this._ready().then(t=>t,t=>{if(!(t.code===_t.errors.NETWORK_ERROR&&t.event==="noNetwork"))throw t}))}static getFormatter(){return Hc==null&&(Hc=new xx),Hc}static getNetwork(t){return fS(t??"homestead")}ccipReadFetch(t,e,n){return ae(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const a=t.to.toLowerCase(),f=e.toLowerCase(),c=[];for(let y=0;y<n.length;y++){const b=n[y],w=b.replace("{sender}",a).replace("{data}",f),E=b.indexOf("{data}")>=0?null:JSON.stringify({data:f,sender:a}),M=yield G1({url:w,errorPassThrough:!0},E,(F,B)=>(F.status=B.statusCode,F));if(M.data)return M.data;const O=M.message||"unknown error";if(M.status>=400&&M.status<500)return me.throwError(`response not found during CCIP fetch: ${O}`,_t.errors.SERVER_ERROR,{url:b,errorMessage:O});c.push(O)}return me.throwError(`error encountered during CCIP fetch: ${c.map(y=>JSON.stringify(y)).join(", ")}`,_t.errors.SERVER_ERROR,{urls:n,errorMessages:c})})}_getInternalBlockNumber(t){return ae(this,void 0,void 0,function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const a=this._internalBlockNumber;try{const f=yield a;if(F0()-f.respTime<=t)return f.blockNumber;break}catch{if(this._internalBlockNumber===a)break}}const e=F0(),n=gr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(a=>null,a=>a)}).then(({blockNumber:a,networkError:f})=>{if(f)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),f;const c=F0();return a=zt.from(a).toNumber(),a<this._maxInternalBlockNumber&&(a=this._maxInternalBlockNumber),this._maxInternalBlockNumber=a,this._setFastBlockNumber(a),{blockNumber:a,reqTime:e,respTime:c}});return this._internalBlockNumber=n,n.catch(a=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return ae(this,void 0,void 0,function*(){const t=SS++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}
12catch(a){this.emit("error",a);return}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n===this._lastBlockNumber){this.emit("didPoll",t);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)me.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",me.makeError("network block skew detected",_t.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let a=this._emitted.block+1;a<=n;a++)this.emit("block",a);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(a=>{if(a==="block")return;const f=this._emitted[a];f!=="pending"&&n-f>12&&delete this._emitted[a]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(a=>{switch(a.type){case"tx":{const f=a.hash;let c=this.getTransactionReceipt(f).then(y=>(!y||y.blockNumber==null||(this._emitted["t:"+f]=y.blockNumber,this.emit(f,y)),null)).catch(y=>{this.emit("error",y)});e.push(c);break}case"filter":{if(!a._inflight){a._inflight=!0,a._lastBlockNumber===-2&&(a._lastBlockNumber=n-1);const f=a.filter;f.fromBlock=a._lastBlockNumber+1,f.toBlock=n;const c=f.toBlock-this._maxFilterBlockRange;c>f.fromBlock&&(f.fromBlock=c),f.fromBlock<0&&(f.fromBlock=0);const y=this.getLogs(f).then(b=>{a._inflight=!1,b.length!==0&&b.forEach(w=>{w.blockNumber>a._lastBlockNumber&&(a._lastBlockNumber=w.blockNumber),this._emitted["b:"+w.blockHash]=w.blockNumber,this._emitted["t:"+w.transactionHash]=w.blockNumber,this.emit(f,w)})}).catch(b=>{this.emit("error",b),a._inflight=!1});e.push(y)}break}}}),this._lastBlockNumber=n,Promise.all(e).then(()=>{this.emit("didPoll",t)}).catch(a=>{this.emit("error",a)})})}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ae(this,void 0,void 0,function*(){return me.throwError("provider does not support network detection",_t.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ae(this,void 0,void 0,function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield wx(0),this._network;const n=me.makeError("underlying network changed",_t.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(t=>{this._setFastBlockNumber(t)},t=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(t){t&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if(typeof t!="number"||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const t=F0();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(t){this._fastBlockNumber!=null&&t<this._fastBlockNumber||(this._fastQueryDate=F0(),(this._fastBlockNumber==null||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return ae(this,void 0,void 0,function*(){return this._waitForTransaction(t,e??1,n||0,null)})}_waitForTransaction(t,e,n,a){return ae(this,void 0,void 0,function*(){const f=yield this.getTransactionReceipt(t);return(f?f.confirmations:0)>=e?f:new Promise((c,y)=>{const b=[];let w=!1;const E=function(){return w?!0:(w=!0,b.forEach(O=>{O()}),!1)},M=O=>{O.confirmations<e||E()||c(O)};if(this.on(t,M),b.push(()=>{this.removeListener(t,M)}),a){let O=a.startBlock,F=null;const B=L=>ae(this,void 0,void 0,function*(){w||(yield wx(1e3),this.getTransactionCount(a.from).then(z=>ae(this,void 0,void 0,function*(){if(!w){if(z<=a.nonce)O=L;else{{const q=yield this.getTransaction(t);
12if(q&&q.blockNumber!=null)return}for(F==null&&(F=O-3,F<a.startBlock&&(F=a.startBlock));F<=L;){if(w)return;const q=yield this.getBlockWithTransactions(F);for(let V=0;V<q.transactions.length;V++){const At=q.transactions[V];if(At.hash===t)return;if(At.from===a.from&&At.nonce===a.nonce){if(w)return;const St=yield this.waitForTransaction(At.hash,e);if(E())return;let Z="replaced";At.data===a.data&&At.to===a.to&&At.value.eq(a.value)?Z="repriced":At.data==="0x"&&At.from===At.to&&At.value.isZero()&&(Z="cancelled"),y(me.makeError("transaction was replaced",_t.errors.TRANSACTION_REPLACED,{cancelled:Z==="replaced"||Z==="cancelled",reason:Z,replacement:this._wrapTransaction(At),hash:t,receipt:St}));return}}F++}}w||this.once("block",B)}}),z=>{w||this.once("block",B)}))});if(w)return;this.once("block",B),b.push(()=>{this.removeListener("block",B)})}if(typeof n=="number"&&n>0){const O=setTimeout(()=>{E()||y(me.makeError("timeout exceeded",_t.errors.TIMEOUT,{timeout:n}))},n);O.unref&&O.unref(),b.push(()=>{clearTimeout(O)})}})})}getBlockNumber(){return ae(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return zt.from(t)}catch(e){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}})}getBalance(t,e){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield gr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),a=yield this.perform("getBalance",n);try{return zt.from(a)}catch(f){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"getBalance",params:n,result:a,error:f})}})}getTransactionCount(t,e){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield gr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),a=yield this.perform("getTransactionCount",n);try{return zt.from(a).toNumber()}catch(f){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:a,error:f})}})}getCode(t,e){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield gr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),a=yield this.perform("getCode",n);try{return Ut(a)}catch(f){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"getCode",params:n,result:a,error:f})}})}getStorageAt(t,e,n){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const a=yield gr({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then(c=>pp(c))}),f=yield this.perform("getStorageAt",a);try{return Ut(f)}catch(c){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"getStorageAt",params:a,result:f,error:c})}})}_wrapTransaction(t,e,n){if(e!=null&&cs(e)!==32)throw new Error("invalid response - sendTransaction");const a=t;return e!=null&&t.hash!==e&&me.throwError("Transaction hash mismatch from Provider.sendTransaction.",_t.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),a.wait=(f,c)=>ae(this,void 0,void 0,function*(){f==null&&(f=1),c==null&&(c=0);let y;f!==0&&n!=null&&(y={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const b=yield this._waitForTransaction(t.hash,f,c,y);return b==null&&f===0?null:(this._emitted["t:"+t.hash]=b.blockNumber,b.status===0&&me.throwError("transaction failed",_t.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:b}),b)}),a}sendTransaction(t){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then(f=>Ut(f)),n=this.formatter.transaction(t);n.confirmations==null&&(n.confirmations=0);const a=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const f=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,f,a)}catch(f){throw f.transaction=n,f.transactionHash=n.hash,f}})}_getTransactionRequest(t){return ae(this,void 0,void 0,function*(){const e=yield t,n={};return["from","to"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f?this._getAddress(f):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f?zt.from(f):null))}),["type"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f??null))}),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f?Ut(f):null))}),this.formatter.transactionRequest(yield gr(n))})}_getFilter(t){return ae(this,void 0,void 0,function*(){t=yield t;const e={};return t.address!=null&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach(n=>{t[n]!=null&&(e[n]=t[n])}),["fromBlock","toBlock"].forEach(n=>{t[n]!=null&&(e[n]=this._getBlockTag(t[n]))}),this.formatter.filter(yield gr(e))})}_call(t,e,n){return ae(this,void 0,void 0,function*(){n>=wS&&me.throwError("CCIP read exceeded maximum redirections",_t.errors.SERVER_ERROR,{redirects:n,transaction:t});const a=t.to,f=yield this.perform("call",{transaction:t,blockTag:e});if(n>=0&&e==="latest"&&a!=null&&f.substring(0,10)==="0x556f1830"&&cs(f)%32===4)try{const c=Ar(f,4),y=Ar(c,0,32);zt.from(y).eq(a)||me.throwError("CCIP Read sender did not match",_t.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:f});const b=[],w=zt.from(Ar(c,32,64)).toNumber(),E=zt.from(Ar(c,w,w+32)).toNumber(),M=Ar(c,w+32);for(let q=0;q<E;q++){const V=Xh(M,q*32);V==null&&me.throwError("CCIP Read contained corrupt URL string",_t.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:f}),b.push(V)}const O=Sa(c,64);zt.from(Ar(c,100,128)).isZero()||me.throwError("CCIP Read callback selector included junk",_t.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:f});const F=Ar(c,96,100),B=Sa(c,128),L=yield this.ccipReadFetch(t,O,b);L==null&&me.throwError("CCIP Read disabled or provided no URLs",_t.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:f});const z={to:a,data:Mi([F,C3([L,B])])};return this._call(z,e,n+1)}
12catch(c){if(c.code===_t.errors.SERVER_ERROR)throw c}try{return Ut(f)}catch(c){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:f,error:c})}})}call(t,e){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield gr({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)})}estimateGas(t){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield gr({transaction:this._getTransactionRequest(t)}),n=yield this.perform("estimateGas",e);try{return zt.from(n)}catch(a){return me.throwError("bad result from backend",_t.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:n,error:a})}})}_getAddress(t){return ae(this,void 0,void 0,function*(){t=yield t,typeof t!="string"&&me.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return e==null&&me.throwError("ENS name not configured",_t.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e})}_getBlock(t,e){return ae(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let n=-128;const a={includeTransactions:!!e};if(xe(t,32))a.blockHash=t;else try{a.blockTag=yield this._getBlockTag(t),xe(a.blockTag)&&(n=parseInt(a.blockTag.substring(2),16))}catch{me.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return W0(()=>ae(this,void 0,void 0,function*(){const f=yield this.perform("getBlock",a);if(f==null)return a.blockHash!=null&&this._emitted["b:"+a.blockHash]==null||a.blockTag!=null&&n>this._emitted.block?null:void 0;if(e){let c=null;for(let b=0;b<f.transactions.length;b++){const w=f.transactions[b];if(w.blockNumber==null)w.confirmations=0;else if(w.confirmations==null){c==null&&(c=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let E=c-w.blockNumber+1;E<=0&&(E=1),w.confirmations=E}}const y=this.formatter.blockWithTransactions(f);return y.transactions=y.transactions.map(b=>this._wrapTransaction(b)),y}return this.formatter.block(f)}),{oncePoll:this})})}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return ae(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return W0(()=>ae(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",e);if(n==null)return this._emitted["t:"+t]==null?null:void 0;const a=this.formatter.transactionResponse(n);if(a.blockNumber==null)a.confirmations=0;else if(a.confirmations==null){let c=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-a.blockNumber+1;c<=0&&(c=1),a.confirmations=c}return this._wrapTransaction(a)}),{oncePoll:this})})}getTransactionReceipt(t){return ae(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return W0(()=>ae(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",e);if(n==null)return this._emitted["t:"+t]==null?null:void 0;if(n.blockHash==null)return;const a=this.formatter.receipt(n);if(a.blockNumber==null)a.confirmations=0;else if(a.confirmations==null){let c=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-a.blockNumber+1;c<=0&&(c=1),a.confirmations=c}return a}),{oncePoll:this})})}getLogs(t){return ae(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield gr({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);return n.forEach(a=>{a.removed==null&&(a.removed=!1)}),xx.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return ae(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(t){return ae(this,void 0,void 0,function*(){if(t=yield t,typeof t=="number"&&t<0){t%1&&me.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)})}getResolver(t){return ae(this,void 0,void 0,function*(){let e=t;for(;;){if(e===""||e==="."||t!=="eth"&&e==="eth")return null;const n=yield this._getResolver(e,"getResolver");if(n!=null){const a=new Nx(this,n,t);return e!==t&&!(yield a.supportsWildcard())?null:a}e=e.split(".").slice(1).join(".")}})}_getResolver(t,e){return ae(this,void 0,void 0,function*(){e==null&&(e="ENS");const n=yield this.getNetwork();n.ensAddress||me.throwError("network does not support ENS",_t.errors.UNSUPPORTED_OPERATION,{operation:e,network:n.name});try{const a=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+ph(t).substring(2)});return this.formatter.callAddress(a)}catch{}return null})}resolveName(t){return ae(this,void 0,void 0,function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(n){if(xe(t))throw n}typeof t!="string"&&me.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null})}lookupAddress(t){return ae(this,void 0,void 0,function*(){t=yield t,t=this.formatter.address(t);const e=t.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e,"lookupAddress");if(n==null)return null;const a=Xh(yield this.call({to:n,data:"0x691f3431"+ph(e).substring(2)}),0);return(yield this.resolveName(a))!=t?null:a})}getAvatar(t){return ae(this,void 0,void 0,function*(){let e=null;if(xe(t)){const f=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",c=yield this._getResolver(f,"getAvatar");if(!c)return null;e=new Nx(this,c,f);try{const y=yield e.getAvatar();if(y)return y.url}catch(y){if(y.code!==_t.errors.CALL_EXCEPTION)throw y}try{const y=Xh(yield this.call({to:c,data:"0x691f3431"+ph(f).substring(2)}),0);e=yield this.getResolver(y)}catch(y){if(y.code!==_t.errors.CALL_EXCEPTION)throw y;return null}}else if(e=yield this.getResolver(t),!e)return null;const n=yield e.getAvatar();return n==null?null:n.url})}perform(t,e){return me.throwError(t+" not implemented",_t.errors.NOT_IMPLEMENT
12ED,{operation:t})}_startEvent(t){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(t){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(t,e,n){const a=new MS(Is(t),e,n);return this._events.push(a),this._startEvent(a),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,a=[],f=Is(t);return this._events=this._events.filter(c=>c.tag!==f?!0:(setTimeout(()=>{c.listener.apply(this,e)},0),n=!0,c.once?(a.push(c),!1):!0)),a.forEach(c=>{this._stopEvent(c)}),n}listenerCount(t){if(!t)return this._events.length;let e=Is(t);return this._events.filter(n=>n.tag===e).length}listeners(t){if(t==null)return this._events.map(n=>n.listener);let e=Is(t);return this._events.filter(n=>n.tag===e).map(n=>n.listener)}off(t,e){if(e==null)return this.removeAllListeners(t);const n=[];let a=!1,f=Is(t);return this._events=this._events.filter(c=>c.tag!==f||c.listener!=e||a?!0:(a=!0,n.push(c),!1)),n.forEach(c=>{this._stopEvent(c)}),this}removeAllListeners(t){let e=[];
12if(t==null)e=this._events,this._events=[];else{const n=Is(t);this._events=this._events.filter(a=>a.tag!==n?!0:(e.push(a),!1))}return e.forEach(n=>{this._stopEvent(n)}),this}};var Zo=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Er=new _t(Ja),RS=["call","estimateGas"];function fa(r,t){if(r==null)return null;if(typeof r.message=="string"&&r.message.match("reverted")){const e=xe(r.data)?r.data:null;if(!t||e)return{message:r.message,data:e}}if(typeof r=="object"){for(const e in r){const n=fa(r[e],t);if(n)return n}return null}if(typeof r=="string")try{return fa(JSON.parse(r),t)}catch{}return null}function O3(r,t,e){const n=e.transaction||e.signedTransaction;if(r==="call"){const f=fa(t,!0);if(f)return f.data;Er.throwError("missing revert data in call exception; Transaction reverted without a reason string",_t.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if(r==="estimateGas"){let f=fa(t.body,!1);f==null&&(f=fa(t,!1)),f&&Er.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",_t.errors.UNPREDICTABLE_GAS_LIMIT,{reason:f.message,method:r,transaction:n,error:t})}let a=t.message;throw t.code===_t.errors.SERVER_ERROR&&t.error&&typeof t.error.message=="string"?a=t.error.message:typeof t.body=="string"?a=t.body:typeof t.responseText=="string"&&(a=t.responseText),a=(a||"").toLowerCase(),a.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Er.throwError("insufficient funds for intrinsic transaction cost",_t.errors.INSUFFICIENT_FUNDS,{error:t,method:r,transaction:n}),a.match(/nonce (is )?too low/i)&&Er.throwError("nonce has already been used",_t.errors.NONCE_EXPIRED,{error:t,method:r,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Er.throwError("replacement fee too low",_t.errors.REPLACEMENT_UNDERPRICED,{error:t,method:r,transaction:n}),a.match(/only replay-protected/i)&&Er.throwError("legacy pre-eip-155 transactions not supported",_t.errors.UNSUPPORTED_OPERATION,{error:t,method:r,transaction:n}),RS.indexOf(r)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Er.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",_t.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:r,transaction:n}),t}function _x(r){return new Promise(function(t){setTimeout(t,r)})}function TS(r){if(r.error){const t=new Error(r.error.message);throw t.code=r.error.code,t.data=r.error.data,t}return r.result}function D0(r){return r&&r.toLowerCase()}const Yd={};let k3=class extends El{constructor(t,e,n){if(super(),t!==Yd)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Pt(this,"provider",e),n==null&&(n=0),typeof n=="string"?(Pt(this,"_address",this.provider.formatter.address(n)),Pt(this,"_index",null)):typeof n=="number"?(Pt(this,"_index",n),Pt(this,"_address",null)):Er.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return Er.throwError("cannot alter JSON-RPC Signer connection",_t.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new PS(Yd,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(t=>(t.length<=this._index&&Er.throwError("unknown account #"+this._index,_t.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index])))}sendUncheckedTransaction(t){t=Jr(t);const e=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(t.gasLimit==null){const n=Jr(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return t.to!=null&&(t.to=Promise.resolve(t.to).then(n=>Zo(this,void 0,void 0,function*(){if(n==null)return null;const a=yield this.provider.resolveName(n);return a==null&&Er.throwArgumentError("provided ENS name resolves to null","tx.to",n),a}))),gr({tx:gr(t),sender:e}).then(({tx:n,sender:a})=>{n.from!=null?n.from.toLowerCase()!==a&&Er.throwArgumentError("from address mismatch","transaction",t):n.from=a;const f=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[f]).then(c=>c,c=>(typeof c.message=="string"&&c.message.match(/user denied/i)&&Er.throwError("user rejected transaction",_t.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),O3("sendTransaction",c,f)))})}signTransaction(t){return Er.throwError("signing transactions is unsupported",_t.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Zo(this,void 0,void 0,function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield W0(()=>Zo(this,void 0,void 0,function*(){const a=yield this.provider.getTransaction(n);if(a!==null)return this.provider._wrapTransaction(a,n,e)}),{oncePoll:this.provider})}catch(a){throw a.transactionHash=n,a}})}signMessage(t){return Zo(this,void 0,void 0,function*(){const e=typeof t=="string"?cr(t):t,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ut(e),n.toLowerCase()])}catch(a){throw typeof a.message=="string"&&a.message.match(/user denied/i)&&Er.throwError("user rejected signing",_t.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),a}})}_legacySignMessage(t){return Zo(this,void 0,void 0,function*(){const e=typeof t=="string"?cr(t):t,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Ut(e)])}catch(a){throw typeof a.message=="string"&&a.message.match(/user denied/i)&&Er.throwError("user rejected signing",_t.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),a}})}_signTypedData(t,e,n){return Zo(this,void 0,void 0,function*(){const a=yield da.resolveNames(t,e,n,c=>this.provider.resolveName(c)),f=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[f.toLowerCase(),JSON.stringify(da.getPayload(a.domain,e,a.value))])}catch(c){throw typeof c.message=="string"&&c.message.match(/user denied/i)&&Er.throwError("user rejected signing",_t.errors.ACTION_REJECTED,{action:"_signTypedData",from:f,messageData:{domain:a.domain,types:e,value:a.value}}),c}})}unlock(t){return Zo(this,void 0,void 0,function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])})}},PS=class extends k3{sendTransaction(t){return this.sendUncheckedTransaction(t).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(e,n)}))}};const CS={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let B3=class extends IS{constructor(t,e){let n=e;n==null&&(n=new Promise((a,f)=>{setTimeout(()=>{this.detectNetwork().then(c=>{a(c)},c=>{f(c)})},0)})),super(n),t||(t=Bi(this.constructor,"defaultUrl")()),typeof t=="string"?Pt(this,"connection",Object.freeze({url:t})):Pt(this,"connection",Object.freeze(Jr(t))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Zo(this,void 0,void 0,function*(){yield _x(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch{try{t=yield this.send("net_version",[])}catch{}}if(t!=null){const e=Bi(this.constructor,"getNetwork");try{return e(zt.from(t).toNumber())}catch(n){return Er.throwError("could not detect network",_t.errors.NETWORK_E
12RROR,{chainId:t,event:"invalidNetwork",serverError:n})}}return Er.throwError("could not detect network",_t.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(t){return new k3(Yd,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(t=>t.map(e=>this.formatter.address(e)))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:lf(n),provider:this});const a=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(a&&this._cache[t])return this._cache[t];const f=G1(this.connection,JSON.stringify(n),TS).then(c=>(this.emit("debug",{action:"response",request:n,response:c,provider:this}),c),c=>{throw this.emit("debug",{action:"response",error:c,request:n,provider:this}),c});return a&&(this._cache[t]=f,setTimeout(()=>{this._cache[t]=null},0)),f}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[D0(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[D0(e.address),e.blockTag]];case"getCode":return["eth_getCode",[D0(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[D0(e.address),Qe(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[Bi(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[Bi(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&e.filter.address!=null&&(e.filter.address=D0(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Zo(this,void 0,void 0,function*(){if(t==="call"||t==="estimateGas"){const a=e.transaction;if(a&&a.type!=null&&zt.from(a.type).isZero()&&a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null){const f=yield this.getFeeData();f.maxFeePerGas==null&&f.maxPriorityFeePerGas==null&&(e=Jr(e),e.transaction=Jr(a),delete e.transaction.type)}}const n=this.prepareRequest(t,e);n==null&&Er.throwError(t+" not implemented",_t.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(a){return O3(t,a,e)}})}_startEvent(t){t.tag==="pending"&&this._startPending(),super._startEvent(t)}_startPending(){if(this._pendingFilter!=null)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then(function(n){function a(){t.send("eth_getFilterChanges",[n]).then(function(f){if(t._pendingFilter!=e)return null;let c=Promise.resolve();return f.forEach(function(y){t._emitted["t:"+y.toLowerCase()]="pending",c=c.then(function(){return t.getTransaction(y).then(function(b){return t.emit("pending",b),null})})}),c.then(function(){return _x(1e3)})}).then(function(){if(t._pendingFilter!=e){t.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){a()},0),null}).catch(f=>{})}return a(),n}).catch(n=>{})}_stopEvent(t){t.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=Jr(CS);if(e)for(const f in e)e[f]&&(n[f]=!0);z2(t,n);const a={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(f){if(t[f]==null)return;const c=pp(zt.from(t[f]));f==="gasLimit"&&(f="gas"),a[f]=c}),["from","to","data"].forEach(function(f){t[f]!=null&&(a[f]=Ut(t[f]))}),t.accessList&&(a.accessList=A0(t.accessList)),a}};var OS=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const kS=new _t(Ja);let $T=class extends B3{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return OS(this,void 0,void 0,function*(){let e=this.network;
12return e==null&&(e=yield t.detectNetwork.call(this),e||kS.throwError("no network detected",_t.errors.UNKNOWN_ERROR,{}),this._network==null&&(Pt(this,"_network",e),this.emit("network",e,null))),e})}};const Sx=new _t(Ja);let BS=1;function Ix(r,t){const e="Web3LegacyFetcher";return function(n,a){const f={method:n,params:a,id:BS++,jsonrpc:"2.0"};return new Promise((c,y)=>{this.emit("debug",{action:"request",fetcher:e,request:lf(f),provider:this}),t(f,(b,w)=>{if(b)return this.emit("debug",{action:"response",fetcher:e,error:b,request:f,provider:this}),y(b);if(this.emit("debug",{action:"response",fetcher:e,request:f,response:w,provider:this}),w.error){const E=new Error(w.error.message);return E.code=w.error.code,E.data=w.error.data,y(E)}c(w.result)})})}}function US(r){return function(t,e){e==null&&(e=[]);const n={method:t,params:e};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:lf(n),provider:this}),r.request(n).then(a=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:a,provider:this}),a),a=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:a,provider:this}),a})}}class zT extends B3{constructor(t,e){t==null&&Sx.throwArgumentError("missing provider","provider",t);let n=null,a=null,f=null;typeof t=="function"?(n="unknown:",a=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),f=t,t.request?(n===""&&(n="eip-1193:"),a=US(t)):t.sendAsync?a=Ix(t,t.sendAsync.bind(t)):t.send?a=Ix(t,t.send.bind(t)):Sx.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,e),Pt(this,"jsonRpcFetchFunc",a),Pt(this,"provider",f)}send(t,e){return this.jsonRpcFetchFunc(t,e)}}const Va="abi/5.7.0",ze=new _t(Va),ms={};let Rx={calldata:!0,memory:!0,storage:!0},FS={calldata:!0,memory:!0};function nh(r,t){if(r==="bytes"||r==="string"){if(Rx[t])return!0}else if(r==="address"){if(t==="payable")return!0}else if((r.indexOf("[")>=0||r==="tuple")&&FS[t])return!0;return(Rx[t]||t==="payable")&&ze.throwArgumentError("invalid modifier","name",t),!1}function DS(r,t){let e=r;function n(y){ze.throwArgumentError(`unexpected character at position ${y}`,"param",r)}r=r.replace(/\s/g," ");function a(y){let b={type:"",name:"",parent:y,state:{allowType:!0}};return t&&(b.indexed=!1),b}let f={type:"",name:"",state:{allowType:!0}},c=f;for(let y=0;y<r.length;y++){let b=r[y];switch(b){case"(":c.state.allowType&&c.type===""?c.type="tuple":c.state.allowParams||n(y),c.state.allowType=!1,c.type=Fs(c.type),c.components=[a(c)],c=c.components[0];break;case")":delete c.state,c.name==="indexed"&&(t||n(y),c.indexed=!0,c.name=""),nh(c.type,c.name)&&(c.name=""),c.type=Fs(c.type);let w=c;c=c.parent,c||n(y),delete w.parent,c.state.allowParams=!1,c.state.allowName=!0,c.state.allowArray=!0;break;case",":delete c.state,c.name==="indexed"&&(t||n(y),c.indexed=!0,c.name=""),nh(c.type,c.name)&&(c.name=""),c.type=Fs(c.type);let E=a(c.parent);c.parent.components.push(E),delete c.parent,c=E;break;case" ":c.state.allowType&&c.type!==""&&(c.type=Fs(c.type),delete c.state.allowType,c.state.allowName=!0,c.state.allowParams=!0),c.state.allowName&&c.name!==""&&(c.name==="indexed"?(t||n(y),c.indexed&&n(y),c.indexed=!0,c.name=""):nh(c.type,c.name)?c.name="":c.state.allowName=!1);break;case"[":c.state.allowArray||n(y),c.type+=b,c.state.allowArray=!1,c.state.allowName=!1,c.state.readArray=!0;break;case"]":c.state.readArray||n(y),c.type+=b,c.state.readArray=!1,c.state.allowArray=!0,c.state.allowName=!0;break;default:c.state.allowType?(c.type+=b,c.state.allowParams=!0,c.state.allowArray=!0):c.state.allowName?(c.name+=b,delete c.state.allowArray):c.state.readArray?c.type+=b:n(y)}}return c.parent&&ze.throwArgumentError("unexpected eof","param",r),delete f.state,c.name==="indexed"?(t||n(e.length-7),c.indexed&&n(e.length-7),c.indexed=!0,c.name=""):nh(c.type,c.name)&&(c.name=""),f.type=Fs(f.type),f}function Zh(r,t){for(let e in t)Pt(r,e,t[e])}const Ke=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),LS=new RegExp(/^(.*)\[([0-9]*)\]$/);class Wr{constructor(t,e){t!==ms&&ze.throwError("use fromString",_t.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}
12),Zh(this,e);let n=this.type.match(LS);n?Zh(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Wr.fromObject({type:n[1],components:this.components}),baseType:"array"}):Zh(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=Ke.sighash),Ke[t]||ze.throwArgumentError("invalid format type","format",t),t===Ke.json){let n={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(a=>JSON.parse(a.format(t)))),JSON.stringify(n)}let e="";return this.baseType==="array"?(e+=this.arrayChildren.format(t),e+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(t!==Ke.sighash&&(e+=this.type),e+="("+this.components.map(n=>n.format(t)).join(t===Ke.full?", ":",")+")"):e+=this.type,t!==Ke.sighash&&(this.indexed===!0&&(e+=" indexed"),t===Ke.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return typeof t=="string"?Wr.fromString(t,e):Wr.fromObject(t)}static fromObject(t){return Wr.isParamType(t)?t:new Wr(ms,{name:t.name||null,type:Fs(t.type),indexed:t.indexed==null?null:!!t.indexed,components:t.components?t.components.map(Wr.fromObject):null})}static fromString(t,e){function n(a){return Wr.fromObject({name:a.name,type:a.type,indexed:a.indexed,components:a.components})}return n(DS(t,!!e))}static isParamType(t){return!!(t!=null&&t._isParamType)}}function Ia(r,t){return GS(r).map(e=>Wr.fromString(e,t))}class ff{constructor(t,e){t!==ms&&ze.throwError("use a static from method",_t.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Zh(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return ff.isFragment(t)?t:typeof t=="string"?ff.fromString(t):ff.fromObject(t)}static fromObject(t){if(ff.isFragment(t))return t;switch(t.type){case"function":return Bo.fromObject(t);case"event":return rf.fromObject(t);case"constructor":return ko.fromObject(t);case"error":return Pf.fromObject(t);case"fallback":case"receive":return null}return ze.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return t=t.replace(/\s/g," "),t=t.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),t=t.trim(),t.split(" ")[0]==="event"?rf.fromString(t.substring(5).trim()):t.split(" ")[0]==="function"?Bo.fromString(t.substring(8).trim()):t.split("(")[0].trim()==="constructor"?ko.fromString(t.trim()):t.split(" ")[0]==="error"?Pf.fromString(t.substring(5).trim()):ze.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}}class rf extends ff{format(t){if(t||(t=Ke.sighash),Ke[t]||ze.throwArgumentError("invalid format type","format",t),t===Ke.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let e="";return t!==Ke.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===Ke.full?", ":",")+") ",t!==Ke.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return typeof t=="string"?rf.fromString(t):rf.fromObject(t)}static fromObject(t){if(rf.isEventFragment(t))return t;t.type!=="event"&&ze.throwArgumentError("invalid event object","value",t);const e={name:Ra(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Wr.fromObject):[],type:"event"};return new rf(ms,e)}static fromString(t){let e=t.match(Ta);e||ze.throwArgumentError("invalid event string","value",t);let n=!1;return e[3].split(" ").forEach(a=>{switch(a.trim()){case"anonymous":n=!0;break;case"":break;default:ze.warn("unknown modifier: "+a)}}),rf.fromObject({name:e[1].trim(),anonymous:n,inputs:Ia(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&t.type==="event"}}function U3(r,t){t.gas=null;let e=r.split("@");return e.length!==1?(e.length>2&&ze.throwArgumentError("invalid human-readable ABI signature","value",r),e[1].match(/^[0-9]+$/)||ze.throwArgumentError("invalid human-readable ABI signature gas","value",r),t.gas=zt.from(e[1]),e[0]):r}function F3(r,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",r.split(" ").forEach(e
12=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:""+e}})}function D3(r){let t={constant:!1,payable:!0,stateMutability:"payable"};return r.stateMutability!=null?(t.stateMutability=r.stateMutability,t.constant=t.stateMutability==="view"||t.stateMutability==="pure",r.constant!=null&&!!r.constant!==t.constant&&ze.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",r),t.payable=t.stateMutability==="payable",r.payable!=null&&!!r.payable!==t.payable&&ze.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",r)):r.payable!=null?(t.payable=!!r.payable,r.constant==null&&!t.payable&&r.type!=="constructor"&&ze.throwArgumentError("unable to determine stateMutability","value",r),t.constant=!!r.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ze.throwArgumentError("cannot have constant payable function","value",r)):r.constant!=null?(t.constant=!!r.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):r.type!=="constructor"&&ze.throwArgumentError("unable to determine stateMutability","value",r),t}class ko extends ff{format(t){if(t||(t=Ke.sighash),Ke[t]||ze.throwArgumentError("invalid format type","format",t),t===Ke.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});t===Ke.sighash&&ze.throwError("cannot format a constructor for sighash",_t.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map(n=>n.format(t)).join(t===Ke.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(e+=this.stateMutability+" "),e.trim()}static from(t){return typeof t=="string"?ko.fromString(t):ko.fromObject(t)}static fromObject(t){if(ko.isConstructorFragment(t))return t;t.type!=="constructor"&&ze.throwArgumentError("invalid constructor object","value",t);let e=D3(t);e.constant&&ze.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Wr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?zt.from(t.gas):null};return new ko(ms,n)}static fromString(t){let e={type:"constructor"};t=U3(t,e);let n=t.match(Ta);return(!n||n[1].trim()!=="constructor")&&ze.throwArgumentError("invalid constructor string","value",t),e.inputs=Ia(n[2].trim(),!1),F3(n[3].trim(),e),ko.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&t.type==="constructor"}}class Bo extends ko{format(t){if(t||(t=Ke.sighash),Ke[t]||ze.throwArgumentError("invalid format type","format",t),t===Ke.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t))),outputs:this.outputs.map(n=>JSON.parse(n.format(t)))});let e="";return t!==Ke.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===Ke.full?", ":",")+") ",t!==Ke.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map(n=>n.format(t)).join(", ")+") "),this.gas!=null&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return typeof t=="string"?Bo.fromString(t):Bo.fromObject(t)}static fromObject(t){if(Bo.isFunctionFragment(t))return t;t.type!=="function"&&ze.throwArgumentError("invalid function object","value",t);let e=D3(t);const n={type:t.type,name:Ra(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(Wr.fromObject):[],outputs:t.outputs?t.outputs.map(Wr.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?zt.from(t.gas):null};return new Bo(ms,n)}static fromString(t){let e={type:"function"};t=U3(t,e);let n=t.split(" returns ");n.length>2&&ze.throwArgumentError("invalid function string","value",t);let a=n[0].match(Ta);if(a||ze.throwArgumentError("invalid function signature","value",t),e.name=a[1].trim(),e.name&&Ra(e.name),e.inputs=Ia(a[2],!1),F3(a[3].trim(),e),n.length>1){let f=n[1].match(Ta);(f[1].trim()!=""||f[3].trim()!="")&&ze.throwArgumentError("unexpected tokens","value",t),e.outputs=Ia(f[2],!1)}else e.outputs=[];return Bo.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&t.type==="function"}}function Tx(r){const t=r.format();return(t==="Error(string)"||t==="Panic(uint256)")&&ze.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",r),r}class Pf extends ff{format(t){if(t||(t=Ke.sighash),Ke[t]||ze.throwArgumentError("invalid format type","format",t),t===Ke.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let e="";return t!==Ke.sighash&&(e+="error "),e+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===Ke.full?", ":",")+") ",e.trim()}static from(t){return typeof t=="string"?Pf.fromString(t):Pf.fromObject(t)}static fromObject(t){if(Pf.isErrorFragment(t))return t;t.type!=="error"&&ze.throwArgumentError("invalid error object","value",t);const e={type:t.type,name:Ra(t.name),inputs:t.inputs?t.inputs.map(Wr.fromObject):[]};return Tx(new Pf(ms,e))}static fromString(t){let e={type:"error"},n=t.match(Ta);return n||ze.throwArgumentError("invalid error signature","value",t),e.name=n[1].trim(),e.name&&Ra(e.name),e.inputs=Ia(n[2],!1),Tx(Pf.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&t.type==="error"}}function Fs(r){return r.match(/^uint($|[^1-9])/)?r="uint256"+r.substring(4):r.match(/^int($|[^1-9])/)&&(r="int256"+r.substring(3)),r}const $S=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ra(r){return(!r||!r.match($S))&&ze.throwArgumentError(`invalid identifier "${r}"`,"value",r),r}const Ta=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function GS(r){r=r.trim();let t=[],e="",n=0;for(let a=0;a<r.length;a++){let f=r[a];f===","&&n===0?(t.push(e),e=""):(e+=f,f==="("?n++:f===")"&&(n--,n===-1&&ze.throwArgumentError("unbalanced parenthesis","value",r)))}return e&&t.push(e),t}const z1=new _t(Va);function zS(r){const t=[],e=function(n,a){if(Array.isArray(a))for(let f in a){const c=n.slice();c.push(f);try{e(c,a[f])}catch(y){t.push({path:c,error:y})}}};return e([],r),t}class bf{constructor(t,e,n,a){this.name=t,this.type=e,this.localName=n,this.dynamic=a}_throwError(t,e){z1.throwArgumentError(t,this.localName,e)}}class tp{constructor(t){Pt(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return Mi(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(Ve(t._data))}writeBytes(t){let e=kt(t);const n=e.length%this.wordSize;
12return n&&(e=Ve([e,this._padding.slice(n)])),this._writeData(e)}_getValue(t){let e=kt(zt.from(t));return e.length>this.wordSize&&z1.throwError("value out-of-bounds",_t.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=Ve([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class Uu{constructor(t,e,n,a){Pt(this,"_data",kt(t)),Pt(this,"wordSize",e||32),Pt(this,"_coerceFunc",n),Pt(this,"allowLoose",a),this._offset=0}get data(){return Ut(this._data)}get consumed(){return this._offset}static coerce(t,e){let n=t.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):Uu.coerce(t,e)}_peekBytes(t,e,n){let a=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+a>this._data.length&&(this.allowLoose&&n&&this._offset+e<=this._data.length?a=e:z1.throwError("data out-of-bounds",_t.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+a})),this._data.slice(this._offset,this._offset+a)}subReader(t){return new Uu(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let n=this._peekBytes(0,t,!!e);return this._offset+=n.length,n.slice(0,t)}readValue(){return zt.from(this.readBytes(this.wordSize))}}class qS extends bf{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=je(e)}catch(n){this._throwError(n.message,e)}return t.writeValue(e)}decode(t){return je(Qe(t.readValue().toHexString(),20))}}class KS extends bf{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}const $s=new _t(Va);function L3(r,t,e){let n=null;if(Array.isArray(e))n=e;else if(e&&typeof e=="object"){let b={};n=t.map(w=>{const E=w.localName;return E||$s.throwError("cannot encode object for signature with missing names",_t.errors.INVALID_ARGUMENT,{argument:"values",coder:w,value:e}),b[E]&&$s.throwError("cannot encode object for signature with duplicate names",_t.errors.INVALID_ARGUMENT,{argument:"values",coder:w,value:e}),b[E]=!0,e[E]})}else $s.throwArgumentError("invalid tuple value","tuple",e);t.length!==n.length&&$s.throwArgumentError("types/value length mismatch","tuple",e);let a=new tp(r.wordSize),f=new tp(r.wordSize),c=[];t.forEach((b,w)=>{let E=n[w];if(b.dynamic){let M=f.length;b.encode(f,E);let O=a.writeUpdatableValue();c.push(F=>{O(F+M)})}else b.encode(a,E)}),c.forEach(b=>{b(a.length)});let y=r.appendWriter(a);return y+=r.appendWriter(f),y}function $3(r,t){let e=[],n=r.subReader(0);t.forEach(f=>{let c=null;if(f.dynamic){let y=r.readValue(),b=n.subReader(y.toNumber());try{c=f.decode(b)}catch(w){if(w.code===_t.errors.BUFFER_OVERRUN)throw w;c=w,c.baseType=f.name,c.name=f.localName,c.type=f.type}}else try{c=f.decode(r)}catch(y){if(y.code===_t.errors.BUFFER_OVERRUN)throw y;c=y,c.baseType=f.name,c.name=f.localName,c.type=f.type}c!=null&&e.push(c)});const a=t.reduce((f,c)=>{const y=c.localName;return y&&(f[y]||(f[y]=0),f[y]++),f},{});t.forEach((f,c)=>{let y=f.localName;if(!y||a[y]!==1||(y==="length"&&(y="_length"),e[y]!=null))return;const b=e[c];b instanceof Error?Object.defineProperty(e,y,{enumerable:!0,get:()=>{throw b}}):e[y]=b});for(let f=0;f<e.length;f++){const c=e[f];c instanceof Error&&Object.defineProperty(e,f,{enumerable:!0,get:()=>{throw c}})}return Object.freeze(e)}class HS extends bf{constructor(t,e,n){const a=t.type+"["+(e>=0?e:"")+"]",f=e===-1||t.dynamic;super("array",a,n,f),this.coder=t,this.length=e}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;n<this.length;n++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let n=this.length;n===-1&&(n=e.length,t.writeValue(e.length)),$s.checkArgumentCount(e.length,n,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let f=0;f<e.length;f++)a.push(this.coder);return L3(t,a,e)}decode(t){let e=this.length;e===-1&&(e=t.readValue().toNumber(),e*32>t._data.length&&$s.throwError("insufficient data length",_t.errors.BUFFER_OVERRUN,{length:t._data.length,count:e}));let n=[];for(let a=0;a<e;a++)n.push(new KS(this.coder));return t.coerce(this.name,$3(t,n))}}class WS extends bf{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class G3 extends bf{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=kt(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class JS extends G3{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,Ut(super.decode(t)))}}class VS extends bf{constructor(t,e){let n="bytes"+String(t);super(n,n,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,e){let n=kt(e);return n.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(n)}decode(t){return t.coerce(this.name,Ut(t.readBytes(this.size)))}}class jS extends bf{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}class XS extends bf{constructor(t,e,n){const a=(e?"int":"uint")+t*8;super(a,a,n,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let n=zt.from(e),a=iy.mask(t.wordSize*8);if(this.signed){let f=a.mask(this.size*8-1);(n.gt(f)||n.lt(f.add(ry).mul(ey)))&&this._throwError("value out-of-bounds",e)}else(n.lt(yp)||n.gt(a.mask(this.size*8)))&&this._throwError("value out-of-bounds",e);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let e=t.readValue().mask(this.size*8);return this.signed&&(e=e.fromTwos(this.size*8)),t.coerce(this.name,e)}}class ZS extends G3{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,cr(e))}decode(t){return g0(super.decode(t))}}class oh extends bf{constructor(t,e){let n=!1;const a=[];t.forEach(c=>{c.dynamic&&(n=!0),a.push(c.type)});const f="tuple("+a.join(",")+")";super("tuple",f,e,n),this.coders=t}defaultValue(){const t=[];
12this.coders.forEach(n=>{t.push(n.defaultValue())});const e=this.coders.reduce((n,a)=>{const f=a.localName;return f&&(n[f]||(n[f]=0),n[f]++),n},{});return this.coders.forEach((n,a)=>{let f=n.localName;!f||e[f]!==1||(f==="length"&&(f="_length"),t[f]==null&&(t[f]=t[a]))}),Object.freeze(t)}encode(t,e){return L3(t,this.coders,e)}decode(t){return t.coerce(this.name,$3(t,this.coders))}}const fh=new _t(Va),QS=new RegExp(/^bytes([0-9]*)$/),YS=new RegExp(/^(u?int)([0-9]*)$/);class t9{constructor(t){Pt(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new qS(t.name);case"bool":return new WS(t.name);case"string":return new ZS(t.name);case"bytes":return new JS(t.name);case"array":return new HS(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new oh((t.components||[]).map(n=>this._getCoder(n)),t.name);case"":return new jS(t.name)}let e=t.type.match(YS);if(e){let n=parseInt(e[2]||"256");return(n===0||n>256||n%8!==0)&&fh.throwArgumentError("invalid "+e[1]+" bit length","param",t),new XS(n/8,e[1]==="int",t.name)}if(e=t.type.match(QS),e){let n=parseInt(e[1]);return(n===0||n>32)&&fh.throwArgumentError("invalid bytes length","param",t),new VS(n,t.name)}return fh.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new Uu(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new tp(this._getWordSize())}getDefaultValue(t){const e=t.map(a=>this._getCoder(Wr.from(a)));return new oh(e,"_").defaultValue()}encode(t,e){t.length!==e.length&&fh.throwError("types/values length mismatch",_t.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});const n=t.map(c=>this._getCoder(Wr.from(c))),a=new oh(n,"_"),f=this._getWriter();return a.encode(f,e),f.data}decode(t,e,n){const a=t.map(c=>this._getCoder(Wr.from(c)));return new oh(a,"_").decode(this._getReader(kt(e),n))}}const e9=new t9,or=new _t(Va);class r9 extends Wi{}class i9 extends Wi{}class n9 extends Wi{}class ep extends Wi{static isIndexed(t){return!!(t&&t._isIndexed)}}const o9={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Px(r,t){const e=new Error(`deferred error during ABI decoding triggered accessing ${r}`);return e.error=t,e}class Cx{constructor(t){let e=[];typeof t=="string"?e=JSON.parse(t):e=t,Pt(this,"fragments",e.map(n=>ff.from(n)).filter(n=>n!=null)),Pt(this,"_abiCoder",Bi(new.target,"getAbiCoder")()),Pt(this,"functions",{}),Pt(this,"errors",{}),Pt(this,"events",{}),Pt(this,"structs",{}),this.fragments.forEach(n=>{let a=null;switch(n.type){case"constructor":if(this.deploy){or.warn("duplicate definition - constructor");return}Pt(this,"deploy",n);return;case"function":a=this.functions;break;case"event":a=this.events;break;case"error":a=this.errors;break;default:return}let f=n.format();if(a[f]){or.warn("duplicate definition - "+f);return}a[f]=n}),this.deploy||Pt(this,"deploy",ko.from({payable:!1,type:"constructor"})),Pt(this,"_isInterface",!0)}format(t){t||(t=Ke.full),t===Ke.sighash&&or.throwArgumentError("interface does not support formatting sighash","format",t);const e=this.fragments.map(n=>n.format(t));return t===Ke.json?JSON.stringify(e.map(n=>JSON.parse(n))):e}static getAbiCoder(){return e9}static getAddress(t){return je(t)}static getSighash(t){return Ar(po(t.format()),0,4)}static getEventTopic(t){return po(t.format())}getFunction(t){if(xe(t)){for(const n in this.functions)if(t===this.getSighash(n))return this.functions[n];or.throwArgumentError("no matching function","sighash",t)}if(t.indexOf("(")===-1){const n=t.trim(),a=Object.keys(this.functions).filter(f=>f.split("(")[0]===n);return a.length===0?or.throwArgumentError("no matching function","name",n):a.length>1&&or.throwArgumentError("multiple matching functions","name",n),this.functions[a[0]]}const e=this.functions[Bo.fromString(t).format()];return e||or.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(xe(t)){const n=t.toLowerCase();for(const a in this.events)if(n===this.getEventTopic(a))return this.events[a];or.throwArgumentError("no matching event","topichash",n)}if(t.indexOf("(")===-1){const n=t.trim(),a=Object.keys(this.events).filter(f=>f.split("(")[0]===n);return a.length===0?or.throwArgumentError("no matching event","name",n):a.length>1&&or.throwArgumentError("multiple matching events","name",n),this.events[a[0]]}const e=this.events[rf.fromString(t).format()];return e||or.throwArgumentError("no matching event","signature",t),e}getError(t){if(xe(t)){const n=Bi(this.constructor,"getSighash");for(const a in this.errors){const f=this.errors[a];if(t===n(f))return this.errors[a]}or.throwArgumentError("no matching error","sighash",t)}if(t.indexOf("(")===-1){const n=t.trim(),a=Object.keys(this.errors).filter(f=>f.split("(")[0]===n);return a.length===0?or.throwArgumentError("no matching error","name",n):a.length>1&&or.throwArgumentError("multiple matching errors","name",n),this.errors[a[0]]}const e=this.errors[Bo.fromString(t).format()];return e||or.throwArgumentError("no matching error","signature",t),e}getSighash(t){if(typeof t=="string")try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch{throw e}}return Bi(this.constructor,"getSighash")(t)}getEventTopic(t){return typeof t=="string"&&(t=this.getEvent(t)),Bi(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){typeof t=="string"&&(t=this.getError(t));const n=kt(e);return Ut(n.slice(0,4))!==this.getSighash(t)&&or.throwArgumentError(`data signature does not match error ${t.name}.`,"data",Ut(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,e){return typeof t=="string"&&(t=this.getError(t)),Ut(Ve([this.get
12Sighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){typeof t=="string"&&(t=this.getFunction(t));const n=kt(e);return Ut(n.slice(0,4))!==this.getSighash(t)&&or.throwArgumentError(`data signature does not match function ${t.name}.`,"data",Ut(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,e){return typeof t=="string"&&(t=this.getFunction(t)),Ut(Ve([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){typeof t=="string"&&(t=this.getFunction(t));let n=kt(e),a=null,f="",c=null,y=null,b=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch{}break;case 4:{const w=Ut(n.slice(0,4)),E=o9[w];if(E)c=this._abiCoder.decode(E.inputs,n.slice(4)),y=E.name,b=E.signature,E.reason&&(a=c[0]),y==="Error"?f=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(c[0])}`:y==="Panic"&&(f=`; VM Exception while processing transaction: reverted with panic code ${c[0]}`);else try{const M=this.getError(w);c=this._abiCoder.decode(M.inputs,n.slice(4)),y=M.name,b=M.format()}catch{}break}}return or.throwError("call revert exception"+f,_t.errors.CALL_EXCEPTION,{method:t.format(),data:Ut(e),errorArgs:c,errorName:y,errorSignature:b,reason:a})}encodeFunctionResult(t,e){return typeof t=="string"&&(t=this.getFunction(t)),Ut(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){typeof t=="string"&&(t=this.getEvent(t)),e.length>t.inputs.length&&or.throwError("too many arguments for "+t.format(),_t.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let n=[];t.anonymous||n.push(this.getEventTopic(t));const a=(f,c)=>f.type==="string"?po(c):f.type==="bytes"?Je(Ut(c)):(f.type==="bool"&&typeof c=="boolean"&&(c=c?"0x01":"0x00"),f.type.match(/^u?int/)&&(c=zt.from(c).toHexString()),f.type==="address"&&this._abiCoder.encode(["address"],[c]),Qe(Ut(c),32));for(e.forEach((f,c)=>{let y=t.inputs[c];if(!y.indexed){f!=null&&or.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+y.name,f);return}f==null?n.push(null):y.baseType==="array"||y.baseType==="tuple"?or.throwArgumentError("filtering with tuples or arrays not supported","contract."+y.name,f):Array.isArray(f)?n.push(f.map(b=>a(y,b))):n.push(a(y,f))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(t,e){typeof t=="string"&&(t=this.getEvent(t));const n=[],a=[],f=[];return t.anonymous||n.push(this.getEventTopic(t)),e.length!==t.inputs.length&&or.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((c,y)=>{const b=e[y];if(c.indexed)if(c.type==="string")n.push(po(b));else if(c.type==="bytes")n.push(Je(b));else{if(c.baseType==="tuple"||c.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([c.type],[b]))}else a.push(c),f.push(b)}),{data:this._abiCoder.encode(a,f),topics:n}}decodeEventLog(t,e,n){if(typeof t=="string"&&(t=this.getEvent(t)),n!=null&&!t.anonymous){let O=this.getEventTopic(t);(!xe(n[0],32)||n[0].toLowerCase()!==O)&&or.throwError("fragment/topic mismatch",_t.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:O,value:n[0]}),n=n.slice(1)}let a=[],f=[],c=[];t.inputs.forEach((O,F)=>{O.indexed?O.type==="string"||O.type==="bytes"||O.baseType==="tuple"||O.baseType==="array"?(a.push(Wr.fromObject({type:"bytes32",name:O.name})),c.push(!0)):(a.push(O),c.push(!1)):(f.push(O),c.push(!1))});let y=n!=null?this._abiCoder.decode(a,Ve(n)):null,b=this._abiCoder.decode(f,e,!0),w=[],E=0,M=0;t.inputs.forEach((O,F)=>{if(O.indexed)if(y==null)w[F]=new ep({_isIndexed:!0,hash:null});else if(c[F])w[F]=new ep({_isIndexed:!0,hash:y[M++]});else try{w[F]=y[M++]}catch(B){w[F]=B}else try{w[F]=b[E++]}catch(B){w[F]=B}if(O.name&&w[O.name]==null){const B=w[F];B instanceof Error?Object.defineProperty(w,O.name,{enumerable:!0,get:()=>{throw Px(`property ${JSON.stringify(O.name)}`,B)}}):w[O.name]=B}});for(let O=0;O<w.length;O++){const F=w[O];F instanceof Error&&Object.defineProperty(w,O,{enumerable:!0,get:()=>{throw Px(`index ${O}`,F)}})}return Object.freeze(w)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());
12return e?new i9({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:zt.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new r9({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){const e=Ut(t);let n=this.getError(e.substring(0,10).toLowerCase());return n?new n9({args:this._abiCoder.decode(n.inputs,"0x"+e.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!!(t&&t._isInterface)}}const f9="contracts/5.4.0";var vs=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const wr=new _t(f9);function Fu(r,t){return vs(this,void 0,void 0,function*(){const e=yield t;try{return je(e)}catch{}r||wr.throwError("a provider or signer is needed to resolve ENS names",_t.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield r.resolveName(e);return n==null&&wr.throwArgumentError("resolver or addr is not configured for ENS name","name",e),n})}function Qh(r,t,e){return vs(this,void 0,void 0,function*(){return Array.isArray(e)?yield Promise.all(e.map((n,a)=>Qh(r,Array.isArray(t)?t[a]:t[n.name],n))):e.type==="address"?yield Fu(r,t):e.type==="tuple"?yield Qh(r,t,e.components):e.baseType==="array"?Array.isArray(t)?yield Promise.all(t.map(n=>Qh(r,n,e.arrayChildren))):Promise.reject(new Error("invalid value for array")):t})}function Nl(r,t,e){return vs(this,void 0,void 0,function*(){let n={};e.length===t.inputs.length+1&&typeof e[e.length-1]=="object"&&(n=Jr(e.pop())),wr.checkArgumentCount(e.length,t.input
12s.length,"passed to contract"),r.signer?n.from?n.from=gr({override:Fu(r.signer,n.from),signer:r.signer.getAddress()}).then(w=>vs(this,void 0,void 0,function*(){return je(w.signer)!==w.override&&wr.throwError("Contract with a Signer cannot override from",_t.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),w.override})):n.from=r.signer.getAddress():n.from&&(n.from=Fu(r.provider,n.from));const a=yield gr({args:Qh(r.signer||r.provider,e,t.inputs),address:r.resolvedAddress,overrides:gr(n)||{}}),f=r.interface.encodeFunctionData(t,a.args),c={data:f,to:a.address},y=a.overrides;if(y.nonce!=null&&(c.nonce=zt.from(y.nonce).toNumber()),y.gasLimit!=null&&(c.gasLimit=zt.from(y.gasLimit)),y.gasPrice!=null&&(c.gasPrice=zt.from(y.gasPrice)),y.maxFeePerGas!=null&&(c.maxFeePerGas=zt.from(y.maxFeePerGas)),y.maxPriorityFeePerGas!=null&&(c.maxPriorityFeePerGas=zt.from(y.maxPriorityFeePerGas)),y.from!=null&&(c.from=y.from),y.type!=null&&(c.type=y.type),y.accessList!=null&&(c.accessList=A0(y.accessList)),c.gasLimit==null&&t.gas!=null){let w=21e3;const E=kt(f);for(let M=0;M<E.length;M++)w+=4,E[M]&&(w+=64);c.gasLimit=zt.from(t.gas).add(w)}if(y.value){const w=zt.from(y.value);!w.isZero()&&!t.payable&&wr.throwError("non-payable method cannot override value",_t.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),c.value=w}delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas;const b=Object.keys(n).filter(w=>n[w]!=null);return b.length&&wr.throwError(`cannot override ${b.map(w=>JSON.stringify(w)).join(",")}`,_t.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:b}),c})}function s9(r,t){return function(...e){return Nl(r,t,e)}}function a9(r,t){const e=r.signer||r.provider;return function(...n){return vs(this,void 0,void 0,function*(){e||wr.throwError("estimate require a provider or signer",_t.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const a=yield Nl(r,t,n);return yield e.estimateGas(a)})}}function z3(r,t,e){const n=r.signer||r.provider;return function(...a){return vs(this,void 0,void 0,function*(){let f;if(a.length===t.inputs.length+1&&typeof a[a.length-1]=="object"){const b=Jr(a.pop());b.blockTag!=null&&(f=yield b.blockTag),delete b.blockTag,a.push(b)}r.deployTransaction!=null&&(yield r._deployed(f));const c=yield Nl(r,t,a),y=yield n.call(c,f);try{let b=r.interface.decodeFunctionResult(t,y);return e&&t.outputs.length===1&&(b=b[0]),b}catch(b){throw b.code===_t.errors.CALL_EXCEPTION&&(b.address=r.address,b.args=a,b.transaction=c),b}})}}function h9(r,t){return function(...e){return vs(this,void 0,void 0,function*(){r.signer||wr.throwError("sending a transaction requires a signer",_t.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),r.deployTransaction!=null&&(yield r._deployed());const n=yield Nl(r,t,e),a=yield r.signer.sendTransaction(n),f=a.wait.bind(a);return a.wait=c=>f(c).then(y=>(y.events=y.logs.map(b=>{let w=lf(b),E=null;try{E=r.interface.parseLog(b)}catch{}return E&&(w.args=E.args,w.decode=(M,O)=>r.interface.decodeEventLog(E.eventFragment,M,O),w.event=E.name,w.eventSignature=E.signature),w.removeListener=()=>r.provider,w.getBlock=()=>r.provider.getBlock(y.blockHash),w.getTransaction=()=>r.provider.getTransaction(y.transactionHash),w.getTransactionReceipt=()=>Promise.resolve(y),w}),y)),a})}}function Ox(r,t,e){return t.constant?z3(r,t,e):h9(r,t)}
12function q3(r){return r.address&&(r.topics==null||r.topics.length===0)?"*":(r.address||"*")+"@"+(r.topics?r.topics.map(t=>Array.isArray(t)?t.join("|"):t).join(":"):"")}class Pa{constructor(t,e){Pt(this,"tag",t),Pt(this,"filter",e),this._listeners=[]}addListener(t,e){this._listeners.push({listener:t,once:e})}removeListener(t){let e=!1;this._listeners=this._listeners.filter(n=>e||n.listener!==t?!0:(e=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(t=>t.listener)}listenerCount(){return this._listeners.length}run(t){const e=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const a=t.slice();return setTimeout(()=>{n.listener.apply(this,a)},0),!n.once}),e}prepareEvent(t){}getEmit(t){return[t]}}class u9 extends Pa{constructor(){super("error",null)}}class kx extends Pa{constructor(t,e,n,a){const f={address:t};let c=e.getEventTopic(n);a?(c!==a[0]&&wr.throwArgumentError("topic mismatch","topics",a),f.topics=a.slice()):f.topics=[c],super(q3(f),f),Pt(this,"address",t),Pt(this,"interface",e),Pt(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(e,n)=>this.interface.decodeEventLog(this.fragment,e,n);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(e){t.args=null,t.decodeError=e}}getEmit(t){const e=zS(t.args);if(e.length)throw e[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class Bx extends Pa{constructor(t,e){super("*",{address:t}),Pt(this,"address",t),Pt(this,"interface",e)}prepareEvent(t){super.prepareEvent(t);try{const e=this.interface.parseLog(t);t.event=e.name,t.eventSignature=e.signature,t.decode=(n,a)=>this.interface.decodeEventLog(e.eventFragment,n,a),t.args=e.args}catch{}}}class l9{constructor(t,e,n){wr.checkNew(new.target,c9),Pt(this,"interface",Bi(new.target,"getInterface")(e)),n==null?(Pt(this,"provider",null),Pt(this,"signer",null)):El.isSigner(n)?(Pt(this,"provider",n.provider||null),Pt(this,"signer",n)):B1.isProvider(n)?(Pt(this,"provider",n),Pt(this,"signer",null)):wr.throwArgumentError("invalid signer or provider","signerOrProvider",n),Pt(this,"callStatic",{}),Pt(this,"estimateGas",{}),Pt(this,"functions",{}),Pt(this,"populateTransaction",{}),Pt(this,"filters",{});{const c={};Object.keys(this.interface.events).forEach(y=>{const b=this.interface.events[y];Pt(this.filters,y,(...w)=>({address:this.address,topics:this.interface.encodeFilterTopics(b,w)})),c[b.name]||(c[b.name]=[]),c[b.name].push(y)}),Object.keys(c).forEach(y=>{const b=c[y];b.length===1?Pt(this.filters,y,this.filters[b[0]]):wr.warn(`Duplicate definition of ${y} (${b.join(", ")})`)})}if(Pt(this,"_runningEvents",{}),Pt(this,"_wrappedEmits",{}),t==null&&wr.throwArgumentError("invalid contract address or ENS name","addressOrName",t),Pt(this,"address",t),this.provider)Pt(this,"resolvedAddress",Fu(this.provider,t));else try{Pt(this,"resolvedAddress",Promise.resolve(je(t)))}catch{wr.throwError("provider is required to use ENS name as contract address",_t.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const a={},f={};Object.keys(this.interface.functions).forEach(c=>{const y=this.interface.functions[c];if(f[c]){wr.warn(`Duplicate ABI entry for ${JSON.stringify(c)}`);return}f[c]=!0;{const b=y.name;a[b]||(a[b]=[]),a[b].push(c)}this[c]==null&&Pt(this,c,Ox(this,y,!0)),this.functions[c]==null&&Pt(this.functions,c,Ox(this,y,!1)),this.callStatic[c]==null&&Pt(this.callStatic,c,z3(this,y,!0)),this.populateTransaction[c]==null&&Pt(this.populateTransaction,c,s9(this,y)),this.estimateGas[c]==null&&Pt(this.estimateGas,c,a9(this,y))}),Object.keys(a).forEach(c=>{const y=a[c];if(y.length>1)return;const b=y[0];try{this[c]==null&&Pt(this,c,this[b])}catch{}this.functions[c]==null&&Pt(this.functions,c,this.functions[b]),this.callStatic[c]==null&&Pt(this.callStatic,c,this.callStatic[b]),this.populateTransaction[c]==null&&Pt(this.populateTransaction,c,this.populateTransaction[b]),this.estimateGas[c]==null&&Pt(this.estimateGas,c,this.estimateGas[b])})}static getContractAddress(t){return Z2(t)}static getInterface(t){return Cx.isInterface(t)?t:new Cx(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,t).then(e=>(e==="0x"&&wr.throwError("contract not deployed",_t.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(t){this.signer||wr.throwError("sending a transactions require a signer",_t.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const e=Jr(t||{});return["from","to"].forEach(function(n){e[n]!=null&&wr.throwError("cannot override "+n,_t.errors.UNSUPPORTED_OPERATION,{operation:n})}),e.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(e))}connect(t){typeof t=="string"&&(t=new U1(t,this.provider));const e=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&Pt(e,"deployTransaction",this.deployTransaction),e}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return ep.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if(typeof t=="string"){if(t==="error")return this._normalizeRunningEvent(new u9);if(t==="event")return this._normalizeRunningEvent(new Pa("event",null));if(t==="*")return this._normalizeRunningEvent(new Bx(this.address,this.interface));const e=this.interface.getEvent(t);return this._normalizeRunningEvent(new kx(this.address,this.interface,e))}if(t.topics&&t.topics.length>0){try{const n=t.topics[0];
12if(typeof n!="string")throw new Error("invalid topic");const a=this.interface.getEvent(n);return this._normalizeRunningEvent(new kx(this.address,this.interface,a,t.topics))}catch{}const e={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new Pa(q3(e),e))}return this._normalizeRunningEvent(new Bx(this.address,this.interface))}_checkRunningEvents(t){if(t.listenerCount()===0){delete this._runningEvents[t.tag];const e=this._wrappedEmits[t.tag];e&&t.filter&&(this.provider.off(t.filter,e),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,e,n){const a=lf(e);return a.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},a.getBlock=()=>this.provider.getBlock(e.blockHash),a.getTransaction=()=>this.provider.getTransaction(e.transactionHash),a.getTransactionReceipt=()=>this.provider.getTransactionReceipt(e.transactionHash),t.prepareEvent(a),a}_addEventListener(t,e,n){if(this.provider||wr.throwError("events require a provider or a signer with a provider",_t.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(e,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const a=f=>{let c=this._wrapEvent(t,f,e);if(c.decodeError==null)try{const y=t.getEmit(c);this.emit(t.filter,...y)}catch(y){c.decodeError=y.error}t.filter!=null&&this.emit("event",c),c.decodeError!=null&&this.emit("error",c.decodeError,c)};this._wrappedEmits[t.tag]=a,t.filter!=null&&this.provider.on(t.filter,a)}}queryFilter(t,e,n){const a=this._getRunningEvent(t),f=Jr(a.filter);return typeof e=="string"&&xe(e,32)?(n!=null&&wr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),f.blockHash=e):(f.fromBlock=e??0,f.toBlock=n??"latest"),this.provider.getLogs(f).then(c=>c.map(y=>this._wrapEvent(a,y,null)))}on(t,e){return this._addEventListener(this._getRunningEvent(t),e,!1),this}once(t,e){return this._addEventListener(this._getRunningEvent(t),e,!0),this}emit(t,...e){if(!this.provider)return!1;const n=this._getRunningEvent(t),a=n.run(e)>0;return this._checkRunningEvents(n),a}
12listenerCount(t){return this.provider?t==null?Object.keys(this._runningEvents).reduce((e,n)=>e+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(t==null){const e=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(a=>{e.push(a)});return e}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(t==null){for(const n in this._runningEvents){const a=this._runningEvents[n];a.removeAllListeners(),this._checkRunningEvents(a)}return this}const e=this._getRunningEvent(t);return e.removeAllListeners(),this._checkRunningEvents(e),this}off(t,e){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(e),this._checkRunningEvents(n),this}removeListener(t,e){return this.off(t,e)}}class c9 extends l9{}const d9="logger/5.7.0";let Ux=!1,Fx=!1;const Yh={debug:1,default:2,info:2,warning:3,error:4,off:5};let Dx=Yh.default,Wc=null;function p9(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Lx=p9();var rp;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(rp||(rp={}));var ho;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(ho||(ho={}));const $x="0123456789abcdef";let sf=class qr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();Yh[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Dx>Yh[n])&&console.log.apply(console,e)}debug(...t){this._log(qr.levels.DEBUG,t)}info(...t){this._log(qr.levels.INFO,t)}warn(...t){this._log(qr.levels.WARNING,t)}makeError(t,e,n){if(Fx)return this.makeError("censored error",e,{});e||(e=qr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=$x[w[M]>>4],E+=$x[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case ho.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case ho.CALL_EXCEPTION:case ho.INSUFFICIENT_FUNDS:case ho.MISSING_NEW:case ho.NONCE_EXPIRED:case ho.REPLACEMENT_UNDERPRICED:case ho.TRANSACTION_REPLACED:case ho.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,qr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Lx&&this.throwError("platform missing String.prototype.normalize",qr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Lx})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,qr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,qr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,qr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,qr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",qr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",qr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",qr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Wc||(Wc=new qr(d9)),Wc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",qr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ux){if(!t)return;this.globalLogger().throwError("error censorship permanent",qr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Fx=!!t,Ux=!!e}static setLogLevel(t){const e=Yh[t.toLowerCase()];if(e==null){qr.globalLogger().warn("invalid log level - "+t);return}Dx=e}static from(t){return new qr(t)}};sf.errors=ho;sf.levels=rp;const g9="bytes/5.7.0",Jc=new sf(g9);function m9(r){return!!r.toHexString}function Gx(r){return typeof r=="number"&&r==r&&r%1===0}function K3(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!Gx(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!Gx(e)||e<0||e>=256)return!1}return!0}function ip(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const Vc="0123456789abcdef";function v9(r,t){if(t||(t={}),typeof r=="number"){Jc.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Vc[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),m9(r))return r.toHexString();if(ip(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":Jc.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(K3(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Vc[(a&240)>>4]+Vc[a&15]}return e}return Jc.throwArgumentError("invalid hexlify value","value",r)}const x9="bignumber/5.4.0";var np=ue.BN;const No=new sf(x9),jc={},zx=9007199254740991;let qx=!1,H3=class an{constructor(t,e){No.checkNew(new.target,an),t!==jc&&No.throwError("cannot call constructor directly; use BigNumber.from",sf.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Pi(Me(this).fromTwos(t))}toTwos(t){return Pi(Me(this).toTwos(t))}abs(){return this._hex[0]==="-"?an.from(this._hex.substring(1)):this}add(t){return Pi(Me(this).add(Me(t)))}sub(t){return Pi(Me(this).sub(Me(t)))}div(t){return an.from(t).isZero()&&nn("division by zero","div"),Pi(Me(this).div(Me(t)))}mul(t){return Pi(Me(this).mul(Me(t)))}mod(t){const e=Me(t);return e.isNeg()&&nn("cannot modulo negative values","mod"),Pi(Me(this).umod(e))}pow(t){const e=Me(t);return e.isNeg()&&nn("cannot raise to negative values","pow"),Pi(Me(this).pow(e))}and(t){const e=Me(t);return(this.isNegative()||e.isNeg())&&nn("cannot 'and' negative values","and"),Pi(Me(this).and(e))}or(t){const e=Me(t);return(this.isNegative()||e.isNeg())&&nn("cannot 'or' negative values","or"),Pi(Me(this).or(e))}xor(t){const e=Me(t);return(this.isNegative()||e.isNeg())&&nn("cannot 'xor' negative values","xor"),Pi(Me(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&nn("cannot mask negative values","mask"),Pi(Me(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&nn("cannot shift negative values","shl"),Pi(Me(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&nn("cannot shift negative values","shr"),Pi(Me(this).shrn(t))}eq(t){return Me(this).eq(Me(t))}lt(t){return Me(this).lt(Me(t))}lte(t){return Me(this).lte(Me(t))}gt(t){return Me(this).gt(Me(t))}gte(t){return Me(this).gte(Me(t))}isNegative(){return this._hex[0]==="-"}isZero(){return Me(this).isZero()}toNumber(){try{return Me(this).toNumber()}catch{nn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return No.throwError("this platform does not support BigInt",sf.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?qx||(qx=!0,No.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?No.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",sf.errors.UNEXPECTED_ARGUMENT,{}):No.throwError("BigNumber.toString does not accept parameters",sf.errors.UNEXPECTED_ARGUMENT,{})),Me(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof an)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new an(jc,Ca(t)):t.match(/^-?[0-9]+$/)?new an(jc,Ca(new np(t))):No.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&nn("underflow","BigNumber.from",t),(t>=zx||t<=-zx)&&nn("overflow","BigNumber.from",t),an.from(String(t));const e=t;if(typeof e=="bigint")return an.from(e.toString());if(K3(e))return an.from(v9(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return an.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(ip(n)||n[0]==="-"&&ip(n.substring(1))))return an.from(n)}return No.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function Ca(r){if(typeof r!="string")return Ca(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&No.throwArgumentError("invalid hex","value",r),r=Ca(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Pi(r){return H3.from(Ca(r))}function Me(r){const t=H3.from(r).toHexString();return t[0]==="-"?new np("-"+t.substring(3),16):new np(t.substring(2),16)}function nn(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),No.throwError(r,sf.errors.NUMERIC_FAULT,n)}var q1={exports:{}};q1.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}
vendor: 38,081 bytes, line 12
12typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
12function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(q1);var y9=q1.exports;const b9=Nr(y9),w9="logger/5.7.0";let Kx=!1,Hx=!1;const tu={debug:1,default:2,info:2,warning:3,error:4,off:5};let Wx=tu.default,Xc=null;function E9(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const Jx=E9();var op;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(op||(op={}));var uo;
12(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(uo||(uo={}));const Vx="0123456789abcdef";let af=class Kr{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();tu[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Wx>tu[n])&&console.log.apply(console,e)}debug(...t){this._log(Kr.levels.DEBUG,t)}info(...t){this._log(Kr.levels.INFO,t)}warn(...t){this._log(Kr.levels.WARNING,t)}makeError(t,e,n){if(Hx)return this.makeError("censored error",e,{});e||(e=Kr.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=Vx[w[M]>>4],E+=Vx[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case uo.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case uo.CALL_EXCEPTION:case uo.INSUFFICIENT_FUNDS:case uo.MISSING_NEW:case uo.NONCE_EXPIRED:case uo.REPLACEMENT_UNDERPRICED:case uo.TRANSACTION_REPLACED:case uo.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Kr.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){Jx&&this.throwError("platform missing String.prototype.normalize",Kr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Jx})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Kr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Kr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Kr.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Kr.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Kr.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Kr.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Kr.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return Xc||(Xc=new Kr(w9)),Xc}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Kr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Kx){if(!t)return;this.globalLogger().throwError("error censorship permanent",Kr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Hx=!!t,Kx=!!e}static setLogLevel(t){const e=tu[t.toLowerCase()];if(e==null){Kr.globalLogger().warn("invalid log level - "+t);return}Wx=e}static from(t){return new Kr(t)}};af.errors=uo;af.levels=op;const A9="bytes/5.7.0",Zc=new af(A9);function M9(r){return!!r.toHexString}function jx(r){return typeof r=="number"&&r==r&&r%1===0}function W3(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;
12if(typeof r=="string"||!jx(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!jx(e)||e<0||e>=256)return!1}return!0}function fp(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/))}const Qc="0123456789abcdef";function N9(r,t){if(t||(t={}),typeof r=="number"){Zc.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=Qc[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),M9(r))return r.toHexString();if(fp(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":Zc.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(W3(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=Qc[(a&240)>>4]+Qc[a&15]}return e}return Zc.throwArgumentError("invalid hexlify value","value",r)}const _9="bignumber/5.7.0";var sp=b9.BN;const Qo=new af(_9),Yc={},Xx=9007199254740991;let Zx=!1,_l=class Hn{constructor(t,e){t!==Yc&&Qo.throwError("cannot call constructor directly; use BigNumber.from",af.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Ci(Ne(this).fromTwos(t))}toTwos(t){return Ci(Ne(this).toTwos(t))}abs(){return this._hex[0]==="-"?Hn.from(this._hex.substring(1)):this}add(t){return Ci(Ne(this).add(Ne(t)))}sub(t){return Ci(Ne(this).sub(Ne(t)))}div(t){return Hn.from(t).isZero()&&on("division-by-zero","div"),Ci(Ne(this).div(Ne(t)))}mul(t){return Ci(Ne(this).mul(Ne(t)))}mod(t){const e=Ne(t);return e.isNeg()&&on("division-by-zero","mod"),Ci(Ne(this).umod(e))}pow(t){const e=Ne(t);return e.isNeg()&&on("negative-power","pow"),Ci(Ne(this).pow(e))}and(t){const e=Ne(t);return(this.isNegative()||e.isNeg())&&on("unbound-bitwise-result","and"),Ci(Ne(this).and(e))}or(t){const e=Ne(t);return(this.isNegative()||e.isNeg())&&on("unbound-bitwise-result","or"),Ci(Ne(this).or(e))}xor(t){const e=Ne(t);return(this.isNegative()||e.isNeg())&&on("unbound-bitwise-result","xor"),Ci(Ne(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&on("negative-width","mask"),Ci(Ne(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&on("negative-width","shl"),Ci(Ne(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&on("negative-width","shr"),Ci(Ne(this).shrn(t))}eq(t){return Ne(this).eq(Ne(t))}lt(t){return Ne(this).lt(Ne(t))}lte(t){return Ne(this).lte(Ne(t))}gt(t){return Ne(this).gt(Ne(t))}gte(t){return Ne(this).gte(Ne(t))}isNegative(){return this._hex[0]==="-"}isZero(){return Ne(this).isZero()}toNumber(){try{return Ne(this).toNumber()}catch{on("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Qo.throwError("this platform does not support BigInt",af.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Zx||(Zx=!0,Qo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Qo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",af.errors.UNEXPECTED_ARGUMENT,{}):Qo.throwError("BigNumber.toString does not accept parameters",af.errors.UNEXPECTED_ARGUMENT,{})),Ne(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Hn)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new Hn(Yc,Oa(t)):t.match(/^-?[0-9]+$/)?new Hn(Yc,Oa(new sp(t))):Qo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&on("underflow","BigNumber.from",t),(t>=Xx||t<=-Xx)&&on("overflow","BigNumber.from",t),Hn.from(String(t));const e=t;if(typeof e=="bigint")return Hn.from(e.toString());if(W3(e))return Hn.from(N9(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return Hn.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(fp(n)||n[0]==="-"&&fp(n.substring(1))))return Hn.from(n)}return Qo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}};function Oa(r){if(typeof r!="string")return Oa(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Qo.throwArgumentError("invalid hex","value",r),r=Oa(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Ci(r){return _l.from(Oa(r))}function Ne(r){const t=_l.from(r).toHexString();return t[0]==="-"?new sp("-"+t.substring(3),16):new sp(t.substring(2),16)}function on(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),Qo.throwError(r,af.errors.NUMERIC_FAULT,n)}const qT=_l.from(0),KT=_l.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var K1={exports:{}};K1.exports;(function(r){(function(t,e){function n(d,i){if(!d)throw new Error(i||"Assertion failed")}function a(d,i){d.super_=i;var s=function(){};s.prototype=i.prototype,d.prototype=new s,d.prototype.constructor=d}function f(d,i,s){if(f.isBN(d))return d;this.negative=0,this.words=null,this.length=0,this.red=null,d!==null&&((i==="le"||i==="be")&&(s=i,i=10),this._init(d||0,i||10,s||"be"))}
vendor: 38,081 bytes, line 12
12typeof t=="object"?t.exports=f:e.BN=f,f.BN=f,f.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=mf.Buffer}catch{}f.isBN=function(i){return i instanceof f?!0:i!==null&&typeof i=="object"&&i.constructor.wordSize===f.wordSize&&Array.isArray(i.words)},f.max=function(i,s){return i.cmp(s)>0?i:s},f.min=function(i,s){return i.cmp(s)<0?i:s},f.prototype._init=function(i,s,h){if(typeof i=="number")return this._initNumber(i,s,h);if(typeof i=="object")return this._initArray(i,s,h);s==="hex"&&(s=16),n(s===(s|0)&&s>=2&&s<=36),i=i.toString().replace(/\s+/g,"");var p=0;i[0]==="-"&&(p++,this.negative=1),p<i.length&&(s===16?this._parseHex(i,p,h):(this._parseBase(i,s,p),h==="le"&&this._initArray(this.toArray(),s,h)))},f.prototype._initNumber=function(i,s,h){i<0&&(this.negative=1,i=-i),i<67108864?(this.words=[i&67108863],this.length=1):i<4503599627370496?(this.words=[i&67108863,i/67108864&67108863],this.length=2):(n(i<9007199254740992),this.words=[i&67108863,i/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),s,h)},f.prototype._initArray=function(i,s,h){if(n(typeof i.length=="number"),i.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(i.length/3),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m,v,x=0;if(h==="be")for(p=i.length-1,m=0;p>=0;p-=3)v=i[p]|i[p-1]<<8|i[p-2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);else if(h==="le")for(p=0,m=0;p<i.length;p+=3)v=i[p]|i[p+1]<<8|i[p+2]<<16,this.words[m]|=v<<x&67108863,this.words[m+1]=v>>>26-x&67108863,x+=24,x>=26&&(x-=26,m++);return this._strip()};function y(d,i){var s=d.charCodeAt(i);if(s>=48&&s<=57)return s-48;if(s>=65&&s<=70)return s-55;if(s>=97&&s<=102)return s-87;n(!1,"Invalid character in "+d)}function b(d,i,s){var h=y(d,s);return s-1>=i&&(h|=y(d,s-1)<<4),h}f.prototype._parseHex=function(i,s,h){this.length=Math.ceil((i.length-s)/6),this.words=new Array(this.length);for(var p=0;p<this.length;p++)this.words[p]=0;var m=0,v=0,x;if(h==="be")for(p=i.length-1;p>=s;p-=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8;else{var l=i.length-s;for(p=l%2===0?s+1:s;p<i.length;p+=2)x=b(i,s,p)<<m,this.words[v]|=x&67108863,m>=18?(m-=18,v+=1,this.words[v]|=x>>>26):m+=8}this._strip()};function w(d,i,s,h){for(var p=0,m=0,v=Math.min(d.length,s),x=i;x<v;x++){var l=d.charCodeAt(x)-48;p*=h,l>=49?m=l-49+10:l>=17?m=l-17+10:m=l,n(l>=0&&m<h,"Invalid character"),p+=m}return p}f.prototype._parseBase=function(i,s,h){this.words=[0],this.length=1;for(var p=0,m=1;m<=67108863;m*=s)p++;p--,m=m/s|0;for(var v=i.length-h,x=v%p,l=Math.min(v,v-x)+h,o=0,g=h;g<l;g+=p)o=w(i,g,g+p,s),this.imuln(m),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o);if(x!==0){var C=1;for(o=w(i,g,i.length,s),g=0;g<x;g++)C*=s;this.imuln(C),this.words[0]+o<67108864?this.words[0]+=o:this._iaddn(o)}this._strip()},f.prototype.copy=function(i){i.words=new Array(this.length);for(var s=0;s<this.length;s++)i.words[s]=this.words[s];i.length=this.length,i.negative=this.negative,i.red=this.red};function E(d,i){d.words=i.words,d.length=i.length,d.negative=i.negative,d.red=i.red}if(f.prototype._move=function(i){E(i,this)},f.prototype.clone=function(){var i=new f(null);return this.copy(i),i},f.prototype._expand=function(i){for(;this.length<i;)this.words[this.length++]=0;return this},f.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},f.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{f.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{f.prototype.inspect=M}else f.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],F=[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];f.prototype.toString=function(i,s){i=i||10,s=s|0||1;var h;if(i===16||i==="hex"){h="";for(var p=0,m=0,v=0;v<this.length;v++){var x=this.words[v],l=((x<<p|m)&16777215).toString(16);m=x>>>24-p&16777215,p+=2,p>=26&&(p-=26,v--),m!==0||v!==this.length-1?h=O[6-l.length]+l+h:h=l+h}for(m!==0&&(h=m.toString(16)+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(i===(i|0)&&i>=2&&i<=36){var o=F[i],g=B[i];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var u=C.modrn(g).toString(i);C=C.idivn(g),C.isZero()?h=u+h:h=O[o-u.length]+u+h}for(this.isZero()&&(h="0"+h);h.length%s!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}n(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var i=this.words[0];return this.length===2?i+=this.words[1]*67108864:this.length===3&&this.words[2]===1?i+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-i:i},f.prototype.toJSON=function(){return this.toString(16,2)},c&&(f.prototype.toBuffer=function(i,s){return this.toArrayLike(c,i,s)}),f.prototype.toArray=function(i,s){return this.toArrayLike(Array,i,s)};var L=function(i,s){return i.allocUnsafe?i.allocUnsafe(s):new i(s)};f.prototype.toArrayLike=function(i,s,h){this._strip();var p=this.byteLength(),m=h||Math.max(1,p);n(p<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var v=L(i,m),x=s==="le"?"LE":"BE";return this["_toArrayLike"+x](v,p),v},f.prototype._toArrayLikeLE=function(i,s){for(var h=0,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h++]=x&255,h<i.length&&(i[h++]=x>>8&255),h<i.length&&(i[h++]=x>>16&255),v===6?(h<i.length&&(i[h++]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h<i.length)for(i[h++]=p;h<i.length;)i[h++]=0},f.prototype._toArrayLikeBE=function(i,s){for(var h=i.length-1,p=0,m=0,v=0;m<this.length;m++){var x=this.words[m]<<v|p;i[h--]=x&255,h>=0&&(i[h--]=x>>8&255),h>=0&&(i[h--]=x>>16&255),v===6?(h>=0&&(i[h--]=x>>24&255),p=0,v=0):(p=x>>>24,v+=2)}if(h>=0)for(i[h--]=p;h>=0;)i[h--]=0},Math.clz32?f.prototype._countBits=function(i){return 32-Math.clz32(i)}:f.prototype._countBits=function(i){var s=i,h=0;return s>=4096&&(h+=13,s>>>=13),s>=64&&(h+=7,s>>>=7),s>=8&&(h+=4,s>>>=4),s>=2&&(h+=2,s>>>=2),h+s},f.prototype._zeroBits=function(i){if(i===0)return 26;var s=i,h=0;return s&8191||(h+=13,s>>>=13),s&127||(h+=7,s>>>=7),s&15||(h+=4,s>>>=4),s&3||(h+=2,s>>>=2),s&1||h++,h},f.prototype.bitLength=function(){var i=this.words[this.length-1],s=this._countBits(i);return(this.length-1)*26+s};function z(d){for(var i=new Array(d.bitLength()),s=0;s<i.length;s++){var h=s/26|0,p=s%26;i[s]=d.words[h]>>>p&1}return i}f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var i=0,s=0;s<this.length;s++){var h=this._zeroBits(this.words[s]);if(i+=h,h!==26)break}return i},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(i){return this.negative!==0?this.abs().inotn(i).iaddn(1):this.clone()},f.prototype.fromTwos=function(i){return this.testn(i-1)?this.notn(i).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return this.negative!==0},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(i){for(;this.length<i.length;)this.words[this.length++]=0;for(var s=0;s<i.length;s++)this.words[s]=this.words[s]|i.words[s];return this._strip()},f.prototype.ior=function(i){return n((this.negative|i.negative)===0),this.iuor(i)},f.prototype.or=function(i){return this.length>i.length?this.clone().ior(i):i.clone().ior(this)},f.prototype.uor=function(i){return this.length>i.length?this.clone().iuor(i):i.clone().iuor(this)},f.prototype.iuand=function(i){var s;this.length>i.length?s=i:s=this;for(var h=0;h<s.length;h++)this.words[h]=this.words[h]&i.words[h];return this.length=s.length,this._strip()},f.prototype.iand=function(i){return n((this.negative|i.negative)===0),this.iuand(i)},f.prototype.and=function(i){return this.length>i.length?this.clone().iand(i):i.clone().iand(this)},f.prototype.uand=function(i){return this.length>i.length?this.clone().iuand(i):i.clone().iuand(this)},f.prototype.iuxor=function(i){var s,h;this.length>i.length?(s=this,h=i):(s=i,h=this);for(var p=0;p<h.length;p++)this.words[p]=s.words[p]^h.words[p];if(this!==s)for(;p<s.length;p++)this.words[p]=s.words[p];return this.length=s.length,this._strip()},f.prototype.ixor=function(i){return n((this.negative|i.negative)===0),this.iuxor(i)},f.prototype.xor=function(i){return this.length>i.length?this.clone().ixor(i):i.clone().ixor(this)},f.prototype.uxor=function(i){return this.length>i.length?this.clone().iuxor(i):i.clone().iuxor(this)},f.prototype.inotn=function(i){n(typeof i=="number"&&i>=0);var s=Math.ceil(i/26)|0,h=i%26;this._expand(s),h>0&&s--;for(var p=0;p<s;p++)this.words[p]=~this.words[p]&67108863;return h>0&&(this.words[p]=~this.words[p]&67108863>>26-h),this._strip()},f.prototype.notn=function(i){return this.clone().inotn(i)},f.prototype.setn=function(i,s){n(typeof i=="number"&&i>=0);var h=i/26|0,p=i%26;return this._expand(h+1),s?this.words[h]=this.words[h]|1<<p:this.words[h]=this.words[h]&~(1<<p),this._strip()},f.prototype.iadd=function(i){var s;if(this.negative!==0&&i.negative===0)return this.negative=0,s=this.isub(i),this.negative^=1,this._normSign();if(this.negative===0&&i.negative!==0)return i.negative=0,s=this.isub(i),i.negative=1,s._normSign();var h,p;this.length>i.length?(h=this,p=i):(h=i,p=this);for(var m=0,v=0;v<p.length;v++)s=(h.words[v]|0)+(p.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;for(;m!==0&&v<h.length;v++)s=(h.words[v]|0)+m,this.words[v]=s&67108863,m=s>>>26;if(this.length=h.length,m!==0)this.words[this.length]=m,this.length++;else if(h!==this)for(;v<h.length;v++)this.words[v]=h.words[v];return this},f.prototype.add=function(i){var s;return i.negative!==0&&this.negative===0?(i.negative=0,s=this.sub(i),i.negative^=1,s):i.negative===0&&this.negative!==0?(this.negative=0,s=i.sub(this),this.negative=1,s):this.length>i.length?this.clone().iadd(i):i.clone().iadd(this)},f.prototype.isub=function(i){if(i.negative!==0){i.negative=0;var s=this.iadd(i);return i.negative=1,s._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(i),this.negative=1,this._normSign();var h=this.cmp(i);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,m;h>0?(p=this,m=i):(p=i,m=this);for(var v=0,x=0;x<m.length;x++)s=(p.words[x]|0)-(m.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;for(;v!==0&&x<p.length;x++)s=(p.words[x]|0)+v,v=s>>26,this.words[x]=s&67108863;if(v===0&&x<p.length&&p!==this)for(;x<p.length;x++)this.words[x]=p.words[x];return this.length=Math.max(this.length,x),p!==this&&(this.negative=1),this._strip()},f.prototype.sub=function(i){return this.clone().isub(i)};function q(d,i,s){s.negative=i.negative^d.negative;var h=d.length+i.length|0;s.length=h,h=h-1|0;var p=d.words[0]|0,m=i.words[0]|0,v=p*m,x=v&67108863,l=v/67108864|0;s.words[0]=x;for(var o=1;o<h;o++){for(var g=l>>>26,C=l&67108863,u=Math.min(o,i.length-1),A=Math.max(0,o-d.length+1);A<=u;A++){var S=o-A|0;p=d.words[S]|0,m=i.words[A]|0,v=p*m+C,g+=v/67108864|0,C=v&67108863}s.words[o]=C|0,l=g|0}return l!==0?s.words[o]=l|0:s.length--,s._strip()}var V=function(i,s,h){var p=i.words,m=s.words,v=h.words,x=0,l,o,g,C=p[0]|0,u=C&8191,A=C>>>13,S=p[1]|0,_=S&8191,P=S>>>13,K=p[2]|0,$=K&8191,U=K>>>13,It=p[3]|0,G=It&8191,J=It>>>13,Gt=p[4]|0,ct=Gt&8191,rt=Gt>>>13,qt=p[5]|0,dt=qt&8191,it=qt>>>13,Kt=p[6]|0,gt=Kt&8191,tt=Kt>>>13,Lt=p[7]|0,pt=Lt&8191,nt=Lt>>>13,$t=p[8]|0,mt=$t&8191,k=$t>>>13,T=p[9]|0,R=T&8191,D=T>>>13,j=m[0]|0,H=j&8191,W=j>>>13,Bt=m[1]|0,et=Bt&8191,X=Bt>>>13,Ft=m[2]|0,Q=Ft&8191,ot=Ft>>>13,Ht=m[3]|0,vt=Ht&8191,ft=Ht>>>13,Wt=m[4]|0,xt=Wt&8191,st=Wt>>>13,Jt=m[5]|0,yt=Jt&8191,at=Jt>>>13,Vt=m[6]|0,bt=Vt&8191,ht=Vt>>>13,jt=m[7]|0,Mt=jt&8191,ut=jt>>>13,Xt=m[8]|0,Nt=Xt&8191,lt=Xt>>>13,Zt=m[9]|0,wt=Zt&8191,Et=Zt>>>13;h.negative=i.negative^s.negative,h.length=19,l=Math.imul(u,H),o=Math.imul(u,W),o=o+Math.imul(A,H)|0,g=Math.imul(A,W);var Qt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,l=Math.imul(_,H),o=Math.imul(_,W),o=o+Math.imul(P,H)|0,g=Math.imul(P,W),l=l+Math.imul(u,et)|0,o=o+Math.imul(u,X)|0,o=o+Math.imul(A,et)|0,g=g+Math.imul(A,X)|0;var Yt=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,l=Math.imul($,H),o=Math.imul($,W),o=o+Math.imul(U,H)|0,g=Math.imul(U,W),l=l+Math.imul(_,et)|0,o=o+Math.imul(_,X)|0,o=o+Math.imul(P,et)|0,g=g+Math.imul(P,X)|0,l=l+Math.imul(u,Q)|0,o=o+Math.imul(u,ot)|0,o=o+Math.imul(A,Q)|0,g=g+Math.imul(A,ot)|0;var te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(te>>>26)|0,te&=67108863,l=Math.imul(G,H),o=Math.imul(G,W),o=o+Math.imul(J,H)|0,g=Math.imul(J,W),l=l+Math.imul($,et)|0,o=o+Math.imul($,X)|0,o=o+Math.imul(U,et)|0,g=g+Math.imul(U,X)|0,l=l+Math.imul(_,Q)|0,o=o+Math.imul(_,ot)|0,o=o+Math.imul(P,Q)|0,g=g+Math.imul(P,ot)|0,l=l+Math.imul(u,vt)|0,o=o+Math.imul(u,ft)|0,o=o+Math.imul(A,vt)|0,g=g+Math.imul(A,ft)|0;var ee=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ee>>>26)|0,ee&=67108863,l=Math.imul(ct,H),o=Math.imul(ct,W),o=o+Math.imul(rt,H)|0,g=Math.imul(rt,W),l=l+Math.imul(G,et)|0,o=o+Math.imul(G,X)|0,o=o+Math.imul(J,et)|0,g=g+Math.imul(J,X)|0,l=l+Math.imul($,Q)|0,o=o+Math.imul($,ot)|0,o=o+Math.imul(U,Q)|0,g=g+Math.imul(U,ot)|0,l=l+Math.imul(_,vt)|0,o=o+Math.imul(_,ft)|0,o=o+Math.imul(P,vt)|0,g=g+Math.imul(P,ft)|0,l=l+Math.imul(u,xt)|0,o=o+Math.imul(u,st)|0,o=o+Math.imul(A,xt)|0,g=g+Math.imul(A,st)|0;var re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(re>>>26)|0,re&=67108863,l=Math.imul(dt,H),o=Math.imul(dt,W),o=o+Math.imul(it,H)|0,g=Math.imul(it,W),l=l+Math.imul(ct,et)|0,o=o+Math.imul(ct,X)|0,o=o+Math.imul(rt,et)|0,g=g+Math.imul(rt,X)|0,l=l+Math.imul(G,Q)|0,o=o+Math.imul(G,ot)|0,o=o+Math.imul(J,Q)|0,g=g+Math.imul(J,ot)|0,l=l+Math.imul($,vt)|0,o=o+Math.imul($,ft)|0,o=o+Math.imul(U,vt)|0,g=g+Math.imul(U,ft)|0,l=l+Math.imul(_,xt)|0,o=o+Math.imul(_,st)|0,o=o+Math.imul(P,xt)|0,g=g+Math.imul(P,st)|0,l=l+Math.imul(u,yt)|0,o=o+Math.imul(u,at)|0,o=o+Math.imul(A,yt)|0,g=g+Math.imul(A,at)|0;var Re=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,l=Math.imul(gt,H),o=Math.imul(gt,W),o=o+Math.imul(tt,H)|0,g=Math.imul(tt,W),l=l+Math.imul(dt,et)|0,o=o+Math.imul(dt,X)|0,o=o+Math.imul(it,et)|0,g=g+Math.imul(it,X)|0,l=l+Math.imul(ct,Q)|0,o=o+Math.imul(ct,ot)|0,o=o+Math.imul(rt,Q)|0,g=g+Math.imul(rt,ot)|0,l=l+Math.imul(G,vt)|0,o=o+Math.imul(G,ft)|0,o=o+Math.imul(J,vt)|0,g=g+Math.imul(J,ft)|0,l=l+Math.imul($,xt)|0,o=o+Math.imul($,st)|0,o=o+Math.imul(U,xt)|0,g=g+Math.imul(U,st)|0,l=l+Math.imul(_,yt)|0,o=o+Math.imul(_,at)|0,o=o+Math.imul(P,yt)|0,g=g+Math.imul(P,at)|0,l=l+Math.imul(u,bt)|0,o=o+Math.imul(u,ht)|0,o=o+Math.imul(A,bt)|0,g=g+Math.imul(A,ht)|0;var Te=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,l=Math.imul(pt,H),o=Math.imul(pt,W),o=o+Math.imul(nt,H)|0,g=Math.imul(nt,W),l=l+Math.imul(gt,et)|0,o=o+Math.imul(gt,X)|0,o=o+Math.imul(tt,et)|0,g=g+Math.imul(tt,X)|0,l=l+Math.imul(dt,Q)|0,o=o+Math.imul(dt,ot)|0,o=o+Math.imul(it,Q)|0,g=g+Math.imul(it,ot)|0,l=l+Math.imul(ct,vt)|0,o=o+Math.imul(ct,ft)|0,o=o+Math.imul(rt,vt)|0,g=g+Math.imul(rt,ft)|0,l=l+Math.imul(G,xt)|0,o=o+Math.imul(G,st)|0,o=o+Math.imul(J,xt)|0,g=g+Math.imul(J,st)|0,l=l+Math.imul($,yt)|0,o=o+Math.imul($,at)|0,o=o+Math.imul(U,yt)|0,g=g+Math.imul(U,at)|0,l=l+Math.imul(_,bt)|0,o=o+Math.imul(_,ht)|0,o=o+Math.imul(P,bt)|0,g=g+Math.imul(P,ht)|0,l=l+Math.imul(u,Mt)|0,o=o+Math.imul(u,ut)|0,o=o+Math.imul(A,Mt)|0,g=g+Math.imul(A,ut)|0;var Pe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,l=Math.imul(mt,H),o=Math.imul(mt,W),o=o+Math.imul(k,H)|0,g=Math.imul(k,W),l=l+Math.imul(pt,et)|0,o=o+Math.imul(pt,X)|0,o=o+Math.imul(nt,et)|0,g=g+Math.imul(nt,X)|0,l=l+Math.imul(gt,Q)|0,o=o+Math.imul(gt,ot)|0,o=o+Math.imul(tt,Q)|0,g=g+Math.imul(tt,ot)|0,l=l+Math.imul(dt,vt)|0,o=o+Math.imul(dt,ft)|0,o=o+Math.imul(it,vt)|0,g=g+Math.imul(it,ft)|0,l=l+Math.imul(ct,xt)|0,o=o+Math.imul(ct,st)|0,o=o+Math.imul(rt,xt)|0,g=g+Math.imul(rt,st)|0,l=l+Math.imul(G,yt)|0,o=o+Math.imul(G,at)|0,o=o+Math.imul(J,yt)|0,g=g+Math.imul(J,at)|0,l=l+Math.imul($,bt)|0,o=o+Math.imul($,ht)|0,o=o+Math.imul(U,bt)|0,g=g+Math.imul(U,ht)|0,l=l+Math.imul(_,Mt)|0,o=o+Math.imul(_,ut)|0,o=o+Math.imul(P,Mt)|0,g=g+Math.imul(P,ut)|0,l=l+Math.imul(u,Nt)|0,o=o+Math.imul(u,lt)|0,o=o+Math.imul(A,Nt)|0,g=g+Math.imul(A,lt)|0;var Ce=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,l=Math.imul(R,H),o=Math.imul(R,W),o=o+Math.imul(D,H)|0,g=Math.imul(D,W),l=l+Math.imul(mt,et)|0,o=o+Math.imul(mt,X)|0,o=o+Math.imul(k,et)|0,g=g+Math.imul(k,X)|0,l=l+Math.imul(pt,Q)|0,o=o+Math.imul(pt,ot)|0,o=o+Math.imul(nt,Q)|0,g=g+Math.imul(nt,ot)|0,l=l+Math.imul(gt,vt)|0,o=o+Math.imul(gt,ft)|0,o=o+Math.imul(tt,vt)|0,g=g+Math.imul(tt,ft)|0,l=l+Math.imul(dt,xt)|0,o=o+Math.imul(dt,st)|0,o=o+Math.imul(it,xt)|0,g=g+Math.imul(it,st)|0,l=l+Math.imul(ct,yt)|0,o=o+Math.imul(ct,at)|0,o=o+Math.imul(rt,yt)|0,g=g+Math.imul(rt,at)|0,l=l+Math.imul(G,bt)|0,o=o+Math.imul(G,ht)|0,o=o+Math.imul(J,bt)|0,g=g+Math.imul(J,ht)|0,l=l+Math.imul($,Mt)|0,o=o+Math.imul($,ut)|0,o=o+Math.imul(U,Mt)|0,g=g+Math.imul(U,ut)|0,l=l+Math.imul(_,Nt)|0,o=o+Math.imul(_,lt)|0,o=o+Math.imul(P,Nt)|0,g=g+Math.imul(P,lt)|0,l=l+Math.imul(u,wt)|0,o=o+Math.imul(u,Et)|0,o=o+Math.imul(A,wt)|0,g=g+Math.imul(A,Et)|0;var Oe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l=Math.imul(R,et),o=Math.imul(R,X),o=o+Math.imul(D,et)|0,g=Math.imul(D,X),l=l+Math.imul(mt,Q)|0,o=o+Math.imul(mt,ot)|0,o=o+Math.imul(k,Q)|0,g=g+Math.imul(k,ot)|0,l=l+Math.imul(pt,vt)|0,o=o+Math.imul(pt,ft)|0,o=o+Math.imul(nt,vt)|0,g=g+Math.imul(nt,ft)|0,l=l+Math.imul(gt,xt)|0,o=o+Math.imul(gt,st)|0,o=o+Math.imul(tt,xt)|0,g=g+Math.imul(tt,st)|0,l=l+Math.imul(dt,yt)|0,o=o+Math.imul(dt,at)|0,o=o+Math.imul(it,yt)|0,g=g+Math.imul(it,at)|0,l=l+Math.imul(ct,bt)|0,o=o+Math.imul(ct,ht)|0,o=o+Math.imul(rt,bt)|0,g=g+Math.imul(rt,ht)|0,l=l+Math.imul(G,Mt)|0,o=o+Math.imul(G,ut)|0,o=o+Math.imul(J,Mt)|0,g=g+Math.imul(J,ut)|0,l=l+Math.imul($,Nt)|0,o=o+Math.imul($,lt)|0,o=o+Math.imul(U,Nt)|0,g=g+Math.imul(U,lt)|0,l=l+Math.imul(_,wt)|0,o=o+Math.imul(_,Et)|0,o=o+Math.imul(P,wt)|0,g=g+Math.imul(P,Et)|0;var ke=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,l=Math.imul(R,Q),o=Math.imul(R,ot),o=o+Math.imul(D,Q)|0,g=Math.imul(D,ot),l=l+Math.imul(mt,vt)|0,o=o+Math.imul(mt,ft)|0,o=o+Math.imul(k,vt)|0,g=g+Math.imul(k,ft)|0,l=l+Math.imul(pt,xt)|0,o=o+Math.imul(pt,st)|0,o=o+Math.imul(nt,xt)|0,g=g+Math.imul(nt,st)|0,l=l+Math.imul(gt,yt)|0,o=o+Math.imul(gt,at)|0,o=o+Math.imul(tt,yt)|0,g=g+Math.imul(tt,at)|0,l=l+Math.imul(dt,bt)|0,o=o+Math.imul(dt,ht)|0,o=o+Math.imul(it,bt)|0,g=g+Math.imul(it,ht)|0,l=l+Math.imul(ct,Mt)|0,o=o+Math.imul(ct,ut)|0,o=o+Math.imul(rt,Mt)|0,g=g+Math.imul(rt,ut)|0,l=l+Math.imul(G,Nt)|0,o=o+Math.imul(G,lt)|0,o=o+Math.imul(J,Nt)|0,g=g+Math.imul(J,lt)|0,l=l+Math.imul($,wt)|0,o=o+Math.imul($,Et)|0,o=o+Math.imul(U,wt)|0,g=g+Math.imul(U,Et)|0;var Be=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Be>>>26)|0,Be&=67108863,l=Math.imul(R,vt),o=Math.imul(R,ft),o=o+Math.imul(D,vt)|0,g=Math.imul(D,ft),l=l+Math.imul(mt,xt)|0,o=o+Math.imul(mt,st)|0,o=o+Math.imul(k,xt)|0,g=g+Math.imul(k,st)|0,l=l+Math.imul(pt,yt)|0,o=o+Math.imul(pt,at)|0,o=o+Math.imul(nt,yt)|0,g=g+Math.imul(nt,at)|0,l=l+Math.imul(gt,bt)|0,o=o+Math.imul(gt,ht)|0,o=o+Math.imul(tt,bt)|0,g=g+Math.imul(tt,ht)|0,l=l+Math.imul(dt,Mt)|0,o=o+Math.imul(dt,ut)|0,o=o+Math.imul(it,Mt)|0,g=g+Math.imul(it,ut)|0,l=l+Math.imul(ct,Nt)|0,o=o+Math.imul(ct,lt)|0,o=o+Math.imul(rt,Nt)|0,g=g+Math.imul(rt,lt)|0,l=l+Math.imul(G,wt)|0,o=o+Math.imul(G,Et)|0,o=o+Math.imul(J,wt)|0,g=g+Math.imul(J,Et)|0;var Ue=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Ue>>>26)|0,Ue&=67108863,l=Math.imul(R,xt),o=Math.imul(R,st),o=o+Math.imul(D,xt)|0,g=Math.imul(D,st),l=l+Math.imul(mt,yt)|0,o=o+Math.imul(mt,at)|0,o=o+Math.imul(k,yt)|0,g=g+Math.imul(k,at)|0,l=l+Math.imul(pt,bt)|0,o=o+Math.imul(pt,ht)|0,o=o+Math.imul(nt,bt)|0,g=g+Math.imul(nt,ht)|0,l=l+Math.imul(gt,Mt)|0,o=o+Math.imul(gt,ut)|0,o=o+Math.imul(tt,Mt)|0,g=g+Math.imul(tt,ut)|0,l=l+Math.imul(dt,Nt)|0,o=o+Math.imul(dt,lt)|0,o=o+Math.imul(it,Nt)|0,g=g+Math.imul(it,lt)|0,l=l+Math.imul(ct,wt)|0,o=o+Math.imul(ct,Et)|0,o=o+Math.imul(rt,wt)|0,g=g+Math.imul(rt,Et)|0;var Fe=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,l=Math.imul(R,yt),o=Math.imul(R,at),o=o+Math.imul(D,yt)|0,g=Math.imul(D,at),l=l+Math.imul(mt,bt)|0,o=o+Math.imul(mt,ht)|0,o=o+Math.imul(k,bt)|0,g=g+Math.imul(k,ht)|0,l=l+Math.imul(pt,Mt)|0,o=o+Math.imul(pt,ut)|0,o=o+Math.imul(nt,Mt)|0,g=g+Math.imul(nt,ut)|0,l=l+Math.imul(gt,Nt)|0,o=o+Math.imul(gt,lt)|0,o=o+Math.imul(tt,Nt)|0,g=g+Math.imul(tt,lt)|0,l=l+Math.imul(dt,wt)|0,o=o+Math.imul(dt,Et)|0,o=o+Math.imul(it,wt)|0,g=g+Math.imul(it,Et)|0;var De=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(De>>>26)|0,De&=67108863,l=Math.imul(R,bt),o=Math.imul(R,ht),o=o+Math.imul(D,bt)|0,g=Math.imul(D,ht),l=l+Math.imul(mt,Mt)|0,o=o+Math.imul(mt,ut)|0,o=o+Math.imul(k,Mt)|0,g=g+Math.imul(k,ut)|0,l=l+Math.imul(pt,Nt)|0,o=o+Math.imul(pt,lt)|0,o=o+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,lt)|0,l=l+Math.imul(gt,wt)|0,o=o+Math.imul(gt,Et)|0,o=o+Math.imul(tt,wt)|0,g=g+Math.imul(tt,Et)|0;var Le=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(Le>>>26)|0,Le&=67108863,l=Math.imul(R,Mt),o=Math.imul(R,ut),o=o+Math.imul(D,Mt)|0,g=Math.imul(D,ut),l=l+Math.imul(mt,Nt)|0,o=o+Math.imul(mt,lt)|0,o=o+Math.imul(k,Nt)|0,g=g+Math.imul(k,lt)|0,l=l+Math.imul(pt,wt)|0,o=o+Math.imul(pt,Et)|0,o=o+Math.imul(nt,wt)|0,g=g+Math.imul(nt,Et)|0;var $e=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+($e>>>26)|0,$e&=67108863,l=Math.imul(R,Nt),o=Math.imul(R,lt),o=o+Math.imul(D,Nt)|0,g=Math.imul(D,lt),l=l+Math.imul(mt,wt)|0,o=o+Math.imul(mt,Et)|0,o=o+Math.imul(k,wt)|0,g=g+Math.imul(k,Et)|0;var He=(x+l|0)+((o&8191)<<13)|0;x=(g+(o>>>13)|0)+(He>>>26)|0,He&=67108863,l=Math.imul(R,wt),o=Math.imul(R,Et),o=o+Math.imul(D,wt)|0,g=Math.imul(D,Et);var We=(x+l|0)+((o&8191)<<13)|0;return x=(g+(o>>>13)|0)+(We>>>26)|0,We&=67108863,v[0]=Qt,v[1]=Yt,v[2]=te,v[3]=ee,v[4]=re,v[5]=Re,v[6]=Te,v[7]=Pe,v[8]=Ce,v[9]=Oe,v[10]=ke,v[11]=Be,v[12]=Ue,v[13]=Fe,v[14]=De,v[15]=Le,v[16]=$e,v[17]=He,v[18]=We,x!==0&&(v[19]=x,h.length++),h};Math.imul||(V=q);function At(d,i,s){s.negative=i.negative^d.negative,s.length=d.length+i.length;for(var h=0,p=0,m=0;m<s.length-1;m++){var v=p;p=0;for(var x=h&67108863,l=Math.min(m,i.length-1),o=Math.max(0,m-d.length+1);o<=l;o++){var g=m-o,C=d.words[g]|0,u=i.words[o]|0,A=C*u,S=A&67108863;v=v+(A/67108864|0)|0,S=S+x|0,x=S&67108863,v=v+(S>>>26)|0,p+=v>>>26,v&=67108863}s.words[m]=x,h=v,v=p}return h!==0?s.words[m]=h:s.length--,s._strip()}function St(d,i,s){return At(d,i,s)}f.prototype.mulTo=function(i,s){var h,p=this.length+i.length;return this.length===10&&i.length===10?h=V(this,i,s):p<63?h=q(this,i,s):p<1024?h=At(this,i,s):h=St(this,i,s),h},f.prototype.mul=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),this.mulTo(i,s)},f.prototype.mulf=function(i){var s=new f(null);return s.words=new Array(this.length+i.length),St(this,i,s)},f.prototype.imul=function(i){return this.clone().mulTo(i,this)},f.prototype.imuln=function(i){var s=i<0;s&&(i=-i),n(typeof i=="number"),n(i<67108864);for(var h=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*i,v=(m&67108863)+(h&67108863);h>>=26,h+=m/67108864|0,h+=v>>>26,this.words[p]=v&67108863}return h!==0&&(this.words[p]=h,this.length++),s?this.ineg():this},f.prototype.muln=function(i){return this.clone().imuln(i)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(i){var s=z(i);if(s.length===0)return new f(1);for(var h=this,p=0;p<s.length&&s[p]===0;p++,h=h.sqr());if(++p<s.length)for(var m=h.sqr();p<s.length;p++,m=m.sqr())s[p]!==0&&(h=h.mul(m));return h},f.prototype.iushln=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=67108863>>>26-s<<26-s,m;if(s!==0){var v=0;for(m=0;m<this.length;m++){var x=this.words[m]&p,l=(this.words[m]|0)-x<<s;this.words[m]=l|v,v=x>>>26-s}v&&(this.words[m]=v,this.length++)}if(h!==0){for(m=this.length-1;m>=0;m--)this.words[m+h]=this.words[m];for(m=0;m<h;m++)this.words[m]=0;this.length+=h}return this._strip()},f.prototype.ishln=function(i){return n(this.negative===0),this.iushln(i)},f.prototype.iushrn=function(i,s,h){n(typeof i=="number"&&i>=0);var p;s?p=(s-s%26)/26:p=0;var m=i%26,v=Math.min((i-m)/26,this.length),x=67108863^67108863>>>m<<m,l=h;if(p-=v,p=Math.max(0,p),l){for(var o=0;o<v;o++)l.words[o]=this.words[o];l.length=v}if(v!==0)if(this.length>v)for(this.length-=v,o=0;o<this.length;o++)this.words[o]=this.words[o+v];else this.words[0]=0,this.length=1;var g=0;for(o=this.length-1;o>=0&&(g!==0||o>=p);o--){var C=this.words[o]|0;this.words[o]=g<<26-m|C>>>m,g=C&x}return l&&g!==0&&(l.words[l.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},f.prototype.ishrn=function(i,s,h){return n(this.negative===0),this.iushrn(i,s,h)},f.prototype.shln=function(i){return this.clone().ishln(i)},f.prototype.ushln=function(i){return this.clone().iushln(i)},f.prototype.shrn=function(i){return this.clone().ishrn(i)},f.prototype.ushrn=function(i){return this.clone().iushrn(i)},f.prototype.testn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return!1;var m=this.words[h];return!!(m&p)},f.prototype.imaskn=function(i){n(typeof i=="number"&&i>=0);var s=i%26,h=(i-s)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(s!==0&&h++,this.length=Math.min(h,this.length),s!==0){var p=67108863^67108863>>>s<<s;this.words[this.length-1]&=p}return this._strip()},f.prototype.maskn=function(i){return this.clone().imaskn(i)},f.prototype.iaddn=function(i){return n(typeof i=="number"),n(i<67108864),i<0?this.isubn(-i):this.negative!==0?this.length===1&&(this.words[0]|0)<=i?(this.words[0]=i-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(i),this.negative=1,this):this._iaddn(i)},f.prototype._iaddn=function(i){this.words[0]+=i;for(var s=0;s<this.length&&this.words[s]>=67108864;s++)this.words[s]-=67108864,s===this.length-1?this.words[s+1]=1:this.words[s+1]++;return this.length=Math.max(this.length,s+1),this},f.prototype.isubn=function(i){if(n(typeof i=="number"),n(i<67108864),i<0)return this.iaddn(-i);if(this.negative!==0)return this.negative=0,this.iaddn(i),this.negative=1,this;if(this.words[0]-=i,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var s=0;s<this.length&&this.words[s]<0;s++)this.words[s]+=67108864,this.words[s+1]-=1;return this._strip()},f.prototype.addn=function(i){return this.clone().iaddn(i)},f.prototype.subn=function(i){return this.clone().isubn(i)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(i,s,h){var p=i.length+h,m;this._expand(p);var v,x=0;for(m=0;m<i.length;m++){v=(this.words[m+h]|0)+x;var l=(i.words[m]|0)*s;v-=l&67108863,x=(v>>26)-(l/67108864|0),this.words[m+h]=v&67108863}for(;m<this.length-h;m++)v=(this.words[m+h]|0)+x,x=v>>26,this.words[m+h]=v&67108863;if(x===0)return this._strip();for(n(x===-1),x=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+x,x=v>>26,this.words[m]=v&67108863;return this.negative=1,this._strip()},f.prototype._wordDiv=function(i,s){var h=this.length-i.length,p=this.clone(),m=i,v=m.words[m.length-1]|0,x=this._countBits(v);h=26-x,h!==0&&(m=m.ushln(h),p.iushln(h),v=m.words[m.length-1]|0);var l=p.length-m.length,o;if(s!=="mod"){o=new f(null),o.length=l+1,o.words=new Array(o.length);for(var g=0;g<o.length;g++)o.words[g]=0}var C=p.clone()._ishlnsubmul(m,1,l);C.negative===0&&(p=C,o&&(o.words[l]=1));for(var u=l-1;u>=0;u--){var A=(p.words[m.length+u]|0)*67108864+(p.words[m.length+u-1]|0);for(A=Math.min(A/v|0,67108863),p._ishlnsubmul(m,A,u);p.negative!==0;)A--,p.negative=0,p._ishlnsubmul(m,1,u),p.isZero()||(p.negative^=1);o&&(o.words[u]=A)}return o&&o._strip(),p._strip(),s!=="div"&&h!==0&&p.iushrn(h),{div:o||null,mod:p}},f.prototype.divmod=function(i,s,h){if(n(!i.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var p,m,v;return this.negative!==0&&i.negative===0?(v=this.neg().divmod(i,s),s!=="mod"&&(p=v.div.neg()),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.iadd(i)),{div:p,mod:m}):this.negative===0&&i.negative!==0?(v=this.divmod(i.neg(),s),s!=="mod"&&(p=v.div.neg()),{div:p,mod:v.mod}):this.negative&i.negative?(v=this.neg().divmod(i.neg(),s),s!=="div"&&(m=v.mod.neg(),h&&m.negative!==0&&m.isub(i)),{div:v.div,mod:m}):i.length>this.length||this.cmp(i)<0?{div:new f(0),mod:this}:i.length===1?s==="div"?{div:this.divn(i.words[0]),mod:null}:s==="mod"?{div:null,mod:new f(this.modrn(i.words[0]))}:{div:this.divn(i.words[0]),mod:new f(this.modrn(i.words[0]))}:this._wordDiv(i,s)},f.prototype.div=function(i){return this.divmod(i,"div",!1).div},f.prototype.mod=function(i){return this.divmod(i,"mod",!1).mod},f.prototype.umod=function(i){return this.divmod(i,"mod",!0).mod},f.prototype.divRound=function(i){var s=this.divmod(i);if(s.mod.isZero())return s.div;var h=s.div.negative!==0?s.mod.isub(i):s.mod,p=i.ushrn(1),m=i.andln(1),v=h.cmp(p);return v<0||m===1&&v===0?s.div:s.div.negative!==0?s.div.isubn(1):s.div.iaddn(1)},f.prototype.modrn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=(1<<26)%i,p=0,m=this.length-1;m>=0;m--)p=(h*p+(this.words[m]|0))%i;return s?-p:p},f.prototype.modn=function(i){return this.modrn(i)},f.prototype.idivn=function(i){var s=i<0;s&&(i=-i),n(i<=67108863);for(var h=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+h*67108864;this.words[p]=m/i|0,h=m%i}return this._strip(),s?this.ineg():this},f.prototype.divn=function(i){return this.clone().idivn(i)},f.prototype.egcd=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=new f(0),x=new f(1),l=0;s.isEven()&&h.isEven();)s.iushrn(1),h.iushrn(1),++l;for(var o=h.clone(),g=s.clone();!s.isZero();){for(var C=0,u=1;!(s.words[0]&u)&&C<26;++C,u<<=1);if(C>0)for(s.iushrn(C);C-- >0;)(p.isOdd()||m.isOdd())&&(p.iadd(o),m.isub(g)),p.iushrn(1),m.iushrn(1);for(var A=0,S=1;!(h.words[0]&S)&&A<26;++A,S<<=1);if(A>0)for(h.iushrn(A);A-- >0;)(v.isOdd()||x.isOdd())&&(v.iadd(o),x.isub(g)),v.iushrn(1),x.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(v),m.isub(x)):(h.isub(s),v.isub(p),x.isub(m))}return{a:v,b:x,gcd:h.iushln(l)}},f.prototype._invmp=function(i){n(i.negative===0),n(!i.isZero());var s=this,h=i.clone();s.negative!==0?s=s.umod(i):s=s.clone();for(var p=new f(1),m=new f(0),v=h.clone();s.cmpn(1)>0&&h.cmpn(1)>0;){for(var x=0,l=1;!(s.words[0]&l)&&x<26;++x,l<<=1);if(x>0)for(s.iushrn(x);x-- >0;)p.isOdd()&&p.iadd(v),p.iushrn(1);for(var o=0,g=1;!(h.words[0]&g)&&o<26;++o,g<<=1);if(o>0)for(h.iushrn(o);o-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);s.cmp(h)>=0?(s.isub(h),p.isub(m)):(h.isub(s),m.isub(p))}var C;return s.cmpn(1)===0?C=p:C=m,C.cmpn(0)<0&&C.iadd(i),C},f.prototype.gcd=function(i){if(this.isZero())return i.abs();if(i.isZero())return this.abs();var s=this.clone(),h=i.clone();s.negative=0,h.negative=0;for(var p=0;s.isEven()&&h.isEven();p++)s.iushrn(1),h.iushrn(1);do{for(;s.isEven();)s.iushrn(1);for(;h.isEven();)h.iushrn(1);var m=s.cmp(h);if(m<0){var v=s;s=h,h=v}else if(m===0||h.cmpn(1)===0)break;s.isub(h)}while(!0);return h.iushln(p)},f.prototype.invm=function(i){return this.egcd(i).a.umod(i)},f.prototype.isEven=function(){return(this.words[0]&1)===0},f.prototype.isOdd=function(){return(this.words[0]&1)===1},f.prototype.andln=function(i){return this.words[0]&i},f.prototype.bincn=function(i){n(typeof i=="number");var s=i%26,h=(i-s)/26,p=1<<s;if(this.length<=h)return this._expand(h+1),this.words[h]|=p,this;for(var m=p,v=h;m!==0&&v<this.length;v++){var x=this.words[v]|0;x+=m,m=x>>>26,x&=67108863,this.words[v]=x}return m!==0&&(this.words[v]=m,this.length++),this},f.prototype.isZero=function(){return this.length===1&&this.words[0]===0},f.prototype.cmpn=function(i){var s=i<0;if(this.negative!==0&&!s)return-1;if(this.negative===0&&s)return 1;this._strip();var h;if(this.length>1)h=1;else{s&&(i=-i),n(i<=67108863,"Number is too big");var p=this.words[0]|0;h=p===i?0:p<i?-1:1}return this.negative!==0?-h|0:h},f.prototype.cmp=function(i){if(this.negative!==0&&i.negative===0)return-1;if(this.negative===0&&i.negative!==0)return 1;var s=this.ucmp(i);return this.negative!==0?-s|0:s},f.prototype.ucmp=function(i){if(this.length>i.length)return 1;if(this.length<i.length)return-1;for(var s=0,h=this.length-1;h>=0;h--){var p=this.words[h]|0,m=i.words[h]|0;if(p!==m){p<m?s=-1:p>m&&(s=1);break}}return s},f.prototype.gtn=function(i){return this.cmpn(i)===1},f.prototype.gt=function(i){return this.cmp(i)===1},f.prototype.gten=function(i){return this.cmpn(i)>=0},f.prototype.gte=function(i){return this.cmp(i)>=0},f.prototype.ltn=function(i){return this.cmpn(i)===-1},f.prototype.lt=function(i){return this.cmp(i)===-1},f.prototype.lten=function(i){return this.cmpn(i)<=0},f.prototype.lte=function(i){return this.cmp(i)<=0},f.prototype.eqn=function(i){return this.cmpn(i)===0},f.prototype.eq=function(i){return this.cmp(i)===0},f.red=function(i){return new I(i)},f.prototype.toRed=function(i){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),i.convertTo(this)._forceRed(i)},f.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(i){return this.red=i,this},f.prototype.forceRed=function(i){return n(!this.red,"Already a number in reduction context"),this._forceRed(i)},f.prototype.redAdd=function(i){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,i)},f.prototype.redIAdd=function(i){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,i)},f.prototype.redSub=function(i){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,i)},f.prototype.redISub=function(i){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,i)},f.prototype.redShl=function(i){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,i)},f.prototype.redMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.mul(this,i)},f.prototype.redIMul=function(i){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,i),this.red.imul(this,i)},f.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(i){return n(this.red&&!i.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,i)};var Z={k256:null,p224:null,p192:null,p25519:null};function Y(d,i){this.name=d,this.p=new f(i,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Y.prototype._tmp=function(){var i=new f(null);return i.words=new Array(Math.ceil(this.n/13)),i},Y.prototype.ireduce=function(i){var s=i,h;do this.split(s,this.tmp),s=this.imulK(s),s=s.iadd(this.tmp),h=s.bitLength();while(h>this.n);var p=h<this.n?-1:s.ucmp(this.p);return p===0?(s.words[0]=0,s.length=1):p>0?s.isub(this.p):s.strip!==void 0?s.strip():s._strip(),s},Y.prototype.split=function(i,s){i.iushrn(this.n,0,s)},Y.prototype.imulK=function(i){return i.imul(this.k)};function Ct(){Y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Ct,Y),Ct.prototype.split=function(i,s){for(var h=4194303,p=Math.min(i.length,9),m=0;m<p;m++)s.words[m]=i.words[m];if(s.length=p,i.length<=9){i.words[0]=0,i.length=1;return}var v=i.words[9];for(s.words[s.length++]=v&h,m=10;m<i.length;m++){var x=i.words[m]|0;i.words[m-10]=(x&h)<<4|v>>>22,v=x}v>>>=22,i.words[m-10]=v,v===0&&i.length>10?i.length-=10:i.length-=9},Ct.prototype.imulK=function(i){i.words[i.length]=0,i.words[i.length+1]=0,i.length+=2;for(var s=0,h=0;h<i.length;h++){var p=i.words[h]|0;s+=p*977,i.words[h]=s&67108863,s=p*64+(s/67108864|0)}return i.words[i.length-1]===0&&(i.length--,i.words[i.length-1]===0&&i.length--),i};function Tt(){Y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(Tt,Y);function Rt(){Y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Rt,Y);function Dt(){Y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(Dt,Y),Dt.prototype.imulK=function(i){for(var s=0,h=0;h<i.length;h++){var p=(i.words[h]|0)*19+s,m=p&67108863;p>>>=26,i.words[h]=m,s=p}return s!==0&&(i.words[i.length++]=s),i},f._prime=function(i){if(Z[i])return Z[i];var s;if(i==="k256")s=new Ct;else if(i==="p224")s=new Tt;else if(i==="p192")s=new Rt;else if(i==="p25519")s=new Dt;else throw new Error("Unknown prime "+i);return Z[i]=s,s};
12function I(d){if(typeof d=="string"){var i=f._prime(d);this.m=i.p,this.prime=i}else n(d.gtn(1),"modulus must be greater than 1"),this.m=d,this.prime=null}I.prototype._verify1=function(i){n(i.negative===0,"red works only with positives"),n(i.red,"red works only with red numbers")},I.prototype._verify2=function(i,s){n((i.negative|s.negative)===0,"red works only with positives"),n(i.red&&i.red===s.red,"red works only with red numbers")},I.prototype.imod=function(i){return this.prime?this.prime.ireduce(i)._forceRed(this):(E(i,i.umod(this.m)._forceRed(this)),i)},I.prototype.neg=function(i){return i.isZero()?i.clone():this.m.sub(i)._forceRed(this)},I.prototype.add=function(i,s){this._verify2(i,s);var h=i.add(s);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},I.prototype.iadd=function(i,s){this._verify2(i,s);var h=i.iadd(s);return h.cmp(this.m)>=0&&h.isub(this.m),h},I.prototype.sub=function(i,s){this._verify2(i,s);var h=i.sub(s);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},I.prototype.isub=function(i,s){this._verify2(i,s);var h=i.isub(s);return h.cmpn(0)<0&&h.iadd(this.m),h},I.prototype.shl=function(i,s){return this._verify1(i),this.imod(i.ushln(s))},I.prototype.imul=function(i,s){return this._verify2(i,s),this.imod(i.imul(s))},I.prototype.mul=function(i,s){return this._verify2(i,s),this.imod(i.mul(s))},I.prototype.isqr=function(i){return this.imul(i,i.clone())},I.prototype.sqr=function(i){return this.mul(i,i)},I.prototype.sqrt=function(i){if(i.isZero())return i.clone();var s=this.m.andln(3);if(n(s%2===1),s===3){var h=this.m.add(new f(1)).iushrn(2);return this.pow(i,h)}for(var p=this.m.subn(1),m=0;!p.isZero()&&p.andln(1)===0;)m++,p.iushrn(1);n(!p.isZero());var v=new f(1).toRed(this),x=v.redNeg(),l=this.m.subn(1).iushrn(1),o=this.m.bitLength();for(o=new f(2*o*o).toRed(this);this.pow(o,l).cmp(x)!==0;)o.redIAdd(x);for(var g=this.pow(o,p),C=this.pow(i,p.addn(1).iushrn(1)),u=this.pow(i,p),A=m;u.cmp(v)!==0;){for(var S=u,_=0;S.cmp(v)!==0;_++)S=S.redSqr();n(_<A);var P=this.pow(g,new f(1).iushln(A-_-1));C=C.redMul(P),g=P.redSqr(),u=u.redMul(g),A=_}return C},I.prototype.invm=function(i){var s=i._invmp(this.m);return s.negative!==0?(s.negative=0,this.imod(s).redNeg()):this.imod(s)},I.prototype.pow=function(i,s){if(s.isZero())return new f(1).toRed(this);if(s.cmpn(1)===0)return i.clone();var h=4,p=new Array(1<<h);p[0]=new f(1).toRed(this),p[1]=i;for(var m=2;m<p.length;m++)p[m]=this.mul(p[m-1],i);var v=p[0],x=0,l=0,o=s.bitLength()%26;for(o===0&&(o=26),m=s.length-1;m>=0;m--){for(var g=s.words[m],C=o-1;C>=0;C--){var u=g>>C&1;if(v!==p[0]&&(v=this.sqr(v)),u===0&&x===0){l=0;continue}x<<=1,x|=u,l++,!(l!==h&&(m!==0||C!==0))&&(v=this.mul(v,p[x]),l=0,x=0)}o=26}return v},I.prototype.convertTo=function(i){var s=i.umod(this.m);return s===i?s.clone():s},I.prototype.convertFrom=function(i){var s=i.clone();return s.red=null,s},f.mont=function(i){return new N(i)};function N(d){I.call(this,d),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}a(N,I),N.prototype.convertTo=function(i){return this.imod(i.ushln(this.shift))},N.prototype.convertFrom=function(i){var s=this.imod(i.mul(this.rinv));return s.red=null,s},N.prototype.imul=function(i,s){if(i.isZero()||s.isZero())return i.words[0]=0,i.length=1,i;var h=i.imul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.mul=function(i,s){if(i.isZero()||s.isZero())return new f(0)._forceRed(this);var h=i.mul(s),p=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=h.isub(p).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},N.prototype.invm=function(i){var s=this.imod(i._invmp(this.m).mul(this.r2));return s._forceRed(this)}})(r,bi)})(K1);var S9=K1.exports;const ce=Nr(S9),I9="logger/5.7.0";let Qx=!1,Yx=!1;const eu={debug:1,default:2,info:2,warning:3,error:4,off:5};let t2=eu.default,td=null;function R9(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const e2=R9();var ap;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(ap||(ap={}));var lo;
12(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(lo||(lo={}));const r2="0123456789abcdef";class Ot{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();eu[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(t2>eu[n])&&console.log.apply(console,e)}debug(...t){this._log(Ot.levels.DEBUG,t)}info(...t){this._log(Ot.levels.INFO,t)}warn(...t){this._log(Ot.levels.WARNING,t)}makeError(t,e,n){if(Yx)return this.makeError("censored error",e,{});e||(e=Ot.errors.UNKNOWN_ERROR),n||(n={});const a=[];Object.keys(n).forEach(b=>{const w=n[b];try{if(w instanceof Uint8Array){let E="";for(let M=0;M<w.length;M++)E+=r2[w[M]>>4],E+=r2[w[M]&15];a.push(b+"=Uint8Array(0x"+E+")")}else a.push(b+"="+JSON.stringify(w))}catch{a.push(b+"="+JSON.stringify(n[b].toString()))}}),a.push(`code=${e}`),a.push(`version=${this.version}`);const f=t;let c="";switch(e){case lo.NUMERIC_FAULT:{c="NUMERIC_FAULT";const b=t;switch(b){case"overflow":case"underflow":case"division-by-zero":c+="-"+b;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case lo.CALL_EXCEPTION:case lo.INSUFFICIENT_FUNDS:case lo.MISSING_NEW:case lo.NONCE_EXPIRED:case lo.REPLACEMENT_UNDERPRICED:case lo.TRANSACTION_REPLACED:case lo.UNPREDICTABLE_GAS_LIMIT:c=e;break}c&&(t+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),a.length&&(t+=" ("+a.join(", ")+")");const y=new Error(t);return y.reason=f,y.code=e,Object.keys(n).forEach(function(b){y[b]=n[b]}),y}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,Ot.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,a){t||this.throwError(e,n,a)}assertArgument(t,e,n,a){t||this.throwArgumentError(e,n,a)}checkNormalize(t){e2&&this.throwError("platform missing String.prototype.normalize",Ot.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e2})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,Ot.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,Ot.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,Ot.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,Ot.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",Ot.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",Ot.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Ot.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return td||(td=new Ot(I9)),td}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",Ot.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}
12),Qx){if(!t)return;this.globalLogger().throwError("error censorship permanent",Ot.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Yx=!!t,Qx=!!e}static setLogLevel(t){const e=eu[t.toLowerCase()];if(e==null){Ot.globalLogger().warn("invalid log level - "+t);return}t2=e}static from(t){return new Ot(t)}}Ot.errors=lo;Ot.levels=ap;const T9="bytes/5.7.0",lr=new Ot(T9);function J3(r){return!!r.toHexString}function r0(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return r0(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function H1(r){return rr(r)&&!(r.length%2)||Sl(r)}function i2(r){return typeof r=="number"&&r==r&&r%1===0}function Sl(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!i2(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!i2(e)||e<0||e>=256)return!1}return!0}function ve(r,t){if(t||(t={}),typeof r=="number"){lr.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),r0(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),J3(r)&&(r=r.toHexString()),rr(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":lr.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let a=0;a<e.length;a+=2)n.push(parseInt(e.substring(a,a+2),16));return r0(new Uint8Array(n))}return Sl(r)?r0(new Uint8Array(r)):lr.throwArgumentError("invalid arrayify value","value",r)}function Gs(r){const t=r.map(a=>ve(a)),e=t.reduce((a,f)=>a+f.length,0),n=new Uint8Array(e);return t.reduce((a,f)=>(n.set(f,a),a+f.length),0),r0(n)}function l0(r){let t=ve(r);if(t.length===0)return t;let e=0;for(;e<t.length&&t[e]===0;)e++;return e&&(t=t.slice(e)),t}function P9(r,t){r=ve(r),r.length>t&&lr.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),r0(e)}function rr(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const ed="0123456789abcdef";function ge(r,t){if(t||(t={}),typeof r=="number"){lr.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=ed[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),J3(r))return r.toHexString();if(rr(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":lr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Sl(r)){let e="0x";for(let n=0;n<r.length;n++){let a=r[n];e+=ed[(a&240)>>4]+ed[a&15]}return e}return lr.throwArgumentError("invalid hexlify value","value",r)}function _0(r){if(typeof r!="string")r=ge(r);else if(!rr(r)||r.length%2)return null;return(r.length-2)/2}function Df(r,t,e){return typeof r!="string"?r=ge(r):(!rr(r)||r.length%2)&&lr.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function ls(r){let t="0x";return r.forEach(e=>{t+=ge(e).substring(2)}),t}function W1(r){const t=C9(ge(r,{hexPad:"left"}));return t==="0x"?"0x0":t}function C9(r){typeof r!="string"&&(r=ge(r)),rr(r)||lr.throwArgumentError("invalid hex string","value",r),r=r.substring(2);let t=0;for(;t<r.length&&r[t]==="0";)t++;return"0x"+r.substring(t)}function ii(r,t){for(typeof r!="string"?r=ge(r):rr(r)||lr.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&lr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function Il(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(H1(r)){let e=ve(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=ge(e.slice(0,32)),t.s=ge(e.slice(32,64))):e.length===65?(t.r=ge(e.slice(0,32)),t.s=ge(e.slice(32,64)),t.v=e[64]):lr.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:lr.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=ge(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const a=P9(ve(t._vs),32);t._vs=ge(a);const f=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=f:t.recoveryParam!==f&&lr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),a[0]&=127;const c=ge(a);t.s==null?t.s=c:t.s!==c&&lr.throwArgumentError("signature v mismatch _vs","signature",r)}
12if(t.recoveryParam==null)t.v==null?lr.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&lr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!rr(t.r)?lr.throwArgumentError("signature missing or invalid r","signature",r):t.r=ii(t.r,32),t.s==null||!rr(t.s)?lr.throwArgumentError("signature missing or invalid s","signature",r):t.s=ii(t.s,32);const e=ve(t.s);e[0]>=128&&lr.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=ge(e);t._vs&&(rr(t._vs)||lr.throwArgumentError("signature invalid _vs","signature",r),t._vs=ii(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&lr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const O9="bignumber/5.7.0";var Du=ce.BN;const Yo=new Ot(O9),rd={},n2=9007199254740991;let o2=!1;class fe{constructor(t,e){t!==rd&&Yo.throwError("cannot call constructor directly; use BigNumber.from",Ot.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Oi(_e(this).fromTwos(t))}toTwos(t){return Oi(_e(this).toTwos(t))}abs(){return this._hex[0]==="-"?fe.from(this._hex.substring(1)):this}add(t){return Oi(_e(this).add(_e(t)))}sub(t){return Oi(_e(this).sub(_e(t)))}div(t){return fe.from(t).isZero()&&fn("division-by-zero","div"),Oi(_e(this).div(_e(t)))}mul(t){return Oi(_e(this).mul(_e(t)))}mod(t){const e=_e(t);return e.isNeg()&&fn("division-by-zero","mod"),Oi(_e(this).umod(e))}pow(t){const e=_e(t);return e.isNeg()&&fn("negative-power","pow"),Oi(_e(this).pow(e))}and(t){const e=_e(t);return(this.isNegative()||e.isNeg())&&fn("unbound-bitwise-result","and"),Oi(_e(this).and(e))}or(t){const e=_e(t);return(this.isNegative()||e.isNeg())&&fn("unbound-bitwise-result","or"),Oi(_e(this).or(e))}xor(t){const e=_e(t);return(this.isNegative()||e.isNeg())&&fn("unbound-bitwise-result","xor"),Oi(_e(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&fn("negative-width","mask"),Oi(_e(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&fn("negative-width","shl"),Oi(_e(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&fn("negative-width","shr"),Oi(_e(this).shrn(t))}eq(t){return _e(this).eq(_e(t))}lt(t){return _e(this).lt(_e(t))}lte(t){return _e(this).lte(_e(t))}gt(t){return _e(this).gt(_e(t))}gte(t){return _e(this).gte(_e(t))}isNegative(){return this._hex[0]==="-"}isZero(){return _e(this).isZero()}toNumber(){try{return _e(this).toNumber()}catch{fn("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Yo.throwError("this platform does not support BigInt",Ot.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?o2||(o2=!0,Yo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Yo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ot.errors.UNEXPECTED_ARGUMENT,{}):Yo.throwError("BigNumber.toString does not accept parameters",Ot.errors.UNEXPECTED_ARGUMENT,{})),_e(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof fe)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new fe(rd,ka(t)):t.match(/^-?[0-9]+$/)?new fe(rd,ka(new Du(t))):Yo.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&fn("underflow","BigNumber.from",t),(t>=n2||t<=-n2)&&fn("overflow","BigNumber.from",t),fe.from(String(t));const e=t;if(typeof e=="bigint")return fe.from(e.toString());if(Sl(e))return fe.from(ge(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return fe.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(rr(n)||n[0]==="-"&&rr(n.substring(1))))return fe.from(n)}return Yo.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function ka(r){if(typeof r!="string")return ka(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&Yo.throwArgumentError("invalid hex","value",r),r=ka(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Oi(r){return fe.from(ka(r))}function _e(r){const t=fe.from(r).toHexString();return t[0]==="-"?new Du("-"+t.substring(3),16):new Du(t.substring(2),16)}function fn(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),Yo.throwError(r,Ot.errors.NUMERIC_FAULT,n)}function k9(r){return new Du(r,36).toString(16)}const B9="properties/5.7.0";var U9=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Lu=new Ot(B9);function se(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function Of(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}function ti(r){return U9(this,void 0,void 0,function*(){const t=Object.keys(r).map(n=>{const a=r[n];return Promise.resolve(a).then(f=>({key:n,value:f}))});return(yield Promise.all(t)).reduce((n,a)=>(n[a.key]=a.value,n),{})})}function F9(r,t){(!r||typeof r!="object")&&Lu.throwArgumentError("invalid object","object",r),Object.keys(r).forEach(e
12=>{t[e]||Lu.throwArgumentError("invalid object key - "+e,"transaction:"+e,r)})}function wn(r){const t={};for(const e in r)t[e]=r[e];return t}const D9={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function V3(r){if(r==null||D9[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!V3(n))return!1}return!0}return Lu.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function L9(r){if(V3(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>Ba(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&se(t,e,Ba(n))}return t}return Lu.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function Ba(r){return L9(r)}class $9{constructor(t){for(const e in t)this[e]=Ba(t[e])}}const G9="abstract-provider/5.7.0";var z9=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const q9=new Ot(G9);class K9 extends $9{static isForkEvent(t){return!!(t&&t._isForkEvent)}}class $u{constructor(){q9.checkAbstract(new.target,$u),se(this,"_isProvider",!0)}getFeeData(){return z9(this,void 0,void 0,function*(){const{block:t,gasPrice:e}=yield ti({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(c=>null)});let n=null,a=null,f=null;return t&&t.baseFeePerGas&&(n=t.baseFeePerGas,f=fe.from("1500000000"),a=t.baseFeePerGas.mul(2).add(f)),{lastBaseFeePerGas:n,maxFeePerGas:a,maxPriorityFeePerGas:f,gasPrice:e}})}addListener(t,e){return this.on(t,e)}removeListener(t,e){return this.off(t,e)}static isProvider(t){return!!(t&&t._isProvider)}}const H9="networks/5.7.1",f2=new Ot(H9);function W9(r){return r&&typeof r.renetwork=="function"}
12function ef(r){const t=function(e,n){n==null&&(n={});const a=[];if(e.InfuraProvider&&n.infura!=="-")try{a.push(new e.InfuraProvider(r,n.infura))}catch{}if(e.EtherscanProvider&&n.etherscan!=="-")try{a.push(new e.EtherscanProvider(r,n.etherscan))}catch{}if(e.AlchemyProvider&&n.alchemy!=="-")try{a.push(new e.AlchemyProvider(r,n.alchemy))}catch{}if(e.PocketProvider&&n.pocket!=="-"){const f=["goerli","ropsten","rinkeby","sepolia"];try{const c=new e.PocketProvider(r,n.pocket);c.network&&f.indexOf(c.network.name)===-1&&a.push(c)}catch{}}if(e.CloudflareProvider&&n.cloudflare!=="-")try{a.push(new e.CloudflareProvider(r))}catch{}if(e.AnkrProvider&&n.ankr!=="-")try{const f=["ropsten"],c=new e.AnkrProvider(r,n.ankr);c.network&&f.indexOf(c.network.name)===-1&&a.push(c)}catch{}if(a.length===0)return null;if(e.FallbackProvider){let f=1;return n.quorum!=null?f=n.quorum:r==="homestead"&&(f=2),new e.FallbackProvider(a,f)}return a[0]};return t.renetwork=function(e){return ef(e)},t}function Gu(r,t){const e=function(n,a){return n.JsonRpcProvider?new n.JsonRpcProvider(r,t):null};return e.renetwork=function(n){return Gu(r,n)},e}const s2={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ef("homestead")},a2={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ef("ropsten")},h2={chainId:63,name:"classicMordor",_defaultProvider:Gu("https://www.ethercluster.com/mordor","classicMordor")},sh={unspecified:{chainId:0,name:"unspecified"},homestead:s2,mainnet:s2,morden:{chainId:2,name:"morden"},ropsten:a2,testnet:a2,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ef("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ef("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ef("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ef("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Gu("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:h2,classicTestnet:h2,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Gu("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ef("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ef("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function J9(r){if(r==null)return null;if(typeof r=="number"){for(const n in sh){const a=sh[n];if(a.chainId===r)return{name:a.name,chainId:a.chainId,ensAddress:a.ensAddress||null,_defaultProvider:a._defaultProvider||null}}return{chainId:r,name:"unknown"}}if(typeof r=="string"){const n=sh[r];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const t=sh[r.name];if(!t)return typeof r.chainId!="number"&&f2.throwArgumentError("invalid network chainId","network",r),r;r.chainId!==0&&r.chainId!==t.chainId&&f2.throwArgumentError("network chainId mismatch","network",r);let e=r._defaultProvider||null;return e==null&&t._defaultProvider&&(W9(t._defaultProvider)?e=t._defaultProvider.renetwork(r):e=t._defaultProvider),{name:r.name,chainId:t.chainId,ensAddress:r.ensAddress||t.ensAddress||null,_defaultProvider:e}}class j3{constructor(t){se(this,"alphabet",t),se(this,"base",t.length),se(this,"_alphabetMap",{}),se(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=ve(t);if(e.length===0)return"";let n=[0];for(let f=0;f<e.length;++f){let c=e[f];for(let y=0;y<n.length;++y)c+=n[y]<<8,n[y]=c%this.base,c=c/this.base|0;for(;c>0;)n.push(c%this.base),c=c/this.base|0}let a="";for(let f=0;e[f]===0&&f<e.length-1;++f)a+=this._leader;for(let f=n.length-1;f>=0;
12--f)a+=this.alphabet[n[f]];return a}decode(t){if(typeof t!="string")throw new TypeError("Expected String");let e=[];if(t.length===0)return new Uint8Array(e);e.push(0);for(let n=0;n<t.length;n++){let a=this._alphabetMap[t[n]];if(a===void 0)throw new Error("Non-base"+this.base+" character");let f=a;for(let c=0;c<e.length;++c)f+=e[c]*this.base,e[c]=f&255,f>>=8;for(;f>0;)e.push(f&255),f>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)e.push(0);return ve(new Uint8Array(e.reverse()))}}new j3("abcdefghijklmnopqrstuvwxyz234567");const X3=new j3("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),V9="0x0000000000000000000000000000000000000000",j9=fe.from(0),X9="0x0000000000000000000000000000000000000000000000000000000000000000";var Z3={exports:{}};(function(r){(function(){var t="input is invalid type",e="finalize already called",n=typeof window=="object",a=n?window:{};a.JS_SHA3_NO_WINDOW&&(n=!1);var f=!n&&typeof self=="object",c=!a.JS_SHA3_NO_NODE_JS&&typeof xr=="object"&&xr.versions&&xr.versions.node;c?a=bi:f&&(a=self);var y=!a.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!a.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",w="0123456789abcdef".split(""),E=[31,7936,2031616,520093696],M=[4,1024,262144,67108864],O=[1,256,65536,16777216],F=[6,1536,393216,100663296],B=[0,8,16,24],L=[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],z=[224,256,384,512],q=[128,256],V=["hex","buffer","arrayBuffer","array","digest"],At={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),b&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});for(var St=function(u,A,S){return function(_){return new o(u,A,u).update(_)[S]()}},Z=function(u,A,S){return function(_,P){return new o(u,A,P).update(_)[S]()}},Y=function(u,A,S){return function(_,P,K,$){return i["cshake"+u].update(_,P,K,$)[S]()}},Ct=function(u,A,S){return function(_,P,K,$){return i["kmac"+u].update(_,P,K,$)[S]()}},Tt=function(u,A,S,_){for(var P=0;P<V.length;++P){var K=V[P];u[K]=A(S,_,K)}return u},Rt=function(u,A){var S=St(u,A,"hex");return S.create=function(){return new o(u,A,u)},S.update=function(_){return S.create().update(_)},Tt(S,St,u,A)},Dt=function(u,A){var S=Z(u,A,"hex");return S.create=function(_){return new o(u,A,_)},S.update=function(_,P){return S.create(P).update(_)},Tt(S,Z,u,A)},I=function(u,A){var S=At[u],_=Y(u,A,"hex");return _.create=function(P,K,$){return!K&&!$?i["shake"+u].create(P):new o(u,A,P).bytepad([K,$],S)},_.update=function(P,K,$,U){return _.create(K,$,U).update(P)},Tt(_,Y,u,A)},N=function(u,A){var S=At[u],_=Ct(u,A,"hex");return _.create=function(P,K,$){return new g(u,A,K).bytepad(["KMAC",$],S).bytepad([P],S)},_.update=function(P,K,$,U){return _.create(P,$,U).update(K)},Tt(_,Ct,u,A)},d=[{name:"keccak",padding:O,bits:z,createMethod:Rt},{name:"sha3",padding:F,bits:z,createMethod:Rt},{name:"shake",padding:E,bits:q,createMethod:Dt},{name:"cshake",padding:M,bits:q,createMethod:I},{name:"kmac",padding:M,bits:q,createMethod:N}],i={},s=[],h=0;h<d.length;++h)for(var p=d[h],m=p.bits,v=0;v<m.length;++v){var x=p.name+"_"+m[v];if(s.push(x),i[x]=p.createMethod(m[v],p.padding),p.name!=="sha3"){var l=p.name+m[v];s.push(l),i[l]=i[x]}}function o(u,A,S){this.blocks=[],this.s=[],this.padding=A,this.outputBits=S,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(u<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=S>>5,this.extraBytes=(S&31)>>3;for(var _=0;_<50;++_)this.s[_]=0}o.prototype.update=function(u){if(this.finalized)throw new Error(e);var A,S=typeof u;if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}for(var _=this.blocks,P=this.byteCount,K=u.length,$=this.blockCount,U=0,It=this.s,G,J;U<K;){if(this.reset)for(this.reset=!1,_[0]=this.block,G=1;G<$+1;++G)_[G]=0;if(A)for(G=this.start;U<K&&G<P;++U)_[G>>2]|=u[U]<<B[G++&3];else for(G=this.start;U<K&&G<P;++U)J=u.charCodeAt(U),J<128?_[G>>2]|=J<<B[G++&3]:J<2048?(_[G>>2]|=(192|J>>6)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):J<55296||J>=57344?(_[G>>2]|=(224|J>>12)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]):(J=65536+((J&1023)<<10|u.charCodeAt(++U)&1023),_[G>>2]|=(240|J>>18)<<B[G++&3],_[G>>2]|=(128|J>>12&63)<<B[G++&3],_[G>>2]|=(128|J>>6&63)<<B[G++&3],_[G>>2]|=(128|J&63)<<B[G++&3]);if(this.lastByteIndex=G,G>=P){for(this.start=G-P,this.block=_[$],G=0;G<$;++G)It[G]^=_[G];C(It),this.reset=!0}else this.start=G}return this},o.prototype.encode=function(u,A){var S=u&255,_=1,P=[S];for(u=u>>8,S=u&255;S>0;)P.unshift(S),u=u>>8,S=u&255,++_;return A?P.push(_):P.unshift(_),this.update(P),P.length},o.prototype.encodeString=function(u){var A,S=typeof u;
12if(S!=="string"){if(S==="object"){if(u===null)throw new Error(t);if(b&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!b||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);A=!0}var _=0,P=u.length;if(A)_=P;else for(var K=0;K<u.length;++K){var $=u.charCodeAt(K);$<128?_+=1:$<2048?_+=2:$<55296||$>=57344?_+=3:($=65536+(($&1023)<<10|u.charCodeAt(++K)&1023),_+=4)}return _+=this.encode(_*8),this.update(u),_},o.prototype.bytepad=function(u,A){for(var S=this.encode(A),_=0;_<u.length;++_)S+=this.encodeString(u[_]);var P=A-S%A,K=[];return K.length=P,this.update(K),this},o.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,A=this.lastByteIndex,S=this.blockCount,_=this.s;if(u[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(u[0]=u[S],A=1;A<S+1;++A)u[A]=0;for(u[S-1]|=2147483648,A=0;A<S;++A)_[A]^=u[A];C(_)}},o.prototype.toString=o.prototype.hex=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$="",U;K<S;){for(P=0;P<u&&K<S;++P,++K)U=A[P],$+=w[U>>4&15]+w[U&15]+w[U>>12&15]+w[U>>8&15]+w[U>>20&15]+w[U>>16&15]+w[U>>28&15]+w[U>>24&15];K%u===0&&(C(A),P=0)}return _&&(U=A[P],$+=w[U>>4&15]+w[U&15],_>1&&($+=w[U>>12&15]+w[U>>8&15]),_>2&&($+=w[U>>20&15]+w[U>>16&15])),$},o.prototype.arrayBuffer=function(){this.finalize();var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=this.outputBits>>3,U;_?U=new ArrayBuffer(S+1<<2):U=new ArrayBuffer($);for(var It=new Uint32Array(U);K<S;){for(P=0;P<u&&K<S;++P,++K)It[K]=A[P];K%u===0&&C(A)}return _&&(It[P]=A[P],U=U.slice(0,$)),U},o.prototype.buffer=o.prototype.arrayBuffer,o.prototype.digest=o.prototype.array=function(){this.finalize();for(var u=this.blockCount,A=this.s,S=this.outputBlocks,_=this.extraBytes,P=0,K=0,$=[],U,It;K<S;){for(P=0;P<u&&K<S;++P,++K)U=K<<2,It=A[P],$[U]=It&255,$[U+1]=It>>8&255,$[U+2]=It>>16&255,$[U+3]=It>>24&255;K%u===0&&C(A)}return _&&(U=K<<2,It=A[P],$[U]=It&255,_>1&&($[U+1]=It>>8&255),_>2&&($[U+2]=It>>16&255)),$};function g(u,A,S){o.call(this,u,A,S)}g.prototype=new o,g.prototype.finalize=function(){return this.encode(this.outputBits,!0),o.prototype.finalize.call(this)};var C=function(u){var A,S,_,P,K,$,U,It,G,J,Gt,ct,rt,qt,dt,it,Kt,gt,tt,Lt,pt,nt,$t,mt,k,T,R,D,j,H,W,Bt,et,X,Ft,Q,ot,Ht,vt,ft,Wt,xt,st,Jt,yt,at,Vt,bt,ht,jt,Mt,ut,Xt,Nt,lt,Zt,wt,Et,Qt,Yt,te,ee,re;for(_=0;_<48;_+=2)P=u[0]^u[10]^u[20]^u[30]^u[40],K=u[1]^u[11]^u[21]^u[31]^u[41],$=u[2]^u[12]^u[22]^u[32]^u[42],U=u[3]^u[13]^u[23]^u[33]^u[43],It=u[4]^u[14]^u[24]^u[34]^u[44],G=u[5]^u[15]^u[25]^u[35]^u[45],J=u[6]^u[16]^u[26]^u[36]^u[46],Gt=u[7]^u[17]^u[27]^u[37]^u[47],ct=u[8]^u[18]^u[28]^u[38]^u[48],rt=u[9]^u[19]^u[29]^u[39]^u[49],A=ct^($<<1|U>>>31),S=rt^(U<<1|$>>>31),u[0]^=A,u[1]^=S,u[10]^=A,u[11]^=S,u[20]^=A,u[21]^=S,u[30]^=A,u[31]^=S,u[40]^=A,u[41]^=S,A=P^(It<<1|G>>>31),S=K^(G<<1|It>>>31),u[2]^=A,u[3]^=S,u[12]^=A,u[13]^=S,u[22]^=A,u[23]^=S,u[32]^=A,u[33]^=S,u[42]^=A,u[43]^=S,A=$^(J<<1|Gt>>>31),S=U^(Gt<<1|J>>>31),u[4]^=A,u[5]^=S,u[14]^=A,u[15]^=S,u[24]^=A,u[25]^=S,u[34]^=A,u[35]^=S,u[44]^=A,u[45]^=S,A=It^(ct<<1|rt>>>31),S=G^(rt<<1|ct>>>31),u[6]^=A,u[7]^=S,u[16]^=A,u[17]^=S,u[26]^=A,u[27]^=S,u[36]^=A,u[37]^=S,u[46]^=A,u[47]^=S,A=J^(P<<1|K>>>31),S=Gt^(K<<1|P>>>31),u[8]^=A,u[9]^=S,u[18]^=A,u[19]^=S,u[28]^=A,u[29]^=S,u[38]^=A,u[39]^=S,u[48]^=A,u[49]^=S,qt=u[0],dt=u[1],at=u[11]<<4|u[10]>>>28,Vt=u[10]<<4|u[11]>>>28,D=u[20]<<3|u[21]>>>29,j=u[21]<<3|u[20]>>>29,Yt=u[31]<<9|u[30]>>>23,te=u[30]<<9|u[31]>>>23,xt=u[40]<<18|u[41]>>>14,st=u[41]<<18|u[40]>>>14,X=u[2]<<1|u[3]>>>31,Ft=u[3]<<1|u[2]>>>31,it=u[13]<<12|u[12]>>>20,Kt=u[12]<<12|u[13]>>>20,bt=u[22]<<10|u[23]>>>22,ht=u[23]<<10|u[22]>>>22,H=u[33]<<13|u[32]>>>19,W=u[32]<<13|u[33]>>>19,ee=u[42]<<2|u[43]>>>30,re=u[43]<<2|u[42]>>>30,Nt=u[5]<<30|u[4]>>>2,lt=u[4]<<30|u[5]>>>2,Q=u[14]<<6|u[15]>>>26,ot=u[15]<<6|u[14]>>>26,gt=u[25]<<11|u[24]>>>21,tt=u[24]<<11|u[25]>>>21,jt=u[34]<<15|u[35]>>>17,Mt=u[35]<<15|u[34]>>>17,Bt=u[45]<<29|u[44]>>>3,et=u[44]<<29|u[45]>>>3,mt=u[6]<<28|u[7]>>>4,k=u[7]<<28|u[6]>>>4,Zt=u[17]<<23|u[16]>>>
129,wt=u[16]<<23|u[17]>>>9,Ht=u[26]<<25|u[27]>>>7,vt=u[27]<<25|u[26]>>>7,Lt=u[36]<<21|u[37]>>>11,pt=u[37]<<21|u[36]>>>11,ut=u[47]<<24|u[46]>>>8,Xt=u[46]<<24|u[47]>>>8,Jt=u[8]<<27|u[9]>>>5,yt=u[9]<<27|u[8]>>>5,T=u[18]<<20|u[19]>>>12,R=u[19]<<20|u[18]>>>12,Et=u[29]<<7|u[28]>>>25,Qt=u[28]<<7|u[29]>>>25,ft=u[38]<<8|u[39]>>>24,Wt=u[39]<<8|u[38]>>>24,nt=u[48]<<14|u[49]>>>18,$t=u[49]<<14|u[48]>>>18,u[0]=qt^~it&gt,u[1]=dt^~Kt&tt,u[10]=mt^~T&D,u[11]=k^~R&j,u[20]=X^~Q&Ht,u[21]=Ft^~ot&vt,u[30]=Jt^~at&bt,u[31]=yt^~Vt&ht,u[40]=Nt^~Zt&Et,u[41]=lt^~wt&Qt,u[2]=it^~gt&Lt,u[3]=Kt^~tt&pt,u[12]=T^~D&H,u[13]=R^~j&W,u[22]=Q^~Ht&ft,u[23]=ot^~vt&Wt,u[32]=at^~bt&jt,u[33]=Vt^~ht&Mt,u[42]=Zt^~Et&Yt,u[43]=wt^~Qt&te,u[4]=gt^~Lt&nt,u[5]=tt^~pt&$t,u[14]=D^~H&Bt,u[15]=j^~W&et,u[24]=Ht^~ft&xt,u[25]=vt^~Wt&st,u[34]=bt^~jt&ut,u[35]=ht^~Mt&Xt,u[44]=Et^~Yt&ee,u[45]=Qt^~te&re,u[6]=Lt^~nt&qt,u[7]=pt^~$t&dt,u[16]=H^~Bt&mt,u[17]=W^~et&k,u[26]=ft^~xt&X,u[27]=Wt^~st&Ft,u[36]=jt^~ut&Jt,u[37]=Mt^~Xt&yt,u[46]=Yt^~ee&Nt,u[47]=te^~re&lt,u[8]=nt^~qt&it,u[9]=$t^~dt&Kt,u[18]=Bt^~mt&T,u[19]=et^~k&R,u[28]=xt^~X&Q,u[29]=st^~Ft&ot,u[38]=ut^~Jt&at,u[39]=Xt^~yt&Vt,u[48]=ee^~Nt&Zt,u[49]=re^~lt&wt,u[0]^=L[_],u[1]^=L[_+1]};if(y)r.exports=i;else for(h=0;h<s.length;++h)a[s[h]]=i[s[h]]})()})(Z3);var Z9=Z3.exports;const Q9=Nr(Z9);function ri(r){return"0x"+Q9.keccak_256(ve(r))}const Y9="strings/5.7.0",Q3=new Ot(Y9);var Ua;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(Ua||(Ua={}));var Ki;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(Ki||(Ki={}));function tI(r,t,e,n,a){return Q3.throwArgumentError(`invalid codepoint at offset ${t}; ${r}`,"bytes",e)}function Y3(r,t,e,n,a){if(r===Ki.BAD_PREFIX||r===Ki.UNEXPECTED_CONTINUE){let f=0;for(let c=t+1;c<e.length&&e[c]>>6===2;c++)f++;return f}return r===Ki.OVERRUN?e.length-t-1:0}function eI(r,t,e,n,a){return r===Ki.OVERLONG?(n.push(a),0):(n.push(65533),Y3(r,t,e))}const rI=Object.freeze({error:tI,ignore:Y3,replace:eI});function t6(r,t){t==null&&(t=rI.error),r=ve(r);const e=[];let n=0;for(;n<r.length;){const a=r[n++];if(!(a>>7)){e.push(a);continue}let f=null,c=null;if((a&224)===192)f=1,c=127;else if((a&240)===224)f=2,c=2047;else if((a&248)===240)f=3,c=65535;else{(a&192)===128?n+=t(Ki.UNEXPECTED_CONTINUE,n-1,r,e):n+=t(Ki.BAD_PREFIX,n-1,r,e);continue}if(n-1+f>=r.length){n+=t(Ki.OVERRUN,n-1,r,e);continue}let y=a&(1<<8-f-1)-1;for(let b=0;b<f;b++){let w=r[n];if((w&192)!=128){n+=t(Ki.MISSING_CONTINUE,n,r,e),y=null;break}y=y<<6|w&63,n++}if(y!==null){if(y>1114111){n+=t(Ki.OUT_OF_RANGE,n-1-f,r,e,y);continue}if(y>=55296&&y<=57343){n+=t(Ki.UTF16_SURROGATE,n-1-f,r,e,y);continue}if(y<=c){n+=t(Ki.OVERLONG,n-1-f,r,e,y);continue}e.push(y)}}return e}function ts(r,t=Ua.current){t!=Ua.current&&(Q3.checkNormalize(),r=r.normalize(t));let e=[];for(let n=0;n<r.length;n++){const a=r.charCodeAt(n);if(a<128)e.push(a);else if(a<2048)e.push(a>>6|192),e.push(a&63|128);else if((a&64512)==55296){n++;const f=r.charCodeAt(n);if(n>=r.length||(f&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((a&1023)<<10)+(f&1023);e.push(c>>18|240),e.push(c>>12&63|128),e.push(c>>6&63|128),e.push(c&63|128)}else e.push(a>>12|224),e.push(a>>6&63|128),e.push(a&63|128)}return ve(e)}function iI(r){return r.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function Rl(r,t){return iI(t6(r,t))}function nI(r,t=Ua.current){return t6(ts(r,t))}function e6(r){return ri(ts(r))}const r6="hash/5.7.0";function i6(r){r=atob(r);const t=[];for(let e=0;e<r.length;e++)t.push(r.charCodeAt(e));return ve(t)}function oI(r){r=ve(r);let t="";for(let e=0;e<r.length;e++)t+=String.fromCharCode(r[e]);return btoa(t)}function n6(r,t){t==null&&(t=1);const e=[],n=e.forEach,a=function(f,c){n.call(f,function(y){c>0&&Array.isArray(y)?a(y,c-1):e.push(y)})};return a(r,t),e}function fI(r){const t={};for(let e=0;e<r.length;e++){const n=r[e];t[n[0]]=n[1]}return t}function sI(r){let t=0;function e(){return r[t++]<<8|r[t++]}let n=e(),a=1,f=[0,1];for(let Z=1;Z<n;Z++)f.push(a+=e());let c=e(),y=t;t+=c;let b=0,w=0;function E(){return b==0&&(w=w<<8|r[t++],b=8),w>>--b&1}const M=31,O=Math.pow(2,M),F=O>>>1,B=F>>1,L=O-1;let z=0;for(let Z=0;Z<M;Z++)z=z<<1|E();
12let q=[],V=0,At=O;for(;;){let Z=Math.floor(((z-V+1)*a-1)/At),Y=0,Ct=n;for(;Ct-Y>1;){let Dt=Y+Ct>>>1;Z<f[Dt]?Ct=Dt:Y=Dt}if(Y==0)break;q.push(Y);let Tt=V+Math.floor(At*f[Y]/a),Rt=V+Math.floor(At*f[Y+1]/a)-1;for(;!((Tt^Rt)&F);)z=z<<1&L|E(),Tt=Tt<<1&L,Rt=Rt<<1&L|1;for(;Tt&~Rt&B;)z=z&F|z<<1&L>>>1|E(),Tt=Tt<<1^F,Rt=(Rt^F)<<1|F|1;V=Tt,At=1+Rt-Tt}let St=n-4;return q.map(Z=>{switch(Z-St){case 3:return St+65792+(r[y++]<<16|r[y++]<<8|r[y++]);case 2:return St+256+(r[y++]<<8|r[y++]);case 1:return St+r[y++];default:return Z-1}})}function aI(r){let t=0;return()=>r[t++]}function hI(r){return aI(sI(r))}function uI(r){return r&1?~r>>1:r>>1}function lI(r,t){let e=Array(r);for(let n=0;n<r;n++)e[n]=1+t();return e}function u2(r,t){let e=Array(r);for(let n=0,a=-1;n<r;n++)e[n]=a+=1+t();return e}function cI(r,t){let e=Array(r);for(let n=0,a=0;n<r;n++)e[n]=a+=uI(t());return e}function zu(r,t){let e=u2(r(),r),n=r(),a=u2(n,r),f=lI(n,r);for(let c=0;c<n;c++)for(let y=0;y<f[c];y++)e.push(a[c]+y);return t?e.map(c=>t[c]):e}function dI(r){let t=[];for(;;){let e=r();if(e==0)break;t.push(gI(e,r))}for(;;){let e=r()-1;if(e<0)break;t.push(mI(e,r))}return fI(n6(t))}function pI(r){let t=[];for(;;){let e=r();if(e==0)break;t.push(e)}return t}function o6(r,t,e){let n=Array(r).fill(void 0).map(()=>[]);for(let a=0;a<t;a++)cI(r,e).forEach((f,c)=>n[c].push(f));return n}function gI(r,t){let e=1+t(),n=t(),a=pI(t),f=o6(a.length,1+r,t);return n6(f.map((c,y)=>{const b=c[0],w=c.slice(1);return Array(a[y]).fill(void 0).map((E,M)=>{let O=M*n;return[b+M*e,w.map(F=>F+O)]})}))}function mI(r,t){let e=1+t();return o6(e,1+r,t).map(a=>[a[0],a.slice(1)])}function vI(r){let t=zu(r).sort((n,a)=>n-a);return e();function e(){let n=[];for(;;){let w=zu(r,t);if(w.length==0)break;n.push({set:new Set(w),node:e()})}n.sort((w,E)=>E.set.size-w.set.size);let a=r(),f=a%3;a=a/3|0;let c=!!(a&1);a>>=1;let y=a==1,b=a==2;return{branches:n,valid:f,fe0f:c,save:y,check:b}}}function xI(){return hI(i6("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKL
12QAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl
12+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Tl=xI(),yI=new Set(zu(Tl)),bI=new Set(zu(Tl)),wI=dI(Tl),EI=vI(Tl),l2=45,c2=95;function f6(r){return nI(r)}function AI(r){return r.filter(t=>t!=65039)}function s6(r){for(let t of r.split(".")){let e=f6(t);try{for(let n=e.lastIndexOf(c2)-1;n>=0;n--)if(e[n]!==c2)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every(n=>n<128)&&e[2]===l2&&e[3]===l2)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${t}": ${n.message}`)}}return r}function MI(r){return s6(NI(r,AI))}function NI(r,t){let e=f6(r).reverse(),n=[];for(;e.length;){let a=SI(e);if(a){n.push(...t(a));continue}let f=e.pop();if(yI.has(f)){n.push(f);continue}if(bI.has(f))continue;let c=wI[f];if(c){n.push(...c);continue}throw new Error(`Disallowed codepoint: 0x${f.toString(16).toUpperCase()}`)}return s6(_I(String.fromCodePoint(...n)))}function _I(r){return r.normalize("NFC")}function SI(r,t){var e;let n=EI,a,f,c=[],y=r.length;for(;y;){let b=r[--y];if(n=(e=n.branches.find(w=>w.set.has(b)))===null||e===void 0?void 0:e.node,!n)break;if(n.save)f=b;else if(n.check&&b===f)break;
12c.push(b),n.fe0f&&(c.push(65039),y>0&&r[y-1]==65039&&y--),n.valid&&(a=c.slice(),n.valid==2&&a.splice(1,1),r.length=y)}return a}const II=new Ot(r6),a6=new Uint8Array(32);a6.fill(0);function d2(r){if(r.length===0)throw new Error("invalid ENS name; empty component");return r}function RI(r){const t=ts(MI(r)),e=[];if(r.length===0)return e;let n=0;for(let a=0;a<t.length;a++)t[a]===46&&(e.push(d2(t.slice(n,a))),n=a+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return e.push(d2(t.slice(n))),e}function qu(r){typeof r!="string"&&II.throwArgumentError("invalid ENS name; not a string","name",r);let t=a6;const e=RI(r);for(;e.length;)t=ri(Gs([t,ri(e.pop())]));return ge(t)}const TI="rlp/5.7.0",Po=new Ot(TI);function p2(r){const t=[];for(;r;)t.unshift(r&255),r>>=8;return t}function g2(r,t,e){let n=0;for(let a=0;a<e;a++)n=n*256+r[t+a];return n}function h6(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(f){n=n.concat(h6(f))}),n.length<=55)return n.unshift(192+n.length),n;const a=p2(n.length);return a.unshift(247+a.length),a.concat(n)}H1(r)||Po.throwArgumentError("RLP object must be BytesLike","object",r);const t=Array.prototype.slice.call(ve(r));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const e=p2(t.length);return e.unshift(183+e.length),e.concat(t)}function Pl(r){return ge(h6(r))}function m2(r,t,e,n){const a=[];for(;e<t+1+n;){const f=u6(r,e);a.push(f.result),e+=f.consumed,e>t+1+n&&Po.throwError("child data too short",Ot.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function u6(r,t){if(r.length===0&&Po.throwError("data too short",Ot.errors.BUFFER_OVERRUN,{}),r[t]>=248){const e=r[t]-247;t+1+e>r.length&&Po.throwError("data short segment too short",Ot.errors.BUFFER_OVERRUN,{});const n=g2(r,t+1,e);return t+1+e+n>r.length&&Po.throwError("data long segment too short",Ot.errors.BUFFER_OVERRUN,{}),m2(r,t,t+1+e,e+n)}else if(r[t]>=192){const e=r[t]-192;return t+1+e>r.length&&Po.throwError("data array too short",Ot.errors.BUFFER_OVERRUN,{}),m2(r,t,t+1,e)}else if(r[t]>=184){const e=r[t]-183;t+1+e>r.length&&Po.throwError("data array too short",Ot.errors.BUFFER_OVERRUN,{});const n=g2(r,t+1,e);t+1+e+n>r.length&&Po.throwError("data array too short",Ot.errors.BUFFER_OVERRUN,{});const a=ge(r.slice(t+1+e,t+1+e+n));return{consumed:1+e+n,result:a}}else if(r[t]>=128){const e=r[t]-128;t+1+e>r.length&&Po.throwError("data too short",Ot.errors.BUFFER_OVERRUN,{});const n=ge(r.slice(t+1,t+1+e));return{consumed:1+e,result:n}}return{consumed:1,result:ge(r[t])}}function J1(r){const t=ve(r),e=u6(t,0);return e.consumed!==t.length&&Po.throwArgumentError("invalid rlp data","data",r),e.result}const PI="address/5.7.0",zs=new Ot(PI);function v2(r){rr(r,20)||zs.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let a=0;a<40;a++)e[a]=t[a].charCodeAt(0);const n=ve(ri(e));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}const CI=9007199254740991;function OI(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const V1={};for(let r=0;r<10;r++)V1[String(r)]=String(r);for(let r=0;r<26;r++)V1[String.fromCharCode(65+r)]=String(10+r);const x2=Math.floor(OI(CI));function kI(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>V1[n]).join("");for(;t.length>=x2;){let n=t.substring(0,x2);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function Eo(r){let t=null;if(typeof r!="string"&&zs.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=v2(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&zs.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==kI(r)&&zs.throwArgumentError("bad icap checksum","address",r),t=k9(r.substring(4));t.length<40;)t="0"+t;t=v2("0x"+t)}else zs.throwArgumentError("invalid address","address",r);return t}function BI(r){let t=null;try{t=Eo(r.from)}catch{zs.throwArgumentError("missing from address","transaction",r)}const e=l0(ve(fe.from(r.nonce).toHexString()));return Eo(Df(ri(Pl([t,e])),12))}var UI=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const ar=new Ot(r6),l6=new Uint8Array(32);l6.fill(0);const FI=fe.from(-1),c6=fe.from(0),d6=fe.from(1),DI=fe.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function LI(r){const t=ve(r),e=t.length%32;return e?ls([t,l6.slice(e)]):ge(t)}
12const $I=ii(d6.toHexString(),32),GI=ii(c6.toHexString(),32),y2={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},id=["name","version","chainId","verifyingContract","salt"];function b2(r){return function(t){return typeof t!="string"&&ar.throwArgumentError(`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,t),t}}const zI={name:b2("name"),version:b2("version"),chainId:function(r){try{return fe.from(r).toString()}catch{}return ar.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",r)},verifyingContract:function(r){try{return Eo(r).toLowerCase()}catch{}return ar.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){try{const t=ve(r);if(t.length!==32)throw new Error("bad length");return ge(t)}catch{}return ar.throwArgumentError('invalid domain value "salt"',"domain.salt",r)}};function nd(r){{const t=r.match(/^(u?)int(\d*)$/);if(t){const e=t[1]==="",n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&ar.throwArgumentError("invalid numeric width","type",r);const a=DI.mask(e?n-1:n),f=e?a.add(d6).mul(FI):c6;return function(c){const y=fe.from(c);return(y.lt(f)||y.gt(a))&&ar.throwArgumentError(`value out-of-bounds for ${r}`,"value",c),ii(y.toTwos(256).toHexString(),32)}}}{const t=r.match(/^bytes(\d+)$/);if(t){const e=parseInt(t[1]);return(e===0||e>32||t[1]!==String(e))&&ar.throwArgumentError("invalid bytes width","type",r),function(n){return ve(n).length!==e&&ar.throwArgumentError(`invalid length for ${r}`,"value",n),LI(n)}}}switch(r){case"address":return function(t){return ii(Eo(t),32)};case"bool":return function(t){return t?$I:GI};case"bytes":return function(t){return ri(t)};case"string":return function(t){return e6(t)}}return null}function w2(r,t){return`${r}(${t.map(({name:e,type:n})=>n+" "+e).join(",")})`}class Di{constructor(t){se(this,"types",Object.freeze(Ba(t))),se(this,"_encoderCache",{}),se(this,"_types",{});const e={},n={},a={};Object.keys(t).forEach(y=>{e[y]={},n[y]=[],a[y]={}});for(const y in t){const b={};t[y].forEach(w=>{b[w.name]&&ar.throwArgumentError(`duplicate variable name ${JSON.stringify(w.name)} in ${JSON.stringify(y)}`,"types",t),b[w.name]=!0;const E=w.type.match(/^([^\x5b]*)(\x5b|$)/)[1];E===y&&ar.throwArgumentError(`circular type reference to ${JSON.stringify(E)}`,"types",t),!nd(E)&&(n[E]||ar.throwArgumentError(`unknown type ${JSON.stringify(E)}`,"types",t),n[E].push(y),e[y][E]=!0)})}const f=Object.keys(n).filter(y=>n[y].length===0);f.length===0?ar.throwArgumentError("missing primary type","types",t):f.length>1&&ar.throwArgumentError(`ambiguous primary types or unused types: ${f.map(y=>
12JSON.stringify(y)).join(", ")}`,"types",t),se(this,"primaryType",f[0]);function c(y,b){b[y]&&ar.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",t),b[y]=!0,Object.keys(e[y]).forEach(w=>{n[w]&&(c(w,b),Object.keys(b).forEach(E=>{a[E][w]=!0}))}),delete b[y]}c(this.primaryType,{});for(const y in a){const b=Object.keys(a[y]);b.sort(),this._types[y]=w2(y,t[y])+b.map(w=>w2(w,t[w])).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const a=nd(t);if(a)return a}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const a=e[1],f=this.getEncoder(a),c=parseInt(e[3]);return y=>{c>=0&&y.length!==c&&ar.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",y);let b=y.map(f);return this._types[a]&&(b=b.map(ri)),ri(ls(b))}}const n=this.types[t];if(n){const a=e6(this._types[t]);return f=>{const c=n.map(({name:y,type:b})=>{const w=this.getEncoder(b)(f[y]);return this._types[b]?ri(w):w});return c.unshift(a),ls(c)}}return ar.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||ar.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return ri(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,n){if(nd(t))return n(t,e);const a=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(a){const c=a[1],y=parseInt(a[3]);return y>=0&&e.length!==y&&ar.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map(b=>this._visit(c,b,n))}const f=this.types[t];return f?f.reduce((c,{name:y,type:b})=>(c[y]=this._visit(b,e[y],n),c),{}):ar.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Di(t)}static getPrimaryType(t){return Di.from(t).primaryType}static hashStruct(t,e,n){return Di.from(e).hashStruct(t,n)}static hashDomain(t){const e=[];for(const n in t){const a=y2[n];a||ar.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),e.push({name:n,type:a})}return e.sort((n,a)=>id.indexOf(n.name)-id.indexOf(a.name)),Di.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,n){return ls(["0x1901",Di.hashDomain(t),Di.from(e).hash(n)])}static hash(t,e,n){return ri(Di.encode(t,e,n))}static resolveNames(t,e,n,a){return UI(this,void 0,void 0,function*(){t=wn(t);const f={};t.verifyingContract&&!rr(t.verifyingContract,20)&&(f[t.verifyingContract]="0x");const c=Di.from(e);c.visit(n,(y,b)=>(y==="address"&&!rr(b,20)&&(f[b]="0x"),b));for(const y in f)f[y]=yield a(y);return t.verifyingContract&&f[t.verifyingContract]&&(t.verifyingContract=f[t.verifyingContract]),n=c.visit(n,(y,b)=>y==="address"&&f[b]?f[b]:b),{domain:t,value:n}})}static getPayload(t,e,n){Di.hashDomain(t);const a={},f=[];id.forEach(b=>{const w=t[b];w!=null&&(a[b]=zI[b](w),f.push({name:b,type:y2[b]}))});const c=Di.from(e),y=wn(e);return y.EIP712Domain?ar.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):y.EIP712Domain=f,c.encode(n),{types:y,domain:a,primaryType:c.primaryType,message:c.visit(n,(b,w)=>{if(b.match(/^bytes(\d*)/))return ge(ve(w));if(b.match(/^u?int/))return fe.from(w).toString();switch(b){case"address":return w.toLowerCase();case"bool":return!!w;case"string":return typeof w!="string"&&ar.throwArgumentError("invalid string","value",w),w}return ar.throwArgumentError("unsupported type","type",b)})}}}function E2(r){return"0x"+oe.sha256().update(ve(r)).digest("hex")}const qI="web/5.7.1";var KI=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};function HI(r,t){return KI(this,void 0,void 0,function*(){t==null&&(t={});const e={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(t.skipFetchSetup!==!0&&(e.mode="cors",e.cache="no-cache",e.credentials="same-origin",e.redirect="follow",e.referrer="client"),t.fetchOptions!=null){const c=t.fetchOptions;c.mode&&(e.mode=c.mode),c.cache&&(e.cache=c.cache),c.credentials&&(e.credentials=c.credentials),c.redirect&&(e.redirect=c.redirect),c.referrer&&(e.referrer=c.referrer)}const n=yield fetch(r,e),a=yield n.arrayBuffer(),f={};
12return n.headers.forEach?n.headers.forEach((c,y)=>{f[y.toLowerCase()]=c}):n.headers.keys().forEach(c=>{f[c.toLowerCase()]=n.headers.get(c)}),{headers:f,statusCode:n.status,statusMessage:n.statusText,body:ve(new Uint8Array(a))}})}var WI=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Wn=new Ot(qI);function A2(r){return new Promise(t=>{setTimeout(t,r)})}function Mf(r,t){if(r==null)return null;if(typeof r=="string")return r;if(H1(r)){if(t&&(t.split("/")[0]==="text"||t.split(";")[0].trim()==="application/json"))try{return Rl(r)}catch{}return ge(r)}return r}function JI(r){return ts(r.replace(/%([0-9a-f][0-9a-f])/gi,(t,e)=>String.fromCharCode(parseInt(e,16))))}function VI(r,t,e){const n=typeof r=="object"&&r.throttleLimit!=null?r.throttleLimit:12;Wn.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const a=typeof r=="object"?r.throttleCallback:null,f=typeof r=="object"&&typeof r.throttleSlotInterval=="number"?r.throttleSlotInterval:100;Wn.assertArgument(f>0&&f%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",f);const c=typeof r=="object"?!!r.errorPassThrough:!1,y={};let b=null;const w={method:"GET"};let E=!1,M=2*60*1e3;if(typeof r=="string")b=r;else if(typeof r=="object"){if((r==null||r.url==null)&&Wn.throwArgumentError("missing URL","connection.url",r),b=r.url,typeof r.timeout=="number"&&r.timeout>0&&(M=r.timeout),r.headers)for(const q in r.headers)y[q.toLowerCase()]={key:q,value:String(r.headers[q])},["if-none-match","if-modified-since"].indexOf(q.toLowerCase())>=0&&(E=!0);if(w.allowGzip=!!r.allowGzip,r.user!=null&&r.password!=null){b.substring(0,6)!=="https:"&&r.allowInsecureAuthentication!==!0&&Wn.throwError("basic authentication requires a secure https url",Ot.errors.INVALID_ARGUMENT,{argument:"url",url:b,user:r.user,password:"[REDACTED]"});const q=r.user+":"+r.password;y.authorization={key:"Authorization",value:"Basic "+oI(ts(q))}}r.skipFetchSetup!=null&&(w.skipFetchSetup=!!r.skipFetchSetup),r.fetchOptions!=null&&(w.fetchOptions=wn(r.fetchOptions))}const O=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),F=b?b.match(O):null;if(F)try{const q={statusCode:200,statusMessage:"OK",headers:{"content-type":F[1]||"text/plain"},body:F[2]?i6(F[3]):JI(F[3])};let V=q.body;return e&&(V=e(q.body,q)),Promise.resolve(V)}catch(q){Wn.throwError("processing response error",Ot.errors.SERVER_ERROR,{body:Mf(F[1],F[2]),error:q,requestBody:null,requestMethod:"GET",url:b})}t&&(w.method="POST",w.body=t,y["content-type"]==null&&(y["content-type"]={key:"Content-Type",value:"application/octet-stream"}),y["content-length"]==null&&(y["content-length"]={key:"Content-Length",value:String(t.length)}));const B={};Object.keys(y).forEach(q=>{const V=y[q];B[V.key]=V.value}),w.headers=B;const L=function(){let q=null;return{promise:new Promise(function(St,Z){M&&(q=setTimeout(()=>{q!=null&&(q=null,Z(Wn.makeError("timeout",Ot.errors.TIMEOUT,{requestBody:Mf(w.body,B["content-type"]),requestMethod:w.method,timeout:M,url:b})))},M))}),cancel:function(){q!=null&&(clearTimeout(q),q=null)}}}(),z=function(){return WI(this,void 0,void 0,function*(){for(let q=0;q<n;q++){let V=null;try{if(V=yield HI(b,w),q<n){if(V.statusCode===301||V.statusCode===302){const St=V.headers.location||"";if(w.method==="GET"&&St.match(/^https:/)){b=V.headers.location;continue}}else if(V.statusCode===429){let St=!0;if(a&&(St=yield a(q,b)),St){let Z=0;const Y=V.headers["retry-after"];typeof Y=="string"&&Y.match(/^[1-9][0-9]*$/)?Z=parseInt(Y)*1e3:Z=f*parseInt(String(Math.random()*Math.pow(2,q))),yield A2(Z);continue}}}}catch(St){V=St.response,V==null&&(L.cancel(),Wn.throwError("missing response",Ot.errors.SERVER_ERROR,{requestBody:Mf(w.body,B["content-type"]),requestMethod:w.method,serverError:St,url:b}))}let At=V.body;if(E&&V.statusCode===304?At=null:!c&&(V.statusCode<200||V.statusCode>=300)&&(L.cancel(),Wn.throwError("bad response",Ot.errors.SERVER_ERROR,{status:V.statusCode,headers:V.headers,body:Mf(At,V.headers?V.headers["content-type"]:null),requestBody:Mf(w.body,B["content-type"]),requestMethod:w.method,url:b})),e)try{const St=yield e(At,V);return L.cancel(),St}catch(St){if(St.throttleRetry&&q<n){let Z=!0;
12if(a&&(Z=yield a(q,b)),Z){const Y=f*parseInt(String(Math.random()*Math.pow(2,q)));yield A2(Y);continue}}L.cancel(),Wn.throwError("processing response error",Ot.errors.SERVER_ERROR,{body:Mf(At,V.headers?V.headers["content-type"]:null),error:St,requestBody:Mf(w.body,B["content-type"]),requestMethod:w.method,url:b})}return L.cancel(),At}return Wn.throwError("failed response",Ot.errors.SERVER_ERROR,{requestBody:Mf(w.body,B["content-type"]),requestMethod:w.method,url:b})})}();return Promise.race([L.promise,z])}function jI(r,t,e){let n=(f,c)=>{let y=null;if(f!=null)try{y=JSON.parse(Rl(f))}catch(b){Wn.throwError("invalid JSON",Ot.errors.SERVER_ERROR,{body:f,error:b})}return e&&(y=e(y,c)),y},a=null;if(t!=null){a=ts(t);const f=typeof r=="string"?{url:r}:wn(r);f.headers?Object.keys(f.headers).filter(y=>y.toLowerCase()==="content-type").length!==0||(f.headers=wn(f.headers),f.headers["content-type"]="application/json"):f.headers={"content-type":"application/json"},r=f}return VI(r,a,n)}function J0(r,t){return t||(t={}),t=wn(t),t.floor==null&&(t.floor=0),t.ceiling==null&&(t.ceiling=1e4),t.interval==null&&(t.interval=250),new Promise(function(e,n){let a=null,f=!1;const c=()=>f?!1:(f=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout(()=>{c()&&n(new Error("timeout"))},t.timeout));const y=t.retryLimit;let b=0;function w(){return r().then(function(E){if(E!==void 0)c()&&e(E);else if(t.oncePoll)t.oncePoll.once("poll",w);else if(t.onceBlock)t.onceBlock.once("block",w);else if(!f){if(b++,b>y){c()&&n(new Error("retry limit reached"));return}let M=t.interval*parseInt(String(Math.random()*Math.pow(2,b)));M<t.floor&&(M=t.floor),M>t.ceiling&&(M=t.ceiling),setTimeout(w,M)}return null},function(E){c()&&n(E)})}w()})}const As="providers/5.4.0";function S0(r,t,e){return e={path:t,exports:{},require:function(n,a){return XI(n,a??e.path)}},r(e,e.exports),e.exports}function XI(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var j1=p6;function p6(r,t){if(!r)throw new Error(t||"Assertion failed")}p6.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)};var bo=S0(function(r,t){var e=t;function n(c,y){if(Array.isArray(c))return c.slice();if(!c)return[];var b=[];if(typeof c!="string"){for(var w=0;w<c.length;w++)b[w]=c[w]|0;return b}if(y==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var w=0;w<c.length;w+=2)b.push(parseInt(c[w]+c[w+1],16))}else for(var w=0;w<c.length;w++){var E=c.charCodeAt(w),M=E>>8,O=E&255;M?b.push(M,O):b.push(O)}return b}e.toArray=n;function a(c){return c.length===1?"0"+c:c}e.zero2=a;function f(c){for(var y="",b=0;b<c.length;b++)y+=a(c[b].toString(16));return y}e.toHex=f,e.encode=function(y,b){return b==="hex"?f(y):y}}),Zi=S0(function(r,t){var e=t;e.assert=j1,e.toArray=bo.toArray,e.zero2=bo.zero2,e.toHex=bo.toHex,e.encode=bo.encode;function n(b,w,E){var M=new Array(Math.max(b.bitLength(),E)+1);M.fill(0);for(var O=1<<w+1,F=b.clone(),B=0;B<M.length;B++){var L,z=F.andln(O-1);F.isOdd()?(z>(O>>1)-1?L=(O>>1)-z:L=z,F.isubn(L)):L=0,M[B]=L,F.iushrn(1)}return M}e.getNAF=n;function a(b,w){var E=[[],[]];b=b.clone(),w=w.clone();for(var M=0,O=0,F;b.cmpn(-M)>0||w.cmpn(-O)>0;){var B=b.andln(3)+M&3,L=w.andln(3)+O&3;B===3&&(B=-1),L===3&&(L=-1);var z;B&1?(F=b.andln(7)+M&7,(F===3||F===5)&&L===2?z=-B:z=B):z=0,E[0].push(z);var q;L&1?(F=w.andln(7)+O&7,(F===3||F===5)&&B===2?q=-L:q=L):q=0,E[1].push(q),2*M===z+1&&(M=1-M),2*O===q+1&&(O=1-O),b.iushrn(1),w.iushrn(1)}return E}e.getJSF=a;function f(b,w,E){var M="_"+w;b.prototype[w]=function(){return this[M]!==void 0?this[M]:this[M]=E.call(this)}}e.cachedProperty=f;function c(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=c;function y(b){return new ce(b,"hex","le")}e.intFromLE=y}),Ku=Zi.getNAF,ZI=Zi.getJSF,Hu=Zi.assert;function es(r,t){this.type=r,this.p=new ce(t.p,16),this.red=t.prime?ce.red(t.prime):ce.mont(this.p),this.zero=new ce(0).toRed(this.red),this.one=new ce(1).toRed(this.red),this.two=new ce(2).toRed(this.red),this.n=t.n&&new ce(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 e=this.n&&this.p.div(this.n);!e||e.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Ms=es;es.prototype.point=function(){throw new Error("Not implemented")};es.prototype.validate=function(){throw new Error("Not implemented")};es.prototype._fixedNafMul=function(t,e){Hu(t.precomputed);var n=t._getDoubles(),a=Ku(e,1,this._bitLength),f=(1<<n.step+1)-(n.step%2===0?2:1);f/=3;var c=[],y,b;for(y=0;y<a.length;y+=n.step){b=0;for(var w=y+n.step-1;w>=y;w--)b=(b<<1)+a[w];c.push(b)}for(var E=this.jpoint(null,null,null),M=this.jpoint(null,null,null),O=f;O>0;O--){for(y=0;y<c.length;y++)b=c[y],b===O?M=M.mixedAdd(n.points[y]):b===-O&&(M=M.mixedAdd(n.points[y].neg()));E=E.add(M)}return E.toP()};es.prototype._wnafMul=function(t,e){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var f=a.points,c=Ku(e,n,this._bitLength),y=this.jpoint(null,null,null),b=c.length-1;b>=0;b--){for(var w=0;b>=0&&c[b]===0;b--)w++;if(b>=0&&w++,y=y.dblp(w),b<0)break;var E=c[b];Hu(E!==0),t.type==="affine"?E>0?y=y.mixedAdd(f[E-1>>1]):y=y.mixedAdd(f[-E-1>>1].neg()):E>0?y=y.add(f[E-1>>1]):y=y.add(f[-E-1>>1].neg())}return t.type==="affine"?y.toP():y};es.prototype._wnafMulAdd=function(t,e,n,a,f){var c=this._wnafT1,y=this._wnafT2,b=this._wnafT3,w=0,E,M,O;for(E=0;E<a;E++){O=e[E];var F=O._getNAFPoints(t);c[E]=F.wnd,y[E]=F.points}for(E=a-1;E>=1;E-=2){var B=E-1,L=E;if(c[B]!==1||c[L]!==1){b[B]=Ku(n[B],c[B],this._bitLength),b[L]=Ku(n[L],c[L],this._bitLength),w=Math.max(b[B].length,w),w=Math.max(b[L].length,w);continue}var z=[e[B],null,null,e[L]];
12e[B].y.cmp(e[L].y)===0?(z[1]=e[B].add(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg())):e[B].y.cmp(e[L].y.redNeg())===0?(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].add(e[L].neg())):(z[1]=e[B].toJ().mixedAdd(e[L]),z[2]=e[B].toJ().mixedAdd(e[L].neg()));var q=[-3,-1,-5,-7,0,7,5,1,3],V=ZI(n[B],n[L]);for(w=Math.max(V[0].length,w),b[B]=new Array(w),b[L]=new Array(w),M=0;M<w;M++){var At=V[0][M]|0,St=V[1][M]|0;b[B][M]=q[(At+1)*3+(St+1)],b[L][M]=0,y[B]=z}}var Z=this.jpoint(null,null,null),Y=this._wnafT4;for(E=w;E>=0;E--){for(var Ct=0;E>=0;){var Tt=!0;for(M=0;M<a;M++)Y[M]=b[M][E]|0,Y[M]!==0&&(Tt=!1);if(!Tt)break;Ct++,E--}if(E>=0&&Ct++,Z=Z.dblp(Ct),E<0)break;for(M=0;M<a;M++){var Rt=Y[M];Rt!==0&&(Rt>0?O=y[M][Rt-1>>1]:Rt<0&&(O=y[M][-Rt-1>>1].neg()),O.type==="affine"?Z=Z.mixedAdd(O):Z=Z.add(O))}}for(E=0;E<a;E++)y[E]=null;return f?Z:Z.toP()};function Pn(r,t){this.curve=r,this.type=t,this.precomputed=null}es.BasePoint=Pn;Pn.prototype.eq=function(){throw new Error("Not implemented")};Pn.prototype.validate=function(){return this.curve.validate(this)};es.prototype.decodePoint=function(t,e){t=Zi.toArray(t,e);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?Hu(t[t.length-1]%2===0):t[0]===7&&Hu(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};Pn.prototype.encodeCompressed=function(t){return this.encode(t,!0)};Pn.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))};Pn.prototype.encode=function(t,e){return Zi.encode(this._encode(e),t)};Pn.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this};Pn.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1};Pn.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,f=0;f<e;f+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}};Pn.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),f=1;f<n;f++)e[f]=e[f-1].add(a);return{wnd:t,points:e}};Pn.prototype._getBeta=function(){return null};Pn.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e};var X1=S0(function(r){typeof Object.create=="function"?r.exports=function(e,n){
12n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,n){if(n){e.super_=n;var a=function(){};a.prototype=n.prototype,e.prototype=new a,e.prototype.constructor=e}}}),QI=Zi.assert;function Cn(r){Ms.call(this,"short",r),this.a=new ce(r.a,16).toRed(this.red),this.b=new ce(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}X1(Cn,Ms);var YI=Cn;Cn.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,n;if(t.beta)e=new ce(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);e=a[0].cmp(a[1])<0?a[0]:a[1],e=e.toRed(this.red)}if(t.lambda)n=new ce(t.lambda,16);else{var f=this._getEndoRoots(this.n);this.g.mul(f[0]).x.cmp(this.g.x.redMul(e))===0?n=f[0]:(n=f[1],QI(this.g.mul(n).x.cmp(this.g.x.redMul(e))===0))}var c;return t.basis?c=t.basis.map(function(y){return{a:new ce(y.a,16),b:new ce(y.b,16)}}):c=this._getEndoBasis(n),{beta:e,lambda:n,basis:c}}};Cn.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:ce.mont(t),n=new ce(2).toRed(e).redInvm(),a=n.redNeg(),f=new ce(3).toRed(e).redNeg().redSqrt().redMul(n),c=a.redAdd(f).fromRed(),y=a.redSub(f).fromRed();return[c,y]};Cn.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),f=new ce(1),c=new ce(0),y=new ce(0),b=new ce(1),w,E,M,O,F,B,L,z=0,q,V;n.cmpn(0)!==0;){var At=a.div(n);q=a.sub(At.mul(n)),V=y.sub(At.mul(f));var St=b.sub(At.mul(c));if(!M&&q.cmp(e)<0)w=L.neg(),E=f,M=q.neg(),O=V;else if(M&&++z===2)break;L=q,a=n,n=q,y=f,f=V,b=c,c=St}F=q.neg(),B=V;var Z=M.sqr().add(O.sqr()),Y=F.sqr().add(B.sqr());return Y.cmp(Z)>=0&&(F=w,B=E),M.negative&&(M=M.neg(),O=O.neg()),F.negative&&(F=F.neg(),B=B.neg()),[{a:M,b:O},{a:F,b:B}]};Cn.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],a=e[1],f=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),y=f.mul(n.a),b=c.mul(a.a),w=f.mul(n.b),E=c.mul(a.b),M=t.sub(y).sub(b),O=w.add(E).neg();return{k1:M,k2:O}};Cn.prototype.pointFromX=function(t,e){t=new ce(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var f=a.fromRed().isOdd();return(e&&!f||!e&&f)&&(a=a.redNeg()),this.point(t,a)};Cn.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,a=this.a.redMul(e),f=e.redSqr().redMul(e).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(f).cmpn(0)===0};Cn.prototype._endoWnafMulAdd=function(t,e,n){for(var a=this._endoWnafT1,f=this._endoWnafT2,c=0;c<t.length;c++){var y=this._endoSplit(e[c]),b=t[c],w=b._getBeta();y.k1.negative&&(y.k1.ineg(),b=b.neg(!0)),y.k2.negative&&(y.k2.ineg(),w=w.neg(!0)),a[c*2]=b,a[c*2+1]=w,f[c*2]=y.k1,f[c*2+1]=y.k2}for(var E=this._wnafMulAdd(1,a,f,c*2,n),M=0;M<c*2;M++)a[M]=null,f[M]=null;return E};function Qr(r,t,e,n){Ms.BasePoint.call(this,r,"affine"),t===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ce(t,16),this.y=new ce(e,16),n&&(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)}X1(Qr,Ms.BasePoint);Cn.prototype.point=function(t,e,n){return new Qr(this,t,e,n)};Cn.prototype.pointFromJSON=function(t,e){return Qr.fromJSON(this,t,e)};Qr.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,a=function(f){return n.point(f.x.redMul(n.endo.beta),f.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return e}};Qr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.prec
12omputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Qr.fromJSON=function(t,e,n){typeof e=="string"&&(e=JSON.parse(e));var a=t.point(e[0],e[1],n);if(!e[2])return a;function f(y){return t.point(y[0],y[1],n)}var c=e[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(f))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(f))}},a};Qr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Qr.prototype.isInfinity=function(){return this.inf};Qr.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),a=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)};Qr.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),a=t.redInvm(),f=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(a),c=f.redSqr().redISub(this.x.redAdd(this.x)),y=f.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,y)};Qr.prototype.getX=function(){return this.x.fromRed()};Qr.prototype.getY=function(){return this.y.fromRed()};Qr.prototype.mul=function(t){return t=new ce(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};Qr.prototype.mulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f):this.curve._wnafMulAdd(1,a,f,2)};Qr.prototype.jmulAdd=function(t,e,n){var a=[this,e],f=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,f,!0):this.curve._wnafMulAdd(1,a,f,2,!0)};Qr.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};Qr.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
12if(t&&this.precomputed){var n=this.precomputed,a=function(f){return f.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return e};Qr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function ai(r,t,e,n){Ms.BasePoint.call(this,r,"jacobian"),t===null&&e===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ce(0)):(this.x=new ce(t,16),this.y=new ce(e,16),this.z=new ce(n,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}X1(ai,Ms.BasePoint);Cn.prototype.jpoint=function(t,e,n){return new ai(this,t,e,n)};ai.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),a=this.y.redMul(e).redMul(t);return this.curve.point(n,a)};ai.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ai.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(e),f=t.x.redMul(n),c=this.y.redMul(e.redMul(t.z)),y=t.y.redMul(n.redMul(this.z)),b=a.redSub(f),w=c.redSub(y);if(b.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=b.redSqr(),M=E.redMul(b),O=a.redMul(E),F=w.redSqr().redIAdd(M).redISub(O).redISub(O),B=w.redMul(O.redISub(F)).redISub(c.redMul(M)),L=this.z.redMul(t.z).redMul(b);return this.curve.jpoint(F,B,L)};ai.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,a=t.x.redMul(e),f=this.y,c=t.y.redMul(e).redMul(this.z),y=n.redSub(a),b=f.redSub(c);if(y.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=y.redSqr(),E=w.redMul(y),M=n.redMul(w),O=b.redSqr().redIAdd(E).redISub(M).redISub(M),F=b.redMul(M.redISub(O)).redISub(f.redMul(E)),B=this.z.redMul(y);return this.curve.jpoint(O,F,B)};ai.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var n=this;for(e=0;e<t;e++)n=n.dbl();return n}var a=this.curve.a,f=this.curve.tinv,c=this.x,y=this.y,b=this.z,w=b.redSqr().redSqr(),E=y.redAdd(y);for(e=0;e<t;e++){var M=c.redSqr(),O=E.redSqr(),F=O.redSqr(),B=M.redAdd(M).redIAdd(M).redIAdd(a.redMul(w)),L=c.redMul(O),z=B.redSqr().redISub(L.redAdd(L)),q=L.redISub(z),V=B.redMul(q);V=V.redIAdd(V).redISub(F);var At=E.redMul(b);e+1<t&&(w=w.redMul(F)),c=z,b=At,E=V}return this.curve.jpoint(c,E.redMul(f),b)};ai.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};ai.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a),w=b.redSqr().redISub(y).redISub(y),E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),t=w,e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),O=this.y.redSqr(),F=O.redSqr(),B=this.x.redAdd(O).redSqr().redISub(M).redISub(F);B=B.redIAdd(B);var L=M.redAdd(M).redIAdd(M),z=L.redSqr(),q=F.redIAdd(F);q=q.redIAdd(q),q=q.redIAdd(q),t=z.redISub(B).redISub(B),e=L.redMul(B.redISub(t)).redISub(q),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,e,n)};ai.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var a=this.x.redSqr(),f=this.y.redSqr(),c=f.redSqr(),y=this.x.redAdd(f).redSqr().redISub(a).redISub(c);y=y.redIAdd(y);var b=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),w=b.redSqr().redISub(y).redISub(y);t=w;var E=c.redIAdd(c);E=E.redIAdd(E),E=E.redIAdd(E),e=b.redMul(y.redISub(w)).redISub(E),n=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),O=this.y.redSqr(),F=this.x.redMul(O),B=this.x.redSub(M).redMul(this.x.redAdd(M));B=B.redAdd(B).redIAdd(B);var L=F.redIAdd(F);L=L.redIAdd(L);var z=L.redAdd(L);t=B.redSqr().redISub(z),n=this.y.redAdd(this.z).redSqr().redISub(O).redISub(M);var q=O.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),e=B.redMul(L.redISub(t)).redISub(q)}return this.curve.jpoint(t,e,n)};ai.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,a=this.z,f=a.redSqr().redSqr(),c=e.redSqr(),y=n.redSqr(),b=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(f)),w=e.redAdd(e);w=w.redIAdd(w);var E=w.redMul(y),M=b.redSqr().redISub(E.redAdd(E)),O=E.redISub(M),F=y.redSqr();F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=b.redMul(O).redISub(F),L=n.redAdd(n).redMul(a);return this.curve.jpoint(M,B,L)};ai.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),a=e.redSqr(),f=t.redAdd(t).redIAdd(t),
12c=f.redSqr(),y=this.x.redAdd(e).redSqr().redISub(t).redISub(a);y=y.redIAdd(y),y=y.redAdd(y).redIAdd(y),y=y.redISub(c);var b=y.redSqr(),w=a.redIAdd(a);w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var E=f.redIAdd(y).redSqr().redISub(c).redISub(b).redISub(w),M=e.redMul(E);M=M.redIAdd(M),M=M.redIAdd(M);var O=this.x.redMul(b).redISub(M);O=O.redIAdd(O),O=O.redIAdd(O);var F=this.y.redMul(E.redMul(w.redISub(E)).redISub(y.redMul(b)));F=F.redIAdd(F),F=F.redIAdd(F),F=F.redIAdd(F);var B=this.z.redAdd(y).redSqr().redISub(n).redISub(b);return this.curve.jpoint(O,F,B)};ai.prototype.mul=function(t,e){return t=new ce(t,e),this.curve._wnafMul(this,t)};ai.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var a=e.redMul(this.z),f=n.redMul(t.z);return this.y.redMul(f).redISub(t.y.redMul(a)).cmpn(0)===0};ai.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(n)===0)return!0;for(var a=t.clone(),f=this.curve.redN.redMul(e);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(f),this.x.cmp(n)===0)return!0}};ai.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};ai.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var ru=S0(function(r,t){var e=t;e.base=Ms,e.short=YI,e.mont=null,e.edwards=null}),iu=S0(function(r,t){var e=t,n=Zi.assert;function a(y){y.type==="short"?this.curve=new ru.short(y):y.type==="edwards"?this.curve=new ru.edwards(y):this.curve=new ru.mont(y),this.g=this.curve.g,this.n=this.curve.n,this.hash=y.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function f(y,b){Object.defineProperty(e,y,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,y,{configurable:!0,enumerable:!0,value:w}),w}})}f("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:oe.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:oe.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:oe.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:oe.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"]}),f("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:oe.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:oe.sha256,gRed:!1,g:["9"]}),f("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:oe.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}f("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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
12,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function jf(r){if(!(this instanceof jf))return new jf(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=bo.toArray(r.entropy,r.entropyEnc||"hex"),e=bo.toArray(r.nonce,r.nonceEnc||"hex"),n=bo.toArray(r.pers,r.persEnc||"hex");j1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,e,n)}var g6=jf;jf.prototype._init=function(t,e,n){var a=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656};jf.prototype._hmac=function(){return new oe.hmac(this.hash,this.K)};jf.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())};jf.prototype.reseed=function(t,e,n,a){typeof e!="string"&&(a=n,n=e,e=null),t=bo.toArray(t,e),n=bo.toArray(n,a),j1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};jf.prototype.generate=function(t,e,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(a=n,n=e,e=null),n&&(n=bo.toArray(n,a||"hex"),this._update(n));for(var f=[];f.length<t;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var c=f.slice(0,t);return this._update(n),this._reseed++,bo.encode(c,e)};var hp=Zi.assert;function yi(r,t){this.ec=r,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Z1=yi;yi.fromPublic=function(t,e,n){return e instanceof yi?e:new yi(t,{pub:e,pubEnc:n})};yi.fromPrivate=function(t,e,n){return e instanceof yi?e:new yi(t,{priv:e,privEnc:n})};yi.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}};yi.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub};yi.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};yi.prototype._importPrivate=function(t,e){this.priv=new ce(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)};yi.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?hp(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&hp(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)};yi.prototype.derive=function(t){return t.validate()||hp(t.validate(),"public point not validated"),t.mul(this.priv).getX()};yi.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)};yi.prototype.verify=function(t,e){return this.ec.verify(t,e,this)};yi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var tR=Zi.assert;function Cl(r,t){if(r instanceof Cl)return r;this._importDER(r,t)||(tR(r.r&&r.s,"Signature without r or s"),this.r=new ce(r.r,16),this.s=new ce(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var Ol=Cl;function eR(){this.place=0}function od(r,t){var e=r[t.place++];if(!(e&128))return e;var n=e&15;if(n===0||n>4)return!1;for(var a=0,f=0,c=t.place;f<n;f++,c++)a<<=8,a|=r[c],a>>>=0;return a<=127?!1:(t.place=c,a)}function M2(r){for(var t=0,e=r.length-1;!r[t]&&!(r[t+1]&128)&&t<e;)t++;return t===0?r:r.slice(t)}Cl.prototype._importDER=function(t,e){t=Zi.toArray(t,e);var n=new eR;if(t[n.place++]!==48)return!1;var a=od(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var f=od(t,n);if(f===!1)return!1;var c=t.slice(n.place,f+n.place);if(n.place+=f,t[n.place++]!==2)return!1;var y=od(t,n);if(y===!1||t.length!==y+n.place)return!1;var b=t.slice(n.place,y+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new ce(c),this.s=new ce(b),this.recoveryParam=null,!0};function fd(r,t){if(t<128){r.push(t);return}var e=1+(Math.log(t)/Math.LN2>>>3);for(r.push(e|128);--e;)r.push(t>>>(e<<3)&255);r.push(t)}Cl.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();
12for(e[0]&128&&(e=[0].concat(e)),n[0]&128&&(n=[0].concat(n)),e=M2(e),n=M2(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];fd(a,e.length),a=a.concat(e),a.push(2),fd(a,n.length);var f=a.concat(n),c=[48];return fd(c,f.length),c=c.concat(f),Zi.encode(c,t)};var rR=function(){throw new Error("unsupported")},m6=Zi.assert;function En(r){if(!(this instanceof En))return new En(r);typeof r=="string"&&(m6(Object.prototype.hasOwnProperty.call(iu,r),"Unknown curve "+r),r=iu[r]),r instanceof iu.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var iR=En;En.prototype.keyPair=function(t){return new Z1(this,t)};En.prototype.keyFromPrivate=function(t,e){return Z1.fromPrivate(this,t,e)};En.prototype.keyFromPublic=function(t,e){return Z1.fromPublic(this,t,e)};En.prototype.genKeyPair=function(t){t||(t={});for(var e=new g6({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rR(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new ce(2));;){var f=new ce(e.generate(n));if(!(f.cmp(a)>0))return f.iaddn(1),this.keyFromPrivate(f)}};En.prototype._truncateToN=function(t,e){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t};En.prototype.sign=function(t,e,n,a){typeof n=="object"&&(a=n,n=null),a||(a={}),e=this.keyFromPrivate(e,n),t=this._truncateToN(new ce(t,16));for(var f=this.n.byteLength(),c=e.getPrivate().toArray("be",f),y=t.toArray("be",f),b=new g6({hash:this.hash,entropy:c,nonce:y,pers:a.pers,persEnc:a.persEnc||"utf8"}),w=this.n.sub(new ce(1)),E=0;;E++){var M=a.k?a.k(E):new ce(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(w)>=0)){var O=this.g.mul(M);if(!O.isInfinity()){var F=O.getX(),B=F.umod(this.n);if(B.cmpn(0)!==0){var L=M.invm(this.n).mul(B.mul(e.getPrivate()).iadd(t));if(L=L.umod(this.n),L.cmpn(0)!==0){var z=(O.getY().isOdd()?1:0)|(F.cmp(B)!==0?2:0);return a.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),z^=1),new Ol({r:B,s:L,recoveryParam:z})}}}}}};En.prototype.verify=function(t,e,n,a){t=this._truncateToN(new ce(t,16)),n=this.keyFromPublic(n,a),e=new Ol(e,"hex");var f=e.r,c=e.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var y=c.invm(this.n),b=y.mul(t).umod(this.n),w=y.mul(f).umod(this.n),E;return this.curve._maxwellTrick?(E=this.g.jmulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.eqXToP(f)):(E=this.g.mulAdd(b,n.getPublic(),w),E.isInfinity()?!1:E.getX().umod(this.n).cmp(f)===0)};En.prototype.recoverPubKey=function(r,t,e,n){m6((3&e)===e,"The recovery param is more than two bits"),t=new Ol(t,n);var a=this.n,f=new ce(r),c=t.r,y=t.s,b=e&1,w=e>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&w)throw new Error("Unable to find sencond key candinate");w?c=this.curve.pointFromX(c.add(this.curve.n),b):c=this.curve.pointFromX(c,b);var E=t.r.invm(a),M=a.sub(f).mul(E).umod(a),O=y.mul(E).umod(a);return this.g.mulAdd(M,c,O)};En.prototype.getKeyRecoveryParam=function(r,t,e,n){if(t=new Ol(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var f;try{f=this.recoverPubKey(r,t,a)}catch{continue}if(f.eq(e))return a}throw new Error("Unable to find valid recovery factor")};var nR=S0(function(r,t){var e=t;e.version="6.5.4",e.utils=Zi,e.rand=function(){throw new Error("unsupported")},e.curve=ru,e.curves=iu,e.ec=iR,e.eddsa=null}),oR=nR.ec;const fR="signing-key/5.7.0",up=new Ot(fR);let sd=null;function Rf(){return sd||(sd=new oR("secp256k1")),sd}class sR{constructor(t){se(this,"curve","secp256k1"),se(this,"privateKey",ge(t)),_0(this.privateKey)!==32&&up.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const e=Rf().keyFromPrivate(ve(this.privateKey));se(this,"publicKey","0x"+e.getPublic(!1,"hex")),se(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),se(this,"_isSigningKey",!0)}_addPoint(t){const e=Rf().keyFromPublic(ve(this.publicKey)),n=Rf().keyFromPublic(ve(t));return"0x"+e.pub.add(n.pub).encodeCompressed("hex")}
12signDigest(t){const e=Rf().keyFromPrivate(ve(this.privateKey)),n=ve(t);n.length!==32&&up.throwArgumentError("bad digest length","digest",t);const a=e.sign(n,{canonical:!0});return Il({recoveryParam:a.recoveryParam,r:ii("0x"+a.r.toString(16),32),s:ii("0x"+a.s.toString(16),32)})}computeSharedSecret(t){const e=Rf().keyFromPrivate(ve(this.privateKey)),n=Rf().keyFromPublic(ve(v6(t)));return ii("0x"+e.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function aR(r,t){const e=Il(t),n={r:ve(e.r),s:ve(e.s)};return"0x"+Rf().recoverPubKey(ve(r),n,e.recoveryParam).encode("hex",!1)}function v6(r,t){const e=ve(r);return e.length===32?new sR(e).publicKey:e.length===33?"0x"+Rf().keyFromPublic(e).getPublic(!1,"hex"):e.length===65?ge(e):up.throwArgumentError("invalid public or private key","key","[REDACTED]")}const hR="transactions/5.7.0",wf=new Ot(hR);var N2;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(N2||(N2={}));function Q1(r){return r==="0x"?null:Eo(r)}function li(r){return r==="0x"?j9:fe.from(r)}function uR(r){const t=v6(r);return Eo(Df(ri(Df(t,1)),12))}function x6(r,t){return uR(aR(ve(r),t))}function Hi(r,t){const e=l0(fe.from(r).toHexString());return e.length>32&&wf.throwArgumentError("invalid length for "+t,"transaction:"+t,r),e}function ad(r,t){return{address:Eo(r),storageKeys:(t||[]).map((e,n)=>(_0(e)!==32&&wf.throwArgumentError("invalid access list storageKey",`accessList[${r}:${n}]`,e),e.toLowerCase()))}}function ja(r){if(Array.isArray(r))return r.map((e,n)=>Array.isArray(e)?(e.length>2&&wf.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,e),ad(e[0],e[1])):ad(e.address,e.storageKeys));const t=Object.keys(r).map(e=>{const n=r[e].reduce((a,f)=>(a[f]=!0,a),{});return ad(e,Object.keys(n).sort())});return t.sort((e,n)=>e.address.localeCompare(n.address)),t}function y6(r){return ja(r).map(t=>[t.address,t.storageKeys])}function lR(r,t){if(r.gasPrice!=null){const n=fe.from(r.gasPrice),a=fe.from(r.maxFeePerGas||0);n.eq(a)||wf.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:a})}const e=[Hi(r.chainId||0,"chainId"),Hi(r.nonce||0,"nonce"),Hi(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Hi(r.maxFeePerGas||0,"maxFeePerGas"),Hi(r.gasLimit||0,"gasLimit"),r.to!=null?Eo(r.to):"0x",Hi(r.value||0,"value"),r.data||"0x",y6(r.accessList||[])];if(t){const n=Il(t);e.push(Hi(n.recoveryParam,"recoveryParam")),e.push(l0(n.r)),e.push(l0(n.s))}return ls(["0x02",Pl(e)])}function cR(r,t){const e=[Hi(r.chainId||0,"chainId"),Hi(r.nonce||0,"nonce"),Hi(r.gasPrice||0,"gasPrice"),Hi(r.gasLimit||0,"gasLimit"),r.to!=null?Eo(r.to):"0x",Hi(r.value||0,"value"),r.data||"0x",y6(r.accessList||[])];if(t){const n=Il(t);e.push(Hi(n.recoveryParam,"recoveryParam")),e.push(l0(n.r)),e.push(l0(n.s))}return ls(["0x01",Pl(e)])}function b6(r,t,e){try{const n=li(t[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");r.v=n}catch{wf.throwArgumentError("invalid v for transaction type: 1","v",t[0])}r.r=ii(t[1],32),r.s=ii(t[2],32);try{const n=ri(e(r));r.from=x6(n,{r:r.r,s:r.s,recoveryParam:r.v})}catch{}}function dR(r){const t=J1(r.slice(1));t.length!==9&&t.length!==12&&wf.throwArgumentError("invalid component count for transaction type: 2","payload",ge(r));const e=li(t[2]),n=li(t[3]),a={type:2,chainId:li(t[0]).toNumber(),nonce:li(t[1]).toNumber(),maxPriorityFeePerGas:e,maxFeePerGas:n,gasPrice:null,gasLimit:li(t[4]),to:Q1(t[5]),value:li(t[6]),data:t[7],accessList:ja(t[8])};return t.length===9||(a.hash=ri(r),b6(a,t.slice(9),lR)),a}function pR(r){const t=J1(r.slice(1));t.length!==8&&t.length!==11&&wf.throwArgumentError("invalid component count for transaction type: 1","payload",ge(r));const e={type:1,chainId:li(t[0]).toNumber(),nonce:li(t[1]).toNumber(),gasPrice:li(t[2]),gasLimit:li(t[3]),to:Q1(t[4]),value:li(t[5]),data:t[6],accessList:ja(t[7])};return t.length===8||(e.hash=ri(r),b6(e,t.slice(8),cR)),e}function gR(r){const t=J1(r);t.length!==9&&t.length!==6&&wf.throwArgumentError("invalid raw transaction","rawTransaction",r);const e={nonce:li(t[0]).toNumber(),gasPrice:li(t[1]),gasLimit:li(t[2]),to:Q1(t[3]),value:li(t[4]),data:t[5],chainId:0};if(t.length===6)return e;try{e.v=fe.from(t[6]).toNumber()}catch{return e}if(e.r=ii(t[7],32),e.s=ii(t[8],32),fe.from(e.r).isZero()&&fe.from(e.s).isZero())e.chainId=e.v,e.v=0;else{e.chainId=Math.floor((e.v-35)/2),e.chainId<0&&(e.chainId=0);let n=e.v-27;const a=t.slice(0,6);e.chainId!==0&&(a.push(ge(e.chainId)),a.push("0x"),a.push("0x"),n-=e.chainId*2+8);const f=ri(Pl(a));try{e.from=x6(f,{r:ge(e.r),s:ge(e.s),recoveryParam:n})}catch{}e.hash=ri(r)}return e.type=null,e}function mR(r){const t=ve(r);if(t[0]>127)return gR(t);switch(t[0]){case 1:return pR(t);case 2:return dR(t)}return wf.throwError(`unsupported transaction type: ${t[0]}`,Ot.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}const Rs=new Ot(As);class ie{constructor(){Rs.checkNew(new.target,ie),this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),n=this.bigNumber.bind(this),a=this.blockTag.bind(this),f=this.data.bind(this),c=this.hash.bind(this),y=this.hex.bind(this),b=this.number.bind(this),w=this.type.bind(this),E=M=>this.data(M,!0);
12return t.transaction={hash:c,type:w,accessList:ie.allowNull(this.accessList.bind(this),null),blockHash:ie.allowNull(c,null),blockNumber:ie.allowNull(b,null),transactionIndex:ie.allowNull(b,null),confirmations:ie.allowNull(b,null),from:e,gasPrice:ie.allowNull(n),maxPriorityFeePerGas:ie.allowNull(n),maxFeePerGas:ie.allowNull(n),gasLimit:n,to:ie.allowNull(e,null),value:n,nonce:b,data:f,r:ie.allowNull(this.uint256),s:ie.allowNull(this.uint256),v:ie.allowNull(b),creates:ie.allowNull(e,null),raw:ie.allowNull(f)},t.transactionRequest={from:ie.allowNull(e),nonce:ie.allowNull(b),gasLimit:ie.allowNull(n),gasPrice:ie.allowNull(n),maxPriorityFeePerGas:ie.allowNull(n),maxFeePerGas:ie.allowNull(n),to:ie.allowNull(e),value:ie.allowNull(n),data:ie.allowNull(E),type:ie.allowNull(b),accessList:ie.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:b,blockNumber:b,transactionHash:c,address:e,topics:ie.arrayOf(c),data:f,logIndex:b,blockHash:c},t.receipt={to:ie.allowNull(this.address,null),from:ie.allowNull(this.address,null),contractAddress:ie.allowNull(e,null),transactionIndex:b,root:ie.allowNull(y),gasUsed:n,logsBloom:ie.allowNull(f),blockHash:c,transactionHash:c,logs:ie.arrayOf(this.receiptLog.bind(this)),blockNumber:b,confirmations:ie.allowNull(b,null),cumulativeGasUsed:n,effectiveGasPrice:ie.allowNull(n),status:ie.allowNull(b),type:w},t.block={hash:c,parentHash:c,number:b,timestamp:b,nonce:ie.allowNull(y),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:e,extraData:f,transactions:ie.allowNull(ie.arrayOf(c)),baseFeePerGas:ie.allowNull(n)},t.blockWithTransactions=wn(t.block),t.blockWithTransactions.transactions=ie.allowNull(ie.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:ie.allowNull(a,void 0),toBlock:ie.allowNull(a,void 0),blockHash:ie.allowNull(c,void 0),address:ie.allowNull(e,void 0),topics:ie.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:ie.allowNull(b),blockHash:ie.allowNull(c),transactionIndex:b,removed:ie.allowNull(this.boolean.bind(this)),address:e,data:ie.allowFalsish(f,"0x"),topics:ie.arrayOf(c),transactionHash:c,logIndex:b},t}accessList(t){return ja(t||[])}number(t){return t==="0x"?0:fe.from(t).toNumber()}type(t){return t==="0x"||t==null?0:fe.from(t).toNumber()}bigNumber(t){return fe.from(t)}boolean(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t=t.toLowerCase(),t==="true")return!0;if(t==="false")return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return typeof t=="string"&&(!e&&t.substring(0,2)!=="0x"&&(t="0x"+t),rr(t))?t.toLowerCase():Rs.throwArgumentError("invalid hash","value",t)}data(t,e){const n=this.hex(t,e);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return Eo(t)}callAddress(t){if(!rr(t,32))return null;const e=Eo(Df(t,12));return e===V9?null:e}contractAddress(t){return BI(t)}blockTag(t){if(t==null)return"latest";if(t==="earliest")return"0x0";if(t==="latest"||t==="pending")return t;if(typeof t=="number"||rr(t))return W1(t);throw new Error("invalid blockTag")}hash(t,e){const n=this.hex(t,e);return _0(n)!==32?Rs.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(t==null)return null;const e=fe.from(t);try{return e.toNumber()}catch{}return null}uint256(t){if(!rr(t))throw new Error("invalid uint256");return ii(t,32)}_block(t,e){return t.author!=null&&t.miner==null&&(t.miner=t.author),ie.check(e,t)}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return ie.check(this.formats.transactionRequest,t)}transactionResponse(t){t.gas!=null&&t.gasLimit==null&&(t.gasLimit=t.gas),t.to&&fe.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),t.input!=null&&t.data==null&&(t.data=t.input),t.to==null&&t.creates==null&&(t.creates=this.contractAddress(t)),t.type===1&&t.accessList==null&&(t.accessList=[]);const e=ie.check(this.formats.transaction,t);if(t.chainId!=null){let n=t.chainId;rr(n)&&(n=fe.from(n).toNumber()),e.chainId=n}else{let n=t.networkId;n==null&&e.v==null&&(n=t.chainId),rr(n)&&(n=fe.from(n).toNumber()),typeof n!="number"&&e.v!=null&&(n=(e.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),e.chainId=n}return e.blockHash&&e.blockHash.replace(/0/g,"")==="x"&&(e.blockHash=null),e}transaction(t){return mR(t)}receiptLog(t){return ie.check(this.formats.receiptLog,t)}receipt(t){const e=ie.check(this.formats.receipt,t);if(e.root!=null)if(e.root.length<=4){const n=fe.from(e.root).toNumber();n===0||n===1?(e.status!=null&&e.status!==n&&Rs.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=n,delete e.root):Rs.throwArgumentError("invalid alt-root-status","value.root",e.root)}else e.root.length!==66&&Rs.throwArgumentError("invalid root hash","value.root",e.root);return e.status!=null&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map(e=>this.topics(e)):t!=null?this.hash(t,!0):null}filter(t){return ie.check(this.formats.filter,t)}filterLog(t){return ie.check(this.formats.filterLog,t)}static check(t,e){const n={};for(const a in t)try{const f=t[a](e[a]);f!==void 0&&(n[a]=f)}catch(f){throw f.checkKey=a,f.checkValue=e[a],f}return n}static allowNull(t,e){return function(n){return n==null?e:t(n)}}static allowFalsish(t,e){return function(n){return n?t(n):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const n=[];return e.forEach(function(a){n.push(t(a))}),n}}}let _2=!1;function vR(){_2||(_2=!0)}var pe=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Xe=new Ot(As);function S2(r){return r==null?"null":(_0(r)!==32&&Xe.throwArgumentError("invalid topic","topic",r),r.toLowerCase())}function I2(r){for(r=r.slice();r.length>0&&r[r.length-1]==null;)r.pop();return r.map(t=>{if(Array.isArray(t)){const e={};t.forEach(a=>{e[S2(a)]=!0});const n=Object.keys(e);return n.sort(),n.join("|")}else return S2(t)}).join("&")}function xR(r){return r===""?[]:r.split(/&/g).map(t=>{if(t==="")return[];const e=t.split("|").map(n=>n==="null"?null:n);return e.length===1?e[0]:e})}function Ts(r){if(typeof r=="string"){if(r=r.toLowerCase(),_0(r)===32)return"tx:"+r;if(r.indexOf(":")===-1)return r}else{if(Array.isArray(r))return"filter:*:"+I2(r);if(K9.isForkEvent(r))throw Xe.warn("not implemented"),new Error("not implemented");if(r&&typeof r=="object")return"filter:"+(r.address||"*")+":"+I2(r.to
12pics||[])}throw new Error("invalid event - "+r)}function L0(){return new Date().getTime()}function R2(r){return new Promise(t=>{setTimeout(t,r)})}const yR=["block","network","pending","poll"];class bR{constructor(t,e,n){se(this,"tag",t),se(this,"listener",e),se(this,"once",n)}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return t[0]!=="tx"?null:t[1]}get filter(){const t=this.tag.split(":");if(t[0]!=="filter")return null;const e=t[1],n=xR(t[2]),a={};return n.length>0&&(a.topics=n),e&&e!=="*"&&(a.address=e),a}pollable(){return this.tag.indexOf(":")>=0||yR.indexOf(this.tag)>=0}}const wR={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function hd(r){return ii(fe.from(r).toHexString(),32)}function T2(r){return X3.encode(Gs([r,Df(E2(E2(r)),0,4)]))}class ER{constructor(t,e,n){se(this,"provider",t),se(this,"name",n),se(this,"address",t.formatter.address(e))}_fetchBytes(t,e){return pe(this,void 0,void 0,function*(){const n={to:this.address,data:ls([t,qu(this.name),e||"0x"])};try{const a=yield this.provider.call(n);if(a==="0x")return null;const f=fe.from(Df(a,0,32)).toNumber(),c=fe.from(Df(a,f,f+32)).toNumber();return Df(a,f+32,f+32+c)}catch(a){return a.code===Ot.errors.CALL_EXCEPTION,null}})}_getAddress(t,e){const n=wR[String(t)];if(n==null&&Xe.throwError(`unsupported coin type: ${t}`,Ot.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),n.ilk==="eth")return this.provider.formatter.address(e);const a=ve(e);if(n.p2pkh!=null){const f=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(f){const c=parseInt(f[1],16);if(f[2].length===c*2&&c>=1&&c<=75)return T2(Gs([[n.p2pkh],"0x"+f[2]]))}}if(n.p2sh!=null){const f=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(f){const c=parseInt(f[1],16);if(f[2].length===c*2&&c>=1&&c<=75)return T2(Gs([[n.p2sh],"0x"+f[2]]))}}if(n.prefix!=null){const f=a[1];let c=a[0];if(c===0?f!==20&&f!==32&&(c=-1):c=-1,c>=0&&a.length===2+f&&f>=1&&f<=75){const y=Bu.toWords(a.slice(2));return y.unshift(c),Bu.encode(n.prefix,y)}}return null}getAddress(t){return pe(this,void 0,void 0,function*(){if(t==null&&(t=60),t===60)try{const a={to:this.address,data:"0x3b3b57de"+qu(this.name).substring(2)},f=yield this.provider.call(a);return f==="0x"||f===X9?null:this.provider.formatter.callAddress(f)}catch(a){if(a.code===Ot.errors.CALL_EXCEPTION)return null;throw a}const e=yield this._fetchBytes("0xf1cb7e06",hd(t));if(e==null||e==="0x")return null;const n=this._getAddress(t,e);return n==null&&Xe.throwError("invalid or unsupported coin data",Ot.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),n})}getContentHash(){return pe(this,void 0,void 0,function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(t==null||t==="0x")return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const a=parseInt(e[3],16);if(e[4].length===a*2)return"ipfs://"+X3.encode("0x"+e[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);return n&&n[1].length===32*2?"bzz://"+n[1]:Xe.throwError("invalid or unsupported content hash data",Ot.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})})}getText(t){return pe(this,void 0,void 0,function*(){let e=ts(t);e=Gs([hd(64),hd(e.length),e]),e.length%32!==0&&(e=Gs([e,ii("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",ge(e));return n==null||n==="0x"?null:Rl(n)})}}let ud=null,AR=1;class MR extends $u{constructor(t){if(Xe.checkNew(new.target,$u),super(),this._events=[],this._emitted={block:-2},this.formatter=new.target.getFormatter(),se(this,"anyNetwork",t==="any"),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch(e=>{}),this._ready().catch(e=>{});else{const e=Of(new.target,"getNetwork")(t);e?(se(this,"_network",e),this.emit("network",e,null)):Xe.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return pe(this,void 0,void 0,function*(){if(this._network==null){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch{}t==null&&(t=yield this.detectNetwork()),t||Xe.throwError("no network detected",Ot.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=t:se(this,"_network",t),this.emit
12("network",t,null))}return this._network})}get ready(){return J0(()=>this._ready().then(t=>t,t=>{if(!(t.code===Ot.errors.NETWORK_ERROR&&t.event==="noNetwork"))throw t}))}static getFormatter(){return ud==null&&(ud=new ie),ud}static getNetwork(t){return J9(t??"homestead")}_getInternalBlockNumber(t){return pe(this,void 0,void 0,function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const a=this._internalBlockNumber;try{const f=yield a;if(L0()-f.respTime<=t)return f.blockNumber;break}catch{if(this._internalBlockNumber===a)break}}const e=L0(),n=ti({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(a=>null,a=>a)}).then(({blockNumber:a,networkError:f})=>{if(f)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),f;const c=L0();return a=fe.from(a).toNumber(),a<this._maxInternalBlockNumber&&(a=this._maxInternalBlockNumber),this._maxInternalBlockNumber=a,this._setFastBlockNumber(a),{blockNumber:a,reqTime:e,respTime:c}});return this._internalBlockNumber=n,n.catch(a=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return pe(this,void 0,void 0,function*(){const t=AR++,e=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(a){this.emit("error",a);return}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n===this._lastBlockNumber){this.emit("didPoll",t);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Xe.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Xe.makeError("network block skew detected",Ot.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let a=this._emitted.block+1;a<=n;a++)this.emit("block",a);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(a=>{if(a==="block")return;const f=this._emitted[a];f!=="pending"&&n-f>12&&delete this._emitted[a]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(a=>{switch(a.type){case"tx":{const f=a.hash;let c=this.getTransactionReceipt(f).then(y=>(!y||y.blockNumber==null||(this._emitted["t:"+f]=y.blockNumber,this.emit(f,y)),null)).catch(y=>{this.emit("error",y)});e.push(c);break}case"filter":{const f=a.filter;f.fromBlock=this._lastBlockNumber+1,f.toBlock=n;const c=this.getLogs(f).then(y=>
12{y.length!==0&&y.forEach(b=>{this._emitted["b:"+b.blockHash]=b.blockNumber,this._emitted["t:"+b.transactionHash]=b.blockNumber,this.emit(f,b)})}).catch(y=>{this.emit("error",y)});e.push(c);break}}}),this._lastBlockNumber=n,Promise.all(e).then(()=>{this.emit("didPoll",t)}).catch(a=>{this.emit("error",a)})})}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return pe(this,void 0,void 0,function*(){return Xe.throwError("provider does not support network detection",Ot.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return pe(this,void 0,void 0,function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield R2(0),this._network;const n=Xe.makeError("underlying network changed",Ot.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",n),n}return t})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(t=>{this._setFastBlockNumber(t)},t=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(t){t&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if(typeof t!="number"||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const t=L0();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(t){this._fastBlockNumber!=null&&t<this._fastBlockNumber||(this._fastQueryDate=L0(),(this._fastBlockNumber==null||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,n){return pe(this,void 0,void 0,function*(){return this._waitForTransaction(t,e??1,n||0,null)})}_waitForTransaction(t,e,n,a){return pe(this,void 0,void 0,function*(){const f=yield this.getTransactionReceipt(t);return(f?f.confirmations:0)>=e?f:new Promise((c,y)=>{const b=[];let w=!1;const E=function(){return w?!0:(w=!0,b.forEach(O=>{O()}),!1)},M=O=>{O.confirmations<e||E()||c(O)};if(this.on(t,M),b.push(()=>{this.removeListener(t,M)}),a){let O=a.startBlock,F=null;const B=L=>pe(this,void 0,void 0,function*(){w||(yield R2(1e3),this.getTransactionCount(a.from).then(z=>pe(this,void 0,void 0,function*(){if(!w){if(z<=a.nonce)O=L;else{{const q=yield this.getTransaction(t);if(q&&q.blockNumber!=null)return}for(F==null&&(F=O-3,F<a.startBlock&&(F=a.startBlock));F<=L;){if(w)return;const q=yield this.getBlockWithTransactions(F);for(let V=0;V<q.transactions.length;V++){const At=q.transactions[V];if(At.hash===t)return;if(At.from===a.from&&At.nonce===a.nonce){if(w)return;const St=yield this.waitForTransaction(At.hash,e);if(E())return;let Z="replaced";At.data===a.data&&At.to===a.to&&At.value.eq(a.value)?Z="repriced":At.data==="0x"&&At.from===At.to&&At.value.isZero()&&(Z="cancelled"),y(Xe.makeError("transaction was replaced",Ot.errors.TRANSACTION_REPLACED,{cancelled:Z==="replaced"||Z==="cancelled",reason:Z,replacement:this._wrapTransaction(At),hash:t,receipt:St}));return}}F++}}w||this.once("block",B)}}),z=>{w||this.once("block",B)}))});if(w)return;this.once("block",B),b.push(()=>{this.removeListener("block",B)})}if(typeof n=="number"&&n>0){const O=setTimeout(()=>{E()||y(Xe.makeError("timeout exceeded",Ot.errors.TIMEOUT,{timeout:n}))},n);O.unref&&O.unref(),b.push(()=>{clearTimeout(O)})}})})}getBlockNumber(){return pe(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return fe.from(t)}catch(e){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}})}getBalance(t,e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield ti({address:this._getAddress(t),blockTag:this._getBlockTag(e)}
12),a=yield this.perform("getBalance",n);try{return fe.from(a)}catch(f){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"getBalance",params:n,result:a,error:f})}})}getTransactionCount(t,e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield ti({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),a=yield this.perform("getTransactionCount",n);try{return fe.from(a).toNumber()}catch(f){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:a,error:f})}})}getCode(t,e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield ti({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),a=yield this.perform("getCode",n);try{return ge(a)}catch(f){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"getCode",params:n,result:a,error:f})}})}getStorageAt(t,e,n){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const a=yield ti({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(e).then(c=>W1(c))}),f=yield this.perform("getStorageAt",a);try{return ge(f)}catch(c){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"getStorageAt",params:a,result:f,error:c})}})}_wrapTransaction(t,e,n){if(e!=null&&_0(e)!==32)throw new Error("invalid response - sendTransaction");const a=t;return e!=null&&t.hash!==e&&Xe.throwError("Transaction hash mismatch from Provider.sendTransaction.",Ot.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),a.wait=(f,c)=>pe(this,void 0,void 0,function*(){f==null&&(f=1),c==null&&(c=0);let y;f!==0&&n!=null&&(y={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const b=yield this._waitForTransaction(t.hash,f,c,y);return b==null&&f===0?null:(this._emitted["t:"+t.hash]=b.blockNumber,b.status===0&&Xe.throwError("transaction failed",Ot.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:b}),b)}),a}sendTransaction(t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then(f=>ge(f)),n=this.formatter.transaction(t),a=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const f=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(n,f,a)}catch(f){throw f.transaction=n,f.transactionHash=n.hash,f}})}_getTransactionRequest(t){return pe(this,void 0,void 0,function*(){const e=yield t,n={};return["from","to"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f?this._getAddress(f):null))}),["gasLimit","gasPrice","value"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f?fe.from(f):null))}),["type"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f??null))}),e.accessList&&(n.accessList=this.formatter.accessList(e.accessList)),["data"].forEach(a=>{e[a]!=null&&(n[a]=Promise.resolve(e[a]).then(f=>f?ge(f):null))}),this.formatter.transactionRequest(yield ti(n))})}_getFilter(t){return pe(this,void 0,void 0,function*(){t=yield t;const e={};return t.address!=null&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach(n=>{t[n]!=null&&(e[n]=t[n])}),["fromBlock","toBlock"].forEach(n=>{t[n]!=null&&(e[n]=this._getBlockTag(t[n]))}),this.formatter.filter(yield ti(e))})}call(t,e){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield ti({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e)}),a=yield this.perform("call",n);try{return ge(a)}catch(f){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"call",params:n,result:a,error:f})}})}estimateGas(t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield ti({transaction:this._getTransactionRequest(t)}),n=yield this.perform("estimateGas",e);try{return fe.from(n)}catch(a){return Xe.throwError("bad result from backend",Ot.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:n,error:a})}})}_getAddress(t){return pe(this,void 0,void 0,function*(){const e=yield this.resolveName(t);return e==null&&Xe.throwError("ENS name not configured",Ot.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e})}_getBlock(t,e){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let n=-128;const a={includeTransactions:!!e};if(rr(t,32))a.blockHash=t;else try{a.blockTag=this.formatter.blockTag(yield this._getBlockTag(t)),rr(a.blockTag)&&(n=parseInt(a.blockTag.substring(2),16))}catch{Xe.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return J0(()=>pe(this,void 0,void 0,function*(){const f=yield this.perform("getBlock",a);if(f==null)return a.blockHash!=null&&this._emitted["b:"+a.blockHash]==null||a.blockTag!=null&&n>this._emitted.block?null:void 0;if(e){let c=null;for(let y=0;y<f.transactions.length;y++){const b=f.transactions[y];if(b.blockNumber==null)b.confirmations=0;else if(b.confirmations==null){c==null&&(c=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let w=c-b.blockNumber+1;w<=0&&(w=1),b.confirmations=w}}return this.formatter.blockWithTransactions(f)}return this.formatter.block(f)}),{oncePoll:this})})}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return J0(()=>pe(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",e);if(n==null)return this._emitted["t:"+t]==null?null:void 0;const a=this.formatter.transactionResponse(n);if(a.blockNumber==null)a.confirmations=0;else if(a.confirmations==null){let c=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-a.blockNumber+1;c<=0&&(c=1),a.confirmations=c}return this._wrapTransaction(a)}),{oncePoll:this})})}getTransactionReceipt(t){return pe(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return J0(()=>pe(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",e);if(n==null)return this._emitted["t:"+t]==null?null:void 0;if(n.blockHash==null)return;const a=this.formatter.receipt(n);if(a.blockNumber==null)a.confirmations=0;else if(a.confirmations==null){let c=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-a.blockNumber+1;c<=0&&(c=1),a.confirmations=c}return a}),{oncePoll:this})})}getLogs(t){return pe(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield ti({filter:this._getFilter(t)}),n=yield this.perform("getLogs",e);
12return n.forEach(a=>{a.removed==null&&(a.removed=!1)}),ie.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return pe(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(t){return pe(this,void 0,void 0,function*(){if(t=yield t,typeof t=="number"&&t<0){t%1&&Xe.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)})}getResolver(t){return pe(this,void 0,void 0,function*(){try{const e=yield this._getResolver(t);return e==null?null:new ER(this,e,t)}catch(e){return e.code===Ot.errors.CALL_EXCEPTION,null}})}_getResolver(t){return pe(this,void 0,void 0,function*(){const e=yield this.getNetwork();e.ensAddress||Xe.throwError("network does not support ENS",Ot.errors.UNSUPPORTED_OPERATION,{operation:"ENS",network:e.name});const n={to:e.ensAddress,data:"0x0178b8bf"+qu(t).substring(2)};try{return this.formatter.callAddress(yield this.call(n))}catch(a){if(a.code===Ot.errors.CALL_EXCEPTION)return null;throw a}})}resolveName(t){return pe(this,void 0,void 0,function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(n){if(rr(t))throw n}typeof t!="string"&&Xe.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null})}lookupAddress(t){return pe(this,void 0,void 0,function*(){t=yield t,t=this.formatter.address(t);const e=t.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(e);if(!n)return null;let a=ve(yield this.call({to:n,data:"0x691f3431"+qu(e).substring(2)}));if(a.length<32||!fe.from(a.slice(0,32)).eq(32)||(a=a.slice(32),a.length<32))return null;const f=fe.from(a.slice(0,32)).toNumber();if(a=a.slice(32),f>a.length)return null;const c=Rl(a.slice(0,f));return(yield this.resolveName(c))!=t?null:c})}perform(t,e){return Xe.throwError(t+" not implemented",Ot.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(t){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(t,e,n){const a=new bR(Ts(t),e,n);return this._events.push(a),this._startEvent(a),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let n=!1,a=[],f=Ts(t);return this._events=this._events.filter(c=>c.tag!==f?!0:(setTimeout(()=>{c.listener.apply(this,e)},0),n=!0,c.once?(a.push(c),!1):!0)),a.forEach(c=>{this._stopEvent(c)}),n}listenerCount(t){if(!t)return this._events.length;let e=Ts(t);return this._events.filter(n=>n.tag===e).length}listeners(t){if(t==null)return this._events.map(n=>n.listener);let e=Ts(t);return this._events.filter(n=>n.tag===e).map(n=>n.listener)}off(t,e){if(e==null)return this.removeAllListeners(t);const n=[];let a=!1,f=Ts(t);return this._events=this._events.filter(c=>c.tag!==f||c.listener!=e||a?!0:(a=!0,n.push(c),!1)),n.forEach(c=>{this._stopEvent(c)}),this}removeAllListeners(t){let e=[];
12if(t==null)e=this._events,this._events=[];else{const n=Ts(t);this._events=this._events.filter(a=>a.tag!==n?!0:(e.push(a),!1))}return e.forEach(n=>{this._stopEvent(n)}),this}}const NR="abstract-signer/5.7.0";var Bn=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const Un=new Ot(NR),_R=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],SR=[Ot.errors.INSUFFICIENT_FUNDS,Ot.errors.NONCE_EXPIRED,Ot.errors.REPLACEMENT_UNDERPRICED];class Y1{constructor(){Un.checkAbstract(new.target,Y1),se(this,"_isSigner",!0)}getBalance(t){return Bn(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)})}getTransactionCount(t){return Bn(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)})}estimateGas(t){return Bn(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const e=yield ti(this.checkTransaction(t));return yield this.provider.estimateGas(e)})}call(t,e){return Bn(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield ti(this.checkTransaction(t));return yield this.provider.call(n,e)})}sendTransaction(t){return Bn(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const e=yield this.populateTransaction(t),n=yield this.signTransaction(e);return yield this.provider.sendTransaction(n)})}getChainId(){return Bn(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Bn(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Bn(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(t){return Bn(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)})}checkTransaction(t){for(const n in t)_R.indexOf(n)===-1&&Un.throwArgumentError("invalid transaction key: "+n,"transaction",t);const e=wn(t);return e.from==null?e.from=this.getAddress():e.from=Promise.all([Promise.resolve(e.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Un.throwArgumentError("from address mismatch","transaction",t),n[0])),e}populateTransaction(t){return Bn(this,void 0,void 0,function*(){const e=yield ti(this.checkTransaction(t));e.to!=null&&(e.to=Promise.resolve(e.to).then(a=>Bn(this,void 0,void 0,function*(){if(a==null)return null;const f=yield this.resolveName(a);return f==null&&Un.throwArgumentError("provided ENS name resolves to null","tx.to",a),f})),e.to.catch(a=>{}));const n=e.maxFeePerGas!=null||e.maxPriorityFeePerGas!=null;if(e.gasPrice!=null&&(e.type===2||n)?Un.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t):(e.type===0||e.type===1)&&n&&Un.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t),(e.type===2||e.type==null)&&e.maxFeePerGas!=null&&e.maxPriorityFeePerGas!=null)e.type=2;else if(e.type===0||e.type===1)e.gasPrice==null&&(e.gasPrice=this.getGasPrice());else{const a=yield this.getFeeData();if(e.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(e.type=2,e.gasPrice!=null){const f=e.gasPrice;delete e.gasPrice,e.maxFeePerGas=f,e.maxPriorityFeePerGas=f}else e.maxFeePerGas==null&&(e.maxFeePerGas=a.maxFeePerGas),e.maxPriorityFeePerGas==null&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(n&&Un.throwError("network does not support EIP-1559",Ot.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),e.gasPrice==null&&(e.gasPrice=a.gasPrice),e.type=0):Un.throwError("failed to get consistent fee data",Ot.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else e.type===2&&(e.maxFeePerGas==null&&(e.maxFeePerGas=a.maxFeePerGas),e.maxPriorityFeePerGas==null&&(e.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return e.nonce==null&&(e.nonce=this.getTransactionCount("pending")),e.gasLimit==null&&(e.gasLim
12it=this.estimateGas(e).catch(a=>{if(SR.indexOf(a.code)>=0)throw a;return Un.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ot.errors.UNPREDICTABLE_GAS_LIMIT,{error:a,tx:e})})),e.chainId==null?e.chainId=this.getChainId():e.chainId=Promise.all([Promise.resolve(e.chainId),this.getChainId()]).then(a=>(a[1]!==0&&a[0]!==a[1]&&Un.throwArgumentError("chainId address mismatch","transaction",t),a[0])),yield ti(e)})}_checkProvider(t){this.provider||Un.throwError("missing provider",Ot.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!!(t&&t._isSigner)}}var Tf=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const ei=new Ot(As),IR=["call","estimateGas"];function w6(r,t,e){if(r==="call"&&t.code===Ot.errors.SERVER_ERROR){const f=t.error;if(f&&f.message.match("reverted")&&rr(f.data))return f.data;ei.throwError("missing revert data in call exception",Ot.errors.CALL_EXCEPTION,{error:t,data:"0x"})}let n=t.message;t.code===Ot.errors.SERVER_ERROR&&t.error&&typeof t.error.message=="string"?n=t.error.message:typeof t.body=="string"?n=t.body:typeof t.responseText=="string"&&(n=t.responseText),n=(n||"").toLowerCase();const a=e.transaction||e.signedTransaction;throw n.match(/insufficient funds/)&&ei.throwError("insufficient funds for intrinsic transaction cost",Ot.errors.INSUFFICIENT_FUNDS,{error:t,method:r,transaction:a}),n.match(/nonce too low/)&&ei.throwError("nonce has already been used",Ot.errors.NONCE_EXPIRED,{error:t,method:r,transaction:a}),n.match(/replacement transaction underpriced/)&&ei.throwError("replacement fee too low",Ot.errors.REPLACEMENT_UNDERPRICED,{error:t,method:r,transaction:a}),n.match(/only replay-protected/)&&ei.throwError("legacy pre-eip-155 transactions not supported",Ot.errors.UNSUPPORTED_OPERATION,{error:t,method:r,transaction:a}),IR.indexOf(r)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&ei.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ot.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:r,transaction:a}),t}function P2(r){return new Promise(function(t){setTimeout(t,r)})}function RR(r){if(r.error){const t=new Error(r.error.message);throw t.code=r.error.code,t.data=r.error.data,t}return r.result}function $0(r){return r&&r.toLowerCase()}const lp={};class kl extends Y1{constructor(t,e,n){if(ei.checkNew(new.target,kl),super(),t!==lp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");se(this,"provider",e),n==null&&(n=0),typeof n=="string"?(se(this,"_address",this.provider.formatter.address(n)),se(this,"_index",null)):typeof n=="number"?(se(this,"_index",n),se(this,"_address",null)):ei.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return ei.throwError("cannot alter JSON-RPC Signer connection",Ot.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new TR(lp,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(t=>(t.length<=this._index&&ei.throwError("unknown account #"+this._index,Ot.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index])))}sendUncheckedTransaction(t){t=wn(t);const e=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(t.gasLimit==null){const n=wn(t);n.from=e,t.gasLimit=this.provider.estimateGas(n)}return t.to!=null&&(t.to=Promise.resolve(t.to).then(n=>Tf(this,void 0,void 0,function*(){if(n==null)return null;const a=yield this.provider.resolveName(n);return a==null&&ei.throwArgumentError("provided ENS name resolves to null","tx.to",n),a}))),ti({tx:ti(t),sender:e}).then(({tx:n,sender:a})=>{n.from!=null?n.from.toLowerCase()!==a&&ei.throwArgumentError("from address mismatch","transaction",t):n.from=a;const f=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[f]).then(c=>c,c=>w6("sendTransaction",c,f))})}signTransaction(t){return ei.throwError("signing transactions is unsupported",Ot.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Tf(this,void 0,void 0,function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield J0(()=>Tf(this,void 0,void 0,function*(){const a=yield this.provider.getTransaction(n);if(a!==null)return this.provider._wrapTransaction(a,n,e)}),{oncePoll:this.provider})}catch(a){throw a.transactionHash=n,a}})}signMessage(t){return Tf(this,void 0,void 0,function*(){const e=typeof t=="string"?ts(t):t,n=yield this.getAddress();return yield this.provider.send("eth_sign",[n.toLowerCase(),ge(e)])})}_signTypedData(t,e,n){return Tf(this,void 0,void 0,function*(){const a=yield Di.resolveNames(t,e,n,c=>this.provider.resolveName(c)),f=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[f.toLowerCase(),JSON.stringify(Di.getPayload(a.domain,e,a.value))])})}unlock(t){return Tf(this,void 0,void 0,function*(){const e=this.provider,n=yield this.getAddress();return e.send("personal_unlockAccount",[n.toLowerCase(),t,null])})}}class TR extends kl{sendTransaction(t){return this.sendUncheckedTransaction(t).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(e,n)}))}}const PR={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0};class Bl extends MR{constructor(t,e){ei.checkNew(new.target,Bl);let n=e;n==null&&(n=new Promise((a,f)=>{setTimeout(()=>{this.detectNetwork().then(c=>{a(c)},c=>{f(c)})},0)})),super(n),t||(t=Of(this.constructor,"defaultUrl")()),typeof t=="string"?se(this,"connection",Object.freeze({url:t})):se(this,"connection",Object.freeze(wn(t))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Tf(this,void 0,void 0,function*(){yield P2(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch{try{t=yield this.send("net_version",[])}catch{}}if(t!=null){const e=Of(this.constructor,"getNetwork");try{return e(fe.from(t).toNumber())}catch(n){return ei.throwError("could not detect network",Ot.errors.NETWORK_E
12RROR,{chainId:t,event:"invalidNetwork",serverError:n})}}return ei.throwError("could not detect network",Ot.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(t){return new kl(lp,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(t=>t.map(e=>this.formatter.address(e)))}send(t,e){const n={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ba(n),provider:this});const a=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(a&&this._cache[t])return this._cache[t];const f=jI(this.connection,JSON.stringify(n),RR).then(c=>(this.emit("debug",{action:"response",request:n,response:c,provider:this}),c),c=>{throw this.emit("debug",{action:"response",error:c,request:n,provider:this}),c});return a&&(this._cache[t]=f,setTimeout(()=>{this._cache[t]=null},0)),f}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[$0(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[$0(e.address),e.blockTag]];case"getCode":return["eth_getCode",[$0(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[$0(e.address),e.position,e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[Of(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[Of(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&e.filter.address!=null&&(e.filter.address=$0(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Tf(this,void 0,void 0,function*(){const n=this.prepareRequest(t,e);n==null&&ei.throwError(t+" not implemented",Ot.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(a){return w6(t,a,e)}})}_startEvent(t){t.tag==="pending"&&this._startPending(),super._startEvent(t)}_startPending(){if(this._pendingFilter!=null)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then(function(n){function a(){t.send("eth_getFilterChanges",[n]).then(function(f){if(t._pendingFilter!=e)return null;let c=Promise.resolve();return f.forEach(function(y){t._emitted["t:"+y.toLowerCase()]="pending",c=c.then(function(){return t.getTransaction(y).then(function(b){return t.emit("pending",b),null})})}),c.then(function(){return P2(1e3)})}).then(function(){if(t._pendingFilter!=e){t.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){a()},0),null}).catch(f=>{})}return a(),n}).catch(n=>{})}_stopEvent(t){t.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const n=wn(PR);if(e)for(const f in e)e[f]&&(n[f]=!0);F9(t,n);const a={};return["gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(f){if(t[f]==null)return;const c=W1(t[f]);f==="gasLimit"&&(f="gas"),a[f]=c}),["from","to","data"].forEach(function(f){t[f]!=null&&(a[f]=ge(t[f]))}),t.accessList&&(a.accessList=ja(t.accessList)),a}}let sa=null;try{if(sa=WebSocket,sa==null)throw new Error("inject please")}catch{const t=new Ot(As);sa=function(){t.throwError("WebSockets not supported in this environment",Ot.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var ld=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const ah=new Ot(As);let CR=1;class OR extends Bl{constructor(t,e){e==="any"&&ah.throwError("WebSocketProvider does not support 'any' network yet",Ot.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super(t,e),this._pollingInterval=-1,this._wsReady=!1,se(this,"_websocket",new sa(this.connection.url)),se(this,"_requests",{}),se(this,"_subs",{}),se(this,"_subIds",{}),se(this,"_detectNetwork",super.detectNetwork()),this._websocket.onopen=()=>
12{this._wsReady=!0,Object.keys(this._requests).forEach(a=>{this._websocket.send(this._requests[a].payload)})},this._websocket.onmessage=a=>{const f=a.data,c=JSON.parse(f);if(c.id!=null){const y=String(c.id),b=this._requests[y];if(delete this._requests[y],c.result!==void 0)b.callback(null,c.result),this.emit("debug",{action:"response",request:JSON.parse(b.payload),response:c.result,provider:this});else{let w=null;c.error?(w=new Error(c.error.message||"unknown error"),se(w,"code",c.error.code||null),se(w,"response",f)):w=new Error("unknown error"),b.callback(w,void 0),this.emit("debug",{action:"response",error:w,request:JSON.parse(b.payload),provider:this})}}else if(c.method==="eth_subscription"){const y=this._subs[c.params.subscription];y&&y.processFunc(c.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){ah.throwError("cannot reset events block on WebSocketProvider",Ot.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){ah.throwError("cannot set polling interval on WebSocketProvider",Ot.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return ld(this,void 0,void 0,function*(){return null})}set polling(t){t&&ah.throwError("cannot set polling on WebSocketProvider",Ot.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,e){const n=CR++;return new Promise((a,f)=>{function c(b,w){return b?f(b):a(w)}const y=JSON.stringify({method:t,params:e,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(y),provider:this}),this._requests[String(n)]={callback:c,payload:y},this._wsReady&&this._websocket.send(y)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,e,n){return ld(this,void 0,void 0,function*(){let a=this._subIds[t];a==null&&(a=Promise.all(e).then(c=>this.send("eth_subscribe",c)),this._subIds[t]=a);const f=yield a;this._subs[f]={tag:t,processFunc:n}})}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],e=>{const n=fe.from(e.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],e=>{this.emit("pending",e)});break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],e=>{e.removed==null&&(e.removed=!1),this.emit(t.filter,this.formatter.filterLog(e))});break;case"tx":{const e=n=>{const a=n.hash;this.getTransactionReceipt(a).then(f=>{f&&this.emit(a,f)})};e(t),this._subscribe("tx",["newHeads"],n=>{this._events.filter(a=>a.type==="tx").forEach(e)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:break}}_stopEvent(t){let e=t.tag;if(t.type==="tx"){if(this._events.filter(a=>a.type==="tx").length)return;e="tx"}else if(this.listenerCount(t.event))return;const n=this._subIds[e];n&&(delete this._subIds[e],n.then(a=>{this._subs[a]&&(delete this._subs[a],this.send("eth_unsubscribe",[a]))}))}destroy(){return ld(this,void 0,void 0,function*(){this._websocket.readyState===sa.CONNECTING&&(yield new Promise(t=>{this._websocket.onopen=function(){t(!0)},this._websocket.onerror=function(){t(!1)}})),this._websocket.close(1e3)})}}var kR=function(r,t,e,n){function a(f){return f instanceof e?f:new e(function(c){c(f)})}return new(e||(e=Promise))(function(f,c){function y(E){try{w(n.next(E))}catch(M){c(M)}}function b(E){try{w(n.throw(E))}catch(M){c(M)}}function w(E){E.done?f(E.value):a(E.value).then(y,b)}w((n=n.apply(r,t||[])).next())})};const V0=new Ot(As);class BR extends Bl{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return kR(this,void 0,void 0,function*(){let e=this.network;return e==null&&(e=yield t.detectNetwork.call(this),e||V0.throwError("no network detected",Ot.errors.UNKNOWN_ERROR,{}),this._network==null&&(se(this,"_network",e),this.emit("network",e,null))),e})}}class tg extends BR{constructor(t,e){V0.checkAbstract(new.target,tg),t=Of(new.target,"getNetwork")(t),e=Of(new.target,"getApiKey")(e);const n=Of(new.target,"getUrl")(t,e);super(n,t),typeof e=="string"?se(this,"apiKey",e):e!=null&&Object.keys(e).forEach(a=>{se(this,a,e[a])})}_startPending(){V0.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return V0.throwError("API provider does not support signing",Ot.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,e){return V0.throwError("not implemented;
12 sub-classes must override getUrl",Ot.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const nu=new Ot(As),j0="84842078b09946638c03157f83405213";class UR extends OR{constructor(t,e){const n=new FR(t,e),a=n.connection;a.password&&nu.throwError("INFURA WebSocket project secrets unsupported",Ot.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const f=a.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(f,t),se(this,"apiKey",n.projectId),se(this,"projectId",n.projectId),se(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===j0}}class FR extends tg{static getWebSocketProvider(t,e){return new UR(t,e)}static getApiKey(t){const e={apiKey:j0,projectId:j0,projectSecret:null};return t==null||(typeof t=="string"?e.projectId=t:t.projectSecret!=null?(nu.assertArgument(typeof t.projectId=="string","projectSecret requires a projectId","projectId",t.projectId),nu.assertArgument(typeof t.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),e.projectId=t.projectId,e.projectSecret=t.projectSecret):t.projectId&&(e.projectId=t.projectId),e.apiKey=e.projectId),e}static getUrl(t,e){let n=null;switch(t?t.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"ropsten":n="ropsten.infura.io";break;case"rinkeby":n="rinkeby.infura.io";break;case"kovan":n="kovan.infura.io";break;case"goerli":n="goerli.infura.io";break;default:nu.throwError("unsupported network",Ot.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const a={allowGzip:!0,url:"https://"+n+"/v3/"+e.projectId,throttleCallback:(f,c)=>(e.projectId===j0&&vR(),Promise.resolve(!0))};return e.projectSecret!=null&&(a.user="",a.password=e.projectSecret),a}isCommunityResource(){return this.projectId===j0}}const HT=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:bp,ConstructorFragment:i0,ErrorFragment:su,EventFragment:ua,FormatTypes:qe,Fragment:p0,FunctionFragment:n0,HDNode:Db,Indexed:hu,Interface:wy,LogDescription:Ep,Logger:ul,ParamType:dn,RLP:ZN,SigningKey:v1,get SupportedAlgorithm(){return Aa},TransactionDescription:Ap,get TransactionTypes(){return Pu},get UnicodeNormalizationForm(){return Jf},Utf8ErrorFuncs:y1,get Utf8ErrorReason(){return Ei},_TypedDataEncoder:fb,_fetchData:$1,_toEscapedUtf8String:Lw,accessListify:Wa,arrayify:kf,base58:Oy,base64:QA,checkProperties:bw,checkResultErrors:J2,commify:a3,computeAddress:C1,computeHmac:cw,computePublicKey:x1,concat:Op,deepCopy:Ma,defaultAbiCoder:wp,defaultPath:Fb,defineReadOnly:h1,entropyToMnemonic:Zp,fetchJson:S3,formatBytes32String:$w,formatEther:h3,formatUnits:O1,getAccountPath:$b,getAddress:$f,getContractAddress:Ty,getCreate2Address:Py,getIcapAddress:Ry,getJsonWalletAddress:qb,getStatic:xw,hashMessage:Yy,hexConcat:Dy,hexDataLength:Uy,hexDataSlice:Fy,hexStripZeros:Bp,hexValue:Ly,hexZeroPad:Y0,hexlify:Ai,id:Zu,isAddress:Iy,isBytes:Da,isBytesLike:Cp,isHexString:pn,isValidMnemonic:Lb,isValidName:Xy,joinSignature:$y,keccak256:aw,mnemonicToEntropy:il,mnemonicToSeed:Xp,namehash:Zy,nameprep:qw,parseBytes32String:Gw,parseEther:u3,parseTransaction:o3,parseUnits:k1,poll:I3,randomBytes:mw,recoverAddress:wl,recoverPublicKey:Ow,resolveProperties:yw,ripemd160:hw,serializeTransaction:i3,sha256:uw,sha512:lw,shallowCopy:ww,shuffled:vw,solidityKeccak256:pw,solidityPack:ll,soliditySha256:gw,splitSignature:Up,stripZeros:By,toUtf8Bytes:vl,toUtf8CodePoints:Su,toUtf8String:w1,verifyMessage:b3,verifyTypedData:w3,zeroPad:kp},Symbol.toStringTag,{value:"Module"}));export{vl as $,mf as A,B6 as B,a4 as C,La as D,QN as E,ub as F,wy as G,c9 as H,FR as I,If as J,aw as K,kf as L,KT as M,HT as N,Iy as O,k1 as P,H3 as Q,O1 as R,$T as S,Y0 as T,wp as U,u3 as V,zT as W,$y as X,Up as Y,h3 as Z,qT as _,cd as a,C1 as a0,E6 as b,bi as c,nT as d,QA as e,fT as f,Nr as g,sT as h,aT as i,cT as j,vT as k,iT as l,xT as m,yT as n,bT as o,xr as p,wT as q,ET as r,MT as s,ZN as t,_T as u,ST as v,RT as w,TT as x,CT as y,OT as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.