@dcl/shop 0.1.0-30276533246.commit-f8e4e8f → 0.1.0-30277401547.commit-e877307

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.
Files changed (170) hide show
  1. package/assets/{Activity-hXLcKq2h.js → Activity-_qlXQij1.js} +1 -1
  2. package/assets/{AnimatedBackground-dbV7gtfn.js → AnimatedBackground-DO49gSw8.js} +1 -1
  3. package/assets/{Assets-CMMyLxYK.js → Assets-D-VpkQ1l.js} +2 -2
  4. package/assets/{Assets.styles-0t7WQHO0.js → Assets.styles-BZMkOQeI.js} +1 -1
  5. package/assets/{Authorizations-UmG-Df3r.js → Authorizations-BFWG3QA_.js} +1 -1
  6. package/assets/{Button-DZEnGtFb.js → Button-DvhW1Z1S.js} +1 -1
  7. package/assets/{Cart-Cv-0Hvub.js → Cart-Cz7NK8QL.js} +1 -1
  8. package/assets/{CircularProgress-BJ3mR2Td.js → CircularProgress-BmwVvF17.js} +1 -1
  9. package/assets/{Collection-B2vZD-tj.js → Collection-Bc2CvIur.js} +1 -1
  10. package/assets/{CollectionCarousel--kzVfaO5.js → CollectionCarousel-DEYFBykF.js} +1 -1
  11. package/assets/{Creator-q1uyTJMB.js → Creator-7vyVsWtE.js} +1 -1
  12. package/assets/{ExchangeController-aW_MlhrS.js → ExchangeController-icK8vQc1.js} +1 -1
  13. package/assets/{GetCredits-C_zVvwJv.js → GetCredits-BE-bIUdj.js} +1 -1
  14. package/assets/{HelpersUtil-ClO_3Jc1.js → HelpersUtil-C_aV_Y-W.js} +1 -1
  15. package/assets/{ImportListings-Bkbdthc9.js → ImportListings-CusN2RYj.js} +1 -1
  16. package/assets/{ItemDetail-mOl_Kn1H.js → ItemDetail-blewhWwg.js} +3 -3
  17. package/assets/{LoadMore-EHn5w6iP.js → LoadMore-C2uaqP2N.js} +1 -1
  18. package/assets/{MarketCheckout-dZs9K_G4.js → MarketCheckout-CW6mGgHt.js} +1 -1
  19. package/assets/{MenuList-CMbA1PQj.js → MenuList-mbP1RxaG.js} +1 -1
  20. package/assets/{MyAssets-BJI5V-2P.js → MyAssets-HcHA9d8L.js} +1 -1
  21. package/assets/{MyFavorites-BguSqCh7.js → MyFavorites-DkEAv96J.js} +1 -1
  22. package/assets/{NotFound-i-z6JKyV.js → NotFound-B2W2MHR8.js} +1 -1
  23. package/assets/{NotificationsBell-C_yrd9Xo.js → NotificationsBell-BEAvIZcq.js} +1 -1
  24. package/assets/{StoreSettings-DZkFM1rM.js → StoreSettings-CGc7i0kZ.js} +5 -5
  25. package/assets/{Success-Dnd1gDEe.js → Success-5LiVLOny.js} +1 -1
  26. package/assets/{SwapController-3J3CaWML.js → SwapController-BZT-uJE0.js} +1 -1
  27. package/assets/{Tooltip-D02GGolw.js → Tooltip-V9fXstBY.js} +1 -1
  28. package/assets/{TradeService-CD7-qmvB.js → TradeService-D9nuCaGq.js} +1 -1
  29. package/assets/{W3MFrameProviderSingleton-C03Pb4B-.js → W3MFrameProviderSingleton-Ccq1reIt.js} +3 -3
  30. package/assets/{WebCryptoP256-BNVfqOHe.js → WebCryptoP256-CrgJppag.js} +1 -1
  31. package/assets/{authorizations-Cp6LZG2p.js → authorizations-t9AL68YM.js} +1 -1
  32. package/assets/{basic-BiNYECPU.js → basic-BIbSgqQe.js} +1 -1
  33. package/assets/{biconomy-sueKb6TZ.js → biconomy-JEnDnFaz.js} +1 -1
  34. package/assets/{builder-DlCHGdvc.js → builder-uUlDA8Em.js} +1 -1
  35. package/assets/{buy-B2kHW0nr.js → buy-84sizoxr.js} +1 -1
  36. package/assets/{buy-gasless-C1AGMpyR.js → buy-gasless-oF_YJX_W.js} +1 -1
  37. package/assets/{cart-checkout-gXQTm1Je.js → cart-checkout-K77UDHy3.js} +1 -1
  38. package/assets/{categories-C3OIiumf.js → categories-BwvbYi6M.js} +1 -1
  39. package/assets/{ccip-DPUSAyAP.js → ccip-5L0bsS_C.js} +1 -1
  40. package/assets/{ccip-DN5nMPw-.js → ccip-wypw12me.js} +1 -1
  41. package/assets/{collection-DreRuzb5.js → collection-D7HQMUIe.js} +1 -1
  42. package/assets/{controller-3Y3P-qSA.js → controller-Cwg1NxXB.js} +2 -2
  43. package/assets/{core-DNLw0r_l.js → core-3ZRiSdvl.js} +4 -4
  44. package/assets/{custom-B2MFF440.js → custom-BVE_f5dD.js} +1 -1
  45. package/assets/{data-capture-BwNOBkUG.js → data-capture-BRhsLQVv.js} +1 -1
  46. package/assets/{email-DsF1SFzq.js → email-CldXoMar.js} +1 -1
  47. package/assets/{embedded-wallet-CqXzyQH3.js → embedded-wallet-vSjh73AM.js} +1 -1
  48. package/assets/{emotion-styled.browser.esm-KRbVdXBp.js → emotion-styled.browser.esm-vQZV14Nf.js} +1 -1
  49. package/assets/{engine-Bt0lIrAq.js → engine-BPP9EW4Q.js} +1 -1
  50. package/assets/{errors-DRre14b2.js → errors-D-hio89k.js} +1 -1
  51. package/assets/{estimate-l1-fee-D2kU8y3A.js → estimate-l1-fee-BLZxmPJY.js} +1 -1
  52. package/assets/{execute-CxJ661iN.js → execute-cH8V-8nL.js} +2 -2
  53. package/assets/{features-C_M-5faE.js → features-CJ1tq5LL.js} +1 -1
  54. package/assets/{fetchTokenMetadata-_p-iZKio.js → fetchTokenMetadata-hD4VNXHw.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-86ruW1Fa.js → get-ecosystem-wallet-info-3DZHpSG2.js} +1 -1
  56. package/assets/{getBalance-unWh_KQT.js → getBalance-vjJ5CXDC.js} +1 -1
  57. package/assets/{getNFT-CIgk3nT1.js → getNFT-BTjIkFXY.js} +1 -1
  58. package/assets/{getNFT-BGqdTpXh.js → getNFT-D8HIjTde.js} +1 -1
  59. package/assets/{getThemeProps-BSd7rKgs.js → getThemeProps-qmqFWvou.js} +1 -1
  60. package/assets/{hashTypedData-QLpD25u5.js → hashTypedData-BrvDnrgK.js} +1 -1
  61. package/assets/{hashTypedData-BTWIstyF.js → hashTypedData-Y2DJnKI9.js} +1 -1
  62. package/assets/{import-C8mG5kpp.js → import-AgO0v-a5.js} +1 -1
  63. package/assets/{in-app-BhtePNrr.js → in-app-C4N5lFwd.js} +1 -1
  64. package/assets/{in-app-wallet-calls-CshV6paA.js → in-app-wallet-calls-CMBsSG6j.js} +1 -1
  65. package/assets/{index-Cy1iqq4E.js → index--8tZMj8Y.js} +1 -1
  66. package/assets/{index-D14A8-Ez.js → index-1cJq3bUz.js} +1 -1
  67. package/assets/{index-DTdfAXzC.js → index-B8GAuQX3.js} +3 -3
  68. package/assets/{index-jMf-NKbX.js → index-B96cJA0d.js} +1 -1
  69. package/assets/{index-DW7iqXK6.js → index-B9AUDrI9.js} +1 -1
  70. package/assets/{index-ZWDXIF6O.js → index-BFPNYe8x.js} +10 -10
  71. package/assets/{index-CoUgtRBd.js → index-BGTbU_0B.js} +2 -2
  72. package/assets/{index-DekG2ccV.js → index-BKvaZQRw.js} +1 -1
  73. package/assets/{index-BR3whuSX.js → index-BQOr-Vwz.js} +1 -1
  74. package/assets/{index-Cn4XSZr0.js → index-BQuXaLZX.js} +1 -1
  75. package/assets/{index-Dz09ibiS.js → index-BWgCJZHy.js} +2 -2
  76. package/assets/{index-DFiDXKfN.js → index-B_jKVCv0.js} +1 -1
  77. package/assets/{index-BjEtYT4r.js → index-BcgMkg8Z.js} +1 -1
  78. package/assets/{index-CjbITVZo.js → index-BjQNL760.js} +1 -1
  79. package/assets/{index-m5nQVxYP.js → index-BlBoDOVY.js} +1 -1
  80. package/assets/{index-DYq_oVmx.js → index-C-2OENmH.js} +1 -1
  81. package/assets/{index-By453YwH.js → index-C7UEmKEb.js} +3 -3
  82. package/assets/{index-ezQi9fE0.js → index-C7gHM4wY.js} +1 -1
  83. package/assets/{index-ByXnBudX.js → index-C8Ua1g52.js} +1 -1
  84. package/assets/{index-BQmilESQ.js → index-CI-UnS2-.js} +1 -1
  85. package/assets/{index-BW895N7Q.js → index-CV39-lnY.js} +1 -1
  86. package/assets/{index-CyD5tTbO.js → index-CcARyxeB.js} +1 -1
  87. package/assets/{index-CbMR0Bj_.js → index-Ch88GJdD.js} +1 -1
  88. package/assets/{index-COv1RTFu.js → index-CiKWw9L3.js} +2 -2
  89. package/assets/{index-DNq_ZzO9.js → index-CmhYJKse.js} +1 -1
  90. package/assets/{index-B5y-D5X8.js → index-CnIGe1GZ.js} +1 -1
  91. package/assets/{index-phHbAFw8.js → index-CsSypry2.js} +1 -1
  92. package/assets/{index-COdiwi90.js → index-CvkWE_vF.js} +1 -1
  93. package/assets/{index-DsxE94hA.js → index-D0cj2XsC.js} +1 -1
  94. package/assets/{index-Bm3DarTl.js → index-D2-V-v9q.js} +1 -1
  95. package/assets/{index-CZat8yuA.js → index-D2iLR1Fl.js} +1 -1
  96. package/assets/{index-CzQo6jjU.js → index-D96o2dcC.js} +1 -1
  97. package/assets/{index-C8v7zDBJ.js → index-DCFYAbF4.js} +1 -1
  98. package/assets/{index-CQCEoI0f.js → index-DGwFgPlc.js} +1 -1
  99. package/assets/{index-D2w8m12L.js → index-DN-OLR2r.js} +3 -3
  100. package/assets/{index-DOpvn00g.js → index-DNLIdOOI.js} +1 -1
  101. package/assets/{index-CZHmX5J8.js → index-DZxRXkvI.js} +1 -1
  102. package/assets/{index-CLcox4E7.js → index-Dq7pc9gT.js} +1 -1
  103. package/assets/{index-DkF53JBL.js → index-Dx4EbFs-.js} +1 -1
  104. package/assets/{index-w8qdvQSI.js → index-Dz0EI57w.js} +1 -1
  105. package/assets/{index-DTu4F44-.js → index-E3wxKJyS.js} +1 -1
  106. package/assets/{index-BHZuyKoD.js → index-HMuz0PhO.js} +1 -1
  107. package/assets/{index-CkOuE7FD.js → index-Hb4Ys2Tq.js} +1 -1
  108. package/assets/{index-DIpKr5PH.js → index-Vlg-GpRL.js} +1 -1
  109. package/assets/{index-DXk86Ivm.js → index-YHVXMMbH.js} +1 -1
  110. package/assets/{index-C_Gr4cGQ.js → index-bqj_5mVc.js} +1 -1
  111. package/assets/{index-BnmhOYyH.js → index-jPOTr4Wq.js} +1 -1
  112. package/assets/{index-OZxfsC7n.js → index-qDfBJZD7.js} +1 -1
  113. package/assets/{index-Cd5MdlQV.js → index-r7kjVwFs.js} +1 -1
  114. package/assets/{index-C2uZoNuk.js → index-rjU6xZd8.js} +1 -1
  115. package/assets/{index-XVXsmUHu.js → index-trxbKGTp.js} +1 -1
  116. package/assets/{index.es-B_VDxdYa.js → index.es-BKhU-mgO.js} +1 -1
  117. package/assets/{index.es-CH1EpUFZ.js → index.es-DvYEMDdQ.js} +4 -4
  118. package/assets/{index.es-CUbFS9-7.js → index.es-magZDVqq.js} +1 -1
  119. package/assets/{localBatchGatewayRequest-gUKVbACI.js → localBatchGatewayRequest-CnLOTida.js} +1 -1
  120. package/assets/{mana-rate-BkFbk0kZ.js → mana-rate-BpgRIQMS.js} +1 -1
  121. package/assets/{networks-Bd6TgNp5.js → networks-BNqJWbtk.js} +1 -1
  122. package/assets/{onramp-CsEoJ4ye.js → onramp-BYjThZVX.js} +1 -1
  123. package/assets/{openzeppelin-CvVwdooA.js → openzeppelin-Ba3p7TP4.js} +1 -1
  124. package/assets/{parseNft-BuGslaHc.js → parseNft-CfH76UUp.js} +2 -2
  125. package/assets/{parseSignature-CJjL6IIG.js → parseSignature-CuL9-kIi.js} +1 -1
  126. package/assets/{parseSignature-cMUHSEHb.js → parseSignature-D3qKk3uH.js} +3 -3
  127. package/assets/{passkeys-CU5Dd8fW.js → passkeys-DPVQjClK.js} +1 -1
  128. package/assets/{pay-with-exchange-D5anhnsP.js → pay-with-exchange-MNFdDdCT.js} +1 -1
  129. package/assets/{qr-overlay-D7N8zFXO.js → qr-overlay-DDDT3Q-c.js} +1 -1
  130. package/assets/{receive-D1bfspT3.js → receive-BU9aVDlN.js} +1 -1
  131. package/assets/{resolveImplementation-yZJLHNcT.js → resolveImplementation-OjvLy3T5.js} +1 -1
  132. package/assets/{rpc-DR3Pyl3d.js → rpc-DjbYCcnH.js} +1 -1
  133. package/assets/{secp256k1-CphVajjd.js → secp256k1-Cz5kqQCg.js} +1 -1
  134. package/assets/{secp256k1-zVdNPaTf.js → secp256k1-X13vDEXt.js} +1 -1
  135. package/assets/{secp256k1-DDxmRKuj.js → secp256k1-w4Bql-wA.js} +1 -1
  136. package/assets/{send-batch-transaction-DbJ2GI0Z.js → send-batch-transaction-Dxt9X3nj.js} +1 -1
  137. package/assets/{send-eip712-transaction-g0RXPeLW.js → send-eip712-transaction-DaAvg9MZ.js} +2 -2
  138. package/assets/{send-gasless-transaction-hk-PL2RZ.js → send-gasless-transaction-BquzQGsb.js} +2 -2
  139. package/assets/{send-CQZNNlKI.js → send-oOaeKGnc.js} +1 -1
  140. package/assets/{send-transaction-Qs7YNICs.js → send-transaction-BHdPLXiu.js} +2 -2
  141. package/assets/{sendMetaTransaction-Bky8YK8T.js → sendMetaTransaction-DNedK3Cr.js} +1 -1
  142. package/assets/{sendRawTransaction-FrBDfTMh.js → sendRawTransaction-DUzMWVdQ.js} +3 -3
  143. package/assets/{serializeTransaction-BY81pWis.js → serializeTransaction-BfDfoMJJ.js} +1 -1
  144. package/assets/{session-proposal-DJycTDzh.js → session-proposal-CuVqfqoo.js} +1 -1
  145. package/assets/{session-request-CvXHUfW2.js → session-request-CKwxSrqb.js} +2 -2
  146. package/assets/{signing-C-pXPlUm.js → signing-BjyyWrkp.js} +3 -3
  147. package/assets/{socials-ZM1DPB14.js → socials-pvmMMGV3.js} +1 -1
  148. package/assets/{swaps-DWHYQxSV.js → swaps-padIwW3Y.js} +1 -1
  149. package/assets/{thirdweb-CdJoXk5x.js → thirdweb-kveVeUIA.js} +3 -3
  150. package/assets/{to-serializable-transaction-D53T_ITW.js → to-serializable-transaction-108u7zPg.js} +2 -2
  151. package/assets/{trade-encoding-C0CKvlMZ.js → trade-encoding-DcECym8l.js} +1 -1
  152. package/assets/{transactionReceipt-DcSpquTW.js → transactionReceipt-Bs-2Cglz.js} +1 -1
  153. package/assets/{transactions-BH9skO3z.js → transactions-dcat6MM1.js} +1 -1
  154. package/assets/useCreditPacks-BAZLy3JX.js +1 -0
  155. package/assets/{useInfiniteGrid-Byw1k8Mi.js → useInfiniteGrid-BBNOO0mR.js} +1 -1
  156. package/assets/useManaRate-CGtpZZBQ.js +1 -0
  157. package/assets/{useStore-ZMBovGpH.js → useStore-Bo6L1SFA.js} +1 -1
  158. package/assets/{useTheme-DqyRDQjm.js → useTheme-CQjQJ5Is.js} +1 -1
  159. package/assets/{verifyHash-DVsBhfqm.js → verifyHash-BfupbUWA.js} +1 -1
  160. package/assets/{w3m-modal-BJOvzFgf.js → w3m-modal-C2yr-A_-.js} +1 -1
  161. package/assets/{w3m-modal-r_B_A1Y3.js → w3m-modal-CdtZ4EYL.js} +1 -1
  162. package/assets/{wait-for-tx-receipt-BWOrjd7S.js → wait-for-tx-receipt-BBOv1oQx.js} +1 -1
  163. package/assets/{wallets-CQrQiCdZ.js → wallets-CcitqMTg.js} +5 -5
  164. package/assets/{web-connector-b-JbgcxK.js → web-connector-BLbBOK88.js} +3 -3
  165. package/assets/{writeContract-CRMw42Kd.js → writeContract-Cke2dgme.js} +1 -1
  166. package/assets/{zoraTestnet-ziGwenPM.js → zoraTestnet-NeGGigN-.js} +1 -1
  167. package/index.html +11 -11
  168. package/package.json +2 -2
  169. package/assets/useCreditPacks-DA-NvTNC.js +0 -1
  170. package/assets/useManaRate-CslU6wit.js +0 -1
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-BSpg_u0K.js","assets/sentry-BV_ZSgtd.js","assets/react-BW1xvPTF.js"])))=>i.map(i=>d[i]);
2
- import{p as gt,b as Yt,i as Qt,I as Zt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as me,x as Z,y as le,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as K,a0 as _e,a1 as Bt,a2 as Re,a3 as qe,a4 as mt,a5 as Fe,a6 as Ue,a7 as Be,a8 as ke,a9 as Ne,aa as kt,ab as Le}from"./parseSignature-cMUHSEHb.js";import{ac as Pr,ad as _r,ae as Rr,af as qr,ag as Fr,ah as Ur,ai as Br,aj as kr,ak as Nr,al as Lr,am as Mr,an as Dr,ao as zr,ap as Gr,aq as $r,ar as Hr,as as Or,at as jr,au as Wr,av as Vr,aw as Kr,ax as Jr,ay as Yr,az as Qr,aA as Zr,aB as Xr,aC as ts,aD as es,aE as as,aF as ns,aG as rs,aH as ss,aI as os,aJ as is,aK as cs,aL as us,aM as ds,aN as ms,aO as ls,aP as fs,aQ as hs,aR as ps,aS as ys,aT as gs,aU as bs,aV as ws,aW as xs,aX as Es,aY as Is,aZ as Ts,a_ as Cs,a$ as vs,b0 as Ss,b1 as As,b2 as Ps,b3 as _s,b4 as Rs,b5 as qs,b6 as Fs,b7 as Us,b8 as Bs,b9 as ks,ba as Ns,bb as Ls,bc as Ms,bd as Ds,be as zs,bf as Gs,bg as $s,bh as Hs,bi as Os,bj as js,bk as Ws,bl as Vs,bm as Ks,bn as Js,bo as Ys,bp as Qs,bq as Zs,br as Xs,bs as to,bt as eo,bu as ao,bv as no,bw as ro,bx as so,by as oo,bz as io,br as co,bA as uo,bB as mo,bC as lo,bD as fo,bE as ho,bF as po,bG as yo,bH as go,bH as bo,bI as wo,bJ as xo,bi as Eo,bj as Io,bK as To,bL as Co,bM as vo,bN as So,bO as Ao}from"./parseSignature-cMUHSEHb.js";import{R as k,b3 as B,S as Me,x as Y,a7 as De,w as ze,b4 as Ge,U as H,V as ct,W as G,B as lt,q as E,E as $e,a2 as He,b5 as j,a1 as wt,G as Nt,b6 as Lt,d as Mt,A as R,m as F,b7 as A,C as Oe,I as je,b8 as We,b9 as xt,y as Ve,ba as Ke,bb as Je,bc as Ye,bd as Et}from"./prepare-contract-call-CHrp3EL4.js";import{be as _o,O as Ro,a8 as qo,bf as Fo,bg as Uo,bh as Bo,bi as ko,bj as No,a9 as Lo,bk as Mo,J as Do,M as zo,bl as Go,bm as $o,bn as Ho,F as Oo,Q as jo,N as Wo,bo as Vo,bp as Ko,bq as Jo,br as Yo,bs as Qo,bt as Zo,bu as Xo,bv as ti,bw as ei,bx as ai,by as ni,bz as ri,bA as si,bB as oi,bC as ii,bD as ci,bE as ui,bF as di,bG as mi,bH as li,j as fi,bI as hi,bJ as pi,bK as yi,bL as gi,K as bi,bM as wi,t as xi,bM as Ei,bN as Ii,bO as Ti,bP as Ci,bQ as vi,bR as Si,bS as Ai,bT as Pi,bU as _i,K as Ri,bM as qi,bU as Fi,t as Ui,bM as Bi}from"./prepare-contract-call-CHrp3EL4.js";import{u as ft}from"./to-serializable-transaction-D53T_ITW.js";import{b as Ni,B as Li,C as Mi,D as Di,E as zi,m as Gi,n as $i,F as Hi,s as Oi,a as ji}from"./to-serializable-transaction-D53T_ITW.js";import{w as Qe,h as Ze,g as Xe,v as ta,s as ea}from"./hashTypedData-BTWIstyF.js";import{I as Vi,a as Ki,b as Ji,d as Yi,c as Qi,e as Zi}from"./hashTypedData-BTWIstyF.js";import{T as aa,a as Q,W as It,b as na,U as ra,R as sa}from"./rpc-DR3Pyl3d.js";import{A as tc,c as ec,B as ac,C as nc,D as rc,H as sc,I as oc,d as ic,e as cc,f as uc,J as dc,L as mc,M as lc,h as fc,P as hc,i as pc,j as yc,k as gc,l as bc,m as wc,S as xc,n as Ec,o as Ic,p as Tc,q as Cc,r as vc,s as Sc}from"./rpc-DR3Pyl3d.js";import{_ as oa}from"./index-ZWDXIF6O.js";import{t as ia,H as ca}from"./sha256-BImz_UXn.js";import{b as Pc,h as _c,a as Rc,c as qc,d as Fc,e as Uc,f as Bc,g as kc,i as Nc,j as Lc,k as Mc,l as Dc,n as zc,o as Gc,p as $c,q as Hc,r as Oc,u as jc,v as Wc,w as Vc,x as Kc,y as Jc,z as Yc,A as Qc,B as Zc,C as Xc,D as tu,E as eu,F as au,G as nu,I as ru,J as su,K as ou,L as iu,M as cu,N as uu,O as du,P as mu,Q as lu,R as fu,S as hu,m as pu,T as yu,U as gu,V as bu,W as wu,X as xu,Y as Eu,Z as Iu,_ as Tu,$ as Cu,a0 as vu,a1 as Su,a2 as Au,a3 as Pu,a4 as _u,a5 as Ru,a6 as qu,a7 as Fu,a8 as Uu,a9 as Bu,aa as ku,ab as Nu,ac as Lu,ad as Mu,ae as Du,af as zu,ag as Gu,ah as $u,ai as Hu,aj as Ou,ak as ju,al as Wu,am as Vu,an as Ku,ao as Ju,ap as Yu,aq as Qu,ar as Zu,as as Xu,at as td,au as ed,av as ad,aw as nd,ax as rd,ay as sd,az as od,aA as id,aB as cd,aC as ud,aD as dd,aE as md,aF as ld,aG as fd,aH as hd,aI as pd,aJ as yd,aK as gd,s as bd}from"./sha256-BImz_UXn.js";import{i as ht}from"./get-bytecode-C6TlbHJu.js";import{d as xd,a as Ed}from"./get-bytecode-C6TlbHJu.js";import{ccipRequest as Td,ccipRequest as Cd,offchainLookup as vd,offchainLookupAbiItem as Sd,offchainLookupSignature as Ad}from"./ccip-DN5nMPw-.js";import{d as _d,a as Rd,f as qd}from"./transactionReceipt-DcSpquTW.js";import"./utils-B7rjkjB1.js";import"./sentry-BV_ZSgtd.js";import"./react-BW1xvPTF.js";import"./transaction-BOS1fhp8.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";function Qn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Qt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Zt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:l,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:l});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(m){throw te(m,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:l,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Zn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,l=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(l=!0),i&&f&&l)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),l&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:m,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Xn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=k(B(t.from));let a=k(t.nonce);return a[0]===0&&(a=new Uint8Array([])),B(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=k(B(t.from)),a=Me(Tt(t.salt)?t.salt:k(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:k(t.bytecodeHash):Y(t.bytecode,"bytes");return B(De(Y(ze([k("0xff"),e,a,n])),12))}function tr({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return ma(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new lt("Invalid RLP prefix")}function ma(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function la(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,l=this.h4|0,h=l;for(let o=0;o<5;o++){const p=4-o,m=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+m,C[x])+l|0;n=l,l=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+l+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function er(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?k(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let l=0;const{schedule:h}=ie({id:i,fn:async()=>{const m=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&l<d){if(b)return;b=!0,l++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else m.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of m.values())(v=S.onError)==null||v.call(S,new Q({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Q({url:s}));x()},onError(v){var P,S;w=v;for(const _ of m.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,l=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:m,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};m.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Qe(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:m,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function J(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-BSpg_u0K.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",l),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function l({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",l),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Q({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Q({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await J(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function ar(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function nr(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=me(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Z({hash:le(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Z({hash:Ze({domain:e,message:a,primaryType:n,types:s}),signature:r})}function rr(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function sr({address:t,hash:e,signature:a}){return ht(B(t),await Z({hash:e,signature:a}))}async function or({address:t,message:e,signature:a}){return ht(B(t),await Sa({message:e,signature:a}))}async function ir(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ht(B(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):Ba(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:l,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const m={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(m.to=d),E(u)&&u!=="0x"&&(m.gas=A(u)),E(i)&&i!=="0x"&&(m.data=i),E(n)&&(m.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(m.value=A(c)),E(s)&&s!=="0x"&&(m.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(m.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(m.accessList=tt(f)),l.length!==0&&l!=="0x"&&(m.authorizationList=ka(l)),we(m),{...e.length===13?O(e):void 0,...m}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,l,h,o,p,m,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:l,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:m,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(l)&&l!=="0x"&&(I.value=A(l)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:l,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:l,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function Ba(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const l={type:"legacy"};if(E(s)&&s!=="0x"&&(l.to=s),E(r)&&r!=="0x"&&(l.gas=A(r)),E(d)&&d!=="0x"&&(l.data=d),E(a)&&(l.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(l.value=A(u)),E(n)&&n!=="0x"&&(l.gasPrice=A(n)),xe(l),e.length===6)return l;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(l.chainId=Number(h)),l;const o=h,p=Number((o-35n)/2n);if(p>0)l.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return l.v=o,l.s=f,l.r=i,l.yParity=o%2n===0n?1:0,l}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>la(s)?s:We(s))})}return e}function ka(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends lt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function cr(t,e="wei"){return Wt(t,Ie[e])}function ur(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ka(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ja(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,m=(o||ft)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function Qa(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Za(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function mn(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function ln(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ka(a,n),revert:n=>Ja(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Qa(a,n),setBalance:n=>Za(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>mn(a,n),snapshot:()=>ln(a),stopImpersonatingAccount:n=>fn(a,n)}}}function dr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,l]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=l}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>B(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Ke(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:m,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new lt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ft)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Kt=pt?"wallet_sendTransaction":"eth_sendTransaction",Jt=await(async()=>{try{return await t.request({method:Kt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Jt,pollingInterval:p,timeout:C});if(m&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:m})}throw(b==null?void 0:b.type)==="smart"?new K({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new K({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof K?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new K({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await Bt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Je(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,l,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ft;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(l=t.chain)==null?void 0:l.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>Bt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function mr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function lr(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>mt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function fr(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...l})=>{let h=t,o=()=>{};const p=mt({key:a,name:n,async request({method:m,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...l,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:m,params:y});return o({method:m,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:m,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(m):v?!v.includes(m):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:m=>o=m,transports:h.map(m=>m({chain:c,retryCount:0}))});if(r){const m=typeof r=="object"?r:{};Un({chain:c,interval:m.interval??i,onTransports:y=>h=y,ping:m.ping,sampleCount:m.sampleCount,timeout:m.timeout,transports:h,weights:m.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],l=async()=>{const h=await Promise.all(u.map(async m=>{const y=m({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(m=>Math.max(...m.map(({latency:y})=>y)))),p=u.map((m,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((m,y)=>y[0]-m[0]);a(p.map(([,m])=>u[m])),await Ue(e),l()};l()}function hr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var m;const l=e.retryCount??i,h=f??e.timeout??1e4,o=t||((m=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:m[0]),p={keepAlive:a,reconnect:u};if(!o)throw new Be;return mt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await J(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:l,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return J(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await J(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class pr extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function yr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function gr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const l=c.readByte();if(l===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(l)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function br(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(ke({commitment:s,to:n,version:a}));return r}const Bn=2147483648;function wr(t){if(t===1)return 60n;if(t>=Bn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function kn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function xr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return kn(t)}function Er({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function Ir(t){const{r:e,s:a}=kt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function Tr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Z({hash:Y(s),signature:r})}function Cr({r:t,yParityAndS:e}){return`0x${new kt.Signature(A(t),A(e)).toCompactHex()}`}function vr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,_o as AbiDecodingDataSizeInvalidError,Ro as AbiDecodingDataSizeTooSmallError,qo as AbiDecodingZeroDataError,Fo as AbiEncodingArrayLengthMismatchError,Uo as AbiEncodingBytesSizeMismatchError,Bo as AbiEncodingLengthMismatchError,ko as AbiErrorInputsNotFoundError,No as AbiErrorNotFoundError,Lo as AbiErrorSignatureNotFoundError,Mo as AbiEventNotFoundError,Do as AbiEventSignatureEmptyTopicsError,zo as AbiEventSignatureNotFoundError,Go as AbiFunctionNotFoundError,$o as AbiFunctionOutputsNotFoundError,Ho as AbiFunctionSignatureNotFoundError,Pr as AccountStateConflictError,tc as AtomicReadyWalletRejectedUpgradeError,ec as AtomicityNotSupportedError,lt as BaseError,_r as BaseFeeScalarError,Rr as BlockNotFoundError,qr as BundleFailedError,ac as BundleTooLargeError,Oo as BytesSizeMismatchError,Fr as CallExecutionError,nc as ChainDisconnectedError,Ur as ChainDoesNotSupportContract,Br as ChainMismatchError,kr as ChainNotFoundError,Nr as CircularReferenceError,Lr as ClientChainNotConfiguredError,Mr as ContractFunctionExecutionError,Dr as ContractFunctionRevertedError,zr as ContractFunctionZeroDataError,Gr as CounterfactualDeploymentFailedError,jo as DecodeLogDataMismatch,Wo as DecodeLogTopicsMismatch,rc as DuplicateIdError,pr as EIP1193ProviderRpcError,$r as Eip1559FeesNotSupportedError,Hr as EnsAvatarInvalidNftUriError,Or as EnsAvatarUnsupportedNamespaceError,jr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,Wr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Vr as FeeCapTooHighError,Kr as FeeCapTooLowError,Jr as FeeConflictError,Vo as FilterTypeNotSupportedError,sc as HttpRequestError,Yr as InsufficientFundsError,Ko as IntegerOutOfRangeError,oc as InternalRpcError,Qr as IntrinsicGasTooHighError,Zr as IntrinsicGasTooLowError,Jo as InvalidAbiDecodingTypeError,Yo as InvalidAbiEncodingTypeError,Xr as InvalidAbiItemError,Zt as InvalidAbiParameterError,ts as InvalidAbiParametersError,es as InvalidAbiTypeParameterError,je as InvalidAddressError,Qo as InvalidArrayError,Zo as InvalidBytesBooleanError,as as InvalidChainIdError,Na as InvalidDecimalNumberError,Xo as InvalidDefinitionTypeError,Vi as InvalidDomainError,ns as InvalidFunctionModifierError,ti as InvalidHexBooleanError,Ge as InvalidHexValueError,ic as InvalidInputRpcError,Ee as InvalidLegacyVError,rs as InvalidModifierError,ss as InvalidParameterError,cc as InvalidParamsRpcError,os as InvalidParenthesisError,Ki as InvalidPrimaryTypeError,uc as InvalidRequestRpcError,is as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,cs as InvalidSignatureError,us as InvalidStorageKeySizeError,ds as InvalidStructSignatureError,Ji as InvalidStructTypeError,dc as JsonRpcVersionUnsupportedError,mc as LimitExceededRpcError,ms as MaxFeePerGasTooLowError,lc as MethodNotFoundRpcError,fc as MethodNotSupportedRpcError,ls as NonceMaxValueError,fs as NonceTooHighError,hs as NonceTooLowError,hc as ParseRpcError,pc as ProviderDisconnectedError,yc as ProviderRpcError,ps as RawContractError,gc as ResourceNotFoundRpcError,bc as ResourceUnavailableRpcError,wc as RpcError,sa as RpcRequestError,ei as SizeExceedsPaddingSizeError,ai as SizeOverflowError,ni as SliceOffsetOutOfBoundsError,Q as SocketClosedError,ys as SolidityProtectedKeywordError,gs as StateAssignmentConflictError,xc as SwitchChainError,aa as TimeoutError,bs as TipAboveFeeCapError,ws as TransactionExecutionError,xs as TransactionNotFoundError,Es as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,Is as TransactionTypeNotSupportedError,Ec as UnauthorizedProviderError,Ic as UnknownBundleIdError,Ts as UnknownNodeError,Tc as UnknownRpcError,Cs as UnknownSignatureError,vs as UnknownTypeError,Cc as UnsupportedChainIdError,vc as UnsupportedNonOptionalCapabilityError,ri as UnsupportedPackedAbiType,Sc as UnsupportedProviderMethodError,Be as UrlRequiredError,ra as UserRejectedRequestError,Ss as WaitForCallsStatusTimeoutError,As as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Ps as blobsToCommitments,_s as blobsToProofs,si as boolToBytes,oi as boolToHex,ii as bytesToBigInt,ci as bytesToBool,G as bytesToHex,ui as bytesToNumber,Pc as bytesToRlp,di as bytesToString,Td as ccipFetch,Cd as ccipRequest,Ve as checksumAddress,ke as commitmentToVersionedHash,Rs as commitmentsToVersionedHashes,Cr as compactSignatureToHex,Er as compactSignatureToSignature,ze as concat,mi as concatBytes,li as concatHex,At as createClient,qs as createNonceManager,Fs as createPublicClient,dr as createTestClient,mt as createTransport,mr as createWalletClient,lr as custom,Mt as decodeAbiParameters,yr as decodeDeployData,Ni as decodeErrorResult,xd as decodeEventLog,Us as decodeFunctionData,Bs as decodeFunctionResult,Li as defineBlock,Mi as defineChain,kn as defineKzg,Di as defineTransaction,_d as defineTransactionReceipt,zi as defineTransactionRequest,ks as deploylessCallViaBytecodeBytecode,Ns as deploylessCallViaFactoryBytecode,Yi as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,Ls as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Ms as encodeFunctionResult,Ds as encodePacked,zs as erc1155Abi,Gs as erc20Abi,$s as erc20Abi_bytes32,Hs as erc4626Abi,Os as erc6492SignatureValidatorAbi,js as erc6492SignatureValidatorByteCode,Ws as erc721Abi,Vs as ethAddress,Ie as etherUnits,tr as extractChain,fr as fallback,Gi as formatBlock,Ks as formatEther,Js as formatGwei,Rd as formatLog,$i as formatTransaction,qd as formatTransactionReceipt,ft as formatTransactionRequest,Ys as formatUnits,gr as fromBlobs,pi as fromBytes,yi as fromHex,Dt as fromRlp,gi as getAbiItem,B as getAddress,Qs as getChainContractAddress,Zn as getContract,Xn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,bi as getEventSelector,wi as getEventSignature,xi as getFunctionSelector,Ei as getFunctionSignature,Pa as getSerializedTransactionType,Zs as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Qi as hashDomain,le as hashMessage,Zi as hashStruct,Ze as hashTypedData,A as hexToBigInt,Ii as hexToBool,H as hexToBytes,Ir as hexToCompactSignature,F as hexToNumber,_c as hexToRlp,Xs as hexToSignature,Ti as hexToString,to as http,Oe as isAddress,ht as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,la as isHash,E as isHex,Y as keccak256,eo as labelhash,Rc as maxInt104,qc as maxInt112,Fc as maxInt120,Uc as maxInt128,Bc as maxInt136,kc as maxInt144,Nc as maxInt152,Lc as maxInt16,Mc as maxInt160,Dc as maxInt168,zc as maxInt176,Gc as maxInt184,$c as maxInt192,Hc as maxInt200,Oc as maxInt208,jc as maxInt216,Wc as maxInt224,Vc as maxInt232,Kc as maxInt24,Jc as maxInt240,Yc as maxInt248,Qc as maxInt256,Zc as maxInt32,Xc as maxInt40,tu as maxInt48,eu as maxInt56,au as maxInt64,nu as maxInt72,ru as maxInt8,su as maxInt80,ou as maxInt88,iu as maxInt96,cu as maxUint104,uu as maxUint112,du as maxUint120,mu as maxUint128,lu as maxUint136,fu as maxUint144,hu as maxUint152,pu as maxUint16,yu as maxUint160,gu as maxUint168,bu as maxUint176,wu as maxUint184,xu as maxUint192,Eu as maxUint200,Iu as maxUint208,Tu as maxUint216,Cu as maxUint224,vu as maxUint232,Su as maxUint24,Au as maxUint240,Pu as maxUint248,_u as maxUint256,Ru as maxUint32,qu as maxUint40,Fu as maxUint48,Uu as maxUint56,Bu as maxUint64,ku as maxUint72,Nu as maxUint8,Lu as maxUint80,Mu as maxUint88,Du as maxUint96,zu as minInt104,Gu as minInt112,$u as minInt120,Hu as minInt128,Ou as minInt136,ju as minInt144,Wu as minInt152,Vu as minInt16,Ku as minInt160,Ju as minInt168,Yu as minInt176,Qu as minInt184,Zu as minInt192,Xu as minInt200,td as minInt208,ed as minInt216,ad as minInt224,nd as minInt232,rd as minInt24,sd as minInt240,od as minInt248,id as minInt256,cd as minInt32,ud as minInt40,dd as minInt48,md as minInt56,ld as minInt64,fd as minInt72,hd as minInt8,pd as minInt80,yd as minInt88,gd as minInt96,ao as multicall3Abi,no as namehash,ro as nonceManager,Ci as numberToBytes,R as numberToHex,vd as offchainLookup,Sd as offchainLookupAbiItem,Ad as offchainLookupSignature,Me as pad,vi as padBytes,xt as padHex,so as parseAbi,oo as parseAbiItem,Qn as parseAbiParameter,io as parseAbiParameters,Ir as parseCompactSignature,ar as parseErc6492Signature,nr as parseErc8010Signature,cr as parseEther,Ed as parseEventLogs,ur as parseGwei,co as parseSignature,_a as parseTransaction,Wt as parseUnits,uo as prepareEncodeFunctionData,mo as presignMessagePrefix,lo as publicActions,Z as recoverAddress,Sa as recoverMessageAddress,fo as recoverPublicKey,Tr as recoverTransactionAddress,Aa as recoverTypedDataAddress,er as ripemd160,ho as rpcSchema,Hi as rpcTransactionType,po as serializeAccessList,Cr as serializeCompactSignature,yo as serializeErc6492Signature,rr as serializeErc8010Signature,go as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Si as setErrorConfig,xr as setupKzg,bd as sha256,Fn as shouldThrow,br as sidecarsToVersionedHashes,vr as signatureToCompactSignature,bo as signatureToHex,$e as size,De as slice,Ai as sliceBytes,Lt as sliceHex,Pi as stringToBytes,Je as stringToHex,Oi as stringify,hn as testActions,ge as toBlobSidecars,wo as toBlobs,k as toBytes,wr as toCoinType,_i as toEventHash,Ri as toEventSelector,qi as toEventSignature,Fi as toFunctionHash,Ui as toFunctionSelector,Bi as toFunctionSignature,Nt as toHex,xo as toPrefixedMessage,ia as toRlp,ji as transactionType,We as trim,Eo as universalSignatureValidatorAbi,Io as universalSignatureValidatorByteCode,ta as validateTypedData,sr as verifyHash,or as verifyMessage,ir as verifyTypedData,qn as walletActions,hr as webSocket,To as weiUnits,Co as withCache,vo as withRetry,Qe as withTimeout,So as zeroAddress,Ao as zeroHash};
2
+ import{p as gt,b as Yt,i as Qt,I as Zt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as me,x as Z,y as le,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as K,a0 as _e,a1 as Bt,a2 as Re,a3 as qe,a4 as mt,a5 as Fe,a6 as Ue,a7 as Be,a8 as ke,a9 as Ne,aa as kt,ab as Le}from"./parseSignature-D3qKk3uH.js";import{ac as Pr,ad as _r,ae as Rr,af as qr,ag as Fr,ah as Ur,ai as Br,aj as kr,ak as Nr,al as Lr,am as Mr,an as Dr,ao as zr,ap as Gr,aq as $r,ar as Hr,as as Or,at as jr,au as Wr,av as Vr,aw as Kr,ax as Jr,ay as Yr,az as Qr,aA as Zr,aB as Xr,aC as ts,aD as es,aE as as,aF as ns,aG as rs,aH as ss,aI as os,aJ as is,aK as cs,aL as us,aM as ds,aN as ms,aO as ls,aP as fs,aQ as hs,aR as ps,aS as ys,aT as gs,aU as bs,aV as ws,aW as xs,aX as Es,aY as Is,aZ as Ts,a_ as Cs,a$ as vs,b0 as Ss,b1 as As,b2 as Ps,b3 as _s,b4 as Rs,b5 as qs,b6 as Fs,b7 as Us,b8 as Bs,b9 as ks,ba as Ns,bb as Ls,bc as Ms,bd as Ds,be as zs,bf as Gs,bg as $s,bh as Hs,bi as Os,bj as js,bk as Ws,bl as Vs,bm as Ks,bn as Js,bo as Ys,bp as Qs,bq as Zs,br as Xs,bs as to,bt as eo,bu as ao,bv as no,bw as ro,bx as so,by as oo,bz as io,br as co,bA as uo,bB as mo,bC as lo,bD as fo,bE as ho,bF as po,bG as yo,bH as go,bH as bo,bI as wo,bJ as xo,bi as Eo,bj as Io,bK as To,bL as Co,bM as vo,bN as So,bO as Ao}from"./parseSignature-D3qKk3uH.js";import{R as k,b3 as B,S as Me,x as Y,a7 as De,w as ze,b4 as Ge,U as H,V as ct,W as G,B as lt,q as E,E as $e,a2 as He,b5 as j,a1 as wt,G as Nt,b6 as Lt,d as Mt,A as R,m as F,b7 as A,C as Oe,I as je,b8 as We,b9 as xt,y as Ve,ba as Ke,bb as Je,bc as Ye,bd as Et}from"./prepare-contract-call-CHrp3EL4.js";import{be as _o,O as Ro,a8 as qo,bf as Fo,bg as Uo,bh as Bo,bi as ko,bj as No,a9 as Lo,bk as Mo,J as Do,M as zo,bl as Go,bm as $o,bn as Ho,F as Oo,Q as jo,N as Wo,bo as Vo,bp as Ko,bq as Jo,br as Yo,bs as Qo,bt as Zo,bu as Xo,bv as ti,bw as ei,bx as ai,by as ni,bz as ri,bA as si,bB as oi,bC as ii,bD as ci,bE as ui,bF as di,bG as mi,bH as li,j as fi,bI as hi,bJ as pi,bK as yi,bL as gi,K as bi,bM as wi,t as xi,bM as Ei,bN as Ii,bO as Ti,bP as Ci,bQ as vi,bR as Si,bS as Ai,bT as Pi,bU as _i,K as Ri,bM as qi,bU as Fi,t as Ui,bM as Bi}from"./prepare-contract-call-CHrp3EL4.js";import{u as ft}from"./to-serializable-transaction-108u7zPg.js";import{b as Ni,B as Li,C as Mi,D as Di,E as zi,m as Gi,n as $i,F as Hi,s as Oi,a as ji}from"./to-serializable-transaction-108u7zPg.js";import{w as Qe,h as Ze,g as Xe,v as ta,s as ea}from"./hashTypedData-Y2DJnKI9.js";import{I as Vi,a as Ki,b as Ji,d as Yi,c as Qi,e as Zi}from"./hashTypedData-Y2DJnKI9.js";import{T as aa,a as Q,W as It,b as na,U as ra,R as sa}from"./rpc-DjbYCcnH.js";import{A as tc,c as ec,B as ac,C as nc,D as rc,H as sc,I as oc,d as ic,e as cc,f as uc,J as dc,L as mc,M as lc,h as fc,P as hc,i as pc,j as yc,k as gc,l as bc,m as wc,S as xc,n as Ec,o as Ic,p as Tc,q as Cc,r as vc,s as Sc}from"./rpc-DjbYCcnH.js";import{_ as oa}from"./index-BFPNYe8x.js";import{t as ia,H as ca}from"./sha256-BImz_UXn.js";import{b as Pc,h as _c,a as Rc,c as qc,d as Fc,e as Uc,f as Bc,g as kc,i as Nc,j as Lc,k as Mc,l as Dc,n as zc,o as Gc,p as $c,q as Hc,r as Oc,u as jc,v as Wc,w as Vc,x as Kc,y as Jc,z as Yc,A as Qc,B as Zc,C as Xc,D as tu,E as eu,F as au,G as nu,I as ru,J as su,K as ou,L as iu,M as cu,N as uu,O as du,P as mu,Q as lu,R as fu,S as hu,m as pu,T as yu,U as gu,V as bu,W as wu,X as xu,Y as Eu,Z as Iu,_ as Tu,$ as Cu,a0 as vu,a1 as Su,a2 as Au,a3 as Pu,a4 as _u,a5 as Ru,a6 as qu,a7 as Fu,a8 as Uu,a9 as Bu,aa as ku,ab as Nu,ac as Lu,ad as Mu,ae as Du,af as zu,ag as Gu,ah as $u,ai as Hu,aj as Ou,ak as ju,al as Wu,am as Vu,an as Ku,ao as Ju,ap as Yu,aq as Qu,ar as Zu,as as Xu,at as td,au as ed,av as ad,aw as nd,ax as rd,ay as sd,az as od,aA as id,aB as cd,aC as ud,aD as dd,aE as md,aF as ld,aG as fd,aH as hd,aI as pd,aJ as yd,aK as gd,s as bd}from"./sha256-BImz_UXn.js";import{i as ht}from"./get-bytecode-C6TlbHJu.js";import{d as xd,a as Ed}from"./get-bytecode-C6TlbHJu.js";import{ccipRequest as Td,ccipRequest as Cd,offchainLookup as vd,offchainLookupAbiItem as Sd,offchainLookupSignature as Ad}from"./ccip-wypw12me.js";import{d as _d,a as Rd,f as qd}from"./transactionReceipt-Bs-2Cglz.js";import"./utils-B7rjkjB1.js";import"./sentry-BV_ZSgtd.js";import"./react-BW1xvPTF.js";import"./transaction-BOS1fhp8.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";function Qn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Qt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Zt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:l,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:l});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(m){throw te(m,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:l,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Zn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,l=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(l=!0),i&&f&&l)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),l&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:m,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Xn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=k(B(t.from));let a=k(t.nonce);return a[0]===0&&(a=new Uint8Array([])),B(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=k(B(t.from)),a=Me(Tt(t.salt)?t.salt:k(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:k(t.bytecodeHash):Y(t.bytecode,"bytes");return B(De(Y(ze([k("0xff"),e,a,n])),12))}function tr({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return ma(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new lt("Invalid RLP prefix")}function ma(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function la(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,l=this.h4|0,h=l;for(let o=0;o<5;o++){const p=4-o,m=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+m,C[x])+l|0;n=l,l=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+l+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function er(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?k(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let l=0;const{schedule:h}=ie({id:i,fn:async()=>{const m=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&l<d){if(b)return;b=!0,l++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else m.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of m.values())(v=S.onError)==null||v.call(S,new Q({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Q({url:s}));x()},onError(v){var P,S;w=v;for(const _ of m.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,l=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:m,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};m.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Qe(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:m,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function J(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-BSpg_u0K.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",l),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function l({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",l),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Q({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Q({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await J(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function ar(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function nr(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=me(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Z({hash:le(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Z({hash:Ze({domain:e,message:a,primaryType:n,types:s}),signature:r})}function rr(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function sr({address:t,hash:e,signature:a}){return ht(B(t),await Z({hash:e,signature:a}))}async function or({address:t,message:e,signature:a}){return ht(B(t),await Sa({message:e,signature:a}))}async function ir(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ht(B(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):Ba(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:l,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const m={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(m.to=d),E(u)&&u!=="0x"&&(m.gas=A(u)),E(i)&&i!=="0x"&&(m.data=i),E(n)&&(m.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(m.value=A(c)),E(s)&&s!=="0x"&&(m.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(m.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(m.accessList=tt(f)),l.length!==0&&l!=="0x"&&(m.authorizationList=ka(l)),we(m),{...e.length===13?O(e):void 0,...m}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,l,h,o,p,m,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:l,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:m,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(l)&&l!=="0x"&&(I.value=A(l)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:l,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:l,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function Ba(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const l={type:"legacy"};if(E(s)&&s!=="0x"&&(l.to=s),E(r)&&r!=="0x"&&(l.gas=A(r)),E(d)&&d!=="0x"&&(l.data=d),E(a)&&(l.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(l.value=A(u)),E(n)&&n!=="0x"&&(l.gasPrice=A(n)),xe(l),e.length===6)return l;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(l.chainId=Number(h)),l;const o=h,p=Number((o-35n)/2n);if(p>0)l.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return l.v=o,l.s=f,l.r=i,l.yParity=o%2n===0n?1:0,l}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>la(s)?s:We(s))})}return e}function ka(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends lt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function cr(t,e="wei"){return Wt(t,Ie[e])}function ur(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ka(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ja(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,m=(o||ft)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function Qa(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Za(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function mn(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function ln(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ka(a,n),revert:n=>Ja(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Qa(a,n),setBalance:n=>Za(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>mn(a,n),snapshot:()=>ln(a),stopImpersonatingAccount:n=>fn(a,n)}}}function dr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,l]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=l}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>B(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Ke(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:m,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new lt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ft)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Kt=pt?"wallet_sendTransaction":"eth_sendTransaction",Jt=await(async()=>{try{return await t.request({method:Kt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Jt,pollingInterval:p,timeout:C});if(m&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:m})}throw(b==null?void 0:b.type)==="smart"?new K({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new K({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof K?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new K({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await Bt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Je(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,l,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ft;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(l=t.chain)==null?void 0:l.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>Bt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function mr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function lr(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>mt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function fr(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...l})=>{let h=t,o=()=>{};const p=mt({key:a,name:n,async request({method:m,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...l,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:m,params:y});return o({method:m,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:m,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(m):v?!v.includes(m):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:m=>o=m,transports:h.map(m=>m({chain:c,retryCount:0}))});if(r){const m=typeof r=="object"?r:{};Un({chain:c,interval:m.interval??i,onTransports:y=>h=y,ping:m.ping,sampleCount:m.sampleCount,timeout:m.timeout,transports:h,weights:m.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],l=async()=>{const h=await Promise.all(u.map(async m=>{const y=m({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(m=>Math.max(...m.map(({latency:y})=>y)))),p=u.map((m,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((m,y)=>y[0]-m[0]);a(p.map(([,m])=>u[m])),await Ue(e),l()};l()}function hr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var m;const l=e.retryCount??i,h=f??e.timeout??1e4,o=t||((m=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:m[0]),p={keepAlive:a,reconnect:u};if(!o)throw new Be;return mt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await J(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:l,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return J(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await J(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class pr extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function yr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function gr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const l=c.readByte();if(l===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(l)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function br(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(ke({commitment:s,to:n,version:a}));return r}const Bn=2147483648;function wr(t){if(t===1)return 60n;if(t>=Bn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function kn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function xr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return kn(t)}function Er({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function Ir(t){const{r:e,s:a}=kt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function Tr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Z({hash:Y(s),signature:r})}function Cr({r:t,yParityAndS:e}){return`0x${new kt.Signature(A(t),A(e)).toCompactHex()}`}function vr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,_o as AbiDecodingDataSizeInvalidError,Ro as AbiDecodingDataSizeTooSmallError,qo as AbiDecodingZeroDataError,Fo as AbiEncodingArrayLengthMismatchError,Uo as AbiEncodingBytesSizeMismatchError,Bo as AbiEncodingLengthMismatchError,ko as AbiErrorInputsNotFoundError,No as AbiErrorNotFoundError,Lo as AbiErrorSignatureNotFoundError,Mo as AbiEventNotFoundError,Do as AbiEventSignatureEmptyTopicsError,zo as AbiEventSignatureNotFoundError,Go as AbiFunctionNotFoundError,$o as AbiFunctionOutputsNotFoundError,Ho as AbiFunctionSignatureNotFoundError,Pr as AccountStateConflictError,tc as AtomicReadyWalletRejectedUpgradeError,ec as AtomicityNotSupportedError,lt as BaseError,_r as BaseFeeScalarError,Rr as BlockNotFoundError,qr as BundleFailedError,ac as BundleTooLargeError,Oo as BytesSizeMismatchError,Fr as CallExecutionError,nc as ChainDisconnectedError,Ur as ChainDoesNotSupportContract,Br as ChainMismatchError,kr as ChainNotFoundError,Nr as CircularReferenceError,Lr as ClientChainNotConfiguredError,Mr as ContractFunctionExecutionError,Dr as ContractFunctionRevertedError,zr as ContractFunctionZeroDataError,Gr as CounterfactualDeploymentFailedError,jo as DecodeLogDataMismatch,Wo as DecodeLogTopicsMismatch,rc as DuplicateIdError,pr as EIP1193ProviderRpcError,$r as Eip1559FeesNotSupportedError,Hr as EnsAvatarInvalidNftUriError,Or as EnsAvatarUnsupportedNamespaceError,jr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,Wr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Vr as FeeCapTooHighError,Kr as FeeCapTooLowError,Jr as FeeConflictError,Vo as FilterTypeNotSupportedError,sc as HttpRequestError,Yr as InsufficientFundsError,Ko as IntegerOutOfRangeError,oc as InternalRpcError,Qr as IntrinsicGasTooHighError,Zr as IntrinsicGasTooLowError,Jo as InvalidAbiDecodingTypeError,Yo as InvalidAbiEncodingTypeError,Xr as InvalidAbiItemError,Zt as InvalidAbiParameterError,ts as InvalidAbiParametersError,es as InvalidAbiTypeParameterError,je as InvalidAddressError,Qo as InvalidArrayError,Zo as InvalidBytesBooleanError,as as InvalidChainIdError,Na as InvalidDecimalNumberError,Xo as InvalidDefinitionTypeError,Vi as InvalidDomainError,ns as InvalidFunctionModifierError,ti as InvalidHexBooleanError,Ge as InvalidHexValueError,ic as InvalidInputRpcError,Ee as InvalidLegacyVError,rs as InvalidModifierError,ss as InvalidParameterError,cc as InvalidParamsRpcError,os as InvalidParenthesisError,Ki as InvalidPrimaryTypeError,uc as InvalidRequestRpcError,is as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,cs as InvalidSignatureError,us as InvalidStorageKeySizeError,ds as InvalidStructSignatureError,Ji as InvalidStructTypeError,dc as JsonRpcVersionUnsupportedError,mc as LimitExceededRpcError,ms as MaxFeePerGasTooLowError,lc as MethodNotFoundRpcError,fc as MethodNotSupportedRpcError,ls as NonceMaxValueError,fs as NonceTooHighError,hs as NonceTooLowError,hc as ParseRpcError,pc as ProviderDisconnectedError,yc as ProviderRpcError,ps as RawContractError,gc as ResourceNotFoundRpcError,bc as ResourceUnavailableRpcError,wc as RpcError,sa as RpcRequestError,ei as SizeExceedsPaddingSizeError,ai as SizeOverflowError,ni as SliceOffsetOutOfBoundsError,Q as SocketClosedError,ys as SolidityProtectedKeywordError,gs as StateAssignmentConflictError,xc as SwitchChainError,aa as TimeoutError,bs as TipAboveFeeCapError,ws as TransactionExecutionError,xs as TransactionNotFoundError,Es as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,Is as TransactionTypeNotSupportedError,Ec as UnauthorizedProviderError,Ic as UnknownBundleIdError,Ts as UnknownNodeError,Tc as UnknownRpcError,Cs as UnknownSignatureError,vs as UnknownTypeError,Cc as UnsupportedChainIdError,vc as UnsupportedNonOptionalCapabilityError,ri as UnsupportedPackedAbiType,Sc as UnsupportedProviderMethodError,Be as UrlRequiredError,ra as UserRejectedRequestError,Ss as WaitForCallsStatusTimeoutError,As as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Ps as blobsToCommitments,_s as blobsToProofs,si as boolToBytes,oi as boolToHex,ii as bytesToBigInt,ci as bytesToBool,G as bytesToHex,ui as bytesToNumber,Pc as bytesToRlp,di as bytesToString,Td as ccipFetch,Cd as ccipRequest,Ve as checksumAddress,ke as commitmentToVersionedHash,Rs as commitmentsToVersionedHashes,Cr as compactSignatureToHex,Er as compactSignatureToSignature,ze as concat,mi as concatBytes,li as concatHex,At as createClient,qs as createNonceManager,Fs as createPublicClient,dr as createTestClient,mt as createTransport,mr as createWalletClient,lr as custom,Mt as decodeAbiParameters,yr as decodeDeployData,Ni as decodeErrorResult,xd as decodeEventLog,Us as decodeFunctionData,Bs as decodeFunctionResult,Li as defineBlock,Mi as defineChain,kn as defineKzg,Di as defineTransaction,_d as defineTransactionReceipt,zi as defineTransactionRequest,ks as deploylessCallViaBytecodeBytecode,Ns as deploylessCallViaFactoryBytecode,Yi as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,Ls as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Ms as encodeFunctionResult,Ds as encodePacked,zs as erc1155Abi,Gs as erc20Abi,$s as erc20Abi_bytes32,Hs as erc4626Abi,Os as erc6492SignatureValidatorAbi,js as erc6492SignatureValidatorByteCode,Ws as erc721Abi,Vs as ethAddress,Ie as etherUnits,tr as extractChain,fr as fallback,Gi as formatBlock,Ks as formatEther,Js as formatGwei,Rd as formatLog,$i as formatTransaction,qd as formatTransactionReceipt,ft as formatTransactionRequest,Ys as formatUnits,gr as fromBlobs,pi as fromBytes,yi as fromHex,Dt as fromRlp,gi as getAbiItem,B as getAddress,Qs as getChainContractAddress,Zn as getContract,Xn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,bi as getEventSelector,wi as getEventSignature,xi as getFunctionSelector,Ei as getFunctionSignature,Pa as getSerializedTransactionType,Zs as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Qi as hashDomain,le as hashMessage,Zi as hashStruct,Ze as hashTypedData,A as hexToBigInt,Ii as hexToBool,H as hexToBytes,Ir as hexToCompactSignature,F as hexToNumber,_c as hexToRlp,Xs as hexToSignature,Ti as hexToString,to as http,Oe as isAddress,ht as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,la as isHash,E as isHex,Y as keccak256,eo as labelhash,Rc as maxInt104,qc as maxInt112,Fc as maxInt120,Uc as maxInt128,Bc as maxInt136,kc as maxInt144,Nc as maxInt152,Lc as maxInt16,Mc as maxInt160,Dc as maxInt168,zc as maxInt176,Gc as maxInt184,$c as maxInt192,Hc as maxInt200,Oc as maxInt208,jc as maxInt216,Wc as maxInt224,Vc as maxInt232,Kc as maxInt24,Jc as maxInt240,Yc as maxInt248,Qc as maxInt256,Zc as maxInt32,Xc as maxInt40,tu as maxInt48,eu as maxInt56,au as maxInt64,nu as maxInt72,ru as maxInt8,su as maxInt80,ou as maxInt88,iu as maxInt96,cu as maxUint104,uu as maxUint112,du as maxUint120,mu as maxUint128,lu as maxUint136,fu as maxUint144,hu as maxUint152,pu as maxUint16,yu as maxUint160,gu as maxUint168,bu as maxUint176,wu as maxUint184,xu as maxUint192,Eu as maxUint200,Iu as maxUint208,Tu as maxUint216,Cu as maxUint224,vu as maxUint232,Su as maxUint24,Au as maxUint240,Pu as maxUint248,_u as maxUint256,Ru as maxUint32,qu as maxUint40,Fu as maxUint48,Uu as maxUint56,Bu as maxUint64,ku as maxUint72,Nu as maxUint8,Lu as maxUint80,Mu as maxUint88,Du as maxUint96,zu as minInt104,Gu as minInt112,$u as minInt120,Hu as minInt128,Ou as minInt136,ju as minInt144,Wu as minInt152,Vu as minInt16,Ku as minInt160,Ju as minInt168,Yu as minInt176,Qu as minInt184,Zu as minInt192,Xu as minInt200,td as minInt208,ed as minInt216,ad as minInt224,nd as minInt232,rd as minInt24,sd as minInt240,od as minInt248,id as minInt256,cd as minInt32,ud as minInt40,dd as minInt48,md as minInt56,ld as minInt64,fd as minInt72,hd as minInt8,pd as minInt80,yd as minInt88,gd as minInt96,ao as multicall3Abi,no as namehash,ro as nonceManager,Ci as numberToBytes,R as numberToHex,vd as offchainLookup,Sd as offchainLookupAbiItem,Ad as offchainLookupSignature,Me as pad,vi as padBytes,xt as padHex,so as parseAbi,oo as parseAbiItem,Qn as parseAbiParameter,io as parseAbiParameters,Ir as parseCompactSignature,ar as parseErc6492Signature,nr as parseErc8010Signature,cr as parseEther,Ed as parseEventLogs,ur as parseGwei,co as parseSignature,_a as parseTransaction,Wt as parseUnits,uo as prepareEncodeFunctionData,mo as presignMessagePrefix,lo as publicActions,Z as recoverAddress,Sa as recoverMessageAddress,fo as recoverPublicKey,Tr as recoverTransactionAddress,Aa as recoverTypedDataAddress,er as ripemd160,ho as rpcSchema,Hi as rpcTransactionType,po as serializeAccessList,Cr as serializeCompactSignature,yo as serializeErc6492Signature,rr as serializeErc8010Signature,go as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Si as setErrorConfig,xr as setupKzg,bd as sha256,Fn as shouldThrow,br as sidecarsToVersionedHashes,vr as signatureToCompactSignature,bo as signatureToHex,$e as size,De as slice,Ai as sliceBytes,Lt as sliceHex,Pi as stringToBytes,Je as stringToHex,Oi as stringify,hn as testActions,ge as toBlobSidecars,wo as toBlobs,k as toBytes,wr as toCoinType,_i as toEventHash,Ri as toEventSelector,qi as toEventSignature,Fi as toFunctionHash,Ui as toFunctionSelector,Bi as toFunctionSignature,Nt as toHex,xo as toPrefixedMessage,ia as toRlp,ji as transactionType,We as trim,Eo as universalSignatureValidatorAbi,Io as universalSignatureValidatorByteCode,ta as validateTypedData,sr as verifyHash,or as verifyMessage,ir as verifyTypedData,qn as walletActions,hr as webSocket,To as weiUnits,Co as withCache,vo as withRetry,Qe as withTimeout,So as zeroAddress,Ao as zeroHash};
@@ -1,4 +1,4 @@
1
- import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-D2w8m12L.js";import{c as p,U as F}from"./index-ezQi9fE0.js";import"./index-DIpKr5PH.js";import"./index-Bm3DarTl.js";import"./index-BjEtYT4r.js";import{O as m,C as d,L as Ee,q as E,b as y,M as P,E as C,t as me,o as b,R as h,d as D,S as A,k as x,l as ze,W as Fe,ak as Xt,aj as he,a3 as J,a1 as qi,z as I,am as tt,A as _i,F as Ki,D as Gi,y as Xi,T as ft,V as Yt,X as Qt,a9 as Yi,ao as Qi,Z as Bt,ap as Ji}from"./W3MFrameProviderSingleton-C03Pb4B-.js";import"./index-CQCEoI0f.js";import{W as Fs,a as Ms}from"./index-DYq_oVmx.js";import"./index-DFiDXKfN.js";import"./index-CyD5tTbO.js";import"./index-C2uZoNuk.js";import{au as S}from"./NetworkUtil-C1aEwuOK.js";import{H as Jt}from"./HelpersUtil-ClO_3Jc1.js";import{n as Zi}from"./index-XVXsmUHu.js";import{E as Q}from"./ExchangeController-aW_MlhrS.js";import"./index-B5y-D5X8.js";import"./index-BnmhOYyH.js";import"./index-DOpvn00g.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-ByXnBudX.js";import{e as Zt,n as ei}from"./ref-BsAZ42-h.js";import"./index-CZHmX5J8.js";import"./index-CzQo6jjU.js";import"./index-jMf-NKbX.js";import"./index-DXk86Ivm.js";import{O as bt}from"./index-Cn4XSZr0.js";import{e as en}from"./index-DNq_ZzO9.js";import"./index-CLcox4E7.js";import"./index-CbMR0Bj_.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-DkF53JBL.js";import"./index-ZWDXIF6O.js";import"./react-BW1xvPTF.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./index-COv1RTFu.js";import"./events-DQ172AOg.js";import"./index-CZat8yuA.js";import"./index-BZ6S4-Qy.js";import"./index-nibyPLVP.js";import"./index-BQmilESQ.js";import"./index.es-B_VDxdYa.js";import"./browser-ponyfill-6L1OGOLN.js";import"./browser-ponyfill-CI1-rMvf.js";import"./ConstantsUtil-DTrOBzCe.js";import"./async-directive-BRxn_Py3.js";import"./browser-CTzRZpIE.js";const nn=v`
1
+ import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-DN-OLR2r.js";import{c as p,U as F}from"./index-C7gHM4wY.js";import"./index-Vlg-GpRL.js";import"./index-D2-V-v9q.js";import"./index-BcgMkg8Z.js";import{O as m,C as d,L as Ee,q as E,b as y,M as P,E as C,t as me,o as b,R as h,d as D,S as A,k as x,l as ze,W as Fe,ak as Xt,aj as he,a3 as J,a1 as qi,z as I,am as tt,A as _i,F as Ki,D as Gi,y as Xi,T as ft,V as Yt,X as Qt,a9 as Yi,ao as Qi,Z as Bt,ap as Ji}from"./W3MFrameProviderSingleton-Ccq1reIt.js";import"./index-DGwFgPlc.js";import{W as Fs,a as Ms}from"./index-C-2OENmH.js";import"./index-B_jKVCv0.js";import"./index-CcARyxeB.js";import"./index-rjU6xZd8.js";import{au as S}from"./NetworkUtil-C1aEwuOK.js";import{H as Jt}from"./HelpersUtil-C_aV_Y-W.js";import{n as Zi}from"./index-trxbKGTp.js";import{E as Q}from"./ExchangeController-icK8vQc1.js";import"./index-CnIGe1GZ.js";import"./index-jPOTr4Wq.js";import"./index-DNLIdOOI.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-C8Ua1g52.js";import{e as Zt,n as ei}from"./ref-BsAZ42-h.js";import"./index-DZxRXkvI.js";import"./index-D96o2dcC.js";import"./index-B96cJA0d.js";import"./index-YHVXMMbH.js";import{O as bt}from"./index-BQuXaLZX.js";import{e as en}from"./index-CmhYJKse.js";import"./index-Dq7pc9gT.js";import"./index-Ch88GJdD.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-Dx4EbFs-.js";import"./index-BFPNYe8x.js";import"./react-BW1xvPTF.js";import"./sentry-BV_ZSgtd.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CtVvB8eG.js";import"./intl-CBcMB1D2.js";import"./index-CiKWw9L3.js";import"./events-DQ172AOg.js";import"./index-D2iLR1Fl.js";import"./index-BZ6S4-Qy.js";import"./index-nibyPLVP.js";import"./index-CI-UnS2-.js";import"./index.es-BKhU-mgO.js";import"./browser-ponyfill-6L1OGOLN.js";import"./browser-ponyfill-CI1-rMvf.js";import"./ConstantsUtil-DTrOBzCe.js";import"./async-directive-BRxn_Py3.js";import"./browser-CTzRZpIE.js";const nn=v`
2
2
  :host {
3
3
  display: block;
4
4
  }
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CoUgtRBd.js","assets/index-ZWDXIF6O.js","assets/react-BW1xvPTF.js","assets/sentry-BV_ZSgtd.js","assets/dcl-schemas-BICTSpB5.js","assets/ethers-CtVvB8eG.js","assets/intl-CBcMB1D2.js","assets/index-DwufS2l2.css","assets/sendRawTransaction-FrBDfTMh.js","assets/NetworkUtil-C1aEwuOK.js","assets/W3MFrameProviderSingleton-C03Pb4B-.js","assets/index-BZ6S4-Qy.js","assets/index-COv1RTFu.js","assets/events-DQ172AOg.js","assets/browser-ponyfill-6L1OGOLN.js","assets/browser-ponyfill-CI1-rMvf.js","assets/custom-B2MFF440.js","assets/index-B6MKNzS8.js","assets/index-COjgItKg.js","assets/store-CraP4F4Y.js","assets/writeContract-CRMw42Kd.js"])))=>i.map(i=>d[i]);
2
- import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as x,Z as qe,t as H,O as D,a7 as $e,e as xe,p as De,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-C03Pb4B-.js";import{al as ze,ao as Ve,ab as Ge,x as B,af as re,Y as _,r as de,au as S,az as ge,a4 as Ke}from"./NetworkUtil-C1aEwuOK.js";import{b7 as Je,bh as Te,aI as q,cv as Xe,bc as Ye,bi as Qe,ah as Ze}from"./sendRawTransaction-FrBDfTMh.js";import"./dcl-schemas-BICTSpB5.js";import"./index-BZ6S4-Qy.js";import"./index-COv1RTFu.js";import"./browser-ponyfill-6L1OGOLN.js";import{_ as we}from"./index-ZWDXIF6O.js";import{E as et}from"./index-B6MKNzS8.js";import{c as tt}from"./store-CraP4F4Y.js";import{c as Pe,a as nt,g as it,b as st,d as ot,e as rt,p as ct}from"./custom-B2MFF440.js";import{s as at,w as dt}from"./writeContract-CRMw42Kd.js";async function ut(o,{account:e=o.account,message:t}){if(!e)throw new Je({docsPath:"/docs/actions/wallet/signMessage"});const n=Te(e);if(n.signMessage)return n.signMessage({message:t});const s=typeof t=="string"?ze(t):t.raw instanceof Uint8Array?Ve(t.raw):t.raw;return o.request({method:"personal_sign",params:[s,n.address]},{retryCount:0})}function U(o,e,t){const n=o[e.name];if(typeof n=="function")return n;const s=o[t];return typeof s=="function"?s:i=>e(o,i)}const ie="3.5.5",lt=()=>`@wagmi/core@${ie}`;var ke=function(o,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!n:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(o):n?n.value:e.get(o)},ce,Re;class O extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return lt()}constructor(e,t={}){var i;super(),ce.add(this),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:"WagmiCoreError"});const n=t.cause instanceof O?t.cause.details:(i=t.cause)!=null&&i.message?t.cause.message:t.details,s=t.cause instanceof O&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
3
- `),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function o(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",o).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(o,e){var n;let t;if(typeof e.connector=="function"?t=o._internal.connectors.setup(e.connector):t=e.connector,t.uid===o.state.current)throw new ht;try{o.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:s,...i}=e,u=await t.connect(i);return t.emitter.off("connect",o._internal.events.connect),t.emitter.on("change",o._internal.events.change),t.emitter.on("disconnect",o._internal.events.disconnect),await((n=o.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),o.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:i.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:i.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(s){throw o.setState(i=>({...i,status:i.current?"connected":"disconnected"})),s}}async function G(o,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(o.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=o.state.connections.get(o.state.current);if(!n)throw new ft;const s=e.chainId??n.chainId,i=await n.connector.getChainId();if(t&&i!==s)throw new mt({connectionChainId:s,connectorChainId:i});const u=n.connector;if(u.getClient)return u.getClient({chainId:s});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=o.chains.find(r=>r.id===s),a=await n.connector.getProvider({chainId:s});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(o,e={}){var s,i;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=o.state,d=u.get(c);t=d==null?void 0:d.connector}const n=o.state.connections;t&&(await t.disconnect(),t.emitter.off("change",o._internal.events.change),t.emitter.off("disconnect",o._internal.events.disconnect),t.emitter.on("connect",o._internal.events.connect),n.delete(t.uid)),o.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=o.state.current;if(!u)return;const c=(s=o.state.connections.get(u))==null?void 0:s.connector;if(!c)return;await((i=o.storage)==null?void 0:i.setItem("recentConnectorId",c.id))}}async function wt(o,e){const{chainId:t,connector:n,...s}=e;let i;e.account?i=e.account:i=(await G(o,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=o.getClient({chainId:t});return U(u,Xe,"estimateGas")({...s,account:i})}async function pt(o,e){const{address:t,blockNumber:n,blockTag:s,chainId:i}=e,u=o.getClient({chainId:i}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:s}),a=o.chains.find(r=>r.id===i)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(o,e){if(o===e)return!0;if(o&&e&&typeof o=="object"&&typeof e=="object"){if(o.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(o)&&Array.isArray(e)){if(t=o.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(o[n],e[n]))return!1;return!0}if(typeof o.valueOf=="function"&&o.valueOf!==Object.prototype.valueOf)return o.valueOf()===e.valueOf();if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString)return o.toString()===e.toString();const s=Object.keys(o);if(t=s.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,s[n]))return!1;for(n=t;n--!==0;){const i=s[n];if(i&&!V(o[i],e[i]))return!1}return!0}return o!==o&&e!==e}function se(o){const e=o.state.current,t=o.state.connections.get(e),n=t==null?void 0:t.accounts,s=n==null?void 0:n[0],i=o.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=o.state.status;switch(u){case"connected":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(o){const e=[...o.state.connections.values()];return o.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s}),U(u,Ye,"prepareTransactionRequest")({...i,...t?{account:t}:{}})}let le=!1;async function he(o,e={}){var a,r;if(le)return[];le=!0,o.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=o._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...o.connectors);let n;try{n=await((r=o.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const s={};for(const[,l]of o.state.connections)s[l.connector.id]=1;n&&(s[n]=0);const i=Object.keys(s).length>0?[...t].sort((l,g)=>(s[l.id]??10)-(s[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of i){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",o._internal.events.connect),l.emitter.on("change",o._internal.events.change),l.emitter.on("disconnect",o._internal.events.disconnect),o.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(o.state.status==="reconnecting"||o.state.status==="connecting")&&(u?o.setState(l=>({...l,status:"connected"})):o.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:i.gas??void 0})}async function bt(o,e){const{account:t,connector:n,...s}=e;let i;return typeof t=="object"&&t.type==="local"?i=o.getClient():i=await G(o,{account:t,connector:n}),U(i,ut,"signMessage")({...s,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(o,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,s=o.state.connections.get(((u=e.connector)==null?void 0:u.uid)??o.state.current);if(s){const c=s.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const i=o.chains.find(c=>c.id===n);if(!i)throw new z;return o.setState(c=>({...c,chainId:n})),i}async function At(o,e){const{chainId:t,timeout:n=0,...s}=e,i=o.getClient({chainId:t}),c=await U(i,st,"waitForTransactionReceipt")({...s,timeout:n});if(c.status==="reverted"){const d=U(i,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(i,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:i.chain.id}}function Nt(o,e){const{onChange:t}=e;return o.subscribe(()=>se(o),t,{equalityFn(n,s){const{connector:i,...u}=n,{connector:c,...d}=s;return V(u,d)&&(i==null?void 0:i.id)===(c==null?void 0:c.id)&&(i==null?void 0:i.uid)===(c==null?void 0:c.uid)}})}function Et(o,e){const{onChange:t}=e;return o.subscribe(()=>M(o),t,{equalityFn:V})}function St(o,e){const{onChange:t}=e;return o._internal.connectors.subscribe((n,s)=>{t(Object.values(n),s)})}function _t(o,e){const{syncConnectedChain:t=o._internal.syncConnectedChain,...n}=e;let s;const i=d=>{s&&s();const a=o.getClient({chainId:d});return s=U(a,rt,"watchPendingTransactions")(n),s},u=i(e.chainId);let c;return t&&!e.chainId&&(c=o.subscribe(({chainId:d})=>d,async d=>i(d))),()=>{u==null||u(),c==null||c()}}async function Tt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c})}function dn(o){return o}ae.type="injected";function ae(o={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=o;function n(){const d=o.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let s,i,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&o.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),s||(s=this.onAccountsChanged.bind(this),a.on("accountsChanged",s)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),o.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;i&&(a.removeListener("chainChanged",i),i=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),o.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!o.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(i&&(r.removeListener("chainChanged",i),i=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(o){return o!=null&&o.coinbaseWalletExtension?o.coinbaseWalletExtension:oe(o,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(o){return oe(o,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(o){var e,t;return(e=o==null?void 0:o.phantom)!=null&&e.ethereum?(t=o.phantom)==null?void 0:t.ethereum:oe(o,"isPhantom")}}};function oe(o,e){function t(s){return typeof e=="function"?e(s):typeof e=="string"?s[e]:!0}const n=o.ethereum;if(n!=null&&n.providers)return n.providers.find(s=>t(s));if(n&&t(n))return n}const kt=o=>(e,t,n)=>{const s=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return s(a)},o(e,t,n)},Rt=kt;function Ot(o,e){let t;try{t=o()}catch{return}return{getItem:s=>{var i;const u=d=>d===null?null:JSON.parse(d,void 0),c=(i=t.getItem(s))!=null?i:null;return c instanceof Promise?c.then(u):u(c)},setItem:(s,i)=>t.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>t.removeItem(s)}}const me=o=>e=>{try{const t=o(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(o,e)=>(t,n,s)=>{let i={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=i.storage;if(!a)return o((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),t(...m)},n,s);const r=()=>{const m=i.partialize({...n()});return a.setItem(i.name,{state:m,version:i.version})},l=s.setState;s.setState=(m,I)=>{l(m,I),r()};const g=o((...m)=>{t(...m),r()},n,s);s.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=i.onRehydrateStorage)==null?void 0:I.call(i,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(i.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return[!0,i.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=i.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:m=>{i={...i,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},i.skipHydration||p(),f||g},jt=Ut,Ne=o=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},s=()=>e,c={setState:n,getState:s,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=o(n,s,c);return c},fe=o=>o?Ne(o):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(o){return new Mt(o)}function Lt(o,e){return JSON.parse(o,(t,n)=>{let s=n;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(e==null?void 0:e(t,s))??s})}function Ee(o,e){return o.slice(0,e).join(".")||"."}function Se(o,e){const{length:t}=o;for(let n=0;n<t;++n)if(o[n]===e)return n+1;return 0}function qt(o,e){const t=typeof o=="function",n=typeof e=="function",s=[],i=[];return function(c,d){if(typeof d=="object")if(s.length){const a=Se(s,this);a===0?s[s.length]=this:(s.splice(a),i.splice(a)),i[i.length]=c;const r=Se(s,d);if(r!==0)return n?e.call(this,c,d,Ee(i,r)):`[ref=${Ee(i,r)}]`}else s[0]=d,i[0]=c;return t?o.call(this,c,d):d}}function $t(o,e,t,n){return JSON.stringify(o,qt((s,i)=>{let u=i;return typeof u=="bigint"&&(u={__type:"bigint",value:i.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(i.entries())}),(e==null?void 0:e(s,u))??u},n),t??void 0)}function xt(o){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:s=Oe}=o;function i(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...s,key:t,async getItem(u,c){const d=s.getItem(`${t}.${u}`),a=await i(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await i(s.removeItem(d)):await i(s.setItem(d,n(c)))},async removeItem(u){await i(s.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function Dt(){const o=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return o.getItem(e)},removeItem(e){o.removeItem(e)},setItem(e,t){try{o.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(o=11){if(!te||ee+o>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++o)}function Ft(o){const{multiInjectedProviderDiscovery:e=!0,storage:t=xt({storage:Dt()}),syncConnectedChain:n=!0,ssr:s=!1,...i}=o,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>i.chains),d=fe(()=>{const h=[],C=new Set;for(const w of i.connectors??[]){const A=a(w);if(h.push(A),!s&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!s&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:i.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(i.client)A=i.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(i);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>i.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:s,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!s,syncConnectedChain:n,transports:i.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(o){let e=[],t,n;function s(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function i(){var c;return t||(t=ye.getInstance({projectId:o.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:o.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=i();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=o.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=s(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:o.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:o.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return s(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(o){const e=o.isNewChainsStale??!0;let t,n,s,i,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:o.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(i||(i=this.onConnect.bind(this),r.on("connect",i)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=D.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),i&&(m.removeListener("connect",i),i=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),s||(s=this.onChainChanged.bind(this),m.on("chainChanged",s)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{s&&(r==null||r.removeListener("chainChanged",s),s=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),i||(i=this.onConnect.bind(this),r==null||r.on("connect",i)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=o.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),i||(i=this.onConnect.bind(this),l.on("connect",i))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=De({pendingTransactions:0}),_e={state:F,subscribeKey(o,e){return xe(F,o,e)},increase(o){F[o]+=1},decrease(o){F[o]-=1},reset(o){F[o]=0}};async function Bt(o){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-CoUgtRBd.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));if(e&&!o.some(t=>t.type==="safe"))return e()}return null}async function zt(o){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-CoUgtRBd.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));if(e&&!o.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(o){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-CoUgtRBd.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));if(e&&!o.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:s,chainId:i}=se(this.wagmiConfig);return Promise.resolve({accounts:i?[...new Set(n||[s])].map(u=>ne.createAccount({caipAddress:`eip155:${i}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(s=>s.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(s=>{var c,d;const i=(c=e.transports)==null?void 0:c[s.id],u=X.getCaipNetworkId(s);i?t[s.id]=X.extendWagmiTransports(s,e.projectId,i):t[s.id]=X.getViemTransport(s,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(i=>i.id===t.chainId),s=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(i=>({address:this.toChecksummedAddress(i)})),caipNetwork:n,connectorId:t.connector.id,auth:s?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const s=e.address!==(t==null?void 0:t.address),i=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(s||i||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=D.state||{};if(n!==!1){const i=await zt(this.wagmiConfig.connectors);i&&e.push(i)}if(t!==!1){const i=await Vt(this.wagmiConfig.connectors);i&&e.push(i)}const s=await Bt(this.wagmiConfig.connectors);s&&e.push(s),await Promise.all(e.map(i=>{const u=this.configureInternalConnector(i);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];D.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:s,enableAuthLogger:i}=D.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:s,enableAuthLogger:i}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const s=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:s,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),i={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:s,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,i);const u=await yt(this.wagmiConfig,i);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,s=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),i=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===s);return{hash:await Tt(this.wagmiConfig,{chain:i,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=D.state||{},s=e.type===S.CONNECTOR_ID.INJECTED,i=e.id===S.CONNECTOR_ID.INJECTED,u=s&&!i;if(i&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:s}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&s}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,i=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(i!=null&&i.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=i==null?void 0:i.connector.type)==null?void 0:a.toUpperCase(),id:i==null?void 0:i.connector.id}}}return{chainId:Number(i==null?void 0:i.chainId),address:this.toChecksummedAddress(i==null?void 0:i.accounts[0]),provider:c,type:(r=i==null?void 0:i.connector.type)==null?void 0:r.toUpperCase(),id:i==null?void 0:i.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const s=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return s.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:s.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,s,i,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(s=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:s.get(p.uid);if(m){await((i=this.wagmiConfig.storage)==null?void 0:i.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(s=>s.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const s=`${n.caipNetworkId}:${e.address}`,i=this.balancePromises[s];if(i)return i;const u=H.getNativeBalanceCacheForCaipAddress(s);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[s]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:s,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[s]}),this.balancePromises[s]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),s=M(this.wagmiConfig).find(i=>Y.isLowerCaseMatch(i.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),D.state.enableReconnect===!1&&this.deleteConnection(e.id),s?{connections:[{accounts:s.accounts.map(i=>({address:this.toChecksummedAddress(i)})),connectorId:s.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const s=this.getWagmiConnector(n.connector.id);return s&&await ve(this.wagmiConfig,{connector:s}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:s,nativeCurrency:i,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=i??t.nativeCurrency,g=s??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await i.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return i.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return i.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return i.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),s=this.getWagmiConnector("walletConnect");if(s&&!n.find(i=>i.connector.id===s.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[s]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const un=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,un as b,dn as c,ae as i};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BGTbU_0B.js","assets/index-BFPNYe8x.js","assets/react-BW1xvPTF.js","assets/sentry-BV_ZSgtd.js","assets/dcl-schemas-BICTSpB5.js","assets/ethers-CtVvB8eG.js","assets/intl-CBcMB1D2.js","assets/index-DwufS2l2.css","assets/sendRawTransaction-DUzMWVdQ.js","assets/NetworkUtil-C1aEwuOK.js","assets/W3MFrameProviderSingleton-Ccq1reIt.js","assets/index-BZ6S4-Qy.js","assets/index-CiKWw9L3.js","assets/events-DQ172AOg.js","assets/browser-ponyfill-6L1OGOLN.js","assets/browser-ponyfill-CI1-rMvf.js","assets/custom-BVE_f5dD.js","assets/index-B6MKNzS8.js","assets/index-COjgItKg.js","assets/store-CraP4F4Y.js","assets/writeContract-Cke2dgme.js"])))=>i.map(i=>d[i]);
2
+ import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as x,Z as qe,t as H,O as D,a7 as $e,e as xe,p as De,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-Ccq1reIt.js";import{al as ze,ao as Ve,ab as Ge,x as B,af as re,Y as _,r as de,au as S,az as ge,a4 as Ke}from"./NetworkUtil-C1aEwuOK.js";import{b7 as Je,bh as Te,aI as q,cv as Xe,bc as Ye,bi as Qe,ah as Ze}from"./sendRawTransaction-DUzMWVdQ.js";import"./dcl-schemas-BICTSpB5.js";import"./index-BZ6S4-Qy.js";import"./index-CiKWw9L3.js";import"./browser-ponyfill-6L1OGOLN.js";import{_ as we}from"./index-BFPNYe8x.js";import{E as et}from"./index-B6MKNzS8.js";import{c as tt}from"./store-CraP4F4Y.js";import{c as Pe,a as nt,g as it,b as st,d as ot,e as rt,p as ct}from"./custom-BVE_f5dD.js";import{s as at,w as dt}from"./writeContract-Cke2dgme.js";async function ut(o,{account:e=o.account,message:t}){if(!e)throw new Je({docsPath:"/docs/actions/wallet/signMessage"});const n=Te(e);if(n.signMessage)return n.signMessage({message:t});const s=typeof t=="string"?ze(t):t.raw instanceof Uint8Array?Ve(t.raw):t.raw;return o.request({method:"personal_sign",params:[s,n.address]},{retryCount:0})}function U(o,e,t){const n=o[e.name];if(typeof n=="function")return n;const s=o[t];return typeof s=="function"?s:i=>e(o,i)}const ie="3.5.5",lt=()=>`@wagmi/core@${ie}`;var ke=function(o,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!n:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(o):n?n.value:e.get(o)},ce,Re;class O extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return lt()}constructor(e,t={}){var i;super(),ce.add(this),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:"WagmiCoreError"});const n=t.cause instanceof O?t.cause.details:(i=t.cause)!=null&&i.message?t.cause.message:t.details,s=t.cause instanceof O&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
3
+ `),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function o(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",o).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(o,e){var n;let t;if(typeof e.connector=="function"?t=o._internal.connectors.setup(e.connector):t=e.connector,t.uid===o.state.current)throw new ht;try{o.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:s,...i}=e,u=await t.connect(i);return t.emitter.off("connect",o._internal.events.connect),t.emitter.on("change",o._internal.events.change),t.emitter.on("disconnect",o._internal.events.disconnect),await((n=o.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),o.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:i.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:i.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(s){throw o.setState(i=>({...i,status:i.current?"connected":"disconnected"})),s}}async function G(o,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(o.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=o.state.connections.get(o.state.current);if(!n)throw new ft;const s=e.chainId??n.chainId,i=await n.connector.getChainId();if(t&&i!==s)throw new mt({connectionChainId:s,connectorChainId:i});const u=n.connector;if(u.getClient)return u.getClient({chainId:s});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=o.chains.find(r=>r.id===s),a=await n.connector.getProvider({chainId:s});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(o,e={}){var s,i;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=o.state,d=u.get(c);t=d==null?void 0:d.connector}const n=o.state.connections;t&&(await t.disconnect(),t.emitter.off("change",o._internal.events.change),t.emitter.off("disconnect",o._internal.events.disconnect),t.emitter.on("connect",o._internal.events.connect),n.delete(t.uid)),o.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=o.state.current;if(!u)return;const c=(s=o.state.connections.get(u))==null?void 0:s.connector;if(!c)return;await((i=o.storage)==null?void 0:i.setItem("recentConnectorId",c.id))}}async function wt(o,e){const{chainId:t,connector:n,...s}=e;let i;e.account?i=e.account:i=(await G(o,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=o.getClient({chainId:t});return U(u,Xe,"estimateGas")({...s,account:i})}async function pt(o,e){const{address:t,blockNumber:n,blockTag:s,chainId:i}=e,u=o.getClient({chainId:i}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:s}),a=o.chains.find(r=>r.id===i)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(o,e){if(o===e)return!0;if(o&&e&&typeof o=="object"&&typeof e=="object"){if(o.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(o)&&Array.isArray(e)){if(t=o.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(o[n],e[n]))return!1;return!0}if(typeof o.valueOf=="function"&&o.valueOf!==Object.prototype.valueOf)return o.valueOf()===e.valueOf();if(typeof o.toString=="function"&&o.toString!==Object.prototype.toString)return o.toString()===e.toString();const s=Object.keys(o);if(t=s.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,s[n]))return!1;for(n=t;n--!==0;){const i=s[n];if(i&&!V(o[i],e[i]))return!1}return!0}return o!==o&&e!==e}function se(o){const e=o.state.current,t=o.state.connections.get(e),n=t==null?void 0:t.accounts,s=n==null?void 0:n[0],i=o.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=o.state.status;switch(u){case"connected":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!s,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:s,addresses:n,chain:i,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(o){const e=[...o.state.connections.values()];return o.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s}),U(u,Ye,"prepareTransactionRequest")({...i,...t?{account:t}:{}})}let le=!1;async function he(o,e={}){var a,r;if(le)return[];le=!0,o.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=o._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...o.connectors);let n;try{n=await((r=o.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const s={};for(const[,l]of o.state.connections)s[l.connector.id]=1;n&&(s[n]=0);const i=Object.keys(s).length>0?[...t].sort((l,g)=>(s[l.id]??10)-(s[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of i){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",o._internal.events.connect),l.emitter.on("change",o._internal.events.change),l.emitter.on("disconnect",o._internal.events.disconnect),o.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(o.state.status==="reconnecting"||o.state.status==="connecting")&&(u?o.setState(l=>({...l,status:"connected"})):o.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:i.gas??void 0})}async function bt(o,e){const{account:t,connector:n,...s}=e;let i;return typeof t=="object"&&t.type==="local"?i=o.getClient():i=await G(o,{account:t,connector:n}),U(i,ut,"signMessage")({...s,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(o,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,s=o.state.connections.get(((u=e.connector)==null?void 0:u.uid)??o.state.current);if(s){const c=s.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const i=o.chains.find(c=>c.id===n);if(!i)throw new z;return o.setState(c=>({...c,chainId:n})),i}async function At(o,e){const{chainId:t,timeout:n=0,...s}=e,i=o.getClient({chainId:t}),c=await U(i,st,"waitForTransactionReceipt")({...s,timeout:n});if(c.status==="reverted"){const d=U(i,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(i,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:i.chain.id}}function Nt(o,e){const{onChange:t}=e;return o.subscribe(()=>se(o),t,{equalityFn(n,s){const{connector:i,...u}=n,{connector:c,...d}=s;return V(u,d)&&(i==null?void 0:i.id)===(c==null?void 0:c.id)&&(i==null?void 0:i.uid)===(c==null?void 0:c.uid)}})}function Et(o,e){const{onChange:t}=e;return o.subscribe(()=>M(o),t,{equalityFn:V})}function St(o,e){const{onChange:t}=e;return o._internal.connectors.subscribe((n,s)=>{t(Object.values(n),s)})}function _t(o,e){const{syncConnectedChain:t=o._internal.syncConnectedChain,...n}=e;let s;const i=d=>{s&&s();const a=o.getClient({chainId:d});return s=U(a,rt,"watchPendingTransactions")(n),s},u=i(e.chainId);let c;return t&&!e.chainId&&(c=o.subscribe(({chainId:d})=>d,async d=>i(d))),()=>{u==null||u(),c==null||c()}}async function Tt(o,e){const{account:t,chainId:n,connector:s,...i}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=o.getClient({chainId:n}):u=await G(o,{account:t??void 0,assertChainId:!1,chainId:n,connector:s});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...i,...t?{account:t}:{},assertChainId:!!n,chain:c})}function dn(o){return o}ae.type="injected";function ae(o={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=o;function n(){const d=o.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let s,i,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&o.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),s||(s=this.onAccountsChanged.bind(this),a.on("accountsChanged",s)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),o.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;i&&(a.removeListener("chainChanged",i),i=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),o.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!o.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),s||(s=this.onAccountsChanged.bind(this),g.on("accountsChanged",s)),i||(i=this.onChainChanged.bind(this),g.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(i&&(r.removeListener("chainChanged",i),i=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(o){return o!=null&&o.coinbaseWalletExtension?o.coinbaseWalletExtension:oe(o,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(o){return oe(o,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(o){var e,t;return(e=o==null?void 0:o.phantom)!=null&&e.ethereum?(t=o.phantom)==null?void 0:t.ethereum:oe(o,"isPhantom")}}};function oe(o,e){function t(s){return typeof e=="function"?e(s):typeof e=="string"?s[e]:!0}const n=o.ethereum;if(n!=null&&n.providers)return n.providers.find(s=>t(s));if(n&&t(n))return n}const kt=o=>(e,t,n)=>{const s=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return s(a)},o(e,t,n)},Rt=kt;function Ot(o,e){let t;try{t=o()}catch{return}return{getItem:s=>{var i;const u=d=>d===null?null:JSON.parse(d,void 0),c=(i=t.getItem(s))!=null?i:null;return c instanceof Promise?c.then(u):u(c)},setItem:(s,i)=>t.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>t.removeItem(s)}}const me=o=>e=>{try{const t=o(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(o,e)=>(t,n,s)=>{let i={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=i.storage;if(!a)return o((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),t(...m)},n,s);const r=()=>{const m=i.partialize({...n()});return a.setItem(i.name,{state:m,version:i.version})},l=s.setState;s.setState=(m,I)=>{l(m,I),r()};const g=o((...m)=>{t(...m),r()},n,s);s.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=i.onRehydrateStorage)==null?void 0:I.call(i,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(i.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==i.version){if(i.migrate)return[!0,i.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=i.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return s.persist={setOptions:m=>{i={...i,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},i.skipHydration||p(),f||g},jt=Ut,Ne=o=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},s=()=>e,c={setState:n,getState:s,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=o(n,s,c);return c},fe=o=>o?Ne(o):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(o){return new Mt(o)}function Lt(o,e){return JSON.parse(o,(t,n)=>{let s=n;return(s==null?void 0:s.__type)==="bigint"&&(s=BigInt(s.value)),(s==null?void 0:s.__type)==="Map"&&(s=new Map(s.value)),(e==null?void 0:e(t,s))??s})}function Ee(o,e){return o.slice(0,e).join(".")||"."}function Se(o,e){const{length:t}=o;for(let n=0;n<t;++n)if(o[n]===e)return n+1;return 0}function qt(o,e){const t=typeof o=="function",n=typeof e=="function",s=[],i=[];return function(c,d){if(typeof d=="object")if(s.length){const a=Se(s,this);a===0?s[s.length]=this:(s.splice(a),i.splice(a)),i[i.length]=c;const r=Se(s,d);if(r!==0)return n?e.call(this,c,d,Ee(i,r)):`[ref=${Ee(i,r)}]`}else s[0]=d,i[0]=c;return t?o.call(this,c,d):d}}function $t(o,e,t,n){return JSON.stringify(o,qt((s,i)=>{let u=i;return typeof u=="bigint"&&(u={__type:"bigint",value:i.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(i.entries())}),(e==null?void 0:e(s,u))??u},n),t??void 0)}function xt(o){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:s=Oe}=o;function i(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...s,key:t,async getItem(u,c){const d=s.getItem(`${t}.${u}`),a=await i(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await i(s.removeItem(d)):await i(s.setItem(d,n(c)))},async removeItem(u){await i(s.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function Dt(){const o=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return o.getItem(e)},removeItem(e){o.removeItem(e)},setItem(e,t){try{o.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(o=11){if(!te||ee+o>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++o)}function Ft(o){const{multiInjectedProviderDiscovery:e=!0,storage:t=xt({storage:Dt()}),syncConnectedChain:n=!0,ssr:s=!1,...i}=o,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>i.chains),d=fe(()=>{const h=[],C=new Set;for(const w of i.connectors??[]){const A=a(w);if(h.push(A),!s&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!s&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:i.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(i.client)A=i.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(i);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>i.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:s,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!s,syncConnectedChain:n,transports:i.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(o){let e=[],t,n;function s(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function i(){var c;return t||(t=ye.getInstance({projectId:o.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:o.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=i();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=o.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=s(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:o.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:o.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?x.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?x.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&x.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return s(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(o){const e=o.isNewChainsStale??!0;let t,n,s,i,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:o.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(i||(i=this.onConnect.bind(this),r.on("connect",i)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=D.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),i&&(m.removeListener("connect",i),i=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),s||(s=this.onChainChanged.bind(this),m.on("chainChanged",s)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{s&&(r==null||r.removeListener("chainChanged",s),s=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),i||(i=this.onConnect.bind(this),r==null||r.on("connect",i)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=o.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),s&&(l.removeListener("chainChanged",s),s=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),i||(i=this.onConnect.bind(this),l.on("connect",i))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=De({pendingTransactions:0}),_e={state:F,subscribeKey(o,e){return xe(F,o,e)},increase(o){F[o]+=1},decrease(o){F[o]-=1},reset(o){F[o]=0}};async function Bt(o){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-BGTbU_0B.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));if(e&&!o.some(t=>t.type==="safe"))return e()}return null}async function zt(o){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-BGTbU_0B.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));if(e&&!o.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(o){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-BGTbU_0B.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]));if(e&&!o.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:s,chainId:i}=se(this.wagmiConfig);return Promise.resolve({accounts:i?[...new Set(n||[s])].map(u=>ne.createAccount({caipAddress:`eip155:${i}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(s=>s.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(s=>{var c,d;const i=(c=e.transports)==null?void 0:c[s.id],u=X.getCaipNetworkId(s);i?t[s.id]=X.extendWagmiTransports(s,e.projectId,i):t[s.id]=X.getViemTransport(s,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(i=>i.id===t.chainId),s=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(i=>({address:this.toChecksummedAddress(i)})),caipNetwork:n,connectorId:t.connector.id,auth:s?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const s=e.address!==(t==null?void 0:t.address),i=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(s||i||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=D.state||{};if(n!==!1){const i=await zt(this.wagmiConfig.connectors);i&&e.push(i)}if(t!==!1){const i=await Vt(this.wagmiConfig.connectors);i&&e.push(i)}const s=await Bt(this.wagmiConfig.connectors);s&&e.push(s),await Promise.all(e.map(i=>{const u=this.configureInternalConnector(i);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];D.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:s,enableAuthLogger:i}=D.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:s,enableAuthLogger:i}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const s=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:s,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),i={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:s,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,i);const u=await yt(this.wagmiConfig,i);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,s=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),i=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===s);return{hash:await Tt(this.wagmiConfig,{chain:i,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=D.state||{},s=e.type===S.CONNECTOR_ID.INJECTED,i=e.id===S.CONNECTOR_ID.INJECTED,u=s&&!i;if(i&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:s}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&s}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,i=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(i!=null&&i.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=i==null?void 0:i.connector.type)==null?void 0:a.toUpperCase(),id:i==null?void 0:i.connector.id}}}return{chainId:Number(i==null?void 0:i.chainId),address:this.toChecksummedAddress(i==null?void 0:i.accounts[0]),provider:c,type:(r=i==null?void 0:i.connector.type)==null?void 0:r.toUpperCase(),id:i==null?void 0:i.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const s=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return s.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:s.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,s,i,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(s=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:s.get(p.uid);if(m){await((i=this.wagmiConfig.storage)==null?void 0:i.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(s=>s.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const s=`${n.caipNetworkId}:${e.address}`,i=this.balancePromises[s];if(i)return i;const u=H.getNativeBalanceCacheForCaipAddress(s);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[s]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:s,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[s]}),this.balancePromises[s]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),s=M(this.wagmiConfig).find(i=>Y.isLowerCaseMatch(i.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),D.state.enableReconnect===!1&&this.deleteConnection(e.id),s?{connections:[{accounts:s.accounts.map(i=>({address:this.toChecksummedAddress(i)})),connectorId:s.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const s=this.getWagmiConnector(n.connector.id);return s&&await ve(this.wagmiConfig,{connector:s}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:s,nativeCurrency:i,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=i??t.nativeCurrency,g=s??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await i.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return i.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return i.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],s=n?this.getWagmiConnector(n.connector.id):null;if(!s)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const i=await s.getProvider();if(!i)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return i.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),s=this.getWagmiConnector("walletConnect");if(s&&!n.find(i=>i.connector.id===s.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[s]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const un=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,un as b,dn as c,ae as i};
@@ -1,4 +1,4 @@
1
- import{a as h,i as d,b as a}from"./lit-element-B3y9oplH.js";import{d as w,r as x,e as b}from"./index-D2w8m12L.js";import{c as m}from"./index-ezQi9fE0.js";import"./index-CLcox4E7.js";import{O as c,E as g,l as v,C,W as _,R as $}from"./W3MFrameProviderSingleton-C03Pb4B-.js";import{r as R}from"./class-map-CxwNmq0D.js";const T=h``;var O=function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(t=(i<3?s(t):i>3?s(e,r,t):s(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let f=class extends d{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return!e&&!r?null:a`
1
+ import{a as h,i as d,b as a}from"./lit-element-B3y9oplH.js";import{d as w,r as x,e as b}from"./index-DN-OLR2r.js";import{c as m}from"./index-C7gHM4wY.js";import"./index-Dq7pc9gT.js";import{O as c,E as g,l as v,C,W as _,R as $}from"./W3MFrameProviderSingleton-Ccq1reIt.js";import{r as R}from"./class-map-CxwNmq0D.js";const T=h``;var O=function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(t=(i<3?s(t):i>3?s(e,r,t):s(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let f=class extends d{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return!e&&!r?null:a`
2
2
  <wui-flex
3
3
  .padding=${["4","3","3","3"]}
4
4
  flexDirection="column"