@dcl/shop 0.1.0-29111888971.commit-e1b927a → 0.1.0-29111917255.commit-e6715c3

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 (181) hide show
  1. package/assets/{AnimatedBackground-XZF9g9Bk.js → AnimatedBackground-BYKnsBtz.js} +3 -3
  2. package/assets/{Assets-CZPTo1jO.js → Assets-ClVmauZ2.js} +1 -1
  3. package/assets/{Button-B2TDtyup.js → Button-CgZSqnGW.js} +1 -1
  4. package/assets/{Cart-DhU4_S6H.js → Cart-Up06p7ew.js} +1 -1
  5. package/assets/{CircularProgress-Cf__730y.js → CircularProgress-BbGH0RSH.js} +1 -1
  6. package/assets/{Collection-CRBxkkqX.js → Collection-DvK8DQsK.js} +1 -1
  7. package/assets/{ConstantsUtil-DrWe0yob.js → ConstantsUtil-CiDezLbv.js} +1 -1
  8. package/assets/{Creator-DO__19RD.js → Creator-ClUMhdS6.js} +1 -1
  9. package/assets/{ExchangeController-txwSQL2Z.js → ExchangeController-DdSsjFTm.js} +1 -1
  10. package/assets/{GetCredits-DS1z5pyp.js → GetCredits-7W0xZLwI.js} +2 -2
  11. package/assets/{HelpersUtil-CMysbO5y.js → HelpersUtil-CbFvbY-T.js} +1 -1
  12. package/assets/{ImportListings-ChNZ2UwM.js → ImportListings-tpyUcfqZ.js} +1 -1
  13. package/assets/ItemDetail-CZQ3QPE1.js +2 -0
  14. package/assets/{Market-Z4jp-uLb.js → Market-CRtp3AGM.js} +1 -1
  15. package/assets/{MenuItem-B4U0TYKf.js → MenuItem-BLQsL8Vh.js} +1 -1
  16. package/assets/{MyAssets-C7QdtDYF.js → MyAssets-Cp2z98Lz.js} +1 -1
  17. package/assets/{MyFavorites-Bu2IDcdJ.js → MyFavorites-_R79W8pO.js} +1 -1
  18. package/assets/{MyPurchases-CDUC3XzQ.js → MyPurchases-DJYHRbWz.js} +1 -1
  19. package/assets/{NetworkUtil-Ddexw9-U.js → NetworkUtil-DDES604E.js} +1 -1
  20. package/assets/{NotFound-D5sXjRPf.js → NotFound-6FTGg4R1.js} +1 -1
  21. package/assets/{RealCheckout-DBL3uxEj.js → RealCheckout-BemiXyZF.js} +1 -1
  22. package/assets/{ShopFooterInner-BHh4OUAv.js → ShopFooterInner-KJ2oezRg.js} +2 -2
  23. package/assets/{Success-BrvAPmP4.js → Success-CXjLiyYm.js} +1 -1
  24. package/assets/{SvgIcon-Cg5l4LDh.js → SvgIcon-DtxoFXOd.js} +1 -1
  25. package/assets/{SwapController-BDZMxnNb.js → SwapController-C07T-0ls.js} +1 -1
  26. package/assets/{TradeService-CkLYTYcJ.js → TradeService-D4PrM9vt.js} +1 -1
  27. package/assets/{W3MFrameProviderSingleton-D4DCXtQm.js → W3MFrameProviderSingleton-DXEpVsCm.js} +3 -3
  28. package/assets/{WebCryptoP256-OE37a6hF.js → WebCryptoP256-B1xyhPdr.js} +1 -1
  29. package/assets/{basic-SUHSB6nZ.js → basic-Dq4Wpic2.js} +1 -1
  30. package/assets/{biconomy-C6flCXA4.js → biconomy-BQtB5Ab0.js} +1 -1
  31. package/assets/{buy-YkuLG1h7.js → buy-6ORWjZW_.js} +1 -1
  32. package/assets/{buy-gasless-gRmZHjsE.js → buy-gasless-DL6o_Lwi.js} +1 -1
  33. package/assets/{ccip-7fqLW_t2.js → ccip-DgHj7djR.js} +1 -1
  34. package/assets/{ccip-ByQiZ_aq.js → ccip-Zo_y8Ko9.js} +1 -1
  35. package/assets/{chains-CMJ6lVMG.js → chains-Bk629xE3.js} +1 -1
  36. package/assets/{collection-2CKCNH2O.js → collection-B8w_ujSk.js} +1 -1
  37. package/assets/{common-GsSQn_vD.js → common-CEkVtB9E.js} +1 -1
  38. package/assets/{controller-BO0zre2A.js → controller-CNZZBumM.js} +2 -2
  39. package/assets/{core-D-mQUZ3X.js → core-C_RCjMc6.js} +4 -4
  40. package/assets/{custom-C6VO1Je_.js → custom-BM-_NC1p.js} +1 -1
  41. package/assets/{data-capture-DdxbO7dd.js → data-capture-Clu_u_4e.js} +1 -1
  42. package/assets/decimals-C7k-JLnD.js +1 -0
  43. package/assets/{decimals-Di7mGY-D.js → decimals-DYUDFeSV.js} +1 -1
  44. package/assets/{detectExtension-DsE82Ej6.js → detectExtension-b3FK4NnW.js} +1 -1
  45. package/assets/{email-BTEyDEk6.js → email-C0z3A7sK.js} +1 -1
  46. package/assets/{embedded-wallet-QGoIGdCB.js → embedded-wallet-COvvX2Qp.js} +1 -1
  47. package/assets/{engine-Bjifrd8K.js → engine-Cs_nlYqC.js} +1 -1
  48. package/assets/{estimate-l1-fee-Bqou6JLl.js → estimate-l1-fee-oTYMvZsv.js} +1 -1
  49. package/assets/eth_estimateGas-D2h2NKDU.js +1 -0
  50. package/assets/{eth_getStorageAt-B-cqm2CG.js → eth_getStorageAt-nxicedso.js} +1 -1
  51. package/assets/eth_getTransactionCount-CYYgSGiU.js +1 -0
  52. package/assets/{ethereum-CjiWK1L5.js → ethereum-CdeRZR9J.js} +1 -1
  53. package/assets/{ethers-DHDSyreX.js → ethers-JeCAM1sd.js} +1 -1
  54. package/assets/{extractIPFS-C5EI4cZz.js → extractIPFS-DzIizex4.js} +1 -1
  55. package/assets/{features-U-ULFF0v.js → features-Ck7HAsYI.js} +1 -1
  56. package/assets/{fetchTokenMetadata-DHc2WWGs.js → fetchTokenMetadata-CvdEl9__.js} +2 -2
  57. package/assets/{generateUtilityClasses-BAjjhm6X.js → generateUtilityClasses-C3jgMIyn.js} +1 -1
  58. package/assets/get-ecosystem-wallet-info-B4ca6uUn.js +1 -0
  59. package/assets/{getBalance-C8i1-K0c.js → getBalance-BS9M_tBF.js} +2 -2
  60. package/assets/{getInstalledModules-BXhbS0To.js → getInstalledModules-TJvbccgJ.js} +1 -1
  61. package/assets/{getNFT-CzHwZ4FU.js → getNFT-BlQFGY94.js} +2 -2
  62. package/assets/{getNFT-D3XSi6wm.js → getNFT-Xlc7XB2G.js} +1 -1
  63. package/assets/{hashTypedData-DX5YrpbP.js → hashTypedData-B7sBgfoL.js} +1 -1
  64. package/assets/{hashTypedData-BOc0w62Q.js → hashTypedData-CEYoWftx.js} +1 -1
  65. package/assets/{import-BulayqYM.js → import-J8FWHnju.js} +1 -1
  66. package/assets/{in-app-wallet-calls-BI0pU06-.js → in-app-wallet-calls-GDlqBGpw.js} +1 -1
  67. package/assets/{index-GAmNssSM.js → index-2dkhZZEZ.js} +1 -1
  68. package/assets/{index-BZ5hUBd_.js → index-6YdbHDXd.js} +1 -1
  69. package/assets/{index-CzfG6alx.js → index-B0PvzweT.js} +1 -1
  70. package/assets/{index-DQx-sY_c.js → index-B11b--Yh.js} +1 -1
  71. package/assets/{index-BKSTjS_b.js → index-B5Oqojt4.js} +1 -1
  72. package/assets/{index-D4VlTBkw.js → index-B5nwKjyJ.js} +1 -1
  73. package/assets/{index-n-cFV5ht.js → index-B6-wCRdo.js} +1 -1
  74. package/assets/{index-DIMSfymy.js → index-BA1ToKo5.js} +3 -3
  75. package/assets/{index-D3hzhbb8.js → index-BBTg_Taa.js} +1 -1
  76. package/assets/{index-CkHNiFzW.js → index-BLF3lLRE.js} +1 -1
  77. package/assets/{index--_rHc9Od.js → index-BNjQhTuO.js} +1 -1
  78. package/assets/{index-Qzch3HJ1.js → index-BNsmSCur.js} +1 -1
  79. package/assets/{index-BOQwd6ZB.js → index-BRAKTMPG.js} +1 -1
  80. package/assets/{index-BOwZsNrV.js → index-B_xrDWUL.js} +1 -1
  81. package/assets/{index-DhBdPYnK.js → index-BcvgfIV4.js} +1 -1
  82. package/assets/{index-CdfeQ7YK.js → index-BcyJUD4U.js} +1 -1
  83. package/assets/{index-ULMMROQ0.js → index-BeymNI6W.js} +1 -1
  84. package/assets/{index-DjPU0-Js.js → index-BgtBi25O.js} +1 -1
  85. package/assets/{index-CIPKmOlZ.js → index-Bj-x5N2U.js} +1 -1
  86. package/assets/{index-Pp2oEhTr.js → index-Blc7OGRU.js} +1 -1
  87. package/assets/{index-LSZxonl2.js → index-BnrCQ-kr.js} +1 -1
  88. package/assets/{index-jYazATJj.js → index-Bu2DcNS5.js} +1 -1
  89. package/assets/{index-C6FQ8I_Q.js → index-C9P6N44e.js} +2 -2
  90. package/assets/{index-C7-iTfFV.js → index-CI_HQD35.js} +25 -25
  91. package/assets/{index-C2U9pe20.js → index-CMib98th.js} +1 -1
  92. package/assets/{index-DacKA042.js → index-CPc95Sx-.js} +1 -1
  93. package/assets/{index-DShBCYos.js → index-CS7PjWbj.js} +3 -3
  94. package/assets/{index-BuKyqX4w.js → index-CSh-BHOv.js} +1 -1
  95. package/assets/{index-DV4p99KA.js → index-CZ8lEqAg.js} +2 -2
  96. package/assets/{index-CxyR8sie.js → index-ChHYiWiR.js} +1 -1
  97. package/assets/{index-CDMAFM2h.js → index-CkCZBr-g.js} +1 -1
  98. package/assets/{index-CMavzzI_.js → index-Cl4u62mB.js} +1 -1
  99. package/assets/{index-CbJmVQBN.js → index-CoACJ04N.js} +1 -1
  100. package/assets/{index-C2OMQVG4.js → index-CptRe6qL.js} +2 -2
  101. package/assets/{index-YfJF6hV4.js → index-CxQiq4b6.js} +1 -1
  102. package/assets/{index-CcQfGUgB.js → index-Cye62OPB.js} +1 -1
  103. package/assets/{index-BLQJ40Mi.js → index-D-lax9BR.js} +1 -1
  104. package/assets/{index-BlEd83Li.js → index-DA60UT_n.js} +1 -1
  105. package/assets/{index-CzFnbzvY.js → index-DFJdN6PH.js} +1 -1
  106. package/assets/{index-D5qOQwpy.js → index-DGSeBOvG.js} +1 -1
  107. package/assets/{index-DtrBN21c.js → index-DSUWwVug.js} +1 -1
  108. package/assets/{index-Eb-Zd0F2.js → index-DUnXGO0a.js} +1 -1
  109. package/assets/{index-CiIXwK1P.js → index-DWEAO5Zp.js} +1 -1
  110. package/assets/{index-BF6unOoT.js → index-DWk4e-hQ.js} +1 -1
  111. package/assets/{index-DJyoXp5I.js → index-DZ8SABwK.js} +1 -1
  112. package/assets/{index-2NUAW7ds.js → index-D_vsPbWD.js} +1 -1
  113. package/assets/{index-DlllSUoB.js → index-DjbM69kL.js} +1 -1
  114. package/assets/{index-CkVoCPEe.js → index-DnPCa8RK.js} +1 -1
  115. package/assets/{index-BNH6Xzon.js → index-DoS7CfZ4.js} +2 -2
  116. package/assets/{index-DOTYPGXa.js → index-Dv6YT5k2.js} +1 -1
  117. package/assets/{index-DIw62AgP.js → index-S-U9uSud.js} +1 -1
  118. package/assets/{index-IfYZnKCO.js → index-_AHcKVpB.js} +1 -1
  119. package/assets/{index-Bo6hVxzu.js → index-dE2OwwEn.js} +1 -1
  120. package/assets/{index-BaSqmd6J.js → index-pJLySSiV.js} +1 -1
  121. package/assets/{index-CENZ1Xjd.js → index-t3MAsdpb.js} +1 -1
  122. package/assets/{index-kxu93Of2.js → index-ulcskxUh.js} +1 -1
  123. package/assets/{index-DS8DYtub.js → index-yq7Vx7EH.js} +1 -1
  124. package/assets/{index.es-DnMpNe4m.js → index.es-BQrA1NgE.js} +4 -4
  125. package/assets/{index.es-IGCEipYb.js → index.es-CbOKB2xh.js} +1 -1
  126. package/assets/{index.es-Dk6KC5kj.js → index.es-Cz73nZm3.js} +1 -1
  127. package/assets/{localBatchGatewayRequest-BLJAP4fw.js → localBatchGatewayRequest-DVz1EzYT.js} +1 -1
  128. package/assets/{mana-rate-DkxpKYLQ.js → mana-rate-PT3JDtK4.js} +1 -1
  129. package/assets/{native-7uSYstXA.js → native-C_y7cRlS.js} +1 -1
  130. package/assets/network-Bdkbzo_l.js +1 -0
  131. package/assets/{networks-Bc_Uf_7y.js → networks-DVx7-Y5v.js} +1 -1
  132. package/assets/{onramp-DnhEoZl6.js → onramp-DWqw8mwD.js} +1 -1
  133. package/assets/{openzeppelin-DwFpqgXP.js → openzeppelin-B2NGugOR.js} +1 -1
  134. package/assets/{ownerOf-Qq7Or7yc.js → ownerOf-BoMFaGBI.js} +1 -1
  135. package/assets/{parseNft-B-POJxiL.js → parseNft-DdgcBV60.js} +2 -2
  136. package/assets/{parseSignature-ClLI6O4f.js → parseSignature-BMBhmj1o.js} +3 -3
  137. package/assets/{parseSignature-kOoafZEo.js → parseSignature-Cu4M83H5.js} +1 -1
  138. package/assets/{pay-with-exchange-BZR4RMBZ.js → pay-with-exchange-B3xXFySH.js} +1 -1
  139. package/assets/{qr-overlay-9WMDd_PO.js → qr-overlay-DXC6ldlf.js} +1 -1
  140. package/assets/{receive-CtJWuhGM.js → receive-C-M9SmxL.js} +1 -1
  141. package/assets/{resolveImplementation-BJatMhHh.js → resolveImplementation-D1Bqtnhr.js} +1 -1
  142. package/assets/{rpc-BA0W82l4.js → rpc-DE1f6rs1.js} +1 -1
  143. package/assets/{secp256k1-B82Rx-TY.js → secp256k1-B39Q-Q6x.js} +1 -1
  144. package/assets/{secp256k1-DFslM7tB.js → secp256k1-CrKymG_Q.js} +1 -1
  145. package/assets/{secp256k1-DHqlJ8nk.js → secp256k1-D1Tuv2c6.js} +1 -1
  146. package/assets/{send-DXVwWcB5.js → send-C1EU45CZ.js} +1 -1
  147. package/assets/{send-batch-transaction-D1j9aZww.js → send-batch-transaction-BTFORkZH.js} +1 -1
  148. package/assets/{send-eip712-transaction-CrryJAyV.js → send-eip712-transaction-CJ_pjExq.js} +2 -2
  149. package/assets/{send-gasless-transaction-B7YcLCGg.js → send-gasless-transaction-CHYN-ATV.js} +2 -2
  150. package/assets/{sendRawTransaction-DT-ObNx8.js → sendRawTransaction-YUhe5FDd.js} +3 -3
  151. package/assets/{serializeTransaction-DawhfTu0.js → serializeTransaction-xu35AVgP.js} +1 -1
  152. package/assets/{session-proposal-lgMupzDT.js → session-proposal-BZLBnV_x.js} +1 -1
  153. package/assets/{session-request-DacijEHD.js → session-request-mA9oQfs4.js} +2 -2
  154. package/assets/{sha256-BxR-wXll.js → sha256-De0VIEFf.js} +1 -1
  155. package/assets/{signing-CoPa7cSW.js → signing-DqVkCMNZ.js} +5 -5
  156. package/assets/{socials-CMh8u0Ej.js → socials-BImUXGbF.js} +1 -1
  157. package/assets/{swaps-B0Q00kKq.js → swaps-B8Tuo6Pt.js} +1 -1
  158. package/assets/{thirdweb-9c12J_EF.js → thirdweb-BPuxSwTj.js} +3 -3
  159. package/assets/{totalSupply-BCZn9Djj.js → totalSupply-Bbiy7170.js} +1 -1
  160. package/assets/{transactionReceipt-C2iQ3ozz.js → transactionReceipt-BcAWHNof.js} +1 -1
  161. package/assets/{transactions-Dqx74UWQ.js → transactions-N8K1pD5P.js} +1 -1
  162. package/assets/{useInfiniteGrid-DgSsqvQS.js → useInfiniteGrid-CVs5pP6I.js} +1 -1
  163. package/assets/{utils-nbkSUjEy.js → utils-BmX8TqzP.js} +1 -1
  164. package/assets/{verifyHash-BVbpPoSf.js → verifyHash-CnnSGyZz.js} +1 -1
  165. package/assets/{w3m-modal-DvCL5Oh_.js → w3m-modal-DJII43ig.js} +1 -1
  166. package/assets/{w3m-modal-CGHylzdj.js → w3m-modal-DWJdJGvu.js} +1 -1
  167. package/assets/{wait-for-tx-receipt-Dm2aAIs1.js → wait-for-tx-receipt-D0UsY_wi.js} +1 -1
  168. package/assets/{wallet-kind-vciDs8sO.js → wallet-kind-C-lIAMBM.js} +1 -1
  169. package/assets/{wallets-D8labJv_.js → wallets-KGduOTOw.js} +6 -6
  170. package/assets/{web-connector-C9MeCxtf.js → web-connector-Ca9PblTL.js} +3 -3
  171. package/assets/{writeContract-C3IzBPhR.js → writeContract-dj4TlIky.js} +1 -1
  172. package/assets/{zora-sepolia-BQEmh41Y.js → zora-sepolia-kNKNf7Kl.js} +1 -1
  173. package/assets/{zoraTestnet-CduWQC79.js → zoraTestnet-BhynxBH0.js} +1 -1
  174. package/index.html +8 -8
  175. package/package.json +2 -2
  176. package/assets/ItemDetail-Do5cjFW8.js +0 -2
  177. package/assets/decimals-ByIlBo-2.js +0 -1
  178. package/assets/eth_estimateGas-CarYiSgL.js +0 -1
  179. package/assets/eth_getTransactionCount-Dfx3JW2Q.js +0 -1
  180. package/assets/get-ecosystem-wallet-info-CWcGnKL4.js +0 -1
  181. package/assets/network-DsCGVBhE.js +0 -1
