@frames.js/debugger
Version:
Debug your Frames.js applications
17 lines • 75.7 kB
JavaScript
"use strict";exports.id=4762,exports.ids=[4762],exports.modules={64717:(e,t,r)=>{r.d(t,{OP:()=>b,PS:()=>w,U_:()=>d,Us:()=>v,gN:()=>y,kK:()=>g,oA:()=>f,wQ:()=>c});var n=r(49510);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let i=BigInt(0),s=BigInt(1),o=BigInt(2),a=BigInt(3),l=BigInt(4),u=BigInt(5),h=BigInt(8);function c(e,t){let r=e%t;return r>=i?r:t+r}function f(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n}function d(e,t){if(e===i||t<=i)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=c(e,t),n=t,o=i,a=s,l=s,u=i;for(;r!==i;){let e=n/r,t=n%r,i=o-l*e,s=a-u*e;n=r,r=t,o=l,a=u,l=i,u=s}if(n!==s)throw Error("invert: does not exist");return c(o,t)}BigInt(9),BigInt(16);let p=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(e){let t=p.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.FF)(e,t)}function g(e,t){let r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function y(e,t,r=!1,f={}){if(e<=i)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:p,nByteLength:b}=g(e,t);if(b>2048)throw Error("Field lengths over 2048 bytes are not supported");let y=function(e){if(e%l===a){let t=(e+s)/l;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%h===u){let t=(e-u)/h;return function(e,r){let n=e.mul(r,o),i=e.pow(n,t),s=e.mul(r,i),a=e.mul(e.mul(s,o),i),l=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(l),r))throw Error("Cannot find square root");return l}}return function(e){let t,r,n;let a=(e-s)/o;for(t=e-s,r=0;t%o===i;t/=o,r++);for(n=o;n<e&&function(e,t,r){if(r<=i||t<i)throw Error("Expected power/modulo > 0");if(r===s)return i;let n=s;for(;t>i;)t&s&&(n=n*e%r),e=e*e%r,t>>=s;return n}(n,a,e)!==e-s;n++);if(1===r){let t=(e+s)/l;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let u=(t+s)/o;return function(e,i){if(e.pow(i,a)===e.neg(e.ONE))throw Error("Cannot find square root");let o=r,l=e.pow(e.mul(e.ONE,n),t),h=e.pow(i,u),c=e.pow(i,t);for(;!e.eql(c,e.ONE);){if(e.eql(c,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(c);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(l,s<<BigInt(o-t-1));l=e.sqr(r),h=e.mul(h,r),c=e.mul(c,l),o=t}return h}}(e)}(e),m=Object.freeze({ORDER:e,BITS:p,BYTES:b,MASK:(0,n.dQ)(p),ZERO:i,ONE:s,create:t=>c(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&s)===s,neg:t=>c(-t,e),eql:(e,t)=>e===t,sqr:t=>c(t*t,e),add:(t,r)=>c(t+r,e),sub:(t,r)=>c(t-r,e),mul:(t,r)=>c(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<i)throw Error("Expected power > 0");if(r===i)return e.ONE;if(r===s)return t;let n=e.ONE,o=t;for(;r>i;)r&s&&(n=e.mul(n,o)),o=e.sqr(o),r>>=s;return n})(m,e,t),div:(t,r)=>c(t*d(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>d(t,e),sqrt:f.sqrt||(e=>y(m,e)),invertBatch:e=>(function(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r})(m,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.S5)(e,b):(0,n.tL)(e,b),fromBytes:e=>{if(e.length!==b)throw Error(`Fp.fromBytes: expected ${b}, got ${e.length}`);return r?(0,n.ty)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(m)}function m(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function w(e){let t=m(e);return t+Math.ceil(t/2)}function v(e,t,r=!1){let i=e.length,o=m(t),a=w(t);if(i<16||i<a||i>1024)throw Error(`expected ${a}-1024 bytes of input, got ${i}`);let l=c(r?(0,n.bytesToNumberBE)(e):(0,n.ty)(e),t-s)+s;return r?(0,n.S5)(l,o):(0,n.tL)(l,o)}},43693:(e,t,r)=>{function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}r.d(t,{kA:()=>q});var o=r(6005),a=r.t(o,2);let l=a&&"object"==typeof a&&"webcrypto"in a?o.webcrypto:void 0,u=e=>e instanceof Uint8Array,h=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),c=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw Error("Non little-endian hardware is not supported");function f(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}(e)),!u(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}class d{clone(){return this._cloneInto()}}function p(e=32){if(l&&"function"==typeof l.getRandomValues)return l.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}class b extends d{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}update(e){s(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=f(e)).length;for(let s=0;s<i;){let o=Math.min(n-this.pos,i-s);if(o===n){let t=h(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){s(this),function(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:o}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;(function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;e.setUint32(t+l,o,n),e.setUint32(t+u,a,n)})(r,n-8,BigInt(8*this.length),o),this.process(r,0);let l=h(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=u/4,f=this.get();if(c>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)l.setUint32(4*e,f[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}let g=(e,t,r)=>e&t^~e&r,y=(e,t,r)=>e&t^e&r^t&r,m=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]),w=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),v=new Uint32Array(64);class x extends b{constructor(){super(64,32,8,!1),this.A=0|w[0],this.B=0|w[1],this.C=0|w[2],this.D=0|w[3],this.E=0|w[4],this.F=0|w[5],this.G=0|w[6],this.H=0|w[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)v[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=v[e-15],r=v[e-2],n=c(t,7)^c(t,18)^t>>>3,i=c(r,17)^c(r,19)^r>>>10;v[e]=i+v[e-7]+n+v[e-16]|0}let{A:r,B:n,C:i,D:s,E:o,F:a,G:l,H:u}=this;for(let e=0;e<64;e++){let t=u+(c(o,6)^c(o,11)^c(o,25))+g(o,a,l)+m[e]+v[e]|0,h=(c(r,2)^c(r,13)^c(r,22))+y(r,n,i)|0;u=l,l=a,a=o,o=s+t|0,s=i,i=n,n=r,r=t+h|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,n,i,s,o,a,l,u)}roundClean(){v.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let E=function(e){let t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}(()=>new x);var B=r(64717);class I extends d{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}(e);let r=f(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),s.fill(0)}update(e){return s(this),this.iHash.update(e),this}digestInto(e){s(this),i(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:o}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let P=(e,t,r)=>new I(e,t).update(r).digest();P.create=(e,t)=>new I(e,t);var $=r(49510);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let O=BigInt(0),A=BigInt(1);function N(e){return(0,B.OP)(e.Fp),(0,$.FF)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,B.kK)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}let{bytesToNumberBE:C,hexToBytes:U}=$,L={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){let{Err:t}=L;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");let r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:C(n),l:e.subarray(r+2)}},toSig(e){let{Err:t}=L,r="string"==typeof e?U(e):e;if(!(r instanceof Uint8Array))throw Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:i,l:s}=L._parseInt(r.subarray(2)),{d:o,l:a}=L._parseInt(s);if(a.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(e){let t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{let t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},S=BigInt(0),G=BigInt(1),j=(BigInt(2),BigInt(3)),T=(BigInt(4),BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f")),R=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),z=BigInt(1),F=BigInt(2),k=(e,t)=>(e+t/F)/t,M=(0,B.gN)(T,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),s=BigInt(23),o=BigInt(44),a=BigInt(88),l=e*e*e%T,u=l*l*e%T,h=(0,B.oA)(u,t,T)*u%T,c=(0,B.oA)(h,t,T)*u%T,f=(0,B.oA)(c,F,T)*l%T,d=(0,B.oA)(f,n,T)*f%T,p=(0,B.oA)(d,i,T)*d%T,b=(0,B.oA)(p,o,T)*p%T,g=(0,B.oA)(b,a,T)*b%T,y=(0,B.oA)(g,o,T)*p%T,m=(0,B.oA)(y,t,T)*u%T,w=(0,B.oA)(m,s,T)*d%T,v=(0,B.oA)(w,r,T)*l%T,x=(0,B.oA)(v,F,T);if(!M.eql(M.sqr(x),e))throw Error("Cannot find square root");return x}}),q=function(e,t){let r=t=>(function(e){let t=function(e){let t=N(e);return $.FF(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n}=t,i=r.BYTES+1,s=2*r.BYTES+1;function o(e){return B.wQ(e,n)}function a(e){return B.U_(e,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:h,isWithinCurveOrder:c}=function(e){let t=/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function(e){let t=N(e);$.FF(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{let i=t.toAffine();return $.eV(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){let{a:n,b:i}=t,s=r.sqr(e),o=r.mul(s,e);return r.add(r.add(o,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw Error("bad generator point: equation left != right");function o(e){return"bigint"==typeof e&&S<e&&e<t.n}function a(e){if(!o(e))throw Error("Expected valid bigint: 0 < bigint < curve.n")}function l(e){let r;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:s,n:o}=t;if(n&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=$.ci(e)),"string"!=typeof e||!n.includes(e.length))throw Error("Invalid key");e=e.padStart(2*i,"0")}try{r="bigint"==typeof e?e:$.bytesToNumberBE((0,$.ql)("private key",e,i))}catch(t){throw Error(`private key must be ${i} bytes, hex or bigint, not ${typeof e}`)}return s&&(r=B.wQ(r,o)),a(r),r}let u=new Map;function h(e){if(!(e instanceof c))throw Error("ProjectivePoint expected")}class c{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw Error("x required");if(null==t||!r.isValid(t))throw Error("y required");if(null==n||!r.isValid(n))throw Error("z required")}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error("invalid affine point");if(e instanceof c)throw Error("projective point not allowed");let i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?c.ZERO:new c(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(c.fromAffine)}static fromHex(e){let t=c.fromAffine(i((0,$.ql)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return c.BASE.multiply(l(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),o=s(e);if(!r.eql(i,o))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){h(e);let{px:t,py:n,pz:i}=this,{px:s,py:o,pz:a}=e,l=r.eql(r.mul(t,a),r.mul(s,i)),u=r.eql(r.mul(n,a),r.mul(o,i));return l&&u}negate(){return new c(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,j),{px:s,py:o,pz:a}=this,l=r.ZERO,u=r.ZERO,h=r.ZERO,f=r.mul(s,s),d=r.mul(o,o),p=r.mul(a,a),b=r.mul(s,o);return b=r.add(b,b),h=r.mul(s,a),h=r.add(h,h),l=r.mul(e,h),u=r.mul(i,p),u=r.add(l,u),l=r.sub(d,u),u=r.add(d,u),u=r.mul(l,u),l=r.mul(b,l),h=r.mul(i,h),p=r.mul(e,p),b=r.sub(f,p),b=r.mul(e,b),b=r.add(b,h),h=r.add(f,f),f=r.add(h,f),f=r.add(f,p),f=r.mul(f,b),u=r.add(u,f),p=r.mul(o,a),p=r.add(p,p),f=r.mul(p,b),l=r.sub(l,f),h=r.mul(p,d),h=r.add(h,h),new c(l,u,h=r.add(h,h))}add(e){h(e);let{px:n,py:i,pz:s}=this,{px:o,py:a,pz:l}=e,u=r.ZERO,f=r.ZERO,d=r.ZERO,p=t.a,b=r.mul(t.b,j),g=r.mul(n,o),y=r.mul(i,a),m=r.mul(s,l),w=r.add(n,i),v=r.add(o,a);w=r.mul(w,v),v=r.add(g,y),w=r.sub(w,v),v=r.add(n,s);let x=r.add(o,l);return v=r.mul(v,x),x=r.add(g,m),v=r.sub(v,x),x=r.add(i,s),u=r.add(a,l),x=r.mul(x,u),u=r.add(y,m),x=r.sub(x,u),d=r.mul(p,v),u=r.mul(b,m),d=r.add(u,d),u=r.sub(y,d),d=r.add(y,d),f=r.mul(u,d),y=r.add(g,g),y=r.add(y,g),m=r.mul(p,m),v=r.mul(b,v),y=r.add(y,m),m=r.sub(g,m),m=r.mul(p,m),v=r.add(v,m),g=r.mul(y,v),f=r.add(f,g),g=r.mul(x,v),u=r.mul(w,u),u=r.sub(u,g),g=r.mul(w,y),d=r.mul(x,d),new c(u,f,d=r.add(d,g))}subtract(e){return this.add(e.negate())}is0(){return this.equals(c.ZERO)}wNAF(e){return d.wNAFCached(this,u,e,e=>{let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(c.fromAffine)})}multiplyUnsafe(e){let n=c.ZERO;if(e===S)return n;if(a(e),e===G)return this;let{endo:i}=t;if(!i)return d.unsafeLadder(this,e);let{k1neg:s,k1:o,k2neg:l,k2:u}=i.splitScalar(e),h=n,f=n,p=this;for(;o>S||u>S;)o&G&&(h=h.add(p)),u&G&&(f=f.add(p)),p=p.double(),o>>=G,u>>=G;return s&&(h=h.negate()),l&&(f=f.negate()),f=new c(r.mul(f.px,i.beta),f.py,f.pz),h.add(f)}multiply(e){let n,i;a(e);let{endo:s}=t;if(s){let{k1neg:t,k1:o,k2neg:a,k2:l}=s.splitScalar(e),{p:u,f:h}=this.wNAF(o),{p:f,f:p}=this.wNAF(l);u=d.constTimeNegate(t,u),f=d.constTimeNegate(a,f),f=new c(r.mul(f.px,s.beta),f.py,f.pz),n=u.add(f),i=h.add(p)}else{let{p:t,f:r}=this.wNAF(e);n=t,i=r}return c.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=c.BASE,i=(e,t)=>t!==S&&t!==G&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){let{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));let o=r.mul(t,e),a=r.mul(n,e),l=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===G)return!0;if(r)return r(c,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===G?this:r?r(c,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(c,this,e)}toHex(e=!0){return $.ci(this.toRawBytes(e))}}c.BASE=new c(t.Gx,t.Gy,r.ONE),c.ZERO=new c(r.ZERO,r.ONE,r.ZERO);let f=t.nBitLength,d=function(e,t){let r=(e,t)=>{let r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>O;)r&A&&(n=n.add(i)),i=i.double(),r>>=A;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),s=[],o=e,a=o;for(let e=0;e<r;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(t,i,s){let{windows:o,windowSize:a}=n(t),l=e.ZERO,u=e.BASE,h=BigInt(2**t-1),c=2**t,f=BigInt(t);for(let e=0;e<o;e++){let t=e*a,n=Number(s&h);s>>=f,n>a&&(n-=c,s+=A);let o=t+Math.abs(n)-1,d=e%2!=0,p=n<0;0===n?u=u.add(r(d,i[t])):l=l.add(r(p,i[o]))}return{p:l,f:u}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}}(c,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:c,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}({...t,toBytes(e,t,n){let i=t.toAffine(),s=r.toBytes(i.x),o=$.eV;return n?o(Uint8Array.from([t.hasEvenY()?2:3]),s):o(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],o=e.subarray(1);if(t===i&&(2===n||3===n)){let e=$.bytesToNumberBE(o);if(!(S<e&&e<r.ORDER))throw Error("Point is not on curve");let t=h(e),i=r.sqrt(t);return(1&n)==1!=((i&G)===G)&&(i=r.neg(i)),{x:e,y:i}}if(t===s&&4===n)return{x:r.fromBytes(o.subarray(0,r.BYTES)),y:r.fromBytes(o.subarray(r.BYTES,2*r.BYTES))};throw Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),f=e=>$.ci($.tL(e,t.nByteLength)),d=(e,t,r)=>$.bytesToNumberBE(e.slice(t,r));class p{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){let r=t.nByteLength;return new p(d(e=(0,$.ql)("compactSignature",e,2*r),0,r),d(e,r,2*r))}static fromDER(e){let{r:t,s:r}=L.toSig((0,$.ql)("DER",e));return new p(t,r)}assertValidity(){if(!c(this.r))throw Error("r must be 0 < r < CURVE.n");if(!c(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new p(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:i,recovery:s}=this,u=y((0,$.ql)("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let h=2===s||3===s?n+t.n:n;if(h>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let c=(1&s)==0?"02":"03",d=l.fromHex(c+f(h)),p=a(h),b=o(-u*p),g=o(i*p),m=l.BASE.multiplyAndAddUnsafe(d,b,g);if(!m)throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>n>>G}normalizeS(){return this.hasHighS()?new p(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return $.hexToBytes(this.toDERHex())}toDERHex(){return L.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $.hexToBytes(this.toCompactHex())}toCompactHex(){return f(this.r)+f(this.s)}}function b(e){let t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===i||n===s:r?n===2*i||n===2*s:e instanceof l}let g=t.bits2int||function(e){let r=$.bytesToNumberBE(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},y=t.bits2int_modN||function(e){return o(g(e))},m=$.dQ(t.nBitLength);function w(e){if("bigint"!=typeof e)throw Error("bigint expected");if(!(S<=e&&e<m))throw Error(`bigint expected < 2^${t.nBitLength}`);return $.tL(e,t.nByteLength)}let v={lowS:t.lowS,prehash:!1},x={lowS:t.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return l.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(b(e))throw Error("first arg must be private key");if(!b(t))throw Error("second arg must be public key");return l.fromHex(t).multiply(u(e)).toRawBytes(r)},sign:function(e,i,s=v){let{seed:h,k2sig:f}=function(e,i,s=v){if(["recovered","canonical"].some(e=>e in s))throw Error("sign() legacy options not supported");let{hash:h,randomBytes:f}=t,{lowS:d,prehash:b,extraEntropy:m}=s;null==d&&(d=!0),e=(0,$.ql)("msgHash",e),b&&(e=(0,$.ql)("prehashed msgHash",h(e)));let x=y(e),E=u(i),B=[w(E),w(x)];if(null!=m){let e=!0===m?f(r.BYTES):m;B.push((0,$.ql)("extraEntropy",e))}return{seed:$.eV(...B),k2sig:function(e){let t=g(e);if(!c(t))return;let r=a(t),i=l.BASE.multiply(t).toAffine(),s=o(i.x);if(s===S)return;let u=o(r*o(x+s*E));if(u===S)return;let h=(i.x===s?0:2)|Number(i.y&G),f=u;if(d&&u>n>>G)f=u>n>>G?o(-u):u,h^=1;return new p(s,f,h)}}}(e,i,s);return $.n$(t.hash.outputLen,t.nByteLength,t.hmac)(h,f)},verify:function(e,r,n,i=x){let s,u;if(r=(0,$.ql)("msgHash",r),n=(0,$.ql)("publicKey",n),"strict"in i)throw Error("options.strict was renamed to lowS");let{lowS:h,prehash:c}=i;try{if("string"==typeof e||e instanceof Uint8Array)try{u=p.fromDER(e)}catch(t){if(!(t instanceof L.Err))throw t;u=p.fromCompact(e)}else if("object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s){let{r:t,s:r}=e;u=new p(t,r)}else throw Error("PARSE");s=l.fromHex(n)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(h&&u.hasHighS())return!1;c&&(r=t.hash(r));let{r:f,s:d}=u,b=y(r),g=a(d),m=o(b*g),w=o(f*g),v=l.BASE.multiplyAndAddUnsafe(s,m,w)?.toAffine();return!!v&&o(v.x)===f},ProjectivePoint:l,Signature:p,utils:{isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let e=B.PS(t.n);return B.Us(t.randomBytes(e),t.n)},precompute:(e=8,t=l.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,hash:t,hmac:(e,...r)=>P(t,e,function(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;return e.forEach(e=>{if(!u(e))throw Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}(...r)),randomBytes:p});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:M,n:R,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-z*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),s=k(t*e,R),o=k(-r*e,R),a=(0,B.wQ)(e-s*t-o*n,R),l=(0,B.wQ)(-s*r-o*t,R),u=a>i,h=l>i;if(u&&(a=R-a),h&&(l=R-l),a>i||l>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:u,k1:a,k2neg:h,k2:l}}}},E);BigInt(0),q.ProjectivePoint},7233:(e,t,r)=>{r.d(t,{lc:()=>n});let n=1},41677:(e,t,r)=>{r.d(t,{Zn:()=>i,ez:()=>n});let n={gwei:9,wei:18},i={ether:-9,wei:9}},61094:(e,t,r)=>{r.d(t,{CI:()=>I,FM:()=>p,Gy:()=>E,KY:()=>v,M4:()=>c,MX:()=>m,S4:()=>w,SM:()=>x,cO:()=>a,dh:()=>B,fM:()=>o,fs:()=>f,gr:()=>h,hn:()=>P,lC:()=>b,mv:()=>g,wM:()=>$,wb:()=>u,xB:()=>l,xL:()=>y,yP:()=>d});var n=r(40486),i=r(33774),s=r(71645);class o extends s.G{constructor({docsPath:e}){super("A constructor was not found on the ABI.\nMake sure you are using the correct ABI and that the constructor exists on it.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class a extends s.G{constructor({docsPath:e}){super("Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.\nMake sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class l extends s.G{constructor({data:e,params:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,n.h)(t,{includeName:!0})})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class u extends s.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class h extends s.G{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
Expected length: ${e}
Given length: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class c extends s.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.d)(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class f extends s.G{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
Expected length (params): ${e}
Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class d extends s.G{constructor(e,{docsPath:t}){super(`Encoded error signature "${e}" not found on ABI.
Make sure you are using the correct ABI and that the error exists on it.
You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class p extends s.G{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class b extends s.G{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI.
Make sure you are using the correct ABI and that the event exists on it.
You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class g extends s.G{constructor(e,{docsPath:t}={}){super(`Event ${e?`"${e}" `:""}not found on ABI.
Make sure you are using the correct ABI and that the event exists on it.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class y extends s.G{constructor(e,{docsPath:t}={}){super(`Function ${e?`"${e}" `:""}not found on ABI.
Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class m extends s.G{constructor(e,{docsPath:t}){super(`Function "${e}" does not contain any \`outputs\` on ABI.
Cannot decode function result without knowing what the parameter types are.
Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class w extends s.G{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,n.t)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,n.t)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class v extends s.G{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class x extends s.G{constructor({abiItem:e,data:t,params:r,size:i}){super(`Data size of ${i} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,n.h)(r,{includeName:!0})})`,`Data: ${t} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class E extends s.G{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.t)(e,{includeName:!0})}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class B extends s.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
Please provide a valid ABI type.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class I extends s.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type.
Please provide a valid ABI type.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class P extends s.G{constructor(e){super(`Value "${e}" is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class $ extends s.G{constructor(e){super(`"${e}" is not a valid definition type.
Valid types: "function", "event", "error"`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}},32586:(e,t,r)=>{r.d(t,{b:()=>i});var n=r(71645);class i extends n.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},92754:(e,t,r)=>{r.d(t,{RX:()=>o,cJ:()=>l,m7:()=>s,xd:()=>a});var n=r(7233),i=r(71645);class s extends i.G{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class o extends i.G{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class a extends i.G{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class l extends i.G{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${n.lc}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}},88167:(e,t,r)=>{r.d(t,{Bk:()=>o,Yl:()=>s,hJ:()=>l,mm:()=>i,pZ:()=>a});var n=r(71645);class i extends n.G{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class s extends n.G{constructor({chain:e,currentChainId:t}){super(`The current chain of the wallet (id: ${t}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class o extends n.G{constructor(){super("No chain was provided to the request.\nPlease provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class a extends n.G{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class l extends n.G{constructor({chainId:e}){super("number"==typeof e?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}},99736:(e,t,r)=>{r.d(t,{KD:()=>o,T_:()=>i,lQ:()=>s});var n=r(71645);class i extends n.G{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class s extends n.G{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class o extends n.G{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}},58192:(e,t,r)=>{r.d(t,{C_:()=>c,G$:()=>a,Hh:()=>o,M_:()=>s,WF:()=>f,ZI:()=>l,cj:()=>g,cs:()=>b,dR:()=>d,pZ:()=>p,se:()=>h,vU:()=>u});var n=r(31277),i=r(71645);class s extends i.G{constructor({cause:e,message:t}={}){let r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class o extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class a extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class l extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class u extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.
Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class h extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class c extends i.G{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class f extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class d extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class p extends i.G{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class b extends i.G{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.o)(r)} gwei`:""}).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(b,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class g extends i.G{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}},42266:(e,t,r)=>{r.d(t,{Bh:()=>f,JC:()=>h,Yb:()=>d,j3:()=>u,mc:()=>p,mk:()=>c,vl:()=>l,xY:()=>a,xr:()=>o});var n=r(36733),i=r(31277),s=r(71645);function o(e){let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>` ${`${e}:`.padEnd(r+1)} ${t}`).join("\n")}class a extends s.G{constructor(){super("Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.\nUse `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class l extends s.G{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class u extends s.G{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",o(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class h extends s.G{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class c extends s.G{constructor(e,{account:t,docsPath:r,chain:s,data:a,gas:l,gasPrice:u,maxFeePerGas:h,maxPriorityFeePerGas:c,nonce:f,to:d,value:p}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",o({chain:s&&`${s?.name} (id: ${s?.id})`,from:t?.address,to:d,value:void 0!==p&&`${(0,n.d)(p)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:l,gasPrice:void 0!==u&&`${(0,i.o)(u)} gwei`,maxFeePerGas:void 0!==h&&`${(0,i.o)(h)} gwei`,maxPriorityFeePerGas:void 0!==c&&`${(0,i.o)(c)} gwei`,nonce:f})].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class f extends s.G{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let s="Transaction";r&&void 0!==i&&(s=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(s=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(s=`Transaction at block number "${t}" at index "${i}"`),n&&(s=`Transaction with hash "${n}"`),super(`${s} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class d extends s.G{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class p extends s.G{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}},56659:(e,t,r)=>{r.d(t,{E:()=>f,S:()=>p});var n=r(61094),i=r(32586),s=r(71645),o=r(8345),a=r(70395),l=r(92415),u=r(33774),h=r(39804),c=r(70451);function f(e,t){if(e.length!==t.length)throw new n.fs({expectedLength:e.length,givenLength:t.length});let r=d(function({params:e,values:t}){let r=[];for(let f=0;f<e.length;f++)r.push(function e({param:t,value:r}){let f=p(t.type);if(f){let[i,s]=f;return function(t,{length:r,param:i}){let s=null===r;if(!Array.isArray(t))throw new n.hn(t);if(!s&&t.length!==r)throw new n.gr({expectedLength:r,givenLength:t.length,type:`${i.type}[${r}]`});let o=!1,l=[];for(let r=0;r<t.length;r++){let n=e({param:i,value:t[r]});n.dynamic&&(o=!0),l.push(n)}if(s||o){let e=d(l);if(s){let t=(0,c.eC)(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?(0,a.zo)([t,e]):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,a.zo)(l.map(({encoded:e})=>e))}}(r,{length:i,param:{...t,type:s}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,i=[];for(let s=0;s<r.components.length;s++){let o=r.components[s],a=Array.isArray(t)?s:o.name,l=e({param:o,value:t[a]});i.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?d(i):(0,a.zo)(i.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type)return function(e){if(!(0,o.U)(e))throw new i.b({address:e});return{dynamic:!1,encoded:(0,l.gc)(e.toLowerCase())}}(r);if("bool"===t.type)return function(e){if("boolean"!=typeof e)throw new s.G(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,l.gc)((0,c.C4)(e))}}(r);if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(e,{signed:t}){return{dynamic:!1,encoded:(0,c.eC)(e,{size:32,signed:t})}}(r,{signed:t.type.startsWith("int")});if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),i=(0,u.d)(e);if(!r){let t=e;return i%32!=0&&(t=(0,l.gc)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,a.zo)([(0,l.gc)((0,c.eC)(i,{size:32})),t])}}if(i!==Number.parseInt(r))throw new n.M4({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:(0,l.gc)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type)return function(e){let t=(0,c.$G)(e),r=Math.ceil((0,u.d)(t)/32),n=[];for(let e=0;e<r;e++)n.push((0,l.gc)((0,h.tP)(t,32*e,(e+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,a.zo)([(0,l.gc)((0,c.eC)((0,u.d)(t),{size:32})),...n])}}(r);throw new n.dh(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[f],value:t[f]}));return r}({params:e,values:t}));return 0===r.length?"0x":r}function d(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=(0,u.d)(i)}let r=[],n=[],i=0;for(let s=0;s<e.length;s++){let{dynamic:o,encoded:a}=e[s];o?(r.push((0,c.eC)(t+i,{size:32})),n.push(a),i+=(0,u.d)(a)):r.push(a)}return(0,a.zo)([...r,...n])}function p(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}},40486:(e,t,r)=>{r.d(t,{h:()=>s,t:()=>i});var n=r(61094);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.wM(e.type);return`${e.name}(${s(e.inputs,{includeName:t})})`}function s(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${s(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},92795:(e,t,r)=>{r.d(t,{Kn:()=>h,xs:()=>u});var n=r(32586),i=r(26532),s=r(85924),o=r(46872),a=r(8345);let l=new o.k(8192);function u(e,t){if(l.has(`${e}.${t}`))return l.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,s.w)((0,i.qX)(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&o[e]&&(o[e]=o[e].toUpperCase()),(15&n[e>>1])>=8&&o[e+1]&&(o[e+1]=o[e+1].toUpperCase());let a=`0x${o.j