superstack-wallet-sdk 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/src/client.js +1 -1
- package/dist/esm/src/client.js.map +1 -1
- package/dist/esm/src/types.js.map +1 -1
- package/dist/esm/types/client.d.ts +17 -0
- package/dist/esm/types/types.d.ts +26 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +44 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -9,7 +9,7 @@ const Sl=BigInt(0),Nl=BigInt(1);function Tl(e,t){const n=t.negate();return e?n:t
|
|
|
9
9
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ll(e){void 0!==e.lowS&&aa("lowS",e.lowS),void 0!==e.prehash&&aa("prehash",e.prehash)}class Fl extends Error{constructor(e=""){super(e)}}const jl={Err:Fl,_tlv:{encode:(e,t)=>{const{Err:n}=jl;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(1&t.length)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=ia(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?ia(o.length/2|128):"";return ia(e)+s+o+t},decode(e,t){const{Err:n}=jl;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++];let s=0;if(!!(128&o)){const e=127&o;if(!e)throw new n("tlv.decode(long): indefinite length not supported");if(e>4)throw new n("tlv.decode(long): byte length is too big");const a=t.subarray(r,r+e);if(a.length!==e)throw new n("tlv.decode: length bytes not complete");if(0===a[0])throw new n("tlv.decode(long): zero leftmost byte");for(const e of a)s=s<<8|e;if(r+=e,s<128)throw new n("tlv.decode(long): not minimal encoding")}else s=o;const a=t.subarray(r,r+s);if(a.length!==s)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+s)}}},_int:{encode(e){const{Err:t}=jl;if(e<Dl)throw new t("integer: negative integers are not allowed");let n=ia(e);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=jl;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return va(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=jl,o=ka("signature",e),{v:s,l:a}=r.decode(48,o);if(a.length)throw new t("invalid signature: left bytes after parsing");const{v:i,l:c}=r.decode(2,s),{v:u,l:l}=r.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(i),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=jl,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};function Ul(e,t){return da(Ea(e,t))}const Dl=BigInt(0),Gl=BigInt(1);BigInt(2);const ql=BigInt(3),Vl=BigInt(4);function Wl(e){const t=function(e){const t=Ml(e);Oa(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=t,r=kl(t.n,t.nBitLength),o=t.toBytes||((e,t,r)=>{const o=t.toAffine();return Aa(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),s=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){const{a:r,b:o}=t,s=n.sqr(e),a=n.mul(s,e);return n.add(n.add(a,n.mul(e,r)),o)}function i(e,t){const r=n.sqr(t),o=a(e);return n.eql(r,o)}if(!i(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const c=n.mul(n.pow(t.a,ql),Vl),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(c,u)))throw new Error("bad curve params: a or b");function l(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:s}=t;if(n&&"bigint"!=typeof e){if(oa(e)&&(e=da(e)),"string"!=typeof e||!n.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*r,"0")}let a;try{a="bigint"==typeof e?e:va(ka("private key",e,r))}catch(t){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof e)}return o&&(a=pl(a,s)),Na("private key",a,Gl,s),a}function d(e){if(!(e instanceof p))throw new Error("ProjectivePoint expected")}const f=_a((e,t)=>{const{px:r,py:o,pz:s}=e;if(n.eql(s,n.ONE))return{x:r,y:o};const a=e.is0();null==t&&(t=a?n.ONE:n.inv(s));const i=n.mul(r,t),c=n.mul(o,t),u=n.mul(s,t);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:i,y:c}}),h=_a(e=>{if(e.is0()){if(t.allowInfinityPoint&&!n.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=e.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not FE");if(!i(r,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class p{constructor(e,t,r){if(null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof p)throw new Error("projective point not allowed");const o=e=>n.eql(e,n.ZERO);return o(t)&&o(r)?p.ZERO:new p(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=xl(n,e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(p.fromAffine)}static fromHex(e){const t=p.fromAffine(s(ka("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return p.BASE.multiply(l(e))}static msm(e,t){return zl(p,r,e,t)}_setWindowSize(e){b.setWindowSize(this,e)}assertValidity(){h(this)}hasEvenY(){const{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){d(e);const{px:t,py:r,pz:o}=this,{px:s,py:a,pz:i}=e,c=n.eql(n.mul(t,i),n.mul(s,o)),u=n.eql(n.mul(r,i),n.mul(a,o));return c&&u}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){const{a:e,b:r}=t,o=n.mul(r,ql),{px:s,py:a,pz:i}=this;let c=n.ZERO,u=n.ZERO,l=n.ZERO,d=n.mul(s,s),f=n.mul(a,a),h=n.mul(i,i),m=n.mul(s,a);return m=n.add(m,m),l=n.mul(s,i),l=n.add(l,l),c=n.mul(e,l),u=n.mul(o,h),u=n.add(c,u),c=n.sub(f,u),u=n.add(f,u),u=n.mul(c,u),c=n.mul(m,c),l=n.mul(o,l),h=n.mul(e,h),m=n.sub(d,h),m=n.mul(e,m),m=n.add(m,l),l=n.add(d,d),d=n.add(l,d),d=n.add(d,h),d=n.mul(d,m),u=n.add(u,d),h=n.mul(a,i),h=n.add(h,h),d=n.mul(h,m),c=n.sub(c,d),l=n.mul(h,f),l=n.add(l,l),l=n.add(l,l),new p(c,u,l)}add(e){d(e);const{px:r,py:o,pz:s}=this,{px:a,py:i,pz:c}=e;let u=n.ZERO,l=n.ZERO,f=n.ZERO;const h=t.a,m=n.mul(t.b,ql);let g=n.mul(r,a),b=n.mul(o,i),y=n.mul(s,c),w=n.add(r,o),v=n.add(a,i);w=n.mul(w,v),v=n.add(g,b),w=n.sub(w,v),v=n.add(r,s);let x=n.add(a,c);return v=n.mul(v,x),x=n.add(g,y),v=n.sub(v,x),x=n.add(o,s),u=n.add(i,c),x=n.mul(x,u),u=n.add(b,y),x=n.sub(x,u),f=n.mul(h,v),u=n.mul(m,y),f=n.add(u,f),u=n.sub(b,f),f=n.add(b,f),l=n.mul(u,f),b=n.add(g,g),b=n.add(b,g),y=n.mul(h,y),v=n.mul(m,v),b=n.add(b,y),y=n.sub(g,y),y=n.mul(h,y),v=n.add(v,y),g=n.mul(b,v),l=n.add(l,g),g=n.mul(x,v),u=n.mul(w,u),u=n.sub(u,g),g=n.mul(w,b),f=n.mul(x,f),f=n.add(f,g),new p(u,l,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(p.ZERO)}wNAF(e){return b.wNAFCached(this,e,p.normalizeZ)}multiplyUnsafe(e){const{endo:r,n:o}=t;Na("scalar",e,Dl,o);const s=p.ZERO;if(e===Dl)return s;if(this.is0()||e===Gl)return this;if(!r||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,e,p.normalizeZ);let{k1neg:a,k1:i,k2neg:c,k2:u}=r.splitScalar(e),l=s,d=s,f=this;for(;i>Dl||u>Dl;)i&Gl&&(l=l.add(f)),u&Gl&&(d=d.add(f)),f=f.double(),i>>=Gl,u>>=Gl;return a&&(l=l.negate()),c&&(d=d.negate()),d=new p(n.mul(d.px,r.beta),d.py,d.pz),l.add(d)}multiply(e){const{endo:r,n:o}=t;let s,a;if(Na("scalar",e,Gl,o),r){const{k1neg:t,k1:o,k2neg:i,k2:c}=r.splitScalar(e);let{p:u,f:l}=this.wNAF(o),{p:d,f:f}=this.wNAF(c);u=b.constTimeNegate(t,u),d=b.constTimeNegate(i,d),d=new p(n.mul(d.px,r.beta),d.py,d.pz),s=u.add(d),a=l.add(f)}else{const{p:t,f:n}=this.wNAF(e);s=t,a=n}return p.normalizeZ([s,a])[0]}multiplyAndAddUnsafe(e,t,n){const r=p.BASE,o=(e,t)=>t!==Dl&&t!==Gl&&e.equals(r)?e.multiply(t):e.multiplyUnsafe(t),s=o(this,t).add(o(e,n));return s.is0()?void 0:s}toAffine(e){return f(this,e)}isTorsionFree(){const{h:e,isTorsionFree:n}=t;if(e===Gl)return!0;if(n)return n(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:n}=t;return e===Gl?this:n?n(p,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return aa("isCompressed",e),this.assertValidity(),o(p,this,e)}toHex(e=!0){return aa("isCompressed",e),da(this.toRawBytes(e))}}p.BASE=new p(t.Gx,t.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);const{endo:m,nBitLength:g}=t,b=(y=p,w=m?Math.ceil(g/2):g,{constTimeNegate:Tl,hasPrecomputes:e=>1!==Rl(e),unsafeLadder(e,t,n=y.ZERO){let r=e;for(;t>Sl;)t&Nl&&(n=n.add(r)),r=r.double(),t>>=Nl;return n},precomputeWindow(e,t){const{windows:n,windowSize:r}=Bl(t,w),o=[];let s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<r;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,t,n){let r=y.ZERO,o=y.BASE;const s=Bl(e,w);for(let e=0;e<s.windows;e++){const{nextN:a,offset:i,isZero:c,isNeg:u,isNegF:l,offsetF:d}=Cl(n,e,s);n=a,c?o=o.add(Tl(l,t[d])):r=r.add(Tl(u,t[i]))}return{p:r,f:o}},wNAFUnsafe(e,t,n,r=y.ZERO){const o=Bl(e,w);for(let e=0;e<o.windows&&n!==Sl;e++){const{nextN:s,offset:a,isZero:i,isNeg:c}=Cl(n,e,o);if(n=s,!i){const e=t[a];r=r.add(c?e.negate():e)}}return r},getPrecomputes(e,t,n){let r=Ol.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&Ol.set(t,n(r))),r},wNAFCached(e,t,n){const r=Rl(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const o=Rl(e);return 1===o?this.unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)},setWindowSize(e,t){$l(t,w),_l.set(e,t),Ol.delete(e)}});var y,w;return{CURVE:t,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function(e){return Sa(e,Gl,t.n)}}}function Hl(e){const t=function(e){const t=Ml(e);return Oa(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,a=n.BYTES+1,i=2*n.BYTES+1;function c(e){return pl(e,r)}function u(e){return gl(e,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=Wl({...t,toBytes(e,t,r){const o=t.toAffine(),s=n.toBytes(o.x),a=Aa;return aa("isCompressed",r),r?a(Uint8Array.from([t.hasEvenY()?2:3]),s):a(Uint8Array.from([4]),s,n.toBytes(o.y))},fromBytes(e){const t=e.length,r=e[0],o=e.subarray(1);if(t!==a||2!==r&&3!==r){if(t===i&&4===r){return{x:n.fromBytes(o.subarray(0,n.BYTES)),y:n.fromBytes(o.subarray(n.BYTES,2*n.BYTES))}}throw new Error("invalid Point, expected length of "+a+", or uncompressed "+i+", got "+t)}{const e=va(o);if(!Sa(e,Gl,n.ORDER))throw new Error("Point is not on curve");const t=f(e);let s;try{s=n.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~r)!==((s&Gl)===Gl)&&(s=n.neg(s)),{x:e,y:s}}}});function p(e){return e>r>>Gl}const m=(e,t,n)=>va(e.slice(t,n));class g{constructor(e,t,n){Na("r",e,Gl,r),Na("s",t,Gl,r),this.r=e,this.s=t,null!=n&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){const t=o;return e=ka("compactSignature",e,2*t),new g(m(e,0,t),m(e,t,2*t))}static fromDER(e){const{r:t,s:n}=jl.toSig(ka("DER",e));return new g(t,n)}assertValidity(){}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r:r,s:o,recovery:s}=this,a=v(ka("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const i=2===s||3===s?r+t.n:r;if(i>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const d=1&s?"03":"02",f=l.fromHex(d+Ul(i,n.BYTES)),h=u(i),p=c(-a*h),m=c(o*h),g=l.BASE.multiplyAndAddUnsafe(f,p,m);if(!g)throw new Error("point at infinify");return g.assertValidity(),g}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return wa(this.toDERHex())}toDERHex(){return jl.hexFromSig(this)}toCompactRawBytes(){return wa(this.toCompactHex())}toCompactHex(){const e=o;return Ul(this.r,e)+Ul(this.s,e)}}const b={isValidPrivateKey(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const e=Il(t.n);return function(e,t,n=!1){const r=e.length,o=Al(t),s=Il(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const a=pl(n?xa(e):va(e),t-cl)+cl;return n?Pa(a,o):Ea(a,o)}(t.randomBytes(e),t.n)},precompute:(e=8,t=l.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){if("bigint"==typeof e)return!1;if(e instanceof l)return!0;const r=ka("key",e).length,s=n.BYTES,a=s+1,i=2*s+1;return t.allowedPrivateKeyLengths||o===a?void 0:r===a||r===i}const w=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=va(e),n=8*e.length-s;return n>0?t>>BigInt(n):t},v=t.bits2int_modN||function(e){return c(w(e))},x=Ta(s);function E(e){return Na("num < 2^"+s,e,Dl,x),Ea(e,o)}function P(e,r,o=k){if(["recovered","canonical"].some(e=>e in o))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:a}=t;let{lowS:i,prehash:f,extraEntropy:m}=o;null==i&&(i=!0),e=ka("msgHash",e),Ll(o),f&&(e=ka("prehashed msgHash",s(e)));const b=v(e),y=d(r),x=[E(y),E(b)];if(null!=m&&!1!==m){const e=!0===m?a(n.BYTES):m;x.push(ka("extraEntropy",e))}const P=Aa(...x),A=b;return{seed:P,k2sig:function(e){const t=w(e);if(!h(t))return;const n=u(t),r=l.BASE.multiply(t).toAffine(),o=c(r.x);if(o===Dl)return;const s=c(n*c(A+o*y));if(s===Dl)return;let a=(r.x===o?0:2)|Number(r.y&Gl),d=s;return i&&p(s)&&(d=function(e){return p(e)?c(-e):e}(s),a^=1),new g(o,d,a)}}}const k={lowS:t.lowS,prehash:!1},A={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,n=!0){if(!0===y(e))throw new Error("first arg must be private key");if(!1===y(t))throw new Error("second arg must be public key");return l.fromHex(t).multiply(d(e)).toRawBytes(n)},sign:function(e,n,r=k){const{seed:o,k2sig:s}=P(e,n,r),a=t,i=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=$a(e),o=$a(e),s=0;const a=()=>{r.fill(1),o.fill(0),s=0},i=(...e)=>n(o,r,...e),c=(e=$a(0))=>{o=i(Ba([0]),e),r=i(),0!==e.length&&(o=i(Ba([1]),e),r=i())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=i();const t=r.slice();n.push(t),e+=r.length}return Aa(...n)};return(e,t)=>{let n;for(a(),c(e);!(n=t(u()));)c();return a(),n}}(a.hash.outputLen,a.nByteLength,a.hmac);return i(o,s)},verify:function(e,n,r,o=A){const s=e;n=ka("msgHash",n),r=ka("publicKey",r);const{lowS:a,prehash:i,format:d}=o;if(Ll(o),"strict"in o)throw new Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw new Error("format must be compact or der");const f="string"==typeof s||oa(s),h=!f&&!d&&"object"==typeof s&&null!==s&&"bigint"==typeof s.r&&"bigint"==typeof s.s;if(!f&&!h)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let p,m;try{if(h&&(p=new g(s.r,s.s)),f){try{"compact"!==d&&(p=g.fromDER(s))}catch(e){if(!(e instanceof jl.Err))throw e}p||"der"===d||(p=g.fromCompact(s))}m=l.fromHex(r)}catch(e){return!1}if(!p)return!1;if(a&&p.hasHighS())return!1;i&&(n=t.hash(n));const{r:b,s:y}=p,w=v(n),x=u(y),E=c(w*x),P=c(b*x),k=l.BASE.multiplyAndAddUnsafe(m,E,P)?.toAffine();return!!k&&c(k.x)===b},ProjectivePoint:l,Signature:g,utils:b}}
|
|
10
10
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Yl(e){return{hash:e,hmac:(t,...n)=>al(e,t,function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];sn(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const o=e[t];n.set(o,r),r+=o.length}return n}(...n)),randomBytes:bn}}
|
|
11
11
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
12
|
-
const Zl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Kl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Jl=BigInt(0),Ql=BigInt(1),Xl=BigInt(2),ed=(e,t)=>(e+t/Xl)/t;const td=kl(Zl,void 0,void 0,{sqrt:function(e){const t=Zl,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),i=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=ml(l,n,t)*l%t,f=ml(d,n,t)*l%t,h=ml(f,Xl,t)*u%t,p=ml(h,o,t)*h%t,m=ml(p,s,t)*p%t,g=ml(m,i,t)*m%t,b=ml(g,c,t)*g%t,y=ml(b,i,t)*m%t,w=ml(y,n,t)*l%t,v=ml(w,a,t)*p%t,x=ml(v,r,t)*u%t,E=ml(x,Xl,t);if(!td.eql(td.sqr(E),e))throw new Error("Cannot find square root");return E}}),nd=function(e,t){const n=t=>Hl({...e,...Yl(t)});return{...n(t),create:n}}({a:Jl,b:BigInt(7),Fp:td,n:Kl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Kl,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ql*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),i=ed(s*e,t),c=ed(-r*e,t);let u=pl(e-i*n-c*o,t),l=pl(-i*r-c*s,t);const d=u>a,f=l>a;if(d&&(u=t-u),f&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},Cs);var rd=Object.freeze({__proto__:null,secp256k1:nd});function od(e,t={}){const{recovered:n}=t;if(void 0===e.r)throw new ud({signature:e});if(void 0===e.s)throw new ud({signature:e});if(n&&void 0===e.yParity)throw new ud({signature:e});if(e.r<0n||e.r>zu)throw new ld({value:e.r});if(e.s<0n||e.s>zu)throw new dd({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new fd({value:e.yParity})}function sd(e){if(130!==e.length&&132!==e.length)throw new cd({signature:e});const t=BigInt(wi(e,0,32)),n=BigInt(wi(e,32,64)),r=(()=>{const t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return id(t)}catch{throw new fd({value:t})}})();return void 0===r?{r:t,s:n}:{r:t,s:n,yParity:r}}function ad(e){if(void 0!==e.r&&void 0!==e.s)return function(e){const t="string"==typeof e?sd(e):e instanceof Uint8Array?function(e){return sd(pi(e))}(e):"string"==typeof e.r?function(e){const t=(()=>{const t=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof n&&(n=id(t)),"number"!=typeof n)throw new fd({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?function(e){return{r:e.r,s:e.s,yParity:id(e.v)}}(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return od(t),t}(e)}function id(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2==0?1:0;throw new hd({value:e})}class cd extends Ra{constructor({signature:e}){var t;super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${vi((t=e,t instanceof Uint8Array?pi(t):Array.isArray(t)?pi(new Uint8Array(t)):t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class ud extends Ra{constructor({signature:e}){super(`Signature \`${Ya(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class ld extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class dd extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class fd extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class hd extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function pd(e,t={}){return"string"==typeof e.chainId?function(e){const{address:t,chainId:n,nonce:r}=e,o=ad(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}(e):{...e,...t.signature}}const md=Ju("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function gd(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==wi(e,-32))throw new bd(e)}else od(e.authorization)}let bd=class extends Ra{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};async function yd(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",a=void 0!==n?Vt(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?jt(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map(e=>({...e,value:BigInt(e.value)}))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,o,a||s]}))}async function wd(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){const a=r||"latest",i=void 0!==n?Vt(n):void 0;let c=null;if(c=o?await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Vt(s)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||a,Vt(s)]},{dedupe:Boolean(i)}),!c)throw new Hr({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||gs)(c)}async function vd(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Yr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||yc)(n)}async function xd(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:a,validation:i}=t;try{const t=[];for(const e of o){const n=e.blockOverrides?Bi(e.blockOverrides):void 0,r=e.calls.map(e=>{const t=e,n=t.account?pr(t.account):void 0,r=t.abi?gr(t):t.data,o={...t,data:t.dataSuffix?Hn([r||"0x",t.dataSuffix]):r,from:t.from??n?.address};return ls(o),ss(o)}),o=e.stateOverrides?cs(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:o})}const c=("bigint"==typeof n?Vt(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:s,traceTransfers:a,validation:i},c]})).map((e,t)=>({...bs(e),calls:e.calls.map((e,n)=>{const{abi:r,args:s,functionName:a,to:i}=o[t].calls[n],c=e.error?.data??e.returnData,u=BigInt(e.gasUsed),l=e.logs?.map(e=>Js(e)),d="0x1"===e.status?"success":"failure",f=r&&"success"===d&&"0x"!==c?ta({abi:r,data:c,functionName:a}):null,h=(()=>{if("success"===d)return;let t;return"0x"===e.error?.data?t=new at:e.error&&(t=new to(e.error)),t?Ro(t,{abi:r??[],address:i??"0x",args:s,functionName:a??"<unknown>"}):void 0})();return{data:c,gasUsed:u,logs:l,status:d,..."success"===d?{result:f}:{error:h}}})}))}catch(e){const t=e,n=ns(t,{});if(n instanceof ts)throw t;throw n}}function Ed(e){let t=!0,n="",r=0,o="",s=!1;for(let a=0;a<e.length;a++){const i=e[a];if(["(",")",","].includes(i)&&(t=!0),"("===i&&r++,")"===i&&r--,t)if(0!==r)" "!==i?(o+=i,n+=i):","!==e[a-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===i&&["event","function","error",""].includes(o))o="";else if(o+=i,")"===i){s=!0;break}}if(!s)throw new Ra("Unable to normalize signature.");return o}function Pd(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Tu(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,n)=>Pd(Object.values(e)[n],t)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>Pd(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function kd(e,t,n){for(const r in e){const o=e[r],s=t[r];if("tuple"===o.type&&"tuple"===s.type&&"components"in o&&"components"in s)return kd(o.components,s.components,n[r]);const a=[o.type,s.type];if((()=>!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&Tu(n[r],{strict:!1}))())return a}}function Ad(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||"string"==typeof e?Ve(e):e;return{...r,...n?{hash:Nd(r)}:{}}}function Id(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=Pi(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?Sd(e)===wi(t,0,4):"event"===e.type&&Nd(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new $d({name:t});if(1===a.length)return{...a[0],...o?{hash:Nd(a[0])}:{}};let i;for(const e of a){if(!("inputs"in e))continue;if(!r||0===r.length){if(!e.inputs||0===e.inputs.length)return{...e,...o?{hash:Nd(e)}:{}};continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==r.length)continue;const t=r.every((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&Pd(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=kd(e.inputs,i.inputs,r);if(t)throw new Td({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}const c=(()=>{if(i)return i;const[e,...t]=a;return{...e,overloads:t}})();if(!c)throw new $d({name:t});return{...c,...o?{hash:Nd(c)}:{}}}function Sd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return Id(t,n)}return e[0]})();return wi(Nd(t),0,4)}function Nd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return Id(t,n)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:Au(gi(function(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return Id(t,n)}return e[0]})();return Ed("string"==typeof t?t:se(t))}(t)))}class Td extends Ra{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${Ed(se(e.abiItem))}\`, and`,`\`${t.type}\` in \`${Ed(se(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:"AbiItem.AmbiguityError"})}}class $d extends Ra{constructor({name:e,data:t,type:n="item"}){super(`ABI ${n}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Bd(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new $d({name:"constructor"});return t}function Cd(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[t,n,r]=e;return[_d(t,n,{args:r}),r]}const[t,n]=e;return[t,n]})(),{overloads:r}=t,o=r?_d([t,...r],t.name,{args:n}):t,s=Sd(o);const a=n.length>0?Zu(o.inputs,n):void 0;return a?fi(s,a):s}function Od(e,t={}){return Ad(e,t)}function _d(e,t,n){const r=Id(e,t,n);if("function"!==r.type)throw new $d({name:t,type:"function"});return r}const Rd="0x0000000000000000000000000000000000000000";async function zd(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:a,traceTransfers:i,validation:c}=t,u=t.account?pr(t.account):void 0;if(a&&!u)throw new tt("`account` is required when `traceAssetChanges` is true");const l=u?function(...e){const[t,n]=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return[Bd(t),n]}return e})(),{bytecode:r,args:o}=n;return fi(r,t.inputs?.length&&o?.length?Zu(t.inputs,o):"0x")}(Ad("constructor(bytes, bytes)"),{bytecode:Di,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",Cd(Od("function getBalance(address)"),[u.address])]}):void 0;const d=a?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;const{accessList:n}=await Hc(e,{account:u.address,...t,data:t.abi?gr(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await xd(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:l}],stateOverrides:s},{calls:d.map((e,t)=>({abi:[Od("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]}]:[],{calls:[...o,{}].map(e=>({...e,from:u?.address})),stateOverrides:s},...a?[{calls:[{data:l}]},{calls:d.map((e,t)=>({abi:[Od("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Od("function decimals() returns (uint256)")],functionName:"decimals",from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Od("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Od("function symbol() returns (string)")],functionName:"symbol",from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]}]:[]],traceTransfers:i,validation:c}),h=a?f[2]:f[0],[p,m,,g,b,y,w,v]=a?f:[],{calls:x,...E}=h,P=x.slice(0,-1)??[],k=[...p?.calls??[],...m?.calls??[]].map(e=>"success"===e.status?Ft(e.data):null),A=[...g?.calls??[],...b?.calls??[]].map(e=>"success"===e.status?Ft(e.data):null),I=(y?.calls??[]).map(e=>"success"===e.status?e.result:null),S=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(w?.calls??[]).map(e=>"success"===e.status?e.result:null),T=[];for(const[e,t]of A.entries()){const n=k[e];if("bigint"!=typeof t)continue;if("bigint"!=typeof n)continue;const r=I[e-1],o=S[e-1],s=N[e-1],a=(()=>0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:d[e-1],decimals:s||r?Number(r??1):void 0,symbol:o??void 0})();T.some(e=>e.token.address===a.address)||T.push({token:a,value:{pre:n,post:t,diff:t-n}})}return{assetChanges:T,block:E,results:P}}const Md="0x6492649264926492649264926492649264926492649264926492649264926492";function Ld(e){try{return function(e){if(wi(e,-32)!==Md)throw new Fd(e)}(e),!0}catch{return!1}}class Fd extends Ra{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function jd({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(0===o||1===o)return o;if(r&&(27n===r||28n===r||r>=35n))return r%2n==0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new nd.Signature(Ft(e),Ft(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===n?a:Qt(a)}async function Ud(e,t){const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??e.chain?.contracts?.erc6492Verifier?.address,multicallAddress:s=t.multicallAddress??e.chain?.contracts?.multicall3?.address}=t,a=(()=>{const e=t.signature;return Ke(e)?e:"object"==typeof e&&"r"in e&&"s"in e?jd(e):qt(e)})();try{return function(e){try{return gd(e),!0}catch{return!1}}(a)?await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:a}=t,{authorization:i,data:c,signature:u,to:l}=function(e){gd(e);const t=Ei(wi(e,-64,-32)),n=wi(e,-t-64,-64),r=wi(e,0,-t-64),[o,s,a]=Yu(md,n);return{authorization:pd({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...a&&"0x"!==a?{data:a,to:s}:{}}}(t.signature),d=await Kc(e,{address:n,blockNumber:r,blockTag:o});if(d===Yn(["0xef0100",i.address]))return await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:a}=t,i=await He(e,rc,"readContract")({address:n,abi:Fi,args:[s,a],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof Jr)throw new Dd;throw e});if(i.startsWith("0x1626ba7e"))return!0;throw new Dd}(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:u});const f={address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:Vt(i.r,{size:32}),s:Vt(i.s,{size:32}),yParity:i.yParity},h=await async function({address:e,authorization:t,signature:n}){return Ws(Gn(e),await Do({authorization:t,signature:n}))}({address:n,authorization:f});if(!h)throw new Dd;const p=await He(e,rc,"readContract")({...a?{address:a}:{code:Vi},authorizationList:[f],abi:Ci,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??n,callData:c}]:[],{allowFailure:!0,target:n,callData:gr({abi:Fi,functionName:"isValidSignature",args:[s,u]})}]]}),m=p[p.length-1]?.returnData;if(m?.startsWith("0x1626ba7e"))return!0;throw new Dd}(e,{...t,multicallAddress:s,signature:a}):await async function(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:a,verifierAddress:i,...c}=t,u=await(async()=>r||o?Ld(a)?a:function(e){const{data:t,signature:n,to:r}=e;return fi(Zu(Ju("address, bytes, bytes"),[r,t,n]),Md)}({data:o,signature:a,to:r}):a)(),l=i?{to:i,data:gr({abi:ji,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:Zi({abi:ji,args:[n,s,u],bytecode:qi}),...c},{data:d}=await He(e,tc,"call")(l).catch(e=>{if(e instanceof Kr)throw new Dd;throw e});if(function(e,t={}){let n=e;if(t.size&&(Lt(n,{size:t.size}),n=Mt(n)),"0x00"===Mt(n))return!1;if("0x01"===Mt(n))return!0;throw new Rt(n)}(d??"0x0"))return!0;throw new Dd}(e,{...t,verifierAddress:o,signature:a})}catch(e){try{if(Ws(Gn(n),await Mo({hash:r,signature:a})))return!0}catch{}if(e instanceof Dd)return!1;throw e}}class Dd extends Error{}function Gd(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:a=e.pollingInterval}){let i;return(void 0!==s?s:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?ic(_r(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:o},r=>uc(async()=>{try{const t=await He(e,hc,"getBlockNumber")({cacheTime:0});if(void 0!==i){if(t===i)return;if(t-i>1&&n)for(let e=i+1n;e<t;e++)r.onBlockNumber(e,i),i=e}(void 0===i||t>i)&&(r.onBlockNumber(t,i),i=t)}catch(e){r.onError?.(e)}},{emitOnBegin:t,interval:a})):ic(_r(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:o},t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const o=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await o.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=Ft(e.result?.number);t.onBlockNumber(r,i),i=r},onError(e){t.onError?.(e)}});r=s,n||r()}catch(e){o?.(e)}})(),()=>r()})}const qd=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Vd=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;async function Wd(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:a,signature:i,time:c=new Date,...u}=t,l=function(e){const{scheme:t,statement:n,...r}=e.match(qd)?.groups??{},{chainId:o,expirationTime:s,issuedAt:a,notBefore:i,requestId:c,...u}=e.match(Vd)?.groups??{},l=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...r,...u,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}(o);if(!l.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:a=new Date}=e;if(n&&r.domain!==n)return!1;if(o&&r.nonce!==o)return!1;if(s&&r.scheme!==s)return!1;if(r.expirationTime&&a>=r.expirationTime)return!1;if(r.notBefore&&a<r.notBefore)return!1;try{if(!r.address)return!1;if(!Wn(r.address,{strict:!1}))return!1;if(t&&!Ws(r.address,t))return!1}catch{return!1}return!0}({address:n,domain:r,message:l,nonce:s,scheme:a,time:c});if(!d)return!1;const f=du(o);return Ud(e,{address:l.address,hash:f,signature:i,...u})}function Hd(e){return{call:t=>tc(e,t),createAccessList:t=>Hc(e,t),createBlockFilter:()=>async function(e){const t=fr(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>hr(e,t),createEventFilter:t=>Yc(e,t),createPendingTransactionFilter:()=>Zc(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:a,...i}=t,c=gr({abi:n,args:o,functionName:s});try{return await He(e,Vs,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:r,...i})}catch(e){const t=i.account?pr(i.account):void 0;throw Ro(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}(e,t),estimateGas:t=>Vs(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o="bigint"==typeof n?Vt(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>ys(e,t),getBlockNumber:t=>hc(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=void 0!==n?Vt(n):void 0;let s;return s=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:Boolean(o)}),jt(s)}(e,t),getBytecode:t=>Kc(e,t),getChainId:()=>Us(e),getCode:t=>Kc(e,t),getContractEvents:t=>Xs(e,t),getEip712Domain:t=>async function(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[t,s,a,i,c,u,l]=await He(e,rc,"readContract")({abi:Qc,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:s,version:a,chainId:Number(i),verifyingContract:c,salt:u},extensions:l,fields:t}}catch(e){const t=e;if("ContractFunctionExecutionError"===t.name&&"ContractFunctionZeroDataError"===t.cause.name)throw new Jc({address:n});throw t}}(e,t),getEnsAddress:t=>async function(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ki({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(e=>s.endsWith(e)))return null;const d=null!=o?[Tc(s),BigInt(o)]:[Tc(s)];try{const t=gr({abi:Li,functionName:"addr",args:d}),o={address:u,abi:Ri,functionName:"resolveWithGateways",args:[Dt(Cc(s)),t,a??[Ic]],blockNumber:n,blockTag:r},i=He(e,rc,"readContract"),c=await i(o);if("0x"===c[0])return null;const l=ta({abi:Li,args:d,functionName:"addr",data:c[0]});return"0x"===l||"0x00"===Mt(l)?null:l}catch(e){if(i)throw e;if(Ec(e))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:a,universalResolverAddress:i}){const c=await He(e,Wc,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:i,gatewayUrls:s,strict:a});if(!c)return null;try{return await Vc(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ki({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const t={address:u,abi:zi,args:[n,s,a??[Ic]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},i=He(e,rc,"readContract"),[c]=await i(t);return c||null}catch(e){if(i)throw e;if(Ec(e))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return Ki({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),i=s?.ensTlds;if(i&&!i.some(e=>o.endsWith(e)))throw new Error(`${o} is not a valid ENS TLD (${i?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await He(e,rc,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Dt(Cc(o))],blockNumber:n,blockTag:r});return c}(e,t),getEnsText:t=>Wc(e,t),getFeeHistory:t=>Xc(e,t),estimateFeesPerGas:t=>async function(e,t){return xs(e,t)}(e,t),getFilterChanges:e=>pc(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>Js(e));return t.abi?Ks({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>ws(e),getLogs:t=>Qs(e,t),getProof:t=>yd(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return vs(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=void 0!==n?Vt(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}(e,t),getTransaction:t=>wd(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([He(e,hc,"getBlockNumber")({}),t?He(e,wd,"getTransaction")({hash:t}):void 0]),s=n?.blockNumber||o?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>Es(e,t),getTransactionReceipt:t=>vd(e,t),multicall:t=>async function(e,t){const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:a,blockTag:i,stateOverride:c}=t,u=t.contracts,{batchSize:l=t.batchSize??1024,deployless:d=t.deployless??!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Ki({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let p=0,m=0;for(let e=0;e<u.length;e++){const{abi:t,address:r,args:s,functionName:a}=u[e];try{const e=gr({abi:t,args:s,functionName:a});m+=(e.length-2)/2,l>0&&m>l&&h[p].length>0&&(p++,m=(e.length-2)/2,h[p]=[]),h[p]=[...h[p],{allowFailure:!0,callData:e,target:r}]}catch(e){const i=Ro(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:a,sender:n});if(!o)throw i;h[p]=[...h[p],{allowFailure:!0,callData:"0x",target:r}]}}const g=await Promise.allSettled(h.map(t=>He(e,rc,"readContract")({...null===f?{code:Vi}:{address:f},abi:Ci,account:n,args:[t],authorizationList:r,blockNumber:s,blockOverrides:a,blockTag:i,functionName:"aggregate3",stateOverride:c}))),b=[];for(let e=0;e<g.length;e++){const t=g[e];if("rejected"===t.status){if(!o)throw t.reason;for(let n=0;n<h[e].length;n++)b.push({status:"failure",error:t.reason,result:void 0});continue}const n=t.value;for(let t=0;t<n.length;t++){const{returnData:r,success:s}=n[t],{callData:a}=h[e][t],{abi:i,address:c,functionName:l,args:d}=u[b.length];try{if("0x"===a)throw new at;if(!s)throw new to({data:r});const e=ta({abi:i,args:d,data:r,functionName:l});b.push(o?{result:e,status:"success"}:e)}catch(e){const t=Ro(e,{abi:i,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:l});if(!o)throw t;b.push({error:t,result:void 0,status:"failure"})}}}if(b.length!==u.length)throw new tt("multicall results mismatch");return b}(e,t),prepareTransactionRequest:t=>qs(e,t),readContract:t=>rc(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulate:t=>xd(e,t),simulateBlocks:t=>xd(e,t),simulateCalls:t=>zd(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:a,...i}=t,c=i.account?pr(i.account):e.account,u=gr({abi:n,args:o,functionName:a});try{const{data:l}=await He(e,tc,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...i,account:c});return{result:ta({abi:n,args:o,functionName:a,data:l||"0x"}),request:{abi:n.filter(e=>"name"in e&&e.name===t.functionName),address:r,args:o,dataSuffix:s,functionName:a,...i,account:c}}}catch(e){throw Ro(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyHash:t=>Ud(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...a}){return Ud(e,{address:t,factory:r,factoryData:o,hash:du(n),signature:s,...a})}(e,t),verifySiweMessage:t=>Wd(e,t),verifyTypedData:t=>async function(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:a,primaryType:i,types:c,domain:u,...l}=t;return Ud(e,{address:n,factory:r,factoryData:o,hash:bu({message:a,primaryType:i,types:c,domain:u}),signature:s,...l})}(e,t),uninstallFilter:e=>mc(0,e),waitForTransactionReceipt:t=>async function(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:a=6,retryDelay:i=({count:e})=>200*(1<<e),timeout:c=18e4}=t,u=_r(["waitForTransactionReceipt",e.uid,o]),l=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;let d,f,h,p,m,g=!1;const{promise:b,resolve:y,reject:w}=Qi(),v=c?setTimeout(()=>{m?.(),p?.(),w(new Zr({hash:o}))},c):void 0;return p=ic(u,{onReplaced:s,resolve:y,reject:w},async t=>{if(h=await He(e,vd,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1)return clearTimeout(v),t.resolve(h),void p?.();m=He(e,Gd,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:l,async onBlockNumber(s){const c=e=>{clearTimeout(v),m?.(),e(),p?.()};let u=s;if(!g)try{if(h){if(r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;return void c(()=>t.resolve(h))}if(n&&!d&&(g=!0,await gc(async()=>{d=await He(e,wd,"getTransaction")({hash:o}),d.blockNumber&&(u=d.blockNumber)},{delay:i,retryCount:a}),g=!1),h=await He(e,vd,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;c(()=>t.resolve(h))}catch(n){if(n instanceof Hr||n instanceof Yr){if(!d)return void(g=!1);try{f=d,g=!0;const n=await gc(()=>He(e,ys,"getBlock")({blockNumber:u,includeTransactions:!0}),{delay:i,retryCount:a,shouldRetry:({error:e})=>e instanceof ps});g=!1;const o=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!o)return;if(h=await He(e,vd,"getTransactionReceipt")({hash:o.hash}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;let s="replaced";o.to===f.to&&o.value===f.value&&o.input===f.input?s="repriced":o.from===o.to&&0n===o.value&&(s="cancelled"),c(()=>{t.onReplaced?.({reason:s,replacedTransaction:f,transaction:o,transactionReceipt:h}),t.resolve(h)})}catch(e){c(()=>t.reject(e))}}else c(()=>t.reject(n))}}})}),b}(e,t),watchBlocks:t=>function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:a,poll:i,pollingInterval:c=e.pollingInterval}){const u=void 0!==i?i:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),l=a??!1;let d;return u?ic(_r(["watchBlocks",e.uid,t,n,r,l,c]),{onBlock:o,onError:s},o=>uc(async()=>{try{const r=await He(e,ys,"getBlock")({blockTag:t,includeTransactions:l});if(null!==r.number&&null!=d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;t<r.number;t++){const n=await He(e,ys,"getBlock")({blockNumber:t,includeTransactions:l});o.onBlock(n,d),d=n}}(null==d?.number||"pending"===t&&null==r?.number||null!==r.number&&r.number>d.number)&&(o.onBlock(r,d),d=r)}catch(e){o.onError?.(e)}},{emitOnBegin:r,interval:c})):(()=>{let n=!0,a=!0,i=()=>n=!1;return(async()=>{try{r&&He(e,ys,"getBlock")({blockTag:t,includeTransactions:l}).then(e=>{n&&a&&(o(e,void 0),a=!1)}).catch(s);const c=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:u}=await c.subscribe({params:["newHeads"],async onData(t){if(!n)return;const r=await He(e,ys,"getBlock")({blockNumber:t.result?.number,includeTransactions:l}).catch(()=>{});n&&(o(r,d),a=!1,d=r)},onError(e){s?.(e)}});i=u,n||i()}catch(e){s?.(e)}})(),()=>i()})()}(e,t),watchBlockNumber:t=>Gd(e,t),watchContractEvent:t=>function(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:a,fromBlock:i,onError:c,onLogs:u,poll:l,pollingInterval:d=e.pollingInterval,strict:f}=t;return(void 0!==l?l:"bigint"==typeof i||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{const t=f??!1;return ic(_r(["watchContractEvent",r,o,s,e.uid,a,d,t,i]),{onLogs:u,onError:c},c=>{let u,l;void 0!==i&&(u=i-1n);let f=!1;const h=uc(async()=>{if(f)try{let i;if(l)i=await He(e,pc,"getFilterChanges")({filter:l});else{const s=await He(e,hc,"getBlockNumber")({});i=u&&u<s?await He(e,Xs,"getContractEvents")({abi:n,address:r,args:o,eventName:a,fromBlock:u+1n,toBlock:s,strict:t}):[],u=s}if(0===i.length)return;if(s)c.onLogs(i);else for(const e of i)c.onLogs([e])}catch(e){l&&e instanceof ho&&(f=!1),c.onError?.(e)}else{try{l=await He(e,hr,"createContractEventFilter")({abi:n,address:r,args:o,eventName:a,strict:t,fromBlock:i})}catch{}f=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await He(e,mc,"uninstallFilter")({filter:l}),h()}})})():(()=>{const t=f??!1,i=_r(["watchContractEvent",r,o,s,e.uid,a,d,t]);let l=!0,h=()=>l=!1;return ic(i,{onLogs:u,onError:c},t=>((async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),i=a?lr({abi:n,eventName:a,args:o}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:r,topics:i}],onData(e){if(!l)return;const r=e.result;try{const{eventName:e,args:o}=Ys({abi:n,data:r.data,topics:r.topics,strict:f}),s=Js(r,{args:o,eventName:e});t.onLogs([s])}catch(e){let n,o;if(e instanceof xt||e instanceof Et){if(f)return;n=e.abiItem.name,o=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const s=Js(r,{args:o?[]:{},eventName:n});t.onLogs([s])}},onError(e){t.onError?.(e)}});h=c,l||h()}catch(e){c?.(e)}})(),()=>h()))})()}(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:a,onError:i,onLogs:c,poll:u,pollingInterval:l=e.pollingInterval,strict:d}){const f=void 0!==u?u:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),h=d??!1;return f?ic(_r(["watchEvent",t,n,r,e.uid,o,l,a]),{onLogs:c,onError:i},i=>{let c,u;void 0!==a&&(c=a-1n);let d=!1;const f=uc(async()=>{if(d)try{let a;if(u)a=await He(e,pc,"getFilterChanges")({filter:u});else{const r=await He(e,hc,"getBlockNumber")({});a=c&&c!==r?await He(e,Qs,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:c+1n,toBlock:r}):[],c=r}if(0===a.length)return;if(r)i.onLogs(a);else for(const e of a)i.onLogs([e])}catch(e){u&&e instanceof ho&&(d=!1),i.onError?.(e)}else{try{u=await He(e,Yc,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:a})}catch{}d=!0}},{emitOnBegin:!0,interval:l});return async()=>{u&&await He(e,mc,"uninstallFilter")({filter:u}),f()}}):(()=>{let r=!0,a=()=>r=!1;return(async()=>{try{const u=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=s??(o?[o]:void 0);let f=[];if(l){const e=l.flatMap(e=>lr({abi:[e],eventName:e.name,args:n}));f=[e],o&&(f=f[0])}const{unsubscribe:p}=await u.subscribe({params:["logs",{address:t,topics:f}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=Ys({abi:l??[],data:t.data,topics:t.topics,strict:h}),r=Js(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof xt||e instanceof Et){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const o=Js(t,{args:r?[]:{},eventName:n});c([o])}},onError(e){i?.(e)}});a=p,r||a()}catch(e){i?.(e)}})(),()=>a()})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(void 0!==o?o:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?ic(_r(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},n=>{let r;const o=uc(async()=>{try{if(!r)try{return void(r=await He(e,Zc,"createPendingTransactionFilter")({}))}catch(e){throw o(),e}const s=await He(e,pc,"getFilterChanges")({filter:r});if(0===s.length)return;if(t)n.onTransactions(s);else for(const e of s)n.onTransactions([e])}catch(e){n.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{r&&await He(e,mc,"uninstallFilter")({filter:r}),o()}}):(()=>{let t=!0,o=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});o=s,t||o()}catch(e){n?.(e)}})(),()=>o()})()}(e,t)}}function Yd(e){const{key:t="public",name:n="Public Client"}=e,r=function(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:a="base"}=e,i=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),c=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),l=e.pollingInterval??u,d=e.cacheTime??l,f=e.account?pr(e.account):void 0,{config:h,request:p,value:m}=e.transport({chain:n,pollingInterval:l}),g={account:f,batch:t,cacheTime:d,ccipRead:r,chain:n,key:o,name:s,pollingInterval:l,request:p,transport:{...h,...m},type:a,uid:xc(),...i?{experimental_blockTag:i}:{}};return Object.assign(g,{extend:function e(t){return n=>{const r=n(t);for(const e in g)delete r[e];const o={...t,...r};return Object.assign(o,{extend:e(o)})}}(g)})}({...e,key:t,name:n,type:"publicClient"});return r.extend(Hd)}class Zd extends tt{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Kd(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:a,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:u,retryDelay:l,raw:d}=t;return({chain:f,retryCount:h,timeout:p})=>{const{batchSize:m=1e3,wait:g=0}="object"==typeof n?n:{},b=t.retryCount??h,y=p??t.timeout??1e4,w=e||f?.rpcUrls.default.http[0];if(!w)throw new Zd;const v=lu(w,{fetchFn:r,fetchOptions:o,onRequest:c,onResponse:u,timeout:y});return function({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:a,type:i},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:a,type:i},request:tu(r,{methods:t,retryCount:o,retryDelay:s,uid:xc()}),value:c}}({key:s,methods:a,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:o}=ec({id:w,wait:g,shouldSplitBatch:e=>e.length>m,fn:e=>v.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:s,result:a}]=await(async e=>n?o(e):[await v.request({body:e})])(r);if(d)return{error:s,result:a};if(s)throw new ro({body:r,error:s,url:w});return a},retryCount:b,retryDelay:l,timeout:y,type:"http"},{fetchOptions:o,url:w})}}function Jd(e,t,n){for(let n in t){let r=t[n];Object.defineProperty(e,n,{enumerable:!0,value:r,writable:!1})}}function Qd(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>Qd(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[15&e[r]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return Qd(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(n=>`${Qd(n,t)}: ${Qd(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Xd(e,t,n,r){if(!e)throw function(e,t,n){let r,o=e;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Qd(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+Qd(t))}}r.push(`code=${t}`),r.push("version=6.15.0"),r.length&&(e+=" ("+r.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return Jd(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Jd(r,{shortMessage:o}),r}(t,n,r)}function ef(e,t,n,r){Xd(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function tf(e,t){return function(e,t){if(e instanceof Uint8Array)return e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}ef(!1,"invalid BytesLike value",t,e)}(e,t)}["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);const nf=BigInt(0),rf=BigInt(1),of=9007199254740991;function sf(e,t){const n=uf(e,"value"),r=BigInt(df(t,"width"));if(Xd(n>>r===nf,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-rf){return-((~n&(rf<<r)-rf)+rf)}return n}function af(e,t){const n=uf(e,"value"),r=BigInt(df(t,"bits"));return n&(rf<<r)-rf}function cf(e,t){switch(typeof e){case"bigint":return e;case"number":return ef(Number.isInteger(e),"underflow",t||"value",e),ef(e>=-of&&e<=of,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){ef(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}ef(!1,"invalid BigNumberish value",t||"value",e)}function uf(e,t){const n=cf(e,t);return Xd(n>=nf,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const lf="0123456789abcdef";function df(e,t){switch(typeof e){case"bigint":return ef(e>=-of&&e<=of,"overflow",t||"value",e),Number(e);case"number":return ef(Number.isInteger(e),"underflow",t||"value",e),ef(e>=-of&&e<=of,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return df(BigInt(e),t)}catch(n){ef(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}ef(!1,"invalid numeric value",t||"value",e)}const ff=BigInt(-1),hf=BigInt(0),pf=BigInt(1),mf=BigInt(5),gf={};let bf="0000";for(;bf.length<80;)bf+=bf;function yf(e){let t=bf;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function wf(e,t,n){const r=BigInt(t.width);if(t.signed){const t=pf<<r-pf;Xd(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>hf?sf(af(e,r),r):-sf(af(-e,r),r)}else{const t=pf<<r;Xd(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-pf}return e}function vf(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);ef(o,"invalid fixed format","format",e),t="u"!==o[1],n=parseInt(o[2]),r=parseInt(o[3])}else if(e){const o=e,s=(e,t,n)=>null==o[e]?n:(ef(typeof o[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,o[e]),o[e]);t=s("signed","boolean",t),n=s("width","number",n),r=s("decimals","number",r)}ef(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),ef(r<=80,"invalid FixedNumber decimals (too large)","format.decimals",r);return{signed:t,width:n,decimals:r,name:(t?"":"u")+"fixed"+String(n)+"x"+String(r)}}class xf{format;#e;#t;#n;_value;constructor(e,t,n){!function(e,t,n){if(e!==t){let e=n,t="new";e+=".",t+=" "+n,Xd(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,gf,"FixedNumber"),this.#t=t,this.#e=n;const r=function(e,t){let n="";e<hf&&(n="-",e*=ff);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=bf+r;const o=r.length-t;for(r=r.substring(0,o)+"."+r.substring(o);"0"===r[0]&&"."!==r[1];)r=r.substring(1);for(;"0"===r[r.length-1]&&"."!==r[r.length-2];)r=r.substring(0,r.length-1);return n+r}(t,n.decimals);Jd(this,{format:n.name,_value:r}),this.#n=yf(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#r(e){ef(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#o(e,t){return e=wf(e,this.#e,t),new xf(gf,e,this.#e)}#s(e,t){return this.#r(e),this.#o(this.#t+e.#t,t)}addUnsafe(e){return this.#s(e)}add(e){return this.#s(e,"add")}#a(e,t){return this.#r(e),this.#o(this.#t-e.#t,t)}subUnsafe(e){return this.#a(e)}sub(e){return this.#a(e,"sub")}#i(e,t){return this.#r(e),this.#o(this.#t*e.#t/this.#n,t)}mulUnsafe(e){return this.#i(e)}mul(e){return this.#i(e,"mul")}mulSignal(e){this.#r(e);const t=this.#t*e.#t;return Xd(t%this.#n===hf,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#o(t/this.#n,"mulSignal")}#c(e,t){return Xd(e.#t!==hf,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e),this.#o(this.#t*this.#n/e.#t,t)}divUnsafe(e){return this.#c(e)}div(e){return this.#c(e,"div")}divSignal(e){Xd(e.#t!==hf,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e);const t=this.#t*this.#n;return Xd(t%e.#t===hf,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#o(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value;const r=this.decimals-e.decimals;return r>0?n*=yf(r):r<0&&(t*=yf(-r)),t<n?-1:t>n?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<hf&&(e-=this.#n-pf),e=this.#t/this.#n*this.#n,this.#o(e,"floor")}ceiling(){let e=this.#t;return this.#t>hf&&(e+=this.#n-pf),e=this.#t/this.#n*this.#n,this.#o(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,n=mf*yf(t-1);let r=this.value+n;const o=yf(t);return r=r/o*o,wf(r,this.#e,"round"),new xf(gf,r,this.#e)}isZero(){return this.#t===hf}isNegative(){return this.#t<hf}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return xf.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:df(t),o=vf(n);let s=cf(e,"value");const a=r-o.decimals;if(a>0){const t=yf(a);Xd(s%t===hf,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=yf(-a));return wf(s,o,"fromValue"),new xf(gf,s,o)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);ef(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=vf(t);let o=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=bf;Xd(s.substring(r.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,r.decimals);const a=BigInt(n[1]+o+s);return wf(a,r,"fromString"),new xf(gf,a,r)}static fromBytes(e,t){let n=function(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=lf[n>>4],t+=lf[15&n];return BigInt(t)}return cf(e)}(tf(e,"value"));const r=vf(t);return r.signed&&(n=sf(n,r.width)),wf(n,r,"fromBytes"),new xf(gf,n,r)}}function Ef(e){return function(e,t){let n=18;return n=df(t,"unit"),xf.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const Pf="0.38.13";function kf({projectId:e,originComponentName:t,...n}){const r=new URL("https://pay.coinbase.com/buy");void 0!==e&&r.searchParams.append("appId",e);for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(["string","number","boolean"].includes(typeof t)?r.searchParams.append(e,t.toString()):r.searchParams.append(e,JSON.stringify(t)))}return t?r.searchParams.append("sdkVersion",`onchainkit@${Pf}:${t}`):r.searchParams.append("sdkVersion",`onchainkit@${Pf}`),r.searchParams.sort(),r.toString()}var Af=[],If=[],Sf="undefined"!=typeof Uint8Array?Uint8Array:Array,Nf=!1;function Tf(){Nf=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Af[t]=e[t],If[e.charCodeAt(t)]=t;If["-".charCodeAt(0)]=62,If["_".charCodeAt(0)]=63}function $f(e){return Af[e>>18&63]+Af[e>>12&63]+Af[e>>6&63]+Af[63&e]}function Bf(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push($f(r));return o.join("")}function Cf(e){var t;Nf||Tf();for(var n=e.length,r=n%3,o="",s=[],a=16383,i=0,c=n-r;i<c;i+=a)s.push(Bf(e,i,i+a>c?c:i+a));return 1===r?(t=e[n-1],o+=Af[t>>2],o+=Af[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=Af[t>>10],o+=Af[t>>4&63],o+=Af[t<<2&63],o+="="),s.push(o),s.join("")}function Of(e,t,n,r,o){var s,a,i=8*o-r-1,c=(1<<i)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=u}return(h?-1:1)*a*Math.pow(2,s-r)}function _f(e,t,n,r,o,s){var a,i,c,u=8*s-o-1,l=(1<<u)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(i=0,a=l):a+d>=1?(i=(t*c-1)*Math.pow(2,o),a+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&i,h+=p,i/=256,o-=8);for(a=a<<o|i,u+=o;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*m}var Rf={}.toString,zf=Array.isArray||function(e){return"[object Array]"==Rf.call(e)};function Mf(){return Ff.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Lf(e,t){if(Mf()<t)throw new RangeError("Invalid typed array length");return Ff.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Ff.prototype:(null===e&&(e=new Ff(t)),e.length=t),e}function Ff(e,t,n){if(!(Ff.TYPED_ARRAY_SUPPORT||this instanceof Ff))return new Ff(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Df(this,e)}return jf(this,e,t,n)}function jf(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Ff.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Ff.prototype:e=Gf(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Ff.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Wf(t,n);e=Lf(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(Vf(t)){var n=0|qf(t.length);return 0===(e=Lf(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Lf(e,0):Gf(e,t);if("Buffer"===t.type&&zf(t.data))return Gf(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Uf(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Df(e,t){if(Uf(t),e=Lf(e,t<0?0:0|qf(t)),!Ff.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Gf(e,t){var n=t.length<0?0:0|qf(t.length);e=Lf(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function qf(e){if(e>=Mf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mf().toString(16)+" bytes");return 0|e}function Vf(e){return!(null==e||!e._isBuffer)}function Wf(e,t){if(Vf(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return wh(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return vh(e).length;default:if(r)return wh(e).length;t=(""+t).toLowerCase(),r=!0}}function Hf(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return ch(this,t,n);case"utf8":case"utf-8":return oh(this,t,n);case"ascii":return ah(this,t,n);case"latin1":case"binary":return ih(this,t,n);case"base64":return rh(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uh(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Yf(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Zf(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=Ff.from(t,r)),Vf(t))return 0===t.length?-1:Kf(e,t,n,r,o);if("number"==typeof t)return t&=255,Ff.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Kf(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Kf(e,t,n,r,o){var s,a=1,i=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,i/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(s=n;s<i;s++)if(u(e,s)===u(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===c)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(n+c>i&&(n=i-c),s=n;s>=0;s--){for(var d=!0,f=0;f<c;f++)if(u(e,s+f)!==u(t,f)){d=!1;break}if(d)return s}return-1}function Jf(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a<r;++a){var i=parseInt(t.substr(2*a,2),16);if(isNaN(i))return a;e[n+a]=i}return a}function Qf(e,t,n,r){return xh(wh(t,e.length-n),e,n,r)}function Xf(e,t,n,r){return xh(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function eh(e,t,n,r){return Xf(e,t,n,r)}function th(e,t,n,r){return xh(vh(t),e,n,r)}function nh(e,t,n,r){return xh(function(e,t){for(var n,r,o,s=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,s.push(o),s.push(r);return s}(t,e.length-n),e,n,r)}function rh(e,t,n){return 0===t&&n===e.length?Cf(e):Cf(e.slice(t,n))}function oh(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var s,a,i,c,u=e[o],l=null,d=u>239?4:u>223?3:u>191?2:1;if(o+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(s=e[o+1]))&&(c=(31&u)<<6|63&s)>127&&(l=c);break;case 3:s=e[o+1],a=e[o+2],128==(192&s)&&128==(192&a)&&(c=(15&u)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:s=e[o+1],a=e[o+2],i=e[o+3],128==(192&s)&&128==(192&a)&&128==(192&i)&&(c=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&i)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=sh)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=sh));return n}(r)}Ff.TYPED_ARRAY_SUPPORT=void 0===globalThis.TYPED_ARRAY_SUPPORT||globalThis.TYPED_ARRAY_SUPPORT,Mf(),Ff.poolSize=8192,Ff._augment=function(e){return e.__proto__=Ff.prototype,e},Ff.from=function(e,t,n){return jf(null,e,t,n)},Ff.TYPED_ARRAY_SUPPORT&&(Ff.prototype.__proto__=Uint8Array.prototype,Ff.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Ff[Symbol.species]),Ff.alloc=function(e,t,n){return function(e,t,n,r){return Uf(t),t<=0?Lf(e,t):void 0!==n?"string"==typeof r?Lf(e,t).fill(n,r):Lf(e,t).fill(n):Lf(e,t)}(null,e,t,n)},Ff.allocUnsafe=function(e){return Df(null,e)},Ff.allocUnsafeSlow=function(e){return Df(null,e)},Ff.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Eh(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Eh(e.slice(0,0))}(e))},Ff.compare=function(e,t){if(!Vf(e)||!Vf(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o<s;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},Ff.isEncoding=function(e){switch(String(e).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}},Ff.concat=function(e,t){if(!zf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Ff.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Ff.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!Vf(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},Ff.byteLength=Wf,Ff.prototype._isBuffer=!0,Ff.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Yf(this,t,t+1);return this},Ff.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Yf(this,t,t+3),Yf(this,t+1,t+2);return this},Ff.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Yf(this,t,t+7),Yf(this,t+1,t+6),Yf(this,t+2,t+5),Yf(this,t+3,t+4);return this},Ff.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?oh(this,0,e):Hf.apply(this,arguments)},Ff.prototype.equals=function(e){if(!Vf(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Ff.compare(this,e)},Ff.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Ff.prototype.compare=function(e,t,n,r,o){if(!Vf(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),i=Math.min(s,a),c=this.slice(r,o),u=e.slice(t,n),l=0;l<i;++l)if(c[l]!==u[l]){s=c[l],a=u[l];break}return s<a?-1:a<s?1:0},Ff.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Ff.prototype.indexOf=function(e,t,n){return Zf(this,e,t,n,!0)},Ff.prototype.lastIndexOf=function(e,t,n){return Zf(this,e,t,n,!1)},Ff.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return Jf(this,e,t,n);case"utf8":case"utf-8":return Qf(this,e,t,n);case"ascii":return Xf(this,e,t,n);case"latin1":case"binary":return eh(this,e,t,n);case"base64":return th(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nh(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Ff.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var sh=4096;function ah(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function ih(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function ch(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",s=t;s<n;++s)o+=yh(e[s]);return o}function uh(e,t,n){for(var r=e.slice(t,n),o="",s=0;s<r.length;s+=2)o+=String.fromCharCode(r[s]+256*r[s+1]);return o}function lh(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function dh(e,t,n,r,o,s){if(!Vf(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function fh(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,s=Math.min(e.length-n,2);o<s;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function hh(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,s=Math.min(e.length-n,4);o<s;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function ph(e,t,n,r,o,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function mh(e,t,n,r,o){return o||ph(e,0,n,4),_f(e,t,n,r,23,4),n+4}function gh(e,t,n,r,o){return o||ph(e,0,n,8),_f(e,t,n,r,52,8),n+8}Ff.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Ff.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Ff.prototype;else{var o=t-e;n=new Ff(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},Ff.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r},Ff.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Ff.prototype.readUInt8=function(e,t){return t||lh(e,1,this.length),this[e]},Ff.prototype.readUInt16LE=function(e,t){return t||lh(e,2,this.length),this[e]|this[e+1]<<8},Ff.prototype.readUInt16BE=function(e,t){return t||lh(e,2,this.length),this[e]<<8|this[e+1]},Ff.prototype.readUInt32LE=function(e,t){return t||lh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Ff.prototype.readUInt32BE=function(e,t){return t||lh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Ff.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},Ff.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=t,o=1,s=this[e+--r];r>0&&(o*=256);)s+=this[e+--r]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},Ff.prototype.readInt8=function(e,t){return t||lh(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Ff.prototype.readInt16LE=function(e,t){t||lh(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Ff.prototype.readInt16BE=function(e,t){t||lh(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Ff.prototype.readInt32LE=function(e,t){return t||lh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Ff.prototype.readInt32BE=function(e,t){return t||lh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Ff.prototype.readFloatLE=function(e,t){return t||lh(e,4,this.length),Of(this,e,!0,23,4)},Ff.prototype.readFloatBE=function(e,t){return t||lh(e,4,this.length),Of(this,e,!1,23,4)},Ff.prototype.readDoubleLE=function(e,t){return t||lh(e,8,this.length),Of(this,e,!0,52,8)},Ff.prototype.readDoubleBE=function(e,t){return t||lh(e,8,this.length),Of(this,e,!1,52,8)},Ff.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||dh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},Ff.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||dh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},Ff.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,1,255,0),Ff.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Ff.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,65535,0),Ff.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fh(this,e,t,!0),t+2},Ff.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,65535,0),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fh(this,e,t,!1),t+2},Ff.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,4294967295,0),Ff.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):hh(this,e,t,!0),t+4},Ff.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,4294967295,0),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):hh(this,e,t,!1),t+4},Ff.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);dh(this,e,t,n,o-1,-o)}var s=0,a=1,i=0;for(this[t]=255&e;++s<n&&(a*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Ff.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);dh(this,e,t,n,o-1,-o)}var s=n-1,a=1,i=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Ff.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,1,127,-128),Ff.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Ff.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,32767,-32768),Ff.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fh(this,e,t,!0),t+2},Ff.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,32767,-32768),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fh(this,e,t,!1),t+2},Ff.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,2147483647,-2147483648),Ff.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):hh(this,e,t,!0),t+4},Ff.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):hh(this,e,t,!1),t+4},Ff.prototype.writeFloatLE=function(e,t,n){return mh(this,e,t,!0,n)},Ff.prototype.writeFloatBE=function(e,t,n){return mh(this,e,t,!1,n)},Ff.prototype.writeDoubleLE=function(e,t,n){return gh(this,e,t,!0,n)},Ff.prototype.writeDoubleBE=function(e,t,n){return gh(this,e,t,!1,n)},Ff.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,s=r-n;if(this===e&&n<t&&t<r)for(o=s-1;o>=0;--o)e[o+t]=this[o+n];else if(s<1e3||!Ff.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},Ff.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Ff.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=Vf(e)?e:wh(new Ff(e,r).toString()),i=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%i]}return this};var bh=/[^+\/0-9A-Za-z-_]/g;function yh(e){return e<16?"0"+e.toString(16):e.toString(16)}function wh(e,t){var n;t=t||1/0;for(var r=e.length,o=null,s=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function vh(e){return function(e){var t,n,r,o,s,a;Nf||Tf();var i=e.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[i-2]?2:"="===e[i-1]?1:0,a=new Sf(3*i/4-s),r=s>0?i-4:i;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)o=If[e.charCodeAt(t)]<<18|If[e.charCodeAt(t+1)]<<12|If[e.charCodeAt(t+2)]<<6|If[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=If[e.charCodeAt(t)]<<2|If[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=If[e.charCodeAt(t)]<<10|If[e.charCodeAt(t+1)]<<4|If[e.charCodeAt(t+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(bh,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function xh(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Eh(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Ph(){const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}class kh{constructor(e){this.walletInfo=null,this.userId=null,this.solanaConnection=null,this.ethereumProvider=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=exports.Network.Solana,this.api=w.default.create({baseURL:e.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=w.default.create({baseURL:e.middleAccountBaseURL||"https://yeezy-payment-service-sit-a0dchfccbufeh5bx.z03.azurefd.net",headers:{"Content-Type":"application/json"}}),this.solanaCluster=e.solanaCluster,this.solanaConnection=new t.Connection(e.solanaCluster.rpcUrl),e.ethereumNetwork&&(this.ethereumNetwork={...e.ethereumNetwork,chainId:Number(e.ethereumNetwork.chainId)},this.ethereumProvider=Yd({transport:Kd(e.ethereumNetwork.rpcUrl)})),this.defaultNetwork=e.defaultNetwork||exports.Network.Solana,this.setWalletInfo=t=>{var n;e.setWalletInfo(t),this.userId=null!==(n=null==t?void 0:t.id)&&void 0!==n?n:null,this.walletInfo=t}}setWalletType(e){this.walletType=e,$.saveWalletType(e)}async reconnect(e){try{if($.getWalletType()==="phantom"+(e?"_backup":"")){return await this.connectPhantom()}if(!e){const e=await this.getAndRefreshSession();return this.setWalletInfo(e),e}const t=$.getBackupWalletInfo();return this.setWalletInfo(t),t}catch(e){return null}}getPhantomAdapter(){return this.phantomAdapter}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new K),await this.phantomAdapter.connect(),!this.phantomAdapter.publicKey)throw new Error("Failed to connect to Phantom wallet");const e=this.phantomAdapter.publicKey.toString(),t={id:r.v4(),wallets:[{id:e,address:e,network:exports.Network.Solana,wallet_type:exports.WalletType.Phantom,wallet_set:"Main",account_index:0,is_enabled:!0}],social_links:[],social_infos:[],account_info:{name:null,sub_accounts:[],credit_account:{account_mode:exports.AccountMode.Basic}},created_at:Date.now(),is_exported:!1};return this.setWalletInfo(t),this.setWalletType("phantom"),t}catch(e){throw console.error("Phantom connect error:",e),new Error(e instanceof Error?e.message:"Failed to connect to Phantom wallet")}}async updateAccountName(e,t){const n={name:e,account_index:t},r=(await this.api.post("/account/update",n,{withCredentials:!0})).data;return this.setWalletInfo(r),r}async manageMultiAccount(e){const t=(await this.api.post("/account/multi",e,{withCredentials:!0})).data;return this.setWalletInfo(t),t}async createSubAccount(e){return this.manageMultiAccount({type:"Create",data:{name:null!=e?e:null}})}async enableSubAccount(e){return this.manageMultiAccount({type:"Enable",data:{index:e}})}async disableSubAccount(e){return this.manageMultiAccount({type:"Disable",data:{index:e}})}async signSolanaTransaction(e,n){try{if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:r}=await this.solanaConnection.getLatestBlockhash();if(P(e)?e.message.recentBlockhash=r:e.recentBlockhash=r,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(e);const o=await this.signV3({network:exports.Network.Solana,address:n,tx:{Solana:v.default.encode(P(e)?e.message.serialize():e.serializeMessage())}});return e.addSignature(new t.PublicKey(n),Ff.from(v.default.decode(o))),e}catch(e){throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signEthereumEip712(e,t){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");return await this.signV2({network:exports.Network.Ethereum,address:t,tx:{EthereumEip712:e}})}async sendSolanaTransaction(e){if(!this.solanaConnection)throw new Error("No rpc connection");try{return await this.solanaConnection.sendRawTransaction(e,{maxRetries:3,skipPreflight:!1})}catch(e){throw e}}async sendEthereumTransaction(e){if(!this.ethereumProvider)throw new Error("No Ethereum provider");try{return await this.ethereumProvider.sendRawTransaction({serializedTransaction:e})}catch(e){throw e}}async sendEmailVerificationCode(e){await this.api.post("/send_verification",{email:e})}async sendPhoneVerificationCode(e){e.startsWith("+")||(e=`+${e}`),await this.api.post("/send_verification",{phone:e,type:"phone"})}async verifyEmailVerificationCode({email:e,code:t}){const n={type:"Email",data:{network:this.defaultNetwork,email:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async verifyPhoneVerificationCode({phone:e,code:t}){const n={type:"Phone",data:{network:this.defaultNetwork,phone:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async twitterLogin(e){const t={type:"TwitterOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWalletInfo(n),this.setWalletType("embedded"),n}async googleLogin(e){const t={type:"GoogleOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWalletInfo(n),this.setWalletType("embedded"),n}async oauthLogin(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async loginWithChallenge(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async bind(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/bind",n,{withCredentials:!0})).data;return this.setWalletInfo(r),r}async oauthInit(e){return(await this.api.post("/oauth/init",e)).data}async getSignChallenge(e){return(await this.api.get(`/challenge?method=${e.method}&id=${e.id}`)).data}async getAndRefreshSession(){const e=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:t}=e;return t&&$.saveAccessToken(t),this.setWalletInfo(e),e}async logout(e){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWalletInfo(null),e?$.clearBackup():$.clear()}async getOAuth2ClientId(e){return(await this.api.get(`/oauth_id/${e}`)).data.client_id}async getSolanaBalance(e){if(!this.solanaConnection)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new t.PublicKey(e))/t.LAMPORTS_PER_SOL).toString()}async getEthereumBalance(e){if(!this.ethereumProvider)throw new Error("Ethereum provider not available");return Ef(await this.ethereumProvider.getBalance({address:e}))}async fetchCoinbaseToken(e,t="solana"){return(await this.api.post("/ramp/coinbase",{addresses:[{address:e,blockchains:[t]}],assets:["solana"===t?"SOL":"ETH"]})).data.token}viemSignerAdapter(e){return{signTypedData:async t=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");const n=await this.signV2({network:exports.Network.Ethereum,address:e,tx:{EthereumEip712:t}}),r=v.default.decode(n),o=r[64];return jd({r:`0x${Ff.from(r.slice(0,32)).toString("hex")}`,s:`0x${Ff.from(r.slice(32,64)).toString("hex")}`,v:BigInt(o+27)})}}}async createMiddleAccount(e){try{return(await this.middleAccountApi.post("/create",e)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to create middle account")}}async getCoinbaseOnrampUrlForMiddleAccount(e){try{const t={sessionToken:await this.fetchCoinbaseToken(e.middleAccountAddress,e.network===exports.Network.Solana?"solana":"ethereum"),presetCryptoAmount:Number(e.amount),redirectUrl:e.redirectUrl||window.location.href};return kf(t)}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get Coinbase onramp URL")}}async getOrderState(e){try{return(await this.middleAccountApi.get(`/order/${e}`)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get order status")}}async transfer(e){var t,n,r;const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",from:e.from,to:e.to,amount:e.amount,decimals:e.decimals,token:e.token,network:e.network,chain_id:e.chain_id};try{return(await this.api.post("/v3/sign/transfer",o,{withCredentials:!0})).data}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Transfer failed")}}async buildTransaction(e){var t,n;try{return(await this.api.post("/v3/sign/build_transaction",e,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build transaction")}}async exportInit(e){var t,n;const r={user_nonce:Ph(),account_index:e};try{return(await this.api.post("/export/init",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to initialize export")}}async exportFinal(e){var t,n,r;const o={user_nonce:e.userNonce,server_nonce:e.serverNonce,account_index:e.accountIndex,is_export:null===(t=e.isExport)||void 0===t||t};try{return(await this.api.post("/export/final",o,{withCredentials:!0})).data}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to finalize export")}}async getExportedWallets(e){var t,n;const r={account_index:e,is_export:!1};try{return(await this.api.post("/export/final",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to retrieve exported wallets")}}async closeInit(){var e,t;const n={user_nonce:Ph()};try{return(await this.api.post("/close/init",n,{withCredentials:!0})).data}catch(n){if(null===(t=null===(e=n.response)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error)throw new Error(n.response.data.error);throw new Error(n instanceof Error?n.message:"Failed to initialize account closure")}}async closeFinal(e){var t,n;const r={user_nonce:e.userNonce,server_nonce:e.serverNonce};try{const e=await this.api.post("/close/final",r,{withCredentials:!0});return this.setWalletInfo(null),$.clear(),e.data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to close account")}}async signV1(e){var t,n,r;const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,message:e.message};try{return(await this.api.post("/v1/sign",o,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to sign message")}}async signV2(e){var t,n,r;const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,tx:e.tx};try{return(await this.api.post("/v2/sign",o,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signV3(e){var t,n,r;if(e.network!==exports.Network.Solana)throw new Error("v3 sign API only supports Solana transactions");if(!e.tx.Solana)throw new Error("Solana transaction is required for v3 sign API");const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,tx:{Solana:e.tx.Solana}};try{return(await this.api.post("/v3/sign",o,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async lighterBuildTransaction(e,t){var n,r;try{const n={...e,wallet_address:t||e.wallet_address||null};return(await this.api.post("/v3/lighter/build_transaction",n,{withCredentials:!0})).data}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build Lighter transaction")}}async lighterAuth(e){var t,n;const r={account_index:e.lighter_account_index,wallet_address:e.wallet_address||null,expires_in_ms:e.expires_in_ms||null};try{return(await this.api.post("/v3/lighter/auth",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to generate Lighter auth token")}}async lighterChangeKey(e){var t,n;if(e.lighter_account_index<0)throw new Error("accountIndex must be non-negative");const r={account_index:e.lighter_account_index,wallet_address:e.wallet_address||null};try{return(await this.api.post("/v3/lighter/change_key",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to change Lighter key")}}async exchange(e){var t,n;try{return(await this.api.post("/v3/sign/exchange",e,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build exchange transaction")}}}var Ah=function(){return Ah=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ah.apply(this,arguments)};function Ih(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Sh(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}"function"==typeof SuppressedError&&SuppressedError;var Nh=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Th=Sh(function(e){return Nh.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),$h="-ms-",Bh="-moz-",Ch="-webkit-",Oh="comm",_h="rule",Rh="decl",zh="@keyframes",Mh=Math.abs,Lh=String.fromCharCode,Fh=Object.assign;function jh(e){return e.trim()}function Uh(e,t){return(e=t.exec(e))?e[0]:e}function Dh(e,t,n){return e.replace(t,n)}function Gh(e,t,n){return e.indexOf(t,n)}function qh(e,t){return 0|e.charCodeAt(t)}function Vh(e,t,n){return e.slice(t,n)}function Wh(e){return e.length}function Hh(e){return e.length}function Yh(e,t){return t.push(e),e}function Zh(e,t){return e.filter(function(e){return!Uh(e,t)})}var Kh=1,Jh=1,Qh=0,Xh=0,ep=0,tp="";function np(e,t,n,r,o,s,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:s,line:Kh,column:Jh,length:a,return:"",siblings:i}}function rp(e,t){return Fh(np("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function op(e){for(;e.root;)e=rp(e.root,{children:[e]});Yh(e,e.siblings)}function sp(){return ep=Xh>0?qh(tp,--Xh):0,Jh--,10===ep&&(Jh=1,Kh--),ep}function ap(){return ep=Xh<Qh?qh(tp,Xh++):0,Jh++,10===ep&&(Jh=1,Kh++),ep}function ip(){return qh(tp,Xh)}function cp(){return Xh}function up(e,t){return Vh(tp,e,t)}function lp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function dp(e){return jh(up(Xh-1,pp(91===e?e+2:40===e?e+1:e)))}function fp(e){for(;(ep=ip())&&ep<33;)ap();return lp(e)>2||lp(ep)>3?"":" "}function hp(e,t){for(;--t&&ap()&&!(ep<48||ep>102||ep>57&&ep<65||ep>70&&ep<97););return up(e,cp()+(t<6&&32==ip()&&32==ap()))}function pp(e){for(;ap();)switch(ep){case e:return Xh;case 34:case 39:34!==e&&39!==e&&pp(ep);break;case 40:41===e&&pp(e);break;case 92:ap()}return Xh}function mp(e,t){for(;ap()&&e+ep!==57&&(e+ep!==84||47!==ip()););return"/*"+up(t,Xh-1)+"*"+Lh(47===e?e:ap())}function gp(e){for(;!lp(ip());)ap();return up(e,Xh)}function bp(e){return function(e){return tp="",e}(yp("",null,null,null,[""],e=function(e){return Kh=Jh=1,Qh=Wh(tp=e),Xh=0,[]}(e),0,[0],e))}function yp(e,t,n,r,o,s,a,i,c){for(var u=0,l=0,d=a,f=0,h=0,p=0,m=1,g=1,b=1,y=0,w="",v=o,x=s,E=r,P=w;g;)switch(p=y,y=ap()){case 40:if(108!=p&&58==qh(P,d-1)){-1!=Gh(P+=Dh(dp(y),"&","&\f"),"&\f",Mh(u?i[u-1]:0))&&(b=-1);break}case 34:case 39:case 91:P+=dp(y);break;case 9:case 10:case 13:case 32:P+=fp(p);break;case 92:P+=hp(cp()-1,7);continue;case 47:switch(ip()){case 42:case 47:Yh(vp(mp(ap(),cp()),t,n,c),c);break;default:P+="/"}break;case 123*m:i[u++]=Wh(P)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+l:-1==b&&(P=Dh(P,/\f/g,"")),h>0&&Wh(P)-d&&Yh(h>32?xp(P+";",r,n,d-1,c):xp(Dh(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(Yh(E=wp(P,t,n,u,l,o,i,w,v=[],x=[],d,s),s),123===y)if(0===l)yp(P,t,E,E,v,s,d,i,x);else switch(99===f&&110===qh(P,3)?100:f){case 100:case 108:case 109:case 115:yp(e,E,E,r&&Yh(wp(e,E,E,0,0,o,i,w,o,v=[],d,x),x),o,x,d,i,r?v:x);break;default:yp(P,E,E,E,[""],x,0,i,x)}}u=l=h=0,m=b=1,w=P="",d=a;break;case 58:d=1+Wh(P),h=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==sp())continue;switch(P+=Lh(y),y*m){case 38:b=l>0?1:(P+="\f",-1);break;case 44:i[u++]=(Wh(P)-1)*b,b=1;break;case 64:45===ip()&&(P+=dp(ap())),f=ip(),l=d=Wh(w=P+=gp(cp())),y++;break;case 45:45===p&&2==Wh(P)&&(m=0)}}return s}function wp(e,t,n,r,o,s,a,i,c,u,l,d){for(var f=o-1,h=0===o?s:[""],p=Hh(h),m=0,g=0,b=0;m<r;++m)for(var y=0,w=Vh(e,f+1,f=Mh(g=a[m])),v=e;y<p;++y)(v=jh(g>0?h[y]+" "+w:Dh(w,/&\f/g,h[y])))&&(c[b++]=v);return np(e,t,n,0===o?_h:i,c,u,l,d)}function vp(e,t,n,r){return np(e,t,n,Oh,Lh(ep),Vh(e,2,-2),0,r)}function xp(e,t,n,r,o){return np(e,t,n,Rh,Vh(e,0,r),Vh(e,r+1,-1),r,o)}function Ep(e,t,n){switch(function(e,t){return 45^qh(e,0)?(((t<<2^qh(e,0))<<2^qh(e,1))<<2^qh(e,2))<<2^qh(e,3):0}(e,t)){case 5103:return Ch+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ch+e+e;case 4789:return Bh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ch+e+Bh+e+$h+e+e;case 5936:switch(qh(e,t+11)){case 114:return Ch+e+$h+Dh(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ch+e+$h+Dh(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ch+e+$h+Dh(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ch+e+$h+e+e;case 6165:return Ch+e+$h+"flex-"+e+e;case 5187:return Ch+e+Dh(e,/(\w+).+(:[^]+)/,Ch+"box-$1$2"+$h+"flex-$1$2")+e;case 5443:return Ch+e+$h+"flex-item-"+Dh(e,/flex-|-self/g,"")+(Uh(e,/flex-|baseline/)?"":$h+"grid-row-"+Dh(e,/flex-|-self/g,""))+e;case 4675:return Ch+e+$h+"flex-line-pack"+Dh(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ch+e+$h+Dh(e,"shrink","negative")+e;case 5292:return Ch+e+$h+Dh(e,"basis","preferred-size")+e;case 6060:return Ch+"box-"+Dh(e,"-grow","")+Ch+e+$h+Dh(e,"grow","positive")+e;case 4554:return Ch+Dh(e,/([^-])(transform)/g,"$1"+Ch+"$2")+e;case 6187:return Dh(Dh(Dh(e,/(zoom-|grab)/,Ch+"$1"),/(image-set)/,Ch+"$1"),e,"")+e;case 5495:case 3959:return Dh(e,/(image-set\([^]*)/,Ch+"$1$`$1");case 4968:return Dh(Dh(e,/(.+:)(flex-)?(.*)/,Ch+"box-pack:$3"+$h+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ch+e+e;case 4200:if(!Uh(e,/flex-|baseline/))return $h+"grid-column-align"+Vh(e,t)+e;break;case 2592:case 3360:return $h+Dh(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,Uh(e.props,/grid-\w+-end/)})?~Gh(e+(n=n[t].value),"span",0)?e:$h+Dh(e,"-start","")+e+$h+"grid-row-span:"+(~Gh(n,"span",0)?Uh(n,/\d+/):+Uh(n,/\d+/)-+Uh(e,/\d+/))+";":$h+Dh(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return Uh(e.props,/grid-\w+-start/)})?e:$h+Dh(Dh(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Dh(e,/(.+)-inline(.+)/,Ch+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Wh(e)-1-t>6)switch(qh(e,t+1)){case 109:if(45!==qh(e,t+4))break;case 102:return Dh(e,/(.+:)(.+)-([^]+)/,"$1"+Ch+"$2-$3$1"+Bh+(108==qh(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Gh(e,"stretch",0)?Ep(Dh(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Dh(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,s,a,i){return $h+n+":"+r+i+(o?$h+n+"-span:"+(s?a:+a-+r)+i:"")+e});case 4949:if(121===qh(e,t+6))return Dh(e,":",":"+Ch)+e;break;case 6444:switch(qh(e,45===qh(e,14)?18:11)){case 120:return Dh(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ch+(45===qh(e,14)?"inline-":"")+"box$3$1"+Ch+"$2$3$1"+$h+"$2box$3")+e;case 100:return Dh(e,":",":"+$h)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Dh(e,"scroll-","scroll-snap-")+e}return e}function Pp(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function kp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Rh:return e.return=e.return||e.value;case Oh:return"";case zh:return e.return=e.value+"{"+Pp(e.children,r)+"}";case _h:if(!Wh(e.value=e.props.join(",")))return""}return Wh(n=Pp(e.children,r))?e.return=e.value+"{"+n+"}":""}function Ap(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Rh:return void(e.return=Ep(e.value,e.length,n));case zh:return Pp([rp(e,{value:Dh(e.value,"@","@"+Ch)})],r);case _h:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch(Uh(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":op(rp(e,{props:[Dh(t,/:(read-\w+)/,":-moz-$1")]})),op(rp(e,{props:[t]})),Fh(e,{props:Zh(n,r)});break;case"::placeholder":op(rp(e,{props:[Dh(t,/:(plac\w+)/,":"+Ch+"input-$1")]})),op(rp(e,{props:[Dh(t,/:(plac\w+)/,":-moz-$1")]})),op(rp(e,{props:[Dh(t,/:(plac\w+)/,$h+"input-$1")]})),op(rp(e,{props:[t]})),Fh(e,{props:Zh(n,r)})}return""})}}var Ip={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Sp="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Np="active",Tp="data-styled-version",$p="6.1.19",Bp="/*!sc*/\n",Cp="undefined"!=typeof window&&"undefined"!=typeof document,Op=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),_p=/invalid hook call/i,Rp=new Set,zp=function(e,t){if("production"!==process.env.NODE_ENV){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n",s=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];_p.test(e)?(a=!1,Rp.delete(r)):s.apply(void 0,Ih([e],t,!1))},o.useRef(),a&&!Rp.has(r)&&(console.warn(r),Rp.add(r))}catch(e){_p.test(e.message)&&Rp.delete(r)}finally{console.error=s}}},Mp=Object.freeze([]),Lp=Object.freeze({});var Fp=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),jp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Up=/(^-|-$)/g;function Dp(e){return e.replace(jp,"-").replace(Up,"")}var Gp=/(a)(d)/gi,qp=function(e){return String.fromCharCode(e+(e>25?39:97))};function Vp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=qp(t%52)+n;return(qp(t%52)+n).replace(Gp,"$1-$2")}var Wp,Hp=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Yp=function(e){return Hp(5381,e)};function Zp(e){return Vp(Yp(e)>>>0)}function Kp(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Jp(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Qp="function"==typeof Symbol&&Symbol.for,Xp=Qp?Symbol.for("react.memo"):60115,em=Qp?Symbol.for("react.forward_ref"):60112,tm={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},nm={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},rm={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},om=((Wp={})[em]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Wp[Xp]=rm,Wp);function sm(e){return("type"in(t=e)&&t.type.$$typeof)===Xp?rm:"$$typeof"in e?om[e.$$typeof]:tm;var t}var am=Object.defineProperty,im=Object.getOwnPropertyNames,cm=Object.getOwnPropertySymbols,um=Object.getOwnPropertyDescriptor,lm=Object.getPrototypeOf,dm=Object.prototype;function fm(e,t,n){if("string"!=typeof t){if(dm){var r=lm(t);r&&r!==dm&&fm(e,r,n)}var o=im(t);cm&&(o=o.concat(cm(t)));for(var s=sm(e),a=sm(t),i=0;i<o.length;++i){var c=o[i];if(!(c in nm||n&&n[c]||a&&c in a||s&&c in s)){var u=um(t,c);try{am(e,c,u)}catch(e){}}}}return e}function hm(e){return"function"==typeof e}function pm(e){return"object"==typeof e&&"styledComponentId"in e}function mm(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function gm(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function bm(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ym(e,t,n){if(void 0===n&&(n=!1),!n&&!bm(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=ym(e[r],t[r]);else if(bm(t))for(var r in t)e[r]=ym(e[r],t[r]);return e}function wm(e,t){Object.defineProperty(e,"toString",{value:t})}var vm="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function xm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function Em(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(xm.apply(void 0,Ih([vm[e]],t,!1)).trim())}var Pm=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw Em(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),i=(s=0,t.length);s<i;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(Bp);return t},e}(),km=1<<30,Am=new Map,Im=new Map,Sm=1,Nm=function(e){if(Am.has(e))return Am.get(e);for(;Im.has(Sm);)Sm++;var t=Sm++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>km))throw Em(16,"".concat(t));return Am.set(e,t),Im.set(t,e),t},Tm=function(e,t){Sm=t+1,Am.set(e,t),Im.set(t,e)},$m="style[".concat(Sp,"][").concat(Tp,'="').concat($p,'"]'),Bm=new RegExp("^".concat(Sp,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Cm=function(e,t,n){for(var r,o=n.split(","),s=0,a=o.length;s<a;s++)(r=o[s])&&e.registerName(t,r)},Om=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(Bp),o=[],s=0,a=r.length;s<a;s++){var i=r[s].trim();if(i){var c=i.match(Bm);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(Tm(l,u),Cm(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(i)}}},_m=function(e){for(var t=document.querySelectorAll($m),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(Sp)!==Np&&(Om(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var Rm=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(Sp,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(Sp,Np),r.setAttribute(Tp,$p);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,s),r},zm=function(){function e(e){this.element=Rm(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw Em(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Mm=function(){function e(e){this.element=Rm(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Lm=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Fm=Cp,jm={isServer:!Cp,useCSSOMInjection:!Op},Um=function(){function e(e,t,n){void 0===e&&(e=Lp),void 0===t&&(t={});var r=this;this.options=Ah(Ah({},jm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&Cp&&Fm&&(Fm=!1,_m(this)),wm(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return Im.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),a=t.getGroup(n);if(void 0===s||!s.size||0===a.length)return"continue";var i="".concat(Sp,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(a).concat(i,'{content:"').concat(c,'"}').concat(Bp)},s=0;s<n;s++)o(s);return r}(r)})}return e.registerId=function(e){return Nm(e)},e.prototype.rehydrate=function(){!this.server&&Cp&&_m(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Ah(Ah({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Lm(n):t?new zm(n):new Mm(n)}(this.options),new Pm(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(Nm(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(Nm(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(Nm(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Dm=/&/g,Gm=/^\s*\/\/.*$/gm;function qm(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=qm(e.children,t)),e})}var Vm=new Um,Wm=function(){var e,t,n,r=Lp,o=r.options,s=void 0===o?Lp:o,a=r.plugins,i=void 0===a?Mp:a,c=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},u=i.slice();u.push(function(e){e.type===_h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Dm,t).replace(n,c))}),s.prefix&&u.push(Ap),u.push(kp);var l=function(r,o,a,i){void 0===o&&(o=""),void 0===a&&(a=""),void 0===i&&(i="&"),e=i,t=o,n=new RegExp("\\".concat(t,"\\b"),"g");var c=r.replace(Gm,""),l=bp(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);s.namespace&&(l=qm(l,s.namespace));var d,f=[];return Pp(l,function(e){var t=Hh(e);return function(n,r,o,s){for(var a="",i=0;i<t;i++)a+=e[i](n,r,o,s)||"";return a}}(u.concat((d=function(e){return f.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),f};return l.hash=i.length?i.reduce(function(e,t){return t.name||Em(15),Hp(e,t.name)},5381).toString():"",l}(),Hm=x.default.createContext({shouldForwardProp:void 0,styleSheet:Vm,stylis:Wm});function Ym(){return o.useContext(Hm)}Hm.Consumer,x.default.createContext(void 0);var Zm=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Wm);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,wm(this,function(){throw Em(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Wm),this.name+e.hash},e}(),Km=function(e){return e>="A"&&e<="Z"};function Jm(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Km(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Qm=function(e){return null==e||!1===e||""===e},Xm=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!Qm(s)&&(Array.isArray(s)&&s.isCss||hm(s)?r.push("".concat(Jm(o),":"),s,";"):bm(s)?r.push.apply(r,Ih(Ih(["".concat(o," {")],Xm(s),!1),["}"],!1)):r.push("".concat(Jm(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in Ip||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function eg(e,t,n,r){if(Qm(e))return[];if(pm(e))return[".".concat(e.styledComponentId)];if(hm(e)){if(!hm(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Zm||bm(o)||null===o||console.error("".concat(Kp(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),eg(o,t,n,r)}var s;return e instanceof Zm?n?(e.inject(n,r),[e.getName(r)]):[e]:bm(e)?Xm(e):Array.isArray(e)?Array.prototype.concat.apply(Mp,e.map(function(e){return eg(e,t,n,r)})):[e.toString()]}var tg=Yp($p),ng=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(hm(n)&&!pm(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Hp(tg,t),this.baseStyle=n,Um.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=mm(r,this.staticRulesId);else{var o=gm(eg(this.rules,e,t,n)),s=Vp(Hp(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var a=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,a)}r=mm(r,s),this.staticRulesId=s}else{for(var i=Hp(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l,"production"!==process.env.NODE_ENV&&(i=Hp(i,l));else if(l){var d=gm(eg(l,e,t,n));i=Hp(i,d+u),c+=d}}if(c){var f=Vp(i>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,n(c,".".concat(f),void 0,this.componentId)),r=mm(r,f)}}return r},e}(),rg=x.default.createContext(void 0);rg.Consumer;var og={},sg=new Set;function ag(e,t,n){var r=pm(e),s=e,a=!Jp(e),i=t.attrs,c=void 0===i?Mp:i,u=t.componentId,l=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Dp(e);og[n]=(og[n]||0)+1;var r="".concat(n,"-").concat(Zp($p+n+og[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Jp(e)?"styled.".concat(e):"Styled(".concat(Kp(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(Dp(t.displayName),"-").concat(t.componentId):t.componentId||l,p=r&&s.attrs?s.attrs.concat(c).filter(Boolean):c,m=t.shouldForwardProp;if(r&&s.shouldForwardProp){var g=s.shouldForwardProp;if(t.shouldForwardProp){var b=t.shouldForwardProp;m=function(e,t){return g(e,t)&&b(e,t)}}else m=g}var y=new ng(n,h,r?s.componentStyle:void 0);function w(e,t){return function(e,t,n){var r=e.attrs,s=e.componentStyle,a=e.defaultProps,i=e.foldedComponentIds,c=e.styledComponentId,u=e.target,l=x.default.useContext(rg),d=Ym(),f=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue(c);var h=function(e,t,n){return void 0===n&&(n=Lp),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,a)||Lp,p=function(e,t,n){for(var r,o=Ah(Ah({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=hm(r=e[s])?r(o):r;for(var i in a)o[i]="className"===i?mm(o[i],a[i]):"style"===i?Ah(Ah({},o[i]),a[i]):a[i]}return t.className&&(o.className=mm(o.className,t.className)),o}(r,t,h),m=p.as||u,g={};for(var b in p)void 0===p[b]||"$"===b[0]||"as"===b||"theme"===b&&p.theme===h||("forwardedAs"===b?g.as=p.forwardedAs:f&&!f(b,m)||(g[b]=p[b],f||"development"!==process.env.NODE_ENV||Th(b)||sg.has(b)||!Fp.has(m)||(sg.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var y=function(e,t){var n=Ym(),r=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&o.useDebugValue(r),r}(s,p);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(y);var w=mm(i,c);return y&&(w+=" "+y),p.className&&(w+=" "+p.className),g[Jp(m)&&!Fp.has(m)?"class":"className"]=w,n&&(g.ref=n),o.createElement(m,g)}(v,e,t)}w.displayName=f;var v=x.default.forwardRef(w);return v.attrs=p,v.componentStyle=y,v.displayName=f,v.shouldForwardProp=m,v.foldedComponentIds=r?mm(s.foldedComponentIds,s.styledComponentId):"",v.styledComponentId=h,v.target=r?s.target:e,Object.defineProperty(v,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)ym(e,o[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(zp(f,h),v.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,h)),wm(v,function(){return".".concat(v.styledComponentId)}),a&&fm(v,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),v}function ig(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var cg=function(e){return Object.assign(e,{isCss:!0})};function ug(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(hm(e)||bm(e))return cg(eg(ig(Mp,Ih([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?eg(r):cg(eg(ig(r,t)))}function lg(e,t,n){if(void 0===n&&(n=Lp),!t)throw Em(1,t);var r=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,ug.apply(void 0,Ih([r],o,!1)))};return r.attrs=function(r){return lg(e,t,Ah(Ah({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return lg(e,t,Ah(Ah({},n),r))},r}var dg=function(e){return lg(ag,e)},fg=dg;Fp.forEach(function(e){fg[e]=dg(e)}),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var hg="__sc-".concat(Sp,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[hg]||(window[hg]=0),1===window[hg]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[hg]+=1);const pg={colors:{black:"#000000",white:"#FFFFFF",offWhite:"#F5F5F5",grey:{100:"#F7F7F7",200:"#E6E6E6",300:"#D1D1D1",400:"#B0B0B0",500:"#8C8C8C",600:"#696969",700:"#474747",800:"#2B2B2B",900:"#1A1A1A"},primary:"#000000",secondary:"#B0B0B0",error:"#FF4D4D",success:"#4CAF50",background:{main:"#FFFFFF",secondary:"#F5F5F5",overlay:"rgba(0, 0, 0, 0.7)"},text:{primary:"#000000",secondary:"#474747",tertiary:"#8C8C8C",inverse:"#FFFFFF"},button:{primary:{background:"#000000",text:"#FFFFFF",hover:"#2B2B2B",disabled:"#8C8C8C"},secondary:{background:"#F5F5F5",text:"#000000",hover:"#E6E6E6",disabled:"#D1D1D1"}},border:{light:"#E6E6E6",medium:"#D1D1D1",dark:"#8C8C8C"}},typography:{fontFamily:"'Montserrat', 'Arial', sans-serif",fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeights:{light:300,regular:400,medium:500,semibold:600,bold:700}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},shadows:{none:"none",sm:"0 1px 2px rgba(0, 0, 0, 0.05)",md:"0 4px 6px rgba(0, 0, 0, 0.05)",lg:"0 10px 15px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.1s ease",normal:"0.2s ease",slow:"0.3s ease"}},mg=(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var r=gm(ug.apply(void 0,Ih([e],t,!1))),o=Zp(r);return new Zm(o,r)})`
|
|
12
|
+
const Zl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Kl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Jl=BigInt(0),Ql=BigInt(1),Xl=BigInt(2),ed=(e,t)=>(e+t/Xl)/t;const td=kl(Zl,void 0,void 0,{sqrt:function(e){const t=Zl,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),i=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,d=ml(l,n,t)*l%t,f=ml(d,n,t)*l%t,h=ml(f,Xl,t)*u%t,p=ml(h,o,t)*h%t,m=ml(p,s,t)*p%t,g=ml(m,i,t)*m%t,b=ml(g,c,t)*g%t,y=ml(b,i,t)*m%t,w=ml(y,n,t)*l%t,v=ml(w,a,t)*p%t,x=ml(v,r,t)*u%t,E=ml(x,Xl,t);if(!td.eql(td.sqr(E),e))throw new Error("Cannot find square root");return E}}),nd=function(e,t){const n=t=>Hl({...e,...Yl(t)});return{...n(t),create:n}}({a:Jl,b:BigInt(7),Fp:td,n:Kl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Kl,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ql*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),i=ed(s*e,t),c=ed(-r*e,t);let u=pl(e-i*n-c*o,t),l=pl(-i*r-c*s,t);const d=u>a,f=l>a;if(d&&(u=t-u),f&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:l}}}},Cs);var rd=Object.freeze({__proto__:null,secp256k1:nd});function od(e,t={}){const{recovered:n}=t;if(void 0===e.r)throw new ud({signature:e});if(void 0===e.s)throw new ud({signature:e});if(n&&void 0===e.yParity)throw new ud({signature:e});if(e.r<0n||e.r>zu)throw new ld({value:e.r});if(e.s<0n||e.s>zu)throw new dd({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new fd({value:e.yParity})}function sd(e){if(130!==e.length&&132!==e.length)throw new cd({signature:e});const t=BigInt(wi(e,0,32)),n=BigInt(wi(e,32,64)),r=(()=>{const t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return id(t)}catch{throw new fd({value:t})}})();return void 0===r?{r:t,s:n}:{r:t,s:n,yParity:r}}function ad(e){if(void 0!==e.r&&void 0!==e.s)return function(e){const t="string"==typeof e?sd(e):e instanceof Uint8Array?function(e){return sd(pi(e))}(e):"string"==typeof e.r?function(e){const t=(()=>{const t=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof n&&(n=id(t)),"number"!=typeof n)throw new fd({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?function(e){return{r:e.r,s:e.s,yParity:id(e.v)}}(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return od(t),t}(e)}function id(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return e%2==0?1:0;throw new hd({value:e})}class cd extends Ra{constructor({signature:e}){var t;super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${vi((t=e,t instanceof Uint8Array?pi(t):Array.isArray(t)?pi(new Uint8Array(t)):t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class ud extends Ra{constructor({signature:e}){super(`Signature \`${Ya(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class ld extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class dd extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class fd extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class hd extends Ra{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function pd(e,t={}){return"string"==typeof e.chainId?function(e){const{address:t,chainId:n,nonce:r}=e,o=ad(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}(e):{...e,...t.signature}}const md=Ju("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function gd(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==wi(e,-32))throw new bd(e)}else od(e.authorization)}let bd=class extends Ra{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};async function yd(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",a=void 0!==n?Vt(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?jt(e.nonce):void 0,storageProof:e.storageProof?(t=e.storageProof,t.map(e=>({...e,value:BigInt(e.value)}))):void 0};var t}(await e.request({method:"eth_getProof",params:[t,o,a||s]}))}async function wd(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){const a=r||"latest",i=void 0!==n?Vt(n):void 0;let c=null;if(c=o?await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,Vt(s)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||a,Vt(s)]},{dedupe:Boolean(i)}),!c)throw new Hr({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||gs)(c)}async function vd(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Yr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||yc)(n)}async function xd(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:a,validation:i}=t;try{const t=[];for(const e of o){const n=e.blockOverrides?Bi(e.blockOverrides):void 0,r=e.calls.map(e=>{const t=e,n=t.account?pr(t.account):void 0,r=t.abi?gr(t):t.data,o={...t,data:t.dataSuffix?Hn([r||"0x",t.dataSuffix]):r,from:t.from??n?.address};return ls(o),ss(o)}),o=e.stateOverrides?cs(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:o})}const c=("bigint"==typeof n?Vt(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:s,traceTransfers:a,validation:i},c]})).map((e,t)=>({...bs(e),calls:e.calls.map((e,n)=>{const{abi:r,args:s,functionName:a,to:i}=o[t].calls[n],c=e.error?.data??e.returnData,u=BigInt(e.gasUsed),l=e.logs?.map(e=>Js(e)),d="0x1"===e.status?"success":"failure",f=r&&"success"===d&&"0x"!==c?ta({abi:r,data:c,functionName:a}):null,h=(()=>{if("success"===d)return;let t;return"0x"===e.error?.data?t=new at:e.error&&(t=new to(e.error)),t?Ro(t,{abi:r??[],address:i??"0x",args:s,functionName:a??"<unknown>"}):void 0})();return{data:c,gasUsed:u,logs:l,status:d,..."success"===d?{result:f}:{error:h}}})}))}catch(e){const t=e,n=ns(t,{});if(n instanceof ts)throw t;throw n}}function Ed(e){let t=!0,n="",r=0,o="",s=!1;for(let a=0;a<e.length;a++){const i=e[a];if(["(",")",","].includes(i)&&(t=!0),"("===i&&r++,")"===i&&r--,t)if(0!==r)" "!==i?(o+=i,n+=i):","!==e[a-1]&&","!==n&&",("!==n&&(n="",t=!1);else if(" "===i&&["event","function","error",""].includes(o))o="";else if(o+=i,")"===i){s=!0;break}}if(!s)throw new Ra("Unable to normalize signature.");return o}function Pd(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Tu(e,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:return"tuple"===r&&"components"in t?Object.values(t.components).every((t,n)=>Pd(Object.values(e)[n],t)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?"number"===n||"bigint"===n:/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?"string"===n||e instanceof Uint8Array:!!/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)&&(Array.isArray(e)&&e.every(e=>Pd(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function kd(e,t,n){for(const r in e){const o=e[r],s=t[r];if("tuple"===o.type&&"tuple"===s.type&&"components"in o&&"components"in s)return kd(o.components,s.components,n[r]);const a=[o.type,s.type];if((()=>!(!a.includes("address")||!a.includes("bytes20"))||(a.includes("address")&&a.includes("string")||!(!a.includes("address")||!a.includes("bytes")))&&Tu(n[r],{strict:!1}))())return a}}function Ad(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||"string"==typeof e?Ve(e):e;return{...r,...n?{hash:Nd(r)}:{}}}function Id(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=Pi(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?Sd(e)===wi(t,0,4):"event"===e.type&&Nd(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new $d({name:t});if(1===a.length)return{...a[0],...o?{hash:Nd(a[0])}:{}};let i;for(const e of a){if(!("inputs"in e))continue;if(!r||0===r.length){if(!e.inputs||0===e.inputs.length)return{...e,...o?{hash:Nd(e)}:{}};continue}if(!e.inputs)continue;if(0===e.inputs.length)continue;if(e.inputs.length!==r.length)continue;const t=r.every((t,n)=>{const r="inputs"in e&&e.inputs[n];return!!r&&Pd(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=kd(e.inputs,i.inputs,r);if(t)throw new Td({abiItem:e,type:t[0]},{abiItem:i,type:t[1]})}i=e}}const c=(()=>{if(i)return i;const[e,...t]=a;return{...e,overloads:t}})();if(!c)throw new $d({name:t});return{...c,...o?{hash:Nd(c)}:{}}}function Sd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return Id(t,n)}return e[0]})();return wi(Nd(t),0,4)}function Nd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return Id(t,n)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:Au(gi(function(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return Id(t,n)}return e[0]})();return Ed("string"==typeof t?t:se(t))}(t)))}class Td extends Ra{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${Ed(se(e.abiItem))}\`, and`,`\`${t.type}\` in \`${Ed(se(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:"AbiItem.AmbiguityError"})}}class $d extends Ra{constructor({name:e,data:t,type:n="item"}){super(`ABI ${n}${e?` with name "${e}"`:t?` with data "${t}"`:""} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function Bd(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new $d({name:"constructor"});return t}function Cd(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[t,n,r]=e;return[_d(t,n,{args:r}),r]}const[t,n]=e;return[t,n]})(),{overloads:r}=t,o=r?_d([t,...r],t.name,{args:n}):t,s=Sd(o);const a=n.length>0?Zu(o.inputs,n):void 0;return a?fi(s,a):s}function Od(e,t={}){return Ad(e,t)}function _d(e,t,n){const r=Id(e,t,n);if("function"!==r.type)throw new $d({name:t,type:"function"});return r}const Rd="0x0000000000000000000000000000000000000000";async function zd(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:a,traceTransfers:i,validation:c}=t,u=t.account?pr(t.account):void 0;if(a&&!u)throw new tt("`account` is required when `traceAssetChanges` is true");const l=u?function(...e){const[t,n]=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return[Bd(t),n]}return e})(),{bytecode:r,args:o}=n;return fi(r,t.inputs?.length&&o?.length?Zu(t.inputs,o):"0x")}(Ad("constructor(bytes, bytes)"),{bytecode:Di,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",Cd(Od("function getBalance(address)"),[u.address])]}):void 0;const d=a?await Promise.all(t.calls.map(async t=>{if(!t.data&&!t.abi)return;const{accessList:n}=await Hc(e,{account:u.address,...t,data:t.abi?gr(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await xd(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:l}],stateOverrides:s},{calls:d.map((e,t)=>({abi:[Od("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]}]:[],{calls:[...o,{}].map(e=>({...e,from:u?.address})),stateOverrides:s},...a?[{calls:[{data:l}]},{calls:d.map((e,t)=>({abi:[Od("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Od("function decimals() returns (uint256)")],functionName:"decimals",from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Od("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Od("function symbol() returns (string)")],functionName:"symbol",from:Rd,nonce:t})),stateOverrides:[{address:Rd,nonce:0}]}]:[]],traceTransfers:i,validation:c}),h=a?f[2]:f[0],[p,m,,g,b,y,w,v]=a?f:[],{calls:x,...E}=h,P=x.slice(0,-1)??[],k=[...p?.calls??[],...m?.calls??[]].map(e=>"success"===e.status?Ft(e.data):null),A=[...g?.calls??[],...b?.calls??[]].map(e=>"success"===e.status?Ft(e.data):null),I=(y?.calls??[]).map(e=>"success"===e.status?e.result:null),S=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(w?.calls??[]).map(e=>"success"===e.status?e.result:null),T=[];for(const[e,t]of A.entries()){const n=k[e];if("bigint"!=typeof t)continue;if("bigint"!=typeof n)continue;const r=I[e-1],o=S[e-1],s=N[e-1],a=(()=>0===e?{address:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",decimals:18,symbol:"ETH"}:{address:d[e-1],decimals:s||r?Number(r??1):void 0,symbol:o??void 0})();T.some(e=>e.token.address===a.address)||T.push({token:a,value:{pre:n,post:t,diff:t-n}})}return{assetChanges:T,block:E,results:P}}const Md="0x6492649264926492649264926492649264926492649264926492649264926492";function Ld(e){try{return function(e){if(wi(e,-32)!==Md)throw new Fd(e)}(e),!0}catch{return!1}}class Fd extends Ra{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function jd({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(0===o||1===o)return o;if(r&&(27n===r||28n===r||r>=35n))return r%2n==0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new nd.Signature(Ft(e),Ft(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===n?a:Qt(a)}async function Ud(e,t){const{address:n,hash:r,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??e.chain?.contracts?.erc6492Verifier?.address,multicallAddress:s=t.multicallAddress??e.chain?.contracts?.multicall3?.address}=t,a=(()=>{const e=t.signature;return Ke(e)?e:"object"==typeof e&&"r"in e&&"s"in e?jd(e):qt(e)})();try{return function(e){try{return gd(e),!0}catch{return!1}}(a)?await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:a}=t,{authorization:i,data:c,signature:u,to:l}=function(e){gd(e);const t=Ei(wi(e,-64,-32)),n=wi(e,-t-64,-64),r=wi(e,0,-t-64),[o,s,a]=Yu(md,n);return{authorization:pd({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...a&&"0x"!==a?{data:a,to:s}:{}}}(t.signature),d=await Kc(e,{address:n,blockNumber:r,blockTag:o});if(d===Yn(["0xef0100",i.address]))return await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:a}=t,i=await He(e,rc,"readContract")({address:n,abi:Fi,args:[s,a],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof Jr)throw new Dd;throw e});if(i.startsWith("0x1626ba7e"))return!0;throw new Dd}(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:u});const f={address:i.address,chainId:Number(i.chainId),nonce:Number(i.nonce),r:Vt(i.r,{size:32}),s:Vt(i.s,{size:32}),yParity:i.yParity},h=await async function({address:e,authorization:t,signature:n}){return Ws(Gn(e),await Do({authorization:t,signature:n}))}({address:n,authorization:f});if(!h)throw new Dd;const p=await He(e,rc,"readContract")({...a?{address:a}:{code:Vi},authorizationList:[f],abi:Ci,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??n,callData:c}]:[],{allowFailure:!0,target:n,callData:gr({abi:Fi,functionName:"isValidSignature",args:[s,u]})}]]}),m=p[p.length-1]?.returnData;if(m?.startsWith("0x1626ba7e"))return!0;throw new Dd}(e,{...t,multicallAddress:s,signature:a}):await async function(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:a,verifierAddress:i,...c}=t,u=await(async()=>r||o?Ld(a)?a:function(e){const{data:t,signature:n,to:r}=e;return fi(Zu(Ju("address, bytes, bytes"),[r,t,n]),Md)}({data:o,signature:a,to:r}):a)(),l=i?{to:i,data:gr({abi:ji,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:Zi({abi:ji,args:[n,s,u],bytecode:qi}),...c},{data:d}=await He(e,tc,"call")(l).catch(e=>{if(e instanceof Kr)throw new Dd;throw e});if(function(e,t={}){let n=e;if(t.size&&(Lt(n,{size:t.size}),n=Mt(n)),"0x00"===Mt(n))return!1;if("0x01"===Mt(n))return!0;throw new Rt(n)}(d??"0x0"))return!0;throw new Dd}(e,{...t,verifierAddress:o,signature:a})}catch(e){try{if(Ws(Gn(n),await Mo({hash:r,signature:a})))return!0}catch{}if(e instanceof Dd)return!1;throw e}}class Dd extends Error{}function Gd(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:a=e.pollingInterval}){let i;return(void 0!==s?s:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?ic(_r(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:o},r=>uc(async()=>{try{const t=await He(e,hc,"getBlockNumber")({cacheTime:0});if(void 0!==i){if(t===i)return;if(t-i>1&&n)for(let e=i+1n;e<t;e++)r.onBlockNumber(e,i),i=e}(void 0===i||t>i)&&(r.onBlockNumber(t,i),i=t)}catch(e){r.onError?.(e)}},{emitOnBegin:t,interval:a})):ic(_r(["watchBlockNumber",e.uid,t,n]),{onBlockNumber:r,onError:o},t=>{let n=!0,r=()=>n=!1;return(async()=>{try{const o=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await o.subscribe({params:["newHeads"],onData(e){if(!n)return;const r=Ft(e.result?.number);t.onBlockNumber(r,i),i=r},onError(e){t.onError?.(e)}});r=s,n||r()}catch(e){o?.(e)}})(),()=>r()})}const qd=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Vd=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;async function Wd(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:a,signature:i,time:c=new Date,...u}=t,l=function(e){const{scheme:t,statement:n,...r}=e.match(qd)?.groups??{},{chainId:o,expirationTime:s,issuedAt:a,notBefore:i,requestId:c,...u}=e.match(Vd)?.groups??{},l=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...r,...u,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...i?{notBefore:new Date(i)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}(o);if(!l.address)return!1;const d=function(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:a=new Date}=e;if(n&&r.domain!==n)return!1;if(o&&r.nonce!==o)return!1;if(s&&r.scheme!==s)return!1;if(r.expirationTime&&a>=r.expirationTime)return!1;if(r.notBefore&&a<r.notBefore)return!1;try{if(!r.address)return!1;if(!Wn(r.address,{strict:!1}))return!1;if(t&&!Ws(r.address,t))return!1}catch{return!1}return!0}({address:n,domain:r,message:l,nonce:s,scheme:a,time:c});if(!d)return!1;const f=du(o);return Ud(e,{address:l.address,hash:f,signature:i,...u})}function Hd(e){return{call:t=>tc(e,t),createAccessList:t=>Hc(e,t),createBlockFilter:()=>async function(e){const t=fr(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>hr(e,t),createEventFilter:t=>Yc(e,t),createPendingTransactionFilter:()=>Zc(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:a,...i}=t,c=gr({abi:n,args:o,functionName:s});try{return await He(e,Vs,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:r,...i})}catch(e){const t=i.account?pr(i.account):void 0;throw Ro(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}(e,t),estimateGas:t=>Vs(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o="bigint"==typeof n?Vt(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}(e,t),getBlobBaseFee:()=>async function(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}(e),getBlock:t=>ys(e,t),getBlockNumber:t=>hc(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=void 0!==n?Vt(n):void 0;let s;return s=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:Boolean(o)}),jt(s)}(e,t),getBytecode:t=>Kc(e,t),getChainId:()=>Us(e),getCode:t=>Kc(e,t),getContractEvents:t=>Xs(e,t),getEip712Domain:t=>async function(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[t,s,a,i,c,u,l]=await He(e,rc,"readContract")({abi:Qc,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:s,version:a,chainId:Number(i),verifyingContract:c,salt:u},extensions:l,fields:t}}catch(e){const t=e;if("ContractFunctionExecutionError"===t.name&&"ContractFunctionZeroDataError"===t.cause.name)throw new Jc({address:n});throw t}}(e,t),getEnsAddress:t=>async function(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ki({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(e=>s.endsWith(e)))return null;const d=null!=o?[Tc(s),BigInt(o)]:[Tc(s)];try{const t=gr({abi:Li,functionName:"addr",args:d}),o={address:u,abi:Ri,functionName:"resolveWithGateways",args:[Dt(Cc(s)),t,a??[Ic]],blockNumber:n,blockTag:r},i=He(e,rc,"readContract"),c=await i(o);if("0x"===c[0])return null;const l=ta({abi:Li,args:d,functionName:"addr",data:c[0]});return"0x"===l||"0x00"===Mt(l)?null:l}catch(e){if(i)throw e;if(Ec(e))return null;throw e}}(e,t),getEnsAvatar:t=>async function(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:a,universalResolverAddress:i}){const c=await He(e,Wc,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:i,gatewayUrls:s,strict:a});if(!c)return null;try{return await Vc(e,{record:c,gatewayUrls:r})}catch{return null}}(e,t),getEnsName:t=>async function(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:a,strict:i}=t,{chain:c}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ki({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const t={address:u,abi:zi,args:[n,s,a??[Ic]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},i=He(e,rc,"readContract"),[c]=await i(t);return c||null}catch(e){if(i)throw e;if(Ec(e))return null;throw e}}(e,t),getEnsResolver:t=>async function(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return Ki({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),i=s?.ensTlds;if(i&&!i.some(e=>o.endsWith(e)))throw new Error(`${o} is not a valid ENS TLD (${i?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await He(e,rc,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Dt(Cc(o))],blockNumber:n,blockTag:r});return c}(e,t),getEnsText:t=>Wc(e,t),getFeeHistory:t=>Xc(e,t),estimateFeesPerGas:t=>async function(e,t){return xs(e,t)}(e,t),getFilterChanges:e=>pc(0,e),getFilterLogs:e=>async function(e,{filter:t}){const n=t.strict??!1,r=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>Js(e));return t.abi?Ks({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>ws(e),getLogs:t=>Qs(e,t),getProof:t=>yd(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return vs(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=void 0!==n?Vt(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}(e,t),getTransaction:t=>wd(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([He(e,hc,"getBlockNumber")({}),t?He(e,wd,"getTransaction")({hash:t}):void 0]),s=n?.blockNumber||o?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>Es(e,t),getTransactionReceipt:t=>vd(e,t),multicall:t=>async function(e,t){const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:a,blockTag:i,stateOverride:c}=t,u=t.contracts,{batchSize:l=t.batchSize??1024,deployless:d=t.deployless??!1}="object"==typeof e.batch?.multicall?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Ki({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let p=0,m=0;for(let e=0;e<u.length;e++){const{abi:t,address:r,args:s,functionName:a}=u[e];try{const e=gr({abi:t,args:s,functionName:a});m+=(e.length-2)/2,l>0&&m>l&&h[p].length>0&&(p++,m=(e.length-2)/2,h[p]=[]),h[p]=[...h[p],{allowFailure:!0,callData:e,target:r}]}catch(e){const i=Ro(e,{abi:t,address:r,args:s,docsPath:"/docs/contract/multicall",functionName:a,sender:n});if(!o)throw i;h[p]=[...h[p],{allowFailure:!0,callData:"0x",target:r}]}}const g=await Promise.allSettled(h.map(t=>He(e,rc,"readContract")({...null===f?{code:Vi}:{address:f},abi:Ci,account:n,args:[t],authorizationList:r,blockNumber:s,blockOverrides:a,blockTag:i,functionName:"aggregate3",stateOverride:c}))),b=[];for(let e=0;e<g.length;e++){const t=g[e];if("rejected"===t.status){if(!o)throw t.reason;for(let n=0;n<h[e].length;n++)b.push({status:"failure",error:t.reason,result:void 0});continue}const n=t.value;for(let t=0;t<n.length;t++){const{returnData:r,success:s}=n[t],{callData:a}=h[e][t],{abi:i,address:c,functionName:l,args:d}=u[b.length];try{if("0x"===a)throw new at;if(!s)throw new to({data:r});const e=ta({abi:i,args:d,data:r,functionName:l});b.push(o?{result:e,status:"success"}:e)}catch(e){const t=Ro(e,{abi:i,address:c,args:d,docsPath:"/docs/contract/multicall",functionName:l});if(!o)throw t;b.push({error:t,result:void 0,status:"failure"})}}}if(b.length!==u.length)throw new tt("multicall results mismatch");return b}(e,t),prepareTransactionRequest:t=>qs(e,t),readContract:t=>rc(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulate:t=>xd(e,t),simulateBlocks:t=>xd(e,t),simulateCalls:t=>zd(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:a,...i}=t,c=i.account?pr(i.account):e.account,u=gr({abi:n,args:o,functionName:a});try{const{data:l}=await He(e,tc,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...i,account:c});return{result:ta({abi:n,args:o,functionName:a,data:l||"0x"}),request:{abi:n.filter(e=>"name"in e&&e.name===t.functionName),address:r,args:o,dataSuffix:s,functionName:a,...i,account:c}}}catch(e){throw Ro(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyHash:t=>Ud(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...a}){return Ud(e,{address:t,factory:r,factoryData:o,hash:du(n),signature:s,...a})}(e,t),verifySiweMessage:t=>Wd(e,t),verifyTypedData:t=>async function(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:a,primaryType:i,types:c,domain:u,...l}=t;return Ud(e,{address:n,factory:r,factoryData:o,hash:bu({message:a,primaryType:i,types:c,domain:u}),signature:s,...l})}(e,t),uninstallFilter:e=>mc(0,e),waitForTransactionReceipt:t=>async function(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:a=6,retryDelay:i=({count:e})=>200*(1<<e),timeout:c=18e4}=t,u=_r(["waitForTransactionReceipt",e.uid,o]),l=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval;let d,f,h,p,m,g=!1;const{promise:b,resolve:y,reject:w}=Qi(),v=c?setTimeout(()=>{m?.(),p?.(),w(new Zr({hash:o}))},c):void 0;return p=ic(u,{onReplaced:s,resolve:y,reject:w},async t=>{if(h=await He(e,vd,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1)return clearTimeout(v),t.resolve(h),void p?.();m=He(e,Gd,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:l,async onBlockNumber(s){const c=e=>{clearTimeout(v),m?.(),e(),p?.()};let u=s;if(!g)try{if(h){if(r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;return void c(()=>t.resolve(h))}if(n&&!d&&(g=!0,await gc(async()=>{d=await He(e,wd,"getTransaction")({hash:o}),d.blockNumber&&(u=d.blockNumber)},{delay:i,retryCount:a}),g=!1),h=await He(e,vd,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;c(()=>t.resolve(h))}catch(n){if(n instanceof Hr||n instanceof Yr){if(!d)return void(g=!1);try{f=d,g=!0;const n=await gc(()=>He(e,ys,"getBlock")({blockNumber:u,includeTransactions:!0}),{delay:i,retryCount:a,shouldRetry:({error:e})=>e instanceof ps});g=!1;const o=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!o)return;if(h=await He(e,vd,"getTransactionReceipt")({hash:o.hash}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;let s="replaced";o.to===f.to&&o.value===f.value&&o.input===f.input?s="repriced":o.from===o.to&&0n===o.value&&(s="cancelled"),c(()=>{t.onReplaced?.({reason:s,replacedTransaction:f,transaction:o,transactionReceipt:h}),t.resolve(h)})}catch(e){c(()=>t.reject(e))}}else c(()=>t.reject(n))}}})}),b}(e,t),watchBlocks:t=>function(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:a,poll:i,pollingInterval:c=e.pollingInterval}){const u=void 0!==i?i:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),l=a??!1;let d;return u?ic(_r(["watchBlocks",e.uid,t,n,r,l,c]),{onBlock:o,onError:s},o=>uc(async()=>{try{const r=await He(e,ys,"getBlock")({blockTag:t,includeTransactions:l});if(null!==r.number&&null!=d?.number){if(r.number===d.number)return;if(r.number-d.number>1&&n)for(let t=d?.number+1n;t<r.number;t++){const n=await He(e,ys,"getBlock")({blockNumber:t,includeTransactions:l});o.onBlock(n,d),d=n}}(null==d?.number||"pending"===t&&null==r?.number||null!==r.number&&r.number>d.number)&&(o.onBlock(r,d),d=r)}catch(e){o.onError?.(e)}},{emitOnBegin:r,interval:c})):(()=>{let n=!0,a=!0,i=()=>n=!1;return(async()=>{try{r&&He(e,ys,"getBlock")({blockTag:t,includeTransactions:l}).then(e=>{n&&a&&(o(e,void 0),a=!1)}).catch(s);const c=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:u}=await c.subscribe({params:["newHeads"],async onData(t){if(!n)return;const r=await He(e,ys,"getBlock")({blockNumber:t.result?.number,includeTransactions:l}).catch(()=>{});n&&(o(r,d),a=!1,d=r)},onError(e){s?.(e)}});i=u,n||i()}catch(e){s?.(e)}})(),()=>i()})()}(e,t),watchBlockNumber:t=>Gd(e,t),watchContractEvent:t=>function(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:a,fromBlock:i,onError:c,onLogs:u,poll:l,pollingInterval:d=e.pollingInterval,strict:f}=t;return(void 0!==l?l:"bigint"==typeof i||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{const t=f??!1;return ic(_r(["watchContractEvent",r,o,s,e.uid,a,d,t,i]),{onLogs:u,onError:c},c=>{let u,l;void 0!==i&&(u=i-1n);let f=!1;const h=uc(async()=>{if(f)try{let i;if(l)i=await He(e,pc,"getFilterChanges")({filter:l});else{const s=await He(e,hc,"getBlockNumber")({});i=u&&u<s?await He(e,Xs,"getContractEvents")({abi:n,address:r,args:o,eventName:a,fromBlock:u+1n,toBlock:s,strict:t}):[],u=s}if(0===i.length)return;if(s)c.onLogs(i);else for(const e of i)c.onLogs([e])}catch(e){l&&e instanceof ho&&(f=!1),c.onError?.(e)}else{try{l=await He(e,hr,"createContractEventFilter")({abi:n,address:r,args:o,eventName:a,strict:t,fromBlock:i})}catch{}f=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await He(e,mc,"uninstallFilter")({filter:l}),h()}})})():(()=>{const t=f??!1,i=_r(["watchContractEvent",r,o,s,e.uid,a,d,t]);let l=!0,h=()=>l=!1;return ic(i,{onLogs:u,onError:c},t=>((async()=>{try{const s=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),i=a?lr({abi:n,eventName:a,args:o}):[],{unsubscribe:c}=await s.subscribe({params:["logs",{address:r,topics:i}],onData(e){if(!l)return;const r=e.result;try{const{eventName:e,args:o}=Ys({abi:n,data:r.data,topics:r.topics,strict:f}),s=Js(r,{args:o,eventName:e});t.onLogs([s])}catch(e){let n,o;if(e instanceof xt||e instanceof Et){if(f)return;n=e.abiItem.name,o=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const s=Js(r,{args:o?[]:{},eventName:n});t.onLogs([s])}},onError(e){t.onError?.(e)}});h=c,l||h()}catch(e){c?.(e)}})(),()=>h()))})()}(e,t),watchEvent:t=>function(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:a,onError:i,onLogs:c,poll:u,pollingInterval:l=e.pollingInterval,strict:d}){const f=void 0!==u?u:"bigint"==typeof a||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type&&"ipc"!==e.transport.transports[0].config.type),h=d??!1;return f?ic(_r(["watchEvent",t,n,r,e.uid,o,l,a]),{onLogs:c,onError:i},i=>{let c,u;void 0!==a&&(c=a-1n);let d=!1;const f=uc(async()=>{if(d)try{let a;if(u)a=await He(e,pc,"getFilterChanges")({filter:u});else{const r=await He(e,hc,"getBlockNumber")({});a=c&&c!==r?await He(e,Qs,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:c+1n,toBlock:r}):[],c=r}if(0===a.length)return;if(r)i.onLogs(a);else for(const e of a)i.onLogs([e])}catch(e){u&&e instanceof ho&&(d=!1),i.onError?.(e)}else{try{u=await He(e,Yc,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:a})}catch{}d=!0}},{emitOnBegin:!0,interval:l});return async()=>{u&&await He(e,mc,"uninstallFilter")({filter:u}),f()}}):(()=>{let r=!0,a=()=>r=!1;return(async()=>{try{const u=(()=>{if("fallback"===e.transport.type){const t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=s??(o?[o]:void 0);let f=[];if(l){const e=l.flatMap(e=>lr({abi:[e],eventName:e.name,args:n}));f=[e],o&&(f=f[0])}const{unsubscribe:p}=await u.subscribe({params:["logs",{address:t,topics:f}],onData(e){if(!r)return;const t=e.result;try{const{eventName:e,args:n}=Ys({abi:l??[],data:t.data,topics:t.topics,strict:h}),r=Js(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof xt||e instanceof Et){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const o=Js(t,{args:r?[]:{},eventName:n});c([o])}},onError(e){i?.(e)}});a=p,r||a()}catch(e){i?.(e)}})(),()=>a()})()}(e,t),watchPendingTransactions:t=>function(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(void 0!==o?o:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?ic(_r(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},n=>{let r;const o=uc(async()=>{try{if(!r)try{return void(r=await He(e,Zc,"createPendingTransactionFilter")({}))}catch(e){throw o(),e}const s=await He(e,pc,"getFilterChanges")({filter:r});if(0===s.length)return;if(t)n.onTransactions(s);else for(const e of s)n.onTransactions([e])}catch(e){n.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{r&&await He(e,mc,"uninstallFilter")({filter:r}),o()}}):(()=>{let t=!0,o=()=>t=!1;return(async()=>{try{const{unsubscribe:s}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!t)return;const n=e.result;r([n])},onError(e){n?.(e)}});o=s,t||o()}catch(e){n?.(e)}})(),()=>o()})()}(e,t)}}function Yd(e){const{key:t="public",name:n="Public Client"}=e,r=function(e){const{batch:t,chain:n,ccipRead:r,key:o="base",name:s="Base Client",type:a="base"}=e,i=e.experimental_blockTag??("number"==typeof n?.experimental_preconfirmationTime?"pending":void 0),c=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),l=e.pollingInterval??u,d=e.cacheTime??l,f=e.account?pr(e.account):void 0,{config:h,request:p,value:m}=e.transport({chain:n,pollingInterval:l}),g={account:f,batch:t,cacheTime:d,ccipRead:r,chain:n,key:o,name:s,pollingInterval:l,request:p,transport:{...h,...m},type:a,uid:xc(),...i?{experimental_blockTag:i}:{}};return Object.assign(g,{extend:function e(t){return n=>{const r=n(t);for(const e in g)delete r[e];const o={...t,...r};return Object.assign(o,{extend:e(o)})}}(g)})}({...e,key:t,name:n,type:"publicClient"});return r.extend(Hd)}class Zd extends tt{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Kd(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:a,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:u,retryDelay:l,raw:d}=t;return({chain:f,retryCount:h,timeout:p})=>{const{batchSize:m=1e3,wait:g=0}="object"==typeof n?n:{},b=t.retryCount??h,y=p??t.timeout??1e4,w=e||f?.rpcUrls.default.http[0];if(!w)throw new Zd;const v=lu(w,{fetchFn:r,fetchOptions:o,onRequest:c,onResponse:u,timeout:y});return function({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:a,type:i},c){return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:a,type:i},request:tu(r,{methods:t,retryCount:o,retryDelay:s,uid:xc()}),value:c}}({key:s,methods:a,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:o}=ec({id:w,wait:g,shouldSplitBatch:e=>e.length>m,fn:e=>v.request({body:e}),sort:(e,t)=>e.id-t.id}),[{error:s,result:a}]=await(async e=>n?o(e):[await v.request({body:e})])(r);if(d)return{error:s,result:a};if(s)throw new ro({body:r,error:s,url:w});return a},retryCount:b,retryDelay:l,timeout:y,type:"http"},{fetchOptions:o,url:w})}}function Jd(e,t,n){for(let n in t){let r=t[n];Object.defineProperty(e,n,{enumerable:!0,value:r,writable:!1})}}function Qd(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>Qd(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let n="0x";for(let r=0;r<e.length;r++)n+=t[e[r]>>4],n+=t[15&e[r]];return n}if("object"==typeof e&&"function"==typeof e.toJSON)return Qd(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(n=>`${Qd(n,t)}: ${Qd(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Xd(e,t,n,r){if(!e)throw function(e,t,n){let r,o=e;{const r=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Qd(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+Qd(t))}}r.push(`code=${t}`),r.push("version=6.15.0"),r.length&&(e+=" ("+r.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":r=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(e);break;default:r=new Error(e)}return Jd(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Jd(r,{shortMessage:o}),r}(t,n,r)}function ef(e,t,n,r){Xd(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function tf(e,t){return function(e,t){if(e instanceof Uint8Array)return e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let n=2;for(let r=0;r<t.length;r++)t[r]=parseInt(e.substring(n,n+2),16),n+=2;return t}ef(!1,"invalid BytesLike value",t,e)}(e,t)}["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);const nf=BigInt(0),rf=BigInt(1),of=9007199254740991;function sf(e,t){const n=uf(e,"value"),r=BigInt(df(t,"width"));if(Xd(n>>r===nf,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-rf){return-((~n&(rf<<r)-rf)+rf)}return n}function af(e,t){const n=uf(e,"value"),r=BigInt(df(t,"bits"));return n&(rf<<r)-rf}function cf(e,t){switch(typeof e){case"bigint":return e;case"number":return ef(Number.isInteger(e),"underflow",t||"value",e),ef(e>=-of&&e<=of,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(n){ef(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}ef(!1,"invalid BigNumberish value",t||"value",e)}function uf(e,t){const n=cf(e,t);return Xd(n>=nf,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const lf="0123456789abcdef";function df(e,t){switch(typeof e){case"bigint":return ef(e>=-of&&e<=of,"overflow",t||"value",e),Number(e);case"number":return ef(Number.isInteger(e),"underflow",t||"value",e),ef(e>=-of&&e<=of,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return df(BigInt(e),t)}catch(n){ef(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}ef(!1,"invalid numeric value",t||"value",e)}const ff=BigInt(-1),hf=BigInt(0),pf=BigInt(1),mf=BigInt(5),gf={};let bf="0000";for(;bf.length<80;)bf+=bf;function yf(e){let t=bf;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function wf(e,t,n){const r=BigInt(t.width);if(t.signed){const t=pf<<r-pf;Xd(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>hf?sf(af(e,r),r):-sf(af(-e,r),r)}else{const t=pf<<r;Xd(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-pf}return e}function vf(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const o=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);ef(o,"invalid fixed format","format",e),t="u"!==o[1],n=parseInt(o[2]),r=parseInt(o[3])}else if(e){const o=e,s=(e,t,n)=>null==o[e]?n:(ef(typeof o[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,o[e]),o[e]);t=s("signed","boolean",t),n=s("width","number",n),r=s("decimals","number",r)}ef(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),ef(r<=80,"invalid FixedNumber decimals (too large)","format.decimals",r);return{signed:t,width:n,decimals:r,name:(t?"":"u")+"fixed"+String(n)+"x"+String(r)}}class xf{format;#e;#t;#n;_value;constructor(e,t,n){!function(e,t,n){if(e!==t){let e=n,t="new";e+=".",t+=" "+n,Xd(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,gf,"FixedNumber"),this.#t=t,this.#e=n;const r=function(e,t){let n="";e<hf&&(n="-",e*=ff);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=bf+r;const o=r.length-t;for(r=r.substring(0,o)+"."+r.substring(o);"0"===r[0]&&"."!==r[1];)r=r.substring(1);for(;"0"===r[r.length-1]&&"."!==r[r.length-2];)r=r.substring(0,r.length-1);return n+r}(t,n.decimals);Jd(this,{format:n.name,_value:r}),this.#n=yf(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#r(e){ef(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#o(e,t){return e=wf(e,this.#e,t),new xf(gf,e,this.#e)}#s(e,t){return this.#r(e),this.#o(this.#t+e.#t,t)}addUnsafe(e){return this.#s(e)}add(e){return this.#s(e,"add")}#a(e,t){return this.#r(e),this.#o(this.#t-e.#t,t)}subUnsafe(e){return this.#a(e)}sub(e){return this.#a(e,"sub")}#i(e,t){return this.#r(e),this.#o(this.#t*e.#t/this.#n,t)}mulUnsafe(e){return this.#i(e)}mul(e){return this.#i(e,"mul")}mulSignal(e){this.#r(e);const t=this.#t*e.#t;return Xd(t%this.#n===hf,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#o(t/this.#n,"mulSignal")}#c(e,t){return Xd(e.#t!==hf,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e),this.#o(this.#t*this.#n/e.#t,t)}divUnsafe(e){return this.#c(e)}div(e){return this.#c(e,"div")}divSignal(e){Xd(e.#t!==hf,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e);const t=this.#t*this.#n;return Xd(t%e.#t===hf,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#o(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value;const r=this.decimals-e.decimals;return r>0?n*=yf(r):r<0&&(t*=yf(-r)),t<n?-1:t>n?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<hf&&(e-=this.#n-pf),e=this.#t/this.#n*this.#n,this.#o(e,"floor")}ceiling(){let e=this.#t;return this.#t>hf&&(e+=this.#n-pf),e=this.#t/this.#n*this.#n,this.#o(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,n=mf*yf(t-1);let r=this.value+n;const o=yf(t);return r=r/o*o,wf(r,this.#e,"round"),new xf(gf,r,this.#e)}isZero(){return this.#t===hf}isNegative(){return this.#t<hf}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return xf.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:df(t),o=vf(n);let s=cf(e,"value");const a=r-o.decimals;if(a>0){const t=yf(a);Xd(s%t===hf,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=yf(-a));return wf(s,o,"fromValue"),new xf(gf,s,o)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);ef(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=vf(t);let o=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=bf;Xd(s.substring(r.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,r.decimals);const a=BigInt(n[1]+o+s);return wf(a,r,"fromString"),new xf(gf,a,r)}static fromBytes(e,t){let n=function(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=lf[n>>4],t+=lf[15&n];return BigInt(t)}return cf(e)}(tf(e,"value"));const r=vf(t);return r.signed&&(n=sf(n,r.width)),wf(n,r,"fromBytes"),new xf(gf,n,r)}}function Ef(e){return function(e,t){let n=18;return n=df(t,"unit"),xf.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const Pf="0.38.13";function kf({projectId:e,originComponentName:t,...n}){const r=new URL("https://pay.coinbase.com/buy");void 0!==e&&r.searchParams.append("appId",e);for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(["string","number","boolean"].includes(typeof t)?r.searchParams.append(e,t.toString()):r.searchParams.append(e,JSON.stringify(t)))}return t?r.searchParams.append("sdkVersion",`onchainkit@${Pf}:${t}`):r.searchParams.append("sdkVersion",`onchainkit@${Pf}`),r.searchParams.sort(),r.toString()}var Af=[],If=[],Sf="undefined"!=typeof Uint8Array?Uint8Array:Array,Nf=!1;function Tf(){Nf=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Af[t]=e[t],If[e.charCodeAt(t)]=t;If["-".charCodeAt(0)]=62,If["_".charCodeAt(0)]=63}function $f(e){return Af[e>>18&63]+Af[e>>12&63]+Af[e>>6&63]+Af[63&e]}function Bf(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16)+(e[s+1]<<8)+e[s+2],o.push($f(r));return o.join("")}function Cf(e){var t;Nf||Tf();for(var n=e.length,r=n%3,o="",s=[],a=16383,i=0,c=n-r;i<c;i+=a)s.push(Bf(e,i,i+a>c?c:i+a));return 1===r?(t=e[n-1],o+=Af[t>>2],o+=Af[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=Af[t>>10],o+=Af[t>>4&63],o+=Af[t<<2&63],o+="="),s.push(o),s.join("")}function Of(e,t,n,r,o){var s,a,i=8*o-r-1,c=(1<<i)-1,u=c>>1,l=-7,d=n?o-1:0,f=n?-1:1,h=e[t+d];for(d+=f,s=h&(1<<-l)-1,h>>=-l,l+=i;l>0;s=256*s+e[t+d],d+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),s-=u}return(h?-1:1)*a*Math.pow(2,s-r)}function _f(e,t,n,r,o,s){var a,i,c,u=8*s-o-1,l=(1<<u)-1,d=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(i=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(a++,c/=2),a+d>=l?(i=0,a=l):a+d>=1?(i=(t*c-1)*Math.pow(2,o),a+=d):(i=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&i,h+=p,i/=256,o-=8);for(a=a<<o|i,u+=o;u>0;e[n+h]=255&a,h+=p,a/=256,u-=8);e[n+h-p]|=128*m}var Rf={}.toString,zf=Array.isArray||function(e){return"[object Array]"==Rf.call(e)};function Mf(){return Ff.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Lf(e,t){if(Mf()<t)throw new RangeError("Invalid typed array length");return Ff.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Ff.prototype:(null===e&&(e=new Ff(t)),e.length=t),e}function Ff(e,t,n){if(!(Ff.TYPED_ARRAY_SUPPORT||this instanceof Ff))return new Ff(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Df(this,e)}return jf(this,e,t,n)}function jf(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);Ff.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Ff.prototype:e=Gf(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Ff.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Wf(t,n);e=Lf(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(Vf(t)){var n=0|qf(t.length);return 0===(e=Lf(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?Lf(e,0):Gf(e,t);if("Buffer"===t.type&&zf(t.data))return Gf(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Uf(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Df(e,t){if(Uf(t),e=Lf(e,t<0?0:0|qf(t)),!Ff.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Gf(e,t){var n=t.length<0?0:0|qf(t.length);e=Lf(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function qf(e){if(e>=Mf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mf().toString(16)+" bytes");return 0|e}function Vf(e){return!(null==e||!e._isBuffer)}function Wf(e,t){if(Vf(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return wh(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return vh(e).length;default:if(r)return wh(e).length;t=(""+t).toLowerCase(),r=!0}}function Hf(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return ch(this,t,n);case"utf8":case"utf-8":return oh(this,t,n);case"ascii":return ah(this,t,n);case"latin1":case"binary":return ih(this,t,n);case"base64":return rh(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return uh(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Yf(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Zf(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=Ff.from(t,r)),Vf(t))return 0===t.length?-1:Kf(e,t,n,r,o);if("number"==typeof t)return t&=255,Ff.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Kf(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Kf(e,t,n,r,o){var s,a=1,i=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,i/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(s=n;s<i;s++)if(u(e,s)===u(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===c)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(n+c>i&&(n=i-c),s=n;s>=0;s--){for(var d=!0,f=0;f<c;f++)if(u(e,s+f)!==u(t,f)){d=!1;break}if(d)return s}return-1}function Jf(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a<r;++a){var i=parseInt(t.substr(2*a,2),16);if(isNaN(i))return a;e[n+a]=i}return a}function Qf(e,t,n,r){return xh(wh(t,e.length-n),e,n,r)}function Xf(e,t,n,r){return xh(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function eh(e,t,n,r){return Xf(e,t,n,r)}function th(e,t,n,r){return xh(vh(t),e,n,r)}function nh(e,t,n,r){return xh(function(e,t){for(var n,r,o,s=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,s.push(o),s.push(r);return s}(t,e.length-n),e,n,r)}function rh(e,t,n){return 0===t&&n===e.length?Cf(e):Cf(e.slice(t,n))}function oh(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var s,a,i,c,u=e[o],l=null,d=u>239?4:u>223?3:u>191?2:1;if(o+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(s=e[o+1]))&&(c=(31&u)<<6|63&s)>127&&(l=c);break;case 3:s=e[o+1],a=e[o+2],128==(192&s)&&128==(192&a)&&(c=(15&u)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:s=e[o+1],a=e[o+2],i=e[o+3],128==(192&s)&&128==(192&a)&&128==(192&i)&&(c=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&i)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=d}return function(e){var t=e.length;if(t<=sh)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=sh));return n}(r)}Ff.TYPED_ARRAY_SUPPORT=void 0===globalThis.TYPED_ARRAY_SUPPORT||globalThis.TYPED_ARRAY_SUPPORT,Mf(),Ff.poolSize=8192,Ff._augment=function(e){return e.__proto__=Ff.prototype,e},Ff.from=function(e,t,n){return jf(null,e,t,n)},Ff.TYPED_ARRAY_SUPPORT&&(Ff.prototype.__proto__=Uint8Array.prototype,Ff.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Ff[Symbol.species]),Ff.alloc=function(e,t,n){return function(e,t,n,r){return Uf(t),t<=0?Lf(e,t):void 0!==n?"string"==typeof r?Lf(e,t).fill(n,r):Lf(e,t).fill(n):Lf(e,t)}(null,e,t,n)},Ff.allocUnsafe=function(e){return Df(null,e)},Ff.allocUnsafeSlow=function(e){return Df(null,e)},Ff.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Eh(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Eh(e.slice(0,0))}(e))},Ff.compare=function(e,t){if(!Vf(e)||!Vf(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o<s;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},Ff.isEncoding=function(e){switch(String(e).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}},Ff.concat=function(e,t){if(!zf(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Ff.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Ff.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!Vf(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},Ff.byteLength=Wf,Ff.prototype._isBuffer=!0,Ff.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Yf(this,t,t+1);return this},Ff.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Yf(this,t,t+3),Yf(this,t+1,t+2);return this},Ff.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Yf(this,t,t+7),Yf(this,t+1,t+6),Yf(this,t+2,t+5),Yf(this,t+3,t+4);return this},Ff.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?oh(this,0,e):Hf.apply(this,arguments)},Ff.prototype.equals=function(e){if(!Vf(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Ff.compare(this,e)},Ff.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Ff.prototype.compare=function(e,t,n,r,o){if(!Vf(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),i=Math.min(s,a),c=this.slice(r,o),u=e.slice(t,n),l=0;l<i;++l)if(c[l]!==u[l]){s=c[l],a=u[l];break}return s<a?-1:a<s?1:0},Ff.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Ff.prototype.indexOf=function(e,t,n){return Zf(this,e,t,n,!0)},Ff.prototype.lastIndexOf=function(e,t,n){return Zf(this,e,t,n,!1)},Ff.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return Jf(this,e,t,n);case"utf8":case"utf-8":return Qf(this,e,t,n);case"ascii":return Xf(this,e,t,n);case"latin1":case"binary":return eh(this,e,t,n);case"base64":return th(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nh(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Ff.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var sh=4096;function ah(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function ih(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function ch(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",s=t;s<n;++s)o+=yh(e[s]);return o}function uh(e,t,n){for(var r=e.slice(t,n),o="",s=0;s<r.length;s+=2)o+=String.fromCharCode(r[s]+256*r[s+1]);return o}function lh(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function dh(e,t,n,r,o,s){if(!Vf(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function fh(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,s=Math.min(e.length-n,2);o<s;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function hh(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,s=Math.min(e.length-n,4);o<s;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function ph(e,t,n,r,o,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function mh(e,t,n,r,o){return o||ph(e,0,n,4),_f(e,t,n,r,23,4),n+4}function gh(e,t,n,r,o){return o||ph(e,0,n,8),_f(e,t,n,r,52,8),n+8}Ff.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Ff.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Ff.prototype;else{var o=t-e;n=new Ff(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},Ff.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r},Ff.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Ff.prototype.readUInt8=function(e,t){return t||lh(e,1,this.length),this[e]},Ff.prototype.readUInt16LE=function(e,t){return t||lh(e,2,this.length),this[e]|this[e+1]<<8},Ff.prototype.readUInt16BE=function(e,t){return t||lh(e,2,this.length),this[e]<<8|this[e+1]},Ff.prototype.readUInt32LE=function(e,t){return t||lh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Ff.prototype.readUInt32BE=function(e,t){return t||lh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Ff.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},Ff.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||lh(e,t,this.length);for(var r=t,o=1,s=this[e+--r];r>0&&(o*=256);)s+=this[e+--r]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*t)),s},Ff.prototype.readInt8=function(e,t){return t||lh(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Ff.prototype.readInt16LE=function(e,t){t||lh(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Ff.prototype.readInt16BE=function(e,t){t||lh(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Ff.prototype.readInt32LE=function(e,t){return t||lh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Ff.prototype.readInt32BE=function(e,t){return t||lh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Ff.prototype.readFloatLE=function(e,t){return t||lh(e,4,this.length),Of(this,e,!0,23,4)},Ff.prototype.readFloatBE=function(e,t){return t||lh(e,4,this.length),Of(this,e,!1,23,4)},Ff.prototype.readDoubleLE=function(e,t){return t||lh(e,8,this.length),Of(this,e,!0,52,8)},Ff.prototype.readDoubleBE=function(e,t){return t||lh(e,8,this.length),Of(this,e,!1,52,8)},Ff.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||dh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},Ff.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||dh(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},Ff.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,1,255,0),Ff.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Ff.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,65535,0),Ff.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fh(this,e,t,!0),t+2},Ff.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,65535,0),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fh(this,e,t,!1),t+2},Ff.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,4294967295,0),Ff.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):hh(this,e,t,!0),t+4},Ff.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,4294967295,0),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):hh(this,e,t,!1),t+4},Ff.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);dh(this,e,t,n,o-1,-o)}var s=0,a=1,i=0;for(this[t]=255&e;++s<n&&(a*=256);)e<0&&0===i&&0!==this[t+s-1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Ff.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);dh(this,e,t,n,o-1,-o)}var s=n-1,a=1,i=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===i&&0!==this[t+s+1]&&(i=1),this[t+s]=(e/a|0)-i&255;return t+n},Ff.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,1,127,-128),Ff.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Ff.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,32767,-32768),Ff.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):fh(this,e,t,!0),t+2},Ff.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,2,32767,-32768),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):fh(this,e,t,!1),t+2},Ff.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,2147483647,-2147483648),Ff.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):hh(this,e,t,!0),t+4},Ff.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||dh(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Ff.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):hh(this,e,t,!1),t+4},Ff.prototype.writeFloatLE=function(e,t,n){return mh(this,e,t,!0,n)},Ff.prototype.writeFloatBE=function(e,t,n){return mh(this,e,t,!1,n)},Ff.prototype.writeDoubleLE=function(e,t,n){return gh(this,e,t,!0,n)},Ff.prototype.writeDoubleBE=function(e,t,n){return gh(this,e,t,!1,n)},Ff.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,s=r-n;if(this===e&&n<t&&t<r)for(o=s-1;o>=0;--o)e[o+t]=this[o+n];else if(s<1e3||!Ff.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},Ff.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Ff.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=Vf(e)?e:wh(new Ff(e,r).toString()),i=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%i]}return this};var bh=/[^+\/0-9A-Za-z-_]/g;function yh(e){return e<16?"0"+e.toString(16):e.toString(16)}function wh(e,t){var n;t=t||1/0;for(var r=e.length,o=null,s=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&s.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&s.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function vh(e){return function(e){var t,n,r,o,s,a;Nf||Tf();var i=e.length;if(i%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s="="===e[i-2]?2:"="===e[i-1]?1:0,a=new Sf(3*i/4-s),r=s>0?i-4:i;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)o=If[e.charCodeAt(t)]<<18|If[e.charCodeAt(t+1)]<<12|If[e.charCodeAt(t+2)]<<6|If[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=If[e.charCodeAt(t)]<<2|If[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=If[e.charCodeAt(t)]<<10|If[e.charCodeAt(t+1)]<<4|If[e.charCodeAt(t+2)]>>2,a[c++]=o>>8&255,a[c++]=255&o),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(bh,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function xh(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Eh(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Ph(){const e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}class kh{constructor(e){this.walletInfo=null,this.userId=null,this.solanaConnection=null,this.ethereumProvider=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=exports.Network.Solana,this.api=w.default.create({baseURL:e.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=w.default.create({baseURL:e.middleAccountBaseURL||"",headers:{"Content-Type":"application/json"}}),this.solanaCluster=e.solanaCluster,this.solanaConnection=new t.Connection(e.solanaCluster.rpcUrl),e.ethereumNetwork&&(this.ethereumNetwork={...e.ethereumNetwork,chainId:Number(e.ethereumNetwork.chainId)},this.ethereumProvider=Yd({transport:Kd(e.ethereumNetwork.rpcUrl)})),this.defaultNetwork=e.defaultNetwork||exports.Network.Solana,this.setWalletInfo=t=>{var n;e.setWalletInfo(t),this.userId=null!==(n=null==t?void 0:t.id)&&void 0!==n?n:null,this.walletInfo=t}}setWalletType(e){this.walletType=e,$.saveWalletType(e)}async reconnect(e){try{if($.getWalletType()==="phantom"+(e?"_backup":"")){return await this.connectPhantom()}if(!e){const e=await this.getAndRefreshSession();return this.setWalletInfo(e),e}const t=$.getBackupWalletInfo();return this.setWalletInfo(t),t}catch(e){return null}}getPhantomAdapter(){return this.phantomAdapter}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new K),await this.phantomAdapter.connect(),!this.phantomAdapter.publicKey)throw new Error("Failed to connect to Phantom wallet");const e=this.phantomAdapter.publicKey.toString(),t={id:r.v4(),wallets:[{id:e,address:e,network:exports.Network.Solana,wallet_type:exports.WalletType.Phantom,wallet_set:"Main",account_index:0,is_enabled:!0}],social_links:[],social_infos:[],account_info:{name:null,sub_accounts:[],credit_account:{account_mode:exports.AccountMode.Basic}},created_at:Date.now(),is_exported:!1};return this.setWalletInfo(t),this.setWalletType("phantom"),t}catch(e){throw console.error("Phantom connect error:",e),new Error(e instanceof Error?e.message:"Failed to connect to Phantom wallet")}}async updateAccountName(e,t){const n={name:e,account_index:t},r=(await this.api.post("/account/update",n,{withCredentials:!0})).data;return this.setWalletInfo(r),r}async manageMultiAccount(e){const t=(await this.api.post("/account/multi",e,{withCredentials:!0})).data;return this.setWalletInfo(t),t}async createSubAccount(e){return this.manageMultiAccount({type:"Create",data:{name:null!=e?e:null}})}async enableSubAccount(e){return this.manageMultiAccount({type:"Enable",data:{index:e}})}async disableSubAccount(e){return this.manageMultiAccount({type:"Disable",data:{index:e}})}async signSolanaTransaction(e,n){try{if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:r}=await this.solanaConnection.getLatestBlockhash();if(P(e)?e.message.recentBlockhash=r:e.recentBlockhash=r,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(e);const o=await this.signV3({network:exports.Network.Solana,address:n,tx:{Solana:v.default.encode(P(e)?e.message.serialize():e.serializeMessage())}});return e.addSignature(new t.PublicKey(n),Ff.from(v.default.decode(o))),e}catch(e){throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signEthereumEip712(e,t){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");return await this.signV2({network:exports.Network.Ethereum,address:t,tx:{EthereumEip712:e}})}async sendSolanaTransaction(e){if(!this.solanaConnection)throw new Error("No rpc connection");try{return await this.solanaConnection.sendRawTransaction(e,{maxRetries:3,skipPreflight:!1})}catch(e){throw e}}async sendEthereumTransaction(e){if(!this.ethereumProvider)throw new Error("No Ethereum provider");try{return await this.ethereumProvider.sendRawTransaction({serializedTransaction:e})}catch(e){throw e}}async sendEmailVerificationCode(e){await this.api.post("/send_verification",{email:e})}async sendPhoneVerificationCode(e){e.startsWith("+")||(e=`+${e}`),await this.api.post("/send_verification",{phone:e,type:"phone"})}async verifyEmailVerificationCode({email:e,code:t}){const n={type:"Email",data:{network:this.defaultNetwork,email:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async verifyPhoneVerificationCode({phone:e,code:t}){const n={type:"Phone",data:{network:this.defaultNetwork,phone:e,code:t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async twitterLogin(e){const t={type:"TwitterOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWalletInfo(n),this.setWalletType("embedded"),n}async googleLogin(e){const t={type:"GoogleOAuth",data:{network:this.defaultNetwork,...e}},n=(await this.api.post("/login",t,{withCredentials:!0})).data;return this.setWalletInfo(n),this.setWalletType("embedded"),n}async oauthLogin(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async loginWithChallenge(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/login",n,{withCredentials:!0})).data;return this.setWalletInfo(r),this.setWalletType("embedded"),r}async bind(e,t){const n={type:e,data:{network:t.network||this.defaultNetwork,...t}},r=(await this.api.post("/bind",n,{withCredentials:!0})).data;return this.setWalletInfo(r),r}async oauthInit(e){return(await this.api.post("/oauth/init",e)).data}async getSignChallenge(e){return(await this.api.get(`/challenge?method=${e.method}&id=${e.id}`)).data}async getAndRefreshSession(){const e=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:t}=e;return t&&$.saveAccessToken(t),this.setWalletInfo(e),e}async logout(e){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWalletInfo(null),e?$.clearBackup():$.clear()}async getOAuth2ClientId(e){return(await this.api.get(`/oauth_id/${e}`)).data.client_id}async getSolanaBalance(e){if(!this.solanaConnection)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new t.PublicKey(e))/t.LAMPORTS_PER_SOL).toString()}async getEthereumBalance(e){if(!this.ethereumProvider)throw new Error("Ethereum provider not available");return Ef(await this.ethereumProvider.getBalance({address:e}))}async fetchCoinbaseToken(e,t="solana"){return(await this.api.post("/ramp/coinbase",{addresses:[{address:e,blockchains:[t]}],assets:["solana"===t?"SOL":"ETH"]})).data.token}viemSignerAdapter(e){return{signTypedData:async t=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");const n=await this.signV2({network:exports.Network.Ethereum,address:e,tx:{EthereumEip712:t}}),r=v.default.decode(n),o=r[64];return jd({r:`0x${Ff.from(r.slice(0,32)).toString("hex")}`,s:`0x${Ff.from(r.slice(32,64)).toString("hex")}`,v:BigInt(o+27)})}}}async createMiddleAccount(e){try{return(await this.middleAccountApi.post("/create",e)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to create middle account")}}async getCoinbaseOnrampUrlForMiddleAccount(e){try{const t={sessionToken:await this.fetchCoinbaseToken(e.middleAccountAddress,e.network===exports.Network.Solana?"solana":"ethereum"),presetCryptoAmount:Number(e.amount),redirectUrl:e.redirectUrl||window.location.href};return kf(t)}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get Coinbase onramp URL")}}async getOrderState(e){try{return(await this.middleAccountApi.get(`/order/${e}`)).data}catch(e){throw new Error(e instanceof Error?e.message:"Failed to get order status")}}async transfer(e){var t,n,r;const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",from:e.from,to:e.to,amount:e.amount,decimals:e.decimals,token:e.token,network:e.network,chain_id:e.chain_id};try{return(await this.api.post("/v3/sign/transfer",o,{withCredentials:!0})).data}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Transfer failed")}}async buildTransaction(e){var t,n;try{return(await this.api.post("/v3/sign/build_transaction",e,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build transaction")}}async exportInit(e){var t,n;const r={user_nonce:Ph(),account_index:e};try{return(await this.api.post("/export/init",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to initialize export")}}async exportFinal(e){var t,n,r;const o={user_nonce:e.userNonce,server_nonce:e.serverNonce,account_index:e.accountIndex,is_export:null===(t=e.isExport)||void 0===t||t};try{return(await this.api.post("/export/final",o,{withCredentials:!0})).data}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to finalize export")}}async getExportedWallets(e){var t,n;const r={account_index:e,is_export:!1};try{return(await this.api.post("/export/final",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to retrieve exported wallets")}}async closeInit(){var e,t;const n={user_nonce:Ph()};try{return(await this.api.post("/close/init",n,{withCredentials:!0})).data}catch(n){if(null===(t=null===(e=n.response)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error)throw new Error(n.response.data.error);throw new Error(n instanceof Error?n.message:"Failed to initialize account closure")}}async closeFinal(e){var t,n;const r={user_nonce:e.userNonce,server_nonce:e.serverNonce};try{const e=await this.api.post("/close/final",r,{withCredentials:!0});return this.setWalletInfo(null),$.clear(),e.data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to close account")}}async signV1(e){var t,n,r;const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,message:e.message};try{return(await this.api.post("/v1/sign",o,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to sign message")}}async signV2(e){var t,n,r;const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,tx:e.tx};try{return(await this.api.post("/v2/sign",o,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signV3(e){var t,n,r;if(e.network!==exports.Network.Solana)throw new Error("v3 sign API only supports Solana transactions");if(!e.tx.Solana)throw new Error("Solana transaction is required for v3 sign API");const o={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,tx:{Solana:e.tx.Solana}};try{return(await this.api.post("/v3/sign",o,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async authV3(e){var t,n,r;if(e.network!==exports.Network.Ethereum)throw new Error("v3 auth API only supports Ethereum EIP-712 authentication");const o={domain:{name:"SUPERSTACK",version:"1",chainId:999,verifyingContract:"0x0000000000000000000000000000000000000000"},types:e.types,primaryType:e.primaryType,message:e.message},s={user_id:null!==(t=this.userId)&&void 0!==t?t:"",network:e.network,address:e.address,payload:{EthereumEip712:o}};try{return(await this.api.post("/v3/auth",s,{withCredentials:!0})).data.signature}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to authenticate")}}async lighterBuildTransaction(e,t){var n,r;try{const n={...e,wallet_address:t||e.wallet_address||null};return(await this.api.post("/v3/lighter/build_transaction",n,{withCredentials:!0})).data}catch(e){if(null===(r=null===(n=e.response)||void 0===n?void 0:n.data)||void 0===r?void 0:r.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build Lighter transaction")}}async lighterAuth(e){var t,n;const r={account_index:e.lighter_account_index,wallet_address:e.wallet_address||null,expires_in_ms:e.expires_in_ms||null};try{return(await this.api.post("/v3/lighter/auth",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to generate Lighter auth token")}}async lighterChangeKey(e){var t,n;if(e.lighter_account_index<0)throw new Error("accountIndex must be non-negative");const r={account_index:e.lighter_account_index,wallet_address:e.wallet_address||null};try{return(await this.api.post("/v3/lighter/change_key",r,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to change Lighter key")}}async exchange(e){var t,n;try{return(await this.api.post("/v3/sign/exchange",e,{withCredentials:!0})).data}catch(e){if(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.error)throw new Error(e.response.data.error);throw new Error(e instanceof Error?e.message:"Failed to build exchange transaction")}}}var Ah=function(){return Ah=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ah.apply(this,arguments)};function Ih(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Sh(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}"function"==typeof SuppressedError&&SuppressedError;var Nh=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Th=Sh(function(e){return Nh.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),$h="-ms-",Bh="-moz-",Ch="-webkit-",Oh="comm",_h="rule",Rh="decl",zh="@keyframes",Mh=Math.abs,Lh=String.fromCharCode,Fh=Object.assign;function jh(e){return e.trim()}function Uh(e,t){return(e=t.exec(e))?e[0]:e}function Dh(e,t,n){return e.replace(t,n)}function Gh(e,t,n){return e.indexOf(t,n)}function qh(e,t){return 0|e.charCodeAt(t)}function Vh(e,t,n){return e.slice(t,n)}function Wh(e){return e.length}function Hh(e){return e.length}function Yh(e,t){return t.push(e),e}function Zh(e,t){return e.filter(function(e){return!Uh(e,t)})}var Kh=1,Jh=1,Qh=0,Xh=0,ep=0,tp="";function np(e,t,n,r,o,s,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:s,line:Kh,column:Jh,length:a,return:"",siblings:i}}function rp(e,t){return Fh(np("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function op(e){for(;e.root;)e=rp(e.root,{children:[e]});Yh(e,e.siblings)}function sp(){return ep=Xh>0?qh(tp,--Xh):0,Jh--,10===ep&&(Jh=1,Kh--),ep}function ap(){return ep=Xh<Qh?qh(tp,Xh++):0,Jh++,10===ep&&(Jh=1,Kh++),ep}function ip(){return qh(tp,Xh)}function cp(){return Xh}function up(e,t){return Vh(tp,e,t)}function lp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function dp(e){return jh(up(Xh-1,pp(91===e?e+2:40===e?e+1:e)))}function fp(e){for(;(ep=ip())&&ep<33;)ap();return lp(e)>2||lp(ep)>3?"":" "}function hp(e,t){for(;--t&&ap()&&!(ep<48||ep>102||ep>57&&ep<65||ep>70&&ep<97););return up(e,cp()+(t<6&&32==ip()&&32==ap()))}function pp(e){for(;ap();)switch(ep){case e:return Xh;case 34:case 39:34!==e&&39!==e&&pp(ep);break;case 40:41===e&&pp(e);break;case 92:ap()}return Xh}function mp(e,t){for(;ap()&&e+ep!==57&&(e+ep!==84||47!==ip()););return"/*"+up(t,Xh-1)+"*"+Lh(47===e?e:ap())}function gp(e){for(;!lp(ip());)ap();return up(e,Xh)}function bp(e){return function(e){return tp="",e}(yp("",null,null,null,[""],e=function(e){return Kh=Jh=1,Qh=Wh(tp=e),Xh=0,[]}(e),0,[0],e))}function yp(e,t,n,r,o,s,a,i,c){for(var u=0,l=0,d=a,f=0,h=0,p=0,m=1,g=1,b=1,y=0,w="",v=o,x=s,E=r,P=w;g;)switch(p=y,y=ap()){case 40:if(108!=p&&58==qh(P,d-1)){-1!=Gh(P+=Dh(dp(y),"&","&\f"),"&\f",Mh(u?i[u-1]:0))&&(b=-1);break}case 34:case 39:case 91:P+=dp(y);break;case 9:case 10:case 13:case 32:P+=fp(p);break;case 92:P+=hp(cp()-1,7);continue;case 47:switch(ip()){case 42:case 47:Yh(vp(mp(ap(),cp()),t,n,c),c);break;default:P+="/"}break;case 123*m:i[u++]=Wh(P)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+l:-1==b&&(P=Dh(P,/\f/g,"")),h>0&&Wh(P)-d&&Yh(h>32?xp(P+";",r,n,d-1,c):xp(Dh(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(Yh(E=wp(P,t,n,u,l,o,i,w,v=[],x=[],d,s),s),123===y)if(0===l)yp(P,t,E,E,v,s,d,i,x);else switch(99===f&&110===qh(P,3)?100:f){case 100:case 108:case 109:case 115:yp(e,E,E,r&&Yh(wp(e,E,E,0,0,o,i,w,o,v=[],d,x),x),o,x,d,i,r?v:x);break;default:yp(P,E,E,E,[""],x,0,i,x)}}u=l=h=0,m=b=1,w=P="",d=a;break;case 58:d=1+Wh(P),h=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==sp())continue;switch(P+=Lh(y),y*m){case 38:b=l>0?1:(P+="\f",-1);break;case 44:i[u++]=(Wh(P)-1)*b,b=1;break;case 64:45===ip()&&(P+=dp(ap())),f=ip(),l=d=Wh(w=P+=gp(cp())),y++;break;case 45:45===p&&2==Wh(P)&&(m=0)}}return s}function wp(e,t,n,r,o,s,a,i,c,u,l,d){for(var f=o-1,h=0===o?s:[""],p=Hh(h),m=0,g=0,b=0;m<r;++m)for(var y=0,w=Vh(e,f+1,f=Mh(g=a[m])),v=e;y<p;++y)(v=jh(g>0?h[y]+" "+w:Dh(w,/&\f/g,h[y])))&&(c[b++]=v);return np(e,t,n,0===o?_h:i,c,u,l,d)}function vp(e,t,n,r){return np(e,t,n,Oh,Lh(ep),Vh(e,2,-2),0,r)}function xp(e,t,n,r,o){return np(e,t,n,Rh,Vh(e,0,r),Vh(e,r+1,-1),r,o)}function Ep(e,t,n){switch(function(e,t){return 45^qh(e,0)?(((t<<2^qh(e,0))<<2^qh(e,1))<<2^qh(e,2))<<2^qh(e,3):0}(e,t)){case 5103:return Ch+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ch+e+e;case 4789:return Bh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ch+e+Bh+e+$h+e+e;case 5936:switch(qh(e,t+11)){case 114:return Ch+e+$h+Dh(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ch+e+$h+Dh(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ch+e+$h+Dh(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Ch+e+$h+e+e;case 6165:return Ch+e+$h+"flex-"+e+e;case 5187:return Ch+e+Dh(e,/(\w+).+(:[^]+)/,Ch+"box-$1$2"+$h+"flex-$1$2")+e;case 5443:return Ch+e+$h+"flex-item-"+Dh(e,/flex-|-self/g,"")+(Uh(e,/flex-|baseline/)?"":$h+"grid-row-"+Dh(e,/flex-|-self/g,""))+e;case 4675:return Ch+e+$h+"flex-line-pack"+Dh(e,/align-content|flex-|-self/g,"")+e;case 5548:return Ch+e+$h+Dh(e,"shrink","negative")+e;case 5292:return Ch+e+$h+Dh(e,"basis","preferred-size")+e;case 6060:return Ch+"box-"+Dh(e,"-grow","")+Ch+e+$h+Dh(e,"grow","positive")+e;case 4554:return Ch+Dh(e,/([^-])(transform)/g,"$1"+Ch+"$2")+e;case 6187:return Dh(Dh(Dh(e,/(zoom-|grab)/,Ch+"$1"),/(image-set)/,Ch+"$1"),e,"")+e;case 5495:case 3959:return Dh(e,/(image-set\([^]*)/,Ch+"$1$`$1");case 4968:return Dh(Dh(e,/(.+:)(flex-)?(.*)/,Ch+"box-pack:$3"+$h+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ch+e+e;case 4200:if(!Uh(e,/flex-|baseline/))return $h+"grid-column-align"+Vh(e,t)+e;break;case 2592:case 3360:return $h+Dh(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,Uh(e.props,/grid-\w+-end/)})?~Gh(e+(n=n[t].value),"span",0)?e:$h+Dh(e,"-start","")+e+$h+"grid-row-span:"+(~Gh(n,"span",0)?Uh(n,/\d+/):+Uh(n,/\d+/)-+Uh(e,/\d+/))+";":$h+Dh(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return Uh(e.props,/grid-\w+-start/)})?e:$h+Dh(Dh(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Dh(e,/(.+)-inline(.+)/,Ch+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Wh(e)-1-t>6)switch(qh(e,t+1)){case 109:if(45!==qh(e,t+4))break;case 102:return Dh(e,/(.+:)(.+)-([^]+)/,"$1"+Ch+"$2-$3$1"+Bh+(108==qh(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Gh(e,"stretch",0)?Ep(Dh(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Dh(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,s,a,i){return $h+n+":"+r+i+(o?$h+n+"-span:"+(s?a:+a-+r)+i:"")+e});case 4949:if(121===qh(e,t+6))return Dh(e,":",":"+Ch)+e;break;case 6444:switch(qh(e,45===qh(e,14)?18:11)){case 120:return Dh(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Ch+(45===qh(e,14)?"inline-":"")+"box$3$1"+Ch+"$2$3$1"+$h+"$2box$3")+e;case 100:return Dh(e,":",":"+$h)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Dh(e,"scroll-","scroll-snap-")+e}return e}function Pp(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function kp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Rh:return e.return=e.return||e.value;case Oh:return"";case zh:return e.return=e.value+"{"+Pp(e.children,r)+"}";case _h:if(!Wh(e.value=e.props.join(",")))return""}return Wh(n=Pp(e.children,r))?e.return=e.value+"{"+n+"}":""}function Ap(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Rh:return void(e.return=Ep(e.value,e.length,n));case zh:return Pp([rp(e,{value:Dh(e.value,"@","@"+Ch)})],r);case _h:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch(Uh(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":op(rp(e,{props:[Dh(t,/:(read-\w+)/,":-moz-$1")]})),op(rp(e,{props:[t]})),Fh(e,{props:Zh(n,r)});break;case"::placeholder":op(rp(e,{props:[Dh(t,/:(plac\w+)/,":"+Ch+"input-$1")]})),op(rp(e,{props:[Dh(t,/:(plac\w+)/,":-moz-$1")]})),op(rp(e,{props:[Dh(t,/:(plac\w+)/,$h+"input-$1")]})),op(rp(e,{props:[t]})),Fh(e,{props:Zh(n,r)})}return""})}}var Ip={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Sp="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",Np="active",Tp="data-styled-version",$p="6.1.19",Bp="/*!sc*/\n",Cp="undefined"!=typeof window&&"undefined"!=typeof document,Op=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),_p=/invalid hook call/i,Rp=new Set,zp=function(e,t){if("production"!==process.env.NODE_ENV){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n," has been created dynamically.\n")+"You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n",s=console.error;try{var a=!0;console.error=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];_p.test(e)?(a=!1,Rp.delete(r)):s.apply(void 0,Ih([e],t,!1))},o.useRef(),a&&!Rp.has(r)&&(console.warn(r),Rp.add(r))}catch(e){_p.test(e.message)&&Rp.delete(r)}finally{console.error=s}}},Mp=Object.freeze([]),Lp=Object.freeze({});var Fp=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),jp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Up=/(^-|-$)/g;function Dp(e){return e.replace(jp,"-").replace(Up,"")}var Gp=/(a)(d)/gi,qp=function(e){return String.fromCharCode(e+(e>25?39:97))};function Vp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=qp(t%52)+n;return(qp(t%52)+n).replace(Gp,"$1-$2")}var Wp,Hp=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Yp=function(e){return Hp(5381,e)};function Zp(e){return Vp(Yp(e)>>>0)}function Kp(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Jp(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Qp="function"==typeof Symbol&&Symbol.for,Xp=Qp?Symbol.for("react.memo"):60115,em=Qp?Symbol.for("react.forward_ref"):60112,tm={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},nm={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},rm={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},om=((Wp={})[em]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Wp[Xp]=rm,Wp);function sm(e){return("type"in(t=e)&&t.type.$$typeof)===Xp?rm:"$$typeof"in e?om[e.$$typeof]:tm;var t}var am=Object.defineProperty,im=Object.getOwnPropertyNames,cm=Object.getOwnPropertySymbols,um=Object.getOwnPropertyDescriptor,lm=Object.getPrototypeOf,dm=Object.prototype;function fm(e,t,n){if("string"!=typeof t){if(dm){var r=lm(t);r&&r!==dm&&fm(e,r,n)}var o=im(t);cm&&(o=o.concat(cm(t)));for(var s=sm(e),a=sm(t),i=0;i<o.length;++i){var c=o[i];if(!(c in nm||n&&n[c]||a&&c in a||s&&c in s)){var u=um(t,c);try{am(e,c,u)}catch(e){}}}}return e}function hm(e){return"function"==typeof e}function pm(e){return"object"==typeof e&&"styledComponentId"in e}function mm(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function gm(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function bm(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ym(e,t,n){if(void 0===n&&(n=!1),!n&&!bm(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=ym(e[r],t[r]);else if(bm(t))for(var r in t)e[r]=ym(e[r],t[r]);return e}function wm(e,t){Object.defineProperty(e,"toString",{value:t})}var vm="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function xm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,s=e.length;o<s;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function Em(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(xm.apply(void 0,Ih([vm[e]],t,!1)).trim())}var Pm=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return e.prototype.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw Em(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),i=(s=0,t.length);s<i;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},e.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},e.prototype.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(Bp);return t},e}(),km=1<<30,Am=new Map,Im=new Map,Sm=1,Nm=function(e){if(Am.has(e))return Am.get(e);for(;Im.has(Sm);)Sm++;var t=Sm++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>km))throw Em(16,"".concat(t));return Am.set(e,t),Im.set(t,e),t},Tm=function(e,t){Sm=t+1,Am.set(e,t),Im.set(t,e)},$m="style[".concat(Sp,"][").concat(Tp,'="').concat($p,'"]'),Bm=new RegExp("^".concat(Sp,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),Cm=function(e,t,n){for(var r,o=n.split(","),s=0,a=o.length;s<a;s++)(r=o[s])&&e.registerName(t,r)},Om=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(Bp),o=[],s=0,a=r.length;s<a;s++){var i=r[s].trim();if(i){var c=i.match(Bm);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(Tm(l,u),Cm(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(i)}}},_m=function(e){for(var t=document.querySelectorAll($m),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(Sp)!==Np&&(Om(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var Rm=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(Sp,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(Sp,Np),r.setAttribute(Tp,$p);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,s),r},zm=function(){function e(e){this.element=Rm(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}throw Em(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),Mm=function(){function e(e){this.element=Rm(e),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Lm=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Fm=Cp,jm={isServer:!Cp,useCSSOMInjection:!Op},Um=function(){function e(e,t,n){void 0===e&&(e=Lp),void 0===t&&(t={});var r=this;this.options=Ah(Ah({},jm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&Cp&&Fm&&(Fm=!1,_m(this)),wm(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return Im.get(e)}(n);if(void 0===o)return"continue";var s=e.names.get(o),a=t.getGroup(n);if(void 0===s||!s.size||0===a.length)return"continue";var i="".concat(Sp,".g").concat(n,'[id="').concat(o,'"]'),c="";void 0!==s&&s.forEach(function(e){e.length>0&&(c+="".concat(e,","))}),r+="".concat(a).concat(i,'{content:"').concat(c,'"}').concat(Bp)},s=0;s<n;s++)o(s);return r}(r)})}return e.registerId=function(e){return Nm(e)},e.prototype.rehydrate=function(){!this.server&&Cp&&_m(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(Ah(Ah({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target;return e.isServer?new Lm(n):t?new zm(n):new Mm(n)}(this.options),new Pm(e)));var e},e.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},e.prototype.registerName=function(e,t){if(Nm(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(Nm(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(Nm(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Dm=/&/g,Gm=/^\s*\/\/.*$/gm;function qm(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=qm(e.children,t)),e})}var Vm=new Um,Wm=function(){var e,t,n,r=Lp,o=r.options,s=void 0===o?Lp:o,a=r.plugins,i=void 0===a?Mp:a,c=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},u=i.slice();u.push(function(e){e.type===_h&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Dm,t).replace(n,c))}),s.prefix&&u.push(Ap),u.push(kp);var l=function(r,o,a,i){void 0===o&&(o=""),void 0===a&&(a=""),void 0===i&&(i="&"),e=i,t=o,n=new RegExp("\\".concat(t,"\\b"),"g");var c=r.replace(Gm,""),l=bp(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);s.namespace&&(l=qm(l,s.namespace));var d,f=[];return Pp(l,function(e){var t=Hh(e);return function(n,r,o,s){for(var a="",i=0;i<t;i++)a+=e[i](n,r,o,s)||"";return a}}(u.concat((d=function(e){return f.push(e)},function(e){e.root||(e=e.return)&&d(e)})))),f};return l.hash=i.length?i.reduce(function(e,t){return t.name||Em(15),Hp(e,t.name)},5381).toString():"",l}(),Hm=x.default.createContext({shouldForwardProp:void 0,styleSheet:Vm,stylis:Wm});function Ym(){return o.useContext(Hm)}Hm.Consumer,x.default.createContext(void 0);var Zm=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Wm);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,wm(this,function(){throw Em(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Wm),this.name+e.hash},e}(),Km=function(e){return e>="A"&&e<="Z"};function Jm(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Km(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Qm=function(e){return null==e||!1===e||""===e},Xm=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!Qm(s)&&(Array.isArray(s)&&s.isCss||hm(s)?r.push("".concat(Jm(o),":"),s,";"):bm(s)?r.push.apply(r,Ih(Ih(["".concat(o," {")],Xm(s),!1),["}"],!1)):r.push("".concat(Jm(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in Ip||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function eg(e,t,n,r){if(Qm(e))return[];if(pm(e))return[".".concat(e.styledComponentId)];if(hm(e)){if(!hm(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return[e];var o=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof o||Array.isArray(o)||o instanceof Zm||bm(o)||null===o||console.error("".concat(Kp(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),eg(o,t,n,r)}var s;return e instanceof Zm?n?(e.inject(n,r),[e.getName(r)]):[e]:bm(e)?Xm(e):Array.isArray(e)?Array.prototype.concat.apply(Mp,e.map(function(e){return eg(e,t,n,r)})):[e.toString()]}var tg=Yp($p),ng=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(hm(n)&&!pm(n))return!1}return!0}(e),this.componentId=t,this.baseHash=Hp(tg,t),this.baseStyle=n,Um.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=mm(r,this.staticRulesId);else{var o=gm(eg(this.rules,e,t,n)),s=Vp(Hp(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var a=n(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,a)}r=mm(r,s),this.staticRulesId=s}else{for(var i=Hp(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l,"production"!==process.env.NODE_ENV&&(i=Hp(i,l));else if(l){var d=gm(eg(l,e,t,n));i=Hp(i,d+u),c+=d}}if(c){var f=Vp(i>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,n(c,".".concat(f),void 0,this.componentId)),r=mm(r,f)}}return r},e}(),rg=x.default.createContext(void 0);rg.Consumer;var og={},sg=new Set;function ag(e,t,n){var r=pm(e),s=e,a=!Jp(e),i=t.attrs,c=void 0===i?Mp:i,u=t.componentId,l=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Dp(e);og[n]=(og[n]||0)+1;var r="".concat(n,"-").concat(Zp($p+n+og[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Jp(e)?"styled.".concat(e):"Styled(".concat(Kp(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(Dp(t.displayName),"-").concat(t.componentId):t.componentId||l,p=r&&s.attrs?s.attrs.concat(c).filter(Boolean):c,m=t.shouldForwardProp;if(r&&s.shouldForwardProp){var g=s.shouldForwardProp;if(t.shouldForwardProp){var b=t.shouldForwardProp;m=function(e,t){return g(e,t)&&b(e,t)}}else m=g}var y=new ng(n,h,r?s.componentStyle:void 0);function w(e,t){return function(e,t,n){var r=e.attrs,s=e.componentStyle,a=e.defaultProps,i=e.foldedComponentIds,c=e.styledComponentId,u=e.target,l=x.default.useContext(rg),d=Ym(),f=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue(c);var h=function(e,t,n){return void 0===n&&(n=Lp),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,a)||Lp,p=function(e,t,n){for(var r,o=Ah(Ah({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=hm(r=e[s])?r(o):r;for(var i in a)o[i]="className"===i?mm(o[i],a[i]):"style"===i?Ah(Ah({},o[i]),a[i]):a[i]}return t.className&&(o.className=mm(o.className,t.className)),o}(r,t,h),m=p.as||u,g={};for(var b in p)void 0===p[b]||"$"===b[0]||"as"===b||"theme"===b&&p.theme===h||("forwardedAs"===b?g.as=p.forwardedAs:f&&!f(b,m)||(g[b]=p[b],f||"development"!==process.env.NODE_ENV||Th(b)||sg.has(b)||!Fp.has(m)||(sg.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var y=function(e,t){var n=Ym(),r=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&o.useDebugValue(r),r}(s,p);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(y);var w=mm(i,c);return y&&(w+=" "+y),p.className&&(w+=" "+p.className),g[Jp(m)&&!Fp.has(m)?"class":"className"]=w,n&&(g.ref=n),o.createElement(m,g)}(v,e,t)}w.displayName=f;var v=x.default.forwardRef(w);return v.attrs=p,v.componentStyle=y,v.displayName=f,v.shouldForwardProp=m,v.foldedComponentIds=r?mm(s.foldedComponentIds,s.styledComponentId):"",v.styledComponentId=h,v.target=r?s.target:e,Object.defineProperty(v,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=r?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)ym(e,o[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(zp(f,h),v.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(s,".\n")+"Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(f,h)),wm(v,function(){return".".concat(v.styledComponentId)}),a&&fm(v,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),v}function ig(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n}var cg=function(e){return Object.assign(e,{isCss:!0})};function ug(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(hm(e)||bm(e))return cg(eg(ig(Mp,Ih([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?eg(r):cg(eg(ig(r,t)))}function lg(e,t,n){if(void 0===n&&(n=Lp),!t)throw Em(1,t);var r=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,ug.apply(void 0,Ih([r],o,!1)))};return r.attrs=function(r){return lg(e,t,Ah(Ah({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return lg(e,t,Ah(Ah({},n),r))},r}var dg=function(e){return lg(ag,e)},fg=dg;Fp.forEach(function(e){fg[e]=dg(e)}),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");var hg="__sc-".concat(Sp,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[hg]||(window[hg]=0),1===window[hg]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window[hg]+=1);const pg={colors:{black:"#000000",white:"#FFFFFF",offWhite:"#F5F5F5",grey:{100:"#F7F7F7",200:"#E6E6E6",300:"#D1D1D1",400:"#B0B0B0",500:"#8C8C8C",600:"#696969",700:"#474747",800:"#2B2B2B",900:"#1A1A1A"},primary:"#000000",secondary:"#B0B0B0",error:"#FF4D4D",success:"#4CAF50",background:{main:"#FFFFFF",secondary:"#F5F5F5",overlay:"rgba(0, 0, 0, 0.7)"},text:{primary:"#000000",secondary:"#474747",tertiary:"#8C8C8C",inverse:"#FFFFFF"},button:{primary:{background:"#000000",text:"#FFFFFF",hover:"#2B2B2B",disabled:"#8C8C8C"},secondary:{background:"#F5F5F5",text:"#000000",hover:"#E6E6E6",disabled:"#D1D1D1"}},border:{light:"#E6E6E6",medium:"#D1D1D1",dark:"#8C8C8C"}},typography:{fontFamily:"'Montserrat', 'Arial', sans-serif",fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeights:{light:300,regular:400,medium:500,semibold:600,bold:700}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{none:"0",sm:"0.125rem",md:"0.25rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"},shadows:{none:"none",sm:"0 1px 2px rgba(0, 0, 0, 0.05)",md:"0 4px 6px rgba(0, 0, 0, 0.05)",lg:"0 10px 15px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.1s ease",normal:"0.2s ease",slow:"0.3s ease"}},mg=(function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var r=gm(ug.apply(void 0,Ih([e],t,!1))),o=Zp(r);return new Zm(o,r)})`
|
|
13
13
|
from {
|
|
14
14
|
transform: rotate(0deg);
|
|
15
15
|
}
|