@dcl/marketplace-site 8.26.2-28438598732.commit-9be9bba → 8.26.2
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/assets/{ConstantsUtil-DPJhqMeI.js → ConstantsUtil-BVe08SFv.js} +1 -1
- package/assets/{ExchangeController-dDDBhM7G.js → ExchangeController-D7I2RcZT.js} +1 -1
- package/assets/{HelpersUtil-Bp3sdXDl.js → HelpersUtil-ChksFsB0.js} +1 -1
- package/assets/{NetworkUtil-D9Apb7PC.js → NetworkUtil-CHwzbV4h.js} +1 -1
- package/assets/{SwapController-D2uQloTv.js → SwapController-BDPAlwW-.js} +1 -1
- package/assets/{biconomy-CSoC-rI8.js → biconomy-CbcBq0Ty.js} +1 -1
- package/assets/{browser-CnlaB8aC.js → browser-BIe69NGp.js} +1 -1
- package/assets/{ccip-Cu5lEKSq.js → ccip-D97o_Zdl.js} +1 -1
- package/assets/{ccip-Cj7-LEGv.js → ccip-e5a5X4c5.js} +1 -1
- package/assets/{chains-r7J7qhHp.js → chains-Bx-tlqt8.js} +1 -1
- package/assets/{common-D7MWUpES.js → common-B8yAeqHw.js} +1 -1
- package/assets/{controller-BjIVvsNj.js → controller-ChEtySr4.js} +2 -2
- package/assets/{data-capture-CL1x_TWk.js → data-capture-CVZHhrkz.js} +1 -1
- package/assets/{decimals-BxBfm4F8.js → decimals-Bg-x-yWm.js} +1 -1
- package/assets/decimals-unishlFr.js +1 -0
- package/assets/{detectExtension-DQYjL7QT.js → detectExtension-6BActM5c.js} +1 -1
- package/assets/{email-Dt5oL7h7.js → email-DFvQIcUa.js} +1 -1
- package/assets/{embedded-wallet-CxlQMgyC.js → embedded-wallet-Bkzfg8Q-.js} +1 -1
- package/assets/{engine-CWrMFEHj.js → engine-D56ezgnV.js} +1 -1
- package/assets/{estimate-l1-fee-BA0rS8_T.js → estimate-l1-fee-CdZ3w41f.js} +1 -1
- package/assets/eth_estimateGas-ETW4xztT.js +1 -0
- package/assets/{eth_getStorageAt-D-YjRD8M.js → eth_getStorageAt-CXsNN6pn.js} +1 -1
- package/assets/{eth_getTransactionCount-hf8F-dbS.js → eth_getTransactionCount-qsl0Cr9u.js} +1 -1
- package/assets/{ethereum-x457AqDc.js → ethereum-CEtGPAUd.js} +1 -1
- package/assets/{extractIPFS-uIQNCz58.js → extractIPFS-DIUED-Pg.js} +1 -1
- package/assets/{features-DpOkT5eu.js → features-BDgwSdkw.js} +1 -1
- package/assets/{fetchTokenMetadata-BzHNZoJx.js → fetchTokenMetadata-B08gZ7bo.js} +2 -2
- package/assets/{fortmatic-C9-_drsj.js → fortmatic-v2xaLqWX.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-DVkt4lO-.js → get-ecosystem-wallet-info-Dy07hdCI.js} +1 -1
- package/assets/{getBalance-Dg__EkP1.js → getBalance-DsI9g0TY.js} +2 -2
- package/assets/{getInstalledModules-6mBUE3YV.js → getInstalledModules-Du4PQQY7.js} +1 -1
- package/assets/{getNFT-DI2UbpHZ.js → getNFT-BV-kLyDv.js} +2 -2
- package/assets/{getNFT-M3sK_31w.js → getNFT-BaIgXH0L.js} +1 -1
- package/assets/{hashTypedData-JpWupk8Z.js → hashTypedData-BcqP-VKp.js} +1 -1
- package/assets/{hooks.module-BdVNI2aP.js → hooks.module-2VF1s86u.js} +1 -1
- package/assets/{if-defined-CScwbni5.js → if-defined-Ds3urhgS.js} +1 -1
- package/assets/{in-app-wallet-calls-BLeiSGXo.js → in-app-wallet-calls-Bdrxdgac.js} +1 -1
- package/assets/{index-CnFUmLYv.css → index--i8cFVe-.css} +4 -4
- package/assets/{index-oPjWMwGZ.js → index-4DIz2OLU.js} +1 -1
- package/assets/{index-C64ohPrX.js → index-B-V1pT7O.js} +1 -1
- package/assets/{index-BGEwPdAj.js → index-B1Yn6LZ7.js} +1 -1
- package/assets/{index-DFcdgpvJ.js → index-B86FVXsF.js} +1 -1
- package/assets/{index-mxkvGiB-.js → index-B8ywPsk7.js} +1 -1
- package/assets/{index-DRgXv-Kn.js → index-B99H637p.js} +1 -1
- package/assets/{index-DS8Dfzvp.js → index-BCg8xZps.js} +1 -1
- package/assets/{index-CyAqAEl0.js → index-BFN2JwZf.js} +1 -1
- package/assets/{index-CkL1VqhG.js → index-BMj8di1o.js} +1 -1
- package/assets/{index-BSEhKdxS.js → index-BX-MdUp7.js} +1 -1
- package/assets/{index-BzsXZXiV.js → index-BqbPuN49.js} +2 -2
- package/assets/{index-CuBLbtoZ.js → index-BrVrHHcA.js} +1 -1
- package/assets/{index-DuZ8iGP2.js → index-BrayI2is.js} +1 -1
- package/assets/{index-CNlLDagM.js → index-BvwJ4NFY.js} +1 -1
- package/assets/{index-C1c8kneY.js → index-ByKRDdXr.js} +1 -1
- package/assets/{index-BJpbrEV7.js → index-Byvz3GUv.js} +1 -1
- package/assets/{index-BZel7GPS.js → index-CEGG1TLL.js} +5 -5
- package/assets/{index-DD7iMQzJ.js → index-CMWe_uTx.js} +1 -1
- package/assets/{index-CcLcbAJR.js → index-CVDRowk6.js} +1 -1
- package/assets/{index-pg3gVqDq.js → index-CZvdQ09D.js} +1 -1
- package/assets/{index-DvAfYHns.js → index-Cb869yYJ.js} +1 -1
- package/assets/{index-DMx12jGt.js → index-CkEDC948.js} +1 -1
- package/assets/{index-BdQYipn_.js → index-Cn7IwhQW.js} +1 -1
- package/assets/{index-oMud_shx.js → index-CyXq8LLv.js} +1 -1
- package/assets/{index-CSZIVLyQ.js → index-D4O7QrQN.js} +1 -1
- package/assets/{index-DkKbloi0.js → index-DBOW59t5.js} +1 -1
- package/assets/{index-BfrT8V4g.js → index-DLrth3RC.js} +1 -1
- package/assets/{index-D8kIKvzY.js → index-DPDHrphZ.js} +1 -1
- package/assets/{index-D67VpjIw.js → index-DSz9GFR1.js} +1 -1
- package/assets/{index-Cj4EAkNq.js → index-DTHNWrSK.js} +1 -1
- package/assets/{index-B8OqPQn0.js → index-Df7WkvHL.js} +1 -1
- package/assets/{index-BOjSzafE.js → index-Dk1r4ews.js} +1 -1
- package/assets/{index-D7UaaJaW.js → index-DnQCkOoU.js} +1 -1
- package/assets/{index-DiaiZT1E.js → index-KB_OlOsY.js} +1 -1
- package/assets/{index-FZQUryan.js → index-LJw8fTYh.js} +1 -1
- package/assets/{index-CJrxaZov.js → index-PL5hyrXD.js} +1 -1
- package/assets/{index-CdL8rBqX.js → index-Pi1Cu9h8.js} +1 -1
- package/assets/{index-C3xCnLWR.js → index-TsJ5aihM.js} +1 -1
- package/assets/{index-sWOsl5Mq.js → index-ck0-AGvi.js} +9 -9
- package/assets/{index-U1mrx0Bi.js → index-cvVZg_4X.js} +1 -1
- package/assets/{index-CkFR0MQl.js → index-vFAtXWYb.js} +1 -1
- package/assets/{index-CwyZjPUn.js → index-yCStn-Jf.js} +1 -1
- package/assets/{index.es-K-9xnuOr.js → index.es-D5-9dS_L.js} +1 -1
- package/assets/{index.es-BNdtevav.js → index.es-DmegW8iA.js} +1 -1
- package/assets/{index.es-C_YmGTsa.js → index.es-GZOcqfUt.js} +1 -1
- package/assets/{networks-3zvikuaU.js → networks-s96UMzHA.js} +1 -1
- package/assets/{onramp-DvYnrw4s.js → onramp-BUgdMu2R.js} +1 -1
- package/assets/{openzeppelin-RkIBKfVK.js → openzeppelin-CekW9wve.js} +1 -1
- package/assets/{ownerOf-JpXqTWrQ.js → ownerOf-C-8LA9rh.js} +1 -1
- package/assets/{parseNft-eA-ntahV.js → parseNft-BuLJ6CN_.js} +2 -2
- package/assets/{parseSignature-BF9XoBVw.js → parseSignature-BF7SmcrH.js} +3 -3
- package/assets/{pay-with-exchange-CBu8dDvu.js → pay-with-exchange-CQ-1PkzS.js} +1 -1
- package/assets/{qr-overlay-DzX75qoo.js → qr-overlay-KOiqNJ7X.js} +3 -3
- package/assets/{receive-CEk6pgz7.js → receive-DdQ-eNuq.js} +1 -1
- package/assets/{ref-5yClEFwG.js → ref-Cf_ViboH.js} +1 -1
- package/assets/{resolveImplementation-DDsaIAFL.js → resolveImplementation-Dml3QyNc.js} +1 -1
- package/assets/{rpc-0WxzKp4G.js → rpc-Ab24KkZg.js} +1 -1
- package/assets/{secp256k1-CgGDcudz.js → secp256k1-b-PbPirG.js} +1 -1
- package/assets/{send-DsuDpLhH.js → send-DYChYkEs.js} +1 -1
- package/assets/{send-batch-transaction-Bu_2rhYZ.js → send-batch-transaction-BgxJyMqO.js} +1 -1
- package/assets/{send-eip712-transaction-DwOwlCqR.js → send-eip712-transaction-B2xYx25b.js} +2 -2
- package/assets/{send-gasless-transaction-DhgWzw2O.js → send-gasless-transaction-DHhfap7k.js} +2 -2
- package/assets/{session-proposal-gCtrzWm4.js → session-proposal-BnHJBpnN.js} +1 -1
- package/assets/{session-request-CbcWY9Ja.js → session-request-oxggTqvw.js} +2 -2
- package/assets/{sha256-ClaNMra1.js → sha256-B6qHgPJw.js} +1 -1
- package/assets/{signing-CDXpwg1w.js → signing-CBJKy3lp.js} +5 -5
- package/assets/{socials-DhDCwExF.js → socials-DkK77CE4.js} +1 -1
- package/assets/{swaps-F_xZ0dzZ.js → swaps-CONEC-rn.js} +1 -1
- package/assets/{thirdweb-CnE8pMyg.js → thirdweb-CXdV8otn.js} +3 -3
- package/assets/{totalSupply-DKJF9DIi.js → totalSupply-DewA9IDx.js} +1 -1
- package/assets/{transactionReceipt-CX3mUtae.js → transactionReceipt-CIDOJhxr.js} +1 -1
- package/assets/{transactions-Di8L0T-_.js → transactions-DeTiWVbv.js} +1 -1
- package/assets/utils-CSELsIOA.js +1 -0
- package/assets/{verifyHash-CGn48zoz.js → verifyHash-BIPQuk0X.js} +3 -3
- package/assets/{w3m-modal-GUBTCSBO.js → w3m-modal-DL2ymkGa.js} +1 -1
- package/assets/{wait-for-tx-receipt-BvWtLCnm.js → wait-for-tx-receipt-rcWke49s.js} +1 -1
- package/assets/{wallets-MLt9VdIg.js → wallets-Cs85dk6n.js} +6 -6
- package/assets/{web-connector-BKvHD2Ne.js → web-connector-BSznc5-3.js} +3 -3
- package/assets/{zora-sepolia-QvmvwDKI.js → zora-sepolia-fy3MjZbS.js} +1 -1
- package/index.html +5 -5
- package/package.json +2 -2
- package/assets/decimals-BJPY5y0c.js +0 -1
- package/assets/eth_estimateGas-B-vKWEoE.js +0 -1
- package/assets/utils-DcLg-vXm.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/utils-
|
|
2
|
-
import{L as _i,c as at,b as ea,e as zi,w as Oi}from"./utils-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/utils-CSELsIOA.js","assets/index-ck0-AGvi.js","assets/index--i8cFVe-.css","assets/resolveImplementation-Dml3QyNc.js","assets/eth_getStorageAt-CXsNN6pn.js","assets/extractIPFS-DIUED-Pg.js","assets/getInstalledModules-Du4PQQY7.js","assets/eth_estimateGas-ETW4xztT.js","assets/send-eip712-transaction-B2xYx25b.js","assets/sha256-B6qHgPJw.js","assets/eth_getTransactionCount-qsl0Cr9u.js","assets/send-gasless-transaction-DHhfap7k.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{L as _i,c as at,b as ea,e as zi,w as Oi}from"./utils-CSELsIOA.js";import{_ as F}from"./index-ck0-AGvi.js";function fe(e,t,n){return JSON.stringify(e,(i,s)=>{const o=typeof s=="bigint"?s.toString():s;return typeof t=="function"?t(i,o):o},n)}const L0=Object.freeze(Object.defineProperty({__proto__:null,stringify:fe},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ar=BigInt(0),kn=BigInt(1);function nt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cr(e){if(!nt(e))throw new Error("Uint8Array expected")}function wt(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Mt(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Li(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?ar:BigInt("0x"+e)}const Mi=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ta=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function xt(e){if(cr(e),Mi)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=ta[e[n]];return t}const ye={_0:48,_9:57,A:65,F:70,a:97,f:102};function Fr(e){if(e>=ye._0&&e<=ye._9)return e-ye._0;if(e>=ye.A&&e<=ye.F)return e-(ye.A-10);if(e>=ye.a&&e<=ye.f)return e-(ye.a-10)}function jt(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Mi)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,s=0;i<n;i++,s+=2){const o=Fr(e.charCodeAt(s)),a=Fr(e.charCodeAt(s+1));if(o===void 0||a===void 0){const c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}r[i]=o*16+a}return r}function Ce(e){return Li(xt(e))}function Ci(e){return cr(e),Li(xt(Uint8Array.from(e).reverse()))}function $t(e,t){return jt(e.toString(16).padStart(t*2,"0"))}function Ni(e,t){return $t(e,t).reverse()}function se(e,t,n){let r;if(typeof t=="string")try{r=jt(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(nt(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r}function Ft(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];cr(i),t+=i.length}const n=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const s=e[r];n.set(s,i),i+=s.length}return n}const En=e=>typeof e=="bigint"&&ar<=e;function ur(e,t,n){return En(e)&&En(t)&&En(n)&&t<=e&&e<n}function Qe(e,t,n,r){if(!ur(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function na(e){let t;for(t=0;e>ar;e>>=kn,t+=1);return t}const Qt=e=>(kn<<BigInt(e))-kn,vn=e=>new Uint8Array(e),Dr=e=>Uint8Array.from(e);function ra(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=vn(e),i=vn(e),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...d)=>n(i,r,...d),c=(d=vn(0))=>{i=a(Dr([0]),d),r=a(),d.length!==0&&(i=a(Dr([1]),d),r=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const l=[];for(;d<t;){r=a();const p=r.slice();l.push(p),d+=r.length}return Ft(...l)};return(d,l)=>{o(),c(d);let p;for(;!(p=l(u()));)c();return o(),p}}const ia={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||nt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function en(e,t,n={}){const r=(i,s,o)=>{const a=ia[s];if(typeof a!="function")throw new Error("invalid validator function");const c=e[i];if(!(o&&c===void 0)&&!a(c,e))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(t))r(i,s,!1);for(const[i,s]of Object.entries(n))r(i,s,!0);return e}function Hr(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(i!==void 0)return i;const s=e(n,...r);return t.set(n,s),s}}const sa="0.1.1";function oa(){return sa}let P=class jn extends Error{constructor(t,n={}){const r=(()=>{var c;if(n.cause instanceof jn){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof jn&&n.cause.docsPath||n.docsPath,o=`https://oxlib.sh${i??""}`,a=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(`
|
|
3
3
|
`);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${oa()}`}),this.cause=n.cause,this.details=r,this.docs=o,this.docsPath=i,this.shortMessage=t}walk(t){return Ui(this,t)}};function Ui(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Ui(e.cause,t):t?null:e}const aa="#__bigint";function ct(e,t,n){return JSON.stringify(e,(r,i)=>typeof t=="function"?t(r,i):typeof i=="bigint"?i.toString()+aa:i,n)}function je(e,t){if(Xe(e)>t)throw new za({givenSize:Xe(e),maxSize:t})}const ge={zero:48,nine:57,A:65,F:70,a:97,f:102};function Vr(e){if(e>=ge.zero&&e<=ge.nine)return e-ge.zero;if(e>=ge.A&&e<=ge.F)return e-(ge.A-10);if(e>=ge.a&&e<=ge.f)return e-(ge.a-10)}function Ri(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Oa({size:e.length,targetSize:r,type:"Bytes"});const i=new Uint8Array(r);for(let s=0;s<r;s++){const o=n==="right";i[o?s:r-s-1]=e[o?s:e.length-s-1]}return i}function ki(e,t={}){const{dir:n="left"}=t;let r=e,i=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)i++;return r=n==="left"?r.slice(i):r.slice(0,r.length-i),r}function Bt(e,t){if(R(e)>t)throw new ba({givenSize:R(e),maxSize:t})}function ca(e,t){if(typeof t=="number"&&t>0&&t>R(e)-1)throw new Hi({offset:t,position:"start",size:R(e)})}function ua(e,t,n){if(typeof t=="number"&&typeof n=="number"&&R(e)!==n-t)throw new Hi({offset:n,position:"end",size:R(e)})}function ji(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const i=e.replace("0x","");if(i.length>r*2)throw new wa({size:Math.ceil(i.length/2),targetSize:r,type:"Hex"});return`0x${i[n==="right"?"padEnd":"padStart"](r*2,"0")}`}function fa(e,t={}){const{dir:n="left"}=t;let r=e.replace("0x",""),i=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)i++;return r=n==="left"?r.slice(i):r.slice(0,r.length-i),r==="0"?"0x":n==="right"&&r.length%2===1?`0x${r}0`:`0x${r}`}const da=new TextEncoder,la=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ha(e,t={}){const{strict:n=!1}=t;if(!e)throw new Gr(e);if(typeof e!="string")throw new Gr(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new qr(e);if(!e.startsWith("0x"))throw new qr(e)}function N(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function tn(e){return e instanceof Uint8Array?Y(e):Array.isArray(e)?Y(new Uint8Array(e)):e}function fr(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Bt(n,t.size),Te(n,t.size)):n}function Y(e,t={}){let n="";for(let i=0;i<e.length;i++)n+=la[e[i]];const r=`0x${n}`;return typeof t.size=="number"?(Bt(r,t.size),_e(r,t.size)):r}function I(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const u=typeof e=="bigint"?"n":"";throw new Di({max:s?`${s}${u}`:void 0,min:`${o}${u}`,signed:n,size:r,value:`${e}${u}`})}const c=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?Te(c,r):c}function St(e,t={}){return Y(da.encode(e),t)}function Te(e,t){return ji(e,{dir:"left",size:t})}function _e(e,t){return ji(e,{dir:"right",size:t})}function K(e,t,n,r={}){const{strict:i}=r;ca(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return i&&ua(s,t,n),s}function R(e){return Math.ceil((e.length-2)/2)}function Et(e){return fa(e,{dir:"left"})}function be(e,t={}){const{signed:n}=t;t.size&&Bt(e,t.size);const r=BigInt(e);if(!n)return r;const i=(e.length-2)/2,s=(1n<<BigInt(i)*8n)-1n,o=s>>1n;return r<=o?r:r-s-1n}function pa(e,t={}){t.size&&Bt(e,t.size);const n=Et(e);if(n==="0x")return!1;if(n==="0x1")return!0;throw new ma(e)}function ya(e,t={}){return ze(e,t)}function Fi(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:be(e,t))}function ga(e,t={}){const{size:n}=t;let r=ze(e);return n&&(je(r,n),r=Ki(r)),new TextDecoder().decode(r)}function dr(e,t={}){const{strict:n=!1}=t;try{return ha(e,{strict:n}),!0}catch{return!1}}let Di=class extends P{constructor({max:t,min:n,signed:r,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},ma=class extends P{constructor(t){super(`Hex value \`"${t}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}};class Gr extends P{constructor(t){super(`Value \`${typeof t=="object"?ct(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}let qr=class extends P{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}},ba=class extends P{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},Hi=class extends P{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},wa=class extends P{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};const xa=new TextDecoder,$a=new TextEncoder;function Ea(e){if(!(e instanceof Uint8Array)){if(!e)throw new Ct(e);if(typeof e!="object")throw new Ct(e);if(!("BYTES_PER_ELEMENT"in e))throw new Ct(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new Ct(e)}}function Vi(...e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const s=e[r];n.set(s,i),i+=s.length}return n}function Fn(e){return e instanceof Uint8Array?e:typeof e=="string"?ze(e):va(e)}function va(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function Aa(e,t={}){const{size:n}=t,r=new Uint8Array(1);return r[0]=Number(e),typeof n=="number"?(je(r,n),Ia(r,n)):r}function ze(e,t={}){const{size:n}=t;let r=e;n&&(Bt(e,n),r=_e(e,n));let i=r.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const u=Vr(i.charCodeAt(c++)),f=Vr(i.charCodeAt(c++));if(u===void 0||f===void 0)throw new P(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);o[a]=u*16+f}return o}function Pa(e,t){const n=I(e,t);return ze(n)}function lr(e,t={}){const{size:n}=t,r=$a.encode(e);return typeof n=="number"?(je(r,n),Ba(r,n)):r}function Ia(e,t){return Ri(e,{dir:"left",size:t})}function Ba(e,t){return Ri(e,{dir:"right",size:t})}function Xe(e){return e.length}function Sa(e,t,n,r={}){const{strict:i}=r;return e.slice(t,n)}function Gi(e,t={}){const{size:n}=t;typeof n<"u"&&je(e,n);const r=Y(e,t);return be(r,t)}function qi(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(je(r,n),r=Zi(r)),r.length>1||r[0]>1)throw new _a(r);return!!r[0]}function ce(e,t={}){const{size:n}=t;typeof n<"u"&&je(e,n);const r=Y(e,t);return Fi(r,t)}function Wi(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(je(r,n),r=Ki(r)),xa.decode(r)}function Zi(e){return ki(e,{dir:"left"})}function Ki(e){return ki(e,{dir:"right"})}function Ta(e){try{return Ea(e),!0}catch{return!1}}let _a=class extends P{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}};class Ct extends P{constructor(t){super(`Value \`${typeof t=="object"?ct(t):t}\` of type \`${typeof t}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}let za=class extends P{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Oa=class extends P{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};function Fe(e,t={}){return dr(e,t)}function La(e,t={}){switch(typeof e){case"number":case"bigint":return Na(e,t);case"boolean":return Ma(e,t);default:return Fe(e)?Ca(e,t):Dt(e,t)}}function Ma(e,t={}){return Aa(e,t)}function Ca(e,t={}){return ze(e,t)}function Na(e,t){return Pa(e,t)}function Dt(e,t={}){return lr(e,t)}function Ht(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ua(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ut(e,...t){if(!Ua(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ra(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ht(e.outputLen),Ht(e.blockLen)}function rt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Yi(e,t){ut(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const Nt=BigInt(2**32-1),Wr=BigInt(32);function ka(e,t=!1){return t?{h:Number(e&Nt),l:Number(e>>Wr&Nt)}:{h:Number(e>>Wr&Nt)|0,l:Number(e&Nt)|0}}function ja(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:o}=ka(e[i],t);[n[i],r[i]]=[s,o]}return[n,r]}const Fa=(e,t,n)=>e<<n|t>>>32-n,Da=(e,t,n)=>t<<n|e>>>32-n,Ha=(e,t,n)=>t<<n-32|e>>>64-n,Va=(e,t,n)=>e<<n-32|t>>>64-n,We=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Ga(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function An(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ae(e,t){return e<<32-t|e>>>t}const Zr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function qa(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Kr(e){for(let t=0;t<e.length;t++)e[t]=qa(e[t])}const Wa=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Za=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function H0(e){if(ut(e),Wa)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Za[e[n]];return t}function Ka(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function nn(e){return typeof e=="string"&&(e=Ka(e)),ut(e),e}function Ya(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];ut(i),t+=i.length}const n=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const s=e[r];n.set(s,i),i+=s.length}return n}let hr=class{clone(){return this._cloneInto()}};function Xi(e){const t=r=>e().update(nn(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Xa(e=32){if(We&&typeof We.getRandomValues=="function")return We.getRandomValues(new Uint8Array(e));if(We&&typeof We.randomBytes=="function")return Uint8Array.from(We.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Ji=[],Qi=[],es=[],Ja=BigInt(0),yt=BigInt(1),Qa=BigInt(2),ec=BigInt(7),tc=BigInt(256),nc=BigInt(113);for(let e=0,t=yt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Ji.push(2*(5*r+n)),Qi.push((e+1)*(e+2)/2%64);let i=Ja;for(let s=0;s<7;s++)t=(t<<yt^(t>>ec)*nc)%tc,t&Qa&&(i^=yt<<(yt<<BigInt(s))-yt);es.push(i)}const[rc,ic]=ja(es,!0),Yr=(e,t,n)=>n>32?Ha(e,t,n):Fa(e,t,n),Xr=(e,t,n)=>n>32?Va(e,t,n):Da(e,t,n);function sc(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],f=n[c+1],d=Yr(u,f,1)^n[a],l=Xr(u,f,1)^n[a+1];for(let p=0;p<50;p+=10)e[o+p]^=d,e[o+p+1]^=l}let i=e[2],s=e[3];for(let o=0;o<24;o++){const a=Qi[o],c=Yr(i,s,a),u=Xr(i,s,a),f=Ji[o];i=e[f],s=e[f+1],e[f]=c,e[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=rc[r],e[1]^=ic[r]}n.fill(0)}let oc=class ts extends hr{constructor(t,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,Ht(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Ga(this.state)}keccak(){Zr||Kr(this.state32),sc(this.state32,this.rounds),Zr||Kr(this.state32),this.posOut=0,this.pos=0}update(t){rt(this);const{blockLen:n,state:r}=this;t=nn(t);const i=t.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:i}=this;t[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){rt(this,!1),ut(t),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=t.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);t.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Ht(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Yi(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return t||(t=new ts(n,r,i,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}};const ac=(e,t,n)=>Xi(()=>new oc(t,e,n)),ns=ac(1,136,256/8);function Ne(e,t={}){const{dir:n,size:r=32}=t;return r===null?e:n==="right"?_e(e,r):Te(e,r)}function cc(e,t={}){return ga(e,t)}function rn(e,t={}){return be(e,t)}function uc(e,t={}){return Fi(e,t)}function rs(e,t={}){return pa(e,t)}function is(e,t={}){return ya(e,t)}function G0(e,t){const n=typeof t=="string"?{to:t}:t;switch(n.to){case"number":return uc(e,n);case"bigint":return rn(e,n);case"string":return cc(e,n);case"boolean":return rs(e,n);default:return is(e,n)}}function ss(e,t={}){return fr(e,t)}function pr(e,t={}){return Y(e,t)}function de(e,t={}){return I(e,t)}function sn(e,t={}){return St(e,t)}function os(e,t={}){switch(typeof e){case"number":case"bigint":return de(e,t);case"string":return sn(e,t);case"boolean":return ss(e,t);default:return pr(e,t)}}function $e(e,t){const n=ns(Fe(e,{strict:!1})?is(e):e);return t==="bytes"?n:pr(n)}const fc=/^0x[a-fA-F0-9]{40}$/,Pn=new _i(4096);function yr(e){if(Pn.has(e))return Pn.get(e);const t=fc.test(e)&&(e.toLowerCase()===e||as(e)===e);return Pn.set(e,t),t}function as(e){const t=e.substring(2).toLowerCase(),n=$e(Dt(t),"bytes"),r=t.split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&e[i]&&(r[i]=r[i].toUpperCase()),(n[i>>1]&15)>=8&&e[i+1]&&(r[i+1]=r[i+1].toUpperCase());return`0x${r.join("")}`}function Ie(e){if(!yr(e))throw new Error(`Invalid address: ${e}`);return as(e)}function dc(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),s=BigInt(4294967295),o=Number(n>>i&s),a=Number(n&s),c=r?4:0,u=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+u,a,r)}function lc(e,t,n){return e&t^~e&n}function hc(e,t,n){return e&t^e&n^t&n}class pc extends hr{constructor(t,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(t),this.view=An(this.buffer)}update(t){rt(this);const{view:n,buffer:r,blockLen:i}=this;t=nn(t);const s=t.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=An(t);for(;i<=s-o;o+=i)this.process(c,o);continue}r.set(t.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){rt(this),Yi(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;n[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let d=o;d<i;d++)n[d]=0;dc(r,i-8,BigInt(this.length*8),s),this.process(r,0);const a=An(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,f=this.get();if(u>f.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<u;d++)a.setUint32(4*d,f[d],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:s,destroyed:o,pos:a}=this;return t.length=i,t.pos=a,t.finished=s,t.destroyed=o,i%n&&t.buffer.set(r),t}}const yc=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ae=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pe=new Uint32Array(64);class gc extends pc{constructor(t=32){super(64,t,8,!1),this.A=Ae[0]|0,this.B=Ae[1]|0,this.C=Ae[2]|0,this.D=Ae[3]|0,this.E=Ae[4]|0,this.F=Ae[5]|0,this.G=Ae[6]|0,this.H=Ae[7]|0}get(){const{A:t,B:n,C:r,D:i,E:s,F:o,G:a,H:c}=this;return[t,n,r,i,s,o,a,c]}set(t,n,r,i,s,o,a,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(t,n){for(let d=0;d<16;d++,n+=4)Pe[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const l=Pe[d-15],p=Pe[d-2],m=ae(l,7)^ae(l,18)^l>>>3,y=ae(p,17)^ae(p,19)^p>>>10;Pe[d]=y+Pe[d-7]+m+Pe[d-16]|0}let{A:r,B:i,C:s,D:o,E:a,F:c,G:u,H:f}=this;for(let d=0;d<64;d++){const l=ae(a,6)^ae(a,11)^ae(a,25),p=f+l+lc(a,c,u)+yc[d]+Pe[d]|0,y=(ae(r,2)^ae(r,13)^ae(r,22))+hc(r,i,s)|0;f=u,u=c,c=a,a=o+p|0,o=s,s=i,i=r,r=p+y|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(r,i,s,o,a,c,u,f)}roundClean(){Pe.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const mc=Xi(()=>new gc),bc="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";function q0(e){return e.toLowerCase()===bc}const W0="0x0000000000000000000000000000000000000000";function kt(e){if(!e.client)throw new Error(`getContract validation error - invalid client: ${e.client}`);if(!yr(e.address))throw new Error(`getContract validation error - invalid address: ${e.address}`);if(!e.chain||!e.chain.id)throw new Error(`getContract validation error - invalid chain: ${e.chain}`);return e}function wc(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Z0=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,K0=/^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)?$/,Y0=/^\(.+?\).*?$/,Jr=/^tuple(?<array>(\[(\d*)\])*)$/;function Dn(e){let t=e.type;if(Jr.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let i=0;i<n;i++){const s=e.components[i];t+=Dn(s),i<n-1&&(t+=", ")}const r=wc(Jr,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,Dn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function gt(e){let t="";const n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=Dn(i),r!==n-1&&(t+=", ")}return t}function xc(e){var t;return e.type==="function"?`function ${e.name}(${gt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${gt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${gt(e.inputs)})`:e.type==="error"?`error ${e.name}(${gt(e.inputs)})`:e.type==="constructor"?`constructor(${gt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function it(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new zc(e.type);return`${e.name}(${on(e.inputs,{includeName:t})})`}function on(e,{includeName:t=!1}={}){return e?e.map(n=>$c(n,{includeName:t})).join(t?", ":","):""}function $c(e,{includeName:t}){return e.type.startsWith("tuple")?`(${on(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Tt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function G(e){return Tt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const cs="2.39.0";let Ke={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${cs}`};function X0(e){Ke=e}let S=class Hn extends Error{constructor(t,n={}){var a;const r=(()=>{var c;return n.cause instanceof Hn?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof Hn&&n.cause.docsPath||n.docsPath,s=(a=Ke.getDocsUrl)==null?void 0:a.call(Ke,{...n,docsPath:i}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...Ke.version?[`Version: ${Ke.version}`]:[]].join(`
|
|
4
4
|
`);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=cs}walk(t){return us(this,t)}};function us(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?us(e.cause,t):t?null:e}class J0 extends S{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
5
5
|
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Q0 extends S{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
@@ -23,8 +23,8 @@ import{L as _i,c as at,b as ea,e as zi,w as Oi}from"./utils-DcLg-vXm.js";import{
|
|
|
23
23
|
`),{name:"InvalidArrayError"})}};class zc extends S{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
24
24
|
`),{name:"InvalidDefinitionTypeError"})}}class up extends S{constructor(t){super(`Type "${t}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}class Oc extends S{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class ps extends S{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class ys extends S{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}class fp extends S{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function ft(e,{dir:t,size:n=32}={}){return typeof e=="string"?Se(e,{dir:t,size:n}):Lc(e,{dir:t,size:n})}function Se(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new ys({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Lc(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ys({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const s=t==="right";r[s?i:n-i-1]=e[s?i:e.length-i-1]}return r}class gs extends S{constructor({max:t,min:n,signed:r,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Mc extends S{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class Cc extends S{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class dp extends S{constructor(t){super(`Hex value "${t}" is an odd length (${t.length}). It must be an even length.`,{name:"InvalidHexValueError"})}}class Nc extends S{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Ue(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let i=0;i<n.length-1&&n[t==="left"?i:n.length-i-1].toString()==="0";i++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function re(e,{size:t}){if(G(e)>t)throw new Nc({givenSize:G(e),maxSize:t})}function lp(e,t){const n=typeof t=="string"?{to:t}:t,r=n.to;return r==="number"?Vt(e,n):r==="bigint"?gr(e,n):r==="string"?Rc(e,n):r==="boolean"?Uc(e,n):_t(e,n)}function gr(e,t={}){const{signed:n}=t;t.size&&re(e,{size:t.size});const r=BigInt(e);if(!n)return r;const i=(e.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Uc(e,t={}){let n=e;if(t.size&&(re(n,{size:t.size}),n=Ue(n)),Ue(n)==="0x00")return!1;if(Ue(n)==="0x01")return!0;throw new Cc(n)}function Vt(e,t={}){return Number(gr(e,t))}function Rc(e,t={}){let n=_t(e);return t.size&&(re(n,{size:t.size}),n=Ue(n,{dir:"right"})),new TextDecoder().decode(n)}const kc=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function jc(e,t={}){return typeof e=="number"||typeof e=="bigint"?j(e,t):typeof e=="string"?bs(e,t):typeof e=="boolean"?ms(e,t):le(e,t)}function ms(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(re(n,{size:t.size}),ft(n,{size:t.size})):n}function le(e,t={}){let n="";for(let i=0;i<e.length;i++)n+=kc[e[i]];const r=`0x${n}`;return typeof t.size=="number"?(re(r,{size:t.size}),ft(r,{dir:"right",size:t.size})):r}function j(e,t={}){const{signed:n,size:r}=t,i=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&n?-s-1n:0;if(s&&i>s||i<o){const c=typeof e=="bigint"?"n":"";throw new gs({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&i<0?(1n<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?ft(a,{size:r}):a}const Fc=new TextEncoder;function bs(e,t={}){const n=Fc.encode(e);return le(n,t)}const Dc=new TextEncoder;function an(e,t={}){return typeof e=="number"||typeof e=="bigint"?Vc(e,t):typeof e=="boolean"?Hc(e,t):Tt(e)?_t(e,t):ws(e,t)}function Hc(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(re(n,{size:t.size}),ft(n,{size:t.size})):n}const me={zero:48,nine:57,A:65,F:70,a:97,f:102};function ei(e){if(e>=me.zero&&e<=me.nine)return e-me.zero;if(e>=me.A&&e<=me.F)return e-(me.A-10);if(e>=me.a&&e<=me.f)return e-(me.a-10)}function _t(e,t={}){let n=e;t.size&&(re(n,{size:t.size}),n=ft(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=ei(r.charCodeAt(a++)),u=ei(r.charCodeAt(a++));if(c===void 0||u===void 0)throw new S(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);s[o]=c*16+u}return s}function Vc(e,t){const n=j(e,t);return _t(n)}function ws(e,t={}){const n=Dc.encode(e);return typeof t.size=="number"?(re(n,{size:t.size}),ft(n,{dir:"right",size:t.size})):n}const Ut=BigInt(2**32-1),ti=BigInt(32);function Gc(e,t=!1){return t?{h:Number(e&Ut),l:Number(e>>ti&Ut)}:{h:Number(e>>ti&Ut)|0,l:Number(e&Ut)|0}}function qc(e,t=!1){const n=e.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let s=0;s<n;s++){const{h:o,l:a}=Gc(e[s],t);[r[s],i[s]]=[o,a]}return[r,i]}const Wc=(e,t,n)=>e<<n|t>>>32-n,Zc=(e,t,n)=>t<<n|e>>>32-n,Kc=(e,t,n)=>t<<n-32|e>>>64-n,Yc=(e,t,n)=>e<<n-32|t>>>64-n,Ze=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Xc(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Gt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function vt(e,...t){if(!Xc(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function hp(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Gt(e.outputLen),Gt(e.blockLen)}function ni(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Jc(e,t){vt(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Qc(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function xs(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function pp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function yp(e,t){return e<<32-t|e>>>t}function gp(e,t){return e<<t|e>>>32-t>>>0}const eu=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function tu(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function nu(e){for(let t=0;t<e.length;t++)e[t]=tu(e[t]);return e}const ri=eu?e=>e:nu;function ru(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function $s(e){return typeof e=="string"&&(e=ru(e)),vt(e),e}function mp(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];vt(i),t+=i.length}const n=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const s=e[r];n.set(s,i),i+=s.length}return n}class iu{}function su(e){const t=r=>e().update($s(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function bp(e=32){if(Ze&&typeof Ze.getRandomValues=="function")return Ze.getRandomValues(new Uint8Array(e));if(Ze&&typeof Ze.randomBytes=="function")return Uint8Array.from(Ze.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const ou=BigInt(0),mt=BigInt(1),au=BigInt(2),cu=BigInt(7),uu=BigInt(256),fu=BigInt(113),Es=[],vs=[],As=[];for(let e=0,t=mt,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Es.push(2*(5*r+n)),vs.push((e+1)*(e+2)/2%64);let i=ou;for(let s=0;s<7;s++)t=(t<<mt^(t>>cu)*fu)%uu,t&au&&(i^=mt<<(mt<<BigInt(s))-mt);As.push(i)}const Ps=qc(As,!0),du=Ps[0],lu=Ps[1],ii=(e,t,n)=>n>32?Kc(e,t,n):Wc(e,t,n),si=(e,t,n)=>n>32?Yc(e,t,n):Zc(e,t,n);function hu(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,u=n[c],f=n[c+1],d=ii(u,f,1)^n[a],l=si(u,f,1)^n[a+1];for(let p=0;p<50;p+=10)e[o+p]^=d,e[o+p+1]^=l}let i=e[2],s=e[3];for(let o=0;o<24;o++){const a=vs[o],c=ii(i,s,a),u=si(i,s,a),f=Es[o];i=e[f],s=e[f+1],e[f]=c,e[f+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)n[a]=e[o+a];for(let a=0;a<10;a++)e[o+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=du[r],e[1]^=lu[r]}xs(n)}class mr extends iu{constructor(t,n,r,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=s,Gt(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Qc(this.state)}clone(){return this._cloneInto()}keccak(){ri(this.state32),hu(this.state32,this.rounds),ri(this.state32),this.posOut=0,this.pos=0}update(t){ni(this),t=$s(t),vt(t);const{blockLen:n,state:r}=this,i=t.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);for(let a=0;a<o;a++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:i}=this;t[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){ni(this,!1),vt(t),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,s=t.length;i<s;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,s-i);t.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Gt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Jc(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,xs(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:i,rounds:s,enableXOF:o}=this;return t||(t=new mr(n,r,i,o,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=i,t.enableXOF=o,t.destroyed=this.destroyed,t}}const pu=(e,t,n)=>su(()=>new mr(t,e,n)),yu=pu(1,136,256/8);function cn(e,t){const n=t||"hex",r=yu(Tt(e,{strict:!1})?an(e):e);return n==="bytes"?r:jc(r)}const gu=e=>cn(an(e));function mu(e){return gu(e)}function bu(e){let t=!0,n="",r=0,i="",s=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}i+=a,n+=a}}if(!s)throw new S("Unable to normalize signature.");return i}const wu=e=>{const t=typeof e=="string"?e:xc(e);return bu(t)};function br(e){return mu(wu(e))}const un=br;let qt=class extends S{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},Is=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const In=new Is(8192);function wr(e,t){if(In.has(`${e}.${t}`))return In.get(`${e}.${t}`);const n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=cn(ws(n),"bytes"),i=(t?n.substring(`${t}0x`.length):n).split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return In.set(`${e}.${t}`,s),s}function $p(e,t){if(!Re(e,{strict:!1}))throw new qt({address:e});return wr(e,t)}const xu=/^0x[a-fA-F0-9]{40}$/,Bn=new Is(8192);function Re(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Bn.has(r))return Bn.get(r);const i=xu.test(e)?e.toLowerCase()===e?!0:n?wr(e)===e:!0:!1;return Bn.set(r,i),i}function st(e){return typeof e[0]=="string"?Eu(e):$u(e)}function $u(e){let t=0;for(const i of e)t+=i.length;const n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}function Eu(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Wt(e,t,n,{strict:r}={}){return Tt(e,{strict:!1})?vu(e,t,n,{strict:r}):Ts(e,t,n,{strict:r})}function Bs(e,t){if(typeof t=="number"&&t>0&&t>G(e)-1)throw new ps({offset:t,position:"start",size:G(e)})}function Ss(e,t,n){if(typeof t=="number"&&typeof n=="number"&&G(e)!==n-t)throw new ps({offset:n,position:"end",size:G(e)})}function Ts(e,t,n,{strict:r}={}){Bs(e,t);const i=e.slice(t,n);return r&&Ss(i,t,n),i}function vu(e,t,n,{strict:r}={}){Bs(e,t);const i=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Ss(i,t,n),i}const Ep=/^(.*)\[([0-9]*)\]$/,vp=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Au=/^(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)?$/;function Pu(e,t){if(e.length!==t.length)throw new Ac({expectedLength:e.length,givenLength:t.length});const n=Iu({params:e,values:t}),r=$r(n);return r.length===0?"0x":r}function Iu({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(xr({param:e[r],value:t[r]}));return n}function xr({param:e,value:t}){const n=Er(e.type);if(n){const[r,i]=n;return Su(t,{length:r,param:{...e,type:i}})}if(e.type==="tuple")return Lu(t,{param:e});if(e.type==="address")return Bu(t);if(e.type==="bool")return _u(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,i="256"]=Au.exec(e.type)??[];return zu(t,{signed:r,size:Number(i)})}if(e.type.startsWith("bytes"))return Tu(t,{param:e});if(e.type==="string")return Ou(t);throw new Sc(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function $r(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?t+=32:t+=G(a)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push(j(t+i,{size:32})),r.push(a),i+=G(a)):n.push(a)}return st([...n,...r])}function Bu(e){if(!Re(e))throw new qt({address:e});return{dynamic:!1,encoded:Se(e.toLowerCase())}}function Su(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new _c(e);if(!r&&e.length!==t)throw new Ec({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let i=!1;const s=[];for(let o=0;o<e.length;o++){const a=xr({param:n,value:e[o]});a.dynamic&&(i=!0),s.push(a)}if(r||i){const o=$r(s);if(r){const a=j(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?st([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:st(s.map(({encoded:o})=>o))}}function Tu(e,{param:t}){const[,n]=t.type.split("bytes"),r=G(e);if(!n){let i=e;return r%32!==0&&(i=Se(i,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:st([Se(j(r,{size:32})),i])}}if(r!==Number.parseInt(n,10))throw new vc({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Se(e,{dir:"right"})}}function _u(e){if(typeof e!="boolean")throw new S(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Se(ms(e))}}function zu(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,i=t?-r-1n:0n;if(e>r||e<i)throw new gs({max:r.toString(),min:i.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:j(e,{size:32,signed:t})}}function Ou(e){const t=bs(e),n=Math.ceil(G(t)/32),r=[];for(let i=0;i<n;i++)r.push(Se(Wt(t,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:st([Se(j(G(t),{size:32})),...r])}}function Lu(e,{param:t}){let n=!1;const r=[];for(let i=0;i<t.components.length;i++){const s=t.components[i],o=Array.isArray(e)?i:s.name,a=xr({param:s,value:e[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?$r(r):st(r.map(({encoded:i})=>i))}}function Er(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const vr=e=>Wt(br(e),0,4);function Mu(e){const{abi:t,args:n=[],name:r}=e,i=Tt(r,{strict:!1}),s=t.filter(a=>i?a.type==="function"?vr(a)===r:a.type==="event"?un(a)===r:!1:"name"in a&&a.name===r);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((u,f)=>{const d="inputs"in a&&a.inputs[f];return d?Gn(u,d):!1})){if(o&&"inputs"in o&&o.inputs){const u=_s(a.inputs,o.inputs,n);if(u)throw new Bc({abiItem:a,type:u[0]},{abiItem:o,type:u[1]})}o=a}}return o||s[0]}function Gn(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Re(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((i,s)=>Gn(Object.values(e)[s],i)):/^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)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(i=>Gn(i,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _s(e,t,n){for(const r in e){const i=e[r],s=t[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return _s(i.components,s.components,n[r]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Re(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?Re(n[r],{strict:!1}):!1)return o}}const oi="/docs/contract/encodeEventTopics";function Cu(e){var c;const{abi:t,eventName:n,args:r}=e;let i=t[0];if(n){const u=Mu({abi:t,name:n});if(!u)throw new Qr(n,{docsPath:oi});i=u}if(i.type!=="event")throw new Qr(void 0,{docsPath:oi});const s=it(i),o=un(s);let a=[];if(r&&"inputs"in i){const u=(c=i.inputs)==null?void 0:c.filter(d=>"indexed"in d&&d.indexed),f=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(d=>r[d.name]))??[]:[];f.length>0&&(a=(u==null?void 0:u.map((d,l)=>Array.isArray(f[l])?f[l].map((p,m)=>ai({param:d,value:f[l][m]})):typeof f[l]<"u"&&f[l]!==null?ai({param:d,value:f[l]}):null))??[])}return[o,...a]}function ai({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return cn(an(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Oc(e.type);return Pu([e],[t])}const Ap={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Nu={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Uu={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let ci=class extends S{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},zs=class extends S{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},Ru=class extends S{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const ku={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Ru({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new zs({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new ci({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new ci({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function ju(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(ku);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function Sp(e,t){const n=typeof t=="string"?{to:t}:t,r=n.to;return r==="number"?ue(e,n):r==="bigint"?Os(e,n):r==="boolean"?Ls(e,n):r==="string"?Ms(e,n):le(e,n)}function Os(e,t={}){typeof t.size<"u"&&re(e,{size:t.size});const n=le(e,t);return gr(n,t)}function Ls(e,t={}){let n=e;if(typeof t.size<"u"&&(re(n,{size:t.size}),n=Ue(n)),n.length>1||n[0]>1)throw new Mc(n);return!!n[0]}function ue(e,t={}){typeof t.size<"u"&&re(e,{size:t.size});const n=le(e,t);return Vt(n,t)}function Ms(e,t={}){let n=e;return typeof t.size<"u"&&(re(n,{size:t.size}),n=Ue(n,{dir:"right"})),new TextDecoder().decode(n)}function fn(e,t){const n=typeof t=="string"?_t(t):t,r=ju(n);if(G(n)===0&&e.length>0)throw new ds;if(G(t)&&G(t)<32)throw new fs({data:typeof t=="string"?t:le(t),params:e,size:G(t)});let i=0;const s=[];for(let o=0;o<e.length;++o){const a=e[o];r.setPosition(i);const[c,u]=et(r,a,{staticPosition:0});i+=u,s.push(c)}return s}function et(e,t,{staticPosition:n}){const r=Er(t.type);if(r){const[i,s]=r;return Du(e,{...t,type:s},{length:i,staticPosition:n})}if(t.type==="tuple")return qu(e,t,{staticPosition:n});if(t.type==="address")return Fu(e);if(t.type==="bool")return Hu(e);if(t.type.startsWith("bytes"))return Vu(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Gu(e,t);if(t.type==="string")return Wu(e,{staticPosition:n});throw new Tc(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ui=32,qn=32;function Fu(e){const t=e.readBytes(32);return[wr(le(Ts(t,-20))),32]}function Du(e,t,{length:n,staticPosition:r}){if(!n){const o=ue(e.readBytes(qn)),a=r+o,c=a+ui;e.setPosition(a);const u=ue(e.readBytes(ui)),f=At(t);let d=0;const l=[];for(let p=0;p<u;++p){e.setPosition(c+(f?p*32:d));const[m,y]=et(e,t,{staticPosition:c});d+=y,l.push(m)}return e.setPosition(r+32),[l,32]}if(At(t)){const o=ue(e.readBytes(qn)),a=r+o,c=[];for(let u=0;u<n;++u){e.setPosition(a+u*32);const[f]=et(e,t,{staticPosition:a});c.push(f)}return e.setPosition(r+32),[c,32]}let i=0;const s=[];for(let o=0;o<n;++o){const[a,c]=et(e,t,{staticPosition:r+i});i+=c,s.push(a)}return[s,i]}function Hu(e){return[Ls(e.readBytes(32),{size:32}),32]}function Vu(e,t,{staticPosition:n}){const[r,i]=t.type.split("bytes");if(!i){const o=ue(e.readBytes(32));e.setPosition(n+o);const a=ue(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[le(c),32]}return[le(e.readBytes(Number.parseInt(i,10),32)),32]}function Gu(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),i=e.readBytes(32);return[r>48?Os(i,{signed:n}):ue(i,{signed:n}),32]}function qu(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:o})=>!o),i=r?[]:{};let s=0;if(At(t)){const o=ue(e.readBytes(qn)),a=n+o;for(let c=0;c<t.components.length;++c){const u=t.components[c];e.setPosition(a+s);const[f,d]=et(e,u,{staticPosition:a});s+=d,i[r?c:u==null?void 0:u.name]=f}return e.setPosition(n+32),[i,32]}for(let o=0;o<t.components.length;++o){const a=t.components[o],[c,u]=et(e,a,{staticPosition:n});i[r?o:a==null?void 0:a.name]=c,s+=u}return[i,s]}function Wu(e,{staticPosition:t}){const n=ue(e.readBytes(32)),r=t+n;e.setPosition(r);const i=ue(e.readBytes(32));if(i===0)return e.setPosition(t+32),["",32];const s=e.readBytes(i,32),o=Ms(Ue(s));return e.setPosition(t+32),[o,32]}function At(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(At);const n=Er(e.type);return!!(n&&At({...e,type:n[1]}))}function Zu(e){const{abi:t,data:n}=e,r=Wt(n,0,4);if(r==="0x")throw new ds;const s=[...t||[],Nu,Uu].find(o=>o.type==="error"&&r===vr(it(o)));if(!s)throw new Pc(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?fn(s.inputs,Wt(n,4)):void 0,errorName:s.name}}const Ku=(e,t,n)=>JSON.stringify(e,(r,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof t=="function"?t(r,s):s},n);function Ar(e,t){return({exclude:n,format:r})=>({exclude:n,format:(i,s)=>{const o=t(i,s);if(n)for(const a of n)delete o[a];return{...o,...r(i,s)}},type:e})}const Yu={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Cs(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Xu(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>le(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=j(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=j(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=j(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=j(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=j(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=j(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Yu[e.type]),typeof e.value<"u"&&(n.value=j(e.value)),n}const Tp=Ar("transactionRequest",Cs);function Xu(e){return e.map(t=>({address:t.address,r:t.r?j(BigInt(t.r)):t.r,s:t.s?j(BigInt(t.s)):t.s,chainId:j(t.chainId),nonce:j(t.nonce),...typeof t.yParity<"u"?{yParity:j(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:j(t.v)}:{}}))}const Ju={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Ns(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?Vt(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?Vt(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ju[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Qu(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const _p=Ar("transaction",Ns);function Qu(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Us(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Ns(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const zp=Ar("block",Us);function ef(e,t){if(!Re(e,{strict:!1}))throw new qt({address:e});if(!Re(t,{strict:!1}))throw new qt({address:t});return e.toLowerCase()===t.toLowerCase()}const fi="/docs/contract/decodeEventLog";function tf(e){const{abi:t,data:n,strict:r,topics:i}=e,s=r??!0,[o,...a]=i;if(!o)throw new Ic({docsPath:fi});const c=t.find(y=>y.type==="event"&&o===un(it(y)));if(!(c&&"name"in c)||c.type!=="event")throw new ls(o,{docsPath:fi});const{name:u,inputs:f}=c,d=f==null?void 0:f.some(y=>!("name"in y&&y.name)),l=d?[]:{},p=f.map((y,h)=>[y,h]).filter(([y])=>"indexed"in y&&y.indexed);for(let y=0;y<p.length;y++){const[h,g]=p[y],b=a[y];if(!b)throw new hs({abiItem:c,param:h});l[d?g:h.name||g]=nf({param:h,value:b})}const m=f.filter(y=>!("indexed"in y&&y.indexed));if(m.length>0){if(n&&n!=="0x")try{const y=fn(m,n);if(y)if(d)for(let h=0;h<f.length;h++)l[h]=l[h]??y.shift();else for(let h=0;h<m.length;h++)l[m[h].name]=y[h]}catch(y){if(s)throw y instanceof fs||y instanceof zs?new Vn({abiItem:c,data:n,params:m,size:G(n)}):y}else if(s)throw new Vn({abiItem:c,data:"0x",params:m,size:0})}return{eventName:u,args:Object.values(l).length>0?l:void 0}}function nf({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(fn([e],t)||[])[0]}function rf(e){const{abi:t,args:n,logs:r,strict:i=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return r.map(o=>{var a;try{const c=t.find(f=>f.type==="event"&&o.topics[0]===un(f));if(!c)return null;const u=tf({...o,abi:[c],strict:i});return s&&!s.includes(u.eventName)||!sf({args:u.args,inputs:c.inputs,matchArgs:n})?null:{...u,...o}}catch(c){let u,f;if(c instanceof ls)return null;if(c instanceof Vn||c instanceof hs){if(i)return null;u=c.abiItem.name,f=(a=c.abiItem.inputs)==null?void 0:a.some(d=>!("name"in d&&d.name))}return{...o,args:f?[]:{},eventName:u}}}).filter(Boolean)}function sf(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function i(s,o,a){try{return s.type==="address"?ef(o,a):s.type==="string"||s.type==="bytes"?cn(an(o))===a:o===a}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,o)=>{if(s==null)return!0;const a=n[o];return a?(Array.isArray(s)?s:[s]).some(u=>i(a,u,t[o])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,o])=>{if(o==null)return!0;const a=n.find(u=>u.name===s);return a?(Array.isArray(o)?o:[o]).some(u=>i(a,u,t[s])):!1}):!1}function of(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}const Sn=new WeakMap;async function dn(e){if(Sn.has(e))return Sn.get(e);const t=(async()=>{const[n,r,{concatHex:i}]=await Promise.all([Rs(e),ks(e),F(()=>Promise.resolve().then(()=>a0),void 0)]);return r?i([n,r]):n})();return Sn.set(e,t),t}async function Rs(e){if(e.data===void 0)return"0x";if(typeof e.data=="function"){const t=await e.data();return t||"0x"}return e.data}async function ks(e){if(e.extraCallData){if(typeof e.extraCallData=="function"){const t=await e.extraCallData();if(!t)return;if(!t.startsWith("0x"))throw Error("Invalid extra calldata - must be a hex string");return t==="0x"?void 0:t}if(!e.extraCallData.startsWith("0x"))throw Error("Invalid extra calldata - must be a hex string");return e.extraCallData}}const af=Object.freeze(Object.defineProperty({__proto__:null,encode:dn,getDataFromTx:Rs,getExtraCallDataFromTx:ks},Symbol.toStringTag,{value:"Module"}));async function cf(e,t){const n=t.blockTag??"latest",r=t.includeTransactions??!1,i=t.blockNumber!==void 0?de(t.blockNumber):void 0,s=await e({method:"eth_getBlockByNumber",params:[i||n,r]});if(!s)throw new Error("Block not found");return Us(s)}async function uf(e){const t=await e({method:"eth_maxPriorityFeePerGas"});return rn(t)}async function ff(e,t,n){var i,s,o,a,c,u,f,d,l;const r=await at(t)(e,{body:fe(n.requests),headers:{...(o=(s=(i=t.config)==null?void 0:i.rpc)==null?void 0:s.fetch)==null?void 0:o.headers,"Content-Type":"application/json"},keepalive:(u=(c=(a=t.config)==null?void 0:a.rpc)==null?void 0:c.fetch)==null?void 0:u.keepalive,method:"POST",requestTimeoutMs:n.requestTimeoutMs??((l=(d=(f=t.config)==null?void 0:f.rpc)==null?void 0:d.fetch)==null?void 0:l.requestTimeoutMs)});if(!r.ok){const p=await r.text().catch(()=>null);throw new Error(`RPC request failed with status ${r.status} - ${r.statusText}: ${p||"unknown error"}`)}return await r.json()}async function df(e,t,n){var i,s,o,a,c,u,f,d,l;const r=await at(t)(e,{body:fe(n.request),headers:{...((o=(s=(i=t.config)==null?void 0:i.rpc)==null?void 0:s.fetch)==null?void 0:o.headers)||{},"Content-Type":"application/json"},keepalive:(u=(c=(a=t.config)==null?void 0:a.rpc)==null?void 0:c.fetch)==null?void 0:u.keepalive,method:"POST",requestTimeoutMs:n.requestTimeoutMs??((l=(d=(f=t.config)==null?void 0:f.rpc)==null?void 0:d.fetch)==null?void 0:l.requestTimeoutMs)});if(!r.ok){const p=await r.text().catch(()=>null);throw new Error(`RPC request failed with status ${r.status} - ${r.statusText}: ${p||"unknown error"}`)}return await r.json()}const Tn=new WeakMap;function lf(e){if(Tn.has(e))return Tn.get(e);const t=new Map;return Tn.set(e,t),t}function hf(e){return`${e.method}:${fe(e.params)}`}const pf=100,yf=0;function De(e){const t=lf(e.client),n=e.chain.rpc;if(t.has(n))return t.get(n);const r=(()=>{var d,l,p,m,y,h;const i=ea({chain:e.chain,client:e.client}),s=((d=e.config)==null?void 0:d.maxBatchSize)??((p=(l=e.client.config)==null?void 0:l.rpc)==null?void 0:p.maxBatchSize)??pf,o=((m=e.config)==null?void 0:m.batchTimeoutMs)??((h=(y=e.client.config)==null?void 0:y.rpc)==null?void 0:h.batchTimeoutMs)??yf,a=new Map;let c=[],u=null;function f(){var x;u&&(clearTimeout(u),u=null);const g=new Array(c.length),b=c.slice().map((v,B)=>(v.request.id=B,v.request.jsonrpc="2.0",g[B]=v.request,v));c=[],ff(i,e.client,{requests:g,requestTimeoutMs:(x=e.config)==null?void 0:x.requestTimeoutMs}).then(v=>{b.forEach((B,_)=>{const A=v[_];A?A instanceof Error?B.reject(A):"error"in A?B.reject(A.error):typeof A=="string"?B.reject(new Error(A)):A.method==="eth_subscription"?B.reject("Subscriptions not supported yet"):B.resolve(A.result):B.reject(new Error(`RPC Error from ${i}:
|
|
25
25
|
requests: ${fe(g)}
|
|
26
|
-
responses: ${fe(v)}`))})}).catch(v=>{for(const B of b)B.reject(v)}).finally(()=>{a.clear()})}return s===1?async g=>{var x;g.id=1,g.jsonrpc="2.0";const b=await df(i,e.client,{request:g,requestTimeoutMs:(x=e.config)==null?void 0:x.requestTimeoutMs});if(!b)throw new Error("No response");if("error"in b)throw b.error;return b.result}:async g=>{const b=hf(g);if(a.has(b))return a.get(b);let x,v;const B=new Promise((_,A)=>{x=_,v=A});return a.set(b,B),c.push({reject:v,request:g,requestKey:b,resolve:x}),s>1?(u||(u=setTimeout(f,o)),c.length>=s&&f()):f(),B}})();return t.set(n,r),r}const gf=Object.freeze(Object.defineProperty({__proto__:null,getRpcClient:De},Symbol.toStringTag,{value:"Module"}));async function q(e){return typeof e=="function"?await e():e}function js(e,t){const n=e.toString(),r=n[0]==="-"?"-":"",s=(r?n.slice(1):n).padStart(t+1,"0"),o=s.length-t,a=s.slice(0,o)||"0";let c=s.slice(o);for(let u=c.length-1;u>=0;u--){if(c[u]!=="0"){c=c.slice(0,u+1);break}u===0&&(c="")}return`${r}${a}${c?`.${c}`:""}`}function mf(e){return js(e,18)}function ln(e,t){e.includes("e")&&(e=Number(e).toFixed(t));let[n,r=""]=e.split(".");const i=n.startsWith("-")?"-":"";if(i&&(n=n.slice(1)),r=r.padEnd(t,"0"),t===0)r[0]&&Number.parseInt(r[0])>=5&&(n=(BigInt(n)+1n).toString()),r="";else if(r.length>t){const s=r[t];s&&Number.parseInt(s,10)>=5?(r=(BigInt(r.substring(0,t))+1n).toString().padStart(t,"0"),r.length>t&&(n=(BigInt(n)+1n).toString(),r=r.substring(r.length-t))):r=r.substring(0,t)}return BigInt(`${i}${n}${r}`)}function bf(e){return ln(e,18)}function wf(e){return ln(e,9)}const Op=Object.freeze(Object.defineProperty({__proto__:null,fromGwei:wf,toEther:mf,toTokens:js,toUnits:ln,toWei:bf},Symbol.toStringTag,{value:"Module"}));async function xf(e){const t=await e({method:"eth_gasPrice"});return rn(t)}async function di(e){const{client:t,chain:n,percentMultiplier:r}=e,i=De({chain:n,client:t}),s=await xf(i),o=r?s/BigInt(100)*BigInt(r):0n;return s+o}function bt(e){if(e===0n||(e&e-1n)===0n)return e;let t=1n;for(;e>0n;)e>>=1n,t<<=1n;return t}const $f=[78600,2040,248,9372,841,842,2016,9768,2442,1942999413,1952959480,994873017,19011,40875,1511670449,5464,2020,2021,98866,1417429182];async function Fs(e){var o;const[t,n,r,i]=await Promise.all([q(e.maxFeePerGas),q(e.maxPriorityFeePerGas),q(e.gasPrice),q(e.type)]);if(t!==void 0&&n!==void 0)return{maxFeePerGas:t,maxPriorityFeePerGas:n};if(typeof r=="bigint")return{gasPrice:r};const s=await Ds(e.client,e.chain,i==="legacy"?"legacy":"eip1559");return(o=e.chain.experimental)!=null&&o.increaseZeroByteCount?s.gasPrice?{gasPrice:bt(s.gasPrice)}:{maxFeePerGas:t??bt(s.maxFeePerGas??0n),maxPriorityFeePerGas:n??bt(s.maxPriorityFeePerGas??0n)}:s.gasPrice!==void 0?s:{maxFeePerGas:t??s.maxFeePerGas,maxPriorityFeePerGas:n??s.maxPriorityFeePerGas}}async function Ds(e,t,n){if((n??t.feeType)==="legacy"||$f.includes(t.id))return{gasPrice:await di({chain:t,client:e,percentMultiplier:10})};const i=await Ef(e,t);return i.maxFeePerGas!==null&&i.maxPriorityFeePerGas!==null?{maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}:{gasPrice:await di({chain:t,client:e,percentMultiplier:10})}}async function Ef(e,t,n=10){let r=null,i=null;const s=De({chain:t,client:e}),[o,a]=await Promise.all([cf(s,{blockTag:"latest"}),uf(s).catch(()=>null)]),c=o==null?void 0:o.baseFeePerGas,u=t.id;return u===220||u===1220?{maxFeePerGas:null,maxPriorityFeePerGas:null}:(u===80002||u===137?i=await If(u):a!==null&&(i=a),i==null||c==null?{maxFeePerGas:null,maxPriorityFeePerGas:null}:(i=vf(i,n),r=c*2n+i,(u===42220||u===44787||u===62320)&&(i=r),{maxFeePerGas:r,maxPriorityFeePerGas:i}))}function vf(e,t=10){const n=e/BigInt(100)*BigInt(t);return e+n}function Af(e){switch(e){case 137:return"https://gasstation.polygon.technology/v2";case 80002:return"https://gasstation.polygon.technology/amoy"}}const Pf=31n;async function If(e){const t=Af(e);try{const r=(await(await fetch(t)).json()).fast.maxPriorityFee;if(r>0){const i=Number.parseFloat(r).toFixed(9);return ln(i,9)}}catch(n){console.error("failed to fetch gas",n)}return Pf}const Lp=Object.freeze(Object.defineProperty({__proto__:null,getDefaultGasOverrides:Ds,getGasOverridesForTransaction:Fs},Symbol.toStringTag,{value:"Module"}));async function Hs(e){if(e.id===1337||e.id===31337)return!1;if(e.id===324||e.id===300||e.id===302||e.id===11124||e.id===282||e.id===388||e.id===4654||e.id===333271||e.id===37111||e.id===978658||e.id===531050104||e.id===4457845||e.id===2741||e.id===240||e.id===555271||e.id===61166||e.id===555272)return!0;try{const{getChainMetadata:t}=await F(async()=>{const{getChainMetadata:r}=await import("./utils-
|
|
27
|
-
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=t}}function Ee(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Gs=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,qs=/^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)?$/,Ws=/^\(.+?\).*?$/,li=/^tuple(?<array>(\[(\d*)\])*)$/;function Wn(e){let t=e.type;if(li.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let i=0;i<n;i++){const s=e.components[i];t+=Wn(s),i<n-1&&(t+=", ")}const r=Ee(li,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,Wn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Ye(e){let t="";const n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=Wn(i),r!==n-1&&(t+=", ")}return t}function Zt(e){var t;return e.type==="function"?`function ${e.name}(${Ye(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Ye(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Ye(e.inputs)})`:e.type==="error"?`error ${e.name}(${Ye(e.inputs)})`:e.type==="constructor"?`constructor(${Ye(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Of(e){const t=[],n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Zt(i);t.push(s)}return t}const Zs=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Lf(e){return Zs.test(e)}function Mf(e){return Ee(Zs,e)}const Ks=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Cf(e){return Ks.test(e)}function Nf(e){return Ee(Ks,e)}const Ys=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Uf(e){return Ys.test(e)}function Rf(e){return Ee(Ys,e)}const Xs=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Pr(e){return Xs.test(e)}function kf(e){return Ee(Xs,e)}const Js=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function jf(e){return Js.test(e)}function Ff(e){return Ee(Js,e)}const Qs=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Df(e){return Qs.test(e)}function Hf(e){return Ee(Qs,e)}const Vf=/^receive\(\) external payable$/;function Gf(e){return Vf.test(e)}const qf=new Set(["indexed"]),Zn=new Set(["calldata","memory","storage"]);class Wf extends W{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Zf extends W{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Kf extends W{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Yf extends W{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Xf extends W{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Jf extends W{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Qf extends W{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class ed extends W{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class dt extends W{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class td extends W{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class nd extends W{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class rd extends W{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class id extends W{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function sd(e,t,n){let r="";if(n)for(const i of Object.entries(n)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${i[0]}{${s}})`}return t?`${t}:${e}${r}`:e}const _n=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Kn(e,t={}){if(Uf(e))return od(e,t);if(Cf(e))return ad(e,t);if(Lf(e))return cd(e,t);if(jf(e))return ud(e,t);if(Df(e))return fd(e);if(Gf(e))return{type:"receive",stateMutability:"payable"};throw new td({signature:e})}function od(e,t={}){const n=Rf(e);if(!n)throw new dt({signature:e,type:"function"});const r=oe(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(ke(r[a],{modifiers:Zn,structs:t,type:"function"}));const o=[];if(n.returns){const a=oe(n.returns),c=a.length;for(let u=0;u<c;u++)o.push(ke(a[u],{modifiers:Zn,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:i,outputs:o}}function ad(e,t={}){const n=Nf(e);if(!n)throw new dt({signature:e,type:"event"});const r=oe(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(ke(r[o],{modifiers:qf,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:i}}function cd(e,t={}){const n=Mf(e);if(!n)throw new dt({signature:e,type:"error"});const r=oe(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(ke(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:i}}function ud(e,t={}){const n=Ff(e);if(!n)throw new dt({signature:e,type:"constructor"});const r=oe(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(ke(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:i}}function fd(e){const t=Hf(e);if(!t)throw new dt({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const dd=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ld=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,hd=/^u?int$/;function ke(e,t){var d,l;const n=sd(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(_n.has(n))return _n.get(n);const r=Ws.test(e),i=Ee(r?ld:dd,e);if(!i)throw new Yf({param:e});if(i.name&&yd(i.name))throw new Xf({param:e,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const p=oe(i.type),m=[],y=p.length;for(let h=0;h<y;h++)m.push(ke(p[h],{structs:a}));u={components:m}}else if(i.type in a)c="tuple",u={components:a[i.type]};else if(hd.test(i.type))c=`${i.type}256`;else if(c=i.type,(t==null?void 0:t.type)!=="struct"&&!eo(c))throw new Kf({type:c});if(i.modifier){if(!((l=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&l.call(d,i.modifier)))throw new Jf({param:e,type:t==null?void 0:t.type,modifier:i.modifier});if(Zn.has(i.modifier)&&!gd(c,!!i.array))throw new Qf({param:e,type:t==null?void 0:t.type,modifier:i.modifier})}const f={type:`${c}${i.array??""}`,...s,...o,...u};return _n.set(n,f),f}function oe(e,t=[],n="",r=0){const i=e.trim().length;for(let s=0;s<i;s++){const o=e[s],a=e.slice(s+1);switch(o){case",":return r===0?oe(a,[...t,n.trim()]):oe(a,t,`${n}${o}`,r);case"(":return oe(a,t,`${n}${o}`,r+1);case")":return oe(a,t,`${n}${o}`,r-1);default:return oe(a,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new id({current:n,depth:r});return t.push(n.trim()),t}function eo(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Gs.test(e)||qs.test(e)}const pd=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function yd(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Gs.test(e)||qs.test(e)||pd.test(e)}function gd(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function to(e){const t={},n=e.length;for(let o=0;o<n;o++){const a=e[o];if(!Pr(a))continue;const c=kf(a);if(!c)throw new dt({signature:a,type:"struct"});const u=c.properties.split(";"),f=[],d=u.length;for(let l=0;l<d;l++){const m=u[l].trim();if(!m)continue;const y=ke(m,{type:"struct"});f.push(y)}if(!f.length)throw new nd({signature:a});t[c.name]=f}const r={},i=Object.entries(t),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];r[a]=no(c,t)}return r}const md=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function no(e,t,n=new Set){const r=[],i=e.length;for(let s=0;s<i;s++){const o=e[s];if(Ws.test(o.type))r.push(o);else{const c=Ee(md,o.type);if(!(c!=null&&c.type))throw new ed({abiParameter:o});const{array:u,type:f}=c;if(f in t){if(n.has(f))throw new rd({type:f});r.push({...o,type:`tuple${u??""}`,components:no(t[f]??[],t,new Set([...n,f]))})}else if(eo(f))r.push(o);else throw new Zf({type:f})}}return r}function ro(e){const t=to(e),n=[],r=e.length;for(let i=0;i<r;i++){const s=e[i];Pr(s)||n.push(Kn(s,t))}return n}function ot(e){let t;if(typeof e=="string")t=Kn(e);else{const n=to(e),r=e.length;for(let i=0;i<r;i++){const s=e[i];if(!Pr(s)){t=Kn(s,n);break}}}if(!t)throw new Wf({signature:e});return t}const bd=of({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),wd="https://{clientId}.ipfscdn.io/ipfs/{cid}";function xd(e){var t,n;if(e.uri.startsWith("ipfs://")){const r=((n=(t=e.client.config)==null?void 0:t.storage)==null?void 0:n.gatewayUrl)??wd,i=e.client.clientId,s=$d(e.uri);let o;return typeof globalThis<"u"&&"Application"in globalThis&&(o=globalThis.Application.applicationId),`${r.replace("{clientId}",i).split("/ipfs")[0]}/ipfs/${s}${o?`?bundleId=${o}`:""}`}if(e.uri.startsWith("http"))return e.uri;throw new Error('Invalid URI scheme, expected "ipfs://" or "http(s)://"')}function $d(e){if(!e.startsWith("ipfs://"))return e;const t=e.search(/\/(Qm|baf)/i);return e.slice(t+1)}async function io(e){var r,i,s,o,a,c,u,f,d;let t;if(e.uri.startsWith("ar://")){const{resolveArweaveScheme:l}=await F(async()=>{const{resolveArweaveScheme:p}=await import("./arweave-CAGvOb64.js");return{resolveArweaveScheme:p}},[]);t=l(e)}else t=xd(e);const n=await at(e.client)(t,{headers:(s=(i=(r=e.client.config)==null?void 0:r.storage)==null?void 0:i.fetch)==null?void 0:s.headers,keepalive:(c=(a=(o=e.client.config)==null?void 0:o.storage)==null?void 0:a.fetch)==null?void 0:c.keepalive,requestTimeoutMs:e.requestTimeoutMs??((d=(f=(u=e.client.config)==null?void 0:u.storage)==null?void 0:f.fetch)==null?void 0:d.requestTimeoutMs)??6e4});if(!n.ok){const l=await n.text();throw new Error(`Failed to download file: ${n.status} ${n.statusText} ${l||""}`)}return n}const Cp=Object.freeze(Object.defineProperty({__proto__:null,download:io},Symbol.toStringTag,{value:"Module"}));function Ed(e,t="https://contract.thirdweb.com/abi"){return Oi(async()=>{if(e.abi)return e.abi;if(e.chain.id===31337||e.chain.id===1337||e.chain.id===bd.id)return await hi(e);try{return await vd(e,t)}catch{return await hi(e)}},{cacheKey:`${e.chain.id}-${e.address}`,cacheTime:1e3*60*60*1})}async function vd(e,t="https://contract.thirdweb.com/abi"){const r=await(await at(e.client)(`${t}/${e.chain.id}/${e.address}`)).json();if(!r||r.error)throw new Error(`Failed to resolve ABI from contract API. ${r.error||""}`);return r}async function so(e){const[{resolveImplementation:t},{extractIPFSUri:n}]=await Promise.all([F(()=>import("./resolveImplementation-DDsaIAFL.js"),__vite__mapDeps([3,4,0,1,2])),F(()=>import("./extractIPFS-uIQNCz58.js"),__vite__mapDeps([5,0,1,2]))]),{bytecode:r}=await t(e);if(r==="0x"){const{id:s,name:o}=e.chain;throw new Error(`Failed to load contract bytecode. Make sure the contract [${e.address}] exists on the chain [${o||"Unknown Chain"} (chain id: ${s})]`)}const i=n(r);if(!i)return[];try{return(await(await io({client:e.client,uri:i})).json()).output.abi}catch{return[]}}const Ad={inputs:[],name:"getAllPlugins",outputs:[{components:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"},{internalType:"string",name:"functionSignature",type:"string"},{internalType:"address",name:"pluginAddress",type:"address"}],internalType:"struct IPluginMap.Plugin[]",name:"registered",type:"tuple[]"}],stateMutability:"view",type:"function"},Pd={inputs:[],name:"getAllExtensions",outputs:[{components:[{components:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"metadataURI",type:"string"},{internalType:"address",name:"implementation",type:"address"}],internalType:"struct IExtension.ExtensionMetadata",name:"metadata",type:"tuple"},{components:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"},{internalType:"string",name:"functionSignature",type:"string"}],internalType:"struct IExtension.ExtensionFunction[]",name:"functions",type:"tuple[]"}],internalType:"struct IExtension.Extension[]",name:"allExtensions",type:"tuple[]"}],stateMutability:"view",type:"function"},Id={inputs:[],name:"facets",outputs:[{components:[{internalType:"address",name:"facetAddress",type:"address"},{internalType:"bytes4[]",name:"functionSelectors",type:"bytes4[]"}],type:"tuple[]"}],stateMutability:"view",type:"function"};async function hi(e,t,n){const[r,i,s,o,a]=await Promise.all([so(e),Bd(e),Sd(e),Td(e),_d(e)]),c=[...new Set([...i,...s,...o,...a])];if(!c.length)return r;const u=await zd({contract:e,plugins:c,resolveSubAbi:n});return Od({pluginAbis:u,rootAbi:r})}async function Bd(e){try{const{readContract:t}=await F(async()=>{const{readContract:r}=await Promise.resolve().then(()=>Rr);return{readContract:r}},void 0),n=await t({contract:e,method:Ad});return n.length?[...new Set(n.map(r=>r.pluginAddress))]:[]}catch{}return[]}async function Sd(e){try{const{readContract:t}=await F(async()=>{const{readContract:r}=await Promise.resolve().then(()=>Rr);return{readContract:r}},void 0),n=await t({contract:e,method:Pd});return n.length?[...new Set(n.map(r=>r.metadata.implementation))]:[]}catch{}return[]}async function Td(e){try{const{getInstalledModules:t}=await F(async()=>{const{getInstalledModules:r}=await import("./getInstalledModules-6mBUE3YV.js");return{getInstalledModules:r}},__vite__mapDeps([6,0,1,2])),n=await t({contract:e});return n.length?[...new Set(n.map(r=>r.implementation))]:[]}catch{}return[]}async function _d(e){try{const{readContract:t}=await F(async()=>{const{readContract:r}=await Promise.resolve().then(()=>Rr);return{readContract:r}},void 0),n=await t({contract:e,method:Id});return n.length?n.map(r=>r.facetAddress):[]}catch{}return[]}async function zd(e){return Promise.all(e.plugins.map(t=>{const n=kt({...e.contract,address:t});return e.resolveSubAbi?e.resolveSubAbi(n):so(n)}))}function Od(e){let t=e.pluginAbis.flat().filter(r=>r.type!=="constructor");e.rootAbi&&(t=[...e.rootAbi,...t].filter(r=>r.type!=="fallback"&&r.type!=="receive").filter(Boolean));const n=[...new Set(Of(t))];return ro(n)}async function pi(e){var s;const{error:t,contract:n,fromAddress:r}=e;Bf(t)&&n&&_f({chainId:(s=n.chain)==null?void 0:s.id,client:n.client,contractAddress:n.address,error:t,walletAddress:r});const i=await Ld({contract:n,error:t});return i?new Md(i,n):t}async function Ld(e){const{error:t,contract:n}=e;if(typeof t=="object"){const r=t;if(r.data&&r.data!=="0x"&&Fe(r.data)){let i=n==null?void 0:n.abi;n&&!i&&(i=await Ed(n).catch(()=>{}));const s=Zu({abi:i,data:r.data});return`${s.errorName}${s.args?` - ${s.args}`:""}`}}return`Execution Reverted: ${Ku(t)}`}class Md extends Error{constructor(t,n){var i;let r=t;super(r),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chainId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TransactionError",this.contractAddress=n==null?void 0:n.address,this.chainId=(i=n==null?void 0:n.chain)==null?void 0:i.id,this.message=r}}const zn=new WeakMap;async function oo(e){var s,o;const t=typeof e.from=="string"?e.from??void 0:((s=e.from)==null?void 0:s.address)??((o=e.account)==null?void 0:o.address),n={...e.transaction,from:t};if(zn.has(n))return zn.get(n);const{account:r}=e,i=(async()=>{var h,g;const a=await q(e.transaction.gas);if(a!==void 0)return a;if(r!=null&&r.estimateGas)try{let b=await r.estimateGas(e.transaction);return(h=e.transaction.chain.experimental)!=null&&h.increaseZeroByteCount&&(b=bt(b)),b}catch(b){throw await pi({contract:e.transaction.__contract,error:b,fromAddress:t})}const{encode:c}=await F(async()=>{const{encode:b}=await Promise.resolve().then(()=>af);return{encode:b}},void 0),[u,f,d,l]=await Promise.all([c(e.transaction),q(e.transaction.to),q(e.transaction.value),q(e.transaction.authorizationList)]),[{getRpcClient:p},{eth_estimateGas:m}]=await Promise.all([F(()=>Promise.resolve().then(()=>gf),void 0),F(()=>import("./eth_estimateGas-B-vKWEoE.js"),__vite__mapDeps([7,0,1,2]))]),y=p(e.transaction);try{const b=Cs({authorizationList:l==null?void 0:l.map(v=>({...v,address:Ie(v.address),nonce:Number(v.nonce),r:I(v.r),s:I(v.s)})),data:u,from:t?Ie(t):void 0,to:f?Ie(f):void 0,value:d});let x=await m(y,b);return(g=e.transaction.chain.experimental)!=null&&g.increaseZeroByteCount&&(x=bt(x)),x}catch(b){throw await pi({contract:e.transaction.__contract,error:b,fromAddress:t})}})();return zn.set(n,i),i}const Np=Object.freeze(Object.defineProperty({__proto__:null,estimateGas:oo},Symbol.toStringTag,{value:"Module"}));async function Cd(e){if(await Hs(e.transaction.chain)){const{getZkGasFees:y}=await F(async()=>{const{getZkGasFees:x}=await import("./send-eip712-transaction-DwOwlCqR.js").then(v=>v.a);return{getZkGasFees:x}},__vite__mapDeps([8,1,2,9])),{gas:h,maxFeePerGas:g,maxPriorityFeePerGas:b}=await y({from:typeof e.from=="string"?Ie(e.from):e.from!==void 0?Ie(e.from.address):void 0,transaction:e.transaction});e.transaction={...e.transaction,gas:h,maxFeePerGas:g,maxPriorityFeePerGas:b}}const n=De(e.transaction),r=e.transaction.chain.id,i=e.from;let[s,o,a,c,u,f,d,l,p]=await Promise.all([dn(e.transaction),(async()=>{const y=await q(e.transaction.nonce);return y!==void 0?y:i?await F(async()=>{const{eth_getTransactionCount:h}=await import("./eth_getTransactionCount-hf8F-dbS.js");return{eth_getTransactionCount:h}},__vite__mapDeps([10,0,1,2])).then(({eth_getTransactionCount:h})=>h(n,{address:Ie(typeof i=="string"?i:i.address),blockTag:"pending"})):void 0})(),oo({...e,from:e.from}),Fs(e.transaction),q(e.transaction.to),q(e.transaction.accessList),q(e.transaction.value),q(e.transaction.authorizationList),q(e.transaction.type)]);const m=await q(e.transaction.extraGas);return m&&(a+=m),{accessList:f,authorizationList:l,chainId:r,data:s,gas:a,nonce:o,to:u,type:p,value:d,...c}}function Nd(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,{balance:n.balance?de(n.balance):void 0,code:n.code,nonce:n.nonce?de(n.nonce):void 0,state:n.state,stateDiff:n.stateDiff}]))}async function ao(e,t){const{blockNumber:n,blockTag:r,...i}=t,o=(n?de(n):void 0)||r||"latest";return await e({method:"eth_call",params:t.stateOverrides?[i,o,Nd(t.stateOverrides)]:[i,o]})}async function Up(e,t){const n=await e({method:"eth_getBalance",params:[t.address,t.blockTag||"latest"]});return rn(n)}async function Ud(e,t){return e({method:"eth_getCode",params:[t.address,t.blockTag||"latest"]})}async function Rp(e,t){return await e({method:"eth_sendRawTransaction",params:[t]})}async function kp({client:e,walletAddress:t,email:n,phone:r,id:i,externalWalletAddress:s,ecosystem:o}){if(!e.secretKey)throw new Error("A secret key is required to query for users. If you're making this request from the server, please add a secret key to your client.");const a=new URL(`${zi("inAppWallet")}/api/2023-11-30/embedded-wallet/user-details`);if(t)a.searchParams.set("queryBy","walletAddress"),a.searchParams.set("walletAddress",t);else if(n)a.searchParams.set("queryBy","email"),a.searchParams.set("email",n);else if(r)a.searchParams.set("queryBy","phone"),a.searchParams.set("phone",r);else if(i)a.searchParams.set("queryBy","id"),a.searchParams.set("id",i);else if(s)a.searchParams.set("queryBy","externalWalletAddress"),a.searchParams.set("externalWalletAddress",s);else throw new Error("Please provide a walletAddress, email, phone, id, or externalWalletAddress to query for users.");const u=await at(e,o)(a.toString());if(!u.ok){const d=await u.text().catch(()=>"Unknown error");throw new Error(`Failed to get profiles. ${u.status} ${u.statusText}: ${d}`)}return(await u.json()).map(d=>({createdAt:d.createdAt,email:d.email,phone:d.phone,profiles:d.linkedAccounts.map(l=>({details:l.details,type:l.type==="siwe"?"wallet":l.type})),smartAccountAddress:d.smartAccountAddress,userId:d.userId,walletAddress:d.walletAddress}))[0]||null}function Rd(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="event")}function jp(e){const{signature:t}=e;let n;return Rd(t)?n=t:n=ot(t),{abiEvent:n,hash:br(n),topics:Cu({abi:[n],args:e.filters})}}function Fp(e){const{logs:t,events:n,strict:r}=e;return rf({abi:n.map(i=>i.abiEvent),logs:t,strict:r})}function kd(e){for(const t of e)if(typeof t!="string")return!1;return!0}function jd(e){return kd(e)?ro(e):e}function ne(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=ns(Fn(e));return n==="Bytes"?r:Y(r)}class Fd extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Dd={checksum:new Fd(8192)},On=Dd.checksum;function co(e,t={}){const{compressed:n}=t,{prefix:r,x:i,y:s}=e;if(n===!1||typeof i=="bigint"&&typeof s=="bigint"){if(r!==4)throw new yi({prefix:r,cause:new Zd});return}if(n===!0||typeof i=="bigint"&&typeof s>"u"){if(r!==3&&r!==2)throw new yi({prefix:r,cause:new Wd});return}throw new qd({publicKey:e})}function Hd(e){const t=(()=>{if(dr(e))return uo(e);if(Ta(e))return Vd(e);const{prefix:n,x:r,y:i}=e;return typeof r=="bigint"&&typeof i=="bigint"?{prefix:n??4,x:r,y:i}:{prefix:n,x:r}})();return co(t),t}function Vd(e){return uo(Y(e))}function uo(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Kd({publicKey:e});if(e.length===130){const r=BigInt(K(e,0,32)),i=BigInt(K(e,32,64));return{prefix:4,x:r,y:i}}if(e.length===132){const r=Number(K(e,0,1)),i=BigInt(K(e,1,33)),s=BigInt(K(e,33,65));return{prefix:r,x:i,y:s}}const t=Number(K(e,0,1)),n=BigInt(K(e,1,33));return{prefix:t,x:n}}function Gd(e,t={}){co(e);const{prefix:n,x:r,y:i}=e,{includePrefix:s=!0}=t;return N(s?I(n,{size:1}):"0x",I(r,{size:32}),typeof i=="bigint"?I(i,{size:32}):"0x")}class qd extends P{constructor({publicKey:t}){super(`Value \`${ct(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class yi extends P{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class Wd extends P{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Zd extends P{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Kd=class extends P{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${R(tn(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const Yd=/^0x[a-fA-F0-9]{40}$/;function he(e,t={}){const{strict:n=!0}=t;if(!Yd.test(e))throw new Yn({address:e,cause:new fo});if(n){if(e.toLowerCase()===e)return;if(Ir(e)!==e)throw new Yn({address:e,cause:new Qd})}}function Ir(e){if(On.has(e))return On.get(e);he(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=ne(lr(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i=`0x${r.join("")}`;return On.set(e,i),i}function Xd(e,t={}){const{checksum:n=!1}=t;return he(e),n?Ir(e):e}function Jd(e,t={}){const n=ne(`0x${Gd(e).slice(4)}`).substring(26);return Xd(`0x${n}`,t)}function Kt(e,t={}){const{strict:n=!0}=t??{};try{return he(e,{strict:n}),!0}catch{return!1}}class Yn extends P{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class fo extends P{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Qd extends P{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function Xn(e){let t=!0,n="",r=0,i="",s=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}i+=a,n+=a}}if(!s)throw new P("Unable to normalize signature.");return i}function Jn(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Kt(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((i,s)=>Jn(Object.values(e)[s],i)):/^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)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(i=>Jn(i,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function lo(e,t,n){for(const r in e){const i=e[r],s=t[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return lo(i.components,s.components,n[r]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Kt(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?Kt(n[r],{strict:!1}):!1)return o}}function el(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?ot(e):e;return{...r,...n?{hash:Je(r)}:{}}}function tl(e,t,n){const{args:r=[],prepare:i=!0}=n??{},s=dr(t,{strict:!1}),o=e.filter(u=>s?u.type==="function"||u.type==="error"?ho(u)===K(t,0,4):u.type==="event"?Je(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new Yt({name:t});if(o.length===1)return{...o[0],...i?{hash:Je(o[0])}:{}};let a;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...i?{hash:Je(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((d,l)=>{const p="inputs"in u&&u.inputs[l];return p?Jn(d,p):!1})){if(a&&"inputs"in a&&a.inputs){const d=lo(u.inputs,a.inputs,r);if(d)throw new rl({abiItem:u,type:d[0]},{abiItem:a,type:d[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...f]=o;return{...u,overloads:f}})();if(!c)throw new Yt({name:t});return{...c,...i?{hash:Je(c)}:{}}}function ho(e){return K(Je(e),0,4)}function nl(e){const t=typeof e=="string"?e:Zt(e);return Xn(t)}function Je(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:ne(St(nl(e)))}class rl extends P{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Xn(Zt(t.abiItem))}\`, and`,`\`${n.type}\` in \`${Xn(Zt(n.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 Yt extends P{constructor({name:t,data:n,type:r="item"}){const i=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${i} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}class il extends P{constructor({data:t}){super(`Selector size is invalid. Expected 4 bytes. Received ${R(t)} bytes ("${t}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}const sl=/^(.*)\[([0-9]*)\]$/,po=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Br=/^(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)?$/,Hp=2n**96n-1n,gi=2n**256n-1n;function tt(e,t,n){const{checksumAddress:r,staticPosition:i}=n,s=_r(t.type);if(s){const[o,a]=s;return al(e,{...t,type:a},{checksumAddress:r,length:o,staticPosition:i})}if(t.type==="tuple")return dl(e,t,{checksumAddress:r,staticPosition:i});if(t.type==="address")return ol(e,{checksum:r});if(t.type==="bool")return cl(e);if(t.type.startsWith("bytes"))return ul(e,t,{staticPosition:i});if(t.type.startsWith("uint")||t.type.startsWith("int"))return fl(e,t);if(t.type==="string")return ll(e,{staticPosition:i});throw new zr(t.type)}const mi=32,Qn=32;function ol(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Ir(s):s)(Y(Sa(r,-20))),32]}function al(e,t,n){const{checksumAddress:r,length:i,staticPosition:s}=n;if(!i){const c=ce(e.readBytes(Qn)),u=s+c,f=u+mi;e.setPosition(u);const d=ce(e.readBytes(mi)),l=Pt(t);let p=0;const m=[];for(let y=0;y<d;++y){e.setPosition(f+(l?y*32:p));const[h,g]=tt(e,t,{checksumAddress:r,staticPosition:f});p+=g,m.push(h)}return e.setPosition(s+32),[m,32]}if(Pt(t)){const c=ce(e.readBytes(Qn)),u=s+c,f=[];for(let d=0;d<i;++d){e.setPosition(u+d*32);const[l]=tt(e,t,{checksumAddress:r,staticPosition:u});f.push(l)}return e.setPosition(s+32),[f,32]}let o=0;const a=[];for(let c=0;c<i;++c){const[u,f]=tt(e,t,{checksumAddress:r,staticPosition:s+o});o+=f,a.push(u)}return[a,o]}function cl(e){return[qi(e.readBytes(32),{size:32}),32]}function ul(e,t,{staticPosition:n}){const[r,i]=t.type.split("bytes");if(!i){const o=ce(e.readBytes(32));e.setPosition(n+o);const a=ce(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[Y(c),32]}return[Y(e.readBytes(Number.parseInt(i),32)),32]}function fl(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),i=e.readBytes(32);return[r>48?Gi(i,{signed:n}):ce(i,{signed:n}),32]}function dl(e,t,n){const{checksumAddress:r,staticPosition:i}=n,s=t.components.length===0||t.components.some(({name:c})=>!c),o=s?[]:{};let a=0;if(Pt(t)){const c=ce(e.readBytes(Qn)),u=i+c;for(let f=0;f<t.components.length;++f){const d=t.components[f];e.setPosition(u+a);const[l,p]=tt(e,d,{checksumAddress:r,staticPosition:u});a+=p,o[s?f:d==null?void 0:d.name]=l}return e.setPosition(i+32),[o,32]}for(let c=0;c<t.components.length;++c){const u=t.components[c],[f,d]=tt(e,u,{checksumAddress:r,staticPosition:i});o[s?c:u==null?void 0:u.name]=f,a+=d}return[o,a]}function ll(e,{staticPosition:t}){const n=ce(e.readBytes(32)),r=t+n;e.setPosition(r);const i=ce(e.readBytes(32));if(i===0)return e.setPosition(t+32),["",32];const s=e.readBytes(i,32),o=Wi(Zi(s));return e.setPosition(t+32),[o,32]}function hl({checksumAddress:e,parameters:t,values:n}){const r=[];for(let i=0;i<t.length;i++)r.push(Sr({checksumAddress:e,parameter:t[i],value:n[i]}));return r}function Sr({checksumAddress:e=!1,parameter:t,value:n}){const r=t,i=_r(r.type);if(i){const[s,o]=i;return yl(n,{checksumAddress:e,length:s,parameter:{...r,type:o}})}if(r.type==="tuple")return xl(n,{checksumAddress:e,parameter:r});if(r.type==="address")return pl(n,{checksum:e});if(r.type==="bool")return ml(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,o="256"]=Br.exec(r.type)??[];return bl(n,{signed:s,size:Number(o)})}if(r.type.startsWith("bytes"))return gl(n,{type:r.type});if(r.type==="string")return wl(n);throw new zr(r.type)}function Tr(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?t+=32:t+=R(a)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push(I(t+i,{size:32})),r.push(a),i+=R(a)):n.push(a)}return N(...n,...r)}function pl(e,t){const{checksum:n=!1}=t;return he(e,{strict:n}),{dynamic:!1,encoded:Te(e.toLowerCase())}}function yl(e,t){const{checksumAddress:n,length:r,parameter:i}=t,s=r===null;if(!Array.isArray(e))throw new Sl(e);if(!s&&e.length!==r)throw new Bl({expectedLength:r,givenLength:e.length,type:`${i.type}[${r}]`});let o=!1;const a=[];for(let c=0;c<e.length;c++){const u=Sr({checksumAddress:n,parameter:i,value:e[c]});u.dynamic&&(o=!0),a.push(u)}if(s||o){const c=Tr(a);if(s){const u=I(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?N(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:N(...a.map(({encoded:c})=>c))}}function gl(e,{type:t}){const[,n]=t.split("bytes"),r=R(e);if(!n){let i=e;return r%32!==0&&(i=_e(i,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:N(Te(I(r,{size:32})),i)}}if(r!==Number.parseInt(n))throw new go({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:_e(e)}}function ml(e){if(typeof e!="boolean")throw new P(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Te(fr(e))}}function bl(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,i=t?-r-1n:0n;if(e>r||e<i)throw new Di({max:r.toString(),min:i.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:I(e,{size:32,signed:t})}}function wl(e){const t=St(e),n=Math.ceil(R(t)/32),r=[];for(let i=0;i<n;i++)r.push(_e(K(t,i*32,(i+1)*32)));return{dynamic:!0,encoded:N(_e(I(R(t),{size:32})),...r)}}function xl(e,t){const{checksumAddress:n,parameter:r}=t;let i=!1;const s=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],c=Array.isArray(e)?o:a.name,u=Sr({checksumAddress:n,parameter:a,value:e[c]});s.push(u),u.dynamic&&(i=!0)}return{dynamic:i,encoded:i?Tr(s):N(...s.map(({encoded:o})=>o))}}function _r(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Pt(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(Pt);const n=_r(e.type);return!!(n&&Pt({...e,type:n[1]}))}const $l={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new vl({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new El({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new bi({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new bi({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function yo(e,{recursiveReadLimit:t=8192}={}){const n=Object.create($l);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class bi extends P{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class El extends P{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class vl extends P{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Al(e,t,n={}){const{as:r="Array",checksumAddress:i=!1}=n,s=typeof t=="string"?ze(t):t,o=yo(s);if(Xe(s)===0&&e.length>0)throw new Il;if(Xe(s)&&Xe(s)<32)throw new Pl({data:typeof t=="string"?t:Y(t),parameters:e,size:Xe(s)});let a=0;const c=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const f=e[u];o.setPosition(a);const[d,l]=tt(o,f,{checksumAddress:i,staticPosition:0});a+=l,r==="Array"?c.push(d):c[f.name??u]=d}return c}function hn(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new mo({expectedLength:e.length,givenLength:t.length});const i=hl({checksumAddress:r,parameters:e,values:t}),s=Tr(i);return s.length===0?"0x":s}function er(e,t){if(e.length!==t.length)throw new mo({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r];n.push(er.encode(i,s))}return N(...n)}(function(e){function t(n,r,i=!1){if(n==="address"){const c=r;return he(c),Te(c.toLowerCase(),i?32:0)}if(n==="string")return St(r);if(n==="bytes")return r;if(n==="bool")return Te(fr(r),i?32:1);const s=n.match(Br);if(s){const[c,u,f="256"]=s,d=Number.parseInt(f)/8;return I(r,{size:i?32:d,signed:u==="int"})}const o=n.match(po);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new go({expectedSize:Number.parseInt(u),value:r});return _e(r,i?32:0)}const a=n.match(sl);if(a&&Array.isArray(r)){const[c,u]=a,f=[];for(let d=0;d<r.length;d++)f.push(t(u,r[d],!0));return f.length===0?"0x":N(...f)}throw new zr(n)}e.encode=t})(er||(er={}));class Pl extends P{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Ye(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Il extends P{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Bl extends P{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}let go=class extends P{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${R(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}};class mo extends P{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
26
|
+
responses: ${fe(v)}`))})}).catch(v=>{for(const B of b)B.reject(v)}).finally(()=>{a.clear()})}return s===1?async g=>{var x;g.id=1,g.jsonrpc="2.0";const b=await df(i,e.client,{request:g,requestTimeoutMs:(x=e.config)==null?void 0:x.requestTimeoutMs});if(!b)throw new Error("No response");if("error"in b)throw b.error;return b.result}:async g=>{const b=hf(g);if(a.has(b))return a.get(b);let x,v;const B=new Promise((_,A)=>{x=_,v=A});return a.set(b,B),c.push({reject:v,request:g,requestKey:b,resolve:x}),s>1?(u||(u=setTimeout(f,o)),c.length>=s&&f()):f(),B}})();return t.set(n,r),r}const gf=Object.freeze(Object.defineProperty({__proto__:null,getRpcClient:De},Symbol.toStringTag,{value:"Module"}));async function q(e){return typeof e=="function"?await e():e}function js(e,t){const n=e.toString(),r=n[0]==="-"?"-":"",s=(r?n.slice(1):n).padStart(t+1,"0"),o=s.length-t,a=s.slice(0,o)||"0";let c=s.slice(o);for(let u=c.length-1;u>=0;u--){if(c[u]!=="0"){c=c.slice(0,u+1);break}u===0&&(c="")}return`${r}${a}${c?`.${c}`:""}`}function mf(e){return js(e,18)}function ln(e,t){e.includes("e")&&(e=Number(e).toFixed(t));let[n,r=""]=e.split(".");const i=n.startsWith("-")?"-":"";if(i&&(n=n.slice(1)),r=r.padEnd(t,"0"),t===0)r[0]&&Number.parseInt(r[0])>=5&&(n=(BigInt(n)+1n).toString()),r="";else if(r.length>t){const s=r[t];s&&Number.parseInt(s,10)>=5?(r=(BigInt(r.substring(0,t))+1n).toString().padStart(t,"0"),r.length>t&&(n=(BigInt(n)+1n).toString(),r=r.substring(r.length-t))):r=r.substring(0,t)}return BigInt(`${i}${n}${r}`)}function bf(e){return ln(e,18)}function wf(e){return ln(e,9)}const Op=Object.freeze(Object.defineProperty({__proto__:null,fromGwei:wf,toEther:mf,toTokens:js,toUnits:ln,toWei:bf},Symbol.toStringTag,{value:"Module"}));async function xf(e){const t=await e({method:"eth_gasPrice"});return rn(t)}async function di(e){const{client:t,chain:n,percentMultiplier:r}=e,i=De({chain:n,client:t}),s=await xf(i),o=r?s/BigInt(100)*BigInt(r):0n;return s+o}function bt(e){if(e===0n||(e&e-1n)===0n)return e;let t=1n;for(;e>0n;)e>>=1n,t<<=1n;return t}const $f=[78600,2040,248,9372,841,842,2016,9768,2442,1942999413,1952959480,994873017,19011,40875,1511670449,5464,2020,2021,98866,1417429182];async function Fs(e){var o;const[t,n,r,i]=await Promise.all([q(e.maxFeePerGas),q(e.maxPriorityFeePerGas),q(e.gasPrice),q(e.type)]);if(t!==void 0&&n!==void 0)return{maxFeePerGas:t,maxPriorityFeePerGas:n};if(typeof r=="bigint")return{gasPrice:r};const s=await Ds(e.client,e.chain,i==="legacy"?"legacy":"eip1559");return(o=e.chain.experimental)!=null&&o.increaseZeroByteCount?s.gasPrice?{gasPrice:bt(s.gasPrice)}:{maxFeePerGas:t??bt(s.maxFeePerGas??0n),maxPriorityFeePerGas:n??bt(s.maxPriorityFeePerGas??0n)}:s.gasPrice!==void 0?s:{maxFeePerGas:t??s.maxFeePerGas,maxPriorityFeePerGas:n??s.maxPriorityFeePerGas}}async function Ds(e,t,n){if((n??t.feeType)==="legacy"||$f.includes(t.id))return{gasPrice:await di({chain:t,client:e,percentMultiplier:10})};const i=await Ef(e,t);return i.maxFeePerGas!==null&&i.maxPriorityFeePerGas!==null?{maxFeePerGas:i.maxFeePerGas,maxPriorityFeePerGas:i.maxPriorityFeePerGas}:{gasPrice:await di({chain:t,client:e,percentMultiplier:10})}}async function Ef(e,t,n=10){let r=null,i=null;const s=De({chain:t,client:e}),[o,a]=await Promise.all([cf(s,{blockTag:"latest"}),uf(s).catch(()=>null)]),c=o==null?void 0:o.baseFeePerGas,u=t.id;return u===220||u===1220?{maxFeePerGas:null,maxPriorityFeePerGas:null}:(u===80002||u===137?i=await If(u):a!==null&&(i=a),i==null||c==null?{maxFeePerGas:null,maxPriorityFeePerGas:null}:(i=vf(i,n),r=c*2n+i,(u===42220||u===44787||u===62320)&&(i=r),{maxFeePerGas:r,maxPriorityFeePerGas:i}))}function vf(e,t=10){const n=e/BigInt(100)*BigInt(t);return e+n}function Af(e){switch(e){case 137:return"https://gasstation.polygon.technology/v2";case 80002:return"https://gasstation.polygon.technology/amoy"}}const Pf=31n;async function If(e){const t=Af(e);try{const r=(await(await fetch(t)).json()).fast.maxPriorityFee;if(r>0){const i=Number.parseFloat(r).toFixed(9);return ln(i,9)}}catch(n){console.error("failed to fetch gas",n)}return Pf}const Lp=Object.freeze(Object.defineProperty({__proto__:null,getDefaultGasOverrides:Ds,getGasOverridesForTransaction:Fs},Symbol.toStringTag,{value:"Module"}));async function Hs(e){if(e.id===1337||e.id===31337)return!1;if(e.id===324||e.id===300||e.id===302||e.id===11124||e.id===282||e.id===388||e.id===4654||e.id===333271||e.id===37111||e.id===978658||e.id===531050104||e.id===4457845||e.id===2741||e.id===240||e.id===555271||e.id===61166||e.id===555272)return!0;try{const{getChainMetadata:t}=await F(async()=>{const{getChainMetadata:r}=await import("./utils-CSELsIOA.js").then(i=>i.u);return{getChainMetadata:r}},__vite__mapDeps([0,1,2]));return(await t(e)).stackType==="zksync_stack"}catch{return!1}}function Bf(e){var r;if(!e)return!1;const n=(typeof e=="string"?e:(e==null?void 0:e.message)||((r=e==null?void 0:e.data)==null?void 0:r.message)||"").toLowerCase();return n.includes("insufficient funds")||n.includes("insufficient balance")||n.includes("insufficient")&&(n.includes("native")||n.includes("gas"))||(e==null?void 0:e.code)==="INSUFFICIENT_FUNDS"||(e==null?void 0:e.reason)==="insufficient funds"}function Sf(e){var r;if(!e)return{message:"Unknown error"};const t=typeof e=="string"?e:(e==null?void 0:e.message)||((r=e==null?void 0:e.data)==null?void 0:r.message)||String(e);return{code:(e==null?void 0:e.code)||(e==null?void 0:e.reason),message:t}}async function Vs({client:e,ecosystem:t,data:n}){const r=at(e,t),i={source:"sdk",...n};return r(`${zi("analytics")}/event`,{body:fe(i),method:"POST"}).catch(()=>{})}async function Mp(e){return Tf({...e,action:"transaction:sent"})}function Tf(e){return Vs({client:e.client,data:{action:e.action,chainId:e.chainId,clientId:e.client.clientId,contractAddress:e.contractAddress,errorCode:fe(e.error),functionName:e.functionName,gasPrice:e.gasPrice,transactionHash:e.transactionHash,walletAddress:e.walletAddress,walletType:e.walletType},ecosystem:e.ecosystem})}async function _f(e){var n,r,i;const t=Sf(e.error);return Vs({client:e.client,data:{action:"transaction:insufficient_funds",chainId:e.chainId,clientId:e.client.clientId,contractAddress:e.contractAddress,errorCode:t.code?fe(t.code):void 0,errorMessage:t.message,functionName:e.functionName,requiredAmount:(n=e.requiredAmount)==null?void 0:n.toString(),transactionValue:(r=e.transactionValue)==null?void 0:r.toString(),userBalance:(i=e.userBalance)==null?void 0:i.toString(),walletAddress:e.walletAddress},ecosystem:e.ecosystem})}const zf="1.0.8";class W extends Error{constructor(t,n={}){var o;const r=n.cause instanceof W?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,i=n.cause instanceof W&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${zf}`].join(`
|
|
27
|
+
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=t}}function Ee(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Gs=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,qs=/^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)?$/,Ws=/^\(.+?\).*?$/,li=/^tuple(?<array>(\[(\d*)\])*)$/;function Wn(e){let t=e.type;if(li.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let i=0;i<n;i++){const s=e.components[i];t+=Wn(s),i<n-1&&(t+=", ")}const r=Ee(li,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,Wn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Ye(e){let t="";const n=e.length;for(let r=0;r<n;r++){const i=e[r];t+=Wn(i),r!==n-1&&(t+=", ")}return t}function Zt(e){var t;return e.type==="function"?`function ${e.name}(${Ye(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${Ye(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Ye(e.inputs)})`:e.type==="error"?`error ${e.name}(${Ye(e.inputs)})`:e.type==="constructor"?`constructor(${Ye(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Of(e){const t=[],n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Zt(i);t.push(s)}return t}const Zs=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Lf(e){return Zs.test(e)}function Mf(e){return Ee(Zs,e)}const Ks=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Cf(e){return Ks.test(e)}function Nf(e){return Ee(Ks,e)}const Ys=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Uf(e){return Ys.test(e)}function Rf(e){return Ee(Ys,e)}const Xs=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function Pr(e){return Xs.test(e)}function kf(e){return Ee(Xs,e)}const Js=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function jf(e){return Js.test(e)}function Ff(e){return Ee(Js,e)}const Qs=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Df(e){return Qs.test(e)}function Hf(e){return Ee(Qs,e)}const Vf=/^receive\(\) external payable$/;function Gf(e){return Vf.test(e)}const qf=new Set(["indexed"]),Zn=new Set(["calldata","memory","storage"]);class Wf extends W{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Zf extends W{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Kf extends W{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Yf extends W{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Xf extends W{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Jf extends W{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Qf extends W{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class ed extends W{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class dt extends W{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class td extends W{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class nd extends W{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class rd extends W{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class id extends W{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function sd(e,t,n){let r="";if(n)for(const i of Object.entries(n)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;r+=`(${i[0]}{${s}})`}return t?`${t}:${e}${r}`:e}const _n=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Kn(e,t={}){if(Uf(e))return od(e,t);if(Cf(e))return ad(e,t);if(Lf(e))return cd(e,t);if(jf(e))return ud(e,t);if(Df(e))return fd(e);if(Gf(e))return{type:"receive",stateMutability:"payable"};throw new td({signature:e})}function od(e,t={}){const n=Rf(e);if(!n)throw new dt({signature:e,type:"function"});const r=oe(n.parameters),i=[],s=r.length;for(let a=0;a<s;a++)i.push(ke(r[a],{modifiers:Zn,structs:t,type:"function"}));const o=[];if(n.returns){const a=oe(n.returns),c=a.length;for(let u=0;u<c;u++)o.push(ke(a[u],{modifiers:Zn,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:i,outputs:o}}function ad(e,t={}){const n=Nf(e);if(!n)throw new dt({signature:e,type:"event"});const r=oe(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(ke(r[o],{modifiers:qf,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:i}}function cd(e,t={}){const n=Mf(e);if(!n)throw new dt({signature:e,type:"error"});const r=oe(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(ke(r[o],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:i}}function ud(e,t={}){const n=Ff(e);if(!n)throw new dt({signature:e,type:"constructor"});const r=oe(n.parameters),i=[],s=r.length;for(let o=0;o<s;o++)i.push(ke(r[o],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:i}}function fd(e){const t=Hf(e);if(!t)throw new dt({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const dd=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ld=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,hd=/^u?int$/;function ke(e,t){var d,l;const n=sd(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(_n.has(n))return _n.get(n);const r=Ws.test(e),i=Ee(r?ld:dd,e);if(!i)throw new Yf({param:e});if(i.name&&yd(i.name))throw new Xf({param:e,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(t==null?void 0:t.structs)??{};let c,u={};if(r){c="tuple";const p=oe(i.type),m=[],y=p.length;for(let h=0;h<y;h++)m.push(ke(p[h],{structs:a}));u={components:m}}else if(i.type in a)c="tuple",u={components:a[i.type]};else if(hd.test(i.type))c=`${i.type}256`;else if(c=i.type,(t==null?void 0:t.type)!=="struct"&&!eo(c))throw new Kf({type:c});if(i.modifier){if(!((l=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&l.call(d,i.modifier)))throw new Jf({param:e,type:t==null?void 0:t.type,modifier:i.modifier});if(Zn.has(i.modifier)&&!gd(c,!!i.array))throw new Qf({param:e,type:t==null?void 0:t.type,modifier:i.modifier})}const f={type:`${c}${i.array??""}`,...s,...o,...u};return _n.set(n,f),f}function oe(e,t=[],n="",r=0){const i=e.trim().length;for(let s=0;s<i;s++){const o=e[s],a=e.slice(s+1);switch(o){case",":return r===0?oe(a,[...t,n.trim()]):oe(a,t,`${n}${o}`,r);case"(":return oe(a,t,`${n}${o}`,r+1);case")":return oe(a,t,`${n}${o}`,r-1);default:return oe(a,t,`${n}${o}`,r)}}if(n==="")return t;if(r!==0)throw new id({current:n,depth:r});return t.push(n.trim()),t}function eo(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Gs.test(e)||qs.test(e)}const pd=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function yd(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Gs.test(e)||qs.test(e)||pd.test(e)}function gd(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function to(e){const t={},n=e.length;for(let o=0;o<n;o++){const a=e[o];if(!Pr(a))continue;const c=kf(a);if(!c)throw new dt({signature:a,type:"struct"});const u=c.properties.split(";"),f=[],d=u.length;for(let l=0;l<d;l++){const m=u[l].trim();if(!m)continue;const y=ke(m,{type:"struct"});f.push(y)}if(!f.length)throw new nd({signature:a});t[c.name]=f}const r={},i=Object.entries(t),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];r[a]=no(c,t)}return r}const md=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function no(e,t,n=new Set){const r=[],i=e.length;for(let s=0;s<i;s++){const o=e[s];if(Ws.test(o.type))r.push(o);else{const c=Ee(md,o.type);if(!(c!=null&&c.type))throw new ed({abiParameter:o});const{array:u,type:f}=c;if(f in t){if(n.has(f))throw new rd({type:f});r.push({...o,type:`tuple${u??""}`,components:no(t[f]??[],t,new Set([...n,f]))})}else if(eo(f))r.push(o);else throw new Zf({type:f})}}return r}function ro(e){const t=to(e),n=[],r=e.length;for(let i=0;i<r;i++){const s=e[i];Pr(s)||n.push(Kn(s,t))}return n}function ot(e){let t;if(typeof e=="string")t=Kn(e);else{const n=to(e),r=e.length;for(let i=0;i<r;i++){const s=e[i];if(!Pr(s)){t=Kn(s,n);break}}}if(!t)throw new Wf({signature:e});return t}const bd=of({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),wd="https://{clientId}.ipfscdn.io/ipfs/{cid}";function xd(e){var t,n;if(e.uri.startsWith("ipfs://")){const r=((n=(t=e.client.config)==null?void 0:t.storage)==null?void 0:n.gatewayUrl)??wd,i=e.client.clientId,s=$d(e.uri);let o;return typeof globalThis<"u"&&"Application"in globalThis&&(o=globalThis.Application.applicationId),`${r.replace("{clientId}",i).split("/ipfs")[0]}/ipfs/${s}${o?`?bundleId=${o}`:""}`}if(e.uri.startsWith("http"))return e.uri;throw new Error('Invalid URI scheme, expected "ipfs://" or "http(s)://"')}function $d(e){if(!e.startsWith("ipfs://"))return e;const t=e.search(/\/(Qm|baf)/i);return e.slice(t+1)}async function io(e){var r,i,s,o,a,c,u,f,d;let t;if(e.uri.startsWith("ar://")){const{resolveArweaveScheme:l}=await F(async()=>{const{resolveArweaveScheme:p}=await import("./arweave-CAGvOb64.js");return{resolveArweaveScheme:p}},[]);t=l(e)}else t=xd(e);const n=await at(e.client)(t,{headers:(s=(i=(r=e.client.config)==null?void 0:r.storage)==null?void 0:i.fetch)==null?void 0:s.headers,keepalive:(c=(a=(o=e.client.config)==null?void 0:o.storage)==null?void 0:a.fetch)==null?void 0:c.keepalive,requestTimeoutMs:e.requestTimeoutMs??((d=(f=(u=e.client.config)==null?void 0:u.storage)==null?void 0:f.fetch)==null?void 0:d.requestTimeoutMs)??6e4});if(!n.ok){const l=await n.text();throw new Error(`Failed to download file: ${n.status} ${n.statusText} ${l||""}`)}return n}const Cp=Object.freeze(Object.defineProperty({__proto__:null,download:io},Symbol.toStringTag,{value:"Module"}));function Ed(e,t="https://contract.thirdweb.com/abi"){return Oi(async()=>{if(e.abi)return e.abi;if(e.chain.id===31337||e.chain.id===1337||e.chain.id===bd.id)return await hi(e);try{return await vd(e,t)}catch{return await hi(e)}},{cacheKey:`${e.chain.id}-${e.address}`,cacheTime:1e3*60*60*1})}async function vd(e,t="https://contract.thirdweb.com/abi"){const r=await(await at(e.client)(`${t}/${e.chain.id}/${e.address}`)).json();if(!r||r.error)throw new Error(`Failed to resolve ABI from contract API. ${r.error||""}`);return r}async function so(e){const[{resolveImplementation:t},{extractIPFSUri:n}]=await Promise.all([F(()=>import("./resolveImplementation-Dml3QyNc.js"),__vite__mapDeps([3,4,0,1,2])),F(()=>import("./extractIPFS-DIUED-Pg.js"),__vite__mapDeps([5,0,1,2]))]),{bytecode:r}=await t(e);if(r==="0x"){const{id:s,name:o}=e.chain;throw new Error(`Failed to load contract bytecode. Make sure the contract [${e.address}] exists on the chain [${o||"Unknown Chain"} (chain id: ${s})]`)}const i=n(r);if(!i)return[];try{return(await(await io({client:e.client,uri:i})).json()).output.abi}catch{return[]}}const Ad={inputs:[],name:"getAllPlugins",outputs:[{components:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"},{internalType:"string",name:"functionSignature",type:"string"},{internalType:"address",name:"pluginAddress",type:"address"}],internalType:"struct IPluginMap.Plugin[]",name:"registered",type:"tuple[]"}],stateMutability:"view",type:"function"},Pd={inputs:[],name:"getAllExtensions",outputs:[{components:[{components:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"metadataURI",type:"string"},{internalType:"address",name:"implementation",type:"address"}],internalType:"struct IExtension.ExtensionMetadata",name:"metadata",type:"tuple"},{components:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"},{internalType:"string",name:"functionSignature",type:"string"}],internalType:"struct IExtension.ExtensionFunction[]",name:"functions",type:"tuple[]"}],internalType:"struct IExtension.Extension[]",name:"allExtensions",type:"tuple[]"}],stateMutability:"view",type:"function"},Id={inputs:[],name:"facets",outputs:[{components:[{internalType:"address",name:"facetAddress",type:"address"},{internalType:"bytes4[]",name:"functionSelectors",type:"bytes4[]"}],type:"tuple[]"}],stateMutability:"view",type:"function"};async function hi(e,t,n){const[r,i,s,o,a]=await Promise.all([so(e),Bd(e),Sd(e),Td(e),_d(e)]),c=[...new Set([...i,...s,...o,...a])];if(!c.length)return r;const u=await zd({contract:e,plugins:c,resolveSubAbi:n});return Od({pluginAbis:u,rootAbi:r})}async function Bd(e){try{const{readContract:t}=await F(async()=>{const{readContract:r}=await Promise.resolve().then(()=>Rr);return{readContract:r}},void 0),n=await t({contract:e,method:Ad});return n.length?[...new Set(n.map(r=>r.pluginAddress))]:[]}catch{}return[]}async function Sd(e){try{const{readContract:t}=await F(async()=>{const{readContract:r}=await Promise.resolve().then(()=>Rr);return{readContract:r}},void 0),n=await t({contract:e,method:Pd});return n.length?[...new Set(n.map(r=>r.metadata.implementation))]:[]}catch{}return[]}async function Td(e){try{const{getInstalledModules:t}=await F(async()=>{const{getInstalledModules:r}=await import("./getInstalledModules-Du4PQQY7.js");return{getInstalledModules:r}},__vite__mapDeps([6,0,1,2])),n=await t({contract:e});return n.length?[...new Set(n.map(r=>r.implementation))]:[]}catch{}return[]}async function _d(e){try{const{readContract:t}=await F(async()=>{const{readContract:r}=await Promise.resolve().then(()=>Rr);return{readContract:r}},void 0),n=await t({contract:e,method:Id});return n.length?n.map(r=>r.facetAddress):[]}catch{}return[]}async function zd(e){return Promise.all(e.plugins.map(t=>{const n=kt({...e.contract,address:t});return e.resolveSubAbi?e.resolveSubAbi(n):so(n)}))}function Od(e){let t=e.pluginAbis.flat().filter(r=>r.type!=="constructor");e.rootAbi&&(t=[...e.rootAbi,...t].filter(r=>r.type!=="fallback"&&r.type!=="receive").filter(Boolean));const n=[...new Set(Of(t))];return ro(n)}async function pi(e){var s;const{error:t,contract:n,fromAddress:r}=e;Bf(t)&&n&&_f({chainId:(s=n.chain)==null?void 0:s.id,client:n.client,contractAddress:n.address,error:t,walletAddress:r});const i=await Ld({contract:n,error:t});return i?new Md(i,n):t}async function Ld(e){const{error:t,contract:n}=e;if(typeof t=="object"){const r=t;if(r.data&&r.data!=="0x"&&Fe(r.data)){let i=n==null?void 0:n.abi;n&&!i&&(i=await Ed(n).catch(()=>{}));const s=Zu({abi:i,data:r.data});return`${s.errorName}${s.args?` - ${s.args}`:""}`}}return`Execution Reverted: ${Ku(t)}`}class Md extends Error{constructor(t,n){var i;let r=t;super(r),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chainId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TransactionError",this.contractAddress=n==null?void 0:n.address,this.chainId=(i=n==null?void 0:n.chain)==null?void 0:i.id,this.message=r}}const zn=new WeakMap;async function oo(e){var s,o;const t=typeof e.from=="string"?e.from??void 0:((s=e.from)==null?void 0:s.address)??((o=e.account)==null?void 0:o.address),n={...e.transaction,from:t};if(zn.has(n))return zn.get(n);const{account:r}=e,i=(async()=>{var h,g;const a=await q(e.transaction.gas);if(a!==void 0)return a;if(r!=null&&r.estimateGas)try{let b=await r.estimateGas(e.transaction);return(h=e.transaction.chain.experimental)!=null&&h.increaseZeroByteCount&&(b=bt(b)),b}catch(b){throw await pi({contract:e.transaction.__contract,error:b,fromAddress:t})}const{encode:c}=await F(async()=>{const{encode:b}=await Promise.resolve().then(()=>af);return{encode:b}},void 0),[u,f,d,l]=await Promise.all([c(e.transaction),q(e.transaction.to),q(e.transaction.value),q(e.transaction.authorizationList)]),[{getRpcClient:p},{eth_estimateGas:m}]=await Promise.all([F(()=>Promise.resolve().then(()=>gf),void 0),F(()=>import("./eth_estimateGas-ETW4xztT.js"),__vite__mapDeps([7,0,1,2]))]),y=p(e.transaction);try{const b=Cs({authorizationList:l==null?void 0:l.map(v=>({...v,address:Ie(v.address),nonce:Number(v.nonce),r:I(v.r),s:I(v.s)})),data:u,from:t?Ie(t):void 0,to:f?Ie(f):void 0,value:d});let x=await m(y,b);return(g=e.transaction.chain.experimental)!=null&&g.increaseZeroByteCount&&(x=bt(x)),x}catch(b){throw await pi({contract:e.transaction.__contract,error:b,fromAddress:t})}})();return zn.set(n,i),i}const Np=Object.freeze(Object.defineProperty({__proto__:null,estimateGas:oo},Symbol.toStringTag,{value:"Module"}));async function Cd(e){if(await Hs(e.transaction.chain)){const{getZkGasFees:y}=await F(async()=>{const{getZkGasFees:x}=await import("./send-eip712-transaction-B2xYx25b.js").then(v=>v.a);return{getZkGasFees:x}},__vite__mapDeps([8,1,2,9])),{gas:h,maxFeePerGas:g,maxPriorityFeePerGas:b}=await y({from:typeof e.from=="string"?Ie(e.from):e.from!==void 0?Ie(e.from.address):void 0,transaction:e.transaction});e.transaction={...e.transaction,gas:h,maxFeePerGas:g,maxPriorityFeePerGas:b}}const n=De(e.transaction),r=e.transaction.chain.id,i=e.from;let[s,o,a,c,u,f,d,l,p]=await Promise.all([dn(e.transaction),(async()=>{const y=await q(e.transaction.nonce);return y!==void 0?y:i?await F(async()=>{const{eth_getTransactionCount:h}=await import("./eth_getTransactionCount-qsl0Cr9u.js");return{eth_getTransactionCount:h}},__vite__mapDeps([10,0,1,2])).then(({eth_getTransactionCount:h})=>h(n,{address:Ie(typeof i=="string"?i:i.address),blockTag:"pending"})):void 0})(),oo({...e,from:e.from}),Fs(e.transaction),q(e.transaction.to),q(e.transaction.accessList),q(e.transaction.value),q(e.transaction.authorizationList),q(e.transaction.type)]);const m=await q(e.transaction.extraGas);return m&&(a+=m),{accessList:f,authorizationList:l,chainId:r,data:s,gas:a,nonce:o,to:u,type:p,value:d,...c}}function Nd(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,{balance:n.balance?de(n.balance):void 0,code:n.code,nonce:n.nonce?de(n.nonce):void 0,state:n.state,stateDiff:n.stateDiff}]))}async function ao(e,t){const{blockNumber:n,blockTag:r,...i}=t,o=(n?de(n):void 0)||r||"latest";return await e({method:"eth_call",params:t.stateOverrides?[i,o,Nd(t.stateOverrides)]:[i,o]})}async function Up(e,t){const n=await e({method:"eth_getBalance",params:[t.address,t.blockTag||"latest"]});return rn(n)}async function Ud(e,t){return e({method:"eth_getCode",params:[t.address,t.blockTag||"latest"]})}async function Rp(e,t){return await e({method:"eth_sendRawTransaction",params:[t]})}async function kp({client:e,walletAddress:t,email:n,phone:r,id:i,externalWalletAddress:s,ecosystem:o}){if(!e.secretKey)throw new Error("A secret key is required to query for users. If you're making this request from the server, please add a secret key to your client.");const a=new URL(`${zi("inAppWallet")}/api/2023-11-30/embedded-wallet/user-details`);if(t)a.searchParams.set("queryBy","walletAddress"),a.searchParams.set("walletAddress",t);else if(n)a.searchParams.set("queryBy","email"),a.searchParams.set("email",n);else if(r)a.searchParams.set("queryBy","phone"),a.searchParams.set("phone",r);else if(i)a.searchParams.set("queryBy","id"),a.searchParams.set("id",i);else if(s)a.searchParams.set("queryBy","externalWalletAddress"),a.searchParams.set("externalWalletAddress",s);else throw new Error("Please provide a walletAddress, email, phone, id, or externalWalletAddress to query for users.");const u=await at(e,o)(a.toString());if(!u.ok){const d=await u.text().catch(()=>"Unknown error");throw new Error(`Failed to get profiles. ${u.status} ${u.statusText}: ${d}`)}return(await u.json()).map(d=>({createdAt:d.createdAt,email:d.email,phone:d.phone,profiles:d.linkedAccounts.map(l=>({details:l.details,type:l.type==="siwe"?"wallet":l.type})),smartAccountAddress:d.smartAccountAddress,userId:d.userId,walletAddress:d.walletAddress}))[0]||null}function Rd(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="event")}function jp(e){const{signature:t}=e;let n;return Rd(t)?n=t:n=ot(t),{abiEvent:n,hash:br(n),topics:Cu({abi:[n],args:e.filters})}}function Fp(e){const{logs:t,events:n,strict:r}=e;return rf({abi:n.map(i=>i.abiEvent),logs:t,strict:r})}function kd(e){for(const t of e)if(typeof t!="string")return!1;return!0}function jd(e){return kd(e)?ro(e):e}function ne(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=ns(Fn(e));return n==="Bytes"?r:Y(r)}class Fd extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Dd={checksum:new Fd(8192)},On=Dd.checksum;function co(e,t={}){const{compressed:n}=t,{prefix:r,x:i,y:s}=e;if(n===!1||typeof i=="bigint"&&typeof s=="bigint"){if(r!==4)throw new yi({prefix:r,cause:new Zd});return}if(n===!0||typeof i=="bigint"&&typeof s>"u"){if(r!==3&&r!==2)throw new yi({prefix:r,cause:new Wd});return}throw new qd({publicKey:e})}function Hd(e){const t=(()=>{if(dr(e))return uo(e);if(Ta(e))return Vd(e);const{prefix:n,x:r,y:i}=e;return typeof r=="bigint"&&typeof i=="bigint"?{prefix:n??4,x:r,y:i}:{prefix:n,x:r}})();return co(t),t}function Vd(e){return uo(Y(e))}function uo(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new Kd({publicKey:e});if(e.length===130){const r=BigInt(K(e,0,32)),i=BigInt(K(e,32,64));return{prefix:4,x:r,y:i}}if(e.length===132){const r=Number(K(e,0,1)),i=BigInt(K(e,1,33)),s=BigInt(K(e,33,65));return{prefix:r,x:i,y:s}}const t=Number(K(e,0,1)),n=BigInt(K(e,1,33));return{prefix:t,x:n}}function Gd(e,t={}){co(e);const{prefix:n,x:r,y:i}=e,{includePrefix:s=!0}=t;return N(s?I(n,{size:1}):"0x",I(r,{size:32}),typeof i=="bigint"?I(i,{size:32}):"0x")}class qd extends P{constructor({publicKey:t}){super(`Value \`${ct(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class yi extends P{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class Wd extends P{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Zd extends P{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Kd=class extends P{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${R(tn(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const Yd=/^0x[a-fA-F0-9]{40}$/;function he(e,t={}){const{strict:n=!0}=t;if(!Yd.test(e))throw new Yn({address:e,cause:new fo});if(n){if(e.toLowerCase()===e)return;if(Ir(e)!==e)throw new Yn({address:e,cause:new Qd})}}function Ir(e){if(On.has(e))return On.get(e);he(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=ne(lr(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const i=`0x${r.join("")}`;return On.set(e,i),i}function Xd(e,t={}){const{checksum:n=!1}=t;return he(e),n?Ir(e):e}function Jd(e,t={}){const n=ne(`0x${Gd(e).slice(4)}`).substring(26);return Xd(`0x${n}`,t)}function Kt(e,t={}){const{strict:n=!0}=t??{};try{return he(e,{strict:n}),!0}catch{return!1}}class Yn extends P{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class fo extends P{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Qd extends P{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function Xn(e){let t=!0,n="",r=0,i="",s=!1;for(let o=0;o<e.length;o++){const a=e[o];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function","error",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}i+=a,n+=a}}if(!s)throw new P("Unable to normalize signature.");return i}function Jn(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Kt(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((i,s)=>Jn(Object.values(e)[s],i)):/^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)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(i=>Jn(i,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function lo(e,t,n){for(const r in e){const i=e[r],s=t[r];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return lo(i.components,s.components,n[r]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Kt(n[r],{strict:!1}):o.includes("address")&&o.includes("bytes")?Kt(n[r],{strict:!1}):!1)return o}}function el(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?ot(e):e;return{...r,...n?{hash:Je(r)}:{}}}function tl(e,t,n){const{args:r=[],prepare:i=!0}=n??{},s=dr(t,{strict:!1}),o=e.filter(u=>s?u.type==="function"||u.type==="error"?ho(u)===K(t,0,4):u.type==="event"?Je(u)===t:!1:"name"in u&&u.name===t);if(o.length===0)throw new Yt({name:t});if(o.length===1)return{...o[0],...i?{hash:Je(o[0])}:{}};let a;for(const u of o){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...i?{hash:Je(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((d,l)=>{const p="inputs"in u&&u.inputs[l];return p?Jn(d,p):!1})){if(a&&"inputs"in a&&a.inputs){const d=lo(u.inputs,a.inputs,r);if(d)throw new rl({abiItem:u,type:d[0]},{abiItem:a,type:d[1]})}a=u}}const c=(()=>{if(a)return a;const[u,...f]=o;return{...u,overloads:f}})();if(!c)throw new Yt({name:t});return{...c,...i?{hash:Je(c)}:{}}}function ho(e){return K(Je(e),0,4)}function nl(e){const t=typeof e=="string"?e:Zt(e);return Xn(t)}function Je(e){return typeof e!="string"&&"hash"in e&&e.hash?e.hash:ne(St(nl(e)))}class rl extends P{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Xn(Zt(t.abiItem))}\`, and`,`\`${n.type}\` in \`${Xn(Zt(n.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 Yt extends P{constructor({name:t,data:n,type:r="item"}){const i=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${i} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}class il extends P{constructor({data:t}){super(`Selector size is invalid. Expected 4 bytes. Received ${R(t)} bytes ("${t}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}const sl=/^(.*)\[([0-9]*)\]$/,po=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Br=/^(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)?$/,Hp=2n**96n-1n,gi=2n**256n-1n;function tt(e,t,n){const{checksumAddress:r,staticPosition:i}=n,s=_r(t.type);if(s){const[o,a]=s;return al(e,{...t,type:a},{checksumAddress:r,length:o,staticPosition:i})}if(t.type==="tuple")return dl(e,t,{checksumAddress:r,staticPosition:i});if(t.type==="address")return ol(e,{checksum:r});if(t.type==="bool")return cl(e);if(t.type.startsWith("bytes"))return ul(e,t,{staticPosition:i});if(t.type.startsWith("uint")||t.type.startsWith("int"))return fl(e,t);if(t.type==="string")return ll(e,{staticPosition:i});throw new zr(t.type)}const mi=32,Qn=32;function ol(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?Ir(s):s)(Y(Sa(r,-20))),32]}function al(e,t,n){const{checksumAddress:r,length:i,staticPosition:s}=n;if(!i){const c=ce(e.readBytes(Qn)),u=s+c,f=u+mi;e.setPosition(u);const d=ce(e.readBytes(mi)),l=Pt(t);let p=0;const m=[];for(let y=0;y<d;++y){e.setPosition(f+(l?y*32:p));const[h,g]=tt(e,t,{checksumAddress:r,staticPosition:f});p+=g,m.push(h)}return e.setPosition(s+32),[m,32]}if(Pt(t)){const c=ce(e.readBytes(Qn)),u=s+c,f=[];for(let d=0;d<i;++d){e.setPosition(u+d*32);const[l]=tt(e,t,{checksumAddress:r,staticPosition:u});f.push(l)}return e.setPosition(s+32),[f,32]}let o=0;const a=[];for(let c=0;c<i;++c){const[u,f]=tt(e,t,{checksumAddress:r,staticPosition:s+o});o+=f,a.push(u)}return[a,o]}function cl(e){return[qi(e.readBytes(32),{size:32}),32]}function ul(e,t,{staticPosition:n}){const[r,i]=t.type.split("bytes");if(!i){const o=ce(e.readBytes(32));e.setPosition(n+o);const a=ce(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[Y(c),32]}return[Y(e.readBytes(Number.parseInt(i),32)),32]}function fl(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),i=e.readBytes(32);return[r>48?Gi(i,{signed:n}):ce(i,{signed:n}),32]}function dl(e,t,n){const{checksumAddress:r,staticPosition:i}=n,s=t.components.length===0||t.components.some(({name:c})=>!c),o=s?[]:{};let a=0;if(Pt(t)){const c=ce(e.readBytes(Qn)),u=i+c;for(let f=0;f<t.components.length;++f){const d=t.components[f];e.setPosition(u+a);const[l,p]=tt(e,d,{checksumAddress:r,staticPosition:u});a+=p,o[s?f:d==null?void 0:d.name]=l}return e.setPosition(i+32),[o,32]}for(let c=0;c<t.components.length;++c){const u=t.components[c],[f,d]=tt(e,u,{checksumAddress:r,staticPosition:i});o[s?c:u==null?void 0:u.name]=f,a+=d}return[o,a]}function ll(e,{staticPosition:t}){const n=ce(e.readBytes(32)),r=t+n;e.setPosition(r);const i=ce(e.readBytes(32));if(i===0)return e.setPosition(t+32),["",32];const s=e.readBytes(i,32),o=Wi(Zi(s));return e.setPosition(t+32),[o,32]}function hl({checksumAddress:e,parameters:t,values:n}){const r=[];for(let i=0;i<t.length;i++)r.push(Sr({checksumAddress:e,parameter:t[i],value:n[i]}));return r}function Sr({checksumAddress:e=!1,parameter:t,value:n}){const r=t,i=_r(r.type);if(i){const[s,o]=i;return yl(n,{checksumAddress:e,length:s,parameter:{...r,type:o}})}if(r.type==="tuple")return xl(n,{checksumAddress:e,parameter:r});if(r.type==="address")return pl(n,{checksum:e});if(r.type==="bool")return ml(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,o="256"]=Br.exec(r.type)??[];return bl(n,{signed:s,size:Number(o)})}if(r.type.startsWith("bytes"))return gl(n,{type:r.type});if(r.type==="string")return wl(n);throw new zr(r.type)}function Tr(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?t+=32:t+=R(a)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push(I(t+i,{size:32})),r.push(a),i+=R(a)):n.push(a)}return N(...n,...r)}function pl(e,t){const{checksum:n=!1}=t;return he(e,{strict:n}),{dynamic:!1,encoded:Te(e.toLowerCase())}}function yl(e,t){const{checksumAddress:n,length:r,parameter:i}=t,s=r===null;if(!Array.isArray(e))throw new Sl(e);if(!s&&e.length!==r)throw new Bl({expectedLength:r,givenLength:e.length,type:`${i.type}[${r}]`});let o=!1;const a=[];for(let c=0;c<e.length;c++){const u=Sr({checksumAddress:n,parameter:i,value:e[c]});u.dynamic&&(o=!0),a.push(u)}if(s||o){const c=Tr(a);if(s){const u=I(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?N(u,c):u}}if(o)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:N(...a.map(({encoded:c})=>c))}}function gl(e,{type:t}){const[,n]=t.split("bytes"),r=R(e);if(!n){let i=e;return r%32!==0&&(i=_e(i,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:N(Te(I(r,{size:32})),i)}}if(r!==Number.parseInt(n))throw new go({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:_e(e)}}function ml(e){if(typeof e!="boolean")throw new P(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Te(fr(e))}}function bl(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,i=t?-r-1n:0n;if(e>r||e<i)throw new Di({max:r.toString(),min:i.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:I(e,{size:32,signed:t})}}function wl(e){const t=St(e),n=Math.ceil(R(t)/32),r=[];for(let i=0;i<n;i++)r.push(_e(K(t,i*32,(i+1)*32)));return{dynamic:!0,encoded:N(_e(I(R(t),{size:32})),...r)}}function xl(e,t){const{checksumAddress:n,parameter:r}=t;let i=!1;const s=[];for(let o=0;o<r.components.length;o++){const a=r.components[o],c=Array.isArray(e)?o:a.name,u=Sr({checksumAddress:n,parameter:a,value:e[c]});s.push(u),u.dynamic&&(i=!0)}return{dynamic:i,encoded:i?Tr(s):N(...s.map(({encoded:o})=>o))}}function _r(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Pt(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(Pt);const n=_r(e.type);return!!(n&&Pt({...e,type:n[1]}))}const $l={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new vl({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new El({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new bi({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new bi({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function yo(e,{recursiveReadLimit:t=8192}={}){const n=Object.create($l);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class bi extends P{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class El extends P{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class vl extends P{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function Al(e,t,n={}){const{as:r="Array",checksumAddress:i=!1}=n,s=typeof t=="string"?ze(t):t,o=yo(s);if(Xe(s)===0&&e.length>0)throw new Il;if(Xe(s)&&Xe(s)<32)throw new Pl({data:typeof t=="string"?t:Y(t),parameters:e,size:Xe(s)});let a=0;const c=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const f=e[u];o.setPosition(a);const[d,l]=tt(o,f,{checksumAddress:i,staticPosition:0});a+=l,r==="Array"?c.push(d):c[f.name??u]=d}return c}function hn(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new mo({expectedLength:e.length,givenLength:t.length});const i=hl({checksumAddress:r,parameters:e,values:t}),s=Tr(i);return s.length===0?"0x":s}function er(e,t){if(e.length!==t.length)throw new mo({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r];n.push(er.encode(i,s))}return N(...n)}(function(e){function t(n,r,i=!1){if(n==="address"){const c=r;return he(c),Te(c.toLowerCase(),i?32:0)}if(n==="string")return St(r);if(n==="bytes")return r;if(n==="bool")return Te(fr(r),i?32:1);const s=n.match(Br);if(s){const[c,u,f="256"]=s,d=Number.parseInt(f)/8;return I(r,{size:i?32:d,signed:u==="int"})}const o=n.match(po);if(o){const[c,u]=o;if(Number.parseInt(u)!==(r.length-2)/2)throw new go({expectedSize:Number.parseInt(u),value:r});return _e(r,i?32:0)}const a=n.match(sl);if(a&&Array.isArray(r)){const[c,u]=a,f=[];for(let d=0;d<r.length;d++)f.push(t(u,r[d],!0));return f.length===0?"0x":N(...f)}throw new zr(n)}e.encode=t})(er||(er={}));class Pl extends P{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Ye(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class Il extends P{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class Bl extends P{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}let go=class extends P{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${R(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}};class mo extends P{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
28
28
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class Sl extends P{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class zr extends P{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function Tl(e,t){var i;const{bytecode:n,args:r}=t;return N(n,(i=e.inputs)!=null&&i.length&&(r!=null&&r.length)?hn(e.inputs,r):"0x")}function _l(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Yt({name:"constructor"});return t}function Gp(e,t){const{overloads:n}=e;if(R(t)<4)throw new il({data:t});if(e.inputs.length===0)return;const r=n?Or([e,...n],t):e;if(!(R(t)<=4))return Al(r.inputs,K(t,4))}function zl(e,...t){const{overloads:n}=e,r=n?Or([e,...n],e.name,{args:t[0]}):e,i=Ol(r),s=t.length>0?hn(r.inputs,t[0]):void 0;return s?N(i,s):i}function qp(e,t={}){return el(e,t)}function Or(e,t,n){const r=tl(e,t,n);if(r.type!=="function")throw new Yt({name:t,type:"function"});return r}function Ol(e){return ho(e)}function Lr(e){if(!e||e.length===0)return[];const t=[];for(const{address:n,storageKeys:r}of e){for(let i=0;i<r.length;i++)if(R(r[i])!==32)throw new Ll({storageKey:r[i]});n&&he(n,{strict:!1}),t.push([n,r])}return t}class Ll extends P{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${R(t)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccessList.InvalidStorageKeySizeError"})}}function Ml(e,t){const{as:n}=t,r=bo(e),i=yo(new Uint8Array(r.length));return r.encode(i),n==="Hex"?Y(i.bytes):i.bytes}function zt(e,t={}){const{as:n="Hex"}=t;return Ml(e,{as:n})}function bo(e){return Array.isArray(e)?Cl(e.map(t=>bo(t))):Nl(e)}function Cl(e){const t=e.reduce((i,s)=>i+s.length,0),n=wo(t);return{length:t<=55?1+t:1+n+t,encode(i){t<=55?i.pushByte(192+t):(i.pushByte(247+n),n===1?i.pushUint8(t):n===2?i.pushUint16(t):n===3?i.pushUint24(t):i.pushUint32(t));for(const{encode:s}of e)s(i)}}}function Nl(e){const t=typeof e=="string"?ze(e):e,n=wo(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(i){t.length===1&&t[0]<128?i.pushBytes(t):t.length<=55?(i.pushByte(128+t.length),i.pushBytes(t)):(i.pushByte(183+n),n===1?i.pushUint8(t.length):n===2?i.pushUint16(t.length):n===3?i.pushUint24(t.length):i.pushUint32(t.length),i.pushBytes(t))}}}function wo(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new P("Length is too large.")}class xo extends hr{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,Ra(t);const r=nn(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?t.create().update(r).digest():r);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=t.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(t){return rt(this),this.iHash.update(t),this}digestInto(t){rt(this),ut(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return t=t,t.finished=i,t.destroyed=s,t.blockLen=o,t.outputLen=a,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const $o=(e,t,n)=>new xo(e,t).update(n).digest();$o.create=(e,t)=>new xo(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const H=BigInt(0),U=BigInt(1),Me=BigInt(2),Ul=BigInt(3),tr=BigInt(4),wi=BigInt(5),xi=BigInt(8);function Q(e,t){const n=e%t;return n>=H?n:t+n}function Rl(e,t,n){if(t<H)throw new Error("invalid exponent, negatives unsupported");if(n<=H)throw new Error("invalid modulus");if(n===U)return H;let r=U;for(;t>H;)t&U&&(r=r*e%n),e=e*e%n,t>>=U;return r}function te(e,t,n){let r=e;for(;t-- >H;)r*=r,r%=n;return r}function nr(e,t){if(e===H)throw new Error("invert: expected non-zero number");if(t<=H)throw new Error("invert: expected positive modulus, got "+t);let n=Q(e,t),r=t,i=H,s=U;for(;n!==H;){const a=r/n,c=r%n,u=i-s*a;r=n,n=c,i=s,s=u}if(r!==U)throw new Error("invert: does not exist");return Q(i,t)}function kl(e){const t=(e-U)/Me;let n,r,i;for(n=e-U,r=0;n%Me===H;n/=Me,r++);for(i=Me;i<e&&Rl(i,t,e)!==e-U;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(r===1){const o=(e+U)/tr;return function(c,u){const f=c.pow(u,o);if(!c.eql(c.sqr(f),u))throw new Error("Cannot find square root");return f}}const s=(n+U)/Me;return function(a,c){if(a.pow(c,t)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=r,f=a.pow(a.mul(a.ONE,i),n),d=a.pow(c,s),l=a.pow(c,n);for(;!a.eql(l,a.ONE);){if(a.eql(l,a.ZERO))return a.ZERO;let p=1;for(let y=a.sqr(l);p<u&&!a.eql(y,a.ONE);p++)y=a.sqr(y);const m=a.pow(f,U<<BigInt(u-p-1));f=a.sqr(m),d=a.mul(d,m),l=a.mul(l,f),u=p}return d}}function jl(e){if(e%tr===Ul){const t=(e+U)/tr;return function(r,i){const s=r.pow(i,t);if(!r.eql(r.sqr(s),i))throw new Error("Cannot find square root");return s}}if(e%xi===wi){const t=(e-wi)/xi;return function(r,i){const s=r.mul(i,Me),o=r.pow(s,t),a=r.mul(i,o),c=r.mul(r.mul(a,Me),o),u=r.mul(a,r.sub(c,r.ONE));if(!r.eql(r.sqr(u),i))throw new Error("Cannot find square root");return u}}return kl(e)}const Fl=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Dl(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=Fl.reduce((r,i)=>(r[i]="function",r),t);return en(e,n)}function Hl(e,t,n){if(n<H)throw new Error("invalid exponent, negatives unsupported");if(n===H)return e.ONE;if(n===U)return t;let r=e.ONE,i=t;for(;n>H;)n&U&&(r=e.mul(r,i)),i=e.sqr(i),n>>=U;return r}function Vl(e,t){const n=new Array(t.length),r=t.reduce((s,o,a)=>e.is0(o)?s:(n[a]=s,e.mul(s,o)),e.ONE),i=e.inv(r);return t.reduceRight((s,o,a)=>e.is0(o)?s:(n[a]=e.mul(s,n[a]),e.mul(s,o)),i),n}function Eo(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function vo(e,t,n=!1,r={}){if(e<=H)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:s}=Eo(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:e,isLE:n,BITS:i,BYTES:s,MASK:Qt(i),ZERO:H,ONE:U,create:c=>Q(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return H<=c&&c<e},is0:c=>c===H,isOdd:c=>(c&U)===U,neg:c=>Q(-c,e),eql:(c,u)=>c===u,sqr:c=>Q(c*c,e),add:(c,u)=>Q(c+u,e),sub:(c,u)=>Q(c-u,e),mul:(c,u)=>Q(c*u,e),pow:(c,u)=>Hl(a,c,u),div:(c,u)=>Q(c*nr(u,e),e),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>nr(c,e),sqrt:r.sqrt||(c=>(o||(o=jl(e)),o(a,c))),invertBatch:c=>Vl(a,c),cmov:(c,u,f)=>f?u:c,toBytes:c=>n?Ni(c,s):$t(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return n?Ci(c):Ce(c)}});return Object.freeze(a)}function Ao(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Po(e){const t=Ao(e);return t+Math.ceil(t/2)}function Gl(e,t,n=!1){const r=e.length,i=Ao(t),s=Po(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const o=n?Ci(e):Ce(e),a=Q(o,t-U)+U;return n?Ni(a,i):$t(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $i=BigInt(0),rr=BigInt(1);function Ln(e,t){const n=t.negate();return e?n:t}function Io(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Mn(e,t){Io(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e,s=Qt(e),o=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:i,shiftBy:o}}function Ei(e,t,n){const{windowSize:r,mask:i,maxNumber:s,shiftBy:o}=n;let a=Number(e&i),c=e>>o;a>r&&(a-=s,c+=rr);const u=t*r,f=u+Math.abs(a)-1,d=a===0,l=a<0,p=t%2!==0;return{nextN:c,offset:f,isZero:d,isNeg:l,isNegF:p,offsetF:u}}function ql(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function Wl(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const Cn=new WeakMap,Bo=new WeakMap;function Nn(e){return Bo.get(e)||1}function Zl(e,t){return{constTimeNegate:Ln,hasPrecomputes(n){return Nn(n)!==1},unsafeLadder(n,r,i=e.ZERO){let s=n;for(;r>$i;)r&rr&&(i=i.add(s)),s=s.double(),r>>=rr;return i},precomputeWindow(n,r){const{windows:i,windowSize:s}=Mn(r,t),o=[];let a=n,c=a;for(let u=0;u<i;u++){c=a,o.push(c);for(let f=1;f<s;f++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(n,r,i){let s=e.ZERO,o=e.BASE;const a=Mn(n,t);for(let c=0;c<a.windows;c++){const{nextN:u,offset:f,isZero:d,isNeg:l,isNegF:p,offsetF:m}=Ei(i,c,a);i=u,d?o=o.add(Ln(p,r[m])):s=s.add(Ln(l,r[f]))}return{p:s,f:o}},wNAFUnsafe(n,r,i,s=e.ZERO){const o=Mn(n,t);for(let a=0;a<o.windows&&i!==$i;a++){const{nextN:c,offset:u,isZero:f,isNeg:d}=Ei(i,a,o);if(i=c,!f){const l=r[u];s=s.add(d?l.negate():l)}}return s},getPrecomputes(n,r,i){let s=Cn.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&Cn.set(r,i(s))),s},wNAFCached(n,r,i){const s=Nn(n);return this.wNAF(s,this.getPrecomputes(s,n,i),r)},wNAFCachedUnsafe(n,r,i,s){const o=Nn(n);return o===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(o,this.getPrecomputes(o,n,i),r,s)},setWindowSize(n,r){Io(r,t),Bo.set(n,r),Cn.delete(n)}}}function Kl(e,t,n,r){if(ql(n,e),Wl(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,s=na(BigInt(n.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=Qt(o),c=new Array(Number(a)+1).fill(i),u=Math.floor((t.BITS-1)/o)*o;let f=i;for(let d=u;d>=0;d-=o){c.fill(i);for(let p=0;p<r.length;p++){const m=r[p],y=Number(m>>BigInt(d)&a);c[y]=c[y].add(n[p])}let l=i;for(let p=c.length-1,m=i;p>0;p--)m=m.add(c[p]),l=l.add(m);if(f=f.add(l),d!==0)for(let p=0;p<o;p++)f=f.double()}return f}function So(e){return Dl(e.Fp),en(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Eo(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function vi(e){e.lowS!==void 0&&wt("lowS",e.lowS),e.prehash!==void 0&&wt("prehash",e.prehash)}function Yl(e){const t=So(e);en(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}class Xl extends Error{constructor(t=""){super(t)}}const we={Err:Xl,_tlv:{encode:(e,t)=>{const{Err:n}=we;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,i=Mt(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Mt(i.length/2|128):"";return Mt(e)+s+i+t},decode(e,t){const{Err:n}=we;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 i=t[r++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new n("tlv.decode(long): indefinite length not supported");if(c>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+c);if(u.length!==c)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const f of u)o=o<<8|f;if(r+=c,o<128)throw new n("tlv.decode(long): not minimal encoding")}const a=t.subarray(r,r+o);if(a.length!==o)throw new n("tlv.decode: wrong value length");return{v:a,l:t.subarray(r+o)}}},_int:{encode(e){const{Err:t}=we;if(e<xe)throw new t("integer: negative integers are not allowed");let n=Mt(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=we;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Ce(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=we,i=se("signature",e),{v:s,l:o}=r.decode(48,i);if(o.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=r.decode(2,s),{v:u,l:f}=r.decode(2,c);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=we,r=t.encode(2,n.encode(e.r)),i=t.encode(2,n.encode(e.s)),s=r+i;return t.encode(48,s)}},xe=BigInt(0),D=BigInt(1);BigInt(2);const Ai=BigInt(3);BigInt(4);function Jl(e){const t=Yl(e),{Fp:n}=t,r=vo(t.n,t.nBitLength),i=t.toBytes||((y,h,g)=>{const b=h.toAffine();return Ft(Uint8Array.from([4]),n.toBytes(b.x),n.toBytes(b.y))}),s=t.fromBytes||(y=>{const h=y.subarray(1),g=n.fromBytes(h.subarray(0,n.BYTES)),b=n.fromBytes(h.subarray(n.BYTES,2*n.BYTES));return{x:g,y:b}});function o(y){const{a:h,b:g}=t,b=n.sqr(y),x=n.mul(b,y);return n.add(n.add(x,n.mul(y,h)),g)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(y){return ur(y,D,t.n)}function c(y){const{allowedPrivateKeyLengths:h,nByteLength:g,wrapPrivateKey:b,n:x}=t;if(h&&typeof y!="bigint"){if(nt(y)&&(y=xt(y)),typeof y!="string"||!h.includes(y.length))throw new Error("invalid private key");y=y.padStart(g*2,"0")}let v;try{v=typeof y=="bigint"?y:Ce(se("private key",y,g))}catch{throw new Error("invalid private key, expected hex or "+g+" bytes, got "+typeof y)}return b&&(v=Q(v,x)),Qe("private key",v,D,x),v}function u(y){if(!(y instanceof l))throw new Error("ProjectivePoint expected")}const f=Hr((y,h)=>{const{px:g,py:b,pz:x}=y;if(n.eql(x,n.ONE))return{x:g,y:b};const v=y.is0();h==null&&(h=v?n.ONE:n.inv(x));const B=n.mul(g,h),_=n.mul(b,h),A=n.mul(x,h);if(v)return{x:n.ZERO,y:n.ZERO};if(!n.eql(A,n.ONE))throw new Error("invZ was invalid");return{x:B,y:_}}),d=Hr(y=>{if(y.is0()){if(t.allowInfinityPoint&&!n.is0(y.py))return;throw new Error("bad point: ZERO")}const{x:h,y:g}=y.toAffine();if(!n.isValid(h)||!n.isValid(g))throw new Error("bad point: x or y not FE");const b=n.sqr(g),x=o(h);if(!n.eql(b,x))throw new Error("bad point: equation left != right");if(!y.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class l{constructor(h,g,b){if(h==null||!n.isValid(h))throw new Error("x required");if(g==null||!n.isValid(g))throw new Error("y required");if(b==null||!n.isValid(b))throw new Error("z required");this.px=h,this.py=g,this.pz=b,Object.freeze(this)}static fromAffine(h){const{x:g,y:b}=h||{};if(!h||!n.isValid(g)||!n.isValid(b))throw new Error("invalid affine point");if(h instanceof l)throw new Error("projective point not allowed");const x=v=>n.eql(v,n.ZERO);return x(g)&&x(b)?l.ZERO:new l(g,b,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(h){const g=n.invertBatch(h.map(b=>b.pz));return h.map((b,x)=>b.toAffine(g[x])).map(l.fromAffine)}static fromHex(h){const g=l.fromAffine(s(se("pointHex",h)));return g.assertValidity(),g}static fromPrivateKey(h){return l.BASE.multiply(c(h))}static msm(h,g){return Kl(l,r,h,g)}_setWindowSize(h){m.setWindowSize(this,h)}assertValidity(){d(this)}hasEvenY(){const{y:h}=this.toAffine();if(n.isOdd)return!n.isOdd(h);throw new Error("Field doesn't support isOdd")}equals(h){u(h);const{px:g,py:b,pz:x}=this,{px:v,py:B,pz:_}=h,A=n.eql(n.mul(g,_),n.mul(v,x)),O=n.eql(n.mul(b,_),n.mul(B,x));return A&&O}negate(){return new l(this.px,n.neg(this.py),this.pz)}double(){const{a:h,b:g}=t,b=n.mul(g,Ai),{px:x,py:v,pz:B}=this;let _=n.ZERO,A=n.ZERO,O=n.ZERO,T=n.mul(x,x),V=n.mul(v,v),C=n.mul(B,B),M=n.mul(x,v);return M=n.add(M,M),O=n.mul(x,B),O=n.add(O,O),_=n.mul(h,O),A=n.mul(b,C),A=n.add(_,A),_=n.sub(V,A),A=n.add(V,A),A=n.mul(_,A),_=n.mul(M,_),O=n.mul(b,O),C=n.mul(h,C),M=n.sub(T,C),M=n.mul(h,M),M=n.add(M,O),O=n.add(T,T),T=n.add(O,T),T=n.add(T,C),T=n.mul(T,M),A=n.add(A,T),C=n.mul(v,B),C=n.add(C,C),T=n.mul(C,M),_=n.sub(_,T),O=n.mul(C,V),O=n.add(O,O),O=n.add(O,O),new l(_,A,O)}add(h){u(h);const{px:g,py:b,pz:x}=this,{px:v,py:B,pz:_}=h;let A=n.ZERO,O=n.ZERO,T=n.ZERO;const V=t.a,C=n.mul(t.b,Ai);let M=n.mul(g,v),ee=n.mul(b,B),w=n.mul(x,_),$=n.add(g,b),E=n.add(v,B);$=n.mul($,E),E=n.add(M,ee),$=n.sub($,E),E=n.add(g,x);let z=n.add(v,_);return E=n.mul(E,z),z=n.add(M,w),E=n.sub(E,z),z=n.add(b,x),A=n.add(B,_),z=n.mul(z,A),A=n.add(ee,w),z=n.sub(z,A),T=n.mul(V,E),A=n.mul(C,w),T=n.add(A,T),A=n.sub(ee,T),T=n.add(ee,T),O=n.mul(A,T),ee=n.add(M,M),ee=n.add(ee,M),w=n.mul(V,w),E=n.mul(C,E),ee=n.add(ee,w),w=n.sub(M,w),w=n.mul(V,w),E=n.add(E,w),M=n.mul(ee,E),O=n.add(O,M),M=n.mul(z,E),A=n.mul($,A),A=n.sub(A,M),M=n.mul($,ee),T=n.mul(z,T),T=n.add(T,M),new l(A,O,T)}subtract(h){return this.add(h.negate())}is0(){return this.equals(l.ZERO)}wNAF(h){return m.wNAFCached(this,h,l.normalizeZ)}multiplyUnsafe(h){const{endo:g,n:b}=t;Qe("scalar",h,xe,b);const x=l.ZERO;if(h===xe)return x;if(this.is0()||h===D)return this;if(!g||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,h,l.normalizeZ);let{k1neg:v,k1:B,k2neg:_,k2:A}=g.splitScalar(h),O=x,T=x,V=this;for(;B>xe||A>xe;)B&D&&(O=O.add(V)),A&D&&(T=T.add(V)),V=V.double(),B>>=D,A>>=D;return v&&(O=O.negate()),_&&(T=T.negate()),T=new l(n.mul(T.px,g.beta),T.py,T.pz),O.add(T)}multiply(h){const{endo:g,n:b}=t;Qe("scalar",h,D,b);let x,v;if(g){const{k1neg:B,k1:_,k2neg:A,k2:O}=g.splitScalar(h);let{p:T,f:V}=this.wNAF(_),{p:C,f:M}=this.wNAF(O);T=m.constTimeNegate(B,T),C=m.constTimeNegate(A,C),C=new l(n.mul(C.px,g.beta),C.py,C.pz),x=T.add(C),v=V.add(M)}else{const{p:B,f:_}=this.wNAF(h);x=B,v=_}return l.normalizeZ([x,v])[0]}multiplyAndAddUnsafe(h,g,b){const x=l.BASE,v=(_,A)=>A===xe||A===D||!_.equals(x)?_.multiplyUnsafe(A):_.multiply(A),B=v(this,g).add(v(h,b));return B.is0()?void 0:B}toAffine(h){return f(this,h)}isTorsionFree(){const{h,isTorsionFree:g}=t;if(h===D)return!0;if(g)return g(l,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h,clearCofactor:g}=t;return h===D?this:g?g(l,this):this.multiplyUnsafe(t.h)}toRawBytes(h=!0){return wt("isCompressed",h),this.assertValidity(),i(l,this,h)}toHex(h=!0){return wt("isCompressed",h),xt(this.toRawBytes(h))}}l.BASE=new l(t.Gx,t.Gy,n.ONE),l.ZERO=new l(n.ZERO,n.ONE,n.ZERO);const p=t.nBitLength,m=Zl(l,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:o,isWithinCurveOrder:a}}function Ql(e){const t=So(e);return en(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function eh(e){const t=Ql(e),{Fp:n,n:r}=t,i=n.BYTES+1,s=2*n.BYTES+1;function o(w){return Q(w,r)}function a(w){return nr(w,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:f,isWithinCurveOrder:d}=Jl({...t,toBytes(w,$,E){const z=$.toAffine(),L=n.toBytes(z.x),k=Ft;return wt("isCompressed",E),E?k(Uint8Array.from([$.hasEvenY()?2:3]),L):k(Uint8Array.from([4]),L,n.toBytes(z.y))},fromBytes(w){const $=w.length,E=w[0],z=w.subarray(1);if($===i&&(E===2||E===3)){const L=Ce(z);if(!ur(L,D,n.ORDER))throw new Error("Point is not on curve");const k=f(L);let X;try{X=n.sqrt(k)}catch(ie){const J=ie instanceof Error?": "+ie.message:"";throw new Error("Point is not on curve"+J)}const Z=(X&D)===D;return(E&1)===1!==Z&&(X=n.neg(X)),{x:L,y:X}}else if($===s&&E===4){const L=n.fromBytes(z.subarray(0,n.BYTES)),k=n.fromBytes(z.subarray(n.BYTES,2*n.BYTES));return{x:L,y:k}}else{const L=i,k=s;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+k+", got "+$)}}}),l=w=>xt($t(w,t.nByteLength));function p(w){const $=r>>D;return w>$}function m(w){return p(w)?o(-w):w}const y=(w,$,E)=>Ce(w.slice($,E));class h{constructor($,E,z){Qe("r",$,D,r),Qe("s",E,D,r),this.r=$,this.s=E,z!=null&&(this.recovery=z),Object.freeze(this)}static fromCompact($){const E=t.nByteLength;return $=se("compactSignature",$,E*2),new h(y($,0,E),y($,E,2*E))}static fromDER($){const{r:E,s:z}=we.toSig(se("DER",$));return new h(E,z)}assertValidity(){}addRecoveryBit($){return new h(this.r,this.s,$)}recoverPublicKey($){const{r:E,s:z,recovery:L}=this,k=_(se("msgHash",$));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const X=L===2||L===3?E+t.n:E;if(X>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const Z=(L&1)===0?"02":"03",pe=c.fromHex(Z+l(X)),ie=a(X),J=o(-k*ie),Ve=o(z*ie),ve=c.BASE.multiplyAndAddUnsafe(pe,J,Ve);if(!ve)throw new Error("point at infinify");return ve.assertValidity(),ve}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,o(-this.s),this.recovery):this}toDERRawBytes(){return jt(this.toDERHex())}toDERHex(){return we.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return jt(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const g={isValidPrivateKey(w){try{return u(w),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const w=Po(t.n);return Gl(t.randomBytes(w),t.n)},precompute(w=8,$=c.BASE){return $._setWindowSize(w),$.multiply(BigInt(3)),$}};function b(w,$=!0){return c.fromPrivateKey(w).toRawBytes($)}function x(w){const $=nt(w),E=typeof w=="string",z=($||E)&&w.length;return $?z===i||z===s:E?z===2*i||z===2*s:w instanceof c}function v(w,$,E=!0){if(x(w))throw new Error("first arg must be private key");if(!x($))throw new Error("second arg must be public key");return c.fromHex($).multiply(u(w)).toRawBytes(E)}const B=t.bits2int||function(w){if(w.length>8192)throw new Error("input is too large");const $=Ce(w),E=w.length*8-t.nBitLength;return E>0?$>>BigInt(E):$},_=t.bits2int_modN||function(w){return o(B(w))},A=Qt(t.nBitLength);function O(w){return Qe("num < 2^"+t.nBitLength,w,xe,A),$t(w,t.nByteLength)}function T(w,$,E=V){if(["recovered","canonical"].some(Oe=>Oe in E))throw new Error("sign() legacy options not supported");const{hash:z,randomBytes:L}=t;let{lowS:k,prehash:X,extraEntropy:Z}=E;k==null&&(k=!0),w=se("msgHash",w),vi(E),X&&(w=se("prehashed msgHash",z(w)));const pe=_(w),ie=u($),J=[O(ie),O(pe)];if(Z!=null&&Z!==!1){const Oe=Z===!0?L(n.BYTES):Z;J.push(se("extraEntropy",Oe))}const Ve=Ft(...J),ve=pe;function xn(Oe){const Ge=B(Oe);if(!d(Ge))return;const $n=a(Ge),lt=c.BASE.multiply(Ge).toAffine(),Le=o(lt.x);if(Le===xe)return;const ht=o($n*o(ve+Le*ie));if(ht===xe)return;let pt=(lt.x===Le?0:2)|Number(lt.y&D),qe=ht;return k&&p(ht)&&(qe=m(ht),pt^=1),new h(Le,qe,pt)}return{seed:Ve,k2sig:xn}}const V={lowS:t.lowS,prehash:!1},C={lowS:t.lowS,prehash:!1};function M(w,$,E=V){const{seed:z,k2sig:L}=T(w,$,E),k=t;return ra(k.hash.outputLen,k.nByteLength,k.hmac)(z,L)}c.BASE._setWindowSize(8);function ee(w,$,E,z=C){var pt;const L=w;$=se("msgHash",$),E=se("publicKey",E);const{lowS:k,prehash:X,format:Z}=z;if(vi(z),"strict"in z)throw new Error("options.strict was renamed to lowS");if(Z!==void 0&&Z!=="compact"&&Z!=="der")throw new Error("format must be compact or der");const pe=typeof L=="string"||nt(L),ie=!pe&&!Z&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!pe&&!ie)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let J,Ve;try{if(ie&&(J=new h(L.r,L.s)),pe){try{Z!=="compact"&&(J=h.fromDER(L))}catch(qe){if(!(qe instanceof we.Err))throw qe}!J&&Z!=="der"&&(J=h.fromCompact(L))}Ve=c.fromHex(E)}catch{return!1}if(!J||k&&J.hasHighS())return!1;X&&($=t.hash($));const{r:ve,s:xn}=J,Oe=_($),Ge=a(xn),$n=o(Oe*Ge),lt=o(ve*Ge),Le=(pt=c.BASE.multiplyAndAddUnsafe(Ve,$n,lt))==null?void 0:pt.toAffine();return Le?o(Le.x)===ve:!1}return{CURVE:t,getPublicKey:b,getSharedSecret:v,sign:M,verify:ee,ProjectivePoint:c,Signature:h,utils:g}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function th(e){return{hash:e,hmac:(t,...n)=>$o(e,t,Ya(...n)),randomBytes:Xa}}function nh(e,t){const n=r=>eh({...e,...th(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const To=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Pi=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),rh=BigInt(1),ir=BigInt(2),Ii=(e,t)=>(e+t/ir)/t;function ih(e){const t=To,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=e*e*e%t,f=u*u*e%t,d=te(f,n,t)*f%t,l=te(d,n,t)*f%t,p=te(l,ir,t)*u%t,m=te(p,i,t)*p%t,y=te(m,s,t)*m%t,h=te(y,a,t)*y%t,g=te(h,c,t)*h%t,b=te(g,a,t)*y%t,x=te(b,n,t)*f%t,v=te(x,o,t)*m%t,B=te(v,r,t)*u%t,_=te(B,ir,t);if(!sr.eql(sr.sqr(_),e))throw new Error("Cannot find square root");return _}const sr=vo(To,void 0,void 0,{sqrt:ih}),pn=nh({a:BigInt(0),b:BigInt(7),Fp:sr,n:Pi,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Pi,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-rh*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),a=Ii(s*e,t),c=Ii(-r*e,t);let u=Q(e-a*n-c*i,t),f=Q(-a*r-c*s,t);const d=u>o,l=f>o;if(d&&(u=t-u),l&&(f=t-f),u>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:l,k2:f}}}},mc);BigInt(0);pn.ProjectivePoint;function _o(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Un({signature:e});if(typeof e.s>"u")throw new Un({signature:e});if(n&&typeof e.yParity>"u")throw new Un({signature:e});if(e.r<0n||e.r>gi)throw new dh({value:e.r});if(e.s<0n||e.s>gi)throw new lh({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new mn({value:e.yParity})}function sh(e){return zo(Y(e))}function zo(e){if(e.length!==130&&e.length!==132)throw new fh({signature:e});const t=BigInt(K(e,0,32)),n=BigInt(K(e,32,64)),r=(()=>{const i=+`0x${e.slice(130)}`;if(!Number.isNaN(i))try{return gn(i)}catch{throw new mn({value:i})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function Ot(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return oh(e)}function oh(e){const t=typeof e=="string"?zo(e):e instanceof Uint8Array?sh(e):typeof e.r=="string"?ah(e):e.v?Oo(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return _o(t),t}function Oo(e){return{r:e.r,s:e.s,yParity:gn(e.v)}}function ah(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=gn(n)),typeof r!="number")throw new mn({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function ch(e){_o(e);const t=e.r,n=e.s;return N(I(t,{size:32}),I(n,{size:32}),typeof e.yParity=="number"?I(Lo(e.yParity),{size:1}):"0x")}function uh(e){const{r:t,s:n,yParity:r}=e;return{r:I(t,{size:32}),s:I(n,{size:32}),yParity:r===0?"0x0":"0x1"}}function yn(e){const{r:t,s:n,yParity:r}=e;return[r?"0x01":"0x",t===0n?"0x":Et(I(t)),n===0n?"0x":Et(I(n))]}function gn(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new Mo({value:e})}function Lo(e){if(e===0)return 27;if(e===1)return 28;throw new mn({value:e})}class fh extends P{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${R(tn(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Un extends P{constructor({signature:t}){super(`Signature \`${ct(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class dh extends P{constructor({value:t}){super(`Value \`${t}\` 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 lh extends P{constructor({value:t}){super(`Value \`${t}\` 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 mn extends P{constructor({value:t}){super(`Value \`${t}\` 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 Mo extends P{constructor({value:t}){super(`Value \`${t}\` 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 Wp(e,t={}){return typeof e.chainId=="string"?hh(e):{...e,...t.signature}}function hh(e){const{address:t,chainId:n,nonce:r}=e,i=Ot(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...i}}function Zp(e){return ph(e)}function ph(e){return ne(N("0x05",zt(Co(e))))}function yh(e){const{address:t,chainId:n,nonce:r,...i}=e;return{address:t,chainId:I(n),nonce:I(r),...uh(i)}}function Kp(e){return e.map(yh)}function Co(e){const{address:t,chainId:n,nonce:r}=e,i=Ot(e);return[n?I(n):"0x",t,r?I(r):"0x",...i?yn(i):[]]}function gh(e){if(!e||e.length===0)return[];const t=[];for(const n of e)t.push(Co(n));return t}let mh=!1;function Yp(e={}){const{as:t="Hex"}=e,n=pn.utils.randomPrivateKey();return t==="Hex"?Y(n):n}function Xp(e){return Jd(bh(e))}function bh(e){const{payload:t,signature:n}=e,{r,s:i,yParity:s}=n,a=new pn.Signature(BigInt(r),BigInt(i)).addRecoveryBit(s).recoverPublicKey(tn(t).substring(2));return Hd(a)}function wh(e){const{extraEntropy:t=mh,hash:n,payload:r,privateKey:i}=e,{r:s,s:o,recovery:a}=pn.sign(Fn(r),Fn(i),{extraEntropy:typeof t=="boolean"?t:tn(t).slice(2),lowS:!0,...n?{prehash:!0}:{}});return{r:s,s:o,yParity:a}}const Bi={wei:0,gwei:9,szabo:12,finney:15,ether:18};function xh(e,t=0){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[i,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${s?`.${s}`:""}`}function Xt(e,t="wei"){return xh(e,Bi.gwei-Bi[t])}function Jp(e,t=0){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new $h({value:e});let[n="",r="0"]=e.split(".");const i=n.startsWith("-");if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[s,o,a]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],c=Math.round(+`${o}.${a}`);c>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${c}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${i?"-":""}${n}${r}`)}class $h extends P{constructor({value:t}){super(`Value \`${t}\` is not a valid decimal number.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Value.InvalidDecimalNumberError"})}}class Eh extends P{constructor({feeCap:t}={}){super(`The fee cap (\`maxFeePerGas\`/\`maxPriorityFeePerGas\`${t?` = ${Xt(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.FeeCapTooHighError"})}}class No extends P{constructor({gasPrice:t}={}){super(`The gas price (\`gasPrice\`${t?` = ${Xt(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.GasPriceTooHighError"})}}class bn extends P{constructor({chainId:t}){super(typeof t<"u"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.InvalidChainIdError"})}}class vh extends P{constructor({maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Xt(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Xt(n)} gwei`:""}).`].join(`
|
|
29
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}function Uo(e){const{chainId:t,gasPrice:n,to:r}=e;if(r&&he(r,{strict:!1}),typeof t<"u"&&t<=0)throw new bn({chainId:t});if(n&&BigInt(n)>2n**256n-1n)throw new No({gasPrice:n})}function Ah(e,t={}){const{chainId:n=0,gas:r,data:i,input:s,nonce:o,to:a,value:c,gasPrice:u}=e;Uo(e);let f=[o?I(o):"0x",u?I(u):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",i??s??"0x"];const d=(()=>{if(t.signature)return{r:t.signature.r,s:t.signature.s,v:Lo(t.signature.yParity)};if(!(typeof e.r>"u"||typeof e.s>"u"))return{r:e.r,s:e.s,v:e.v}})();if(d){const l=(()=>{if(d.v>=35)return Math.floor((d.v-35)/2)>0?d.v:27+(d.v===35?0:1);if(n>0)return n*2+35+d.v-27;const p=27+(d.v===27?0:1);if(d.v!==p)throw new Mo({value:d.v});return p})();f=[...f,I(l),d.r===0n?"0x":Et(I(d.r)),d.s===0n?"0x":Et(I(d.s))]}else n>0&&(f=[...f,I(n),"0x","0x"]);return zt(f)}const Ph="0x02";function Mr(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:i}=e;if(t<=0)throw new bn({chainId:t});if(i&&he(i,{strict:!1}),r&&BigInt(r)>2n**256n-1n)throw new Eh({feeCap:r});if(n&&r&&n>r)throw new vh({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Ih(e,t={}){const{chainId:n,gas:r,nonce:i,to:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:f,input:d}=e;Mr(e);const l=Lr(u),p=Ot(t.signature||e),m=[I(n),i?I(i):"0x",c?I(c):"0x",a?I(a):"0x",r?I(r):"0x",s??"0x",o?I(o):"0x",f??d??"0x",l,...p?yn(p):[]];return N(Ph,zt(m))}function Ro(e){const{chainId:t,gasPrice:n,to:r}=e;if(t<=0)throw new bn({chainId:t});if(r&&he(r,{strict:!1}),n&&BigInt(n)>2n**256n-1n)throw new No({gasPrice:n})}function Bh(e,t={}){const{chainId:n,gas:r,data:i,input:s,nonce:o,to:a,value:c,accessList:u,gasPrice:f}=e;Ro(e);const d=Lr(u),l=Ot(t.signature||e),p=[I(n),o?I(o):"0x",f?I(f):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",i??s??"0x",d,...l?yn(l):[]];return N("0x01",zt(p))}const Sh="0x04";function ko(e){const{authorizationList:t}=e;if(t)for(const n of t){const{address:r,chainId:i}=n;if(r&&he(r,{strict:!1}),Number(i)<0)throw new bn({chainId:i})}Mr(e)}function Th(e,t={}){const{authorizationList:n,chainId:r,gas:i,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:f,data:d,input:l}=e;ko(e);const p=Lr(f),m=gh(n),y=Ot(t.signature||e),h=[I(r),s?I(s):"0x",u?I(u):"0x",c?I(c):"0x",i?I(i):"0x",o??"0x",a?I(a):"0x",d??l??"0x",p,m,...y?yn(y):[]];return N(Sh,zt(h))}function jo(e){const{domain:t,message:n,primaryType:r,types:i}=e,s=(o,a)=>{for(const c of o){const{name:u,type:f}=c,d=a[u],l=f.match(Br);if(l&&(typeof d=="number"||typeof d=="bigint")){const[,y,h]=l;I(d,{signed:y==="int",size:Number.parseInt(h??"")/8})}if(f==="address"&&typeof d=="string"&&!Kt(d))throw new Yn({address:d,cause:new fo});const p=f.match(po);if(p){const[,y]=p;if(y&&R(d)!==Number.parseInt(y))throw new Lh({expectedSize:Number.parseInt(y),givenSize:R(d)})}const m=i[f];m&&(Rh(f),s(m,d))}};if(i.EIP712Domain&&t){if(typeof t!="object")throw new Mh({domain:t});s(i.EIP712Domain,t)}if(r!=="EIP712Domain")if(i[r])s(i[r],n);else throw new Ch({primaryType:r,types:i})}function _h(e){const{domain:t={},message:n,primaryType:r}=e,i={EIP712Domain:wn(t),...e.types};jo({domain:t,message:n,primaryType:r,types:i});const s=["0x19","0x01"];return t&&s.push(Fo({domain:t,types:i})),r!=="EIP712Domain"&&s.push(Do({data:n,primaryType:r,types:i})),N(...s)}function zh(e){const{primaryType:t,types:n}=e;let r="";const i=Go({primaryType:t,types:n});i.delete(t);const s=[t,...Array.from(i).sort()];for(const o of s)r+=`${o}(${(n[o]??[]).map(({name:a,type:c})=>`${c} ${a}`).join(",")})`;return r}function wn(e){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Qp(e){return ne(_h(e))}function Fo(e){const{domain:t,types:n}=e;return Do({data:t,primaryType:"EIP712Domain",types:{...n,EIP712Domain:(n==null?void 0:n.EIP712Domain)||wn(t)}})}function Do(e){const{data:t,primaryType:n,types:r}=e,i=Ho({data:t,primaryType:n,types:r});return ne(i)}function ey(e){const{domain:t,message:n,primaryType:r,types:i}=e,s=(c,u)=>{const f={...u};for(const d of c){const{name:l,type:p}=d;p==="address"&&(f[l]=f[l].toLowerCase())}return f},o=(()=>{if(!t)return{};const c=i.EIP712Domain??wn(t);return s(c,t)})(),a=(()=>{if(r!=="EIP712Domain")return i[r]?s(i[r],n):{}})();return ct({domain:o,message:a,primaryType:r,types:i},(c,u)=>typeof u=="bigint"?u.toString():u)}function Oh(e){try{return jo(e),!0}catch{return!1}}class Lh extends P{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.BytesSizeMismatchError"})}}class Mh extends P{constructor({domain:t}){super(`Invalid domain "${ct(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidDomainError"})}}class Ch extends P{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{metaMessages:["Check that the primary type is a key in `types`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidPrimaryTypeError"})}}class Nh extends P{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidStructTypeError"})}}function Ho(e){const{data:t,primaryType:n,types:r}=e,i=[{type:"bytes32"}],s=[Uh({primaryType:n,types:r})];for(const o of r[n]??[]){const[a,c]=Vo({types:r,name:o.name,type:o.type,value:t[o.name]});i.push(a),s.push(c)}return hn(i,s)}function Uh(e){const{primaryType:t,types:n}=e,r=St(zh({primaryType:t,types:n}));return ne(r)}function Vo(e){let{types:t,name:n,type:r,value:i}=e;if(t[r]!==void 0)return[{type:"bytes32"},ne(Ho({data:i,primaryType:r,types:t}))];if(r==="bytes")return i=`0x${(i.length%2?"0":"")+i.slice(2)}`,[{type:"bytes32"},ne(i,{as:"Hex"})];if(r==="string")return[{type:"bytes32"},ne(lr(i),{as:"Hex"})];if(r.lastIndexOf("]")===r.length-1){const s=r.slice(0,r.lastIndexOf("[")),o=i.map(a=>Vo({name:n,type:s,types:t,value:a}));return[{type:"bytes32"},ne(hn(o.map(([a])=>a),o.map(([,a])=>a)))]}return[{type:r},i]}function Go(e,t=new Set){const{primaryType:n,types:r}=e,i=n.match(/^\w*/u),s=i==null?void 0:i[0];if(t.has(s)||r[s]===void 0)return t;t.add(s);for(const o of r[s])Go({primaryType:o.type,types:r},t);return t}function Rh(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Nh({type:e})}function It(e){return Fe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function He(e,t){if(e.length!==t.length)throw new Error("The number of parameters and values must match.");const n=kh({params:e,values:t}),r=Nr(n);return r.length===0?"0x":r}function kh({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Cr({param:e[r],value:t[r]}));return n}function Cr({param:e,value:t}){const n=Wh(e.type);if(n){const[r,i]=n;return Fh(t,{length:r,param:{...e,type:i}})}if(e.type==="tuple")return qh(t,{param:e});if(e.type==="address")return jh(t);if(e.type==="bool")return Hh(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return Vh(t,{signed:r})}if(e.type.startsWith("bytes"))return Dh(t,{param:e});if(e.type==="string")return Gh(t);throw new Error(`Unsupported parameter type: ${e.type}`)}function Nr(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?t+=32:t+=It(a)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push(de(t+i,{size:32})),r.push(a),i+=It(a)):n.push(a)}return N(...n,...r)}function jh(e){if(e!==""&&e!==void 0&&!yr(e))throw new Error(`Invalid address: ${e}`);return{dynamic:!1,encoded:Ne(e.toLowerCase())}}function Fh(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Error("Invalid array value.");if(!r&&e.length!==t)throw new Error("Invalid array length.");let i=!1;const s=[];for(let o=0;o<e.length;o++){const a=Cr({param:n,value:e[o]});a.dynamic&&(i=!0),s.push(a)}if(r||i){const o=Nr(s);if(r){const a=de(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?N(a,o):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:N(...s.map(({encoded:o})=>o))}}function Dh(e,{param:t}){const[,n]=t.type.split("bytes"),r=It(e);if(!n){let i=e;return r%32!==0&&(i=Ne(i,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:N(Ne(de(r,{size:32})),i)}}if(r!==Number.parseInt(n))throw new Error(`Invalid bytes${n} size: ${r}`);return{dynamic:!1,encoded:Ne(e,{dir:"right"})}}function Hh(e){return{dynamic:!1,encoded:Ne(ss(e))}}function Vh(e,{signed:t}){return{dynamic:!1,encoded:de(e,{signed:t,size:32})}}function Gh(e){const t=sn(e),n=Math.ceil(It(t)/32),r=[];for(let i=0;i<n;i++)r.push(Ne(K(t,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:N(Ne(de(It(t),{size:32})),...r)}}function qh(e,{param:t}){let n=!1;const r=[];for(let i=0;i<t.components.length;i++){const s=t.components[i],o=Array.isArray(e)?i:s.name,a=Cr({param:s,value:e[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Nr(r):N(...r.map(({encoded:i})=>i))}}function Wh(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Rn=new _i(4096);function Be(e){const t=typeof e=="string"?e:fe(e);if(Rn.has(t))return Rn.get(t);const n=typeof e=="string"?ot(e):e,i=[vr(n),n.inputs,n.outputs];return Rn.set(t,i),i}function qo(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="function")}async function Ur(e){const{contract:t,method:n,params:r}=e,i=async()=>{var d,l;if(Array.isArray(n))return n;if(qo(n))return Be(n);if(typeof n=="function")return Be(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const p=ot(n);if(p.type==="function")return Be(p);throw new Error('"method" passed is not of type "function"')}if(t.abi&&((d=t.abi)==null?void 0:d.length)>0){const p=(l=t.abi)==null?void 0:l.find(m=>m.type==="function"&&m.name===n);if(p)return Be(p)}throw new Error(`Could not resolve method "${n}".`)},[s,o]=await Promise.all([i(),typeof r=="function"?r():r]);let a;s[1].length===0?a=s[0]:a=s[0]+He(s[1],o).slice(2);const c=De({chain:t.chain,client:t.client}),u=await ao(c,{data:a,from:e.from?Ie(e.from):void 0,to:t.address}),f=fn(s[2],u);return Array.isArray(f)&&f.length===1?f[0]:f}const Rr=Object.freeze(Object.defineProperty({__proto__:null,readContract:Ur},Symbol.toStringTag,{value:"Module"}));function Zh(e){const t=new Set;let n=e;const r=()=>{for(const i of t)i()};return{getValue(){return n},setValue(i){i!==n&&(n=i,r())},subscribe(i){return t.add(i),()=>{t.delete(i)}}}}const or=new Map;function Kh(e){const t=or.get(e);if(t)return t;const n=Zh([]);return or.set(e,n),n}function Yh(e){const{address:t,transactionHash:n,chainId:r}=e,i=Kh(t);i.setValue([...i.getValue(),{chainId:r,transactionHash:n}]),or.set(t,i)}async function Xh(e){let{account:t,transaction:n,gasless:r}=e;if(t.onTransactionRequested&&await t.onTransactionRequested(n),n.eip712){const{sendEip712Transaction:o}=await F(async()=>{const{sendEip712Transaction:a}=await import("./send-eip712-transaction-DwOwlCqR.js").then(c=>c.a);return{sendEip712Transaction:a}},__vite__mapDeps([8,1,2,9]));return o({account:t,transaction:n})}const i=await Cd({from:t,transaction:n});if(r){const{sendGaslessTransaction:o}=await F(async()=>{const{sendGaslessTransaction:a}=await import("./send-gasless-transaction-DhgWzw2O.js");return{sendGaslessTransaction:a}},__vite__mapDeps([11,1,2,0]));return o({account:t,gasless:r,serializableTransaction:i,transaction:n})}const s=await t.sendTransaction(i);return Yh({address:t.address,chainId:n.chain.id,transactionHash:s.transactionHash}),{...s,chain:n.chain,client:n.client}}const Jh=Object.freeze(Object.defineProperty({__proto__:null,sendTransaction:Xh},Symbol.toStringTag,{value:"Module"}));function Si(e){const{transaction:t}=e,n=Qh(t),r=(()=>{if(e.signature)return"v"in e.signature&&typeof e.signature.v<"u"?Oo({r:be(e.signature.r),s:be(e.signature.s),v:Number(e.signature.v)}):{r:be(e.signature.r),s:be(e.signature.s),yParity:e.signature.yParity};if(!(typeof t.v>"u"&&typeof t.yParity>"u")){if(t.r===void 0||t.s===void 0)throw new Error("Invalid signature provided with transaction");return{r:typeof t.r=="bigint"?t.r:be(t.r),s:typeof t.s=="bigint"?t.s:be(t.s),yParity:typeof t.v<"u"&&typeof t.yParity>"u"?gn(Number(t.v)):Number(t.yParity)}}})();if(n==="eip1559"){const i=t;return Mr(i),Ih(i,{signature:r})}if(n==="legacy"){const i=t;return Uo(i),Ah(i,{signature:r})}if(n==="eip2930"){const i=t;return Ro(i),Bh(i,{signature:r})}if(n==="eip7702"){const i=t;return ko(i),Th(i,{signature:r})}throw new Error("Invalid transaction type")}function Qh(e){if(typeof e.type<"u")return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Error("Invalid transaction type")}function ty({transaction:e,privateKey:t}){const n=Si({transaction:e}),r=wh({payload:ne(n),privateKey:t});return Si({transaction:{...e,...r}})}const e0={eip1559:1,eip2930:2,eip4844:3,eip7702:4,legacy:0};function Wo(e,t){return t&&(e.__preparedMethod=t.preparedMethod,e.__contract=t.contract),e}const t0=Object.freeze(Object.defineProperty({__proto__:null,TransactionTypeMap:e0,prepareTransaction:Wo},Symbol.toStringTag,{value:"Module"}));function kr(e){const{contract:t,method:n,params:r,...i}=e,s=()=>(async()=>{var o,a;if(Array.isArray(n))return n;if(qo(n))return Be(n);if(typeof n=="function")return Be(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const c=ot(n);if(c.type==="function")return Be(c);throw new Error('"method" passed is not of type "function"')}if(t.abi&&((o=t.abi)==null?void 0:o.length)>0){const c=(a=t.abi)==null?void 0:a.find(u=>u.type==="function"&&u.name===n);if(c)return Be(c)}throw new Error(`Could not resolve method "${n}".`)})();return Wo({...i,chain:t.chain,client:t.client,data:async()=>{let o;return Array.isArray(n)?o=n:o=await s(),o[1].length===0?o[0]:o[0]+He(o[1],await q(r??[])).slice(2)},to:t.address},{contract:t,preparedMethod:s})}function n0(e,t){const n=typeof t=="string"?{to:t}:t;switch(n.to){case"number":return s0(e,n);case"bigint":return r0(e,n);case"boolean":return i0(e,n);case"string":return o0(e,n);default:return pr(e,n)}}function r0(e,t={}){return Gi(e,t)}function i0(e,t={}){return qi(e,t)}function s0(e,t={}){return ce(e,t)}function o0(e,t={}){return Wi(e,t)}function Zo(e){return N(...e)}const a0=Object.freeze(Object.defineProperty({__proto__:null,concatHex:Zo},Symbol.toStringTag,{value:"Module"})),c0="0x6492649264926492649264926492649264926492649264926492649264926492",u0="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",f0=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function d0(e){if(K(e,-32)!==c0)throw new h0(e)}function l0(e){try{return d0(e),!0}catch{return!1}}class h0 extends P{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WrappedSignature.InvalidWrappedSignatureError"})}}const p0="0x1626ba7e",y0=[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],g0=[{type:"bytes4"}];async function m0(e){return Ur({contract:e.contract,method:[p0,y0,g0],params:[e.hash,e.signature]})}const Rt=new WeakMap;function b0(e){if(Rt.has(e))return Rt.get(e);const t=(async()=>{const n=De(e),r=await Ud(n,{address:e.address,blockTag:"latest"});return r==="0x"&&Rt.delete(e),r})();return Rt.set(e,t),t}const Ti=new WeakSet;async function Lt(e){if(Ti.has(e))return!0;const n=await b0(e)!=="0x";return n&&Ti.add(e),n}const w0=Object.freeze(Object.defineProperty({__proto__:null,isContractDeployed:Lt},Symbol.toStringTag,{value:"Module"})),x0="0x6492649264926492649264926492649264926492649264926492649264926492";function jr({address:e,data:t,signature:n}){return Zo([He([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,t,n]),x0])}const $0="0xfB688330379976DA81eB64Fe4BF50d7401763B9C";async function ny({hash:e,signature:t,address:n,client:r,chain:i,accountFactory:s}){const o=(()=>{if(Fe(t))return t;if(typeof t=="object"&&"r"in t&&"s"in t)return ch(t);if(t instanceof Uint8Array)return n0(t,"hex");throw new Error(`Invalid signature type for signature ${t}: ${typeof t}`)})();if(await Lt(kt({address:n,chain:i,client:r}))&&await Jt({contract:kt({address:n,chain:i,client:r}),hash:e,signature:o}).catch(m=>(console.error("Error verifying EIP-1271 signature",m),!1)))return!0;const c=await(async()=>!s||l0(o)?o:jr({address:s.address,data:s.verificationCalldata,signature:o}))();let u;const f=await Hs(i),d=jd(f0);if(f)u={data:zl(Or(d,"isValidSig"),[n,e,c]),to:$0};else{const p=_l(d);u={data:Tl(p,{args:[n,e,c],bytecode:u0})}}const l=De({chain:i,client:r});try{const p=await ao(l,u);return rs(p)}catch{return!!await Jt({contract:kt({address:n,chain:i,client:r}),hash:e,signature:o}).catch(m=>(console.error("Error verifying EIP-1271 signature",m),!1))}}const E0="0x1626ba7e";async function Jt({hash:e,signature:t,contract:n}){try{return await m0({contract:n,hash:e,signature:t})===E0}catch(r){return console.error("Error verifying EIP-1271 signature",r),!1}}const v0=`Ethereum Signed Message:
|
|
29
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionEnvelope.TipAboveFeeCapError"})}}function Uo(e){const{chainId:t,gasPrice:n,to:r}=e;if(r&&he(r,{strict:!1}),typeof t<"u"&&t<=0)throw new bn({chainId:t});if(n&&BigInt(n)>2n**256n-1n)throw new No({gasPrice:n})}function Ah(e,t={}){const{chainId:n=0,gas:r,data:i,input:s,nonce:o,to:a,value:c,gasPrice:u}=e;Uo(e);let f=[o?I(o):"0x",u?I(u):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",i??s??"0x"];const d=(()=>{if(t.signature)return{r:t.signature.r,s:t.signature.s,v:Lo(t.signature.yParity)};if(!(typeof e.r>"u"||typeof e.s>"u"))return{r:e.r,s:e.s,v:e.v}})();if(d){const l=(()=>{if(d.v>=35)return Math.floor((d.v-35)/2)>0?d.v:27+(d.v===35?0:1);if(n>0)return n*2+35+d.v-27;const p=27+(d.v===27?0:1);if(d.v!==p)throw new Mo({value:d.v});return p})();f=[...f,I(l),d.r===0n?"0x":Et(I(d.r)),d.s===0n?"0x":Et(I(d.s))]}else n>0&&(f=[...f,I(n),"0x","0x"]);return zt(f)}const Ph="0x02";function Mr(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:i}=e;if(t<=0)throw new bn({chainId:t});if(i&&he(i,{strict:!1}),r&&BigInt(r)>2n**256n-1n)throw new Eh({feeCap:r});if(n&&r&&n>r)throw new vh({maxFeePerGas:r,maxPriorityFeePerGas:n})}function Ih(e,t={}){const{chainId:n,gas:r,nonce:i,to:s,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:f,input:d}=e;Mr(e);const l=Lr(u),p=Ot(t.signature||e),m=[I(n),i?I(i):"0x",c?I(c):"0x",a?I(a):"0x",r?I(r):"0x",s??"0x",o?I(o):"0x",f??d??"0x",l,...p?yn(p):[]];return N(Ph,zt(m))}function Ro(e){const{chainId:t,gasPrice:n,to:r}=e;if(t<=0)throw new bn({chainId:t});if(r&&he(r,{strict:!1}),n&&BigInt(n)>2n**256n-1n)throw new No({gasPrice:n})}function Bh(e,t={}){const{chainId:n,gas:r,data:i,input:s,nonce:o,to:a,value:c,accessList:u,gasPrice:f}=e;Ro(e);const d=Lr(u),l=Ot(t.signature||e),p=[I(n),o?I(o):"0x",f?I(f):"0x",r?I(r):"0x",a??"0x",c?I(c):"0x",i??s??"0x",d,...l?yn(l):[]];return N("0x01",zt(p))}const Sh="0x04";function ko(e){const{authorizationList:t}=e;if(t)for(const n of t){const{address:r,chainId:i}=n;if(r&&he(r,{strict:!1}),Number(i)<0)throw new bn({chainId:i})}Mr(e)}function Th(e,t={}){const{authorizationList:n,chainId:r,gas:i,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:f,data:d,input:l}=e;ko(e);const p=Lr(f),m=gh(n),y=Ot(t.signature||e),h=[I(r),s?I(s):"0x",u?I(u):"0x",c?I(c):"0x",i?I(i):"0x",o??"0x",a?I(a):"0x",d??l??"0x",p,m,...y?yn(y):[]];return N(Sh,zt(h))}function jo(e){const{domain:t,message:n,primaryType:r,types:i}=e,s=(o,a)=>{for(const c of o){const{name:u,type:f}=c,d=a[u],l=f.match(Br);if(l&&(typeof d=="number"||typeof d=="bigint")){const[,y,h]=l;I(d,{signed:y==="int",size:Number.parseInt(h??"")/8})}if(f==="address"&&typeof d=="string"&&!Kt(d))throw new Yn({address:d,cause:new fo});const p=f.match(po);if(p){const[,y]=p;if(y&&R(d)!==Number.parseInt(y))throw new Lh({expectedSize:Number.parseInt(y),givenSize:R(d)})}const m=i[f];m&&(Rh(f),s(m,d))}};if(i.EIP712Domain&&t){if(typeof t!="object")throw new Mh({domain:t});s(i.EIP712Domain,t)}if(r!=="EIP712Domain")if(i[r])s(i[r],n);else throw new Ch({primaryType:r,types:i})}function _h(e){const{domain:t={},message:n,primaryType:r}=e,i={EIP712Domain:wn(t),...e.types};jo({domain:t,message:n,primaryType:r,types:i});const s=["0x19","0x01"];return t&&s.push(Fo({domain:t,types:i})),r!=="EIP712Domain"&&s.push(Do({data:n,primaryType:r,types:i})),N(...s)}function zh(e){const{primaryType:t,types:n}=e;let r="";const i=Go({primaryType:t,types:n});i.delete(t);const s=[t,...Array.from(i).sort()];for(const o of s)r+=`${o}(${(n[o]??[]).map(({name:a,type:c})=>`${c} ${a}`).join(",")})`;return r}function wn(e){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Qp(e){return ne(_h(e))}function Fo(e){const{domain:t,types:n}=e;return Do({data:t,primaryType:"EIP712Domain",types:{...n,EIP712Domain:(n==null?void 0:n.EIP712Domain)||wn(t)}})}function Do(e){const{data:t,primaryType:n,types:r}=e,i=Ho({data:t,primaryType:n,types:r});return ne(i)}function ey(e){const{domain:t,message:n,primaryType:r,types:i}=e,s=(c,u)=>{const f={...u};for(const d of c){const{name:l,type:p}=d;p==="address"&&(f[l]=f[l].toLowerCase())}return f},o=(()=>{if(!t)return{};const c=i.EIP712Domain??wn(t);return s(c,t)})(),a=(()=>{if(r!=="EIP712Domain")return i[r]?s(i[r],n):{}})();return ct({domain:o,message:a,primaryType:r,types:i},(c,u)=>typeof u=="bigint"?u.toString():u)}function Oh(e){try{return jo(e),!0}catch{return!1}}class Lh extends P{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.BytesSizeMismatchError"})}}class Mh extends P{constructor({domain:t}){super(`Invalid domain "${ct(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidDomainError"})}}class Ch extends P{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{metaMessages:["Check that the primary type is a key in `types`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidPrimaryTypeError"})}}class Nh extends P{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TypedData.InvalidStructTypeError"})}}function Ho(e){const{data:t,primaryType:n,types:r}=e,i=[{type:"bytes32"}],s=[Uh({primaryType:n,types:r})];for(const o of r[n]??[]){const[a,c]=Vo({types:r,name:o.name,type:o.type,value:t[o.name]});i.push(a),s.push(c)}return hn(i,s)}function Uh(e){const{primaryType:t,types:n}=e,r=St(zh({primaryType:t,types:n}));return ne(r)}function Vo(e){let{types:t,name:n,type:r,value:i}=e;if(t[r]!==void 0)return[{type:"bytes32"},ne(Ho({data:i,primaryType:r,types:t}))];if(r==="bytes")return i=`0x${(i.length%2?"0":"")+i.slice(2)}`,[{type:"bytes32"},ne(i,{as:"Hex"})];if(r==="string")return[{type:"bytes32"},ne(lr(i),{as:"Hex"})];if(r.lastIndexOf("]")===r.length-1){const s=r.slice(0,r.lastIndexOf("[")),o=i.map(a=>Vo({name:n,type:s,types:t,value:a}));return[{type:"bytes32"},ne(hn(o.map(([a])=>a),o.map(([,a])=>a)))]}return[{type:r},i]}function Go(e,t=new Set){const{primaryType:n,types:r}=e,i=n.match(/^\w*/u),s=i==null?void 0:i[0];if(t.has(s)||r[s]===void 0)return t;t.add(s);for(const o of r[s])Go({primaryType:o.type,types:r},t);return t}function Rh(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Nh({type:e})}function It(e){return Fe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function He(e,t){if(e.length!==t.length)throw new Error("The number of parameters and values must match.");const n=kh({params:e,values:t}),r=Nr(n);return r.length===0?"0x":r}function kh({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(Cr({param:e[r],value:t[r]}));return n}function Cr({param:e,value:t}){const n=Wh(e.type);if(n){const[r,i]=n;return Fh(t,{length:r,param:{...e,type:i}})}if(e.type==="tuple")return qh(t,{param:e});if(e.type==="address")return jh(t);if(e.type==="bool")return Hh(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return Vh(t,{signed:r})}if(e.type.startsWith("bytes"))return Dh(t,{param:e});if(e.type==="string")return Gh(t);throw new Error(`Unsupported parameter type: ${e.type}`)}function Nr(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?t+=32:t+=It(a)}const n=[],r=[];let i=0;for(let s=0;s<e.length;s++){const{dynamic:o,encoded:a}=e[s];o?(n.push(de(t+i,{size:32})),r.push(a),i+=It(a)):n.push(a)}return N(...n,...r)}function jh(e){if(e!==""&&e!==void 0&&!yr(e))throw new Error(`Invalid address: ${e}`);return{dynamic:!1,encoded:Ne(e.toLowerCase())}}function Fh(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Error("Invalid array value.");if(!r&&e.length!==t)throw new Error("Invalid array length.");let i=!1;const s=[];for(let o=0;o<e.length;o++){const a=Cr({param:n,value:e[o]});a.dynamic&&(i=!0),s.push(a)}if(r||i){const o=Nr(s);if(r){const a=de(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?N(a,o):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:N(...s.map(({encoded:o})=>o))}}function Dh(e,{param:t}){const[,n]=t.type.split("bytes"),r=It(e);if(!n){let i=e;return r%32!==0&&(i=Ne(i,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:N(Ne(de(r,{size:32})),i)}}if(r!==Number.parseInt(n))throw new Error(`Invalid bytes${n} size: ${r}`);return{dynamic:!1,encoded:Ne(e,{dir:"right"})}}function Hh(e){return{dynamic:!1,encoded:Ne(ss(e))}}function Vh(e,{signed:t}){return{dynamic:!1,encoded:de(e,{signed:t,size:32})}}function Gh(e){const t=sn(e),n=Math.ceil(It(t)/32),r=[];for(let i=0;i<n;i++)r.push(Ne(K(t,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:N(Ne(de(It(t),{size:32})),...r)}}function qh(e,{param:t}){let n=!1;const r=[];for(let i=0;i<t.components.length;i++){const s=t.components[i],o=Array.isArray(e)?i:s.name,a=Cr({param:s,value:e[o]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Nr(r):N(...r.map(({encoded:i})=>i))}}function Wh(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Rn=new _i(4096);function Be(e){const t=typeof e=="string"?e:fe(e);if(Rn.has(t))return Rn.get(t);const n=typeof e=="string"?ot(e):e,i=[vr(n),n.inputs,n.outputs];return Rn.set(t,i),i}function qo(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="function")}async function Ur(e){const{contract:t,method:n,params:r}=e,i=async()=>{var d,l;if(Array.isArray(n))return n;if(qo(n))return Be(n);if(typeof n=="function")return Be(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const p=ot(n);if(p.type==="function")return Be(p);throw new Error('"method" passed is not of type "function"')}if(t.abi&&((d=t.abi)==null?void 0:d.length)>0){const p=(l=t.abi)==null?void 0:l.find(m=>m.type==="function"&&m.name===n);if(p)return Be(p)}throw new Error(`Could not resolve method "${n}".`)},[s,o]=await Promise.all([i(),typeof r=="function"?r():r]);let a;s[1].length===0?a=s[0]:a=s[0]+He(s[1],o).slice(2);const c=De({chain:t.chain,client:t.client}),u=await ao(c,{data:a,from:e.from?Ie(e.from):void 0,to:t.address}),f=fn(s[2],u);return Array.isArray(f)&&f.length===1?f[0]:f}const Rr=Object.freeze(Object.defineProperty({__proto__:null,readContract:Ur},Symbol.toStringTag,{value:"Module"}));function Zh(e){const t=new Set;let n=e;const r=()=>{for(const i of t)i()};return{getValue(){return n},setValue(i){i!==n&&(n=i,r())},subscribe(i){return t.add(i),()=>{t.delete(i)}}}}const or=new Map;function Kh(e){const t=or.get(e);if(t)return t;const n=Zh([]);return or.set(e,n),n}function Yh(e){const{address:t,transactionHash:n,chainId:r}=e,i=Kh(t);i.setValue([...i.getValue(),{chainId:r,transactionHash:n}]),or.set(t,i)}async function Xh(e){let{account:t,transaction:n,gasless:r}=e;if(t.onTransactionRequested&&await t.onTransactionRequested(n),n.eip712){const{sendEip712Transaction:o}=await F(async()=>{const{sendEip712Transaction:a}=await import("./send-eip712-transaction-B2xYx25b.js").then(c=>c.a);return{sendEip712Transaction:a}},__vite__mapDeps([8,1,2,9]));return o({account:t,transaction:n})}const i=await Cd({from:t,transaction:n});if(r){const{sendGaslessTransaction:o}=await F(async()=>{const{sendGaslessTransaction:a}=await import("./send-gasless-transaction-DHhfap7k.js");return{sendGaslessTransaction:a}},__vite__mapDeps([11,1,2,0]));return o({account:t,gasless:r,serializableTransaction:i,transaction:n})}const s=await t.sendTransaction(i);return Yh({address:t.address,chainId:n.chain.id,transactionHash:s.transactionHash}),{...s,chain:n.chain,client:n.client}}const Jh=Object.freeze(Object.defineProperty({__proto__:null,sendTransaction:Xh},Symbol.toStringTag,{value:"Module"}));function Si(e){const{transaction:t}=e,n=Qh(t),r=(()=>{if(e.signature)return"v"in e.signature&&typeof e.signature.v<"u"?Oo({r:be(e.signature.r),s:be(e.signature.s),v:Number(e.signature.v)}):{r:be(e.signature.r),s:be(e.signature.s),yParity:e.signature.yParity};if(!(typeof t.v>"u"&&typeof t.yParity>"u")){if(t.r===void 0||t.s===void 0)throw new Error("Invalid signature provided with transaction");return{r:typeof t.r=="bigint"?t.r:be(t.r),s:typeof t.s=="bigint"?t.s:be(t.s),yParity:typeof t.v<"u"&&typeof t.yParity>"u"?gn(Number(t.v)):Number(t.yParity)}}})();if(n==="eip1559"){const i=t;return Mr(i),Ih(i,{signature:r})}if(n==="legacy"){const i=t;return Uo(i),Ah(i,{signature:r})}if(n==="eip2930"){const i=t;return Ro(i),Bh(i,{signature:r})}if(n==="eip7702"){const i=t;return ko(i),Th(i,{signature:r})}throw new Error("Invalid transaction type")}function Qh(e){if(typeof e.type<"u")return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new Error("Invalid transaction type")}function ty({transaction:e,privateKey:t}){const n=Si({transaction:e}),r=wh({payload:ne(n),privateKey:t});return Si({transaction:{...e,...r}})}const e0={eip1559:1,eip2930:2,eip4844:3,eip7702:4,legacy:0};function Wo(e,t){return t&&(e.__preparedMethod=t.preparedMethod,e.__contract=t.contract),e}const t0=Object.freeze(Object.defineProperty({__proto__:null,TransactionTypeMap:e0,prepareTransaction:Wo},Symbol.toStringTag,{value:"Module"}));function kr(e){const{contract:t,method:n,params:r,...i}=e,s=()=>(async()=>{var o,a;if(Array.isArray(n))return n;if(qo(n))return Be(n);if(typeof n=="function")return Be(await n(t));if(typeof n=="string"&&n.startsWith("function ")){const c=ot(n);if(c.type==="function")return Be(c);throw new Error('"method" passed is not of type "function"')}if(t.abi&&((o=t.abi)==null?void 0:o.length)>0){const c=(a=t.abi)==null?void 0:a.find(u=>u.type==="function"&&u.name===n);if(c)return Be(c)}throw new Error(`Could not resolve method "${n}".`)})();return Wo({...i,chain:t.chain,client:t.client,data:async()=>{let o;return Array.isArray(n)?o=n:o=await s(),o[1].length===0?o[0]:o[0]+He(o[1],await q(r??[])).slice(2)},to:t.address},{contract:t,preparedMethod:s})}function n0(e,t){const n=typeof t=="string"?{to:t}:t;switch(n.to){case"number":return s0(e,n);case"bigint":return r0(e,n);case"boolean":return i0(e,n);case"string":return o0(e,n);default:return pr(e,n)}}function r0(e,t={}){return Gi(e,t)}function i0(e,t={}){return qi(e,t)}function s0(e,t={}){return ce(e,t)}function o0(e,t={}){return Wi(e,t)}function Zo(e){return N(...e)}const a0=Object.freeze(Object.defineProperty({__proto__:null,concatHex:Zo},Symbol.toStringTag,{value:"Module"})),c0="0x6492649264926492649264926492649264926492649264926492649264926492",u0="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",f0=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function d0(e){if(K(e,-32)!==c0)throw new h0(e)}function l0(e){try{return d0(e),!0}catch{return!1}}class h0 extends P{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WrappedSignature.InvalidWrappedSignatureError"})}}const p0="0x1626ba7e",y0=[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],g0=[{type:"bytes4"}];async function m0(e){return Ur({contract:e.contract,method:[p0,y0,g0],params:[e.hash,e.signature]})}const Rt=new WeakMap;function b0(e){if(Rt.has(e))return Rt.get(e);const t=(async()=>{const n=De(e),r=await Ud(n,{address:e.address,blockTag:"latest"});return r==="0x"&&Rt.delete(e),r})();return Rt.set(e,t),t}const Ti=new WeakSet;async function Lt(e){if(Ti.has(e))return!0;const n=await b0(e)!=="0x";return n&&Ti.add(e),n}const w0=Object.freeze(Object.defineProperty({__proto__:null,isContractDeployed:Lt},Symbol.toStringTag,{value:"Module"})),x0="0x6492649264926492649264926492649264926492649264926492649264926492";function jr({address:e,data:t,signature:n}){return Zo([He([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,t,n]),x0])}const $0="0xfB688330379976DA81eB64Fe4BF50d7401763B9C";async function ny({hash:e,signature:t,address:n,client:r,chain:i,accountFactory:s}){const o=(()=>{if(Fe(t))return t;if(typeof t=="object"&&"r"in t&&"s"in t)return ch(t);if(t instanceof Uint8Array)return n0(t,"hex");throw new Error(`Invalid signature type for signature ${t}: ${typeof t}`)})();if(await Lt(kt({address:n,chain:i,client:r}))&&await Jt({contract:kt({address:n,chain:i,client:r}),hash:e,signature:o}).catch(m=>(console.error("Error verifying EIP-1271 signature",m),!1)))return!0;const c=await(async()=>!s||l0(o)?o:jr({address:s.address,data:s.verificationCalldata,signature:o}))();let u;const f=await Hs(i),d=jd(f0);if(f)u={data:zl(Or(d,"isValidSig"),[n,e,c]),to:$0};else{const p=_l(d);u={data:Tl(p,{args:[n,e,c],bytecode:u0})}}const l=De({chain:i,client:r});try{const p=await ao(l,u);return rs(p)}catch{return!!await Jt({contract:kt({address:n,chain:i,client:r}),hash:e,signature:o}).catch(m=>(console.error("Error verifying EIP-1271 signature",m),!1))}}const E0="0x1626ba7e";async function Jt({hash:e,signature:t,contract:n}){try{return await m0({contract:n,hash:e,signature:t})===E0}catch(r){return console.error("Error verifying EIP-1271 signature",r),!1}}const v0=`Ethereum Signed Message:
|
|
30
30
|
`;function A0(e,t){const n=typeof e=="string"?Dt(e):e.raw instanceof Uint8Array?e.raw:La(e.raw),r=Dt(`${v0}${n.length}`);return $e(Vi(r,n),t)}function P0(e){const{domain:t={},message:n,primaryType:r}=e,i={EIP712Domain:wn(t),...e.types};Oh({domain:t,message:n,primaryType:r,types:i});const s=["0x1901"];if(t&&s.push(Fo({domain:t,types:i})),r!=="EIP712Domain"){const o=(()=>{const a=Ko({data:n,primaryType:r,types:i});return $e(a)})();s.push(o)}return $e(Vi(...s.map(o=>ze(o))))}function Ko({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],i=[I0({primaryType:t,types:n})];if(!n[t])throw new Error("Invalid types");for(const s of n[t]){const[o,a]=Xo({name:s.name,type:s.type,types:n,value:e[s.name]});r.push(o),i.push(a)}return He(r,i)}function I0({primaryType:e,types:t}){const n=os(B0({primaryType:e,types:t}));return $e(n)}function B0({primaryType:e,types:t}){let n="";const r=Yo({primaryType:e,types:t});r.delete(e);const i=[e,...Array.from(r).sort()];for(const s of i){if(!t[s])throw new Error("Invalid types");n+=`${s}(${t[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`}return n}function Yo({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),i=r==null?void 0:r[0];if(n.has(i)||t[i]===void 0)return n;n.add(i);for(const s of t[i])Yo({primaryType:s.type,types:t},n);return n}function Xo({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},$e(Ko({data:r,primaryType:n,types:e}))];if(n==="bytes")return r=`0x${(r.length%2?"0":"")+r.slice(2)}`,[{type:"bytes32"},$e(r)];if(n==="string")return[{type:"bytes32"},$e(os(r))];if(n.lastIndexOf("]")===n.length-1){const i=n.slice(0,n.lastIndexOf("[")),s=r.map(o=>Xo({name:t,type:i,types:e,value:o}));return[{type:"bytes32"},$e(He(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:n},r]}async function ry(e){const{factoryContract:t,predictAddressOverride:n,adminAddress:r,accountSalt:i,accountAddress:s}=e;if(n)return n(t,r);if(s)return s;if(!r)throw new Error("Account address is required to predict the smart wallet address.");return Oi(async()=>{const o=i&&Fe(i)?i:sn(i??"");let a,c=0;const u=3;for(;c<=u;)try{a=await Ur({contract:t,method:"function getAddress(address, bytes) returns (address)",params:[r,o]});break}catch(f){if(c===u)throw f;const d=2**(c+1)*200;await new Promise(l=>setTimeout(l,d)),c++}if(!a)throw new Error(`No smart account address found for admin address ${r} and salt ${i}`);return a},{cacheKey:`${e.factoryContract.chain.id}-${e.factoryContract.address}-${e.adminAddress}-${e.accountSalt}`,cacheTime:1e3*60*60*24})}function Jo(e){const{adminAddress:t,factoryContract:n,createAccountOverride:r,accountSalt:i}=e;if(r)return r(n,t);const s=i&&Fe(i)?i:sn(i??"");return kr({contract:n,method:"function createAccount(address, bytes) returns (address)",params:[t,s]})}function iy(e){const{accountContract:t,transaction:n,executeOverride:r}=e;if(r)return r(t,n);let i=n.value||0n;return(n.chainId===295||n.chainId===296)&&(i=BigInt(i)/BigInt(10**10)),kr({contract:t,gas:n.gas?n.gas+21000n:void 0,method:"function execute(address, uint256, bytes)",params:[n.to||"",i,n.data||"0x"]})}function sy(e){var o;const{accountContract:t,transactions:n,executeBatchOverride:r}=e;if(r)return r(t,n);let i=n.map(a=>a.value||0n);const s=(o=n[0])==null?void 0:o.chainId;return(s===295||s===296)&&(i=i.map(a=>BigInt(a)/BigInt(10**10))),kr({contract:t,method:"function executeBatch(address[], uint256[], bytes[])",params:[n.map(a=>a.to||""),i,n.map(a=>a.data||"0x")]})}async function S0({accountContract:e,factoryContract:t,options:n,message:r}){var c,u;const i=A0(r);let s;const o=He([{type:"bytes32"}],[i]);if(s=await n.personalAccount.signTypedData({domain:{chainId:n.chain.id,name:"Account",verifyingContract:e.address,version:"1"},message:{message:o},primaryType:"AccountMessage",types:{AccountMessage:[{name:"message",type:"bytes"}]}}),await Lt(e)){if(await Jt({contract:e,hash:i,signature:s}))return s;throw new Error("Failed to verify signature")}else{const f=Jo({accountSalt:(c=n.overrides)==null?void 0:c.accountSalt,adminAddress:n.personalAccount.address,createAccountOverride:(u=n.overrides)==null?void 0:u.createAccount,factoryContract:t});if(!f)throw new Error("Create account override not provided");const d=await dn(f);return jr({address:t.address,data:d,signature:s})}}async function T0({accountContract:e,factoryContract:t,options:n,typedData:r}){var u,f,d,l,p;if(((f=(u=r.domain)==null?void 0:u.verifyingContract)==null?void 0:f.toLowerCase())===((d=e.address)==null?void 0:d.toLowerCase()))return n.personalAccount.signTypedData(r);const s=P0(r);let o;const a=He([{type:"bytes32"}],[s]);if(o=await n.personalAccount.signTypedData({domain:{chainId:n.chain.id,name:"Account",verifyingContract:e.address,version:"1"},message:{message:a},primaryType:"AccountMessage",types:{AccountMessage:[{name:"message",type:"bytes"}]}}),await Lt(e)){if(await Jt({contract:e,hash:s,signature:o}))return o;throw new Error("Failed to verify signature")}else{const m=Jo({accountSalt:(l=n.overrides)==null?void 0:l.accountSalt,adminAddress:n.personalAccount.address,createAccountOverride:(p=n.overrides)==null?void 0:p.createAccount,factoryContract:t});if(!m)throw new Error("Create account override not provided");const y=await dn(m);return jr({address:t.address,data:y,signature:o})}}async function Qo(e){const{accountContract:t}=e,n=Date.now(),r=6e4,{isContractDeployed:i}=await F(async()=>{const{isContractDeployed:o}=await Promise.resolve().then(()=>w0);return{isContractDeployed:o}},void 0);let s=await i(t);for(;!s;){if(Date.now()-n>r)throw new Error("Timeout: Smart account deployment not confirmed after 1 minute");await new Promise(o=>setTimeout(o,500)),s=await i(t)}}async function _0(e){const{chain:t,client:n,smartAccount:r,accountContract:i}=e;if(await Lt(i))return;const[{sendTransaction:o},{prepareTransaction:a}]=await Promise.all([F(()=>Promise.resolve().then(()=>Jh),void 0),F(()=>Promise.resolve().then(()=>t0),void 0)]),c=a({chain:t,client:n,gas:50000n,to:i.address,value:0n}),u=await o({account:r,transaction:c});return await Qo({accountContract:i}),u}const oy=Object.freeze(Object.defineProperty({__proto__:null,confirmContractDeployment:Qo,deploySmartAccount:_0,smartAccountSignMessage:S0,smartAccountSignTypedData:T0},Symbol.toStringTag,{value:"Module"}));export{le as $,Vt as A,S as B,Ku as C,Tt as D,Zu as E,ef as F,st as G,b0 as H,cn as I,wr as J,Au as K,j as L,Re as M,qt as N,vp as O,G as P,op as Q,jc as R,Ca as S,an as T,ft as U,os as V,Rp as W,_t as X,Zo as Y,W0 as Z,ju as _,uc as a,o0 as a$,iu as a0,pp as a1,ni as a2,$s as a3,vt as a4,Jc as a5,xs as a6,su as a7,yp as a8,q0 as a9,mf as aA,bc as aB,Jp as aC,qp as aD,Gp as aE,xh as aF,Cs as aG,ao as aH,pi as aI,ot as aJ,Qp as aK,Xp as aL,zo as aM,ny as aN,xf as aO,Up as aP,cf as aQ,Ud as aR,uf as aS,kp as aT,di as aU,ty as aV,Wo as aW,wf as aX,r0 as aY,i0 as aZ,s0 as a_,js as aa,kr as ab,ln as ac,bf as ad,Lt as ae,Ds as af,Jo as ag,Hp as ah,Hs as ai,ry as aj,iy as ak,sy as al,Bf as am,_f as an,cc as ao,H0 as ap,mc as aq,is as ar,Dt as as,Us as at,Ns as au,Rd as av,jp as aw,Ed as ax,Fp as ay,oo as az,kt as b,Ms as b$,n0 as b0,ss as b1,G0 as b2,rs as b3,Ne as b4,Ma as b5,Na as b6,La as b7,_0 as b8,$p as b9,Vn as bA,hs as bB,Tc as bC,Sc as bD,_c as bE,zc as bF,up as bG,X0 as bH,ys as bI,ps as bJ,gs as bK,Mc as bL,Cc as bM,Nc as bN,Oc as bO,tf as bP,Cu as bQ,Mu as bR,rf as bS,of as bT,$u as bU,Eu as bV,Lc as bW,Ts as bX,Os as bY,Ls as bZ,ue as b_,Wt as ba,dp as bb,gp as bc,vu as bd,gr as be,Ue as bf,Se as bg,Is as bh,bs as bi,J0 as bj,Q0 as bk,ep as bl,fs as bm,ds as bn,Ec as bo,vc as bp,Ac as bq,tp as br,np as bs,Pc as bt,Qr as bu,Ic as bv,ls as bw,rp as bx,ip as by,sp as bz,Yh as c,Sp as c0,lp as c1,Uc as c2,Rc as c3,Hc as c4,Vc as c5,ws as c6,ms as c7,zp as c8,_p as c9,bd as cA,wc as cB,Z0 as cC,K0 as cD,Y0 as cE,it as cF,Ap as cG,fp as cH,Nu as cI,Ep as cJ,yu as cK,gt as cL,hp as cM,Gt as cN,bp as cO,mp as cP,xc as cQ,L0 as cR,Op as cS,Lp as cT,Cp as cU,Np as cV,oy as cW,Tp as ca,Yu as cb,br as cc,un as cd,wu as ce,ne as cf,tn as cg,N as ch,St as ci,R as cj,Vs as ck,dr as cl,Fi as cm,wn as cn,Oh as co,ey as cp,Zp as cq,Kp as cr,I as cs,wh as ct,ch as cu,pn as cv,Wp as cw,as as cx,Zh as cy,Yp as cz,fn as d,He as e,vr as f,Ie as g,rn as h,yr as i,fe as j,sn as k,Mp as l,De as m,de as n,Fe as o,Pu as p,$e as q,Ur as r,Si as s,Cd as t,pr as u,Xh as v,dn as w,q as x,Ar as y,Ju as z};
|