superstack-wallet-sdk 0.4.10 → 0.4.11

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/index.cjs CHANGED
@@ -9,7 +9,7 @@ const bl=BigInt(0),yl=BigInt(1);function wl(e,t){const n=t.negate();return e?n:t
9
9
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Sl(e){void 0!==e.lowS&&Ks("lowS",e.lowS),void 0!==e.prehash&&Ks("prehash",e.prehash)}class Tl extends Error{constructor(e=""){super(e)}}const $l={Err:Tl,_tlv:{encode:(e,t)=>{const{Err:n}=$l;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=Js(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Js(o.length/2|128):"";return Js(e)+s+o+t},decode(e,t){const{Err:n}=$l;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}=$l;if(e<Cl)throw new t("integer: negative integers are not allowed");let n=Js(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}=$l;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 la(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=$l,o=pa("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}=$l,r=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,r)}};function Bl(e,t){return ta(fa(e,t))}const Cl=BigInt(0),Ol=BigInt(1);BigInt(2);const Rl=BigInt(3),zl=BigInt(4);function _l(e){const t=function(e){const t=Nl(e);Pa(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=pl(t.n,t.nBitLength),o=t.toBytes||((e,t,r)=>{const o=t.toAffine();return ma(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,Rl),zl),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(Ys(e)&&(e=ta(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:la(pa("private key",e,r))}catch(t){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof e)}return o&&(a=ol(a,s)),ya("private key",a,Ol,s),a}function d(e){if(!(e instanceof p))throw new Error("ProjectivePoint expected")}const f=ka((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=ka(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=dl(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(pa("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return p.BASE.multiply(l(e))}static msm(e,t){return Il(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,Rl),{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,Rl);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;ya("scalar",e,Cl,o);const s=p.ZERO;if(e===Cl)return s;if(this.is0()||e===Ol)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>Cl||u>Cl;)i&Ol&&(l=l.add(f)),u&Ol&&(d=d.add(f)),f=f.double(),i>>=Ol,u>>=Ol;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(ya("scalar",e,Ol,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!==Cl&&t!==Ol&&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===Ol)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===Ol?this:n?n(p,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return Ks("isCompressed",e),this.assertValidity(),o(p,this,e)}toHex(e=!0){return Ks("isCompressed",e),ta(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:wl,hasPrecomputes:e=>1!==Al(e),unsafeLadder(e,t,n=y.ZERO){let r=e;for(;t>bl;)t&yl&&(n=n.add(r)),r=r.double(),t>>=yl;return n},precomputeWindow(e,t){const{windows:n,windowSize:r}=xl(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=xl(e,w);for(let e=0;e<s.windows;e++){const{nextN:a,offset:i,isZero:c,isNeg:u,isNegF:l,offsetF:d}=El(n,e,s);n=a,c?o=o.add(wl(l,t[d])):r=r.add(wl(u,t[i]))}return{p:r,f:o}},wNAFUnsafe(e,t,n,r=y.ZERO){const o=xl(e,w);for(let e=0;e<o.windows&&n!==bl;e++){const{nextN:s,offset:a,isZero:i,isNeg:c}=El(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=Pl.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&Pl.set(t,n(r))),r},wNAFCached(e,t,n){const r=Al(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const o=Al(e);return 1===o?this.unsafeLadder(e,t,r):this.wNAFUnsafe(o,this.getPrecomputes(o,e,n),t,r)},setWindowSize(e,t){vl(t,w),kl.set(e,t),Pl.delete(e)}});var y,w;return{CURVE:t,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:function(e){return ba(e,Ol,t.n)}}}function Ml(e){const t=function(e){const t=Nl(e);return Pa(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 ol(e,r)}function u(e){return al(e,r)}const{ProjectivePoint:l,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=_l({...t,toBytes(e,t,r){const o=t.toAffine(),s=n.toBytes(o.x),a=ma;return Ks("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=la(o);if(!ba(e,Ol,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&Ol)===Ol)&&(s=n.neg(s)),{x:e,y:s}}}});function p(e){return e>r>>Ol}const m=(e,t,n)=>la(e.slice(t,n));class g{constructor(e,t,n){ya("r",e,Ol,r),ya("s",t,Ol,r),this.r=e,this.s=t,null!=n&&(this.recovery=n),Object.freeze(this)}static fromCompact(e){const t=o;return e=pa("compactSignature",e,2*t),new g(m(e,0,t),m(e,t,2*t))}static fromDER(e){const{r:t,s:n}=$l.toSig(pa("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(pa("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+Bl(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 ua(this.toDERHex())}toDERHex(){return $l.hexFromSig(this)}toCompactRawBytes(){return ua(this.toCompactHex())}toCompactHex(){const e=o;return Bl(this.r,e)+Bl(this.s,e)}}const b={isValidPrivateKey(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const e=gl(t.n);return function(e,t,n=!1){const r=e.length,o=ml(t),s=gl(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const a=ol(n?da(e):la(e),t-Qu)+Qu;return n?ha(a,o):fa(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=pa("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=la(e),n=8*e.length-s;return n>0?t>>BigInt(n):t},v=t.bits2int_modN||function(e){return c(w(e))},x=wa(s);function E(e){return ya("num < 2^"+s,e,Cl,x),fa(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=pa("msgHash",e),Sl(o),f&&(e=pa("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(pa("extraEntropy",e))}const P=ma(...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===Cl)return;const s=c(n*c(A+o*y));if(s===Cl)return;let a=(r.x===o?0:2)|Number(r.y&Ol),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=va(e),o=va(e),s=0;const a=()=>{r.fill(1),o.fill(0),s=0},i=(...e)=>n(o,r,...e),c=(e=va(0))=>{o=i(xa([0]),e),r=i(),0!==e.length&&(o=i(xa([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 ma(...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=pa("msgHash",n),r=pa("publicKey",r);const{lowS:a,prehash:i,format:d}=o;if(Sl(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||Ys(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 $l.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 Fl(e){return{hash:e,hmac:(t,...n)=>Ku(e,t,function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];Zt(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:an}}
11
11
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
12
- const jl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ll=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ul=BigInt(0),Dl=BigInt(1),Gl=BigInt(2),ql=(e,t)=>(e+t/Gl)/t;const Vl=pl(jl,void 0,void 0,{sqrt:function(e){const t=jl,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=sl(l,n,t)*l%t,f=sl(d,n,t)*l%t,h=sl(f,Gl,t)*u%t,p=sl(h,o,t)*h%t,m=sl(p,s,t)*p%t,g=sl(m,i,t)*m%t,b=sl(g,c,t)*g%t,y=sl(b,i,t)*m%t,w=sl(y,n,t)*l%t,v=sl(w,a,t)*p%t,x=sl(v,r,t)*u%t,E=sl(x,Gl,t);if(!Vl.eql(Vl.sqr(E),e))throw new Error("Cannot find square root");return E}}),Wl=function(e,t){const n=t=>Ml({...e,...Fl(t)});return{...n(t),create:n}}({a:Ul,b:BigInt(7),Fp:Vl,n:Ll,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ll,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Dl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),i=ql(s*e,t),c=ql(-r*e,t);let u=ol(e-i*n-c*o,t),l=ol(-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}}}},Es);var Hl=Object.freeze({__proto__:null,secp256k1:Wl});function Yl(e,t={}){const{recovered:n}=t;if(void 0===e.r)throw new Xl({signature:e});if(void 0===e.s)throw new Xl({signature:e});if(n&&void 0===e.yParity)throw new Xl({signature:e});if(e.r<0n||e.r>Iu)throw new ed({value:e.r});if(e.s<0n||e.s>Iu)throw new td({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new nd({value:e.yParity})}function Zl(e){if(130!==e.length&&132!==e.length)throw new Ql({signature:e});const t=BigInt(ui(e,0,32)),n=BigInt(ui(e,32,64)),r=(()=>{const t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return Jl(t)}catch{throw new nd({value:t})}})();return void 0===r?{r:t,s:n}:{r:t,s:n,yParity:r}}function Kl(e){if(void 0!==e.r&&void 0!==e.s)return function(e){const t="string"==typeof e?Zl(e):e instanceof Uint8Array?function(e){return Zl(oi(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=Jl(t)),"number"!=typeof n)throw new nd({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:Jl(e.v)}}(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return Yl(t),t}(e)}function Jl(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 rd({value:e})}class Ql extends Aa{constructor({signature:e}){var t;super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${li((t=e,t instanceof Uint8Array?oi(t):Array.isArray(t)?oi(new Uint8Array(t)):t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Xl extends Aa{constructor({signature:e}){super(`Signature \`${Fa(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class ed extends Aa{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 td extends Aa{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 nd extends Aa{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 rd extends Aa{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 od(e,t={}){return"string"==typeof e.chainId?function(e){const{address:t,chainId:n,nonce:r}=e,o=Kl(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}(e):{...e,...t.signature}}const sd=Uu("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function ad(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==ui(e,-32))throw new id(e)}else Yl(e.authorization)}let id=class extends Aa{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 cd(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",a=void 0!==n?zt(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?$t(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 ud(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){const a=r||"latest",i=void 0!==n?zt(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,zt(s)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||a,zt(s)]},{dedupe:Boolean(i)}),!c)throw new Mr({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||as)(c)}async function ld(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Fr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||cc)(n)}async function dd(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?xi(e.blockOverrides):void 0,r=e.calls.map(e=>{const t=e,n=t.account?or(t.account):void 0,r=t.abi?ar(t):t.data,o={...t,data:t.dataSuffix?Mn([r||"0x",t.dataSuffix]):r,from:t.from??n?.address};return es(o),Zo(o)}),o=e.stateOverrides?Qo(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:o})}const c=("bigint"==typeof n?zt(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:s,traceTransfers:a,validation:i},c]})).map((e,t)=>({...is(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=>Us(e)),d="0x1"===e.status?"success":"failure",f=r&&"success"===d&&"0x"!==c?Vs({abi:r,data:c,functionName:a}):null,h=(()=>{if("success"===d)return;let t;return"0x"===e.error?.data?t=new Ke:e.error&&(t=new Vr(e.error)),t?Ao(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=Wo(t,{});if(n instanceof Vo)throw t;throw n}}function fd(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 Aa("Unable to normalize signature.");return o}function hd(e,t){const n=typeof e,r=t.type;switch(r){case"address":return wu(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)=>hd(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=>hd(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function pd(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 pd(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")))&&wu(n[r],{strict:!1}))())return a}}function md(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||"string"==typeof e?ze(e):e;return{...r,...n?{hash:yd(r)}:{}}}function gd(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=hi(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?bd(e)===ui(t,0,4):"event"===e.type&&yd(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new vd({name:t});if(1===a.length)return{...a[0],...o?{hash:yd(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:yd(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&&hd(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=pd(e.inputs,i.inputs,r);if(t)throw new wd({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 vd({name:t});return{...c,...o?{hash:yd(c)}:{}}}function bd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return gd(t,n)}return e[0]})();return ui(yd(t),0,4)}function yd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return gd(t,n)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:mu(ai(function(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return gd(t,n)}return e[0]})();return fd("string"==typeof t?t:Z(t))}(t)))}class wd extends Aa{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${fd(Z(e.abiItem))}\`, and`,`\`${t.type}\` in \`${fd(Z(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 vd extends Aa{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 xd(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new vd({name:"constructor"});return t}function Ed(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[t,n,r]=e;return[kd(t,n,{args:r}),r]}const[t,n]=e;return[t,n]})(),{overloads:r}=t,o=r?kd([t,...r],t.name,{args:n}):t,s=bd(o);const a=n.length>0?ju(o.inputs,n):void 0;return a?ni(s,a):s}function Pd(e,t={}){return md(e,t)}function kd(e,t,n){const r=gd(e,t,n);if("function"!==r.type)throw new vd({name:t,type:"function"});return r}const Ad="0x0000000000000000000000000000000000000000";async function Id(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:a,traceTransfers:i,validation:c}=t,u=t.account?or(t.account):void 0;if(a&&!u)throw new Ve("`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[xd(t),n]}return e})(),{bytecode:r,args:o}=n;return ni(r,t.inputs?.length&&o?.length?ju(t.inputs,o):"0x")}(md("constructor(bytes, bytes)"),{bytecode:Ci,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",Ed(Pd("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 Mc(e,{account:u.address,...t,data:t.abi?ar(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await dd(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:l}],stateOverrides:s},{calls:d.map((e,t)=>({abi:[Pd("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]}]:[],{calls:[...o,{}].map(e=>({...e,from:u?.address})),stateOverrides:s},...a?[{calls:[{data:l}]},{calls:d.map((e,t)=>({abi:[Pd("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Pd("function decimals() returns (uint256)")],functionName:"decimals",from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Pd("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Pd("function symbol() returns (string)")],functionName:"symbol",from:Ad,nonce:t})),stateOverrides:[{address:Ad,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?Tt(e.data):null),A=[...g?.calls??[],...b?.calls??[]].map(e=>"success"===e.status?Tt(e.data):null),I=(y?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),S=(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=N[e-1],s=S[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 Nd="0x6492649264926492649264926492649264926492649264926492649264926492";function Sd(e){try{return function(e){if(ui(e,-32)!==Nd)throw new Td(e)}(e),!0}catch{return!1}}class Td extends Aa{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 $d({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 Wl.Signature(Tt(e),Tt(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===n?a:Dt(a)}async function Bd(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 Le(e)?e:"object"==typeof e&&"r"in e&&"s"in e?$d(e):Rt(e)})();try{return function(e){try{return ad(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){ad(e);const t=fi(ui(e,-64,-32)),n=ui(e,-t-64,-64),r=ui(e,0,-t-64),[o,s,a]=Fu(sd,n);return{authorization:od({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 Lc(e,{address:n,blockNumber:r,blockTag:o});if(d===Fn(["0xef0100",i.address]))return await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:a}=t,i=await Me(e,Hi,"readContract")({address:n,abi:Ti,args:[s,a],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof Ur)throw new Cd;throw e});if(i.startsWith("0x1626ba7e"))return!0;throw new Cd}(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:zt(i.r,{size:32}),s:zt(i.s,{size:32}),yParity:i.yParity},h=await async function({address:e,authorization:t,signature:n}){return _s(On(e),await Co({authorization:t,signature:n}))}({address:n,authorization:f});if(!h)throw new Cd;const p=await Me(e,Hi,"readContract")({...a?{address:a}:{code:zi},authorizationList:[f],abi:Ei,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??n,callData:c}]:[],{allowFailure:!0,target:n,callData:ar({abi:Ti,functionName:"isValidSignature",args:[s,u]})}]]}),m=p[p.length-1]?.returnData;if(m?.startsWith("0x1626ba7e"))return!0;throw new Cd}(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?Sd(a)?a:function(e){const{data:t,signature:n,to:r}=e;return ni(ju(Uu("address, bytes, bytes"),[r,t,n]),Nd)}({data:o,signature:a,to:r}):a)(),l=i?{to:i,data:ar({abi:$i,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:ji({abi:$i,args:[n,s,u],bytecode:Ri}),...c},{data:d}=await Me(e,Vi,"call")(l).catch(e=>{if(e instanceof Lr)throw new Cd;throw e});if(function(e,t={}){let n=e;if(t.size&&(St(n,{size:t.size}),n=Nt(n)),"0x00"===Nt(n))return!1;if("0x01"===Nt(n))return!0;throw new At(n)}(d??"0x0"))return!0;throw new Cd}(e,{...t,verifierAddress:o,signature:a})}catch(e){try{if(_s(On(n),await No({hash:r,signature:a})))return!0}catch{}if(e instanceof Cd)return!1;throw e}}class Cd extends Error{}function Od(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))?Ji(kr(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:o},r=>Xi(async()=>{try{const t=await Me(e,rc,"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})):Ji(kr(["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=Tt(e.result?.number);t.onBlockNumber(r,i),i=r},onError(e){t.onError?.(e)}});r=s,n||r()}catch(e){o?.(e)}})(),()=>r()})}const Rd=/^(?:(?<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)?/,zd=/(?: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 _d(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(Rd)?.groups??{},{chainId:o,expirationTime:s,issuedAt:a,notBefore:i,requestId:c,...u}=e.match(zd)?.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(!_n(r.address,{strict:!1}))return!1;if(t&&!_s(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=tu(o);return Bd(e,{address:l.address,hash:f,signature:i,...u})}function Md(e){return{call:t=>Vi(e,t),createAccessList:t=>Mc(e,t),createBlockFilter:()=>async function(e){const t=nr(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>rr(e,t),createEventFilter:t=>Fc(e,t),createPendingTransactionFilter:()=>jc(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:a,...i}=t,c=ar({abi:n,args:o,functionName:s});try{return await Me(e,zs,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:r,...i})}catch(e){const t=i.account?or(i.account):void 0;throw Ao(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}(e,t),estimateGas:t=>zs(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o="bigint"==typeof n?zt(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=>cs(e,t),getBlockNumber:t=>rc(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=void 0!==n?zt(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)}),$t(s)}(e,t),getBytecode:t=>Lc(e,t),getChainId:()=>Bs(e),getCode:t=>Lc(e,t),getContractEvents:t=>Gs(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 Me(e,Hi,"readContract")({abi:Dc,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 Uc({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 Li({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(e=>s.endsWith(e)))return null;const d=null!=o?[wc(s),BigInt(o)]:[wc(s)];try{const t=ar({abi:Si,functionName:"addr",args:d}),o={address:u,abi:Ai,functionName:"resolveWithGateways",args:[Ct(Ec(s)),t,a??[gc]],blockNumber:n,blockTag:r},i=Me(e,Hi,"readContract"),c=await i(o);if("0x"===c[0])return null;const l=Vs({abi:Si,args:d,functionName:"addr",data:c[0]});return"0x"===l||"0x00"===Nt(l)?null:l}catch(e){if(i)throw e;if(fc(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 Me(e,_c,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:i,gatewayUrls:s,strict:a});if(!c)return null;try{return await zc(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 Li({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const t={address:u,abi:Ii,args:[n,s,a??[gc]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},i=Me(e,Hi,"readContract"),[c]=await i(t);return c||null}catch(e){if(i)throw e;if(fc(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 Li({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 Me(e,Hi,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ct(Ec(o))],blockNumber:n,blockTag:r});return c}(e,t),getEnsText:t=>_c(e,t),getFeeHistory:t=>Gc(e,t),estimateFeesPerGas:t=>async function(e,t){return ds(e,t)}(e,t),getFilterChanges:e=>oc(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=>Us(e));return t.abi?Ls({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>us(e),getLogs:t=>Ds(e,t),getProof:t=>cd(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return ls(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=void 0!==n?zt(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}(e,t),getTransaction:t=>ud(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([Me(e,rc,"getBlockNumber")({}),t?Me(e,ud,"getTransaction")({hash:t}):void 0]),s=n?.blockNumber||o?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>fs(e,t),getTransactionReceipt:t=>ld(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 Li({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=ar({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=Ao(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=>Me(e,Hi,"readContract")({...null===f?{code:zi}:{address:f},abi:Ei,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 Ke;if(!s)throw new Vr({data:r});const e=Vs({abi:i,args:d,data:r,functionName:l});b.push(o?{result:e,status:"success"}:e)}catch(e){const t=Ao(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 Ve("multicall results mismatch");return b}(e,t),prepareTransactionRequest:t=>Rs(e,t),readContract:t=>Hi(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulate:t=>dd(e,t),simulateBlocks:t=>dd(e,t),simulateCalls:t=>Id(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:a,...i}=t,c=i.account?or(i.account):e.account,u=ar({abi:n,args:o,functionName:a});try{const{data:l}=await Me(e,Vi,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...i,account:c});return{result:Vs({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 Ao(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyHash:t=>Bd(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...a}){return Bd(e,{address:t,factory:r,factoryData:o,hash:tu(n),signature:s,...a})}(e,t),verifySiweMessage:t=>_d(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 Bd(e,{address:n,factory:r,factoryData:o,hash:iu({message:a,primaryType:i,types:c,domain:u}),signature:s,...l})}(e,t),uninstallFilter:e=>sc(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=kr(["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}=Di(),v=c?setTimeout(()=>{m?.(),p?.(),w(new jr({hash:o}))},c):void 0;return p=Ji(u,{onReplaced:s,resolve:y,reject:w},async t=>{if(h=await Me(e,ld,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1)return clearTimeout(v),t.resolve(h),void p?.();m=Me(e,Od,"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 ac(async()=>{d=await Me(e,ud,"getTransaction")({hash:o}),d.blockNumber&&(u=d.blockNumber)},{delay:i,retryCount:a}),g=!1),h=await Me(e,ld,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;c(()=>t.resolve(h))}catch(n){if(n instanceof Mr||n instanceof Fr){if(!d)return void(g=!1);try{f=d,g=!0;const n=await ac(()=>Me(e,cs,"getBlock")({blockNumber:u,includeTransactions:!0}),{delay:i,retryCount:a,shouldRetry:({error:e})=>e instanceof os});g=!1;const o=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!o)return;if(h=await Me(e,ld,"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?Ji(kr(["watchBlocks",e.uid,t,n,r,l,c]),{onBlock:o,onError:s},o=>Xi(async()=>{try{const r=await Me(e,cs,"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 Me(e,cs,"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&&Me(e,cs,"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 Me(e,cs,"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=>Od(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 Ji(kr(["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=Xi(async()=>{if(f)try{let i;if(l)i=await Me(e,oc,"getFilterChanges")({filter:l});else{const s=await Me(e,rc,"getBlockNumber")({});i=u&&u<s?await Me(e,Gs,"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 no&&(f=!1),c.onError?.(e)}else{try{l=await Me(e,rr,"createContractEventFilter")({abi:n,address:r,args:o,eventName:a,strict:t,fromBlock:i})}catch{}f=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await Me(e,sc,"uninstallFilter")({filter:l}),h()}})})():(()=>{const t=f??!1,i=kr(["watchContractEvent",r,o,s,e.uid,a,d,t]);let l=!0,h=()=>l=!1;return Ji(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?er({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}=Fs({abi:n,data:r.data,topics:r.topics,strict:f}),s=Us(r,{args:o,eventName:e});t.onLogs([s])}catch(e){let n,o;if(e instanceof dt||e instanceof ft){if(f)return;n=e.abiItem.name,o=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const s=Us(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?Ji(kr(["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=Xi(async()=>{if(d)try{let a;if(u)a=await Me(e,oc,"getFilterChanges")({filter:u});else{const r=await Me(e,rc,"getBlockNumber")({});a=c&&c!==r?await Me(e,Ds,"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 no&&(d=!1),i.onError?.(e)}else{try{u=await Me(e,Fc,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:a})}catch{}d=!0}},{emitOnBegin:!0,interval:l});return async()=>{u&&await Me(e,sc,"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=>er({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}=Fs({abi:l??[],data:t.data,topics:t.topics,strict:h}),r=Us(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof dt||e instanceof ft){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const o=Us(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)?Ji(kr(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},n=>{let r;const o=Xi(async()=>{try{if(!r)try{return void(r=await Me(e,jc,"createPendingTransactionFilter")({}))}catch(e){throw o(),e}const s=await Me(e,oc,"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 Me(e,sc,"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 Fd(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?or(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:dc(),...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(Md)}class jd extends Ve{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 Ld(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 jd;const v=eu(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:Vc(r,{methods:t,retryCount:o,retryDelay:s,uid:dc()}),value:c}}({key:s,methods:a,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:o}=qi({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 Hr({body:r,error:s,url:w});return a},retryCount:b,retryDelay:l,timeout:y,type:"http"},{fetchOptions:o,url:w})}}function Ud(e,t,n){for(let n in t){let r=t[n];Object.defineProperty(e,n,{enumerable:!0,value:r,writable:!1})}}function Dd(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=>Dd(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 Dd(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=>`${Dd(n,t)}: ${Dd(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Gd(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: ${Dd(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+Dd(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 Ud(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Ud(r,{shortMessage:o}),r}(t,n,r)}function qd(e,t,n,r){Gd(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function Vd(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}qd(!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 Wd=BigInt(0),Hd=BigInt(1),Yd=9007199254740991;function Zd(e,t){const n=Qd(e,"value"),r=BigInt(ef(t,"width"));if(Gd(n>>r===Wd,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-Hd){return-((~n&(Hd<<r)-Hd)+Hd)}return n}function Kd(e,t){const n=Qd(e,"value"),r=BigInt(ef(t,"bits"));return n&(Hd<<r)-Hd}function Jd(e,t){switch(typeof e){case"bigint":return e;case"number":return qd(Number.isInteger(e),"underflow",t||"value",e),qd(e>=-Yd&&e<=Yd,"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){qd(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}qd(!1,"invalid BigNumberish value",t||"value",e)}function Qd(e,t){const n=Jd(e,t);return Gd(n>=Wd,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Xd="0123456789abcdef";function ef(e,t){switch(typeof e){case"bigint":return qd(e>=-Yd&&e<=Yd,"overflow",t||"value",e),Number(e);case"number":return qd(Number.isInteger(e),"underflow",t||"value",e),qd(e>=-Yd&&e<=Yd,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return ef(BigInt(e),t)}catch(n){qd(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}qd(!1,"invalid numeric value",t||"value",e)}const tf=BigInt(-1),nf=BigInt(0),rf=BigInt(1),of=BigInt(5),sf={};let af="0000";for(;af.length<80;)af+=af;function cf(e){let t=af;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function uf(e,t,n){const r=BigInt(t.width);if(t.signed){const t=rf<<r-rf;Gd(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>nf?Zd(Kd(e,r),r):-Zd(Kd(-e,r),r)}else{const t=rf<<r;Gd(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-rf}return e}function lf(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]+)$/);qd(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:(qd(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)}qd(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),qd(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 df{format;#e;#t;#n;_value;constructor(e,t,n){!function(e,t,n){if(e!==t){let e=n,t="new";e+=".",t+=" "+n,Gd(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,sf,"FixedNumber"),this.#t=t,this.#e=n;const r=function(e,t){let n="";e<nf&&(n="-",e*=tf);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=af+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);Ud(this,{format:n.name,_value:r}),this.#n=cf(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){qd(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#o(e,t){return e=uf(e,this.#e,t),new df(sf,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 Gd(t%this.#n===nf,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#o(t/this.#n,"mulSignal")}#c(e,t){return Gd(e.#t!==nf,"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){Gd(e.#t!==nf,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e);const t=this.#t*this.#n;return Gd(t%e.#t===nf,"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*=cf(r):r<0&&(t*=cf(-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<nf&&(e-=this.#n-rf),e=this.#t/this.#n*this.#n,this.#o(e,"floor")}ceiling(){let e=this.#t;return this.#t>nf&&(e+=this.#n-rf),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=of*cf(t-1);let r=this.value+n;const o=cf(t);return r=r/o*o,uf(r,this.#e,"round"),new df(sf,r,this.#e)}isZero(){return this.#t===nf}isNegative(){return this.#t<nf}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return df.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:ef(t),o=lf(n);let s=Jd(e,"value");const a=r-o.decimals;if(a>0){const t=cf(a);Gd(s%t===nf,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=cf(-a));return uf(s,o,"fromValue"),new df(sf,s,o)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);qd(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=lf(t);let o=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=af;Gd(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 uf(a,r,"fromString"),new df(sf,a,r)}static fromBytes(e,t){let n=function(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Xd[n>>4],t+=Xd[15&n];return BigInt(t)}return Jd(e)}(Vd(e,"value"));const r=lf(t);return r.signed&&(n=Zd(n,r.width)),uf(n,r,"fromBytes"),new df(sf,n,r)}}function ff(e){return function(e,t){let n=18;return n=ef(t,"unit"),df.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const hf="0.38.13";function pf({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@${hf}:${t}`):r.searchParams.append("sdkVersion",`onchainkit@${hf}`),r.searchParams.sort(),r.toString()}var mf=[],gf=[],bf="undefined"!=typeof Uint8Array?Uint8Array:Array,yf=!1;function wf(){yf=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)mf[t]=e[t],gf[e.charCodeAt(t)]=t;gf["-".charCodeAt(0)]=62,gf["_".charCodeAt(0)]=63}function vf(e){return mf[e>>18&63]+mf[e>>12&63]+mf[e>>6&63]+mf[63&e]}function xf(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(vf(r));return o.join("")}function Ef(e){var t;yf||wf();for(var n=e.length,r=n%3,o="",s=[],a=16383,i=0,c=n-r;i<c;i+=a)s.push(xf(e,i,i+a>c?c:i+a));return 1===r?(t=e[n-1],o+=mf[t>>2],o+=mf[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=mf[t>>10],o+=mf[t>>4&63],o+=mf[t<<2&63],o+="="),s.push(o),s.join("")}function Pf(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 kf(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 Af={}.toString,If=Array.isArray||function(e){return"[object Array]"==Af.call(e)};function Nf(){return Tf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Sf(e,t){if(Nf()<t)throw new RangeError("Invalid typed array length");return Tf.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Tf.prototype:(null===e&&(e=new Tf(t)),e.length=t),e}function Tf(e,t,n){if(!(Tf.TYPED_ARRAY_SUPPORT||this instanceof Tf))return new Tf(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 Cf(this,e)}return $f(this,e,t,n)}function $f(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);Tf.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Tf.prototype:e=Of(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Tf.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|_f(t,n);e=Sf(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(zf(t)){var n=0|Rf(t.length);return 0===(e=Sf(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?Sf(e,0):Of(e,t);if("Buffer"===t.type&&If(t.data))return Of(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Bf(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 Cf(e,t){if(Bf(t),e=Sf(e,t<0?0:0|Rf(t)),!Tf.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Of(e,t){var n=t.length<0?0:0|Rf(t.length);e=Sf(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Rf(e){if(e>=Nf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Nf().toString(16)+" bytes");return 0|e}function zf(e){return!(null==e||!e._isBuffer)}function _f(e,t){if(zf(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 uh(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return lh(e).length;default:if(r)return uh(e).length;t=(""+t).toLowerCase(),r=!0}}function Mf(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 Qf(this,t,n);case"utf8":case"utf-8":return Yf(this,t,n);case"ascii":return Kf(this,t,n);case"latin1":case"binary":return Jf(this,t,n);case"base64":return Hf(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xf(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ff(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function jf(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=Tf.from(t,r)),zf(t))return 0===t.length?-1:Lf(e,t,n,r,o);if("number"==typeof t)return t&=255,Tf.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Lf(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Lf(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 Uf(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 Df(e,t,n,r){return dh(uh(t,e.length-n),e,n,r)}function Gf(e,t,n,r){return dh(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function qf(e,t,n,r){return Gf(e,t,n,r)}function Vf(e,t,n,r){return dh(lh(t),e,n,r)}function Wf(e,t,n,r){return dh(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 Hf(e,t,n){return 0===t&&n===e.length?Ef(e):Ef(e.slice(t,n))}function Yf(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<=Zf)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Zf));return n}(r)}Tf.TYPED_ARRAY_SUPPORT=void 0===globalThis.TYPED_ARRAY_SUPPORT||globalThis.TYPED_ARRAY_SUPPORT,Nf(),Tf.poolSize=8192,Tf._augment=function(e){return e.__proto__=Tf.prototype,e},Tf.from=function(e,t,n){return $f(null,e,t,n)},Tf.TYPED_ARRAY_SUPPORT&&(Tf.prototype.__proto__=Uint8Array.prototype,Tf.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Tf[Symbol.species]),Tf.alloc=function(e,t,n){return function(e,t,n,r){return Bf(t),t<=0?Sf(e,t):void 0!==n?"string"==typeof r?Sf(e,t).fill(n,r):Sf(e,t).fill(n):Sf(e,t)}(null,e,t,n)},Tf.allocUnsafe=function(e){return Cf(null,e)},Tf.allocUnsafeSlow=function(e){return Cf(null,e)},Tf.isBuffer=function(e){return null!=e&&(!!e._isBuffer||fh(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&fh(e.slice(0,0))}(e))},Tf.compare=function(e,t){if(!zf(e)||!zf(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},Tf.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}},Tf.concat=function(e,t){if(!If(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Tf.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Tf.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!zf(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},Tf.byteLength=_f,Tf.prototype._isBuffer=!0,Tf.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)Ff(this,t,t+1);return this},Tf.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)Ff(this,t,t+3),Ff(this,t+1,t+2);return this},Tf.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)Ff(this,t,t+7),Ff(this,t+1,t+6),Ff(this,t+2,t+5),Ff(this,t+3,t+4);return this},Tf.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Yf(this,0,e):Mf.apply(this,arguments)},Tf.prototype.equals=function(e){if(!zf(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Tf.compare(this,e)},Tf.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+">"},Tf.prototype.compare=function(e,t,n,r,o){if(!zf(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},Tf.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Tf.prototype.indexOf=function(e,t,n){return jf(this,e,t,n,!0)},Tf.prototype.lastIndexOf=function(e,t,n){return jf(this,e,t,n,!1)},Tf.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 Uf(this,e,t,n);case"utf8":case"utf-8":return Df(this,e,t,n);case"ascii":return Gf(this,e,t,n);case"latin1":case"binary":return qf(this,e,t,n);case"base64":return Vf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wf(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Tf.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Zf=4096;function Kf(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 Jf(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 Qf(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+=ch(e[s]);return o}function Xf(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 eh(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 th(e,t,n,r,o,s){if(!zf(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 nh(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 rh(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 oh(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 sh(e,t,n,r,o){return o||oh(e,0,n,4),kf(e,t,n,r,23,4),n+4}function ah(e,t,n,r,o){return o||oh(e,0,n,8),kf(e,t,n,r,52,8),n+8}Tf.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),Tf.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Tf.prototype;else{var o=t-e;n=new Tf(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},Tf.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||eh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r},Tf.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||eh(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Tf.prototype.readUInt8=function(e,t){return t||eh(e,1,this.length),this[e]},Tf.prototype.readUInt16LE=function(e,t){return t||eh(e,2,this.length),this[e]|this[e+1]<<8},Tf.prototype.readUInt16BE=function(e,t){return t||eh(e,2,this.length),this[e]<<8|this[e+1]},Tf.prototype.readUInt32LE=function(e,t){return t||eh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Tf.prototype.readUInt32BE=function(e,t){return t||eh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Tf.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||eh(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},Tf.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||eh(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},Tf.prototype.readInt8=function(e,t){return t||eh(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Tf.prototype.readInt16LE=function(e,t){t||eh(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Tf.prototype.readInt16BE=function(e,t){t||eh(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Tf.prototype.readInt32LE=function(e,t){return t||eh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Tf.prototype.readInt32BE=function(e,t){return t||eh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Tf.prototype.readFloatLE=function(e,t){return t||eh(e,4,this.length),Pf(this,e,!0,23,4)},Tf.prototype.readFloatBE=function(e,t){return t||eh(e,4,this.length),Pf(this,e,!1,23,4)},Tf.prototype.readDoubleLE=function(e,t){return t||eh(e,8,this.length),Pf(this,e,!0,52,8)},Tf.prototype.readDoubleBE=function(e,t){return t||eh(e,8,this.length),Pf(this,e,!1,52,8)},Tf.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||th(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},Tf.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||th(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},Tf.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,1,255,0),Tf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Tf.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,65535,0),Tf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):nh(this,e,t,!0),t+2},Tf.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,65535,0),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):nh(this,e,t,!1),t+2},Tf.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,4294967295,0),Tf.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):rh(this,e,t,!0),t+4},Tf.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,4294967295,0),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):rh(this,e,t,!1),t+4},Tf.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);th(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},Tf.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);th(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},Tf.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,1,127,-128),Tf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Tf.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,32767,-32768),Tf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):nh(this,e,t,!0),t+2},Tf.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,32767,-32768),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):nh(this,e,t,!1),t+2},Tf.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,2147483647,-2147483648),Tf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):rh(this,e,t,!0),t+4},Tf.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):rh(this,e,t,!1),t+4},Tf.prototype.writeFloatLE=function(e,t,n){return sh(this,e,t,!0,n)},Tf.prototype.writeFloatBE=function(e,t,n){return sh(this,e,t,!1,n)},Tf.prototype.writeDoubleLE=function(e,t,n){return ah(this,e,t,!0,n)},Tf.prototype.writeDoubleBE=function(e,t,n){return ah(this,e,t,!1,n)},Tf.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||!Tf.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},Tf.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&&!Tf.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=zf(e)?e:uh(new Tf(e,r).toString()),i=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%i]}return this};var ih=/[^+\/0-9A-Za-z-_]/g;function ch(e){return e<16?"0"+e.toString(16):e.toString(16)}function uh(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 lh(e){return function(e){var t,n,r,o,s,a;yf||wf();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 bf(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=gf[e.charCodeAt(t)]<<18|gf[e.charCodeAt(t+1)]<<12|gf[e.charCodeAt(t+2)]<<6|gf[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=gf[e.charCodeAt(t)]<<2|gf[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=gf[e.charCodeAt(t)]<<10|gf[e.charCodeAt(t+1)]<<4|gf[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(ih,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function dh(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 fh(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}class hh{constructor(e){this.selectedWalletId=null,this.solanaConnection=null,this.ethereumProvider=null,this.walletInfo=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=exports.Network.Solana,this.api=f.default.create({baseURL:e.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=f.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=Fd({transport:Ld(e.ethereumNetwork.rpcUrl)})),this.defaultNetwork=e.defaultNetwork||exports.Network.Solana}setWallet(e){this.walletInfo=e}setWalletType(e){this.walletType=e,v.saveWalletType(e)}getWallet(){return this.walletInfo}getPhantomAdapter(){return this.phantomAdapter}getWalletType(){return this.walletType}get wallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===this.defaultNetwork))||null}get address(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.address)||null}get network(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.network)||null}get ethereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Ethereum&&"Main"===e.wallet_set))||null}get ethereumAddress(){var e;return(null===(e=this.ethereumWallet)||void 0===e?void 0:e.address)||null}get solanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Main"===e.wallet_set))||null}get forwardSolanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Forward-0"===e.wallet_set))||null}get forwardSolanaAddress(){var e;return(null===(e=this.forwardSolanaWallet)||void 0===e?void 0:e.address)||null}get forwardEthereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Ethereum&&"Forward-0"===e.wallet_set))||null}get forwardEthereumAddress(){var e;return(null===(e=this.forwardEthereumWallet)||void 0===e?void 0:e.address)||null}get solanaAddress(){var e;return(null===(e=this.solanaWallet)||void 0===e?void 0:e.address)||null}get id(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.id)||null}get social_links(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.social_links)||null}async reconnect(){try{if("phantom"===v.getWalletType())return await this.connectPhantom();{const e=await this.getSession();return this.setWallet(e),e}}catch(e){return null}}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new L),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(),is_exported:!1,address:e,network:exports.Network.Solana,type:exports.WalletType.Phantom,wallets:[{id:e,address:e,network:exports.Network.Solana,wallet_type:exports.WalletType.Phantom,wallet_set:"Main"}],social_links:[],social_infos:[],account_info:{name:null}};return this.setWallet(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){if(!this.walletInfo)throw new Error("No wallet info");const t=await this.api.post("/account/update",{name:e},{withCredentials:!0});return this.walletInfo.account_info.name=e,t.data}async signSolanaTransaction(e){try{if(!this.walletInfo)throw new Error("No wallet info");if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:n}=await this.solanaConnection.getLatestBlockhash();if(g(e)?e.message.recentBlockhash=n:e.recentBlockhash=n,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(e);const r=this.solanaWallet;if(!r)throw new Error("No solana wallet available");const o={user_id:this.walletInfo.id,address:r.address,network:exports.Network.Solana,tx:{Solana:h.default.encode(g(e)?e.message.serialize():e.serializeMessage())}},s=await this.api.post("/sign2",o,{withCredentials:!0}),{signature:a}=s.data;return e.addSignature(new t.PublicKey(r.address),Tf.from(h.default.decode(a))),e}catch(e){throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signEthereumEip712(e){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data;return r}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.setWallet(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.setWallet(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.setWallet(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.setWallet(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.setWallet(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.setWallet(r),this.setWalletType("embedded"),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 getSession(){const e=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:t,...n}=e;return t&&v.saveAccessToken(t),e}async logout(){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWallet(null),v.clear()}async getOAuth2ClientId(e){return(await this.api.get(`/oauth_id/${e}`)).data.client_id}setSelectedWallet(e){this.selectedWalletId=e}getSelectedWallet(){return this.selectedWalletId}async getSolanaBalance(){if(!this.solanaConnection||!this.solanaAddress)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new t.PublicKey(this.solanaAddress))/t.LAMPORTS_PER_SOL).toString()}async getEthereumBalance(){if(!this.ethereumProvider||!this.ethereumAddress)throw new Error("Ethereum provider not available");return ff(await this.ethereumProvider.getBalance({address:this.ethereumAddress}))}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(){return{signTypedData:async e=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data,o=h.default.decode(r),s=o[64];return $d({r:`0x${Tf.from(o.slice(0,32)).toString("hex")}`,s:`0x${Tf.from(o.slice(32,64)).toString("hex")}`,v:BigInt(s+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 pf(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;if(!this.walletInfo)throw new Error("No wallet info available");const r={user_id:this.walletInfo.id,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("/transfer",r,{withCredentials:!0})).data.tx_hash}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:"Transfer failed")}}async transferEthereum(e){if(!this.ethereumAddress)throw new Error("No Ethereum address available");const t={from:this.ethereumAddress,to:e.to,amount:e.amount,decimals:e.decimals,token:e.token,network:exports.Network.Ethereum,chain_id:e.chain_id};return this.transfer(t)}}var ph=function(){return ph=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},ph.apply(this,arguments)};function mh(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 gh(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 bh=/^((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)-.*))$/,yh=gh(function(e){return bh.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),wh="-ms-",vh="-moz-",xh="-webkit-",Eh="comm",Ph="rule",kh="decl",Ah="@keyframes",Ih=Math.abs,Nh=String.fromCharCode,Sh=Object.assign;function Th(e){return e.trim()}function $h(e,t){return(e=t.exec(e))?e[0]:e}function Bh(e,t,n){return e.replace(t,n)}function Ch(e,t,n){return e.indexOf(t,n)}function Oh(e,t){return 0|e.charCodeAt(t)}function Rh(e,t,n){return e.slice(t,n)}function zh(e){return e.length}function _h(e){return e.length}function Mh(e,t){return t.push(e),e}function Fh(e,t){return e.filter(function(e){return!$h(e,t)})}var jh=1,Lh=1,Uh=0,Dh=0,Gh=0,qh="";function Vh(e,t,n,r,o,s,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:s,line:jh,column:Lh,length:a,return:"",siblings:i}}function Wh(e,t){return Sh(Vh("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Hh(e){for(;e.root;)e=Wh(e.root,{children:[e]});Mh(e,e.siblings)}function Yh(){return Gh=Dh>0?Oh(qh,--Dh):0,Lh--,10===Gh&&(Lh=1,jh--),Gh}function Zh(){return Gh=Dh<Uh?Oh(qh,Dh++):0,Lh++,10===Gh&&(Lh=1,jh++),Gh}function Kh(){return Oh(qh,Dh)}function Jh(){return Dh}function Qh(e,t){return Rh(qh,e,t)}function Xh(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 ep(e){return Th(Qh(Dh-1,rp(91===e?e+2:40===e?e+1:e)))}function tp(e){for(;(Gh=Kh())&&Gh<33;)Zh();return Xh(e)>2||Xh(Gh)>3?"":" "}function np(e,t){for(;--t&&Zh()&&!(Gh<48||Gh>102||Gh>57&&Gh<65||Gh>70&&Gh<97););return Qh(e,Jh()+(t<6&&32==Kh()&&32==Zh()))}function rp(e){for(;Zh();)switch(Gh){case e:return Dh;case 34:case 39:34!==e&&39!==e&&rp(Gh);break;case 40:41===e&&rp(e);break;case 92:Zh()}return Dh}function op(e,t){for(;Zh()&&e+Gh!==57&&(e+Gh!==84||47!==Kh()););return"/*"+Qh(t,Dh-1)+"*"+Nh(47===e?e:Zh())}function sp(e){for(;!Xh(Kh());)Zh();return Qh(e,Dh)}function ap(e){return function(e){return qh="",e}(ip("",null,null,null,[""],e=function(e){return jh=Lh=1,Uh=zh(qh=e),Dh=0,[]}(e),0,[0],e))}function ip(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=Zh()){case 40:if(108!=p&&58==Oh(P,d-1)){-1!=Ch(P+=Bh(ep(y),"&","&\f"),"&\f",Ih(u?i[u-1]:0))&&(b=-1);break}case 34:case 39:case 91:P+=ep(y);break;case 9:case 10:case 13:case 32:P+=tp(p);break;case 92:P+=np(Jh()-1,7);continue;case 47:switch(Kh()){case 42:case 47:Mh(up(op(Zh(),Jh()),t,n,c),c);break;default:P+="/"}break;case 123*m:i[u++]=zh(P)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+l:-1==b&&(P=Bh(P,/\f/g,"")),h>0&&zh(P)-d&&Mh(h>32?lp(P+";",r,n,d-1,c):lp(Bh(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(Mh(E=cp(P,t,n,u,l,o,i,w,v=[],x=[],d,s),s),123===y)if(0===l)ip(P,t,E,E,v,s,d,i,x);else switch(99===f&&110===Oh(P,3)?100:f){case 100:case 108:case 109:case 115:ip(e,E,E,r&&Mh(cp(e,E,E,0,0,o,i,w,o,v=[],d,x),x),o,x,d,i,r?v:x);break;default:ip(P,E,E,E,[""],x,0,i,x)}}u=l=h=0,m=b=1,w=P="",d=a;break;case 58:d=1+zh(P),h=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Yh())continue;switch(P+=Nh(y),y*m){case 38:b=l>0?1:(P+="\f",-1);break;case 44:i[u++]=(zh(P)-1)*b,b=1;break;case 64:45===Kh()&&(P+=ep(Zh())),f=Kh(),l=d=zh(w=P+=sp(Jh())),y++;break;case 45:45===p&&2==zh(P)&&(m=0)}}return s}function cp(e,t,n,r,o,s,a,i,c,u,l,d){for(var f=o-1,h=0===o?s:[""],p=_h(h),m=0,g=0,b=0;m<r;++m)for(var y=0,w=Rh(e,f+1,f=Ih(g=a[m])),v=e;y<p;++y)(v=Th(g>0?h[y]+" "+w:Bh(w,/&\f/g,h[y])))&&(c[b++]=v);return Vh(e,t,n,0===o?Ph:i,c,u,l,d)}function up(e,t,n,r){return Vh(e,t,n,Eh,Nh(Gh),Rh(e,2,-2),0,r)}function lp(e,t,n,r,o){return Vh(e,t,n,kh,Rh(e,0,r),Rh(e,r+1,-1),r,o)}function dp(e,t,n){switch(function(e,t){return 45^Oh(e,0)?(((t<<2^Oh(e,0))<<2^Oh(e,1))<<2^Oh(e,2))<<2^Oh(e,3):0}(e,t)){case 5103:return xh+"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 xh+e+e;case 4789:return vh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return xh+e+vh+e+wh+e+e;case 5936:switch(Oh(e,t+11)){case 114:return xh+e+wh+Bh(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return xh+e+wh+Bh(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return xh+e+wh+Bh(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return xh+e+wh+e+e;case 6165:return xh+e+wh+"flex-"+e+e;case 5187:return xh+e+Bh(e,/(\w+).+(:[^]+)/,xh+"box-$1$2"+wh+"flex-$1$2")+e;case 5443:return xh+e+wh+"flex-item-"+Bh(e,/flex-|-self/g,"")+($h(e,/flex-|baseline/)?"":wh+"grid-row-"+Bh(e,/flex-|-self/g,""))+e;case 4675:return xh+e+wh+"flex-line-pack"+Bh(e,/align-content|flex-|-self/g,"")+e;case 5548:return xh+e+wh+Bh(e,"shrink","negative")+e;case 5292:return xh+e+wh+Bh(e,"basis","preferred-size")+e;case 6060:return xh+"box-"+Bh(e,"-grow","")+xh+e+wh+Bh(e,"grow","positive")+e;case 4554:return xh+Bh(e,/([^-])(transform)/g,"$1"+xh+"$2")+e;case 6187:return Bh(Bh(Bh(e,/(zoom-|grab)/,xh+"$1"),/(image-set)/,xh+"$1"),e,"")+e;case 5495:case 3959:return Bh(e,/(image-set\([^]*)/,xh+"$1$`$1");case 4968:return Bh(Bh(e,/(.+:)(flex-)?(.*)/,xh+"box-pack:$3"+wh+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+xh+e+e;case 4200:if(!$h(e,/flex-|baseline/))return wh+"grid-column-align"+Rh(e,t)+e;break;case 2592:case 3360:return wh+Bh(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,$h(e.props,/grid-\w+-end/)})?~Ch(e+(n=n[t].value),"span",0)?e:wh+Bh(e,"-start","")+e+wh+"grid-row-span:"+(~Ch(n,"span",0)?$h(n,/\d+/):+$h(n,/\d+/)-+$h(e,/\d+/))+";":wh+Bh(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return $h(e.props,/grid-\w+-start/)})?e:wh+Bh(Bh(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Bh(e,/(.+)-inline(.+)/,xh+"$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(zh(e)-1-t>6)switch(Oh(e,t+1)){case 109:if(45!==Oh(e,t+4))break;case 102:return Bh(e,/(.+:)(.+)-([^]+)/,"$1"+xh+"$2-$3$1"+vh+(108==Oh(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ch(e,"stretch",0)?dp(Bh(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Bh(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,s,a,i){return wh+n+":"+r+i+(o?wh+n+"-span:"+(s?a:+a-+r)+i:"")+e});case 4949:if(121===Oh(e,t+6))return Bh(e,":",":"+xh)+e;break;case 6444:switch(Oh(e,45===Oh(e,14)?18:11)){case 120:return Bh(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+xh+(45===Oh(e,14)?"inline-":"")+"box$3$1"+xh+"$2$3$1"+wh+"$2box$3")+e;case 100:return Bh(e,":",":"+wh)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Bh(e,"scroll-","scroll-snap-")+e}return e}function fp(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function hp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case kh:return e.return=e.return||e.value;case Eh:return"";case Ah:return e.return=e.value+"{"+fp(e.children,r)+"}";case Ph:if(!zh(e.value=e.props.join(",")))return""}return zh(n=fp(e.children,r))?e.return=e.value+"{"+n+"}":""}function pp(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case kh:return void(e.return=dp(e.value,e.length,n));case Ah:return fp([Wh(e,{value:Bh(e.value,"@","@"+xh)})],r);case Ph:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch($h(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Hh(Wh(e,{props:[Bh(t,/:(read-\w+)/,":-moz-$1")]})),Hh(Wh(e,{props:[t]})),Sh(e,{props:Fh(n,r)});break;case"::placeholder":Hh(Wh(e,{props:[Bh(t,/:(plac\w+)/,":"+xh+"input-$1")]})),Hh(Wh(e,{props:[Bh(t,/:(plac\w+)/,":-moz-$1")]})),Hh(Wh(e,{props:[Bh(t,/:(plac\w+)/,wh+"input-$1")]})),Hh(Wh(e,{props:[t]})),Sh(e,{props:Fh(n,r)})}return""})}}var mp={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},gp="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",bp="active",yp="data-styled-version",wp="6.1.19",vp="/*!sc*/\n",xp="undefined"!=typeof window&&"undefined"!=typeof document,Ep=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),Pp=/invalid hook call/i,kp=new Set,Ap=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];Pp.test(e)?(a=!1,kp.delete(r)):s.apply(void 0,mh([e],t,!1))},o.useRef(),a&&!kp.has(r)&&(console.warn(r),kp.add(r))}catch(e){Pp.test(e.message)&&kp.delete(r)}finally{console.error=s}}},Ip=Object.freeze([]),Np=Object.freeze({});var Sp=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"]),Tp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,$p=/(^-|-$)/g;function Bp(e){return e.replace(Tp,"-").replace($p,"")}var Cp=/(a)(d)/gi,Op=function(e){return String.fromCharCode(e+(e>25?39:97))};function Rp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Op(t%52)+n;return(Op(t%52)+n).replace(Cp,"$1-$2")}var zp,_p=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Mp=function(e){return _p(5381,e)};function Fp(e){return Rp(Mp(e)>>>0)}function jp(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Lp(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Up="function"==typeof Symbol&&Symbol.for,Dp=Up?Symbol.for("react.memo"):60115,Gp=Up?Symbol.for("react.forward_ref"):60112,qp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Vp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Wp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Hp=((zp={})[Gp]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zp[Dp]=Wp,zp);function Yp(e){return("type"in(t=e)&&t.type.$$typeof)===Dp?Wp:"$$typeof"in e?Hp[e.$$typeof]:qp;var t}var Zp=Object.defineProperty,Kp=Object.getOwnPropertyNames,Jp=Object.getOwnPropertySymbols,Qp=Object.getOwnPropertyDescriptor,Xp=Object.getPrototypeOf,em=Object.prototype;function tm(e,t,n){if("string"!=typeof t){if(em){var r=Xp(t);r&&r!==em&&tm(e,r,n)}var o=Kp(t);Jp&&(o=o.concat(Jp(t)));for(var s=Yp(e),a=Yp(t),i=0;i<o.length;++i){var c=o[i];if(!(c in Vp||n&&n[c]||a&&c in a||s&&c in s)){var u=Qp(t,c);try{Zp(e,c,u)}catch(e){}}}}return e}function nm(e){return"function"==typeof e}function rm(e){return"object"==typeof e&&"styledComponentId"in e}function om(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function sm(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function am(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function im(e,t,n){if(void 0===n&&(n=!1),!n&&!am(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=im(e[r],t[r]);else if(am(t))for(var r in t)e[r]=im(e[r],t[r]);return e}function cm(e,t){Object.defineProperty(e,"toString",{value:t})}var um="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 lm(){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 dm(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(lm.apply(void 0,mh([um[e]],t,!1)).trim())}var fm=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 dm(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(vp);return t},e}(),hm=1<<30,pm=new Map,mm=new Map,gm=1,bm=function(e){if(pm.has(e))return pm.get(e);for(;mm.has(gm);)gm++;var t=gm++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>hm))throw dm(16,"".concat(t));return pm.set(e,t),mm.set(t,e),t},ym=function(e,t){gm=t+1,pm.set(e,t),mm.set(t,e)},wm="style[".concat(gp,"][").concat(yp,'="').concat(wp,'"]'),vm=new RegExp("^".concat(gp,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),xm=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)},Em=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(vp),o=[],s=0,a=r.length;s<a;s++){var i=r[s].trim();if(i){var c=i.match(vm);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(ym(l,u),xm(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(i)}}},Pm=function(e){for(var t=document.querySelectorAll(wm),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(gp)!==bp&&(Em(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var km=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(gp,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(gp,bp),r.setAttribute(yp,wp);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,s),r},Am=function(){function e(e){this.element=km(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 dm(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}(),Im=function(){function e(e){this.element=km(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}(),Nm=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}(),Sm=xp,Tm={isServer:!xp,useCSSOMInjection:!Ep},$m=function(){function e(e,t,n){void 0===e&&(e=Np),void 0===t&&(t={});var r=this;this.options=ph(ph({},Tm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&xp&&Sm&&(Sm=!1,Pm(this)),cm(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return mm.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(gp,".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(vp)},s=0;s<n;s++)o(s);return r}(r)})}return e.registerId=function(e){return bm(e)},e.prototype.rehydrate=function(){!this.server&&xp&&Pm(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(ph(ph({},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 Nm(n):t?new Am(n):new Im(n)}(this.options),new fm(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(bm(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(bm(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(bm(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Bm=/&/g,Cm=/^\s*\/\/.*$/gm;function Om(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=Om(e.children,t)),e})}var Rm=new $m,zm=function(){var e,t,n,r=Np,o=r.options,s=void 0===o?Np:o,a=r.plugins,i=void 0===a?Ip: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===Ph&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Bm,t).replace(n,c))}),s.prefix&&u.push(pp),u.push(hp);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(Cm,""),l=ap(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);s.namespace&&(l=Om(l,s.namespace));var d,f=[];return fp(l,function(e){var t=_h(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||dm(15),_p(e,t.name)},5381).toString():"",l}(),_m=p.default.createContext({shouldForwardProp:void 0,styleSheet:Rm,stylis:zm});function Mm(){return o.useContext(_m)}_m.Consumer,p.default.createContext(void 0);var Fm=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=zm);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,cm(this,function(){throw dm(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=zm),this.name+e.hash},e}(),jm=function(e){return e>="A"&&e<="Z"};function Lm(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;jm(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Um=function(e){return null==e||!1===e||""===e},Dm=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!Um(s)&&(Array.isArray(s)&&s.isCss||nm(s)?r.push("".concat(Lm(o),":"),s,";"):am(s)?r.push.apply(r,mh(mh(["".concat(o," {")],Dm(s),!1),["}"],!1)):r.push("".concat(Lm(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in mp||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Gm(e,t,n,r){if(Um(e))return[];if(rm(e))return[".".concat(e.styledComponentId)];if(nm(e)){if(!nm(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 Fm||am(o)||null===o||console.error("".concat(jp(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.")),Gm(o,t,n,r)}var s;return e instanceof Fm?n?(e.inject(n,r),[e.getName(r)]):[e]:am(e)?Dm(e):Array.isArray(e)?Array.prototype.concat.apply(Ip,e.map(function(e){return Gm(e,t,n,r)})):[e.toString()]}var qm=Mp(wp),Vm=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(nm(n)&&!rm(n))return!1}return!0}(e),this.componentId=t,this.baseHash=_p(qm,t),this.baseStyle=n,$m.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=om(r,this.staticRulesId);else{var o=sm(Gm(this.rules,e,t,n)),s=Rp(_p(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=om(r,s),this.staticRulesId=s}else{for(var i=_p(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=_p(i,l));else if(l){var d=sm(Gm(l,e,t,n));i=_p(i,d+u),c+=d}}if(c){var f=Rp(i>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,n(c,".".concat(f),void 0,this.componentId)),r=om(r,f)}}return r},e}(),Wm=p.default.createContext(void 0);Wm.Consumer;var Hm={},Ym=new Set;function Zm(e,t,n){var r=rm(e),s=e,a=!Lp(e),i=t.attrs,c=void 0===i?Ip:i,u=t.componentId,l=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Bp(e);Hm[n]=(Hm[n]||0)+1;var r="".concat(n,"-").concat(Fp(wp+n+Hm[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Lp(e)?"styled.".concat(e):"Styled(".concat(jp(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(Bp(t.displayName),"-").concat(t.componentId):t.componentId||l,m=r&&s.attrs?s.attrs.concat(c).filter(Boolean):c,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var b=s.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;g=function(e,t){return b(e,t)&&y(e,t)}}else g=b}var w=new Vm(n,h,r?s.componentStyle:void 0);function v(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=p.default.useContext(Wm),d=Mm(),f=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue(c);var h=function(e,t,n){return void 0===n&&(n=Np),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,a)||Np,m=function(e,t,n){for(var r,o=ph(ph({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=nm(r=e[s])?r(o):r;for(var i in a)o[i]="className"===i?om(o[i],a[i]):"style"===i?ph(ph({},o[i]),a[i]):a[i]}return t.className&&(o.className=om(o.className,t.className)),o}(r,t,h),g=m.as||u,b={};for(var y in m)void 0===m[y]||"$"===y[0]||"as"===y||"theme"===y&&m.theme===h||("forwardedAs"===y?b.as=m.forwardedAs:f&&!f(y,g)||(b[y]=m[y],f||"development"!==process.env.NODE_ENV||yh(y)||Ym.has(y)||!Sp.has(g)||(Ym.add(y),console.warn('styled-components: it looks like an unknown prop "'.concat(y,'" 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 w=function(e,t){var n=Mm(),r=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&o.useDebugValue(r),r}(s,m);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(w);var v=om(i,c);return w&&(v+=" "+w),m.className&&(v+=" "+m.className),b[Lp(g)&&!Sp.has(g)?"class":"className"]=v,n&&(b.ref=n),o.createElement(g,b)}(x,e,t)}v.displayName=f;var x=p.default.forwardRef(v);return x.attrs=m,x.componentStyle=w,x.displayName=f,x.shouldForwardProp=g,x.foldedComponentIds=r?om(s.foldedComponentIds,s.styledComponentId):"",x.styledComponentId=h,x.target=r?s.target:e,Object.defineProperty(x,"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++)im(e,o[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(Ap(f,h),x.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)),cm(x,function(){return".".concat(x.styledComponentId)}),a&&tm(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Km(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 Jm=function(e){return Object.assign(e,{isCss:!0})};function Qm(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(nm(e)||am(e))return Jm(Gm(Km(Ip,mh([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Gm(r):Jm(Gm(Km(r,t)))}function Xm(e,t,n){if(void 0===n&&(n=Np),!t)throw dm(1,t);var r=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,Qm.apply(void 0,mh([r],o,!1)))};return r.attrs=function(r){return Xm(e,t,ph(ph({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Xm(e,t,ph(ph({},n),r))},r}var eg=function(e){return Xm(Zm,e)},tg=eg;Sp.forEach(function(e){tg[e]=eg(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 ng="__sc-".concat(gp,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[ng]||(window[ng]=0),1===window[ng]&&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[ng]+=1);const rg={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"}},og=(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=sm(Qm.apply(void 0,mh([e],t,!1))),o=Fp(r);return new Fm(o,r)})`
12
+ const jl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ll=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ul=BigInt(0),Dl=BigInt(1),Gl=BigInt(2),ql=(e,t)=>(e+t/Gl)/t;const Vl=pl(jl,void 0,void 0,{sqrt:function(e){const t=jl,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=sl(l,n,t)*l%t,f=sl(d,n,t)*l%t,h=sl(f,Gl,t)*u%t,p=sl(h,o,t)*h%t,m=sl(p,s,t)*p%t,g=sl(m,i,t)*m%t,b=sl(g,c,t)*g%t,y=sl(b,i,t)*m%t,w=sl(y,n,t)*l%t,v=sl(w,a,t)*p%t,x=sl(v,r,t)*u%t,E=sl(x,Gl,t);if(!Vl.eql(Vl.sqr(E),e))throw new Error("Cannot find square root");return E}}),Wl=function(e,t){const n=t=>Ml({...e,...Fl(t)});return{...n(t),create:n}}({a:Ul,b:BigInt(7),Fp:Vl,n:Ll,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ll,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Dl*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,a=BigInt("0x100000000000000000000000000000000"),i=ql(s*e,t),c=ql(-r*e,t);let u=ol(e-i*n-c*o,t),l=ol(-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}}}},Es);var Hl=Object.freeze({__proto__:null,secp256k1:Wl});function Yl(e,t={}){const{recovered:n}=t;if(void 0===e.r)throw new Xl({signature:e});if(void 0===e.s)throw new Xl({signature:e});if(n&&void 0===e.yParity)throw new Xl({signature:e});if(e.r<0n||e.r>Iu)throw new ed({value:e.r});if(e.s<0n||e.s>Iu)throw new td({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new nd({value:e.yParity})}function Zl(e){if(130!==e.length&&132!==e.length)throw new Ql({signature:e});const t=BigInt(ui(e,0,32)),n=BigInt(ui(e,32,64)),r=(()=>{const t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return Jl(t)}catch{throw new nd({value:t})}})();return void 0===r?{r:t,s:n}:{r:t,s:n,yParity:r}}function Kl(e){if(void 0!==e.r&&void 0!==e.s)return function(e){const t="string"==typeof e?Zl(e):e instanceof Uint8Array?function(e){return Zl(oi(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=Jl(t)),"number"!=typeof n)throw new nd({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:Jl(e.v)}}(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return Yl(t),t}(e)}function Jl(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 rd({value:e})}class Ql extends Aa{constructor({signature:e}){var t;super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${li((t=e,t instanceof Uint8Array?oi(t):Array.isArray(t)?oi(new Uint8Array(t)):t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Xl extends Aa{constructor({signature:e}){super(`Signature \`${Fa(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class ed extends Aa{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 td extends Aa{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 nd extends Aa{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 rd extends Aa{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 od(e,t={}){return"string"==typeof e.chainId?function(e){const{address:t,chainId:n,nonce:r}=e,o=Kl(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}(e):{...e,...t.signature}}const sd=Uu("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function ad(e){if("string"==typeof e){if("0x8010801080108010801080108010801080108010801080108010801080108010"!==ui(e,-32))throw new id(e)}else Yl(e.authorization)}let id=class extends Aa{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 cd(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",a=void 0!==n?zt(n):void 0;return function(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?$t(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 ud(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){const a=r||"latest",i=void 0!==n?zt(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,zt(s)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[i||a,zt(s)]},{dedupe:Boolean(i)}),!c)throw new Mr({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||as)(c)}async function ld(e,{hash:t}){const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new Fr({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||cc)(n)}async function dd(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?xi(e.blockOverrides):void 0,r=e.calls.map(e=>{const t=e,n=t.account?or(t.account):void 0,r=t.abi?ar(t):t.data,o={...t,data:t.dataSuffix?Mn([r||"0x",t.dataSuffix]):r,from:t.from??n?.address};return es(o),Zo(o)}),o=e.stateOverrides?Qo(e.stateOverrides):void 0;t.push({blockOverrides:n,calls:r,stateOverrides:o})}const c=("bigint"==typeof n?zt(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:t,returnFullTransactions:s,traceTransfers:a,validation:i},c]})).map((e,t)=>({...is(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=>Us(e)),d="0x1"===e.status?"success":"failure",f=r&&"success"===d&&"0x"!==c?Vs({abi:r,data:c,functionName:a}):null,h=(()=>{if("success"===d)return;let t;return"0x"===e.error?.data?t=new Ke:e.error&&(t=new Vr(e.error)),t?Ao(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=Wo(t,{});if(n instanceof Vo)throw t;throw n}}function fd(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 Aa("Unable to normalize signature.");return o}function hd(e,t){const n=typeof e,r=t.type;switch(r){case"address":return wu(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)=>hd(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=>hd(e,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})))}}function pd(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 pd(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")))&&wu(n[r],{strict:!1}))())return a}}function md(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||"string"==typeof e?ze(e):e;return{...r,...n?{hash:yd(r)}:{}}}function gd(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=hi(t,{strict:!1}),a=e.filter(e=>s?"function"===e.type||"error"===e.type?bd(e)===ui(t,0,4):"event"===e.type&&yd(e)===t:"name"in e&&e.name===t);if(0===a.length)throw new vd({name:t});if(1===a.length)return{...a[0],...o?{hash:yd(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:yd(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&&hd(t,r)});if(t){if(i&&"inputs"in i&&i.inputs){const t=pd(e.inputs,i.inputs,r);if(t)throw new wd({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 vd({name:t});return{...c,...o?{hash:yd(c)}:{}}}function bd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return gd(t,n)}return e[0]})();return ui(yd(t),0,4)}function yd(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return gd(t,n)}return e[0]})();return"string"!=typeof t&&"hash"in t&&t.hash?t.hash:mu(ai(function(...e){const t=(()=>{if(Array.isArray(e[0])){const[t,n]=e;return gd(t,n)}return e[0]})();return fd("string"==typeof t?t:Z(t))}(t)))}class wd extends Aa{constructor(e,t){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${fd(Z(e.abiItem))}\`, and`,`\`${t.type}\` in \`${fd(Z(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 vd extends Aa{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 xd(e){const t=e.find(e=>"constructor"===e.type);if(!t)throw new vd({name:"constructor"});return t}function Ed(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[t,n,r]=e;return[kd(t,n,{args:r}),r]}const[t,n]=e;return[t,n]})(),{overloads:r}=t,o=r?kd([t,...r],t.name,{args:n}):t,s=bd(o);const a=n.length>0?ju(o.inputs,n):void 0;return a?ni(s,a):s}function Pd(e,t={}){return md(e,t)}function kd(e,t,n){const r=gd(e,t,n);if("function"!==r.type)throw new vd({name:t,type:"function"});return r}const Ad="0x0000000000000000000000000000000000000000";async function Id(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:a,traceTransfers:i,validation:c}=t,u=t.account?or(t.account):void 0;if(a&&!u)throw new Ve("`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[xd(t),n]}return e})(),{bytecode:r,args:o}=n;return ni(r,t.inputs?.length&&o?.length?ju(t.inputs,o):"0x")}(md("constructor(bytes, bytes)"),{bytecode:Ci,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",Ed(Pd("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 Mc(e,{account:u.address,...t,data:t.abi?ar(t):t.data});return n.map(({address:e,storageKeys:t})=>t.length>0?e:null)})).then(e=>e.flat().filter(Boolean)):[],f=await dd(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:l}],stateOverrides:s},{calls:d.map((e,t)=>({abi:[Pd("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]}]:[],{calls:[...o,{}].map(e=>({...e,from:u?.address})),stateOverrides:s},...a?[{calls:[{data:l}]},{calls:d.map((e,t)=>({abi:[Pd("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:e,from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Pd("function decimals() returns (uint256)")],functionName:"decimals",from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Pd("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ad,nonce:t})),stateOverrides:[{address:Ad,nonce:0}]},{calls:d.map((e,t)=>({to:e,abi:[Pd("function symbol() returns (string)")],functionName:"symbol",from:Ad,nonce:t})),stateOverrides:[{address:Ad,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?Tt(e.data):null),A=[...g?.calls??[],...b?.calls??[]].map(e=>"success"===e.status?Tt(e.data):null),I=(y?.calls??[]).map(e=>"success"===e.status?e.result:null),N=(v?.calls??[]).map(e=>"success"===e.status?e.result:null),S=(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=N[e-1],s=S[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 Nd="0x6492649264926492649264926492649264926492649264926492649264926492";function Sd(e){try{return function(e){if(ui(e,-32)!==Nd)throw new Td(e)}(e),!0}catch{return!1}}class Td extends Aa{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 $d({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 Wl.Signature(Tt(e),Tt(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===n?a:Dt(a)}async function Bd(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 Le(e)?e:"object"==typeof e&&"r"in e&&"s"in e?$d(e):Rt(e)})();try{return function(e){try{return ad(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){ad(e);const t=fi(ui(e,-64,-32)),n=ui(e,-t-64,-64),r=ui(e,0,-t-64),[o,s,a]=Fu(sd,n);return{authorization:od({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 Lc(e,{address:n,blockNumber:r,blockTag:o});if(d===Fn(["0xef0100",i.address]))return await async function(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:a}=t,i=await Me(e,Hi,"readContract")({address:n,abi:Ti,args:[s,a],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof Ur)throw new Cd;throw e});if(i.startsWith("0x1626ba7e"))return!0;throw new Cd}(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:zt(i.r,{size:32}),s:zt(i.s,{size:32}),yParity:i.yParity},h=await async function({address:e,authorization:t,signature:n}){return _s(On(e),await Co({authorization:t,signature:n}))}({address:n,authorization:f});if(!h)throw new Cd;const p=await Me(e,Hi,"readContract")({...a?{address:a}:{code:zi},authorizationList:[f],abi:Ei,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:l??n,callData:c}]:[],{allowFailure:!0,target:n,callData:ar({abi:Ti,functionName:"isValidSignature",args:[s,u]})}]]}),m=p[p.length-1]?.returnData;if(m?.startsWith("0x1626ba7e"))return!0;throw new Cd}(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?Sd(a)?a:function(e){const{data:t,signature:n,to:r}=e;return ni(ju(Uu("address, bytes, bytes"),[r,t,n]),Nd)}({data:o,signature:a,to:r}):a)(),l=i?{to:i,data:ar({abi:$i,functionName:"isValidSig",args:[n,s,u]}),...c}:{data:ji({abi:$i,args:[n,s,u],bytecode:Ri}),...c},{data:d}=await Me(e,Vi,"call")(l).catch(e=>{if(e instanceof Lr)throw new Cd;throw e});if(function(e,t={}){let n=e;if(t.size&&(St(n,{size:t.size}),n=Nt(n)),"0x00"===Nt(n))return!1;if("0x01"===Nt(n))return!0;throw new At(n)}(d??"0x0"))return!0;throw new Cd}(e,{...t,verifierAddress:o,signature:a})}catch(e){try{if(_s(On(n),await No({hash:r,signature:a})))return!0}catch{}if(e instanceof Cd)return!1;throw e}}class Cd extends Error{}function Od(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))?Ji(kr(["watchBlockNumber",e.uid,t,n,a]),{onBlockNumber:r,onError:o},r=>Xi(async()=>{try{const t=await Me(e,rc,"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})):Ji(kr(["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=Tt(e.result?.number);t.onBlockNumber(r,i),i=r},onError(e){t.onError?.(e)}});r=s,n||r()}catch(e){o?.(e)}})(),()=>r()})}const Rd=/^(?:(?<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)?/,zd=/(?: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 _d(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(Rd)?.groups??{},{chainId:o,expirationTime:s,issuedAt:a,notBefore:i,requestId:c,...u}=e.match(zd)?.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(!_n(r.address,{strict:!1}))return!1;if(t&&!_s(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=tu(o);return Bd(e,{address:l.address,hash:f,signature:i,...u})}function Md(e){return{call:t=>Vi(e,t),createAccessList:t=>Mc(e,t),createBlockFilter:()=>async function(e){const t=nr(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}(e),createContractEventFilter:t=>rr(e,t),createEventFilter:t=>Fc(e,t),createPendingTransactionFilter:()=>jc(e),estimateContractGas:t=>async function(e,t){const{abi:n,address:r,args:o,functionName:s,dataSuffix:a,...i}=t,c=ar({abi:n,args:o,functionName:s});try{return await Me(e,zs,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:r,...i})}catch(e){const t=i.account?or(i.account):void 0;throw Ao(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:t?.address})}}(e,t),estimateGas:t=>zs(e,t),getBalance:t=>async function(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){const o="bigint"==typeof n?zt(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=>cs(e,t),getBlockNumber:t=>rc(e,t),getBlockTransactionCount:t=>async function(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=void 0!==n?zt(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)}),$t(s)}(e,t),getBytecode:t=>Lc(e,t),getChainId:()=>Bs(e),getCode:t=>Lc(e,t),getContractEvents:t=>Gs(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 Me(e,Hi,"readContract")({abi:Dc,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 Uc({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 Li({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),l=c?.ensTlds;if(l&&!l.some(e=>s.endsWith(e)))return null;const d=null!=o?[wc(s),BigInt(o)]:[wc(s)];try{const t=ar({abi:Si,functionName:"addr",args:d}),o={address:u,abi:Ai,functionName:"resolveWithGateways",args:[Ct(Ec(s)),t,a??[gc]],blockNumber:n,blockTag:r},i=Me(e,Hi,"readContract"),c=await i(o);if("0x"===c[0])return null;const l=Vs({abi:Si,args:d,functionName:"addr",data:c[0]});return"0x"===l||"0x00"===Nt(l)?null:l}catch(e){if(i)throw e;if(fc(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 Me(e,_c,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:i,gatewayUrls:s,strict:a});if(!c)return null;try{return await zc(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 Li({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})();try{const t={address:u,abi:Ii,args:[n,s,a??[gc]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},i=Me(e,Hi,"readContract"),[c]=await i(t);return c||null}catch(e){if(i)throw e;if(fc(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 Li({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 Me(e,Hi,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ct(Ec(o))],blockNumber:n,blockTag:r});return c}(e,t),getEnsText:t=>_c(e,t),getFeeHistory:t=>Gc(e,t),estimateFeesPerGas:t=>async function(e,t){return ds(e,t)}(e,t),getFilterChanges:e=>oc(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=>Us(e));return t.abi?Ls({abi:t.abi,logs:r,strict:n}):r}(0,e),getGasPrice:()=>us(e),getLogs:t=>Ds(e,t),getProof:t=>cd(e,t),estimateMaxPriorityFeePerGas:t=>async function(e,t){return ls(e,t)}(e,t),getStorageAt:t=>async function(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=void 0!==n?zt(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}(e,t),getTransaction:t=>ud(e,t),getTransactionConfirmations:t=>async function(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([Me(e,rc,"getBlockNumber")({}),t?Me(e,ud,"getTransaction")({hash:t}):void 0]),s=n?.blockNumber||o?.blockNumber;return s?r-s+1n:0n}(e,t),getTransactionCount:t=>fs(e,t),getTransactionReceipt:t=>ld(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 Li({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=ar({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=Ao(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=>Me(e,Hi,"readContract")({...null===f?{code:zi}:{address:f},abi:Ei,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 Ke;if(!s)throw new Vr({data:r});const e=Vs({abi:i,args:d,data:r,functionName:l});b.push(o?{result:e,status:"success"}:e)}catch(e){const t=Ao(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 Ve("multicall results mismatch");return b}(e,t),prepareTransactionRequest:t=>Rs(e,t),readContract:t=>Hi(e,t),sendRawTransaction:t=>async function(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}(e,t),simulate:t=>dd(e,t),simulateBlocks:t=>dd(e,t),simulateCalls:t=>Id(e,t),simulateContract:t=>async function(e,t){const{abi:n,address:r,args:o,dataSuffix:s,functionName:a,...i}=t,c=i.account?or(i.account):e.account,u=ar({abi:n,args:o,functionName:a});try{const{data:l}=await Me(e,Vi,"call")({batch:!1,data:`${u}${s?s.replace("0x",""):""}`,to:r,...i,account:c});return{result:Vs({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 Ao(e,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:a,sender:c?.address})}}(e,t),verifyHash:t=>Bd(e,t),verifyMessage:t=>async function(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...a}){return Bd(e,{address:t,factory:r,factoryData:o,hash:tu(n),signature:s,...a})}(e,t),verifySiweMessage:t=>_d(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 Bd(e,{address:n,factory:r,factoryData:o,hash:iu({message:a,primaryType:i,types:c,domain:u}),signature:s,...l})}(e,t),uninstallFilter:e=>sc(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=kr(["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}=Di(),v=c?setTimeout(()=>{m?.(),p?.(),w(new jr({hash:o}))},c):void 0;return p=Ji(u,{onReplaced:s,resolve:y,reject:w},async t=>{if(h=await Me(e,ld,"getTransactionReceipt")({hash:o}).catch(()=>{}),h&&r<=1)return clearTimeout(v),t.resolve(h),void p?.();m=Me(e,Od,"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 ac(async()=>{d=await Me(e,ud,"getTransaction")({hash:o}),d.blockNumber&&(u=d.blockNumber)},{delay:i,retryCount:a}),g=!1),h=await Me(e,ld,"getTransactionReceipt")({hash:o}),r>1&&(!h.blockNumber||u-h.blockNumber+1n<r))return;c(()=>t.resolve(h))}catch(n){if(n instanceof Mr||n instanceof Fr){if(!d)return void(g=!1);try{f=d,g=!0;const n=await ac(()=>Me(e,cs,"getBlock")({blockNumber:u,includeTransactions:!0}),{delay:i,retryCount:a,shouldRetry:({error:e})=>e instanceof os});g=!1;const o=n.transactions.find(({from:e,nonce:t})=>e===f.from&&t===f.nonce);if(!o)return;if(h=await Me(e,ld,"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?Ji(kr(["watchBlocks",e.uid,t,n,r,l,c]),{onBlock:o,onError:s},o=>Xi(async()=>{try{const r=await Me(e,cs,"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 Me(e,cs,"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&&Me(e,cs,"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 Me(e,cs,"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=>Od(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 Ji(kr(["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=Xi(async()=>{if(f)try{let i;if(l)i=await Me(e,oc,"getFilterChanges")({filter:l});else{const s=await Me(e,rc,"getBlockNumber")({});i=u&&u<s?await Me(e,Gs,"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 no&&(f=!1),c.onError?.(e)}else{try{l=await Me(e,rr,"createContractEventFilter")({abi:n,address:r,args:o,eventName:a,strict:t,fromBlock:i})}catch{}f=!0}},{emitOnBegin:!0,interval:d});return async()=>{l&&await Me(e,sc,"uninstallFilter")({filter:l}),h()}})})():(()=>{const t=f??!1,i=kr(["watchContractEvent",r,o,s,e.uid,a,d,t]);let l=!0,h=()=>l=!1;return Ji(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?er({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}=Fs({abi:n,data:r.data,topics:r.topics,strict:f}),s=Us(r,{args:o,eventName:e});t.onLogs([s])}catch(e){let n,o;if(e instanceof dt||e instanceof ft){if(f)return;n=e.abiItem.name,o=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const s=Us(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?Ji(kr(["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=Xi(async()=>{if(d)try{let a;if(u)a=await Me(e,oc,"getFilterChanges")({filter:u});else{const r=await Me(e,rc,"getBlockNumber")({});a=c&&c!==r?await Me(e,Ds,"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 no&&(d=!1),i.onError?.(e)}else{try{u=await Me(e,Fc,"createEventFilter")({address:t,args:n,event:o,events:s,strict:h,fromBlock:a})}catch{}d=!0}},{emitOnBegin:!0,interval:l});return async()=>{u&&await Me(e,sc,"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=>er({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}=Fs({abi:l??[],data:t.data,topics:t.topics,strict:h}),r=Us(t,{args:n,eventName:e});c([r])}catch(e){let n,r;if(e instanceof dt||e instanceof ft){if(d)return;n=e.abiItem.name,r=e.abiItem.inputs?.some(e=>!("name"in e&&e.name))}const o=Us(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)?Ji(kr(["watchPendingTransactions",e.uid,t,s]),{onTransactions:r,onError:n},n=>{let r;const o=Xi(async()=>{try{if(!r)try{return void(r=await Me(e,jc,"createPendingTransactionFilter")({}))}catch(e){throw o(),e}const s=await Me(e,oc,"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 Me(e,sc,"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 Fd(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?or(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:dc(),...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(Md)}class jd extends Ve{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 Ld(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 jd;const v=eu(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:Vc(r,{methods:t,retryCount:o,retryDelay:s,uid:dc()}),value:c}}({key:s,methods:a,name:i,async request({method:e,params:t}){const r={method:e,params:t},{schedule:o}=qi({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 Hr({body:r,error:s,url:w});return a},retryCount:b,retryDelay:l,timeout:y,type:"http"},{fetchOptions:o,url:w})}}function Ud(e,t,n){for(let n in t){let r=t[n];Object.defineProperty(e,n,{enumerable:!0,value:r,writable:!1})}}function Dd(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=>Dd(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 Dd(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=>`${Dd(n,t)}: ${Dd(e[n],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Gd(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: ${Dd(n)}`);for(const e in n){if("shortMessage"===e)continue;const t=n[e];r.push(e+"="+Dd(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 Ud(r,{code:t}),n&&Object.assign(r,n),null==r.shortMessage&&Ud(r,{shortMessage:o}),r}(t,n,r)}function qd(e,t,n,r){Gd(e,t,"INVALID_ARGUMENT",{argument:n,value:r})}function Vd(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}qd(!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 Wd=BigInt(0),Hd=BigInt(1),Yd=9007199254740991;function Zd(e,t){const n=Qd(e,"value"),r=BigInt(ef(t,"width"));if(Gd(n>>r===Wd,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),n>>r-Hd){return-((~n&(Hd<<r)-Hd)+Hd)}return n}function Kd(e,t){const n=Qd(e,"value"),r=BigInt(ef(t,"bits"));return n&(Hd<<r)-Hd}function Jd(e,t){switch(typeof e){case"bigint":return e;case"number":return qd(Number.isInteger(e),"underflow",t||"value",e),qd(e>=-Yd&&e<=Yd,"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){qd(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}qd(!1,"invalid BigNumberish value",t||"value",e)}function Qd(e,t){const n=Jd(e,t);return Gd(n>=Wd,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}const Xd="0123456789abcdef";function ef(e,t){switch(typeof e){case"bigint":return qd(e>=-Yd&&e<=Yd,"overflow",t||"value",e),Number(e);case"number":return qd(Number.isInteger(e),"underflow",t||"value",e),qd(e>=-Yd&&e<=Yd,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return ef(BigInt(e),t)}catch(n){qd(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}qd(!1,"invalid numeric value",t||"value",e)}const tf=BigInt(-1),nf=BigInt(0),rf=BigInt(1),of=BigInt(5),sf={};let af="0000";for(;af.length<80;)af+=af;function cf(e){let t=af;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function uf(e,t,n){const r=BigInt(t.width);if(t.signed){const t=rf<<r-rf;Gd(null==n||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=e>nf?Zd(Kd(e,r),r):-Zd(Kd(-e,r),r)}else{const t=rf<<r;Gd(null==n||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:n,fault:"overflow",value:e}),e=(e%t+t)%t&t-rf}return e}function lf(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]+)$/);qd(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:(qd(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)}qd(n%8==0,"invalid FixedNumber width (not byte aligned)","format.width",n),qd(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 df{format;#e;#t;#n;_value;constructor(e,t,n){!function(e,t,n){if(e!==t){let e=n,t="new";e+=".",t+=" "+n,Gd(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}(e,sf,"FixedNumber"),this.#t=t,this.#e=n;const r=function(e,t){let n="";e<nf&&(n="-",e*=tf);let r=e.toString();if(0===t)return n+r;for(;r.length<=t;)r=af+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);Ud(this,{format:n.name,_value:r}),this.#n=cf(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){qd(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#o(e,t){return e=uf(e,this.#e,t),new df(sf,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 Gd(t%this.#n===nf,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#o(t/this.#n,"mulSignal")}#c(e,t){return Gd(e.#t!==nf,"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){Gd(e.#t!==nf,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#r(e);const t=this.#t*this.#n;return Gd(t%e.#t===nf,"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*=cf(r):r<0&&(t*=cf(-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<nf&&(e-=this.#n-rf),e=this.#t/this.#n*this.#n,this.#o(e,"floor")}ceiling(){let e=this.#t;return this.#t>nf&&(e+=this.#n-rf),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=of*cf(t-1);let r=this.value+n;const o=cf(t);return r=r/o*o,uf(r,this.#e,"round"),new df(sf,r,this.#e)}isZero(){return this.#t===nf}isNegative(){return this.#t<nf}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return df.fromString(this.toString(),e)}static fromValue(e,t,n){const r=null==t?0:ef(t),o=lf(n);let s=Jd(e,"value");const a=r-o.decimals;if(a>0){const t=cf(a);Gd(s%t===nf,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=cf(-a));return uf(s,o,"fromValue"),new df(sf,s,o)}static fromString(e,t){const n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);qd(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);const r=lf(t);let o=n[2]||"0",s=n[3]||"";for(;s.length<r.decimals;)s+=af;Gd(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 uf(a,r,"fromString"),new df(sf,a,r)}static fromBytes(e,t){let n=function(e){if(e instanceof Uint8Array){let t="0x0";for(const n of e)t+=Xd[n>>4],t+=Xd[15&n];return BigInt(t)}return Jd(e)}(Vd(e,"value"));const r=lf(t);return r.signed&&(n=Zd(n,r.width)),uf(n,r,"fromBytes"),new df(sf,n,r)}}function ff(e){return function(e,t){let n=18;return n=ef(t,"unit"),df.fromValue(e,n,{decimals:n,width:512}).toString()}(e,18)}const hf="0.38.13";function pf({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@${hf}:${t}`):r.searchParams.append("sdkVersion",`onchainkit@${hf}`),r.searchParams.sort(),r.toString()}var mf=[],gf=[],bf="undefined"!=typeof Uint8Array?Uint8Array:Array,yf=!1;function wf(){yf=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)mf[t]=e[t],gf[e.charCodeAt(t)]=t;gf["-".charCodeAt(0)]=62,gf["_".charCodeAt(0)]=63}function vf(e){return mf[e>>18&63]+mf[e>>12&63]+mf[e>>6&63]+mf[63&e]}function xf(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(vf(r));return o.join("")}function Ef(e){var t;yf||wf();for(var n=e.length,r=n%3,o="",s=[],a=16383,i=0,c=n-r;i<c;i+=a)s.push(xf(e,i,i+a>c?c:i+a));return 1===r?(t=e[n-1],o+=mf[t>>2],o+=mf[t<<4&63],o+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],o+=mf[t>>10],o+=mf[t>>4&63],o+=mf[t<<2&63],o+="="),s.push(o),s.join("")}function Pf(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 kf(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 Af={}.toString,If=Array.isArray||function(e){return"[object Array]"==Af.call(e)};function Nf(){return Tf.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Sf(e,t){if(Nf()<t)throw new RangeError("Invalid typed array length");return Tf.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Tf.prototype:(null===e&&(e=new Tf(t)),e.length=t),e}function Tf(e,t,n){if(!(Tf.TYPED_ARRAY_SUPPORT||this instanceof Tf))return new Tf(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 Cf(this,e)}return $f(this,e,t,n)}function $f(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);Tf.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Tf.prototype:e=Of(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!Tf.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|_f(t,n);e=Sf(e,r);var o=e.write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(zf(t)){var n=0|Rf(t.length);return 0===(e=Sf(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?Sf(e,0):Of(e,t);if("Buffer"===t.type&&If(t.data))return Of(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Bf(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 Cf(e,t){if(Bf(t),e=Sf(e,t<0?0:0|Rf(t)),!Tf.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Of(e,t){var n=t.length<0?0:0|Rf(t.length);e=Sf(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Rf(e){if(e>=Nf())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Nf().toString(16)+" bytes");return 0|e}function zf(e){return!(null==e||!e._isBuffer)}function _f(e,t){if(zf(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 uh(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return lh(e).length;default:if(r)return uh(e).length;t=(""+t).toLowerCase(),r=!0}}function Mf(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 Qf(this,t,n);case"utf8":case"utf-8":return Yf(this,t,n);case"ascii":return Kf(this,t,n);case"latin1":case"binary":return Jf(this,t,n);case"base64":return Hf(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xf(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Ff(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function jf(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=Tf.from(t,r)),zf(t))return 0===t.length?-1:Lf(e,t,n,r,o);if("number"==typeof t)return t&=255,Tf.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Lf(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Lf(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 Uf(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 Df(e,t,n,r){return dh(uh(t,e.length-n),e,n,r)}function Gf(e,t,n,r){return dh(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function qf(e,t,n,r){return Gf(e,t,n,r)}function Vf(e,t,n,r){return dh(lh(t),e,n,r)}function Wf(e,t,n,r){return dh(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 Hf(e,t,n){return 0===t&&n===e.length?Ef(e):Ef(e.slice(t,n))}function Yf(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<=Zf)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Zf));return n}(r)}Tf.TYPED_ARRAY_SUPPORT=void 0===globalThis.TYPED_ARRAY_SUPPORT||globalThis.TYPED_ARRAY_SUPPORT,Nf(),Tf.poolSize=8192,Tf._augment=function(e){return e.__proto__=Tf.prototype,e},Tf.from=function(e,t,n){return $f(null,e,t,n)},Tf.TYPED_ARRAY_SUPPORT&&(Tf.prototype.__proto__=Uint8Array.prototype,Tf.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Tf[Symbol.species]),Tf.alloc=function(e,t,n){return function(e,t,n,r){return Bf(t),t<=0?Sf(e,t):void 0!==n?"string"==typeof r?Sf(e,t).fill(n,r):Sf(e,t).fill(n):Sf(e,t)}(null,e,t,n)},Tf.allocUnsafe=function(e){return Cf(null,e)},Tf.allocUnsafeSlow=function(e){return Cf(null,e)},Tf.isBuffer=function(e){return null!=e&&(!!e._isBuffer||fh(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&fh(e.slice(0,0))}(e))},Tf.compare=function(e,t){if(!zf(e)||!zf(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},Tf.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}},Tf.concat=function(e,t){if(!If(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Tf.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=Tf.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!zf(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},Tf.byteLength=_f,Tf.prototype._isBuffer=!0,Tf.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)Ff(this,t,t+1);return this},Tf.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)Ff(this,t,t+3),Ff(this,t+1,t+2);return this},Tf.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)Ff(this,t,t+7),Ff(this,t+1,t+6),Ff(this,t+2,t+5),Ff(this,t+3,t+4);return this},Tf.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Yf(this,0,e):Mf.apply(this,arguments)},Tf.prototype.equals=function(e){if(!zf(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Tf.compare(this,e)},Tf.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+">"},Tf.prototype.compare=function(e,t,n,r,o){if(!zf(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},Tf.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},Tf.prototype.indexOf=function(e,t,n){return jf(this,e,t,n,!0)},Tf.prototype.lastIndexOf=function(e,t,n){return jf(this,e,t,n,!1)},Tf.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 Uf(this,e,t,n);case"utf8":case"utf-8":return Df(this,e,t,n);case"ascii":return Gf(this,e,t,n);case"latin1":case"binary":return qf(this,e,t,n);case"base64":return Vf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wf(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},Tf.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Zf=4096;function Kf(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 Jf(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 Qf(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+=ch(e[s]);return o}function Xf(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 eh(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 th(e,t,n,r,o,s){if(!zf(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 nh(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 rh(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 oh(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 sh(e,t,n,r,o){return o||oh(e,0,n,4),kf(e,t,n,r,23,4),n+4}function ah(e,t,n,r,o){return o||oh(e,0,n,8),kf(e,t,n,r,52,8),n+8}Tf.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),Tf.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=Tf.prototype;else{var o=t-e;n=new Tf(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},Tf.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||eh(e,t,this.length);for(var r=this[e],o=1,s=0;++s<t&&(o*=256);)r+=this[e+s]*o;return r},Tf.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||eh(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},Tf.prototype.readUInt8=function(e,t){return t||eh(e,1,this.length),this[e]},Tf.prototype.readUInt16LE=function(e,t){return t||eh(e,2,this.length),this[e]|this[e+1]<<8},Tf.prototype.readUInt16BE=function(e,t){return t||eh(e,2,this.length),this[e]<<8|this[e+1]},Tf.prototype.readUInt32LE=function(e,t){return t||eh(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Tf.prototype.readUInt32BE=function(e,t){return t||eh(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Tf.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||eh(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},Tf.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||eh(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},Tf.prototype.readInt8=function(e,t){return t||eh(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Tf.prototype.readInt16LE=function(e,t){t||eh(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},Tf.prototype.readInt16BE=function(e,t){t||eh(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},Tf.prototype.readInt32LE=function(e,t){return t||eh(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Tf.prototype.readInt32BE=function(e,t){return t||eh(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Tf.prototype.readFloatLE=function(e,t){return t||eh(e,4,this.length),Pf(this,e,!0,23,4)},Tf.prototype.readFloatBE=function(e,t){return t||eh(e,4,this.length),Pf(this,e,!1,23,4)},Tf.prototype.readDoubleLE=function(e,t){return t||eh(e,8,this.length),Pf(this,e,!0,52,8)},Tf.prototype.readDoubleBE=function(e,t){return t||eh(e,8,this.length),Pf(this,e,!1,52,8)},Tf.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||th(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},Tf.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||th(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},Tf.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,1,255,0),Tf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Tf.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,65535,0),Tf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):nh(this,e,t,!0),t+2},Tf.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,65535,0),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):nh(this,e,t,!1),t+2},Tf.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,4294967295,0),Tf.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):rh(this,e,t,!0),t+4},Tf.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,4294967295,0),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):rh(this,e,t,!1),t+4},Tf.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);th(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},Tf.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);th(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},Tf.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,1,127,-128),Tf.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Tf.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,32767,-32768),Tf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):nh(this,e,t,!0),t+2},Tf.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,2,32767,-32768),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):nh(this,e,t,!1),t+2},Tf.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,2147483647,-2147483648),Tf.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):rh(this,e,t,!0),t+4},Tf.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||th(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Tf.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):rh(this,e,t,!1),t+4},Tf.prototype.writeFloatLE=function(e,t,n){return sh(this,e,t,!0,n)},Tf.prototype.writeFloatBE=function(e,t,n){return sh(this,e,t,!1,n)},Tf.prototype.writeDoubleLE=function(e,t,n){return ah(this,e,t,!0,n)},Tf.prototype.writeDoubleBE=function(e,t,n){return ah(this,e,t,!1,n)},Tf.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||!Tf.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},Tf.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&&!Tf.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=zf(e)?e:uh(new Tf(e,r).toString()),i=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%i]}return this};var ih=/[^+\/0-9A-Za-z-_]/g;function ch(e){return e<16?"0"+e.toString(16):e.toString(16)}function uh(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 lh(e){return function(e){var t,n,r,o,s,a;yf||wf();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 bf(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=gf[e.charCodeAt(t)]<<18|gf[e.charCodeAt(t+1)]<<12|gf[e.charCodeAt(t+2)]<<6|gf[e.charCodeAt(t+3)],a[c++]=o>>16&255,a[c++]=o>>8&255,a[c++]=255&o;return 2===s?(o=gf[e.charCodeAt(t)]<<2|gf[e.charCodeAt(t+1)]>>4,a[c++]=255&o):1===s&&(o=gf[e.charCodeAt(t)]<<10|gf[e.charCodeAt(t+1)]<<4|gf[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(ih,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function dh(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 fh(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}class hh{constructor(e){this.selectedWalletId=null,this.solanaConnection=null,this.ethereumProvider=null,this.walletInfo=null,this.phantomAdapter=null,this.walletType="embedded",this.ethereumNetwork=null,this.defaultNetwork=exports.Network.Solana,this.api=f.default.create({baseURL:e.baseURL,headers:{"Content-Type":"application/json"}}),this.middleAccountApi=f.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=Fd({transport:Ld(e.ethereumNetwork.rpcUrl)})),this.defaultNetwork=e.defaultNetwork||exports.Network.Solana}setWallet(e){this.walletInfo=e}setWalletType(e){this.walletType=e,v.saveWalletType(e)}getWallet(){return this.walletInfo}getPhantomAdapter(){return this.phantomAdapter}getWalletType(){return this.walletType}get wallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===this.defaultNetwork))||null}get address(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.address)||null}get network(){var e;return(null===(e=this.wallet)||void 0===e?void 0:e.network)||null}get ethereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Ethereum&&"Main"===e.wallet_set))||null}get ethereumAddress(){var e;return(null===(e=this.ethereumWallet)||void 0===e?void 0:e.address)||null}get solanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Main"===e.wallet_set))||null}get forwardSolanaWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Solana&&"Forward-0"===e.wallet_set))||null}get forwardSolanaAddress(){var e;return(null===(e=this.forwardSolanaWallet)||void 0===e?void 0:e.address)||null}get forwardEthereumWallet(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.wallets.find(e=>e.network===exports.Network.Ethereum&&"Forward-0"===e.wallet_set))||null}get forwardEthereumAddress(){var e;return(null===(e=this.forwardEthereumWallet)||void 0===e?void 0:e.address)||null}get solanaAddress(){var e;return(null===(e=this.solanaWallet)||void 0===e?void 0:e.address)||null}get id(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.id)||null}get social_links(){var e;return(null===(e=this.walletInfo)||void 0===e?void 0:e.social_links)||null}async reconnect(){try{if("phantom"===v.getWalletType())return await this.connectPhantom();{const e=await this.getSession();return this.setWallet(e),e}}catch(e){return null}}async connectPhantom(){try{if(this.phantomAdapter||(this.phantomAdapter=new L),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(),is_exported:!1,address:e,network:exports.Network.Solana,type:exports.WalletType.Phantom,wallets:[{id:e,address:e,network:exports.Network.Solana,wallet_type:exports.WalletType.Phantom,wallet_set:"Main"}],social_links:[],social_infos:[],account_info:{name:null}};return this.setWallet(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){if(!this.walletInfo)throw new Error("No wallet info");const t=await this.api.post("/account/update",{name:e},{withCredentials:!0});return this.walletInfo.account_info.name=e,t.data}async signSolanaTransaction(e){try{if(!this.walletInfo)throw new Error("No wallet info");if(!this.solanaConnection)throw new Error("No rpc connection");const{blockhash:n}=await this.solanaConnection.getLatestBlockhash();if(g(e)?e.message.recentBlockhash=n:e.recentBlockhash=n,this.phantomAdapter&&this.phantomAdapter.publicKey)return await this.phantomAdapter.signTransaction(e);const r=this.solanaWallet;if(!r)throw new Error("No solana wallet available");const o={user_id:this.walletInfo.id,address:r.address,network:exports.Network.Solana,tx:{Solana:h.default.encode(g(e)?e.message.serialize():e.serializeMessage())}},s=await this.api.post("/sign2",o,{withCredentials:!0}),{signature:a}=s.data;return e.addSignature(new t.PublicKey(r.address),Tf.from(h.default.decode(a))),e}catch(e){throw new Error(e instanceof Error?e.message:"Failed to sign transaction")}}async signEthereumEip712(e){if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data;return r}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.setWallet(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.setWallet(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.setWallet(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.setWallet(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.setWallet(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.setWallet(r),this.setWalletType("embedded"),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 getSession(){const e=(await this.api.get("/session",{withCredentials:!0})).data,{access_token:t,...n}=e;return t&&v.saveAccessToken(t),e}async logout(){this.phantomAdapter?(this.phantomAdapter.disconnect(),this.phantomAdapter=null):await this.api.post("/logout",{},{withCredentials:!0}),this.setWallet(null),v.clear()}async getOAuth2ClientId(e){return(await this.api.get(`/oauth_id/${e}`)).data.client_id}setSelectedWallet(e){this.selectedWalletId=e}getSelectedWallet(){return this.selectedWalletId}async getSolanaBalance(){if(!this.solanaConnection||!this.solanaAddress)throw new Error("Solana connection not available");return(await this.solanaConnection.getBalance(new t.PublicKey(this.solanaAddress))/t.LAMPORTS_PER_SOL).toString()}async getEthereumBalance(){if(!this.ethereumProvider||!this.ethereumAddress)throw new Error("Ethereum provider not available");return ff(await this.ethereumProvider.getBalance({address:this.ethereumAddress}))}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(){return{signTypedData:async e=>{if(!this.ethereumNetwork)throw new Error("No Ethereum network");if(!this.ethereumProvider)throw new Error("No Ethereum provider");if(!this.walletInfo)throw new Error("No wallet info");if(!this.ethereumAddress)throw new Error("No Ethereum address");const t={user_id:this.walletInfo.id,address:this.ethereumAddress,network:exports.Network.Ethereum,tx:{EthereumEip712:e}},n=await this.api.post("/sign2",t,{withCredentials:!0}),{signature:r}=n.data,o=h.default.decode(r),s=o[64];return $d({r:`0x${Tf.from(o.slice(0,32)).toString("hex")}`,s:`0x${Tf.from(o.slice(32,64)).toString("hex")}`,v:BigInt(s+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 pf(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;if(!this.walletInfo)throw new Error("No wallet info available");const r={user_id:this.walletInfo.id,from:e.from,to:e.to,amount:e.amount,decimals:e.decimals,token:e.token,network:e.network,chain_id:e.chain_id,need_send_tx:e.need_send_tx};try{return(await this.api.post("/transfer",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:"Transfer failed")}}}var ph=function(){return ph=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},ph.apply(this,arguments)};function mh(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 gh(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 bh=/^((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)-.*))$/,yh=gh(function(e){return bh.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),wh="-ms-",vh="-moz-",xh="-webkit-",Eh="comm",Ph="rule",kh="decl",Ah="@keyframes",Ih=Math.abs,Nh=String.fromCharCode,Sh=Object.assign;function Th(e){return e.trim()}function $h(e,t){return(e=t.exec(e))?e[0]:e}function Bh(e,t,n){return e.replace(t,n)}function Ch(e,t,n){return e.indexOf(t,n)}function Oh(e,t){return 0|e.charCodeAt(t)}function Rh(e,t,n){return e.slice(t,n)}function zh(e){return e.length}function _h(e){return e.length}function Mh(e,t){return t.push(e),e}function Fh(e,t){return e.filter(function(e){return!$h(e,t)})}var jh=1,Lh=1,Uh=0,Dh=0,Gh=0,qh="";function Vh(e,t,n,r,o,s,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:s,line:jh,column:Lh,length:a,return:"",siblings:i}}function Wh(e,t){return Sh(Vh("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Hh(e){for(;e.root;)e=Wh(e.root,{children:[e]});Mh(e,e.siblings)}function Yh(){return Gh=Dh>0?Oh(qh,--Dh):0,Lh--,10===Gh&&(Lh=1,jh--),Gh}function Zh(){return Gh=Dh<Uh?Oh(qh,Dh++):0,Lh++,10===Gh&&(Lh=1,jh++),Gh}function Kh(){return Oh(qh,Dh)}function Jh(){return Dh}function Qh(e,t){return Rh(qh,e,t)}function Xh(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 ep(e){return Th(Qh(Dh-1,rp(91===e?e+2:40===e?e+1:e)))}function tp(e){for(;(Gh=Kh())&&Gh<33;)Zh();return Xh(e)>2||Xh(Gh)>3?"":" "}function np(e,t){for(;--t&&Zh()&&!(Gh<48||Gh>102||Gh>57&&Gh<65||Gh>70&&Gh<97););return Qh(e,Jh()+(t<6&&32==Kh()&&32==Zh()))}function rp(e){for(;Zh();)switch(Gh){case e:return Dh;case 34:case 39:34!==e&&39!==e&&rp(Gh);break;case 40:41===e&&rp(e);break;case 92:Zh()}return Dh}function op(e,t){for(;Zh()&&e+Gh!==57&&(e+Gh!==84||47!==Kh()););return"/*"+Qh(t,Dh-1)+"*"+Nh(47===e?e:Zh())}function sp(e){for(;!Xh(Kh());)Zh();return Qh(e,Dh)}function ap(e){return function(e){return qh="",e}(ip("",null,null,null,[""],e=function(e){return jh=Lh=1,Uh=zh(qh=e),Dh=0,[]}(e),0,[0],e))}function ip(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=Zh()){case 40:if(108!=p&&58==Oh(P,d-1)){-1!=Ch(P+=Bh(ep(y),"&","&\f"),"&\f",Ih(u?i[u-1]:0))&&(b=-1);break}case 34:case 39:case 91:P+=ep(y);break;case 9:case 10:case 13:case 32:P+=tp(p);break;case 92:P+=np(Jh()-1,7);continue;case 47:switch(Kh()){case 42:case 47:Mh(up(op(Zh(),Jh()),t,n,c),c);break;default:P+="/"}break;case 123*m:i[u++]=zh(P)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+l:-1==b&&(P=Bh(P,/\f/g,"")),h>0&&zh(P)-d&&Mh(h>32?lp(P+";",r,n,d-1,c):lp(Bh(P," ","")+";",r,n,d-2,c),c);break;case 59:P+=";";default:if(Mh(E=cp(P,t,n,u,l,o,i,w,v=[],x=[],d,s),s),123===y)if(0===l)ip(P,t,E,E,v,s,d,i,x);else switch(99===f&&110===Oh(P,3)?100:f){case 100:case 108:case 109:case 115:ip(e,E,E,r&&Mh(cp(e,E,E,0,0,o,i,w,o,v=[],d,x),x),o,x,d,i,r?v:x);break;default:ip(P,E,E,E,[""],x,0,i,x)}}u=l=h=0,m=b=1,w=P="",d=a;break;case 58:d=1+zh(P),h=p;default:if(m<1)if(123==y)--m;else if(125==y&&0==m++&&125==Yh())continue;switch(P+=Nh(y),y*m){case 38:b=l>0?1:(P+="\f",-1);break;case 44:i[u++]=(zh(P)-1)*b,b=1;break;case 64:45===Kh()&&(P+=ep(Zh())),f=Kh(),l=d=zh(w=P+=sp(Jh())),y++;break;case 45:45===p&&2==zh(P)&&(m=0)}}return s}function cp(e,t,n,r,o,s,a,i,c,u,l,d){for(var f=o-1,h=0===o?s:[""],p=_h(h),m=0,g=0,b=0;m<r;++m)for(var y=0,w=Rh(e,f+1,f=Ih(g=a[m])),v=e;y<p;++y)(v=Th(g>0?h[y]+" "+w:Bh(w,/&\f/g,h[y])))&&(c[b++]=v);return Vh(e,t,n,0===o?Ph:i,c,u,l,d)}function up(e,t,n,r){return Vh(e,t,n,Eh,Nh(Gh),Rh(e,2,-2),0,r)}function lp(e,t,n,r,o){return Vh(e,t,n,kh,Rh(e,0,r),Rh(e,r+1,-1),r,o)}function dp(e,t,n){switch(function(e,t){return 45^Oh(e,0)?(((t<<2^Oh(e,0))<<2^Oh(e,1))<<2^Oh(e,2))<<2^Oh(e,3):0}(e,t)){case 5103:return xh+"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 xh+e+e;case 4789:return vh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return xh+e+vh+e+wh+e+e;case 5936:switch(Oh(e,t+11)){case 114:return xh+e+wh+Bh(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return xh+e+wh+Bh(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return xh+e+wh+Bh(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return xh+e+wh+e+e;case 6165:return xh+e+wh+"flex-"+e+e;case 5187:return xh+e+Bh(e,/(\w+).+(:[^]+)/,xh+"box-$1$2"+wh+"flex-$1$2")+e;case 5443:return xh+e+wh+"flex-item-"+Bh(e,/flex-|-self/g,"")+($h(e,/flex-|baseline/)?"":wh+"grid-row-"+Bh(e,/flex-|-self/g,""))+e;case 4675:return xh+e+wh+"flex-line-pack"+Bh(e,/align-content|flex-|-self/g,"")+e;case 5548:return xh+e+wh+Bh(e,"shrink","negative")+e;case 5292:return xh+e+wh+Bh(e,"basis","preferred-size")+e;case 6060:return xh+"box-"+Bh(e,"-grow","")+xh+e+wh+Bh(e,"grow","positive")+e;case 4554:return xh+Bh(e,/([^-])(transform)/g,"$1"+xh+"$2")+e;case 6187:return Bh(Bh(Bh(e,/(zoom-|grab)/,xh+"$1"),/(image-set)/,xh+"$1"),e,"")+e;case 5495:case 3959:return Bh(e,/(image-set\([^]*)/,xh+"$1$`$1");case 4968:return Bh(Bh(e,/(.+:)(flex-)?(.*)/,xh+"box-pack:$3"+wh+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+xh+e+e;case 4200:if(!$h(e,/flex-|baseline/))return wh+"grid-column-align"+Rh(e,t)+e;break;case 2592:case 3360:return wh+Bh(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(e,n){return t=n,$h(e.props,/grid-\w+-end/)})?~Ch(e+(n=n[t].value),"span",0)?e:wh+Bh(e,"-start","")+e+wh+"grid-row-span:"+(~Ch(n,"span",0)?$h(n,/\d+/):+$h(n,/\d+/)-+$h(e,/\d+/))+";":wh+Bh(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(e){return $h(e.props,/grid-\w+-start/)})?e:wh+Bh(Bh(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Bh(e,/(.+)-inline(.+)/,xh+"$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(zh(e)-1-t>6)switch(Oh(e,t+1)){case 109:if(45!==Oh(e,t+4))break;case 102:return Bh(e,/(.+:)(.+)-([^]+)/,"$1"+xh+"$2-$3$1"+vh+(108==Oh(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ch(e,"stretch",0)?dp(Bh(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Bh(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(t,n,r,o,s,a,i){return wh+n+":"+r+i+(o?wh+n+"-span:"+(s?a:+a-+r)+i:"")+e});case 4949:if(121===Oh(e,t+6))return Bh(e,":",":"+xh)+e;break;case 6444:switch(Oh(e,45===Oh(e,14)?18:11)){case 120:return Bh(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+xh+(45===Oh(e,14)?"inline-":"")+"box$3$1"+xh+"$2$3$1"+wh+"$2box$3")+e;case 100:return Bh(e,":",":"+wh)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Bh(e,"scroll-","scroll-snap-")+e}return e}function fp(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function hp(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case kh:return e.return=e.return||e.value;case Eh:return"";case Ah:return e.return=e.value+"{"+fp(e.children,r)+"}";case Ph:if(!zh(e.value=e.props.join(",")))return""}return zh(n=fp(e.children,r))?e.return=e.value+"{"+n+"}":""}function pp(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case kh:return void(e.return=dp(e.value,e.length,n));case Ah:return fp([Wh(e,{value:Bh(e.value,"@","@"+xh)})],r);case Ph:if(e.length)return function(e,t){return e.map(t).join("")}(n=e.props,function(t){switch($h(t,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Hh(Wh(e,{props:[Bh(t,/:(read-\w+)/,":-moz-$1")]})),Hh(Wh(e,{props:[t]})),Sh(e,{props:Fh(n,r)});break;case"::placeholder":Hh(Wh(e,{props:[Bh(t,/:(plac\w+)/,":"+xh+"input-$1")]})),Hh(Wh(e,{props:[Bh(t,/:(plac\w+)/,":-moz-$1")]})),Hh(Wh(e,{props:[Bh(t,/:(plac\w+)/,wh+"input-$1")]})),Hh(Wh(e,{props:[t]})),Sh(e,{props:Fh(n,r)})}return""})}}var mp={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},gp="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",bp="active",yp="data-styled-version",wp="6.1.19",vp="/*!sc*/\n",xp="undefined"!=typeof window&&"undefined"!=typeof document,Ep=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),Pp=/invalid hook call/i,kp=new Set,Ap=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];Pp.test(e)?(a=!1,kp.delete(r)):s.apply(void 0,mh([e],t,!1))},o.useRef(),a&&!kp.has(r)&&(console.warn(r),kp.add(r))}catch(e){Pp.test(e.message)&&kp.delete(r)}finally{console.error=s}}},Ip=Object.freeze([]),Np=Object.freeze({});var Sp=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"]),Tp=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,$p=/(^-|-$)/g;function Bp(e){return e.replace(Tp,"-").replace($p,"")}var Cp=/(a)(d)/gi,Op=function(e){return String.fromCharCode(e+(e>25?39:97))};function Rp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Op(t%52)+n;return(Op(t%52)+n).replace(Cp,"$1-$2")}var zp,_p=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Mp=function(e){return _p(5381,e)};function Fp(e){return Rp(Mp(e)>>>0)}function jp(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function Lp(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var Up="function"==typeof Symbol&&Symbol.for,Dp=Up?Symbol.for("react.memo"):60115,Gp=Up?Symbol.for("react.forward_ref"):60112,qp={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Vp={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Wp={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Hp=((zp={})[Gp]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zp[Dp]=Wp,zp);function Yp(e){return("type"in(t=e)&&t.type.$$typeof)===Dp?Wp:"$$typeof"in e?Hp[e.$$typeof]:qp;var t}var Zp=Object.defineProperty,Kp=Object.getOwnPropertyNames,Jp=Object.getOwnPropertySymbols,Qp=Object.getOwnPropertyDescriptor,Xp=Object.getPrototypeOf,em=Object.prototype;function tm(e,t,n){if("string"!=typeof t){if(em){var r=Xp(t);r&&r!==em&&tm(e,r,n)}var o=Kp(t);Jp&&(o=o.concat(Jp(t)));for(var s=Yp(e),a=Yp(t),i=0;i<o.length;++i){var c=o[i];if(!(c in Vp||n&&n[c]||a&&c in a||s&&c in s)){var u=Qp(t,c);try{Zp(e,c,u)}catch(e){}}}}return e}function nm(e){return"function"==typeof e}function rm(e){return"object"==typeof e&&"styledComponentId"in e}function om(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function sm(e,t){if(0===e.length)return"";for(var n=e[0],r=1;r<e.length;r++)n+=e[r];return n}function am(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function im(e,t,n){if(void 0===n&&(n=!1),!n&&!am(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=im(e[r],t[r]);else if(am(t))for(var r in t)e[r]=im(e[r],t[r]);return e}function cm(e,t){Object.defineProperty(e,"toString",{value:t})}var um="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 lm(){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 dm(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(lm.apply(void 0,mh([um[e]],t,!1)).trim())}var fm=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 dm(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(vp);return t},e}(),hm=1<<30,pm=new Map,mm=new Map,gm=1,bm=function(e){if(pm.has(e))return pm.get(e);for(;mm.has(gm);)gm++;var t=gm++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>hm))throw dm(16,"".concat(t));return pm.set(e,t),mm.set(t,e),t},ym=function(e,t){gm=t+1,pm.set(e,t),mm.set(t,e)},wm="style[".concat(gp,"][").concat(yp,'="').concat(wp,'"]'),vm=new RegExp("^".concat(gp,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),xm=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)},Em=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(vp),o=[],s=0,a=r.length;s<a;s++){var i=r[s].trim();if(i){var c=i.match(vm);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(ym(l,u),xm(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(i)}}},Pm=function(e){for(var t=document.querySelectorAll(wm),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(gp)!==bp&&(Em(e,o),o.parentNode&&o.parentNode.removeChild(o))}};var km=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(gp,"]")));return t[t.length-1]}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(gp,bp),r.setAttribute(yp,wp);var a="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return a&&r.setAttribute("nonce",a),n.insertBefore(r,s),r},Am=function(){function e(e){this.element=km(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 dm(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}(),Im=function(){function e(e){this.element=km(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}(),Nm=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}(),Sm=xp,Tm={isServer:!xp,useCSSOMInjection:!Ep},$m=function(){function e(e,t,n){void 0===e&&(e=Np),void 0===t&&(t={});var r=this;this.options=ph(ph({},Tm),e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&xp&&Sm&&(Sm=!1,Pm(this)),cm(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return mm.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(gp,".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(vp)},s=0;s<n;s++)o(s);return r}(r)})}return e.registerId=function(e){return bm(e)},e.prototype.rehydrate=function(){!this.server&&xp&&Pm(this)},e.prototype.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(ph(ph({},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 Nm(n):t?new Am(n):new Im(n)}(this.options),new fm(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(bm(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(bm(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(bm(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Bm=/&/g,Cm=/^\s*\/\/.*$/gm;function Om(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=Om(e.children,t)),e})}var Rm=new $m,zm=function(){var e,t,n,r=Np,o=r.options,s=void 0===o?Np:o,a=r.plugins,i=void 0===a?Ip: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===Ph&&e.value.includes("&")&&(e.props[0]=e.props[0].replace(Bm,t).replace(n,c))}),s.prefix&&u.push(pp),u.push(hp);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(Cm,""),l=ap(a||o?"".concat(a," ").concat(o," { ").concat(c," }"):c);s.namespace&&(l=Om(l,s.namespace));var d,f=[];return fp(l,function(e){var t=_h(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||dm(15),_p(e,t.name)},5381).toString():"",l}(),_m=p.default.createContext({shouldForwardProp:void 0,styleSheet:Rm,stylis:zm});function Mm(){return o.useContext(_m)}_m.Consumer,p.default.createContext(void 0);var Fm=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=zm);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,cm(this,function(){throw dm(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=zm),this.name+e.hash},e}(),jm=function(e){return e>="A"&&e<="Z"};function Lm(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;jm(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var Um=function(e){return null==e||!1===e||""===e},Dm=function(e){var t,n,r=[];for(var o in e){var s=e[o];e.hasOwnProperty(o)&&!Um(s)&&(Array.isArray(s)&&s.isCss||nm(s)?r.push("".concat(Lm(o),":"),s,";"):am(s)?r.push.apply(r,mh(mh(["".concat(o," {")],Dm(s),!1),["}"],!1)):r.push("".concat(Lm(o),": ").concat((t=o,null==(n=s)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||t in mp||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Gm(e,t,n,r){if(Um(e))return[];if(rm(e))return[".".concat(e.styledComponentId)];if(nm(e)){if(!nm(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 Fm||am(o)||null===o||console.error("".concat(jp(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.")),Gm(o,t,n,r)}var s;return e instanceof Fm?n?(e.inject(n,r),[e.getName(r)]):[e]:am(e)?Dm(e):Array.isArray(e)?Array.prototype.concat.apply(Ip,e.map(function(e){return Gm(e,t,n,r)})):[e.toString()]}var qm=Mp(wp),Vm=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(nm(n)&&!rm(n))return!1}return!0}(e),this.componentId=t,this.baseHash=_p(qm,t),this.baseStyle=n,$m.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=om(r,this.staticRulesId);else{var o=sm(Gm(this.rules,e,t,n)),s=Rp(_p(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=om(r,s),this.staticRulesId=s}else{for(var i=_p(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=_p(i,l));else if(l){var d=sm(Gm(l,e,t,n));i=_p(i,d+u),c+=d}}if(c){var f=Rp(i>>>0);t.hasNameForId(this.componentId,f)||t.insertRules(this.componentId,f,n(c,".".concat(f),void 0,this.componentId)),r=om(r,f)}}return r},e}(),Wm=p.default.createContext(void 0);Wm.Consumer;var Hm={},Ym=new Set;function Zm(e,t,n){var r=rm(e),s=e,a=!Lp(e),i=t.attrs,c=void 0===i?Ip:i,u=t.componentId,l=void 0===u?function(e,t){var n="string"!=typeof e?"sc":Bp(e);Hm[n]=(Hm[n]||0)+1;var r="".concat(n,"-").concat(Fp(wp+n+Hm[n]));return t?"".concat(t,"-").concat(r):r}(t.displayName,t.parentComponentId):u,d=t.displayName,f=void 0===d?function(e){return Lp(e)?"styled.".concat(e):"Styled(".concat(jp(e),")")}(e):d,h=t.displayName&&t.componentId?"".concat(Bp(t.displayName),"-").concat(t.componentId):t.componentId||l,m=r&&s.attrs?s.attrs.concat(c).filter(Boolean):c,g=t.shouldForwardProp;if(r&&s.shouldForwardProp){var b=s.shouldForwardProp;if(t.shouldForwardProp){var y=t.shouldForwardProp;g=function(e,t){return b(e,t)&&y(e,t)}}else g=b}var w=new Vm(n,h,r?s.componentStyle:void 0);function v(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=p.default.useContext(Wm),d=Mm(),f=e.shouldForwardProp||d.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue(c);var h=function(e,t,n){return void 0===n&&(n=Np),e.theme!==n.theme&&e.theme||t||n.theme}(t,l,a)||Np,m=function(e,t,n){for(var r,o=ph(ph({},t),{className:void 0,theme:n}),s=0;s<e.length;s+=1){var a=nm(r=e[s])?r(o):r;for(var i in a)o[i]="className"===i?om(o[i],a[i]):"style"===i?ph(ph({},o[i]),a[i]):a[i]}return t.className&&(o.className=om(o.className,t.className)),o}(r,t,h),g=m.as||u,b={};for(var y in m)void 0===m[y]||"$"===y[0]||"as"===y||"theme"===y&&m.theme===h||("forwardedAs"===y?b.as=m.forwardedAs:f&&!f(y,g)||(b[y]=m[y],f||"development"!==process.env.NODE_ENV||yh(y)||Ym.has(y)||!Sp.has(g)||(Ym.add(y),console.warn('styled-components: it looks like an unknown prop "'.concat(y,'" 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 w=function(e,t){var n=Mm(),r=e.generateAndInjectStyles(t,n.styleSheet,n.stylis);return"production"!==process.env.NODE_ENV&&o.useDebugValue(r),r}(s,m);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(w);var v=om(i,c);return w&&(v+=" "+w),m.className&&(v+=" "+m.className),b[Lp(g)&&!Sp.has(g)?"class":"className"]=v,n&&(b.ref=n),o.createElement(g,b)}(x,e,t)}v.displayName=f;var x=p.default.forwardRef(v);return x.attrs=m,x.componentStyle=w,x.displayName=f,x.shouldForwardProp=g,x.foldedComponentIds=r?om(s.foldedComponentIds,s.styledComponentId):"",x.styledComponentId=h,x.target=r?s.target:e,Object.defineProperty(x,"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++)im(e,o[r],!0);return e}({},s.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(Ap(f,h),x.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)),cm(x,function(){return".".concat(x.styledComponentId)}),a&&tm(x,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Km(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 Jm=function(e){return Object.assign(e,{isCss:!0})};function Qm(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(nm(e)||am(e))return Jm(Gm(Km(Ip,mh([e],t,!0))));var r=e;return 0===t.length&&1===r.length&&"string"==typeof r[0]?Gm(r):Jm(Gm(Km(r,t)))}function Xm(e,t,n){if(void 0===n&&(n=Np),!t)throw dm(1,t);var r=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return e(t,n,Qm.apply(void 0,mh([r],o,!1)))};return r.attrs=function(r){return Xm(e,t,ph(ph({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Xm(e,t,ph(ph({},n),r))},r}var eg=function(e){return Xm(Zm,e)},tg=eg;Sp.forEach(function(e){tg[e]=eg(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 ng="__sc-".concat(gp,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[ng]||(window[ng]=0),1===window[ng]&&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[ng]+=1);const rg={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"}},og=(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=sm(Qm.apply(void 0,mh([e],t,!1))),o=Fp(r);return new Fm(o,r)})`
13
13
  from {
14
14
  transform: rotate(0deg);
15
15
  }