@@ -1,4 +1,4 @@
1
- import{i as m,b as n}from"./lit-element-B3y9oplH.js";import{n as r}from"./class-map-CxwNmq0D.js";import{c as u}from"./index-BOQwd6ZB.js";import"./index--_rHc9Od.js";import"./index-CMavzzI_.js";import{d as g,r as p,e as x}from"./index-DIMSfymy.js";const b=g`
1
+ import{i as m,b as n}from"./lit-element-B3y9oplH.js";import{n as r}from"./class-map-CxwNmq0D.js";import{c as u}from"./index-BRAKTMPG.js";import"./index-BNjQhTuO.js";import"./index-Cl4u62mB.js";import{d as g,r as p,e as x}from"./index-BA1ToKo5.js";const b=g`
2
2
  button {
3
3
  display: block;
4
4
  display: flex;
@@ -1 +1 @@
1
- import{c as r}from"./parseSignature-kOoafZEo.js";import{B as T,E as g,a as b,b as h,F as y,W as f,d as v,e as A,f as S,g as I,p as F,l as R,n as x,p as C,h as B,s as N,z as P}from"./parseSignature-kOoafZEo.js";import{I as U,c as w,a as L,p as M,w as H}from"./custom-C6VO1Je_.js";import{h as s}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{U as z,c as q,f as V,s as O,w as G,a as j}from"./W3MFrameProviderSingleton-D4DCXtQm.js";import{A as K,a as Z,B as J,b as Q,C as X,D as Y,E as _,F as $,c as aa,H as ra,I as oa,d as sa,e as ea,f as ta,g as na,h as ia,i as ca,j as da,k as Ea,l as ua,J as pa,L as la,M as ma,m as Ta,N as ga,n as ba,o as ha,P as ya,p as fa,q as va,R as Aa,r as Sa,s as Ia,t as Fa,u as Ra,S as xa,v as Ca,w as Ba,x as Na,T as Pa,y as Da,z as Ua,G as wa,U as La,K as Ma,O as Ha,Q as ka,V as za,W as qa,X as Va,Y as Oa,Z as Ga,_ as ja,$ as Wa,a0 as Ka,a1 as Za,a2 as Ja,a3 as Qa,a4 as Xa,a5 as Ya,a6 as _a,a7 as $a,a8 as ar,a9 as rr,aa as or,ab as sr,ac as er,ad as tr,ae as nr,af as ir,ag as cr,ah as dr,ai as Er,aj as ur,ak as pr,al as lr,am as mr,an as Tr,ao as gr,ap as br,a1 as hr}from"./NetworkUtil-Ddexw9-U.js";import{A as fr,a as vr,b as Ar,c as Sr,d as Ir,e as Fr,f as Rr,g as xr,h as Cr,i as Br,j as Nr,k as Pr,l as Dr,m as Ur,n as wr,o as Lr,p as Mr,B as Hr,q as kr,r as zr,C as qr,s as Vr,t as Or,u as Gr,v as jr,w as Wr,x as Kr,y as Zr,z as Jr,D as Qr,E as Xr,F as Yr,G as _r,H as $r,I as ao,J as ro,K as oo,L as so,M as eo,N as to,O as no,P as io,Q as co,R as Eo,S as uo,T as po,U as lo,V as mo,W as To,X as go,Y as bo,Z as ho,_ as yo,$ as fo,a0 as vo,a1 as Ao,a2 as So,a3 as Io,a4 as Fo,a5 as Ro,a6 as xo,a7 as Co,a8 as Bo,a9 as No,aa as Po,ab as Do,ac as Uo,ad as wo,ae as Lo,af as Mo,ag as Ho,ah as ko,ai as zo,aj as qo,ak as Vo,al as Oo,am as Go,an as jo,ao as Wo,ap as Ko,aq as Zo,ar as Jo,as as Qo,at as Xo,au as Yo,av as _o,aw as $o,ax as as,ay as rs,az as os,aA as ss,aB as es,aC as ts,aD as ns,aE as is,aF as cs,aG as ds,aH as Es,aI as us,aJ as ps,aK as ls,aL as ms,aM as Ts,aN as gs,aM as bs,aO as hs,aP as ys,aQ as fs,aR as vs,aS as As,aT as Ss,aU as Is,aV as Fs,aW as Rs,aX as xs,aY as Cs,aZ as Bs,a_ as Ns,a$ as Ps,b0 as Ds,b1 as Us,b2 as ws,b3 as Ls,b4 as Ms,aL as Hs,aM as ks,b4 as zs,aN as qs,aM as Vs,b5 as Os,b6 as Gs,aA as js}from"./sendRawTransaction-DT-ObNx8.js";import{I as Ks,a as Zs,b as Js,g as Qs,h as Xs,c as Ys,d as _s,e as $s,p as ae,t as re,v as oe}from"./hashTypedData-BOc0w62Q.js";import{d as ee,e as te,a as ne}from"./localBatchGatewayRequest-BLJAP4fw.js";import{ccipRequest as ce,ccipRequest as de,offchainLookup as Ee,offchainLookupAbiItem as ue,offchainLookupSignature as pe}from"./ccip-ByQiZ_aq.js";import{d as t}from"./verifyHash-BVbpPoSf.js";import{e as me,p as Te,a as ge,s as be,s as he}from"./verifyHash-BVbpPoSf.js";import{a as fe,b as ve,c as Ae,s as Se,d as Ie}from"./serializeTransaction-DawhfTu0.js";import"./secp256k1-DFslM7tB.js";import"./index-C7-iTfFV.js";import"./react-Vu6nbGi5.js";import"./ethers-DHDSyreX.js";import"./index-CdfeQ7YK.js";import"./index-C6FQ8I_Q.js";import"./browser-ponyfill-rND5WOqr.js";export{fr as AbiConstructorNotFoundError,vr as AbiConstructorParamsNotFoundError,Ar as AbiDecodingDataSizeTooSmallError,Sr as AbiDecodingZeroDataError,Ir as AbiEncodingArrayLengthMismatchError,Fr as AbiEncodingBytesSizeMismatchError,Rr as AbiEncodingLengthMismatchError,xr as AbiErrorInputsNotFoundError,Cr as AbiErrorNotFoundError,Br as AbiErrorSignatureNotFoundError,Nr as AbiEventNotFoundError,Pr as AbiEventSignatureEmptyTopicsError,Dr as AbiEventSignatureNotFoundError,Ur as AbiFunctionNotFoundError,wr as AbiFunctionOutputsNotFoundError,Lr as AbiFunctionSignatureNotFoundError,Mr as AccountStateConflictError,K as AtomicReadyWalletRejectedUpgradeError,Z as AtomicityNotSupportedError,J as BaseError,Hr as BaseFeeScalarError,kr as BlockNotFoundError,T as BundleFailedError,Q as BundleTooLargeError,zr as BytesSizeMismatchError,qr as CallExecutionError,X as ChainDisconnectedError,Vr as ChainDoesNotSupportContract,Or as ChainMismatchError,Gr as ChainNotFoundError,jr as CircularReferenceError,Wr as ClientChainNotConfiguredError,Kr as ContractFunctionExecutionError,Zr as ContractFunctionRevertedError,Jr as ContractFunctionZeroDataError,Qr as CounterfactualDeploymentFailedError,Xr as DecodeLogDataMismatch,Yr as DecodeLogTopicsMismatch,Y as DuplicateIdError,_r as Eip1559FeesNotSupportedError,g as EnsAvatarInvalidNftUriError,b as EnsAvatarUnsupportedNamespaceError,h as EnsAvatarUriResolutionError,$r as EstimateGasExecutionError,_ as ExecutionRevertedError,$ as FeeCapTooHighError,aa as FeeCapTooLowError,y as FilterTypeNotSupportedError,ra as HttpRequestError,oa as InsufficientFundsError,sa as IntegerOutOfRangeError,ea as InternalRpcError,ta as IntrinsicGasTooHighError,na as IntrinsicGasTooLowError,ao as InvalidAbiDecodingTypeError,ro as InvalidAbiEncodingTypeError,oo as InvalidAbiItemError,so as InvalidAbiParametersError,eo as InvalidAbiTypeParameterError,to as InvalidAddressError,no as InvalidArrayError,ia as InvalidBytesBooleanError,io as InvalidChainIdError,U as InvalidDecimalNumberError,co as InvalidDefinitionTypeError,Ks as InvalidDomainError,Eo as InvalidFunctionModifierError,ca as InvalidHexBooleanError,da as InvalidInputRpcError,uo as InvalidLegacyVError,po as InvalidModifierError,lo as InvalidParameterError,Ea as InvalidParamsRpcError,mo as InvalidParenthesisError,Zs as InvalidPrimaryTypeError,ua as InvalidRequestRpcError,To as InvalidSerializableTransactionError,go as InvalidSignatureError,bo as InvalidStorageKeySizeError,ho as InvalidStructSignatureError,Js as InvalidStructTypeError,pa as JsonRpcVersionUnsupportedError,la as LimitExceededRpcError,yo as MaxFeePerGasTooLowError,ma as MethodNotFoundRpcError,Ta as MethodNotSupportedRpcError,ga as NonceMaxValueError,ba as NonceTooHighError,ha as NonceTooLowError,ya as ParseRpcError,fa as ProviderDisconnectedError,va as ProviderRpcError,fo as RawContractError,Aa as ResourceNotFoundRpcError,Sa as ResourceUnavailableRpcError,Ia as ResponseBodyTooLargeError,Fa as RpcError,Ra as RpcRequestError,xa as SizeExceedsPaddingSizeError,Ca as SizeOverflowError,Ba as SliceOffsetOutOfBoundsError,vo as SolidityProtectedKeywordError,Ao as StateAssignmentConflictError,Na as SwitchChainError,Pa as TimeoutError,Da as TipAboveFeeCapError,So as TransactionExecutionError,Io as TransactionNotFoundError,Fo as TransactionReceiptNotFoundError,Ua as TransactionRejectedRpcError,wa as TransactionTypeNotSupportedError,La as UnauthorizedProviderError,Ma as UnknownBundleIdError,Ha as UnknownNodeError,ka as UnknownRpcError,Ro as UnknownSignatureError,xo as UnknownTypeError,za as UnsupportedChainIdError,qa as UnsupportedNonOptionalCapabilityError,Co as UnsupportedPackedAbiType,Va as UnsupportedProviderMethodError,z as UrlRequiredError,Oa as UserRejectedRequestError,f as WaitForCallsStatusTimeoutError,Bo as WaitForTransactionReceiptTimeoutError,No as assertCurrentChain,Po as assertRequest,fe as assertTransactionEIP1559,ve as assertTransactionEIP2930,Ae as assertTransactionLegacy,Do as blobsToCommitments,Uo as blobsToProofs,Ga as boolToBytes,ja as boolToHex,wo as bytesToBigInt,Lo as bytesToBool,Wa as bytesToHex,Mo as bytesToNumber,Ho as bytesToString,ce as ccipFetch,de as ccipRequest,ko as checksumAddress,zo as commitmentToVersionedHash,qo as commitmentsToVersionedHashes,Vo as concat,Oo as concatBytes,Go as concatHex,w as createClient,v as createNonceManager,r as createPublicClient,q as createTransport,L as custom,jo as decodeAbiParameters,Wo as decodeErrorResult,Ko as decodeEventLog,ee as decodeFunctionData,Zo as decodeFunctionResult,Jo as defineBlock,t as defineChain,Qo as defineTransaction,Xo as defineTransactionReceipt,Yo as defineTransactionRequest,_o as deploylessCallViaBytecodeBytecode,$o as deploylessCallViaFactoryBytecode,as as encodeAbiParameters,rs as encodeDeployData,te as encodeErrorResult,A as encodeEventTopics,os as encodeFunctionData,ne as encodeFunctionResult,S as encodePacked,Ka as erc20Abi,Za as erc6492SignatureValidatorAbi,ss as erc6492SignatureValidatorByteCode,I as ethAddress,Ja as etherUnits,me as extendSchema,V as fallback,es as formatBlock,ts as formatEther,Qa as formatGwei,ns as formatLog,is as formatTransaction,cs as formatTransactionReceipt,ds as formatTransactionRequest,Xa as formatUnits,Ya as fromHex,Es as getAbiItem,us as getAddress,ps as getChainContractAddress,ls as getContractError,ms as getEventSelector,Ts as getEventSignature,gs as getFunctionSelector,bs as getFunctionSignature,hs as getTransactionType,Qs as getTypesForEIP712Domain,_a as gweiUnits,Xs as hashDomain,Ys as hashMessage,_s as hashStruct,$s as hashTypedData,$a as hexToBigInt,ar as hexToBool,rr as hexToBytes,or as hexToNumber,F as hexToSignature,sr as hexToString,s as http,ys as isAddress,fs as isAddressEqual,er as isHex,vs as keccak256,R as labelhash,As as maxUint16,Ss as maxUint256,tr as multicall3Abi,x as namehash,nr as numberToBytes,ir as numberToHex,Ee as offchainLookup,ue as offchainLookupAbiItem,pe as offchainLookupSignature,cr as pad,dr as padBytes,Er as padHex,Is as parseAbi,Te as parseAbiItem,ge as parseAbiParameters,Fs as parseEventLogs,C as parseSignature,M as parseUnits,Rs as prepareEncodeFunctionData,ae as presignMessagePrefix,B as publicActions,xs as recoverAddress,Cs as recoverPublicKey,Bs as rpcTransactionType,Se as serializeAccessList,N as serializeErc6492Signature,be as serializeSignature,Ie as serializeTransaction,Ns as sha256,O as shouldThrow,he as signatureToHex,ur as size,Ps as slice,Ds as sliceBytes,Us as sliceHex,pr as stringToBytes,lr as stringToHex,mr as stringify,ws as toBlobSidecars,Ls as toBlobs,Tr as toBytes,Ms as toEventHash,Hs as toEventSelector,ks as toEventSignature,zs as toFunctionHash,qs as toFunctionSelector,Vs as toFunctionSignature,gr as toHex,re as toPrefixedMessage,Os as toRlp,Gs as transactionType,br as trim,hr as universalSignatureValidatorAbi,js as universalSignatureValidatorByteCode,oe as validateTypedData,H as withCache,G as withRetry,j as withTimeout,P as zeroAddress};
1
+ import{c as r}from"./parseSignature-Cu4M83H5.js";import{B as T,E as g,a as b,b as h,F as y,W as f,d as v,e as A,f as S,g as I,p as F,l as R,n as x,p as C,h as B,s as N,z as P}from"./parseSignature-Cu4M83H5.js";import{I as U,c as w,a as L,p as M,w as H}from"./custom-BM-_NC1p.js";import{h as s}from"./W3MFrameProviderSingleton-DXEpVsCm.js";import{U as z,c as q,f as V,s as O,w as G,a as j}from"./W3MFrameProviderSingleton-DXEpVsCm.js";import{A as K,a as Z,B as J,b as Q,C as X,D as Y,E as _,F as $,c as aa,H as ra,I as oa,d as sa,e as ea,f as ta,g as na,h as ia,i as ca,j as da,k as Ea,l as ua,J as pa,L as la,M as ma,m as Ta,N as ga,n as ba,o as ha,P as ya,p as fa,q as va,R as Aa,r as Sa,s as Ia,t as Fa,u as Ra,S as xa,v as Ca,w as Ba,x as Na,T as Pa,y as Da,z as Ua,G as wa,U as La,K as Ma,O as Ha,Q as ka,V as za,W as qa,X as Va,Y as Oa,Z as Ga,_ as ja,$ as Wa,a0 as Ka,a1 as Za,a2 as Ja,a3 as Qa,a4 as Xa,a5 as Ya,a6 as _a,a7 as $a,a8 as ar,a9 as rr,aa as or,ab as sr,ac as er,ad as tr,ae as nr,af as ir,ag as cr,ah as dr,ai as Er,aj as ur,ak as pr,al as lr,am as mr,an as Tr,ao as gr,ap as br,a1 as hr}from"./NetworkUtil-DDES604E.js";import{A as fr,a as vr,b as Ar,c as Sr,d as Ir,e as Fr,f as Rr,g as xr,h as Cr,i as Br,j as Nr,k as Pr,l as Dr,m as Ur,n as wr,o as Lr,p as Mr,B as Hr,q as kr,r as zr,C as qr,s as Vr,t as Or,u as Gr,v as jr,w as Wr,x as Kr,y as Zr,z as Jr,D as Qr,E as Xr,F as Yr,G as _r,H as $r,I as ao,J as ro,K as oo,L as so,M as eo,N as to,O as no,P as io,Q as co,R as Eo,S as uo,T as po,U as lo,V as mo,W as To,X as go,Y as bo,Z as ho,_ as yo,$ as fo,a0 as vo,a1 as Ao,a2 as So,a3 as Io,a4 as Fo,a5 as Ro,a6 as xo,a7 as Co,a8 as Bo,a9 as No,aa as Po,ab as Do,ac as Uo,ad as wo,ae as Lo,af as Mo,ag as Ho,ah as ko,ai as zo,aj as qo,ak as Vo,al as Oo,am as Go,an as jo,ao as Wo,ap as Ko,aq as Zo,ar as Jo,as as Qo,at as Xo,au as Yo,av as _o,aw as $o,ax as as,ay as rs,az as os,aA as ss,aB as es,aC as ts,aD as ns,aE as is,aF as cs,aG as ds,aH as Es,aI as us,aJ as ps,aK as ls,aL as ms,aM as Ts,aN as gs,aM as bs,aO as hs,aP as ys,aQ as fs,aR as vs,aS as As,aT as Ss,aU as Is,aV as Fs,aW as Rs,aX as xs,aY as Cs,aZ as Bs,a_ as Ns,a$ as Ps,b0 as Ds,b1 as Us,b2 as ws,b3 as Ls,b4 as Ms,aL as Hs,aM as ks,b4 as zs,aN as qs,aM as Vs,b5 as Os,b6 as Gs,aA as js}from"./sendRawTransaction-YUhe5FDd.js";import{I as Ks,a as Zs,b as Js,g as Qs,h as Xs,c as Ys,d as _s,e as $s,p as ae,t as re,v as oe}from"./hashTypedData-CEYoWftx.js";import{d as ee,e as te,a as ne}from"./localBatchGatewayRequest-DVz1EzYT.js";import{ccipRequest as ce,ccipRequest as de,offchainLookup as Ee,offchainLookupAbiItem as ue,offchainLookupSignature as pe}from"./ccip-Zo_y8Ko9.js";import{d as t}from"./verifyHash-CnnSGyZz.js";import{e as me,p as Te,a as ge,s as be,s as he}from"./verifyHash-CnnSGyZz.js";import{a as fe,b as ve,c as Ae,s as Se,d as Ie}from"./serializeTransaction-xu35AVgP.js";import"./secp256k1-CrKymG_Q.js";import"./index-CI_HQD35.js";import"./react-Vu6nbGi5.js";import"./ethers-JeCAM1sd.js";import"./index-BcyJUD4U.js";import"./index-C9P6N44e.js";import"./browser-ponyfill-rND5WOqr.js";export{fr as AbiConstructorNotFoundError,vr as AbiConstructorParamsNotFoundError,Ar as AbiDecodingDataSizeTooSmallError,Sr as AbiDecodingZeroDataError,Ir as AbiEncodingArrayLengthMismatchError,Fr as AbiEncodingBytesSizeMismatchError,Rr as AbiEncodingLengthMismatchError,xr as AbiErrorInputsNotFoundError,Cr as AbiErrorNotFoundError,Br as AbiErrorSignatureNotFoundError,Nr as AbiEventNotFoundError,Pr as AbiEventSignatureEmptyTopicsError,Dr as AbiEventSignatureNotFoundError,Ur as AbiFunctionNotFoundError,wr as AbiFunctionOutputsNotFoundError,Lr as AbiFunctionSignatureNotFoundError,Mr as AccountStateConflictError,K as AtomicReadyWalletRejectedUpgradeError,Z as AtomicityNotSupportedError,J as BaseError,Hr as BaseFeeScalarError,kr as BlockNotFoundError,T as BundleFailedError,Q as BundleTooLargeError,zr as BytesSizeMismatchError,qr as CallExecutionError,X as ChainDisconnectedError,Vr as ChainDoesNotSupportContract,Or as ChainMismatchError,Gr as ChainNotFoundError,jr as CircularReferenceError,Wr as ClientChainNotConfiguredError,Kr as ContractFunctionExecutionError,Zr as ContractFunctionRevertedError,Jr as ContractFunctionZeroDataError,Qr as CounterfactualDeploymentFailedError,Xr as DecodeLogDataMismatch,Yr as DecodeLogTopicsMismatch,Y as DuplicateIdError,_r as Eip1559FeesNotSupportedError,g as EnsAvatarInvalidNftUriError,b as EnsAvatarUnsupportedNamespaceError,h as EnsAvatarUriResolutionError,$r as EstimateGasExecutionError,_ as ExecutionRevertedError,$ as FeeCapTooHighError,aa as FeeCapTooLowError,y as FilterTypeNotSupportedError,ra as HttpRequestError,oa as InsufficientFundsError,sa as IntegerOutOfRangeError,ea as InternalRpcError,ta as IntrinsicGasTooHighError,na as IntrinsicGasTooLowError,ao as InvalidAbiDecodingTypeError,ro as InvalidAbiEncodingTypeError,oo as InvalidAbiItemError,so as InvalidAbiParametersError,eo as InvalidAbiTypeParameterError,to as InvalidAddressError,no as InvalidArrayError,ia as InvalidBytesBooleanError,io as InvalidChainIdError,U as InvalidDecimalNumberError,co as InvalidDefinitionTypeError,Ks as InvalidDomainError,Eo as InvalidFunctionModifierError,ca as InvalidHexBooleanError,da as InvalidInputRpcError,uo as InvalidLegacyVError,po as InvalidModifierError,lo as InvalidParameterError,Ea as InvalidParamsRpcError,mo as InvalidParenthesisError,Zs as InvalidPrimaryTypeError,ua as InvalidRequestRpcError,To as InvalidSerializableTransactionError,go as InvalidSignatureError,bo as InvalidStorageKeySizeError,ho as InvalidStructSignatureError,Js as InvalidStructTypeError,pa as JsonRpcVersionUnsupportedError,la as LimitExceededRpcError,yo as MaxFeePerGasTooLowError,ma as MethodNotFoundRpcError,Ta as MethodNotSupportedRpcError,ga as NonceMaxValueError,ba as NonceTooHighError,ha as NonceTooLowError,ya as ParseRpcError,fa as ProviderDisconnectedError,va as ProviderRpcError,fo as RawContractError,Aa as ResourceNotFoundRpcError,Sa as ResourceUnavailableRpcError,Ia as ResponseBodyTooLargeError,Fa as RpcError,Ra as RpcRequestError,xa as SizeExceedsPaddingSizeError,Ca as SizeOverflowError,Ba as SliceOffsetOutOfBoundsError,vo as SolidityProtectedKeywordError,Ao as StateAssignmentConflictError,Na as SwitchChainError,Pa as TimeoutError,Da as TipAboveFeeCapError,So as TransactionExecutionError,Io as TransactionNotFoundError,Fo as TransactionReceiptNotFoundError,Ua as TransactionRejectedRpcError,wa as TransactionTypeNotSupportedError,La as UnauthorizedProviderError,Ma as UnknownBundleIdError,Ha as UnknownNodeError,ka as UnknownRpcError,Ro as UnknownSignatureError,xo as UnknownTypeError,za as UnsupportedChainIdError,qa as UnsupportedNonOptionalCapabilityError,Co as UnsupportedPackedAbiType,Va as UnsupportedProviderMethodError,z as UrlRequiredError,Oa as UserRejectedRequestError,f as WaitForCallsStatusTimeoutError,Bo as WaitForTransactionReceiptTimeoutError,No as assertCurrentChain,Po as assertRequest,fe as assertTransactionEIP1559,ve as assertTransactionEIP2930,Ae as assertTransactionLegacy,Do as blobsToCommitments,Uo as blobsToProofs,Ga as boolToBytes,ja as boolToHex,wo as bytesToBigInt,Lo as bytesToBool,Wa as bytesToHex,Mo as bytesToNumber,Ho as bytesToString,ce as ccipFetch,de as ccipRequest,ko as checksumAddress,zo as commitmentToVersionedHash,qo as commitmentsToVersionedHashes,Vo as concat,Oo as concatBytes,Go as concatHex,w as createClient,v as createNonceManager,r as createPublicClient,q as createTransport,L as custom,jo as decodeAbiParameters,Wo as decodeErrorResult,Ko as decodeEventLog,ee as decodeFunctionData,Zo as decodeFunctionResult,Jo as defineBlock,t as defineChain,Qo as defineTransaction,Xo as defineTransactionReceipt,Yo as defineTransactionRequest,_o as deploylessCallViaBytecodeBytecode,$o as deploylessCallViaFactoryBytecode,as as encodeAbiParameters,rs as encodeDeployData,te as encodeErrorResult,A as encodeEventTopics,os as encodeFunctionData,ne as encodeFunctionResult,S as encodePacked,Ka as erc20Abi,Za as erc6492SignatureValidatorAbi,ss as erc6492SignatureValidatorByteCode,I as ethAddress,Ja as etherUnits,me as extendSchema,V as fallback,es as formatBlock,ts as formatEther,Qa as formatGwei,ns as formatLog,is as formatTransaction,cs as formatTransactionReceipt,ds as formatTransactionRequest,Xa as formatUnits,Ya as fromHex,Es as getAbiItem,us as getAddress,ps as getChainContractAddress,ls as getContractError,ms as getEventSelector,Ts as getEventSignature,gs as getFunctionSelector,bs as getFunctionSignature,hs as getTransactionType,Qs as getTypesForEIP712Domain,_a as gweiUnits,Xs as hashDomain,Ys as hashMessage,_s as hashStruct,$s as hashTypedData,$a as hexToBigInt,ar as hexToBool,rr as hexToBytes,or as hexToNumber,F as hexToSignature,sr as hexToString,s as http,ys as isAddress,fs as isAddressEqual,er as isHex,vs as keccak256,R as labelhash,As as maxUint16,Ss as maxUint256,tr as multicall3Abi,x as namehash,nr as numberToBytes,ir as numberToHex,Ee as offchainLookup,ue as offchainLookupAbiItem,pe as offchainLookupSignature,cr as pad,dr as padBytes,Er as padHex,Is as parseAbi,Te as parseAbiItem,ge as parseAbiParameters,Fs as parseEventLogs,C as parseSignature,M as parseUnits,Rs as prepareEncodeFunctionData,ae as presignMessagePrefix,B as publicActions,xs as recoverAddress,Cs as recoverPublicKey,Bs as rpcTransactionType,Se as serializeAccessList,N as serializeErc6492Signature,be as serializeSignature,Ie as serializeTransaction,Ns as sha256,O as shouldThrow,he as signatureToHex,ur as size,Ps as slice,Ds as sliceBytes,Us as sliceHex,pr as stringToBytes,lr as stringToHex,mr as stringify,ws as toBlobSidecars,Ls as toBlobs,Tr as toBytes,Ms as toEventHash,Hs as toEventSelector,ks as toEventSignature,zs as toFunctionHash,qs as toFunctionSelector,Vs as toFunctionSignature,gr as toHex,re as toPrefixedMessage,Os as toRlp,Gs as transactionType,br as trim,hr as universalSignatureValidatorAbi,js as universalSignatureValidatorByteCode,oe as validateTypedData,H as withCache,G as withRetry,j as withTimeout,P as zeroAddress};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DV4p99KA.js","assets/index-C7-iTfFV.js","assets/react-Vu6nbGi5.js","assets/ethers-DHDSyreX.js","assets/index-DCrqkiFN.css","assets/sendRawTransaction-DT-ObNx8.js","assets/NetworkUtil-Ddexw9-U.js","assets/W3MFrameProviderSingleton-D4DCXtQm.js","assets/index-CdfeQ7YK.js","assets/index-C6FQ8I_Q.js","assets/browser-ponyfill-rND5WOqr.js","assets/custom-C6VO1Je_.js","assets/index-CQB-2hib.js","assets/index-COjgItKg.js","assets/store-CraP4F4Y.js","assets/writeContract-C3IzBPhR.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-D4DCXtQm.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-Ddexw9-U.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-DT-ObNx8.js";import{_ as we}from"./index-C7-iTfFV.js";import"./index-CdfeQ7YK.js";import"./index-C6FQ8I_Q.js";import"./browser-ponyfill-rND5WOqr.js";import{E as et}from"./index-CQB-2hib.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-C6VO1Je_.js";import{s as at,w as dt}from"./writeContract-C3IzBPhR.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 an(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-DV4p99KA.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));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-DV4p99KA.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));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-DV4p99KA.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));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 dn=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,dn as b,an as c,ae as i};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CZ8lEqAg.js","assets/index-CI_HQD35.js","assets/react-Vu6nbGi5.js","assets/ethers-JeCAM1sd.js","assets/index-DCrqkiFN.css","assets/sendRawTransaction-YUhe5FDd.js","assets/NetworkUtil-DDES604E.js","assets/W3MFrameProviderSingleton-DXEpVsCm.js","assets/index-BcyJUD4U.js","assets/index-C9P6N44e.js","assets/browser-ponyfill-rND5WOqr.js","assets/custom-BM-_NC1p.js","assets/index-CQB-2hib.js","assets/index-COjgItKg.js","assets/store-CraP4F4Y.js","assets/writeContract-dj4TlIky.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-DXEpVsCm.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-DDES604E.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-YUhe5FDd.js";import{_ as we}from"./index-CI_HQD35.js";import"./index-BcyJUD4U.js";import"./index-C9P6N44e.js";import"./browser-ponyfill-rND5WOqr.js";import{E as et}from"./index-CQB-2hib.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-BM-_NC1p.js";import{s as at,w as dt}from"./writeContract-dj4TlIky.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 an(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-CZ8lEqAg.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));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-CZ8lEqAg.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));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-CZ8lEqAg.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]));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 dn=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,dn as b,an as c,ae as i};
@@ -1,4 +1,4 @@
1
- import{p as ut}from"./ethers-DHDSyreX.js";var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),_e=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(_e||{}),M=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(M||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),dt=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(dt||{}),ht=(e=>(e.Retry="retry",e))(ht||{}),pt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(pt||{}),B=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(B||{}),mt=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(mt||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),Et=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(Et||{}),b=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(b||{}),ft=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(ft||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),gt=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(gt||{}),vt=(e=>(e.Harmony="HARMONY",e))(vt||{}),_t=(e=>(e.PhoneNumber="phone_number",e))(_t||{}),Ee={},It=Object.create,pe=Object.defineProperty,yt=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,Nt=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Te)for(var r of Te(t))At.call(t,r)&&Le(e,r,t[r]);return e},ye=(e,t)=>yt(e,Rt(t)),Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Tt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $t(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=wt(t,n))||i.enumerable});return e},Lt=(e,t,r)=>(r=e!=null?It(Nt(e)):{},Tt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),_=(e,t,r)=>new Promise((i,n)=>{var s=u=>{try{o(r.next(u))}catch(l){n(l)}},a=u=>{try{o(r.throw(u))}catch(l){n(l)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,a);o((r=r.apply(e,t)).next())}),St=Ot((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function a(l,c,d,f,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var I=new s(d,f||l,v),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],I]:l._events[$].push(I):(l._events[$]=I,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)r.call(c,d)&&l.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},u.prototype.listeners=function(l){var c=i?i+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,v=d.length,I=new Array(v);f<v;f++)I[f]=d[f].fn;return I},u.prototype.listenerCount=function(l){var c=i?i+l:l,d=this._events[c];return d?d.fn?1:d.length:0},u.prototype.emit=function(l,c,d,f,v,I){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,C,y;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,d),!0;case 4:return p.fn.call(p.context,c,d,f),!0;case 5:return p.fn.call(p.context,c,d,f,v),!0;case 6:return p.fn.call(p.context,c,d,f,v,I),!0}for(y=1,C=new Array(L-1);y<L;y++)C[y-1]=arguments[y];p.fn.apply(p.context,C)}else{var ct=p.length,V;for(y=0;y<ct;y++)switch(p[y].once&&this.removeListener(l,p[y].fn,void 0,!0),L){case 1:p[y].fn.call(p[y].context);break;case 2:p[y].fn.call(p[y].context,c);break;case 3:p[y].fn.call(p[y].context,c,d);break;case 4:p[y].fn.call(p[y].context,c,d,f);break;default:if(!C)for(V=1,C=new Array(L-1);V<L;V++)C[V-1]=arguments[V];p[y].fn.apply(p[y].context,C)}}return!0},u.prototype.on=function(l,c,d){return a(this,l,c,d,!1)},u.prototype.once=function(l,c,d){return a(this,l,c,d,!0)},u.prototype.removeListener=function(l,c,d,f){var v=i?i+l:l;if(!this._events[v])return this;if(!c)return o(this,v),this;var I=this._events[v];if(I.fn)I.fn===c&&(!f||I.once)&&(!d||I.context===d)&&o(this,v);else{for(var $=0,p=[],L=I.length;$<L;$++)(I[$].fn!==c||f&&!I[$].once||d&&I[$].context!==d)&&p.push(I[$]);p.length?this._events[v]=p.length===1?p[0]:p:o(this,v)}return this},u.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)});function Ct(e){let t={exports:{}};return e(t,t.exports),t.exports}var bt=Number.MAX_SAFE_INTEGER||9007199254740991,we={MAX_LENGTH:256,MAX_SAFE_INTEGER:bt,MAX_SAFE_COMPONENT_LENGTH:16},Pt=typeof ut=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=Pt,ee=Ct(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(u,l,c)=>{let d=a++;E(d,l),s[u]=d,n[d]=l,i[d]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,kt=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},Ut={compareIdentifiers:kt},{MAX_LENGTH:Ce,MAX_SAFE_INTEGER:re}=we,{re:be,t:Pe}=ee,{compareIdentifiers:H}=Ut,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Ce)throw new TypeError(`version is longer than ${Ce} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?be[Pe.LOOSE]:be[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Dt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Dt,Gt=(e,t,r)=>q(e,t,r)===0,xt=Gt,Ft=(e,t,r)=>q(e,t,r)!==0,Wt=Ft,jt=(e,t,r)=>q(e,t,r)>0,qt=jt,Vt=(e,t,r)=>q(e,t,r)>=0,Ht=Vt,Xt=(e,t,r)=>q(e,t,r)<0,Bt=Xt,Kt=(e,t,r)=>q(e,t,r)<=0,Yt=Kt,zt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return xt(e,r,i);case"!=":return Wt(e,r,i);case">":return qt(e,r,i);case">=":return Ht(e,r,i);case"<":return Bt(e,r,i);case"<=":return Yt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=zt,X=Symbol("SemVer ANY"),Q=class{static get ANY(){return X}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===X?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=X}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===X||e===X)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,cr(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Jt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Qt)).replace(N[R.CARETTRIM],Zt)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>er(n,this.options)).join(" ").split(/\s+/).map(n=>lr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ur(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Jt,tildeTrimReplace:Qt,caretTrimReplace:Zt}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},er=(e,t)=>(E("comp",e,t),e=ir(e,t),E("caret",e),e=tr(e,t),E("tildes",e),e=sr(e,t),E("xrange",e),e=ar(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",tr=(e,t)=>e.trim().split(/\s+/).map(r=>rr(r,t)).join(" "),rr=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let u;return E("tilde",e,i,n,s,a,o),A(n)?u="":A(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),u=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",u),u})},ir=(e,t)=>e.trim().split(/\s+/).map(r=>nr(r,t)).join(" "),nr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,u)=>{let l;return E("caret",e,n,s,a,o,u),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(E("replaceCaret pr",u),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},sr=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>or(r,t)).join(" ")),or=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,u)=>{E("xRange",e,i,n,s,a,o,u);let l=A(s),c=l||A(a),d=c||A(o),f=d;return n==="="&&f&&(n=""),u=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(u="-0"),i=`${n+s}.${a}.${o}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},ar=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),lr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),cr=e=>(t,r,i,n,s,a,o,u,l,c,d,f,v)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${d}-${f}`:e?`<${l}.${c}.${+d+1}-0`:`<=${u}`}`.trim(),ur=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},dr=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:hr}=we,{re:Ge,t:xe}=ee,pr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>hr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},mr=pr,{re:ie,t:ne}=ee,Er=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:mr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function fr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function gr(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function vr(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,fr))}function _r(e){return decodeURIComponent(Array.from(atob(e),gr).join(""))}function Xe(e){return vr(JSON.stringify(e))}function Ir(e){return JSON.parse(_r(e))}function K(e){return typeof e>"u"}function yr(e){return e===null}function Be(e){return yr(e)||K(e)}function wr(e){return Be(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function Rr(e){return Be(e)?!1:typeof e=="number"&&Object.values(_e).includes(e)}function ue(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function _i(e,t){return Object.assign(g,t),e}var $r={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},de=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Rr(t)?t:_e.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,de.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ke=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ke.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Nr(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Ar(){return new D(U.ModalNotReady,"Modal is not ready.")}function Or(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Mr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Tr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
1
+ import{p as ut}from"./ethers-JeCAM1sd.js";var U=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(U||{}),j=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT",e))(j||{}),_e=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e))(_e||{}),M=(e=>(e.MetaMask="metamask",e.CoinbaseWallet="coinbase_wallet",e))(M||{}),ae=(e=>(e.WalletSelected="wallet_selected",e.WalletConnected="wallet_connected",e.WalletRejected="wallet_rejected",e))(ae||{}),h=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.SetAuthorizationToken="magic_auth_set_authorization_token",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="magic_get_info",e.ShowUI="magic_wallet",e.NFTPurchase="magic_nft_purchase",e.NFTCheckout="magic_nft_checkout",e.NFTTransfer="magic_nft_transfer",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e.MagicBoxHeartBeat="magic_box_heart_beat",e.AutoConnect="mc_auto_connect",e.Login="mc_login",e.EncryptV1="magic_auth_encrypt_v1",e.DecryptV1="magic_auth_decrypt_v1",e.ShowNFTs="magic_show_nfts",e.ShowOnRamp="magic_show_fiat_onramp",e.ShowSendTokensUI="magic_show_send_tokens_ui",e.ShowAddress="magic_show_address",e.ShowBalances="magic_show_balances",e.SendGaslessTransaction="eth_sendGaslessTransaction",e))(h||{}),k=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e.MAGIC_MG_BOX_SEND_RECEIPT="MAGIC_MG_BOX_SEND_RECEIPT",e.MAGIC_SEND_PRODUCT_ANNOUNCEMENT="MAGIC_SEND_PRODUCT_ANNOUNCEMENT",e))(k||{}),ce=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(ce||{}),dt=(e=>(e.UpdateEmail="update-email",e.MFA="mfa",e.Recovery="recovery",e))(dt||{}),ht=(e=>(e.Retry="retry",e))(ht||{}),pt=(e=>(e.EmailSent="email-sent",e.EmailNotDeliverable="email-not-deliverable",e))(pt||{}),B=(e=>(e.VerifyEmailOtp="verify-email-otp",e.Cancel="cancel",e))(B||{}),mt=(e=>(e.EmailOTPSent="email-otp-sent",e.InvalidEmailOtp="invalid-email-otp",e.ExpiredEmailOtp="expired-email-otp",e))(mt||{}),ge=(e=>(e.Retry="device-retry",e))(ge||{}),Et=(e=>(e.DeviceApproved="device-approved",e.DeviceNeedsApproval="device-needs-approval",e.DeviceVerificationLinkExpired="device-verification-link-expired",e.DeviceVerificationEmailSent="device-verification-email-sent",e))(Et||{}),b=(e=>(e.Retry="Recency/auth-factor-retry",e.Cancel="Recency/auth-factor-verification-cancel",e.VerifyEmailOtp="Recency/auth-factor-verify-email-otp",e))(b||{}),ft=(e=>(e.PrimaryAuthFactorNeedsVerification="Recency/auth-factor-needs-verification",e.PrimaryAuthFactorVerified="Recency/auth-factor-verified",e.InvalidEmailOtp="Recency/auth-factor-invalid-email-otp",e.EmailExpired="Recency/auth-factor-verification-email-expired",e.EmailSent="Recency/auth-factor-verification-email-sent",e.EmailNotDeliverable="Recency/auth-factor-verification-email-not-deliverable",e))(ft||{}),P=(e=>(e.RetryWithNewEmail="UpdateEmail/retry-with-new-email",e.Cancel="UpdateEmail/new-email-verification-cancel",e.VerifyEmailOtp="UpdateEmail/new-email-verify-otp",e))(P||{}),gt=(e=>(e.NewAuthFactorNeedsVerification="UpdateEmail/new-email-needs-verification",e.EmailUpdated="UpdateEmail/email-updated",e.InvalidEmailOtp="UpdateEmail/new-email-invalid-email-otp",e.EmailExpired="UpdateEmail/new-email-verification-email-expired",e.EmailSent="UpdateEmail/new-email-verification-email-sent",e.EmailNotDeliverable="UpdateEmail/new-email-verification-email-not-deliverable",e.InvalidEmail="UpdateEmail/new-email-invalid",e.EmailAlreadyExists="UpdateEmail/new-email-already-exists",e))(gt||{}),vt=(e=>(e.Harmony="HARMONY",e))(vt||{}),_t=(e=>(e.PhoneNumber="phone_number",e))(_t||{}),Ee={},It=Object.create,pe=Object.defineProperty,yt=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertyNames,Te=Object.getOwnPropertySymbols,Nt=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Le=(e,t,r)=>t in e?pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ie=(e,t)=>{for(var r in t||(t={}))He.call(t,r)&&Le(e,r,t[r]);if(Te)for(var r of Te(t))At.call(t,r)&&Le(e,r,t[r]);return e},ye=(e,t)=>yt(e,Rt(t)),Ot=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Mt=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})},Tt=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $t(t))!He.call(e,n)&&n!==r&&pe(e,n,{get:()=>t[n],enumerable:!(i=wt(t,n))||i.enumerable});return e},Lt=(e,t,r)=>(r=e!=null?It(Nt(e)):{},Tt(!e||!e.__esModule?pe(r,"default",{value:e,enumerable:!0}):r,e)),_=(e,t,r)=>new Promise((i,n)=>{var s=u=>{try{o(r.next(u))}catch(l){n(l)}},a=u=>{try{o(r.throw(u))}catch(l){n(l)}},o=u=>u.done?i(u.value):Promise.resolve(u.value).then(s,a);o((r=r.apply(e,t)).next())}),St=Ot((e,t)=>{var r=Object.prototype.hasOwnProperty,i="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(i=!1));function s(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function a(l,c,d,f,v){if(typeof d!="function")throw new TypeError("The listener must be a function");var I=new s(d,f||l,v),$=i?i+c:c;return l._events[$]?l._events[$].fn?l._events[$]=[l._events[$],I]:l._events[$].push(I):(l._events[$]=I,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var l=[],c,d;if(this._eventsCount===0)return l;for(d in c=this._events)r.call(c,d)&&l.push(i?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},u.prototype.listeners=function(l){var c=i?i+l:l,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,v=d.length,I=new Array(v);f<v;f++)I[f]=d[f].fn;return I},u.prototype.listenerCount=function(l){var c=i?i+l:l,d=this._events[c];return d?d.fn?1:d.length:0},u.prototype.emit=function(l,c,d,f,v,I){var $=i?i+l:l;if(!this._events[$])return!1;var p=this._events[$],L=arguments.length,C,y;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),L){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,d),!0;case 4:return p.fn.call(p.context,c,d,f),!0;case 5:return p.fn.call(p.context,c,d,f,v),!0;case 6:return p.fn.call(p.context,c,d,f,v,I),!0}for(y=1,C=new Array(L-1);y<L;y++)C[y-1]=arguments[y];p.fn.apply(p.context,C)}else{var ct=p.length,V;for(y=0;y<ct;y++)switch(p[y].once&&this.removeListener(l,p[y].fn,void 0,!0),L){case 1:p[y].fn.call(p[y].context);break;case 2:p[y].fn.call(p[y].context,c);break;case 3:p[y].fn.call(p[y].context,c,d);break;case 4:p[y].fn.call(p[y].context,c,d,f);break;default:if(!C)for(V=1,C=new Array(L-1);V<L;V++)C[V-1]=arguments[V];p[y].fn.apply(p[y].context,C)}}return!0},u.prototype.on=function(l,c,d){return a(this,l,c,d,!1)},u.prototype.once=function(l,c,d){return a(this,l,c,d,!0)},u.prototype.removeListener=function(l,c,d,f){var v=i?i+l:l;if(!this._events[v])return this;if(!c)return o(this,v),this;var I=this._events[v];if(I.fn)I.fn===c&&(!f||I.once)&&(!d||I.context===d)&&o(this,v);else{for(var $=0,p=[],L=I.length;$<L;$++)(I[$].fn!==c||f&&!I[$].once||d&&I[$].context!==d)&&p.push(I[$]);p.length?this._events[v]=p.length===1?p[0]:p:o(this,v)}return this},u.prototype.removeAllListeners=function(l){var c;return l?(c=i?i+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=i,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)});function Ct(e){let t={exports:{}};return e(t,t.exports),t.exports}var bt=Number.MAX_SAFE_INTEGER||9007199254740991,we={MAX_LENGTH:256,MAX_SAFE_INTEGER:bt,MAX_SAFE_COMPONENT_LENGTH:16},Pt=typeof ut=="object"&&Ee&&Ee.NODE_DEBUG&&/\bsemver\b/i.test(Ee.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},E=Pt,ee=Ct(function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=we,i=(t=e.exports={}).re=[],n=t.src=[],s=t.t={},a=0,o=(u,l,c)=>{let d=a++;E(d,l),s[u]=d,n[d]=l,i[d]=new RegExp(l,c?"g":void 0)};o("NUMERICIDENTIFIER","0|[1-9]\\d*"),o("NUMERICIDENTIFIERLOOSE","[0-9]+"),o("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),o("MAINVERSION",`(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})\\.(${n[s.NUMERICIDENTIFIER]})`),o("MAINVERSIONLOOSE",`(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})\\.(${n[s.NUMERICIDENTIFIERLOOSE]})`),o("PRERELEASEIDENTIFIER",`(?:${n[s.NUMERICIDENTIFIER]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASEIDENTIFIERLOOSE",`(?:${n[s.NUMERICIDENTIFIERLOOSE]}|${n[s.NONNUMERICIDENTIFIER]})`),o("PRERELEASE",`(?:-(${n[s.PRERELEASEIDENTIFIER]}(?:\\.${n[s.PRERELEASEIDENTIFIER]})*))`),o("PRERELEASELOOSE",`(?:-?(${n[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[s.PRERELEASEIDENTIFIERLOOSE]})*))`),o("BUILDIDENTIFIER","[0-9A-Za-z-]+"),o("BUILD",`(?:\\+(${n[s.BUILDIDENTIFIER]}(?:\\.${n[s.BUILDIDENTIFIER]})*))`),o("FULLPLAIN",`v?${n[s.MAINVERSION]}${n[s.PRERELEASE]}?${n[s.BUILD]}?`),o("FULL",`^${n[s.FULLPLAIN]}$`),o("LOOSEPLAIN",`[v=\\s]*${n[s.MAINVERSIONLOOSE]}${n[s.PRERELEASELOOSE]}?${n[s.BUILD]}?`),o("LOOSE",`^${n[s.LOOSEPLAIN]}$`),o("GTLT","((?:<|>)?=?)"),o("XRANGEIDENTIFIERLOOSE",`${n[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),o("XRANGEIDENTIFIER",`${n[s.NUMERICIDENTIFIER]}|x|X|\\*`),o("XRANGEPLAIN",`[v=\\s]*(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:\\.(${n[s.XRANGEIDENTIFIER]})(?:${n[s.PRERELEASE]})?${n[s.BUILD]}?)?)?`),o("XRANGEPLAINLOOSE",`[v=\\s]*(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[s.XRANGEIDENTIFIERLOOSE]})(?:${n[s.PRERELEASELOOSE]})?${n[s.BUILD]}?)?)?`),o("XRANGE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAIN]}$`),o("XRANGELOOSE",`^${n[s.GTLT]}\\s*${n[s.XRANGEPLAINLOOSE]}$`),o("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),o("COERCERTL",n[s.COERCE],!0),o("LONETILDE","(?:~>?)"),o("TILDETRIM",`(\\s*)${n[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",o("TILDE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAIN]}$`),o("TILDELOOSE",`^${n[s.LONETILDE]}${n[s.XRANGEPLAINLOOSE]}$`),o("LONECARET","(?:\\^)"),o("CARETTRIM",`(\\s*)${n[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",o("CARET",`^${n[s.LONECARET]}${n[s.XRANGEPLAIN]}$`),o("CARETLOOSE",`^${n[s.LONECARET]}${n[s.XRANGEPLAINLOOSE]}$`),o("COMPARATORLOOSE",`^${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]})$|^$`),o("COMPARATOR",`^${n[s.GTLT]}\\s*(${n[s.FULLPLAIN]})$|^$`),o("COMPARATORTRIM",`(\\s*)${n[s.GTLT]}\\s*(${n[s.LOOSEPLAIN]}|${n[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",o("HYPHENRANGE",`^\\s*(${n[s.XRANGEPLAIN]})\\s+-\\s+(${n[s.XRANGEPLAIN]})\\s*$`),o("HYPHENRANGELOOSE",`^\\s*(${n[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[s.XRANGEPLAINLOOSE]})\\s*$`),o("STAR","(<|>)?=?\\s*\\*"),o("GTE0","^\\s*>=\\s*0.0.0\\s*$"),o("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")}),Se=/^[0-9]+$/,kt=(e,t)=>{let r=Se.test(e),i=Se.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1},Ut={compareIdentifiers:kt},{MAX_LENGTH:Ce,MAX_SAFE_INTEGER:re}=we,{re:be,t:Pe}=ee,{compareIdentifiers:H}=Ut,w=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>Ce)throw new TypeError(`version is longer than ${Ce} characters`);E("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?be[Pe.LOOSE]:be[Pe.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>re||this.major<0)throw new TypeError("Invalid major version");if(this.minor>re||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>re||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<re)return n}return i}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(E("SemVer.compare",this.version,this.options,e),!(e instanceof w)){if(typeof e=="string"&&e===this.version)return 0;e=new w(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof w||(e=new w(e,this.options)),H(this.major,e.major)||H(this.minor,e.minor)||H(this.patch,e.patch)}comparePre(e){if(e instanceof w||(e=new w(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}compareBuild(e){e instanceof w||(e=new w(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(E("prerelease compare",t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r!==i)return H(r,i)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]=="number"&&(this.prerelease[r]++,r=-2);r===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},Dt=(e,t,r)=>new w(e,r).compare(new w(t,r)),q=Dt,Gt=(e,t,r)=>q(e,t,r)===0,xt=Gt,Ft=(e,t,r)=>q(e,t,r)!==0,Wt=Ft,jt=(e,t,r)=>q(e,t,r)>0,qt=jt,Vt=(e,t,r)=>q(e,t,r)>=0,Ht=Vt,Xt=(e,t,r)=>q(e,t,r)<0,Bt=Xt,Kt=(e,t,r)=>q(e,t,r)<=0,Yt=Kt,zt=(e,t,r,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return xt(e,r,i);case"!=":return Wt(e,r,i);case">":return qt(e,r,i);case">=":return Ht(e,r,i);case"<":return Bt(e,r,i);case"<=":return Yt(e,r,i);default:throw new TypeError(`Invalid operator: ${t}`)}},fe=zt,X=Symbol("SemVer ANY"),Q=class{static get ANY(){return X}constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof Q){if(e.loose===!!t.loose)return e;e=e.value}E("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===X?this.value="":this.value=this.operator+this.semver.version,E("comp",this)}parse(e){let t=this.options.loose?ke[Ue.COMPARATORLOOSE]:ke[Ue.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new w(r[2],this.options.loose):this.semver=X}toString(){return this.value}test(e){if(E("Comparator.test",e,this.options.loose),this.semver===X||e===X)return!0;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}return fe(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Q))throw new TypeError("a Comparator is required");if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""||new F(e.value,t).test(this.value);if(e.operator==="")return e.value===""||new F(this.value,t).test(e.semver);let r=!(this.operator!==">="&&this.operator!==">"||e.operator!==">="&&e.operator!==">"),i=!(this.operator!=="<="&&this.operator!=="<"||e.operator!=="<="&&e.operator!=="<"),n=this.semver.version===e.semver.version,s=!(this.operator!==">="&&this.operator!=="<="||e.operator!==">="&&e.operator!=="<="),a=fe(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),o=fe(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return r||i||n&&s||a||o}},{re:ke,t:Ue}=ee,F=class{constructor(e,t){if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof F)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new F(e.raw,t);if(e instanceof Q)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let r=t?N[R.HYPHENRANGELOOSE]:N[R.HYPHENRANGE];e=e.replace(r,cr(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(N[R.COMPARATORTRIM],Jt),E("comparator trim",e,N[R.COMPARATORTRIM]),e=(e=(e=e.replace(N[R.TILDETRIM],Qt)).replace(N[R.CARETTRIM],Zt)).split(/\s+/).join(" ");let i=t?N[R.COMPARATORLOOSE]:N[R.COMPARATOR];return e.split(" ").map(n=>er(n,this.options)).join(" ").split(/\s+/).map(n=>lr(n,this.options)).filter(this.options.loose?n=>!!n.match(i):()=>!0).map(n=>new Q(n,this.options))}intersects(e,t){if(!(e instanceof F))throw new TypeError("a Range is required");return this.set.some(r=>De(r,t)&&e.set.some(i=>De(i,t)&&r.every(n=>i.every(s=>n.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new w(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ur(this.set[t],e,this.options))return!0;return!1}},{re:N,t:R,comparatorTrimReplace:Jt,tildeTrimReplace:Qt,caretTrimReplace:Zt}=ee,De=(e,t)=>{let r=!0,i=e.slice(),n=i.pop();for(;r&&i.length;)r=i.every(s=>n.intersects(s,t)),n=i.pop();return r},er=(e,t)=>(E("comp",e,t),e=ir(e,t),E("caret",e),e=tr(e,t),E("tildes",e),e=sr(e,t),E("xrange",e),e=ar(e,t),E("stars",e),e),A=e=>!e||e.toLowerCase()==="x"||e==="*",tr=(e,t)=>e.trim().split(/\s+/).map(r=>rr(r,t)).join(" "),rr=(e,t)=>{let r=t.loose?N[R.TILDELOOSE]:N[R.TILDE];return e.replace(r,(i,n,s,a,o)=>{let u;return E("tilde",e,i,n,s,a,o),A(n)?u="":A(s)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:A(a)?u=`>=${n}.${s}.0 <${n}.${+s+1}.0-0`:o?(E("replaceTilde pr",o),u=`>=${n}.${s}.${a}-${o} <${n}.${+s+1}.0-0`):u=`>=${n}.${s}.${a} <${n}.${+s+1}.0-0`,E("tilde return",u),u})},ir=(e,t)=>e.trim().split(/\s+/).map(r=>nr(r,t)).join(" "),nr=(e,t)=>{E("caret",e,t);let r=t.loose?N[R.CARETLOOSE]:N[R.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,(n,s,a,o,u)=>{let l;return E("caret",e,n,s,a,o,u),A(s)?l="":A(a)?l=`>=${s}.0.0${i} <${+s+1}.0.0-0`:A(o)?l=s==="0"?`>=${s}.${a}.0${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.0${i} <${+s+1}.0.0-0`:u?(E("replaceCaret pr",u),l=s==="0"?a==="0"?`>=${s}.${a}.${o}-${u} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}-${u} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o}-${u} <${+s+1}.0.0-0`):(E("no pr"),l=s==="0"?a==="0"?`>=${s}.${a}.${o}${i} <${s}.${a}.${+o+1}-0`:`>=${s}.${a}.${o}${i} <${s}.${+a+1}.0-0`:`>=${s}.${a}.${o} <${+s+1}.0.0-0`),E("caret return",l),l})},sr=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(r=>or(r,t)).join(" ")),or=(e,t)=>{e=e.trim();let r=t.loose?N[R.XRANGELOOSE]:N[R.XRANGE];return e.replace(r,(i,n,s,a,o,u)=>{E("xRange",e,i,n,s,a,o,u);let l=A(s),c=l||A(a),d=c||A(o),f=d;return n==="="&&f&&(n=""),u=t.includePrerelease?"-0":"",l?i=n===">"||n==="<"?"<0.0.0-0":"*":n&&f?(c&&(a=0),o=0,n===">"?(n=">=",c?(s=+s+1,a=0,o=0):(a=+a+1,o=0)):n==="<="&&(n="<",c?s=+s+1:a=+a+1),n==="<"&&(u="-0"),i=`${n+s}.${a}.${o}${u}`):c?i=`>=${s}.0.0${u} <${+s+1}.0.0-0`:d&&(i=`>=${s}.${a}.0${u} <${s}.${+a+1}.0-0`),E("xRange return",i),i})},ar=(e,t)=>(E("replaceStars",e,t),e.trim().replace(N[R.STAR],"")),lr=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(N[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),cr=e=>(t,r,i,n,s,a,o,u,l,c,d,f,v)=>`${r=A(i)?"":A(n)?`>=${i}.0.0${e?"-0":""}`:A(s)?`>=${i}.${n}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=A(l)?"":A(c)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+c+1}.0-0`:f?`<=${l}.${c}.${d}-${f}`:e?`<${l}.${c}.${+d+1}-0`:`<=${u}`}`.trim(),ur=(e,t,r)=>{for(let i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let i=0;i<e.length;i++)if(E(e[i].semver),e[i].semver!==Q.ANY&&e[i].semver.prerelease.length>0){let n=e[i].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},dr=(e,t,r)=>{try{t=new F(t,r)}catch{return!1}return t.test(e)},{MAX_LENGTH:hr}=we,{re:Ge,t:xe}=ee,pr=(e,t)=>{if(t&&typeof t=="object"||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e;if(typeof e!="string"||e.length>hr||!(t.loose?Ge[xe.LOOSE]:Ge[xe.FULL]).test(e))return null;try{return new w(e,t)}catch{return null}},mr=pr,{re:ie,t:ne}=ee,Er=(e,t)=>{if(e instanceof w)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;let r=null;if((t=t||{}).rtl){let i;for(;(i=ie[ne.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),ie[ne.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;ie[ne.COERCERTL].lastIndex=-1}else r=e.match(ie[ne.COERCE]);return r===null?null:mr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function fr(e){return String.fromCharCode(parseInt(e.slice(1),16))}function gr(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function vr(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,fr))}function _r(e){return decodeURIComponent(Array.from(atob(e),gr).join(""))}function Xe(e){return vr(JSON.stringify(e))}function Ir(e){return JSON.parse(_r(e))}function K(e){return typeof e>"u"}function yr(e){return e===null}function Be(e){return yr(e)||K(e)}function wr(e){return Be(e)?!1:!K(e.jsonrpc)&&!K(e.id)&&(!K(e.result)||!K(e.error))}function Rr(e){return Be(e)?!1:typeof e=="number"&&Object.values(_e).includes(e)}function ue(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var g={};function _i(e,t){return Object.assign(g,t),e}var $r={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},D=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,D.prototype)}},de=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(e==null?void 0:e.code);this.rawMessage=(e==null?void 0:e.message)||"Internal error",this.code=Rr(t)?t:_e.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(e==null?void 0:e.data)||void 0,Object.setPrototypeOf(this,de.prototype)}},te=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},Ke=class extends Error{constructor(e,t,r,i){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=i,this.__proto__=Error,Object.setPrototypeOf(this,Ke.prototype)}},Fe=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function Nr(){return new D(U.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function Ar(){return new D(U.ModalNotReady,"Modal is not ready.")}function Or(){return new D(U.MalformedResponse,"Response from the Magic iframe is malformed.")}function Mr(e){return new D(U.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function Tr(e){let t=`Some extensions are incompatible with \`${g.sdkName}@${g.version}\`:`;return e.filter(r=>typeof r.compat<"u"&&r.compat!==null).forEach(r=>{let i=r.compat[g.sdkName];typeof i=="string"?t+=`
2
2
  - Extension \`${r.name}\` supports version(s) \`${i}\``:i||(t+=`
3
3
  - Extension \`${r.name}\` does not support ${g.platform} environments.`)}),new D(U.IncompatibleExtensions,t)}function Lr(e){let t=r=>{let i=r+1,n=i%10,s=i%100;return n===1&&s!==11?`${i}st`:n===2&&s!==12?`${i}nd`:n===3&&s!==13?`${i}rd`:`${i}th`};return new D(U.InvalidArgument,`Invalid ${t(e.argument)} argument given to \`${e.procedure}\`.
4
4
  Expected: \`${e.expected}\`