@dcl/shop 0.1.0-30612955316.commit-0d9b744 → 0.1.0-30633401379.commit-5cd1c31

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 (178) hide show
  1. package/assets/Activity-BHKoZZp5.js +291 -0
  2. package/assets/{AnimatedBackground-DTgtqP8R.js → AnimatedBackground-BlD5oHcR.js} +2 -2
  3. package/assets/{Assets-B9KXwYG0.js → Assets-DUKvbfgo.js} +7 -7
  4. package/assets/{Assets.styles-Dm_MgfhY.js → Assets.styles-BLCNmjO6.js} +1 -1
  5. package/assets/{Authorizations--gatNHIW.js → Authorizations-6n5FWz0U.js} +1 -1
  6. package/assets/Cart-D7ktjzZK.js +695 -0
  7. package/assets/{CircularProgress-BRaMu2HF.js → CircularProgress-CMZVAt1l.js} +1 -1
  8. package/assets/{Collection-BIR5xrVe.js → Collection-CQps3SAa.js} +1 -1
  9. package/assets/{CollectionCarousel-oh8d08gi.js → CollectionCarousel-CrTrsXB-.js} +1 -1
  10. package/assets/{Creator-jKJMNfvf.js → Creator-DeBO0_hP.js} +2 -2
  11. package/assets/{ErrorNotice-C2qBxBzo.js → ErrorNotice-DwhdhAu6.js} +1 -1
  12. package/assets/{ExchangeController-BJ20Rri0.js → ExchangeController-DFaPYxag.js} +1 -1
  13. package/assets/{GetCredits-DWkdHCSk.js → GetCredits-CH0SxGoe.js} +8 -8
  14. package/assets/{HelpersUtil-Bc_-rYa4.js → HelpersUtil-CGxvruiS.js} +1 -1
  15. package/assets/{ImportListings-C61E-WD4.js → ImportListings-D3Q-MYHt.js} +8 -8
  16. package/assets/{ItemDetail-BFNeFxLh.js → ItemDetail-grsXVByw.js} +3 -3
  17. package/assets/{LoadMore-BI2cyij4.js → LoadMore-CVBNO6CV.js} +1 -1
  18. package/assets/{MenuList-CsoSKANx.js → MenuList-D5vC383J.js} +1 -1
  19. package/assets/{MyAssets-B8jlwAvA.js → MyAssets-B4-suVif.js} +1 -1
  20. package/assets/{MyFavorites-B6kCgq1h.js → MyFavorites-rQde9LEq.js} +1 -1
  21. package/assets/{NotFound-CWtlpg63.js → NotFound-CICAlcY2.js} +1 -1
  22. package/assets/{NotificationsBell-wPKuEs_b.js → NotificationsBell-BcUtKYE_.js} +1 -1
  23. package/assets/{StoreSettings-BW2EY9gn.js → StoreSettings-D-p-KMUm.js} +1 -1
  24. package/assets/Success-CKUShs2s.js +276 -0
  25. package/assets/{SwapController-DHr7xvAI.js → SwapController-BqpEkXCy.js} +1 -1
  26. package/assets/{Tooltip-DFmfpHxa.js → Tooltip-v8d4_GhH.js} +1 -1
  27. package/assets/{TradeService-BxS-ssTi.js → TradeService-CMvEMasH.js} +1 -1
  28. package/assets/{W3MFrameProviderSingleton-D3RatyJZ.js → W3MFrameProviderSingleton-MrB8u6EW.js} +3 -3
  29. package/assets/{WebCryptoP256-DLlMYv1t.js → WebCryptoP256-CP0xBKi2.js} +1 -1
  30. package/assets/{authorizations-BrAVsIY_.js → authorizations-uQp0Tner.js} +1 -1
  31. package/assets/{basic-B1iPuZqz.js → basic-B_OSMlWi.js} +1 -1
  32. package/assets/{biconomy-CReC5_o1.js → biconomy-DrNdbDOV.js} +1 -1
  33. package/assets/{browseLayout.styles-Ck-h2OX5.js → browseLayout.styles-B5gAAnD7.js} +5 -5
  34. package/assets/{builder-BW_vsdgs.js → builder-BH8bW8w3.js} +1 -1
  35. package/assets/buy-DI2htlf2.js +1 -0
  36. package/assets/{buy-gasless-DoEdxK3L.js → buy-gasless-D3ucK012.js} +1 -1
  37. package/assets/{categories-P1zgLmzy.js → categories-CUWn-vWY.js} +1 -1
  38. package/assets/{ccip-BHjcKqJV.js → ccip-D4QJIvrM.js} +1 -1
  39. package/assets/{ccip-CZBbVQi3.js → ccip-zHeTh1U3.js} +1 -1
  40. package/assets/{clsx-DhFqZi_3.js → clsx-C78Se7VZ.js} +2 -2
  41. package/assets/{controller-DGy85CgR.js → controller-BICwQmay.js} +2 -2
  42. package/assets/{core-Db5S1VHS.js → core-BpePoapT.js} +4 -4
  43. package/assets/{createSvgIcon-DLpGC0um.js → createSvgIcon-D6bh0MrS.js} +3 -3
  44. package/assets/{custom-ClweN61f.js → custom-DIlU15wg.js} +1 -1
  45. package/assets/{data-capture-z84EsTtU.js → data-capture-DF5W_J8T.js} +1 -1
  46. package/assets/{email-CcLkWyvu.js → email-CLMX01kZ.js} +1 -1
  47. package/assets/{embedded-wallet-COy2jXd-.js → embedded-wallet-CbYQTubx.js} +1 -1
  48. package/assets/{emotion-styled.browser.esm-Bl0xNQms.js → emotion-styled.browser.esm-uimCutsp.js} +1 -1
  49. package/assets/{engine-D5VFTt2U.js → engine-Bobn5NnI.js} +1 -1
  50. package/assets/{errors-D660SWgT.js → errors-BHapDldI.js} +1 -1
  51. package/assets/{estimate-l1-fee-D0AZXU9d.js → estimate-l1-fee-Zo4D8zNV.js} +1 -1
  52. package/assets/{execute-B7xe5F3I.js → execute-B3koRsQT.js} +2 -2
  53. package/assets/{features-CDbo6Rgb.js → features-29eUittk.js} +1 -1
  54. package/assets/{fetchTokenMetadata-CTdt9CEd.js → fetchTokenMetadata-BVVFFsly.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-DSZkSx4X.js → get-ecosystem-wallet-info-Fbs6oNmw.js} +1 -1
  56. package/assets/{getBalance-BDX5XOeM.js → getBalance-BynOYuPH.js} +1 -1
  57. package/assets/{getNFT-CVs2H6Tl.js → getNFT-C7BU-05F.js} +1 -1
  58. package/assets/{getNFT-DINbSeyy.js → getNFT-CHPhy1te.js} +1 -1
  59. package/assets/{getThemeProps-CGtqDWEq.js → getThemeProps-BCb3jyqf.js} +1 -1
  60. package/assets/{grid.styles-D4B-EHGj.js → grid.styles-CFlLjGWA.js} +1 -1
  61. package/assets/{hashTypedData-Dz79Rf5q.js → hashTypedData-BmEKHoZL.js} +1 -1
  62. package/assets/{hashTypedData-B7lV4LZj.js → hashTypedData-CixGH523.js} +1 -1
  63. package/assets/{import-DSm0v4af.js → import-xE4hDmDm.js} +1 -1
  64. package/assets/{in-app-C5pWpM6r.js → in-app-BcKmOV8m.js} +1 -1
  65. package/assets/{in-app-wallet-calls-DXx7lWeR.js → in-app-wallet-calls-BI1PaW_x.js} +1 -1
  66. package/assets/{index-ODLNljC7.js → index-9WfG_CLW.js} +1 -1
  67. package/assets/{index-CJgXTNhS.js → index-ASq7s2Iv.js} +2 -2
  68. package/assets/{index-BobbFiKW.js → index-B0eTctvC.js} +1 -1
  69. package/assets/{index-D7R57an8.js → index-B439DG-9.js} +2 -2
  70. package/assets/{index-BZocXWA4.js → index-BAORCNZn.js} +1 -1
  71. package/assets/{index-G1xB9dvf.js → index-BFzvJeyM.js} +1 -1
  72. package/assets/{index-Cl-v7TvL.js → index-BHVh9ZD-.js} +1 -1
  73. package/assets/{index-yJi2QIJf.js → index-BMIuNfCB.js} +252 -252
  74. package/assets/{index-CZTqkynu.js → index-BTOrBWcS.js} +1 -1
  75. package/assets/{index-b_a6Xe2g.js → index-BUo3wAlN.js} +3 -3
  76. package/assets/{index-1koyBXBc.js → index-Bb9TuCMN.js} +1 -1
  77. package/assets/{index-B81PeozV.js → index-BdDw5syJ.js} +1 -1
  78. package/assets/{index-xZ3i_Adn.js → index-Bdx6vg6T.js} +1 -1
  79. package/assets/{index-tdQJ2A6x.js → index-Bler0kM4.js} +1 -1
  80. package/assets/{index-3ZTohoUZ.js → index-C7EZCMfv.js} +1 -1
  81. package/assets/{index-BBkUTtNV.js → index-CG3EVA6i.js} +2 -2
  82. package/assets/{index-P_XHlb3T.js → index-CP0MJS3n.js} +1 -1
  83. package/assets/{index-frQRdZ2q.js → index-CSzz0-yL.js} +1 -1
  84. package/assets/{index-BFSsZJPW.js → index-CY9EBgzo.js} +1 -1
  85. package/assets/{index-DiOmLLPI.js → index-CgOcSf2Q.js} +1 -1
  86. package/assets/{index-CdsKR_zs.js → index-CkfB4xYf.js} +1 -1
  87. package/assets/{index-CZ1tNVf6.js → index-CpKxcKSt.js} +1 -1
  88. package/assets/{index-B8zb5Fyq.js → index-CsCFxm9l.js} +1 -1
  89. package/assets/{index-DZg10nMY.js → index-CugdcJ5p.js} +1 -1
  90. package/assets/{index-gKwUmrp3.js → index-CvuWb2er.js} +1 -1
  91. package/assets/{index-BgoikptS.js → index-D-jdrajA.js} +1 -1
  92. package/assets/{index-DfTLbDYm.js → index-D6z3Iok7.js} +1 -1
  93. package/assets/{index-DQ2sE8uD.js → index-DA1IdQid.js} +1 -1
  94. package/assets/{index-DMjEzVVJ.js → index-DCUYsq3Z.js} +1 -1
  95. package/assets/{index-1c_qW8yi.js → index-DI-G5L8D.js} +1 -1
  96. package/assets/{index-C0LSKXhw.js → index-DJGQazF5.js} +1 -1
  97. package/assets/{index-C0odNd_G.js → index-DNLfbOQJ.js} +1 -1
  98. package/assets/{index-CuPPMOVj.js → index-DfVobYmm.js} +1 -1
  99. package/assets/{index-C-C5pEJc.js → index-DmnyvmGd.js} +1 -1
  100. package/assets/{index-CpqhaC2H.js → index-DpjOr79p.js} +1 -1
  101. package/assets/{index-DjbRx8bI.js → index-DzCJVhsv.js} +1 -1
  102. package/assets/{index-CXntdDwE.js → index-Eco3bQ72.js} +2 -2
  103. package/assets/{index-CwVjvkdk.js → index-FvB9JTSh.js} +1 -1
  104. package/assets/{index-DU8_EWWx.js → index-H02HAhZo.js} +1 -1
  105. package/assets/{index-CzByZQWv.js → index-LL0BV6rh.js} +1 -1
  106. package/assets/{index-CLBmEx6A.js → index-MsJgZMgr.js} +3 -3
  107. package/assets/{index-Dr4K4hFL.js → index-R3pS6x6y.js} +3 -3
  108. package/assets/{index-CX5Ekh69.js → index-dXYc2QRl.js} +1 -1
  109. package/assets/{index-CkBDyoGg.js → index-hwCoxi9L.js} +1 -1
  110. package/assets/{index-BJ-25Q5l.js → index-ldblNYIT.js} +1 -1
  111. package/assets/{index-CbITlqFn.js → index-n-ShiY2h.js} +1 -1
  112. package/assets/{index-DIR4uPmO.js → index-oFYHMIzO.js} +1 -1
  113. package/assets/{index-Cw6mXTIQ.js → index-rFh28dtY.js} +1 -1
  114. package/assets/{index-CKEG3W2m.js → index-wfubccp5.js} +1 -1
  115. package/assets/{index-Dw4Gh8Hk.js → index-wnx7vlu-.js} +2 -2
  116. package/assets/{index-NPIY1Vbs.js → index-xk15qzPN.js} +1 -1
  117. package/assets/{index.es-CdLNKigl.js → index.es-BEVmNmLD.js} +4 -4
  118. package/assets/{index.es-CZz1nBev.js → index.es-BPA6fTzR.js} +1 -1
  119. package/assets/{index.es-CeoIh9-h.js → index.es-BW6RduBG.js} +1 -1
  120. package/assets/{localBatchGatewayRequest-Dbz593U8.js → localBatchGatewayRequest-C2eNLm--.js} +1 -1
  121. package/assets/{mana-convert-DTic_WF4.js → mana-convert-C341n1xm.js} +1 -1
  122. package/assets/{mana-rate-DTd_zYK_.js → mana-rate-BAPBwbaG.js} +1 -1
  123. package/assets/{networks-D-WgnPJO.js → networks-gEGHz8eL.js} +1 -1
  124. package/assets/{onramp-CxZE_awn.js → onramp-DHcILVIp.js} +1 -1
  125. package/assets/{openzeppelin-BicG6fZ-.js → openzeppelin-BvSgRich.js} +1 -1
  126. package/assets/{parseNft-crNNmDcM.js → parseNft-DrAu-xVe.js} +2 -2
  127. package/assets/{parseSignature-xro4_AeM.js → parseSignature--WNVOXAe.js} +3 -3
  128. package/assets/{parseSignature-TUf4MZpE.js → parseSignature-BlmIeeL7.js} +1 -1
  129. package/assets/{passkeys-DlsWo5hj.js → passkeys-BD41PpMD.js} +1 -1
  130. package/assets/{pay-with-exchange-uJFVzJz2.js → pay-with-exchange-DCmtfnr1.js} +1 -1
  131. package/assets/{qr-overlay-D1DRCZeg.js → qr-overlay-DYViFXBB.js} +1 -1
  132. package/assets/{receive-jEtfcBkz.js → receive-LPMbYHZa.js} +1 -1
  133. package/assets/{resolveImplementation-Dfr_x2D4.js → resolveImplementation-CdVPuboc.js} +1 -1
  134. package/assets/{rpc-HxGwRhjl.js → rpc-D2C2velX.js} +1 -1
  135. package/assets/{secp256k1-BeCdbOwL.js → secp256k1-DLPIWcy9.js} +1 -1
  136. package/assets/{secp256k1-Bmo0zLoN.js → secp256k1-DtCfsIY0.js} +1 -1
  137. package/assets/{secp256k1-CPsxfMTn.js → secp256k1-KqMjq-B-.js} +1 -1
  138. package/assets/{send-SCYWhWgO.js → send-BYANl3m1.js} +1 -1
  139. package/assets/{send-batch-transaction-ClJpcx_r.js → send-batch-transaction-BHqPVqqQ.js} +1 -1
  140. package/assets/{send-eip712-transaction-DCKQGfPC.js → send-eip712-transaction-D3zsFnZJ.js} +2 -2
  141. package/assets/{send-gasless-transaction-C6PqTuT4.js → send-gasless-transaction-Db4a0n6K.js} +2 -2
  142. package/assets/{send-transaction-DCRA_QBx.js → send-transaction-0fPTuVE4.js} +2 -2
  143. package/assets/{sendMetaTransaction-BOtIj1YL.js → sendMetaTransaction-DAsHliEn.js} +1 -1
  144. package/assets/{sendRawTransaction-BkrUK6tH.js → sendRawTransaction-B5IMe5Y5.js} +3 -3
  145. package/assets/{serializeTransaction-bVNzq6Wv.js → serializeTransaction-BT9LeH0D.js} +1 -1
  146. package/assets/{session-proposal-BwFRVt7g.js → session-proposal-plO_EjqI.js} +1 -1
  147. package/assets/{session-request-4TbdsxSC.js → session-request-DTauixOT.js} +2 -2
  148. package/assets/{signing-BxAbixw6.js → signing-BKT41maQ.js} +3 -3
  149. package/assets/{socials-B5zVEegD.js → socials-BPcwRKMp.js} +1 -1
  150. package/assets/{swaps-DQ1LcBTU.js → swaps-DddX0hWZ.js} +1 -1
  151. package/assets/{thirdweb-r2nvH1Ph.js → thirdweb-DI1D_9ce.js} +3 -3
  152. package/assets/{to-serializable-transaction-DMc2E6fk.js → to-serializable-transaction-BZX746C8.js} +2 -2
  153. package/assets/trade-encoding-CK5EArKF.js +1 -0
  154. package/assets/{transactionReceipt-DFdTIN3F.js → transactionReceipt-2D5Q3zvv.js} +1 -1
  155. package/assets/{transactions-DnRd57Kk.js → transactions-DtbDwrsO.js} +1 -1
  156. package/assets/useCreditPacks-Dw0jIjQE.js +1 -0
  157. package/assets/{useInfiniteGrid-CDkGdzFf.js → useInfiniteGrid-Xjfvrq_T.js} +1 -1
  158. package/assets/useManaRate-BEVwu7Q9.js +1 -0
  159. package/assets/{useSecondarySales-BLnZD7gi.js → useSecondarySales-bajhgse5.js} +1 -1
  160. package/assets/{useStore-Dt337zVA.js → useStore-CIqjcPjh.js} +1 -1
  161. package/assets/{useTheme-DlRIY8zD.js → useTheme-DVSXpYGO.js} +1 -1
  162. package/assets/{verifyHash-D8nhWUT9.js → verifyHash-DmL5gbPk.js} +1 -1
  163. package/assets/{w3m-modal-Z-IBP9yL.js → w3m-modal-B2N-eyv6.js} +1 -1
  164. package/assets/{w3m-modal-D1mPkWGM.js → w3m-modal-CfZXCvPG.js} +1 -1
  165. package/assets/{wait-for-tx-receipt-8bgpdxSo.js → wait-for-tx-receipt-BEDrW5cD.js} +1 -1
  166. package/assets/{wallets-BTh4qQ9L.js → wallets-DQk0dtw_.js} +5 -5
  167. package/assets/{web-connector-DXtL7d_s.js → web-connector-2N1NjIJ4.js} +3 -3
  168. package/assets/{writeContract-B7vnLdJy.js → writeContract-BZemjhP4.js} +1 -1
  169. package/assets/{zoraTestnet-kFdaoH4G.js → zoraTestnet-BK5x9nJO.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/assets/Activity-BF3WNwMh.js +0 -291
  173. package/assets/Cart-Cs0FD0IN.js +0 -695
  174. package/assets/Success-CTKJzQjE.js +0 -276
  175. package/assets/buy-DLi3_94e.js +0 -1
  176. package/assets/trade-encoding-BFXwI1r3.js +0 -1
  177. package/assets/useCreditPacks-DnQLmQo7.js +0 -1
  178. package/assets/useManaRate-DwO6H8fK.js +0 -1
@@ -1,4 +1,4 @@
1
- import{i as m,b as h}from"./lit-element-B3y9oplH.js";import{n as b,o as v,r as C}from"./class-map-CxwNmq0D.js";import{d as k,r as g}from"./index-b_a6Xe2g.js";import{c as y}from"./index-CkBDyoGg.js";import{e as O,n as _}from"./ref-BsAZ42-h.js";import{e as L,i as R,p as j,O as l}from"./W3MFrameProviderSingleton-D3RatyJZ.js";const d=j({isLegalCheckboxChecked:!1}),f={state:d,subscribe(e){return R(d,()=>e(d))},subscribeKey(e,t){return L(d,e,t)},setIsLegalCheckboxChecked(e){d.isLegalCheckboxChecked=e}},z=k`
1
+ import{i as m,b as h}from"./lit-element-B3y9oplH.js";import{n as b,o as v,r as C}from"./class-map-CxwNmq0D.js";import{d as k,r as g}from"./index-BUo3wAlN.js";import{c as y}from"./index-hwCoxi9L.js";import{e as O,n as _}from"./ref-BsAZ42-h.js";import{e as L,i as R,p as j,O as l}from"./W3MFrameProviderSingleton-MrB8u6EW.js";const d=j({isLegalCheckboxChecked:!1}),f={state:d,subscribe(e){return R(d,()=>e(d))},subscribeKey(e,t){return L(d,e,t)},setIsLegalCheckboxChecked(e){d.isLegalCheckboxChecked=e}},z=k`
2
2
  label {
3
3
  display: inline-flex;
4
4
  align-items: center;
@@ -1,4 +1,4 @@
1
- import{a as h,i as d,b as a}from"./lit-element-B3y9oplH.js";import{d as w,r as x,e as b}from"./index-b_a6Xe2g.js";import{c as m}from"./index-CkBDyoGg.js";import"./index-DQ2sE8uD.js";import{O as c,E as g,l as v,C,W as _,R as $}from"./W3MFrameProviderSingleton-D3RatyJZ.js";import{r as R}from"./class-map-CxwNmq0D.js";const T=h``;var O=function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(t=(i<3?s(t):i>3?s(e,r,t):s(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let f=class extends d{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return!e&&!r?null:a`
1
+ import{a as h,i as d,b as a}from"./lit-element-B3y9oplH.js";import{d as w,r as x,e as b}from"./index-BUo3wAlN.js";import{c as m}from"./index-hwCoxi9L.js";import"./index-DA1IdQid.js";import{O as c,E as g,l as v,C,W as _,R as $}from"./W3MFrameProviderSingleton-MrB8u6EW.js";import{r as R}from"./class-map-CxwNmq0D.js";const T=h``;var O=function(n,e,r,o){var i=arguments.length,t=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(n,e,r,o);else for(var l=n.length-1;l>=0;l--)(s=n[l])&&(t=(i<3?s(t):i>3?s(e,r,t):s(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let f=class extends d{render(){const{termsConditionsUrl:e,privacyPolicyUrl:r}=c.state;return!e&&!r?null:a`
2
2
  <wui-flex
3
3
  .padding=${["4","3","3","3"]}
4
4
  flexDirection="column"
@@ -1,3 +1,3 @@
1
- import{d as G}from"./index-CbITlqFn.js";/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function I(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function B(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=s=>s,n=(s,u)=>i=>s(u(i)),b=e.map(s=>s.encode).reduceRight(n,r),d=e.map(s=>s.decode).reduce(n,r);return{encode:b,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const b=new Map(r.map((d,s)=>[d,s]));return{encode:d=>(v(d),d.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return r[s]})),decode:d=>(v(d),d.map(s=>{I("alphabet.decode",s);const u=b.get(s);if(u===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return u}))}}function W(e=""){return I("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(I("join.decode",r),r.split(e))}}function fe(e,r="="){return B(e),I("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let b=n.length;if(b*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;b>0&&n[b-1]===r;b--)if((b-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,b)}}}function _(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let b=0;const d=[],s=Array.from(e,i=>{if(B(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),u=s.length;for(;;){let i=0,a=!0;for(let w=b;w<u;w++){const p=s[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const l=Math.floor(m);if(s[w]=l,!Number.isSafeInteger(l)||l*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)l?a=!1:b=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,b){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,s=0;const u=R[r],i=R[n]-1,a=[];for(const w of e){if(B(w),w>=u)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,s+r>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)a.push((d>>s-n&i)>>>0);const p=R[s];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-s&i,!b&&s>=r)throw new Error("Excess padding");if(!b&&d>0)throw new Error(`Non-zero padding: ${d}`);return b&&s>0&&a.push(d>>>0),a}function ae(e){B(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return _(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(_(n,e,r)))}}function le(e,r=!1){if(B(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const be=J(le(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),se=e=>J(ae(58),Q(e),W("")),we=se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function D(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?D(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ge(e,r){r||(r=e.reduce((d,s)=>d+s.length,0));const n=Y(r);let b=0;for(const d of e)n.set(d,b),b+=d.length;return D(n)}function Z(e,r,n,b){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:b}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:G.base16,latin1:T,ascii:T,binary:T,...G};function pe(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?D(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(u){let i;if(u instanceof Uint8Array)i=u;else if(typeof u=="string")i=new TextEncoder().encode(u);else throw new Error(e);return i}function n(u){return Array.prototype.map.call(u,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function b(u){return(4294967296+u).toString(16).substring(1)}function d(u,i,a){let w=`
1
+ import{d as G}from"./index-n-ShiY2h.js";/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function V(e,r){return Array.isArray(r)?r.length===0?!0:e?r.every(n=>typeof n=="string"):r.every(n=>Number.isSafeInteger(n)):!1}function I(e,r){if(typeof r!="string")throw new Error(`${e}: string expected`);return!0}function B(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function v(e){if(!Array.isArray(e))throw new Error("array expected")}function S(e,r){if(!V(!0,r))throw new Error(`${e}: array of strings expected`)}function K(e,r){if(!V(!1,r))throw new Error(`${e}: array of numbers expected`)}function J(...e){const r=s=>s,n=(s,u)=>i=>s(u(i)),b=e.map(s=>s.encode).reduceRight(n,r),d=e.map(s=>s.decode).reduce(n,r);return{encode:b,decode:d}}function Q(e){const r=typeof e=="string"?e.split(""):e,n=r.length;S("alphabet",r);const b=new Map(r.map((d,s)=>[d,s]));return{encode:d=>(v(d),d.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return r[s]})),decode:d=>(v(d),d.map(s=>{I("alphabet.decode",s);const u=b.get(s);if(u===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return u}))}}function W(e=""){return I("join",e),{encode:r=>(S("join.decode",r),r.join(e)),decode:r=>(I("join.decode",r),r.split(e))}}function fe(e,r="="){return B(e),I("padding",r),{encode(n){for(S("padding.encode",n);n.length*e%8;)n.push(r);return n},decode(n){S("padding.decode",n);let b=n.length;if(b*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;b>0&&n[b-1]===r;b--)if((b-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return n.slice(0,b)}}}function _(e,r,n){if(r<2)throw new Error(`convertRadix: invalid from=${r}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: invalid to=${n}, base cannot be less than 2`);if(v(e),!e.length)return[];let b=0;const d=[],s=Array.from(e,i=>{if(B(i),i<0||i>=r)throw new Error(`invalid integer: ${i}`);return i}),u=s.length;for(;;){let i=0,a=!0;for(let w=b;w<u;w++){const p=s[w],x=r*i,A=x+p;if(!Number.isSafeInteger(A)||x/r!==i||A-p!==x)throw new Error("convertRadix: carry overflow");const m=A/n;i=A%n;const l=Math.floor(m);if(s[w]=l,!Number.isSafeInteger(l)||l*n+i!==A)throw new Error("convertRadix: carry overflow");if(a)l?a=!1:b=w;else continue}if(d.push(i),a)break}for(let i=0;i<e.length-1&&e[i]===0;i++)d.push(0);return d.reverse()}const X=(e,r)=>r===0?e:X(r,e%r),$=(e,r)=>e+(r-X(e,r)),R=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function F(e,r,n,b){if(v(e),r<=0||r>32)throw new Error(`convertRadix2: wrong from=${r}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if($(r,n)>32)throw new Error(`convertRadix2: carry overflow from=${r} to=${n} carryBits=${$(r,n)}`);let d=0,s=0;const u=R[r],i=R[n]-1,a=[];for(const w of e){if(B(w),w>=u)throw new Error(`convertRadix2: invalid data word=${w} from=${r}`);if(d=d<<r|w,s+r>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${r}`);for(s+=r;s>=n;s-=n)a.push((d>>s-n&i)>>>0);const p=R[s];if(p===void 0)throw new Error("invalid carry");d&=p-1}if(d=d<<n-s&i,!b&&s>=r)throw new Error("Excess padding");if(!b&&d>0)throw new Error(`Non-zero padding: ${d}`);return b&&s>0&&a.push(d>>>0),a}function ae(e){B(e);const r=2**8;return{encode:n=>{if(!P(n))throw new Error("radix.encode input should be Uint8Array");return _(Array.from(n),r,e)},decode:n=>(K("radix.decode",n),Uint8Array.from(_(n,e,r)))}}function le(e,r=!1){if(B(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($(8,e)>32||$(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!P(n))throw new Error("radix2.encode input should be Uint8Array");return F(Array.from(n),8,e,!r)},decode:n=>(K("radix2.decode",n),Uint8Array.from(F(n,e,8,r)))}}const be=J(le(5),Q("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),fe(5),W("")),se=e=>J(ae(58),Q(e),W("")),we=se("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function D(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Y(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?D(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ge(e,r){r||(r=e.reduce((d,s)=>d+s.length,0));const n=Y(r);let b=0;for(const d of e)n.set(d,b),b+=d.length;return D(n)}function Z(e,r,n,b){return{name:e,prefix:r,encoder:{name:e,prefix:r,encode:n},decoder:{decode:b}}}const q=Z("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),T=Z("ascii","a",e=>{let r="a";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return r},e=>{e=e.substring(1);const r=Y(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}),ee={utf8:q,"utf-8":q,hex:G.base16,latin1:T,ascii:T,binary:T,...G};function pe(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?D(globalThis.Buffer.from(e,"utf-8")):n.decoder.decode(`${n.prefix}${e}`)}function ye(e,r="utf8"){const n=ee[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):n.encoder.encode(e).substring(1)}var H,N;function re(){if(N)return H;N=1;const e="Input must be an string, Buffer or Uint8Array";function r(u){let i;if(u instanceof Uint8Array)i=u;else if(typeof u=="string")i=new TextEncoder().encode(u);else throw new Error(e);return i}function n(u){return Array.prototype.map.call(u,function(i){return(i<16?"0":"")+i.toString(16)}).join("")}function b(u){return(4294967296+u).toString(16).substring(1)}function d(u,i,a){let w=`
2
2
  `+u+" = ";for(let p=0;p<i.length;p+=2){if(a===32)w+=b(i[p]).toUpperCase(),w+=" ",w+=b(i[p+1]).toUpperCase();else if(a===64)w+=b(i[p+1]).toUpperCase(),w+=b(i[p]).toUpperCase();else throw new Error("Invalid size "+a);p%6===4?w+=`
3
3
  `+new Array(u.length+4).join(" "):p<i.length-2&&(w+=" ")}console.log(w)}function s(u,i,a){let w=new Date().getTime();const p=new Uint8Array(i);for(let A=0;A<i;A++)p[A]=A%256;const x=new Date().getTime();console.log("Generated random input in "+(x-w)+"ms"),w=x;for(let A=0;A<a;A++){const m=u(p),l=new Date().getTime(),h=l-w;w=l,console.log("Hashed in "+h+"ms: "+m.substring(0,20)+"..."),console.log(Math.round(i/(1<<20)/(h/1e3)*100)/100+" MB PER SECOND")}}return H={normalizeInput:r,toHex:n,debugPrint:d,testSpeed:s},H}var C,O;function ue(){if(O)return C;O=1;const e=re();function r(t,c,o){const g=t[c]+t[o];let y=t[c+1]+t[o+1];g>=4294967296&&y++,t[c]=g,t[c+1]=y}function n(t,c,o,g){let y=t[c]+o;o<0&&(y+=4294967296);let U=t[c+1]+g;y>=4294967296&&U++,t[c]=y,t[c+1]=U}function b(t,c){return t[c]^t[c+1]<<8^t[c+2]<<16^t[c+3]<<24}function d(t,c,o,g,y,U){const ne=w[y],te=w[y+1],oe=w[U],ie=w[U+1];r(a,t,c),n(a,t,ne,te);let k=a[g]^a[t],E=a[g+1]^a[t+1];a[g]=E,a[g+1]=k,r(a,o,g),k=a[c]^a[o],E=a[c+1]^a[o+1],a[c]=k>>>24^E<<8,a[c+1]=E>>>24^k<<8,r(a,t,c),n(a,t,oe,ie),k=a[g]^a[t],E=a[g+1]^a[t+1],a[g]=k>>>16^E<<16,a[g+1]=E>>>16^k<<16,r(a,o,g),k=a[c]^a[o],E=a[c+1]^a[o+1],a[c]=E>>>31^k<<1,a[c+1]=k>>>31^E<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],i=new Uint8Array(u.map(function(t){return t*2})),a=new Uint32Array(32),w=new Uint32Array(32);function p(t,c){let o=0;for(o=0;o<16;o++)a[o]=t.h[o],a[o+16]=s[o];for(a[24]=a[24]^t.t,a[25]=a[25]^t.t/4294967296,c&&(a[28]=~a[28],a[29]=~a[29]),o=0;o<32;o++)w[o]=b(t.b,4*o);for(o=0;o<12;o++)d(0,8,16,24,i[o*16+0],i[o*16+1]),d(2,10,18,26,i[o*16+2],i[o*16+3]),d(4,12,20,28,i[o*16+4],i[o*16+5]),d(6,14,22,30,i[o*16+6],i[o*16+7]),d(0,10,20,30,i[o*16+8],i[o*16+9]),d(2,12,22,24,i[o*16+10],i[o*16+11]),d(4,14,16,26,i[o*16+12],i[o*16+13]),d(6,8,18,28,i[o*16+14],i[o*16+15]);for(o=0;o<16;o++)t.h[o]=t.h[o]^a[o]^a[o+16]}const x=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function A(t,c,o,g){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(c&&c.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(o&&o.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(g&&g.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const y={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};x.fill(0),x[0]=t,c&&(x[1]=c.length),x[2]=1,x[3]=1,o&&x.set(o,32),g&&x.set(g,48);for(let U=0;U<16;U++)y.h[U]=s[U]^b(x,U*4);return c&&(m(y,c),y.c=128),y}function m(t,c){for(let o=0;o<c.length;o++)t.c===128&&(t.t+=t.c,p(t,!1),t.c=0),t.b[t.c++]=c[o]}function l(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;p(t,!0);const c=new Uint8Array(t.outlen);for(let o=0;o<t.outlen;o++)c[o]=t.h[o>>2]>>8*(o&3);return c}function h(t,c,o,g,y){o=o||64,t=e.normalizeInput(t),g&&(g=e.normalizeInput(g)),y&&(y=e.normalizeInput(y));const U=A(o,c,g,y);return m(U,t),l(U)}function f(t,c,o,g,y){const U=h(t,c,o,g,y);return e.toHex(U)}return C={blake2b:h,blake2bHex:f,blake2bInit:A,blake2bUpdate:m,blake2bFinal:l},C}var M,z;function ce(){if(z)return M;z=1;const e=re();function r(l,h){return l[h]^l[h+1]<<8^l[h+2]<<16^l[h+3]<<24}function n(l,h,f,t,c,o){u[l]=u[l]+u[h]+c,u[t]=b(u[t]^u[l],16),u[f]=u[f]+u[t],u[h]=b(u[h]^u[f],12),u[l]=u[l]+u[h]+o,u[t]=b(u[t]^u[l],8),u[f]=u[f]+u[t],u[h]=b(u[h]^u[f],7)}function b(l,h){return l>>>h^l<<32-h}const d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),u=new Uint32Array(16),i=new Uint32Array(16);function a(l,h){let f=0;for(f=0;f<8;f++)u[f]=l.h[f],u[f+8]=d[f];for(u[12]^=l.t,u[13]^=l.t/4294967296,h&&(u[14]=~u[14]),f=0;f<16;f++)i[f]=r(l.b,4*f);for(f=0;f<10;f++)n(0,4,8,12,i[s[f*16+0]],i[s[f*16+1]]),n(1,5,9,13,i[s[f*16+2]],i[s[f*16+3]]),n(2,6,10,14,i[s[f*16+4]],i[s[f*16+5]]),n(3,7,11,15,i[s[f*16+6]],i[s[f*16+7]]),n(0,5,10,15,i[s[f*16+8]],i[s[f*16+9]]),n(1,6,11,12,i[s[f*16+10]],i[s[f*16+11]]),n(2,7,8,13,i[s[f*16+12]],i[s[f*16+13]]),n(3,4,9,14,i[s[f*16+14]],i[s[f*16+15]]);for(f=0;f<8;f++)l.h[f]^=u[f]^u[f+8]}function w(l,h){if(!(l>0&&l<=32))throw new Error("Incorrect output length, should be in [1, 32]");const f=h?h.length:0;if(h&&!(f>0&&f<=32))throw new Error("Incorrect key length, should be in [1, 32]");const t={h:new Uint32Array(d),b:new Uint8Array(64),c:0,t:0,outlen:l};return t.h[0]^=16842752^f<<8^l,f>0&&(p(t,h),t.c=64),t}function p(l,h){for(let f=0;f<h.length;f++)l.c===64&&(l.t+=l.c,a(l,!1),l.c=0),l.b[l.c++]=h[f]}function x(l){for(l.t+=l.c;l.c<64;)l.b[l.c++]=0;a(l,!0);const h=new Uint8Array(l.outlen);for(let f=0;f<l.outlen;f++)h[f]=l.h[f>>2]>>8*(f&3)&255;return h}function A(l,h,f){f=f||32,l=e.normalizeInput(l);const t=w(f,h);return p(t,l),x(t)}function m(l,h,f){const t=A(l,h,f);return e.toHex(t)}return M={blake2s:A,blake2sHex:m,blake2sInit:w,blake2sUpdate:p,blake2sFinal:x},M}var j,L;function de(){if(L)return j;L=1;const e=ue(),r=ce();return j={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:r.blake2s,blake2sHex:r.blake2sHex,blake2sInit:r.blake2sInit,blake2sUpdate:r.blake2sUpdate,blake2sFinal:r.blake2sFinal},j}var Ae=de();export{be as a,we as b,ge as c,Ae as d,pe as f,ye as t};
@@ -1,4 +1,4 @@
1
- import{w as f,i as w,b as l}from"./lit-element-B3y9oplH.js";import{n as o,o as y}from"./class-map-CxwNmq0D.js";import{c as v,U as $}from"./index-CkBDyoGg.js";import"./index-CZ1tNVf6.js";import{d as b,r as x,e as z}from"./index-b_a6Xe2g.js";import"./index-CwVjvkdk.js";const S=f`<svg width="86" height="96" fill="none">
1
+ import{w as f,i as w,b as l}from"./lit-element-B3y9oplH.js";import{n as o,o as y}from"./class-map-CxwNmq0D.js";import{c as v,U as $}from"./index-hwCoxi9L.js";import"./index-CpKxcKSt.js";import{d as b,r as x,e as z}from"./index-BUo3wAlN.js";import"./index-FvB9JTSh.js";const S=f`<svg width="86" height="96" fill="none">
2
2
  <path
3
3
  d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
4
4
  />
@@ -1,4 +1,4 @@
1
- import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-b_a6Xe2g.js";import{c as p,U as F}from"./index-CkBDyoGg.js";import"./index-CZ1tNVf6.js";import"./index-BJ-25Q5l.js";import"./index-CpqhaC2H.js";import{O as m,C as d,L as Ee,q as E,b as y,M as P,E as C,t as me,o as b,R as h,d as D,S as A,k as x,l as ze,W as Fe,ak as Xt,aj as he,a3 as J,a1 as qi,z as I,am as tt,A as _i,F as Ki,D as Gi,y as Xi,T as ft,V as Yt,X as Qt,a9 as Yi,ao as Qi,Z as Bt,ap as Ji}from"./W3MFrameProviderSingleton-D3RatyJZ.js";import"./index-CwVjvkdk.js";import{W as Fs,a as Ms}from"./index-gKwUmrp3.js";import"./index-DiOmLLPI.js";import"./index-xZ3i_Adn.js";import"./index-BFSsZJPW.js";import{au as S}from"./NetworkUtil-HlUKXKcF.js";import{H as Jt}from"./HelpersUtil-Bc_-rYa4.js";import{n as Zi}from"./index-CuPPMOVj.js";import{E as Q}from"./ExchangeController-BJ20Rri0.js";import"./index-DfTLbDYm.js";import"./index-B8zb5Fyq.js";import"./index-Cl-v7TvL.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-BZocXWA4.js";import{e as Zt,n as ei}from"./ref-BsAZ42-h.js";import"./index-CKEG3W2m.js";import"./index-NPIY1Vbs.js";import"./index-C0LSKXhw.js";import"./index-CzByZQWv.js";import{O as bt}from"./index-1c_qW8yi.js";import{e as en}from"./index-1koyBXBc.js";import"./index-DQ2sE8uD.js";import"./index-G1xB9dvf.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-Cw6mXTIQ.js";import"./index-yJi2QIJf.js";import"./react-vyZjIDcS.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./index-D7R57an8.js";import"./events-DQ172AOg.js";import"./index-CbITlqFn.js";import"./index-DgMAf2q5.js";import"./index-nibyPLVP.js";import"./index-C0odNd_G.js";import"./index.es-CZz1nBev.js";import"./browser-ponyfill-B4tSdV4O.js";import"./browser-ponyfill-BvriZgAo.js";import"./ConstantsUtil-Dfwpy1eP.js";import"./async-directive-BRxn_Py3.js";import"./browser-BGlawS--.js";const nn=v`
1
+ import{i as f,b as l,a as ee}from"./lit-element-B3y9oplH.js";import{n as c,o as w,r as u,a as Ii}from"./class-map-CxwNmq0D.js";import{d as v,r as _,e as W}from"./index-BUo3wAlN.js";import{c as p,U as F}from"./index-hwCoxi9L.js";import"./index-CpKxcKSt.js";import"./index-ldblNYIT.js";import"./index-DpjOr79p.js";import{O as m,C as d,L as Ee,q as E,b as y,M as P,E as C,t as me,o as b,R as h,d as D,S as A,k as x,l as ze,W as Fe,ak as Xt,aj as he,a3 as J,a1 as qi,z as I,am as tt,A as _i,F as Ki,D as Gi,y as Xi,T as ft,V as Yt,X as Qt,a9 as Yi,ao as Qi,Z as Bt,ap as Ji}from"./W3MFrameProviderSingleton-MrB8u6EW.js";import"./index-FvB9JTSh.js";import{W as Fs,a as Ms}from"./index-CvuWb2er.js";import"./index-CgOcSf2Q.js";import"./index-Bdx6vg6T.js";import"./index-CY9EBgzo.js";import{au as S}from"./NetworkUtil-HlUKXKcF.js";import{H as Jt}from"./HelpersUtil-CGxvruiS.js";import{n as Zi}from"./index-DfVobYmm.js";import{E as Q}from"./ExchangeController-DFaPYxag.js";import"./index-D6z3Iok7.js";import"./index-CsCFxm9l.js";import"./index-BHVh9ZD-.js";import{M as mt}from"./MathUtil-BGCe3rZ3.js";import"./index-BAORCNZn.js";import{e as Zt,n as ei}from"./ref-BsAZ42-h.js";import"./index-wfubccp5.js";import"./index-xk15qzPN.js";import"./index-DJGQazF5.js";import"./index-LL0BV6rh.js";import{O as bt}from"./index-DI-G5L8D.js";import{e as en}from"./index-Bb9TuCMN.js";import"./index-DA1IdQid.js";import"./index-BFzvJeyM.js";import{N as tn}from"./NavigationUtil-DmfK5sOV.js";import"./index-rFh28dtY.js";import"./index-BMIuNfCB.js";import"./react-vyZjIDcS.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./index-B439DG-9.js";import"./events-DQ172AOg.js";import"./index-n-ShiY2h.js";import"./index-DgMAf2q5.js";import"./index-nibyPLVP.js";import"./index-DNLfbOQJ.js";import"./index.es-BPA6fTzR.js";import"./browser-ponyfill-B4tSdV4O.js";import"./browser-ponyfill-BvriZgAo.js";import"./ConstantsUtil-Dfwpy1eP.js";import"./async-directive-BRxn_Py3.js";import"./browser-BGlawS--.js";const nn=v`
2
2
  :host {
3
3
  display: block;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{i as h,b as v}from"./lit-element-B3y9oplH.js";import{n as d}from"./class-map-CxwNmq0D.js";import"./index-CZ1tNVf6.js";import{d as m,r as f}from"./index-b_a6Xe2g.js";import{c as u,U as p}from"./index-CkBDyoGg.js";const g=m`
1
+ import{i as h,b as v}from"./lit-element-B3y9oplH.js";import{n as d}from"./class-map-CxwNmq0D.js";import"./index-CpKxcKSt.js";import{d as m,r as f}from"./index-BUo3wAlN.js";import{c as u,U as p}from"./index-hwCoxi9L.js";const g=m`
2
2
  :host {
3
3
  display: block;
4
4
  width: var(--local-width);
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-BbO8hggJ.js","assets/sentry-B35L1FdR.js","assets/react-vyZjIDcS.js"])))=>i.map(i=>d[i]);
2
- import{p as gt,b as Yt,i as Qt,I as Zt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as me,x as Z,y as le,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as K,a0 as _e,a1 as Bt,a2 as Re,a3 as qe,a4 as mt,a5 as Fe,a6 as Ue,a7 as Be,a8 as ke,a9 as Ne,aa as kt,ab as Le}from"./parseSignature-xro4_AeM.js";import{ac as Pr,ad as _r,ae as Rr,af as qr,ag as Fr,ah as Ur,ai as Br,aj as kr,ak as Nr,al as Lr,am as Mr,an as Dr,ao as zr,ap as Gr,aq as $r,ar as Hr,as as Or,at as jr,au as Wr,av as Vr,aw as Kr,ax as Jr,ay as Yr,az as Qr,aA as Zr,aB as Xr,aC as ts,aD as es,aE as as,aF as ns,aG as rs,aH as ss,aI as os,aJ as is,aK as cs,aL as us,aM as ds,aN as ms,aO as ls,aP as fs,aQ as hs,aR as ps,aS as ys,aT as gs,aU as bs,aV as ws,aW as xs,aX as Es,aY as Is,aZ as Ts,a_ as Cs,a$ as vs,b0 as Ss,b1 as As,b2 as Ps,b3 as _s,b4 as Rs,b5 as qs,b6 as Fs,b7 as Us,b8 as Bs,b9 as ks,ba as Ns,bb as Ls,bc as Ms,bd as Ds,be as zs,bf as Gs,bg as $s,bh as Hs,bi as Os,bj as js,bk as Ws,bl as Vs,bm as Ks,bn as Js,bo as Ys,bp as Qs,bq as Zs,br as Xs,bs as to,bt as eo,bu as ao,bv as no,bw as ro,bx as so,by as oo,bz as io,br as co,bA as uo,bB as mo,bC as lo,bD as fo,bE as ho,bF as po,bG as yo,bH as go,bH as bo,bI as wo,bJ as xo,bi as Eo,bj as Io,bK as To,bL as Co,bM as vo,bN as So,bO as Ao}from"./parseSignature-xro4_AeM.js";import{R as k,b3 as B,S as Me,x as Y,a7 as De,w as ze,b4 as Ge,U as H,V as ct,W as G,B as lt,q as E,E as $e,a2 as He,b5 as j,a1 as wt,G as Nt,b6 as Lt,d as Mt,A as R,m as F,b7 as A,C as Oe,I as je,b8 as We,b9 as xt,y as Ve,ba as Ke,bb as Je,bc as Ye,bd as Et}from"./prepare-contract-call-BreQKHF6.js";import{be as _o,O as Ro,a8 as qo,bf as Fo,bg as Uo,bh as Bo,bi as ko,bj as No,a9 as Lo,bk as Mo,J as Do,M as zo,bl as Go,bm as $o,bn as Ho,F as Oo,Q as jo,N as Wo,bo as Vo,bp as Ko,bq as Jo,br as Yo,bs as Qo,bt as Zo,bu as Xo,bv as ti,bw as ei,bx as ai,by as ni,bz as ri,bA as si,bB as oi,bC as ii,bD as ci,bE as ui,bF as di,bG as mi,bH as li,j as fi,bI as hi,bJ as pi,bK as yi,bL as gi,K as bi,bM as wi,t as xi,bM as Ei,bN as Ii,bO as Ti,bP as Ci,bQ as vi,bR as Si,bS as Ai,bT as Pi,bU as _i,K as Ri,bM as qi,bU as Fi,t as Ui,bM as Bi}from"./prepare-contract-call-BreQKHF6.js";import{u as ft}from"./to-serializable-transaction-DMc2E6fk.js";import{b as Ni,B as Li,C as Mi,D as Di,E as zi,m as Gi,n as $i,F as Hi,s as Oi,a as ji}from"./to-serializable-transaction-DMc2E6fk.js";import{w as Qe,h as Ze,g as Xe,v as ta,s as ea}from"./hashTypedData-Dz79Rf5q.js";import{I as Vi,a as Ki,b as Ji,d as Yi,c as Qi,e as Zi}from"./hashTypedData-Dz79Rf5q.js";import{T as aa,a as Q,W as It,b as na,U as ra,R as sa}from"./rpc-HxGwRhjl.js";import{A as tc,c as ec,B as ac,C as nc,D as rc,H as sc,I as oc,d as ic,e as cc,f as uc,J as dc,L as mc,M as lc,h as fc,P as hc,i as pc,j as yc,k as gc,l as bc,m as wc,S as xc,n as Ec,o as Ic,p as Tc,q as Cc,r as vc,s as Sc}from"./rpc-HxGwRhjl.js";import{_ as oa}from"./index-yJi2QIJf.js";import{t as ia,H as ca}from"./sha256-NdAeiB0X.js";import{b as Pc,h as _c,a as Rc,c as qc,d as Fc,e as Uc,f as Bc,g as kc,i as Nc,j as Lc,k as Mc,l as Dc,n as zc,o as Gc,p as $c,q as Hc,r as Oc,u as jc,v as Wc,w as Vc,x as Kc,y as Jc,z as Yc,A as Qc,B as Zc,C as Xc,D as tu,E as eu,F as au,G as nu,I as ru,J as su,K as ou,L as iu,M as cu,N as uu,O as du,P as mu,Q as lu,R as fu,S as hu,m as pu,T as yu,U as gu,V as bu,W as wu,X as xu,Y as Eu,Z as Iu,_ as Tu,$ as Cu,a0 as vu,a1 as Su,a2 as Au,a3 as Pu,a4 as _u,a5 as Ru,a6 as qu,a7 as Fu,a8 as Uu,a9 as Bu,aa as ku,ab as Nu,ac as Lu,ad as Mu,ae as Du,af as zu,ag as Gu,ah as $u,ai as Hu,aj as Ou,ak as ju,al as Wu,am as Vu,an as Ku,ao as Ju,ap as Yu,aq as Qu,ar as Zu,as as Xu,at as td,au as ed,av as ad,aw as nd,ax as rd,ay as sd,az as od,aA as id,aB as cd,aC as ud,aD as dd,aE as md,aF as ld,aG as fd,aH as hd,aI as pd,aJ as yd,aK as gd,s as bd}from"./sha256-NdAeiB0X.js";import{i as ht}from"./get-bytecode-Bg8NviKV.js";import{d as xd,a as Ed}from"./get-bytecode-Bg8NviKV.js";import{ccipRequest as Td,ccipRequest as Cd,offchainLookup as vd,offchainLookupAbiItem as Sd,offchainLookupSignature as Ad}from"./ccip-CZBbVQi3.js";import{d as _d,a as Rd,f as qd}from"./transactionReceipt-DFdTIN3F.js";import"./utils-jd03xFBb.js";import"./sentry-B35L1FdR.js";import"./react-vyZjIDcS.js";import"./transaction-8aHmZ7ni.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";function Qn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Qt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Zt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:l,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:l});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(m){throw te(m,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:l,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Zn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,l=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(l=!0),i&&f&&l)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),l&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:m,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Xn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=k(B(t.from));let a=k(t.nonce);return a[0]===0&&(a=new Uint8Array([])),B(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=k(B(t.from)),a=Me(Tt(t.salt)?t.salt:k(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:k(t.bytecodeHash):Y(t.bytecode,"bytes");return B(De(Y(ze([k("0xff"),e,a,n])),12))}function tr({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return ma(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new lt("Invalid RLP prefix")}function ma(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function la(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,l=this.h4|0,h=l;for(let o=0;o<5;o++){const p=4-o,m=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+m,C[x])+l|0;n=l,l=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+l+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function er(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?k(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let l=0;const{schedule:h}=ie({id:i,fn:async()=>{const m=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&l<d){if(b)return;b=!0,l++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else m.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of m.values())(v=S.onError)==null||v.call(S,new Q({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Q({url:s}));x()},onError(v){var P,S;w=v;for(const _ of m.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,l=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:m,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};m.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Qe(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:m,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function J(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-BbO8hggJ.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",l),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function l({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",l),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Q({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Q({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await J(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function ar(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function nr(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=me(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Z({hash:le(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Z({hash:Ze({domain:e,message:a,primaryType:n,types:s}),signature:r})}function rr(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function sr({address:t,hash:e,signature:a}){return ht(B(t),await Z({hash:e,signature:a}))}async function or({address:t,message:e,signature:a}){return ht(B(t),await Sa({message:e,signature:a}))}async function ir(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ht(B(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):Ba(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:l,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const m={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(m.to=d),E(u)&&u!=="0x"&&(m.gas=A(u)),E(i)&&i!=="0x"&&(m.data=i),E(n)&&(m.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(m.value=A(c)),E(s)&&s!=="0x"&&(m.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(m.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(m.accessList=tt(f)),l.length!==0&&l!=="0x"&&(m.authorizationList=ka(l)),we(m),{...e.length===13?O(e):void 0,...m}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,l,h,o,p,m,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:l,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:m,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(l)&&l!=="0x"&&(I.value=A(l)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:l,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:l,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function Ba(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const l={type:"legacy"};if(E(s)&&s!=="0x"&&(l.to=s),E(r)&&r!=="0x"&&(l.gas=A(r)),E(d)&&d!=="0x"&&(l.data=d),E(a)&&(l.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(l.value=A(u)),E(n)&&n!=="0x"&&(l.gasPrice=A(n)),xe(l),e.length===6)return l;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(l.chainId=Number(h)),l;const o=h,p=Number((o-35n)/2n);if(p>0)l.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return l.v=o,l.s=f,l.r=i,l.yParity=o%2n===0n?1:0,l}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>la(s)?s:We(s))})}return e}function ka(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends lt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function cr(t,e="wei"){return Wt(t,Ie[e])}function ur(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ka(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ja(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,m=(o||ft)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function Qa(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Za(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function mn(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function ln(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ka(a,n),revert:n=>Ja(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Qa(a,n),setBalance:n=>Za(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>mn(a,n),snapshot:()=>ln(a),stopImpersonatingAccount:n=>fn(a,n)}}}function dr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,l]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=l}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>B(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Ke(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:m,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new lt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ft)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Kt=pt?"wallet_sendTransaction":"eth_sendTransaction",Jt=await(async()=>{try{return await t.request({method:Kt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Jt,pollingInterval:p,timeout:C});if(m&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:m})}throw(b==null?void 0:b.type)==="smart"?new K({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new K({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof K?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new K({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await Bt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Je(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,l,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ft;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(l=t.chain)==null?void 0:l.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>Bt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function mr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function lr(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>mt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function fr(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...l})=>{let h=t,o=()=>{};const p=mt({key:a,name:n,async request({method:m,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...l,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:m,params:y});return o({method:m,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:m,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(m):v?!v.includes(m):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:m=>o=m,transports:h.map(m=>m({chain:c,retryCount:0}))});if(r){const m=typeof r=="object"?r:{};Un({chain:c,interval:m.interval??i,onTransports:y=>h=y,ping:m.ping,sampleCount:m.sampleCount,timeout:m.timeout,transports:h,weights:m.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],l=async()=>{const h=await Promise.all(u.map(async m=>{const y=m({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(m=>Math.max(...m.map(({latency:y})=>y)))),p=u.map((m,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((m,y)=>y[0]-m[0]);a(p.map(([,m])=>u[m])),await Ue(e),l()};l()}function hr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var m;const l=e.retryCount??i,h=f??e.timeout??1e4,o=t||((m=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:m[0]),p={keepAlive:a,reconnect:u};if(!o)throw new Be;return mt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await J(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:l,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return J(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await J(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class pr extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function yr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function gr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const l=c.readByte();if(l===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(l)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function br(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(ke({commitment:s,to:n,version:a}));return r}const Bn=2147483648;function wr(t){if(t===1)return 60n;if(t>=Bn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function kn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function xr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return kn(t)}function Er({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function Ir(t){const{r:e,s:a}=kt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function Tr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Z({hash:Y(s),signature:r})}function Cr({r:t,yParityAndS:e}){return`0x${new kt.Signature(A(t),A(e)).toCompactHex()}`}function vr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,_o as AbiDecodingDataSizeInvalidError,Ro as AbiDecodingDataSizeTooSmallError,qo as AbiDecodingZeroDataError,Fo as AbiEncodingArrayLengthMismatchError,Uo as AbiEncodingBytesSizeMismatchError,Bo as AbiEncodingLengthMismatchError,ko as AbiErrorInputsNotFoundError,No as AbiErrorNotFoundError,Lo as AbiErrorSignatureNotFoundError,Mo as AbiEventNotFoundError,Do as AbiEventSignatureEmptyTopicsError,zo as AbiEventSignatureNotFoundError,Go as AbiFunctionNotFoundError,$o as AbiFunctionOutputsNotFoundError,Ho as AbiFunctionSignatureNotFoundError,Pr as AccountStateConflictError,tc as AtomicReadyWalletRejectedUpgradeError,ec as AtomicityNotSupportedError,lt as BaseError,_r as BaseFeeScalarError,Rr as BlockNotFoundError,qr as BundleFailedError,ac as BundleTooLargeError,Oo as BytesSizeMismatchError,Fr as CallExecutionError,nc as ChainDisconnectedError,Ur as ChainDoesNotSupportContract,Br as ChainMismatchError,kr as ChainNotFoundError,Nr as CircularReferenceError,Lr as ClientChainNotConfiguredError,Mr as ContractFunctionExecutionError,Dr as ContractFunctionRevertedError,zr as ContractFunctionZeroDataError,Gr as CounterfactualDeploymentFailedError,jo as DecodeLogDataMismatch,Wo as DecodeLogTopicsMismatch,rc as DuplicateIdError,pr as EIP1193ProviderRpcError,$r as Eip1559FeesNotSupportedError,Hr as EnsAvatarInvalidNftUriError,Or as EnsAvatarUnsupportedNamespaceError,jr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,Wr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Vr as FeeCapTooHighError,Kr as FeeCapTooLowError,Jr as FeeConflictError,Vo as FilterTypeNotSupportedError,sc as HttpRequestError,Yr as InsufficientFundsError,Ko as IntegerOutOfRangeError,oc as InternalRpcError,Qr as IntrinsicGasTooHighError,Zr as IntrinsicGasTooLowError,Jo as InvalidAbiDecodingTypeError,Yo as InvalidAbiEncodingTypeError,Xr as InvalidAbiItemError,Zt as InvalidAbiParameterError,ts as InvalidAbiParametersError,es as InvalidAbiTypeParameterError,je as InvalidAddressError,Qo as InvalidArrayError,Zo as InvalidBytesBooleanError,as as InvalidChainIdError,Na as InvalidDecimalNumberError,Xo as InvalidDefinitionTypeError,Vi as InvalidDomainError,ns as InvalidFunctionModifierError,ti as InvalidHexBooleanError,Ge as InvalidHexValueError,ic as InvalidInputRpcError,Ee as InvalidLegacyVError,rs as InvalidModifierError,ss as InvalidParameterError,cc as InvalidParamsRpcError,os as InvalidParenthesisError,Ki as InvalidPrimaryTypeError,uc as InvalidRequestRpcError,is as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,cs as InvalidSignatureError,us as InvalidStorageKeySizeError,ds as InvalidStructSignatureError,Ji as InvalidStructTypeError,dc as JsonRpcVersionUnsupportedError,mc as LimitExceededRpcError,ms as MaxFeePerGasTooLowError,lc as MethodNotFoundRpcError,fc as MethodNotSupportedRpcError,ls as NonceMaxValueError,fs as NonceTooHighError,hs as NonceTooLowError,hc as ParseRpcError,pc as ProviderDisconnectedError,yc as ProviderRpcError,ps as RawContractError,gc as ResourceNotFoundRpcError,bc as ResourceUnavailableRpcError,wc as RpcError,sa as RpcRequestError,ei as SizeExceedsPaddingSizeError,ai as SizeOverflowError,ni as SliceOffsetOutOfBoundsError,Q as SocketClosedError,ys as SolidityProtectedKeywordError,gs as StateAssignmentConflictError,xc as SwitchChainError,aa as TimeoutError,bs as TipAboveFeeCapError,ws as TransactionExecutionError,xs as TransactionNotFoundError,Es as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,Is as TransactionTypeNotSupportedError,Ec as UnauthorizedProviderError,Ic as UnknownBundleIdError,Ts as UnknownNodeError,Tc as UnknownRpcError,Cs as UnknownSignatureError,vs as UnknownTypeError,Cc as UnsupportedChainIdError,vc as UnsupportedNonOptionalCapabilityError,ri as UnsupportedPackedAbiType,Sc as UnsupportedProviderMethodError,Be as UrlRequiredError,ra as UserRejectedRequestError,Ss as WaitForCallsStatusTimeoutError,As as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Ps as blobsToCommitments,_s as blobsToProofs,si as boolToBytes,oi as boolToHex,ii as bytesToBigInt,ci as bytesToBool,G as bytesToHex,ui as bytesToNumber,Pc as bytesToRlp,di as bytesToString,Td as ccipFetch,Cd as ccipRequest,Ve as checksumAddress,ke as commitmentToVersionedHash,Rs as commitmentsToVersionedHashes,Cr as compactSignatureToHex,Er as compactSignatureToSignature,ze as concat,mi as concatBytes,li as concatHex,At as createClient,qs as createNonceManager,Fs as createPublicClient,dr as createTestClient,mt as createTransport,mr as createWalletClient,lr as custom,Mt as decodeAbiParameters,yr as decodeDeployData,Ni as decodeErrorResult,xd as decodeEventLog,Us as decodeFunctionData,Bs as decodeFunctionResult,Li as defineBlock,Mi as defineChain,kn as defineKzg,Di as defineTransaction,_d as defineTransactionReceipt,zi as defineTransactionRequest,ks as deploylessCallViaBytecodeBytecode,Ns as deploylessCallViaFactoryBytecode,Yi as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,Ls as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Ms as encodeFunctionResult,Ds as encodePacked,zs as erc1155Abi,Gs as erc20Abi,$s as erc20Abi_bytes32,Hs as erc4626Abi,Os as erc6492SignatureValidatorAbi,js as erc6492SignatureValidatorByteCode,Ws as erc721Abi,Vs as ethAddress,Ie as etherUnits,tr as extractChain,fr as fallback,Gi as formatBlock,Ks as formatEther,Js as formatGwei,Rd as formatLog,$i as formatTransaction,qd as formatTransactionReceipt,ft as formatTransactionRequest,Ys as formatUnits,gr as fromBlobs,pi as fromBytes,yi as fromHex,Dt as fromRlp,gi as getAbiItem,B as getAddress,Qs as getChainContractAddress,Zn as getContract,Xn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,bi as getEventSelector,wi as getEventSignature,xi as getFunctionSelector,Ei as getFunctionSignature,Pa as getSerializedTransactionType,Zs as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Qi as hashDomain,le as hashMessage,Zi as hashStruct,Ze as hashTypedData,A as hexToBigInt,Ii as hexToBool,H as hexToBytes,Ir as hexToCompactSignature,F as hexToNumber,_c as hexToRlp,Xs as hexToSignature,Ti as hexToString,to as http,Oe as isAddress,ht as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,la as isHash,E as isHex,Y as keccak256,eo as labelhash,Rc as maxInt104,qc as maxInt112,Fc as maxInt120,Uc as maxInt128,Bc as maxInt136,kc as maxInt144,Nc as maxInt152,Lc as maxInt16,Mc as maxInt160,Dc as maxInt168,zc as maxInt176,Gc as maxInt184,$c as maxInt192,Hc as maxInt200,Oc as maxInt208,jc as maxInt216,Wc as maxInt224,Vc as maxInt232,Kc as maxInt24,Jc as maxInt240,Yc as maxInt248,Qc as maxInt256,Zc as maxInt32,Xc as maxInt40,tu as maxInt48,eu as maxInt56,au as maxInt64,nu as maxInt72,ru as maxInt8,su as maxInt80,ou as maxInt88,iu as maxInt96,cu as maxUint104,uu as maxUint112,du as maxUint120,mu as maxUint128,lu as maxUint136,fu as maxUint144,hu as maxUint152,pu as maxUint16,yu as maxUint160,gu as maxUint168,bu as maxUint176,wu as maxUint184,xu as maxUint192,Eu as maxUint200,Iu as maxUint208,Tu as maxUint216,Cu as maxUint224,vu as maxUint232,Su as maxUint24,Au as maxUint240,Pu as maxUint248,_u as maxUint256,Ru as maxUint32,qu as maxUint40,Fu as maxUint48,Uu as maxUint56,Bu as maxUint64,ku as maxUint72,Nu as maxUint8,Lu as maxUint80,Mu as maxUint88,Du as maxUint96,zu as minInt104,Gu as minInt112,$u as minInt120,Hu as minInt128,Ou as minInt136,ju as minInt144,Wu as minInt152,Vu as minInt16,Ku as minInt160,Ju as minInt168,Yu as minInt176,Qu as minInt184,Zu as minInt192,Xu as minInt200,td as minInt208,ed as minInt216,ad as minInt224,nd as minInt232,rd as minInt24,sd as minInt240,od as minInt248,id as minInt256,cd as minInt32,ud as minInt40,dd as minInt48,md as minInt56,ld as minInt64,fd as minInt72,hd as minInt8,pd as minInt80,yd as minInt88,gd as minInt96,ao as multicall3Abi,no as namehash,ro as nonceManager,Ci as numberToBytes,R as numberToHex,vd as offchainLookup,Sd as offchainLookupAbiItem,Ad as offchainLookupSignature,Me as pad,vi as padBytes,xt as padHex,so as parseAbi,oo as parseAbiItem,Qn as parseAbiParameter,io as parseAbiParameters,Ir as parseCompactSignature,ar as parseErc6492Signature,nr as parseErc8010Signature,cr as parseEther,Ed as parseEventLogs,ur as parseGwei,co as parseSignature,_a as parseTransaction,Wt as parseUnits,uo as prepareEncodeFunctionData,mo as presignMessagePrefix,lo as publicActions,Z as recoverAddress,Sa as recoverMessageAddress,fo as recoverPublicKey,Tr as recoverTransactionAddress,Aa as recoverTypedDataAddress,er as ripemd160,ho as rpcSchema,Hi as rpcTransactionType,po as serializeAccessList,Cr as serializeCompactSignature,yo as serializeErc6492Signature,rr as serializeErc8010Signature,go as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Si as setErrorConfig,xr as setupKzg,bd as sha256,Fn as shouldThrow,br as sidecarsToVersionedHashes,vr as signatureToCompactSignature,bo as signatureToHex,$e as size,De as slice,Ai as sliceBytes,Lt as sliceHex,Pi as stringToBytes,Je as stringToHex,Oi as stringify,hn as testActions,ge as toBlobSidecars,wo as toBlobs,k as toBytes,wr as toCoinType,_i as toEventHash,Ri as toEventSelector,qi as toEventSignature,Fi as toFunctionHash,Ui as toFunctionSelector,Bi as toFunctionSignature,Nt as toHex,xo as toPrefixedMessage,ia as toRlp,ji as transactionType,We as trim,Eo as universalSignatureValidatorAbi,Io as universalSignatureValidatorByteCode,ta as validateTypedData,sr as verifyHash,or as verifyMessage,ir as verifyTypedData,qn as walletActions,hr as webSocket,To as weiUnits,Co as withCache,vo as withRetry,Qe as withTimeout,So as zeroAddress,Ao as zeroHash};
2
+ import{p as gt,b as Yt,i as Qt,I as Zt,m as bt,s as ut,A as D,e as Xt,g as U,d as te,f as N,r as ee,h as ae,j as ne,k as re,w as se,n as oe,o as ie,q as ce,t as ue,v as de,u as me,x as Z,y as le,z as fe,B as he,C as $,D as pe,E as ye,F as ge,G as be,H as we,J as xe,K as Ee,L as Ie,M as Te,N as St,O as At,P as Ce,Q as Pt,R as _t,S as Rt,T as ve,U as dt,V as qt,W as Se,X as Ae,Y as Ft,Z as Pe,_ as Ut,$ as K,a0 as _e,a1 as Bt,a2 as Re,a3 as qe,a4 as mt,a5 as Fe,a6 as Ue,a7 as Be,a8 as ke,a9 as Ne,aa as kt,ab as Le}from"./parseSignature--WNVOXAe.js";import{ac as Pr,ad as _r,ae as Rr,af as qr,ag as Fr,ah as Ur,ai as Br,aj as kr,ak as Nr,al as Lr,am as Mr,an as Dr,ao as zr,ap as Gr,aq as $r,ar as Hr,as as Or,at as jr,au as Wr,av as Vr,aw as Kr,ax as Jr,ay as Yr,az as Qr,aA as Zr,aB as Xr,aC as ts,aD as es,aE as as,aF as ns,aG as rs,aH as ss,aI as os,aJ as is,aK as cs,aL as us,aM as ds,aN as ms,aO as ls,aP as fs,aQ as hs,aR as ps,aS as ys,aT as gs,aU as bs,aV as ws,aW as xs,aX as Es,aY as Is,aZ as Ts,a_ as Cs,a$ as vs,b0 as Ss,b1 as As,b2 as Ps,b3 as _s,b4 as Rs,b5 as qs,b6 as Fs,b7 as Us,b8 as Bs,b9 as ks,ba as Ns,bb as Ls,bc as Ms,bd as Ds,be as zs,bf as Gs,bg as $s,bh as Hs,bi as Os,bj as js,bk as Ws,bl as Vs,bm as Ks,bn as Js,bo as Ys,bp as Qs,bq as Zs,br as Xs,bs as to,bt as eo,bu as ao,bv as no,bw as ro,bx as so,by as oo,bz as io,br as co,bA as uo,bB as mo,bC as lo,bD as fo,bE as ho,bF as po,bG as yo,bH as go,bH as bo,bI as wo,bJ as xo,bi as Eo,bj as Io,bK as To,bL as Co,bM as vo,bN as So,bO as Ao}from"./parseSignature--WNVOXAe.js";import{R as k,b3 as B,S as Me,x as Y,a7 as De,w as ze,b4 as Ge,U as H,V as ct,W as G,B as lt,q as E,E as $e,a2 as He,b5 as j,a1 as wt,G as Nt,b6 as Lt,d as Mt,A as R,m as F,b7 as A,C as Oe,I as je,b8 as We,b9 as xt,y as Ve,ba as Ke,bb as Je,bc as Ye,bd as Et}from"./prepare-contract-call-BreQKHF6.js";import{be as _o,O as Ro,a8 as qo,bf as Fo,bg as Uo,bh as Bo,bi as ko,bj as No,a9 as Lo,bk as Mo,J as Do,M as zo,bl as Go,bm as $o,bn as Ho,F as Oo,Q as jo,N as Wo,bo as Vo,bp as Ko,bq as Jo,br as Yo,bs as Qo,bt as Zo,bu as Xo,bv as ti,bw as ei,bx as ai,by as ni,bz as ri,bA as si,bB as oi,bC as ii,bD as ci,bE as ui,bF as di,bG as mi,bH as li,j as fi,bI as hi,bJ as pi,bK as yi,bL as gi,K as bi,bM as wi,t as xi,bM as Ei,bN as Ii,bO as Ti,bP as Ci,bQ as vi,bR as Si,bS as Ai,bT as Pi,bU as _i,K as Ri,bM as qi,bU as Fi,t as Ui,bM as Bi}from"./prepare-contract-call-BreQKHF6.js";import{u as ft}from"./to-serializable-transaction-BZX746C8.js";import{b as Ni,B as Li,C as Mi,D as Di,E as zi,m as Gi,n as $i,F as Hi,s as Oi,a as ji}from"./to-serializable-transaction-BZX746C8.js";import{w as Qe,h as Ze,g as Xe,v as ta,s as ea}from"./hashTypedData-BmEKHoZL.js";import{I as Vi,a as Ki,b as Ji,d as Yi,c as Qi,e as Zi}from"./hashTypedData-BmEKHoZL.js";import{T as aa,a as Q,W as It,b as na,U as ra,R as sa}from"./rpc-D2C2velX.js";import{A as tc,c as ec,B as ac,C as nc,D as rc,H as sc,I as oc,d as ic,e as cc,f as uc,J as dc,L as mc,M as lc,h as fc,P as hc,i as pc,j as yc,k as gc,l as bc,m as wc,S as xc,n as Ec,o as Ic,p as Tc,q as Cc,r as vc,s as Sc}from"./rpc-D2C2velX.js";import{_ as oa}from"./index-BMIuNfCB.js";import{t as ia,H as ca}from"./sha256-NdAeiB0X.js";import{b as Pc,h as _c,a as Rc,c as qc,d as Fc,e as Uc,f as Bc,g as kc,i as Nc,j as Lc,k as Mc,l as Dc,n as zc,o as Gc,p as $c,q as Hc,r as Oc,u as jc,v as Wc,w as Vc,x as Kc,y as Jc,z as Yc,A as Qc,B as Zc,C as Xc,D as tu,E as eu,F as au,G as nu,I as ru,J as su,K as ou,L as iu,M as cu,N as uu,O as du,P as mu,Q as lu,R as fu,S as hu,m as pu,T as yu,U as gu,V as bu,W as wu,X as xu,Y as Eu,Z as Iu,_ as Tu,$ as Cu,a0 as vu,a1 as Su,a2 as Au,a3 as Pu,a4 as _u,a5 as Ru,a6 as qu,a7 as Fu,a8 as Uu,a9 as Bu,aa as ku,ab as Nu,ac as Lu,ad as Mu,ae as Du,af as zu,ag as Gu,ah as $u,ai as Hu,aj as Ou,ak as ju,al as Wu,am as Vu,an as Ku,ao as Ju,ap as Yu,aq as Qu,ar as Zu,as as Xu,at as td,au as ed,av as ad,aw as nd,ax as rd,ay as sd,az as od,aA as id,aB as cd,aC as ud,aD as dd,aE as md,aF as ld,aG as fd,aH as hd,aI as pd,aJ as yd,aK as gd,s as bd}from"./sha256-NdAeiB0X.js";import{i as ht}from"./get-bytecode-Bg8NviKV.js";import{d as xd,a as Ed}from"./get-bytecode-Bg8NviKV.js";import{ccipRequest as Td,ccipRequest as Cd,offchainLookup as vd,offchainLookupAbiItem as Sd,offchainLookupSignature as Ad}from"./ccip-zHeTh1U3.js";import{d as _d,a as Rd,f as qd}from"./transactionReceipt-2D5Q3zvv.js";import"./utils-jd03xFBb.js";import"./sentry-B35L1FdR.js";import"./react-vyZjIDcS.js";import"./transaction-8aHmZ7ni.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";function Qn(t){let e;if(typeof t=="string")e=gt(t,{modifiers:bt});else{const a=Yt(t),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(!Qt(s)){e=gt(s,{modifiers:bt,structs:a});break}}}if(!e)throw new Zt({param:t});return e}async function M(t,e){return M.internal(t,ut,"sendTransaction",e)}(function(t){async function e(a,n,r,s){const{abi:u,account:d=a.account,address:c,args:i,dataSuffix:f,functionName:l,...h}=s;if(typeof d>"u")throw new D({docsPath:"/docs/contract/writeContract"});const o=d?N(d):null,p=Xt({abi:u,args:i,functionName:l});try{return await U(a,n,r)({data:`${p}${f?f.replace("0x",""):""}`,to:c,account:o,...h})}catch(m){throw te(m,{abi:u,address:c,args:i,docsPath:"/docs/contract/writeContract",functionName:l,sender:o==null?void 0:o.address})}}t.internal=e})(M||(M={}));function Zn({abi:t,address:e,client:a}){const n=a,[r,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],u=r!=null,d=s!=null,c={};let i=!1,f=!1,l=!1;for(const h of t)if(h.type==="function"?h.stateMutability==="view"||h.stateMutability==="pure"?i=!0:f=!0:h.type==="event"&&(l=!0),i&&f&&l)break;return u&&(i&&(c.read=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ee,"readContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),f&&(c.simulate=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r,ae,"simulateContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),l&&(c.createEventFilter=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,ne,"createContractEventFilter")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.getEvents=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,re,"getContractEvents")({abi:t,address:e,eventName:o,args:y,...w})}}}),c.watchEvent=new Proxy({},{get(h,o){return(...p)=>{const m=t.find(g=>g.type==="event"&&g.name===o),{args:y,options:w}=rt(p,m);return U(r,se,"watchContractEvent")({abi:t,address:e,eventName:o,args:y,...w})}}}))),d&&f&&(c.write=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(s,M,"writeContract")({abi:t,address:e,functionName:o,args:m,...y})}}})),(u||d)&&f&&(c.estimateGas=new Proxy({},{get(h,o){return(...p)=>{const{args:m,options:y}=W(p);return U(r??s,oe,"estimateContractGas")({abi:t,address:e,functionName:o,args:m,...y,account:y.account??s.account})}}})),c.address=e,c.abi=t,c}function W(t){const e=t.length&&Array.isArray(t[0]),a=e?t[0]:[],n=(e?t[1]:t[0])??{};return{args:a,options:n}}function rt(t,e){let a=!1;Array.isArray(t[0])?a=!0:t.length===1?a=e.inputs.some(s=>s.indexed):t.length===2&&(a=!0);const n=a?t[0]:void 0,r=(a?t[1]:t[0])??{};return{args:n,options:r}}function Tt(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}function Xn(t){return t.opcode==="CREATE2"?da(t):ua(t)}function ua(t){const e=k(B(t.from));let a=k(t.nonce);return a[0]===0&&(a=new Uint8Array([])),B(`0x${Y(ia([e,a],"bytes")).slice(26)}`)}function da(t){const e=k(B(t.from)),a=Me(Tt(t.salt)?t.salt:k(t.salt),{size:32}),n="bytecodeHash"in t?Tt(t.bytecodeHash)?t.bytecodeHash:k(t.bytecodeHash):Y(t.bytecode,"bytes");return B(De(Y(ze([k("0xff"),e,a,n])),12))}function tr({chains:t,id:e}){return t.find(a=>a.id===e)}function Dt(t,e="hex"){const a=(()=>{if(typeof t=="string"){if(t.length>3&&t.length%2!==0)throw new Ge(t);return H(t)}return t})(),n=ct(a,{recursiveReadLimit:Number.POSITIVE_INFINITY});return zt(n,e)}function zt(t,e="hex"){if(t.bytes.length===0)return e==="hex"?G(t.bytes):t.bytes;const a=t.readByte();if(a<128&&t.decrementPosition(1),a<192){const r=Ct(t,a,128),s=t.readBytes(r);return e==="hex"?G(s):s}const n=Ct(t,a,192);return ma(t,n,e)}function Ct(t,e,a){if(a===128&&e<128)return 1;if(e<=a+55)return e-a;if(e===a+55+1)return t.readUint8();if(e===a+55+2)return t.readUint16();if(e===a+55+3)return t.readUint24();if(e===a+55+4)return t.readUint32();throw new lt("Invalid RLP prefix")}function ma(t,e,a){const n=t.position,r=[];for(;t.position-n<e;)r.push(zt(t,a));return r}function la(t){return E(t)&&$e(t)===32}const fa=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Gt=Uint8Array.from(new Array(16).fill(0).map((t,e)=>e)),ha=Gt.map(t=>(9*t+5)%16),$t=(()=>{const a=[[Gt],[ha]];for(let n=0;n<4;n++)for(let r of a)r.push(r[n].map(s=>fa[s]));return a})(),Ht=$t[0],Ot=$t[1],jt=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>Uint8Array.from(t)),pa=Ht.map((t,e)=>t.map(a=>jt[e][a])),ya=Ot.map((t,e)=>t.map(a=>jt[e][a])),ga=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),ba=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function vt(t,e,a,n){return t===0?e^a^n:t===1?e&a|~e&n:t===2?(e|~a)^n:t===3?e&n|a&~n:e^(a|~n)}const V=new Uint32Array(16);class wa extends ca{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:a,h2:n,h3:r,h4:s}=this;return[e,a,n,r,s]}set(e,a,n,r,s){this.h0=e|0,this.h1=a|0,this.h2=n|0,this.h3=r|0,this.h4=s|0}process(e,a){for(let o=0;o<16;o++,a+=4)V[o]=e.getUint32(a,!0);let n=this.h0|0,r=n,s=this.h1|0,u=s,d=this.h2|0,c=d,i=this.h3|0,f=i,l=this.h4|0,h=l;for(let o=0;o<5;o++){const p=4-o,m=ga[o],y=ba[o],w=Ht[o],g=Ot[o],C=pa[o],b=ya[o];for(let x=0;x<16;x++){const I=j(n+vt(o,s,d,i)+V[w[x]]+m,C[x])+l|0;n=l,l=i,i=j(d,10)|0,d=s,s=I}for(let x=0;x<16;x++){const I=j(r+vt(p,u,c,f)+V[g[x]]+y,b[x])+h|0;r=h,h=f,f=j(c,10)|0,c=u,u=I}}this.set(this.h1+d+f|0,this.h2+i+h|0,this.h3+l+r|0,this.h4+n+u|0,this.h0+s+c|0)}roundClean(){wt(V)}destroy(){this.destroyed=!0,wt(this.buffer),this.set(0,0,0,0,0)}}const xa=He(()=>new wa),Ea=xa;function er(t,e){const a=e||"hex",n=Ea(E(t,{strict:!1})?k(t):t);return a==="bytes"?n:Nt(n)}const st=new Map;async function Ia(t){const{getSocket:e,keepAlive:a=!0,key:n="socket",reconnect:r=!0,url:s}=t,{interval:u=3e4}=typeof a=="object"?a:{},{attempts:d=5,delay:c=2e3}=typeof r=="object"?r:{},i=JSON.stringify({keepAlive:a,key:n,url:s,reconnect:r});let f=st.get(i);if(f)return f;let l=0;const{schedule:h}=ie({id:i,fn:async()=>{const m=new Map,y=new Map;let w,g,C,b=!1;function x(){if(r&&l<d){if(b)return;b=!0,l++,g==null||g.close(),setTimeout(async()=>{await I().catch(console.error),b=!1},c)}else m.clear(),y.clear()}async function I(){const T=await e({onClose(){var v,P;for(const S of m.values())(v=S.onError)==null||v.call(S,new Q({url:s}));for(const S of y.values())(P=S.onError)==null||P.call(S,new Q({url:s}));x()},onError(v){var P,S;w=v;for(const _ of m.values())(P=_.onError)==null||P.call(_,w);for(const _ of y.values())(S=_.onError)==null||S.call(_,w);x()},onOpen(){w=void 0,l=0},onResponse(v){const P=v.method==="eth_subscription",S=P?v.params.subscription:v.id,_=P?y:m,q=_.get(S);q&&q.onResponse(v),P||_.delete(S)}});if(g=T,a&&(C&&clearInterval(C),C=setInterval(()=>{var v;return(v=g.ping)==null?void 0:v.call(g)},u)),r&&y.size>0){const v=y.entries();for(const[P,{onResponse:S,body:_,onError:q}]of v)_&&(y.delete(P),f==null||f.request({body:_,onResponse:S,onError:q}))}return T}return await I(),w=void 0,f={close(){C&&clearInterval(C),g.close(),st.delete(i)},get socket(){return g},request({body:T,onError:v,onResponse:P}){w&&v&&v(w);const S=T.id??ce.take(),_=q=>{var z;typeof q.id=="number"&&S!==q.id||(T.method==="eth_subscribe"&&typeof q.result=="string"&&y.set(q.result,{onResponse:_,onError:v,body:T}),T.method==="eth_unsubscribe"&&y.delete((z=T.params)==null?void 0:z[0]),P(q))};m.set(S,{onResponse:_,onError:v});try{g.request({body:{jsonrpc:"2.0",id:S,...T}})}catch(q){v==null||v(q)}},requestAsync({body:T,timeout:v=1e4}){return Qe(()=>new Promise((P,S)=>this.request({body:T,onError:S,onResponse:P})),{errorInstance:new aa({body:T,url:s}),timeout:v})},requests:m,subscriptions:y,url:s},st.set(i,f),[f]}}),[o,[p]]=await h();return p}async function J(t,e={}){const{keepAlive:a,reconnect:n}=e;return Ia({async getSocket({onClose:r,onError:s,onOpen:u,onResponse:d}){const c=await oa(()=>import("./native-BbO8hggJ.js").then(o=>o.n),__vite__mapDeps([0,1,2])).then(o=>o.WebSocket),i=new c(t);function f(){i.removeEventListener("close",f),i.removeEventListener("message",l),i.removeEventListener("error",s),i.removeEventListener("open",u),r()}function l({data:o}){if(!(typeof o=="string"&&o.trim().length===0))try{const p=JSON.parse(o);d(p)}catch(p){s(p)}}i.addEventListener("close",f),i.addEventListener("message",l),i.addEventListener("error",s),i.addEventListener("open",u),i.readyState===c.CONNECTING&&await new Promise((o,p)=>{i&&(i.onopen=o,i.onerror=p)});const{close:h}=i;return Object.assign(i,{close(){h.bind(i)(),f()},ping(){try{if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({url:i.url,cause:new Q({url:i.url})});const o={jsonrpc:"2.0",id:null,method:"net_version",params:[]};i.send(JSON.stringify(o))}catch(o){s(o)}},request({body:o}){if(i.readyState===i.CLOSED||i.readyState===i.CLOSING)throw new It({body:o,url:i.url,cause:new Q({url:i.url})});return i.send(JSON.stringify(o))}})},keepAlive:a,reconnect:n,url:t})}async function Ta(t){const e=await J(t);return Object.assign(e.socket,{requests:e.requests,subscriptions:e.subscriptions})}function Ca(t){return Lt(t,-32)===ue}function va(t){return de(t)}function ar(t){if(!Ca(t))return{signature:t};const[e,a,n]=Mt([{type:"address"},{type:"bytes"},{type:"bytes"}],t);return{address:e,data:a,signature:n}}function nr(t){if(!va(t))return{signature:t};const{authorization:e,to:a,...n}=me(t);return{authorization:{address:e.address,chainId:e.chainId,nonce:Number(e.nonce),r:R(e.r,{size:32}),s:R(e.s,{size:32}),yParity:e.yParity},...a?{address:a}:{},...n}}async function Sa({message:t,signature:e}){return Z({hash:le(t),signature:e})}async function Aa(t){const{domain:e,message:a,primaryType:n,signature:r,types:s}=t;return Z({hash:Ze({domain:e,message:a,primaryType:n,types:s}),signature:r})}function rr(t){const{address:e,data:a,signature:n,to:r="hex"}=t,s=fe({authorization:{address:t.authorization.address,chainId:t.authorization.chainId,nonce:BigInt(t.authorization.nonce),r:BigInt(t.authorization.r),s:BigInt(t.authorization.s),yParity:t.authorization.yParity},data:a,signature:n,to:e});return r==="hex"?s:H(s)}async function sr({address:t,hash:e,signature:a}){return ht(B(t),await Z({hash:e,signature:a}))}async function or({address:t,message:e,signature:a}){return ht(B(t),await Sa({message:e,signature:a}))}async function ir(t){const{address:e,domain:a,message:n,primaryType:r,signature:s,types:u}=t;return ht(B(e),await Aa({domain:a,message:n,primaryType:r,signature:s,types:u}))}function Pa(t){const e=Lt(t,0,1);if(e==="0x04")return"eip7702";if(e==="0x03")return"eip4844";if(e==="0x02")return"eip1559";if(e==="0x01")return"eip2930";if(e!=="0x"&&F(e)>=192)return"legacy";throw new he({serializedType:e})}function _a(t){const e=Pa(t);return e==="eip1559"?Fa(t):e==="eip2930"?Ua(t):e==="eip4844"?qa(t):e==="eip7702"?Ra(t):Ba(t)}function Ra(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o,p]=e;if(e.length!==10&&e.length!==13)throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,authorizationList:l,...e.length>9?{v:h,r:o,s:p}:{}},serializedTransaction:t,type:"eip7702"});const m={chainId:F(a),type:"eip7702"};return E(d)&&d!=="0x"&&(m.to=d),E(u)&&u!=="0x"&&(m.gas=A(u)),E(i)&&i!=="0x"&&(m.data=i),E(n)&&(m.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(m.value=A(c)),E(s)&&s!=="0x"&&(m.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(m.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(m.accessList=tt(f)),l.length!==0&&l!=="0x"&&(m.authorizationList=ka(l)),we(m),{...e.length===13?O(e):void 0,...m}}function qa(t){const e=X(t),a=e.length===4,n=a?e[0]:e,r=a?e.slice(1):[],[s,u,d,c,i,f,l,h,o,p,m,y,w,g]=n,[C,b,x]=r;if(!(n.length===11||n.length===14))throw new $({attributes:{chainId:s,nonce:u,maxPriorityFeePerGas:d,maxFeePerGas:c,gas:i,to:f,value:l,data:h,accessList:o,...n.length>9?{v:y,r:w,s:g}:{}},serializedTransaction:t,type:"eip4844"});const I={blobVersionedHashes:m,chainId:F(s),to:f,type:"eip4844"};return E(i)&&i!=="0x"&&(I.gas=A(i)),E(h)&&h!=="0x"&&(I.data=h),E(u)&&(I.nonce=u==="0x"?0:F(u)),E(l)&&l!=="0x"&&(I.value=A(l)),E(p)&&p!=="0x"&&(I.maxFeePerBlobGas=A(p)),E(c)&&c!=="0x"&&(I.maxFeePerGas=A(c)),E(d)&&d!=="0x"&&(I.maxPriorityFeePerGas=A(d)),o.length!==0&&o!=="0x"&&(I.accessList=tt(o)),C&&b&&x&&(I.sidecars=ge({blobs:C,commitments:b,proofs:x})),be(I),{...n.length===14?O(n):void 0,...I}}function Fa(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h,o]=e;if(!(e.length===9||e.length===12))throw new $({attributes:{chainId:a,nonce:n,maxPriorityFeePerGas:r,maxFeePerGas:s,gas:u,to:d,value:c,data:i,accessList:f,...e.length>9?{v:l,r:h,s:o}:{}},serializedTransaction:t,type:"eip1559"});const p={chainId:F(a),type:"eip1559"};return E(d)&&d!=="0x"&&(p.to=d),E(u)&&u!=="0x"&&(p.gas=A(u)),E(i)&&i!=="0x"&&(p.data=i),E(n)&&(p.nonce=n==="0x"?0:F(n)),E(c)&&c!=="0x"&&(p.value=A(c)),E(s)&&s!=="0x"&&(p.maxFeePerGas=A(s)),E(r)&&r!=="0x"&&(p.maxPriorityFeePerGas=A(r)),f.length!==0&&f!=="0x"&&(p.accessList=tt(f)),pe(p),{...e.length===12?O(e):void 0,...p}}function Ua(t){const e=X(t),[a,n,r,s,u,d,c,i,f,l,h]=e;if(!(e.length===8||e.length===11))throw new $({attributes:{chainId:a,nonce:n,gasPrice:r,gas:s,to:u,value:d,data:c,accessList:i,...e.length>8?{v:f,r:l,s:h}:{}},serializedTransaction:t,type:"eip2930"});const o={chainId:F(a),type:"eip2930"};return E(u)&&u!=="0x"&&(o.to=u),E(s)&&s!=="0x"&&(o.gas=A(s)),E(c)&&c!=="0x"&&(o.data=c),E(n)&&(o.nonce=n==="0x"?0:F(n)),E(d)&&d!=="0x"&&(o.value=A(d)),E(r)&&r!=="0x"&&(o.gasPrice=A(r)),i.length!==0&&i!=="0x"&&(o.accessList=tt(i)),ye(o),{...e.length===11?O(e):void 0,...o}}function Ba(t){const e=Dt(t,"hex"),[a,n,r,s,u,d,c,i,f]=e;if(!(e.length===6||e.length===9))throw new $({attributes:{nonce:a,gasPrice:n,gas:r,to:s,value:u,data:d,...e.length>6?{v:c,r:i,s:f}:{}},serializedTransaction:t,type:"legacy"});const l={type:"legacy"};if(E(s)&&s!=="0x"&&(l.to=s),E(r)&&r!=="0x"&&(l.gas=A(r)),E(d)&&d!=="0x"&&(l.data=d),E(a)&&(l.nonce=a==="0x"?0:F(a)),E(u)&&u!=="0x"&&(l.value=A(u)),E(n)&&n!=="0x"&&(l.gasPrice=A(n)),xe(l),e.length===6)return l;const h=E(c)&&c!=="0x"?A(c):0n;if(f==="0x"&&i==="0x")return h>0&&(l.chainId=Number(h)),l;const o=h,p=Number((o-35n)/2n);if(p>0)l.chainId=p;else if(o!==27n&&o!==28n)throw new Ee({v:o});return l.v=o,l.s=f,l.r=i,l.yParity=o%2n===0n?1:0,l}function X(t){return Dt(`0x${t.slice(4)}`,"hex")}function tt(t){const e=[];for(let a=0;a<t.length;a++){const[n,r]=t[a];if(!Oe(n,{strict:!1}))throw new je({address:n});e.push({address:n,storageKeys:r.map(s=>la(s)?s:We(s))})}return e}function ka(t){const e=[];for(let a=0;a<t.length;a++){const[n,r,s,u,d,c]=t[a];e.push({address:r,chainId:n==="0x"?0:F(n),nonce:s==="0x"?0:F(s),...O([u,d,c])})}return e}function O(t){const e=t.slice(-3),a=e[0]==="0x"||A(e[0])===0n?27n:28n;return{r:xt(e[1],{size:32}),s:xt(e[2],{size:32}),v:a,yParity:a===27n?0:1}}class Na extends lt{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Wt(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new Na({value:t});let[a,n="0"]=t.split(".");const r=a.startsWith("-");if(r&&(a=a.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(a=`${BigInt(a)+1n}`),n="";else if(n.length>e){const[s,u,d]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${u}.${d}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),a=`${BigInt(a)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${r?"-":""}${a}${n}`)}function cr(t,e="wei"){return Wt(t,Ie[e])}function ur(t,e="wei"){return Wt(t,Te[e])}async function La(t,{hash:e}){await t.request({method:`${t.mode}_dropTransaction`,params:[e]})}async function Ma(t){return t.request({method:`${t.mode}_dumpState`})}async function Da(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}async function za(t){return await t.request({method:"txpool_content"})}async function Ga(t){const{pending:e,queued:a}=await t.request({method:"txpool_status"});return{pending:F(e),queued:F(a)}}async function $a(t,{address:e}){await t.request({method:`${t.mode}_impersonateAccount`,params:[e]})}async function Ha(t,{seconds:e}){return await t.request({method:"evm_increaseTime",params:[R(e)]})}async function Oa(t){return await t.request({method:"txpool_inspect"})}async function ja(t,{state:e}){await t.request({method:`${t.mode}_loadState`,params:[e]})}async function Wa(t,{blocks:e,interval:a}){t.mode==="ganache"?await t.request({method:"evm_mine",params:[{blocks:R(e)}]}):await t.request({method:`${t.mode}_mine`,params:[R(e),R(a||0)]})}async function Va(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}async function Ka(t,{blockNumber:e,jsonRpcUrl:a}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(e),jsonRpcUrl:a}}]})}async function Ja(t,{id:e}){await t.request({method:"evm_revert",params:[e]})}async function Ya(t,e){var w,g,C;const{accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l,...h}=e,o=(C=(g=(w=t.chain)==null?void 0:w.formatters)==null?void 0:g.transactionRequest)==null?void 0:C.format,m=(o||ft)({...St(h,{format:o}),accessList:a,data:n,from:r,gas:s,gasPrice:u,maxFeePerGas:d,maxPriorityFeePerGas:c,nonce:i,to:f,value:l},"sendUnsignedTransaction");return await t.request({method:"eth_sendUnsignedTransaction",params:[m]})}async function Qa(t,e){t.mode==="ganache"?e?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[e]})}async function Za(t,{address:e,value:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountBalance",params:[e,R(a)]}):await t.request({method:`${t.mode}_setBalance`,params:[e,R(a)]})}async function Xa(t,{gasLimit:e}){await t.request({method:"evm_setBlockGasLimit",params:[R(e)]})}async function tn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[a]})}async function en(t,{address:e,bytecode:a}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[e,a]}):await t.request({method:`${t.mode}_setCode`,params:[e,a]})}async function an(t,{address:e}){await t.request({method:`${t.mode}_setCoinbase`,params:[e]})}async function nn(t,{interval:e}){const a=t.mode==="hardhat"?e*1e3:e;await t.request({method:"evm_setIntervalMining",params:[a]})}async function rn(t,e){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[e]})}async function sn(t,{gasPrice:e}){await t.request({method:`${t.mode}_setMinGasPrice`,params:[R(e)]})}async function on(t,{baseFeePerGas:e}){await t.request({method:`${t.mode}_setNextBlockBaseFeePerGas`,params:[R(e)]})}async function cn(t,{timestamp:e}){await t.request({method:"evm_setNextBlockTimestamp",params:[R(e)]})}async function un(t,{address:e,nonce:a}){await t.request({method:`${t.mode}_setNonce`,params:[e,R(a)]})}async function dn(t,e){await t.request({method:`${t.mode}_setRpcUrl`,params:[e]})}async function mn(t,{address:e,index:a,value:n}){await t.request({method:`${t.mode}_setStorageAt`,params:[e,typeof a=="number"?R(a):a,n]})}async function ln(t){return await t.request({method:"evm_snapshot"})}async function fn(t,{address:e}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[e]})}function hn({mode:t}){return e=>{const a=e.extend(()=>({mode:t}));return{dropTransaction:n=>La(a,n),dumpState:()=>Ma(a),getAutomine:()=>Da(a),getTxpoolContent:()=>za(a),getTxpoolStatus:()=>Ga(a),impersonateAccount:n=>$a(a,n),increaseTime:n=>Ha(a,n),inspectTxpool:()=>Oa(a),loadState:n=>ja(a,n),mine:n=>Wa(a,n),removeBlockTimestampInterval:()=>Va(a),reset:n=>Ka(a,n),revert:n=>Ja(a,n),sendUnsignedTransaction:n=>Ya(a,n),setAutomine:n=>Qa(a,n),setBalance:n=>Za(a,n),setBlockGasLimit:n=>Xa(a,n),setBlockTimestampInterval:n=>tn(a,n),setCode:n=>en(a,n),setCoinbase:n=>an(a,n),setIntervalMining:n=>nn(a,n),setLoggingEnabled:n=>rn(a,n),setMinGasPrice:n=>sn(a,n),setNextBlockBaseFeePerGas:n=>on(a,n),setNextBlockTimestamp:n=>cn(a,n),setNonce:n=>un(a,n),setRpcUrl:n=>dn(a,n),setStorageAt:n=>mn(a,n),snapshot:()=>ln(a),stopImpersonatingAccount:n=>fn(a,n)}}}function dr(t){const{key:e="test",name:a="Test Client",mode:n}=t;return At({...t,key:e,name:a,type:"testClient"}).extend(s=>({mode:n,...hn({mode:n})(s)}))}async function pn(t,{chain:e}){const{id:a,name:n,nativeCurrency:r,rpcUrls:s,blockExplorers:u}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:R(a),chainName:n,nativeCurrency:r,rpcUrls:s.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}function yn(t,e){const{abi:a,args:n,bytecode:r,...s}=e,u=Ce({abi:a,args:n,bytecode:r});return ut(t,{...s,...s.authorizationList?{to:null}:{},data:u})}async function gn(t){var a;return((a=t.account)==null?void 0:a.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Ve(n))}async function bn(t,e={}){const{account:a=t.account,chainId:n}=e,r=a?N(a):void 0,s=n?[r==null?void 0:r.address,[R(n)]]:[r==null?void 0:r.address],u=await t.request({method:"wallet_getCapabilities",params:s}),d={};for(const[c,i]of Object.entries(u)){d[Number(c)]={};for(let[f,l]of Object.entries(i))f==="addSubAccount"&&(f="unstable_addSubAccount"),d[Number(c)][f]=l}return typeof n=="number"?d[n]:d}async function wn(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function xn(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(a=>B(a))}async function En(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function In(t,e){const{chain:a=t.chain}=e,n=e.timeout??Math.max(((a==null?void 0:a.blockTime)??0)*3,5e3),r=await Pt(t,e);return await _t(t,{...e,id:r.id,timeout:n})}const ot=new Ke(128);async function Vt(t,e){var x,I,T,v;const{account:a=t.account,chain:n=t.chain,accessList:r,authorizationList:s,blobs:u,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,pollingInterval:p,throwOnReceiptRevert:m,type:y,value:w,...g}=e,C=e.timeout??Math.max(((n==null?void 0:n.blockTime)??0)*3,5e3);if(typeof a>"u")throw new D({docsPath:"/docs/actions/wallet/sendTransactionSync"});const b=a?N(a):null;try{Rt(e);const P=await(async()=>{if(e.to)return e.to;if(e.to!==null&&s&&s.length>0)return await ve({authorization:s[0]}).catch(()=>{throw new lt("`to` is required. Could not infer from `authorizationList`.")})})();if((b==null?void 0:b.type)==="json-rpc"||b===null){let S;n!==null&&(S=await U(t,dt,"getChainId")({}),qt({currentChainId:S,chain:n}));const _=(T=(I=(x=t.chain)==null?void 0:x.formatters)==null?void 0:I.transactionRequest)==null?void 0:T.format,z=(_||ft)({...St(g,{format:_}),accessList:r,account:b,authorizationList:s,blobs:u,chainId:S,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,to:P,type:y,value:w},"sendTransaction"),pt=ot.get(t.uid),Kt=pt?"wallet_sendTransaction":"eth_sendTransaction",Jt=await(async()=>{try{return await t.request({method:Kt,params:[z]},{retryCount:0})}catch(yt){if(pt===!1)throw yt;const L=yt;if(L.name==="InvalidInputRpcError"||L.name==="InvalidParamsRpcError"||L.name==="MethodNotFoundRpcError"||L.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[z]},{retryCount:0}).then(at=>(ot.set(t.uid,!0),at)).catch(at=>{const nt=at;throw nt.name==="MethodNotFoundRpcError"||nt.name==="MethodNotSupportedRpcError"?(ot.set(t.uid,!1),L):nt});throw L}})(),et=await U(t,Se,"waitForTransactionReceipt")({checkReplacement:!1,hash:Jt,pollingInterval:p,timeout:C});if(m&&et.status==="reverted")throw new Ae({receipt:et});return et}if((b==null?void 0:b.type)==="local"){const S=await U(t,Ft,"prepareTransactionRequest")({account:b,accessList:r,authorizationList:s,blobs:u,chain:n,data:d,gas:c,gasPrice:i,maxFeePerBlobGas:f,maxFeePerGas:l,maxPriorityFeePerGas:h,nonce:o,nonceManager:b.nonceManager,parameters:[...Pe,"sidecars"],type:y,value:w,...g,to:P}),_=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,q=await b.signTransaction(S,{serializer:_});return await U(t,Ut,"sendRawTransactionSync")({serializedTransaction:q,throwOnReceiptRevert:m})}throw(b==null?void 0:b.type)==="smart"?new K({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new K({docsPath:"/docs/actions/wallet/sendTransactionSync",type:b==null?void 0:b.type})}catch(P){throw P instanceof K?P:_e(P,{...e,account:b,chain:e.chain||void 0})}}async function Tn(t,e){const{id:a}=e;await t.request({method:"wallet_showCallsStatus",params:[a]})}async function Cn(t,e){const{account:a=t.account}=e;if(!a)throw new D({docsPath:"/docs/eip7702/signAuthorization"});const n=N(a);if(!n.signAuthorization)throw new K({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const r=await Bt(t,e);return n.signAuthorization(r)}async function vn(t,{account:e=t.account,message:a}){if(!e)throw new D({docsPath:"/docs/actions/wallet/signMessage"});const n=N(e);if(n.signMessage)return n.signMessage({message:a});const r=typeof a=="string"?Je(a):a.raw instanceof Uint8Array?Nt(a.raw):a.raw;return t.request({method:"personal_sign",params:[r,n.address]},{retryCount:0})}async function Sn(t,e){var i,f,l,h;const{account:a=t.account,chain:n=t.chain,...r}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTransaction"});const s=N(a);Rt({account:s,...e});const u=await U(t,dt,"getChainId")({});n!==null&&qt({currentChainId:u,chain:n});const d=(n==null?void 0:n.formatters)||((i=t.chain)==null?void 0:i.formatters),c=((f=d==null?void 0:d.transactionRequest)==null?void 0:f.format)||ft;return s.signTransaction?s.signTransaction({...r,chainId:u},{serializer:(h=(l=t.chain)==null?void 0:l.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...r,account:s},"signTransaction"),chainId:R(u),from:s.address}]},{retryCount:0})}async function An(t,e){const{account:a=t.account,domain:n,message:r,primaryType:s}=e;if(!a)throw new D({docsPath:"/docs/actions/wallet/signTypedData"});const u=N(a),d={EIP712Domain:Xe({domain:n}),...e.types};if(ta({domain:n,message:r,primaryType:s,types:d}),u.signTypedData)return u.signTypedData({domain:n,message:r,primaryType:s,types:d});const c=ea({domain:n,message:r,primaryType:s,types:d});return t.request({method:"eth_signTypedData_v4",params:[u.address,c]},{retryCount:0})}async function Pn(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:R(e)}]},{retryCount:0})}async function _n(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function Rn(t,e){return M.internal(t,Vt,"sendTransactionSync",e)}function qn(t){return{addChain:e=>pn(t,e),deployContract:e=>yn(t,e),getAddresses:()=>gn(t),getCallsStatus:e=>qe(t,e),getCapabilities:e=>bn(t,e),getChainId:()=>dt(t),getPermissions:()=>wn(t),prepareAuthorization:e=>Bt(t,e),prepareTransactionRequest:e=>Ft(t,e),requestAddresses:()=>xn(t),requestPermissions:e=>En(t,e),sendCalls:e=>Pt(t,e),sendCallsSync:e=>In(t,e),sendRawTransaction:e=>Re(t,e),sendRawTransactionSync:e=>Ut(t,e),sendTransaction:e=>ut(t,e),sendTransactionSync:e=>Vt(t,e),showCallsStatus:e=>Tn(t,e),signAuthorization:e=>Cn(t,e),signMessage:e=>vn(t,e),signTransaction:e=>Sn(t,e),signTypedData:e=>An(t,e),switchChain:e=>Pn(t,e),waitForCallsStatus:e=>_t(t,e),watchAsset:e=>_n(t,e),writeContract:e=>M(t,e),writeContractSync:e=>Rn(t,e)}}function mr(t){const{key:e="wallet",name:a="Wallet Client",transport:n}=t;return At({...t,key:e,name:a,transport:n,type:"walletClient"}).extend(qn)}function lr(t,e={}){const{key:a="custom",methods:n,name:r="Custom Provider",retryDelay:s}=e;return({retryCount:u})=>mt({key:a,methods:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??u,retryDelay:s,type:"custom"})}function fr(t,e={}){const{key:a="fallback",name:n="Fallback",rank:r=!1,shouldThrow:s=Fn,retryCount:u,retryDelay:d}=e;return(({chain:c,pollingInterval:i=4e3,timeout:f,...l})=>{let h=t,o=()=>{};const p=mt({key:a,name:n,async request({method:m,params:y}){let w;const g=async(C=0)=>{const b=h[C]({...l,chain:c,retryCount:0,timeout:f});try{const x=await b.request({method:m,params:y});return o({method:m,params:y,response:x,transport:b,status:"success"}),x}catch(x){if(o({error:x,method:m,params:y,transport:b,status:"error"}),s(x)||C===h.length-1||(w??(w=h.slice(C+1).some(I=>{const{include:T,exclude:v}=I({chain:c}).config.methods||{};return T?T.includes(m):v?!v.includes(m):!0})),!w))throw x;return g(C+1)}};return g()},retryCount:u,retryDelay:d,type:"fallback"},{onResponse:m=>o=m,transports:h.map(m=>m({chain:c,retryCount:0}))});if(r){const m=typeof r=="object"?r:{};Un({chain:c,interval:m.interval??i,onTransports:y=>h=y,ping:m.ping,sampleCount:m.sampleCount,timeout:m.timeout,transports:h,weights:m.weights})}return p})}function Fn(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===na.code||t.code===ra.code||Fe.nodeMessage.test(t.message)||t.code===5e3))}function Un({chain:t,interval:e=4e3,onTransports:a,ping:n,sampleCount:r=10,timeout:s=1e3,transports:u,weights:d={}}){const{stability:c=.7,latency:i=.3}=d,f=[],l=async()=>{const h=await Promise.all(u.map(async m=>{const y=m({chain:t,retryCount:0,timeout:s}),w=Date.now();let g,C;try{await(n?n({transport:y}):y.request({method:"net_listening"})),C=1}catch{C=0}finally{g=Date.now()}return{latency:g-w,success:C}}));f.push(h),f.length>r&&f.shift();const o=Math.max(...f.map(m=>Math.max(...m.map(({latency:y})=>y)))),p=u.map((m,y)=>{const w=f.map(I=>I[y].latency),C=1-w.reduce((I,T)=>I+T,0)/w.length/o,b=f.map(I=>I[y].success),x=b.reduce((I,T)=>I+T,0)/b.length;return x===0?[0,y]:[i*C+c*x,y]}).sort((m,y)=>y[0]-m[0]);a(p.map(([,m])=>u[m])),await Ue(e),l()};l()}function hr(t,e={}){const{keepAlive:a,key:n="webSocket",methods:r,name:s="WebSocket JSON-RPC",reconnect:u,retryDelay:d}=e;return({chain:c,retryCount:i,timeout:f})=>{var m;const l=e.retryCount??i,h=f??e.timeout??1e4,o=t||((m=c==null?void 0:c.rpcUrls.default.webSocket)==null?void 0:m[0]),p={keepAlive:a,reconnect:u};if(!o)throw new Be;return mt({key:n,methods:r,name:s,async request({method:y,params:w}){const g={method:y,params:w},C=await J(o,p),{error:b,result:x}=await C.requestAsync({body:g,timeout:h});if(b)throw new sa({body:g,error:b,url:o});return x},retryCount:l,retryDelay:d,timeout:h,type:"webSocket"},{getSocket(){return Ta(o)},getRpcClient(){return J(o,p)},async subscribe({params:y,onData:w,onError:g}){const C=await J(o,p),{result:b}=await new Promise((x,I)=>C.request({body:{method:"eth_subscribe",params:y},onError(T){I(T),g==null||g(T)},onResponse(T){if(T.error){I(T.error),g==null||g(T.error);return}if(typeof T.id=="number"){x(T);return}T.method==="eth_subscription"&&w(T.params)}}));return{subscriptionId:b,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[b]},onResponse:x}))}}}})}}class pr extends Error{constructor(e,a){super(a),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=a}}const it="/docs/contract/decodeDeployData";function yr(t){const{abi:e,bytecode:a,data:n}=t;if(n===a)return{bytecode:a};const r=e.find(u=>"type"in u&&u.type==="constructor");if(!r)throw new Ye({docsPath:it});if(!("inputs"in r))throw new Et({docsPath:it});if(!r.inputs||r.inputs.length===0)throw new Et({docsPath:it});return{args:Mt(r.inputs,`0x${n.replace(a,"")}`),bytecode:a}}function gr(t){const e=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),a=typeof t.blobs[0]=="string"?t.blobs.map(d=>H(d)):t.blobs,n=a.reduce((d,c)=>d+c.length,0),r=ct(new Uint8Array(n));let s=!0;for(const d of a){const c=ct(d);for(;s&&c.position<d.length;){c.incrementPosition(1);let i=31;d.length-c.position<31&&(i=d.length-c.position);for(const f in Array.from({length:i})){const l=c.readByte();if(l===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}r.pushByte(l)}}}const u=r.bytes.slice(0,r.position);return e==="hex"?G(u):u}function br(t){const{sidecars:e,version:a}=t,n=t.to??(typeof e[0].blob=="string"?"hex":"bytes"),r=[];for(const{commitment:s}of e)r.push(ke({commitment:s,to:n,version:a}));return r}const Bn=2147483648;function wr(t){if(t===1)return 60n;if(t>=Bn||t<0)throw new Ne({chainId:t});return BigInt((2147483648|t)>>>0)}function kn({blobToKzgCommitment:t,computeBlobKzgProof:e}){return{blobToKzgCommitment:t,computeBlobKzgProof:e}}function xr(t,e){try{t.loadTrustedSetup(e)}catch(a){const n=a;if(!n.message.includes("trusted setup is already loaded"))throw n}return kn(t)}function Er({r:t,yParityAndS:e}){const a=H(e),n=a[0]&128?1:0,r=a;return n===1&&(r[0]&=127),{r:t,s:G(r),yParity:n}}function Ir(t){const{r:e,s:a}=kt.Signature.fromCompact(t.slice(2,130));return{r:R(e,{size:32}),yParityAndS:R(a,{size:32})}}async function Tr(t){const{serializedTransaction:e,signature:a}=t,n=_a(e),r=a??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=Le({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await Z({hash:Y(s),signature:r})}function Cr({r:t,yParityAndS:e}){return`0x${new kt.Signature(A(t),A(e)).toCompactHex()}`}function vr(t){const{r:e,s:a,v:n,yParity:r}=t,s=Number(r??n-27n);let u=a;if(s===1){const d=H(a);d[0]|=128,u=G(d)}return{r:e,yParityAndS:u}}export{Ye as AbiConstructorNotFoundError,Et as AbiConstructorParamsNotFoundError,_o as AbiDecodingDataSizeInvalidError,Ro as AbiDecodingDataSizeTooSmallError,qo as AbiDecodingZeroDataError,Fo as AbiEncodingArrayLengthMismatchError,Uo as AbiEncodingBytesSizeMismatchError,Bo as AbiEncodingLengthMismatchError,ko as AbiErrorInputsNotFoundError,No as AbiErrorNotFoundError,Lo as AbiErrorSignatureNotFoundError,Mo as AbiEventNotFoundError,Do as AbiEventSignatureEmptyTopicsError,zo as AbiEventSignatureNotFoundError,Go as AbiFunctionNotFoundError,$o as AbiFunctionOutputsNotFoundError,Ho as AbiFunctionSignatureNotFoundError,Pr as AccountStateConflictError,tc as AtomicReadyWalletRejectedUpgradeError,ec as AtomicityNotSupportedError,lt as BaseError,_r as BaseFeeScalarError,Rr as BlockNotFoundError,qr as BundleFailedError,ac as BundleTooLargeError,Oo as BytesSizeMismatchError,Fr as CallExecutionError,nc as ChainDisconnectedError,Ur as ChainDoesNotSupportContract,Br as ChainMismatchError,kr as ChainNotFoundError,Nr as CircularReferenceError,Lr as ClientChainNotConfiguredError,Mr as ContractFunctionExecutionError,Dr as ContractFunctionRevertedError,zr as ContractFunctionZeroDataError,Gr as CounterfactualDeploymentFailedError,jo as DecodeLogDataMismatch,Wo as DecodeLogTopicsMismatch,rc as DuplicateIdError,pr as EIP1193ProviderRpcError,$r as Eip1559FeesNotSupportedError,Hr as EnsAvatarInvalidNftUriError,Or as EnsAvatarUnsupportedNamespaceError,jr as EnsAvatarUriResolutionError,Ne as EnsInvalidChainIdError,Wr as EstimateGasExecutionError,Fe as ExecutionRevertedError,Vr as FeeCapTooHighError,Kr as FeeCapTooLowError,Jr as FeeConflictError,Vo as FilterTypeNotSupportedError,sc as HttpRequestError,Yr as InsufficientFundsError,Ko as IntegerOutOfRangeError,oc as InternalRpcError,Qr as IntrinsicGasTooHighError,Zr as IntrinsicGasTooLowError,Jo as InvalidAbiDecodingTypeError,Yo as InvalidAbiEncodingTypeError,Xr as InvalidAbiItemError,Zt as InvalidAbiParameterError,ts as InvalidAbiParametersError,es as InvalidAbiTypeParameterError,je as InvalidAddressError,Qo as InvalidArrayError,Zo as InvalidBytesBooleanError,as as InvalidChainIdError,Na as InvalidDecimalNumberError,Xo as InvalidDefinitionTypeError,Vi as InvalidDomainError,ns as InvalidFunctionModifierError,ti as InvalidHexBooleanError,Ge as InvalidHexValueError,ic as InvalidInputRpcError,Ee as InvalidLegacyVError,rs as InvalidModifierError,ss as InvalidParameterError,cc as InvalidParamsRpcError,os as InvalidParenthesisError,Ki as InvalidPrimaryTypeError,uc as InvalidRequestRpcError,is as InvalidSerializableTransactionError,$ as InvalidSerializedTransactionError,he as InvalidSerializedTransactionTypeError,cs as InvalidSignatureError,us as InvalidStorageKeySizeError,ds as InvalidStructSignatureError,Ji as InvalidStructTypeError,dc as JsonRpcVersionUnsupportedError,mc as LimitExceededRpcError,ms as MaxFeePerGasTooLowError,lc as MethodNotFoundRpcError,fc as MethodNotSupportedRpcError,ls as NonceMaxValueError,fs as NonceTooHighError,hs as NonceTooLowError,hc as ParseRpcError,pc as ProviderDisconnectedError,yc as ProviderRpcError,ps as RawContractError,gc as ResourceNotFoundRpcError,bc as ResourceUnavailableRpcError,wc as RpcError,sa as RpcRequestError,ei as SizeExceedsPaddingSizeError,ai as SizeOverflowError,ni as SliceOffsetOutOfBoundsError,Q as SocketClosedError,ys as SolidityProtectedKeywordError,gs as StateAssignmentConflictError,xc as SwitchChainError,aa as TimeoutError,bs as TipAboveFeeCapError,ws as TransactionExecutionError,xs as TransactionNotFoundError,Es as TransactionReceiptNotFoundError,na as TransactionRejectedRpcError,Is as TransactionTypeNotSupportedError,Ec as UnauthorizedProviderError,Ic as UnknownBundleIdError,Ts as UnknownNodeError,Tc as UnknownRpcError,Cs as UnknownSignatureError,vs as UnknownTypeError,Cc as UnsupportedChainIdError,vc as UnsupportedNonOptionalCapabilityError,ri as UnsupportedPackedAbiType,Sc as UnsupportedProviderMethodError,Be as UrlRequiredError,ra as UserRejectedRequestError,Ss as WaitForCallsStatusTimeoutError,As as WaitForTransactionReceiptTimeoutError,It as WebSocketRequestError,qt as assertCurrentChain,Rt as assertRequest,pe as assertTransactionEIP1559,ye as assertTransactionEIP2930,xe as assertTransactionLegacy,Ps as blobsToCommitments,_s as blobsToProofs,si as boolToBytes,oi as boolToHex,ii as bytesToBigInt,ci as bytesToBool,G as bytesToHex,ui as bytesToNumber,Pc as bytesToRlp,di as bytesToString,Td as ccipFetch,Cd as ccipRequest,Ve as checksumAddress,ke as commitmentToVersionedHash,Rs as commitmentsToVersionedHashes,Cr as compactSignatureToHex,Er as compactSignatureToSignature,ze as concat,mi as concatBytes,li as concatHex,At as createClient,qs as createNonceManager,Fs as createPublicClient,dr as createTestClient,mt as createTransport,mr as createWalletClient,lr as custom,Mt as decodeAbiParameters,yr as decodeDeployData,Ni as decodeErrorResult,xd as decodeEventLog,Us as decodeFunctionData,Bs as decodeFunctionResult,Li as defineBlock,Mi as defineChain,kn as defineKzg,Di as defineTransaction,_d as defineTransactionReceipt,zi as defineTransactionRequest,ks as deploylessCallViaBytecodeBytecode,Ns as deploylessCallViaFactoryBytecode,Yi as domainSeparator,fi as encodeAbiParameters,Ce as encodeDeployData,Ls as encodeErrorResult,hi as encodeEventTopics,Xt as encodeFunctionData,Ms as encodeFunctionResult,Ds as encodePacked,zs as erc1155Abi,Gs as erc20Abi,$s as erc20Abi_bytes32,Hs as erc4626Abi,Os as erc6492SignatureValidatorAbi,js as erc6492SignatureValidatorByteCode,Ws as erc721Abi,Vs as ethAddress,Ie as etherUnits,tr as extractChain,fr as fallback,Gi as formatBlock,Ks as formatEther,Js as formatGwei,Rd as formatLog,$i as formatTransaction,qd as formatTransactionReceipt,ft as formatTransactionRequest,Ys as formatUnits,gr as fromBlobs,pi as fromBytes,yi as fromHex,Dt as fromRlp,gi as getAbiItem,B as getAddress,Qs as getChainContractAddress,Zn as getContract,Xn as getContractAddress,te as getContractError,da as getCreate2Address,ua as getCreateAddress,bi as getEventSelector,wi as getEventSignature,xi as getFunctionSelector,Ei as getFunctionSignature,Pa as getSerializedTransactionType,Zs as getTransactionType,Xe as getTypesForEIP712Domain,Te as gweiUnits,Qi as hashDomain,le as hashMessage,Zi as hashStruct,Ze as hashTypedData,A as hexToBigInt,Ii as hexToBool,H as hexToBytes,Ir as hexToCompactSignature,F as hexToNumber,_c as hexToRlp,Xs as hexToSignature,Ti as hexToString,to as http,Oe as isAddress,ht as isAddressEqual,Tt as isBytes,Ca as isErc6492Signature,va as isErc8010Signature,la as isHash,E as isHex,Y as keccak256,eo as labelhash,Rc as maxInt104,qc as maxInt112,Fc as maxInt120,Uc as maxInt128,Bc as maxInt136,kc as maxInt144,Nc as maxInt152,Lc as maxInt16,Mc as maxInt160,Dc as maxInt168,zc as maxInt176,Gc as maxInt184,$c as maxInt192,Hc as maxInt200,Oc as maxInt208,jc as maxInt216,Wc as maxInt224,Vc as maxInt232,Kc as maxInt24,Jc as maxInt240,Yc as maxInt248,Qc as maxInt256,Zc as maxInt32,Xc as maxInt40,tu as maxInt48,eu as maxInt56,au as maxInt64,nu as maxInt72,ru as maxInt8,su as maxInt80,ou as maxInt88,iu as maxInt96,cu as maxUint104,uu as maxUint112,du as maxUint120,mu as maxUint128,lu as maxUint136,fu as maxUint144,hu as maxUint152,pu as maxUint16,yu as maxUint160,gu as maxUint168,bu as maxUint176,wu as maxUint184,xu as maxUint192,Eu as maxUint200,Iu as maxUint208,Tu as maxUint216,Cu as maxUint224,vu as maxUint232,Su as maxUint24,Au as maxUint240,Pu as maxUint248,_u as maxUint256,Ru as maxUint32,qu as maxUint40,Fu as maxUint48,Uu as maxUint56,Bu as maxUint64,ku as maxUint72,Nu as maxUint8,Lu as maxUint80,Mu as maxUint88,Du as maxUint96,zu as minInt104,Gu as minInt112,$u as minInt120,Hu as minInt128,Ou as minInt136,ju as minInt144,Wu as minInt152,Vu as minInt16,Ku as minInt160,Ju as minInt168,Yu as minInt176,Qu as minInt184,Zu as minInt192,Xu as minInt200,td as minInt208,ed as minInt216,ad as minInt224,nd as minInt232,rd as minInt24,sd as minInt240,od as minInt248,id as minInt256,cd as minInt32,ud as minInt40,dd as minInt48,md as minInt56,ld as minInt64,fd as minInt72,hd as minInt8,pd as minInt80,yd as minInt88,gd as minInt96,ao as multicall3Abi,no as namehash,ro as nonceManager,Ci as numberToBytes,R as numberToHex,vd as offchainLookup,Sd as offchainLookupAbiItem,Ad as offchainLookupSignature,Me as pad,vi as padBytes,xt as padHex,so as parseAbi,oo as parseAbiItem,Qn as parseAbiParameter,io as parseAbiParameters,Ir as parseCompactSignature,ar as parseErc6492Signature,nr as parseErc8010Signature,cr as parseEther,Ed as parseEventLogs,ur as parseGwei,co as parseSignature,_a as parseTransaction,Wt as parseUnits,uo as prepareEncodeFunctionData,mo as presignMessagePrefix,lo as publicActions,Z as recoverAddress,Sa as recoverMessageAddress,fo as recoverPublicKey,Tr as recoverTransactionAddress,Aa as recoverTypedDataAddress,er as ripemd160,ho as rpcSchema,Hi as rpcTransactionType,po as serializeAccessList,Cr as serializeCompactSignature,yo as serializeErc6492Signature,rr as serializeErc8010Signature,go as serializeSignature,Le as serializeTransaction,ea as serializeTypedData,Si as setErrorConfig,xr as setupKzg,bd as sha256,Fn as shouldThrow,br as sidecarsToVersionedHashes,vr as signatureToCompactSignature,bo as signatureToHex,$e as size,De as slice,Ai as sliceBytes,Lt as sliceHex,Pi as stringToBytes,Je as stringToHex,Oi as stringify,hn as testActions,ge as toBlobSidecars,wo as toBlobs,k as toBytes,wr as toCoinType,_i as toEventHash,Ri as toEventSelector,qi as toEventSignature,Fi as toFunctionHash,Ui as toFunctionSelector,Bi as toFunctionSignature,Nt as toHex,xo as toPrefixedMessage,ia as toRlp,ji as transactionType,We as trim,Eo as universalSignatureValidatorAbi,Io as universalSignatureValidatorByteCode,ta as validateTypedData,sr as verifyHash,or as verifyMessage,ir as verifyTypedData,qn as walletActions,hr as webSocket,To as weiUnits,Co as withCache,vo as withRetry,Qe as withTimeout,So as zeroAddress,Ao as zeroHash};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/decimals-CTAJwKFW.js","assets/utils-jd03xFBb.js","assets/sentry-B35L1FdR.js","assets/react-vyZjIDcS.js","assets/decimals-rMqzXjFU.js","assets/prepare-contract-call-BreQKHF6.js","assets/signing-BxAbixw6.js","assets/index-yJi2QIJf.js","assets/dcl-schemas-BICTSpB5.js","assets/ethers-CXBJm_wN.js","assets/intl-CBcMB1D2.js","assets/index-BMzstP-8.css","assets/to-serializable-transaction-DMc2E6fk.js","assets/transaction-8aHmZ7ni.js","assets/get-bytecode-Bg8NviKV.js","assets/in-app-wallet-calls-DXx7lWeR.js","assets/wait-for-tx-receipt-8bgpdxSo.js","assets/transactionReceipt-DFdTIN3F.js","assets/sleep-mAKpSMLY.js","assets/send-batch-transaction-ClJpcx_r.js","assets/send-transaction-DCRA_QBx.js","assets/execute-B7xe5F3I.js","assets/detectExtension-0JcORGBX.js"])))=>i.map(i=>d[i]);
2
- import{_ as T}from"./index-yJi2QIJf.js";import{t as V,i as ct,a as ot}from"./transaction-8aHmZ7ni.js";import{e as dt,i as mt,a as F}from"./utils-jd03xFBb.js";import{f as pt,h as q,e as $,i as ut,g as L,j as lt,t as yt}from"./to-serializable-transaction-DMc2E6fk.js";import{r as C,a5 as B,w as E,S as O,G as x,s as z,h as _,l as D,H as ft,k as wt,e as At,T as Gt,g as K}from"./prepare-contract-call-BreQKHF6.js";import{o as j,r as gt}from"./execute-B7xe5F3I.js";import{Z,a as Y,p as Q,m as ht,b as Tt,d as J,e as Pt}from"./signing-BxAbixw6.js";import{t as vt,p as Lt,s as Dt}from"./send-eip712-transaction-DCKQGfPC.js";import{s as Ot}from"./send-transaction-DCRA_QBx.js";import{p as xt}from"./linkAccount-D303ryxj.js";import{g as X,E as S,h as St,a as k,b as Ct,c as _t,d as Et,e as U,D as tt,f as at,i as Ft,j as Vt,k as Ut,l as It}from"./index-Dr4K4hFL.js";import{M as Ae}from"./wallets-BTh4qQ9L.js";import"./react-vyZjIDcS.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./detectExtension-0JcORGBX.js";import"./get-bytecode-Bg8NviKV.js";import"./eth_sendRawTransaction-DPdnXbFR.js";import"./sha256-NdAeiB0X.js";import"./ethereum-7duKFA0R.js";import"./types-DC0Zmj1B.js";import"./store-CraP4F4Y.js";import"./hashTypedData-Dz79Rf5q.js";import"./index-D7R57an8.js";import"./events-DQ172AOg.js";import"./index-CbITlqFn.js";import"./index-DgMAf2q5.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index-C0odNd_G.js";const bt="0xdd62ed3e",Rt=[{name:"owner",type:"address"},{name:"spender",type:"address"}],Nt=[{type:"uint256"}];async function $t(a){return C({contract:a.contract,method:[bt,Rt,Nt],params:[a.owner,a.spender]})}const kt="0x095ea7b3",Ht=[{name:"spender",type:"address"},{name:"value",type:"uint256"}],Mt=[{type:"bool"}];function Wt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[kt,Ht,Mt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.spender,t.value]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function qt(a){return Wt({asyncParams:async()=>{let e;if("amount"in a){const{decimals:t}=await T(async()=>{const{decimals:r}=await import("./decimals-CTAJwKFW.js");return{decimals:r}},__vite__mapDeps([0,1,2,3,4,5])),i=await t(a).catch(()=>18);e=pt(a.amount.toString(),i)}else e=a.amountWei;return{overrides:{erc20Value:{amountWei:e,tokenAddress:a.contract.address},...a.overrides},spender:a.spender,value:e}},contract:a.contract})}const Bt="0xf15d424e",zt=[{name:"signer",type:"address"}],Kt=[{components:[{name:"signer",type:"address"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"startTimestamp",type:"uint128"},{name:"endTimestamp",type:"uint128"}],name:"permissions",type:"tuple"}];async function jt(a){return C({contract:a.contract,method:[Bt,zt,Kt],params:[a.signer]})}const Zt="0x5892e236",Yt=[{components:[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}],name:"req",type:"tuple"},{name:"signature",type:"bytes"}],Qt=[];function Jt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[Zt,Yt,Qt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.req,t.signature]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function W(){return new Date(Date.now()+1e3*60*60*24*365*10)}function b(a){return vt(Math.floor(a.getTime()/1e3))}const Xt=[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}];async function ta(a){const{account:e,contract:t,req:i}=a,r=await e.signTypedData({domain:{chainId:t.chain.id,name:"Account",verifyingContract:t.address,version:"1"},message:i,primaryType:"SignerPermissionRequest",types:{SignerPermissionRequest:Xt}});return{req:i,signature:r}}async function aa(a){var i;const{target:e,permissions:t}=a;return{approvedTargets:t.approvedTargets==="*"?[Z]:t.approvedTargets,isAdmin:0,nativeTokenLimitPerTransaction:q(((i=t.nativeTokenLimitPerTransaction)==null?void 0:i.toString())||"0"),permissionEndTimestamp:b(t.permissionEndTimestamp||W()),permissionStartTimestamp:b(t.permissionStartTimestamp||new Date(0)),reqValidityEndTimestamp:b(W()),reqValidityStartTimestamp:0n,signer:e,uid:await gt()}}function ea(a){const{contract:e,sessionKeyAddress:t,account:i,permissions:r}=a;return Jt({async asyncParams(){const{req:n,signature:c}=await ta({account:i,contract:e,req:await aa({permissions:r,target:t})});return{req:n,signature:c}},contract:e})}async function sa(a){var c;const{accountContract:e,sessionKeyAddress:t,newPermissions:i}=a;if(!await Y(e))return!0;const n=await jt({contract:e,signer:t});return!!(n.endTimestamp&&n.endTimestamp<Math.floor(Date.now()/1e3)||!na(n.approvedTargets,i.approvedTargets)||q(((c=i.nativeTokenLimitPerTransaction)==null?void 0:c.toString())??"0")>n.nativeTokenLimitPerTransaction)}function na(a,e){return e==="*"&&a.length===1&&a[0]===Z?!0:e!=="*"?e.map(t=>t.toLowerCase()).every(t=>a.map(i=>i.toLowerCase()).includes(t)):!1}const ra=2n**96n-1n,ia="0x35567e1a",ca=[{name:"sender",type:"address"},{name:"key",type:"uint192"}],oa=[{name:"nonce",type:"uint256"}];async function da(a){return C({contract:a.contract,method:[ia,ca,oa],params:[a.sender,a.key]})}const ma="0xa6193531",pa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],ua=[{type:"bytes32"}];async function la(a){return C({contract:a.contract,method:[ma,pa,ua],params:[a.userOp]})}const ya="0x22cdde4c",fa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],wa=[{type:"bytes32"}];async function Aa(a){return C({contract:a.contract,method:[ya,fa,wa],params:[a.userOp]})}function Ga(a){return a.factory?E([a.factory,a.factoryData||"0x"]):"0x"}function ga(a){return E([O(x(BigInt(a.verificationGasLimit)),{size:16}),O(x(BigInt(a.callGasLimit)),{size:16})])}function ha(a){return E([O(x(BigInt(a.maxPriorityFeePerGas)),{size:16}),O(x(BigInt(a.maxFeePerGas)),{size:16})])}function Ta(a){return a.paymaster?E([a.paymaster,O(x(BigInt(a.paymasterVerificationGasLimit||0)),{size:16}),O(x(BigInt(a.paymasterPostOpGasLimit||0)),{size:16}),a.paymasterData||"0x"]):"0x"}const Pa=a=>({accountGasLimits:ga(a),callData:a.callData,gasFees:ha(a),initCode:Ga(a),nonce:BigInt(a.nonce),paymasterAndData:Ta(a),preVerificationGas:BigInt(a.preVerificationGas),sender:a.sender,signature:a.signature});async function I(a){var A;const{userOp:e,paymasterOverride:t,client:i,chain:r,entrypointAddress:n}=a;if(t)return t(e);const c={"Content-Type":"application/json"},s=n??S,o=X(r),d={id:1,jsonrpc:"2.0",method:"pm_sponsorUserOperation",params:[St(e),s]},y=await dt(i)(o,{body:z(d),headers:c,method:"POST"});if(!y.ok){const G=await y.text()||y.statusText;throw new Error(`Paymaster error: ${y.status} - ${G}`)}const p=await y.json();if(p.result)return typeof p.result=="string"?{paymasterAndData:p.result}:(p.result.reason&&console.warn(`Paymaster policy rejected this transaction with reason: ${p.result.reason} ${p.result.policyId?`(policyId: ${p.result.policyId})`:""}`),{callGasLimit:p.result.callGasLimit?_(p.result.callGasLimit):void 0,paymaster:p.result.paymaster,paymasterAndData:p.result.paymasterAndData,paymasterData:p.result.paymasterData,paymasterPostOpGasLimit:p.result.paymasterPostOpGasLimit?_(p.result.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:p.result.paymasterVerificationGasLimit?_(p.result.paymasterVerificationGasLimit):void 0,preVerificationGas:p.result.preVerificationGas?_(p.result.preVerificationGas):void 0,verificationGasLimit:p.result.verificationGasLimit?_(p.result.verificationGasLimit):void 0});const w=((A=p.error)==null?void 0:A.message)||p.error||y.statusText||"unknown error";throw new Error(`Paymaster error from ${o}: ${w}`)}const H=new Set,M=a=>`${a.chain.id}:${a.address}`,et=a=>{H.add(M(a))},st=a=>{H.delete(M(a))},nt=a=>H.has(M(a));async function va(a){const e=a.timeoutMs||12e4,t=a.intervalMs||1e3,i=Date.now()+e;for(;Date.now()<i;){const r=await Ct(a);if(r)return r;await new Promise(n=>setTimeout(n,t))}throw new Error(`Timeout waiting for userOp to be mined on chain ${a.chain.id} with UserOp hash: ${a.userOpHash}`)}async function La(a){var P;const{transaction:e,accountContract:t,factoryContract:i,adminAddress:r,overrides:n,sponsorGas:c,waitForDeployment:s=!0,isDeployedOverride:o}=a,d=e.chain,l=e.client,y={bundlerUrl:n==null?void 0:n.bundlerUrl,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress},p=k(((P=a.overrides)==null?void 0:P.entrypointAddress)||S),[w,A,G,g,f]=await Promise.all([typeof o=="boolean"?o:Y(t).then(h=>h||nt(t)),$(e),D(e.gas),Da({bundlerOptions:y,chain:d,client:l,executeTx:e}),Ea({accountContract:t,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress,getNonceOverride:n==null?void 0:n.getAccountNonce})]),{maxFeePerGas:m,maxPriorityFeePerGas:u}=g;return p==="v0.7"?Oa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s}):xa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s})}async function Da(a){const{executeTx:e,bundlerOptions:t,chain:i,client:r}=a;let{maxFeePerGas:n,maxPriorityFeePerGas:c}=e;const s=(t==null?void 0:t.bundlerUrl)??X(i);if(mt(s)){const o=await _t({options:t});n=o.maxFeePerGas,c=o.maxPriorityFeePerGas}else{const[o,d]=await Promise.all([D(n),D(c)]);if(o&&d)n=o,c=d;else{const l=await ut(r,i);c=d??l.maxPriorityFeePerGas??0n,n=o??l.maxFeePerGas??0n}}return{maxFeePerGas:n,maxPriorityFeePerGas:c}}async function Oa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g,f;t?(f="0x",w&&await rt(r)):(g=i.address,f=await $(Q({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i})),w&&et(r));const m={callData:d,callGasLimit:l??0n,factory:g,factoryData:f,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymaster:void 0,paymasterData:"0x",paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n,preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const u=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});if(u.paymaster&&u.paymasterData&&(m.paymaster=u.paymaster,m.paymasterData=u.paymasterData),u.callGasLimit&&u.verificationGasLimit&&u.preVerificationGas&&u.paymasterPostOpGasLimit&&u.paymasterVerificationGasLimit)m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit;else{const P=s!=null&&s.tokenPaymaster?{[s.tokenPaymaster.tokenAddress]:{stateDiff:{[wt(At([{type:"address"},{type:"uint256"}],[r.address,s.tokenPaymaster.balanceStorageSlot]))]:Gt(ht,{size:32})}}}:void 0,h=await U({options:e,userOp:m},P);m.callGasLimit=h.callGasLimit,m.verificationGasLimit=h.verificationGasLimit,m.preVerificationGas=h.preVerificationGas,m.paymasterPostOpGasLimit=s!=null&&s.tokenPaymaster?500000n:h.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=h.paymasterVerificationGasLimit||0n;const v=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});v.paymaster&&v.paymasterData&&(m.paymaster=v.paymaster,m.paymasterData=v.paymasterData)}}else{const u=await U({options:e,userOp:m});m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit||0n}return{...m,signature:"0x"}}async function xa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g;t?(g="0x",w&&await rt(r)):(g=await _a({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i}),w&&et(r));const f={callData:d,callGasLimit:l??0n,initCode:g,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymasterAndData:"0x",preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const m=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),u="paymasterAndData"in m?m.paymasterAndData:"0x";if(u&&u!=="0x"&&(f.paymasterAndData=u),m.callGasLimit&&m.verificationGasLimit&&m.preVerificationGas)f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas;else{const P=await U({options:e,userOp:f});if(f.callGasLimit=P.callGasLimit,f.verificationGasLimit=P.verificationGasLimit,f.preVerificationGas=P.preVerificationGas,u&&u!=="0x"){const h=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),v="paymasterAndData"in h?h.paymasterAndData:"0x";v&&v!=="0x"&&(f.paymasterAndData=v)}}}else{const m=await U({options:e,userOp:f});f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas}return{...f,signature:"0x"}}async function Sa(a){const{userOp:e,chain:t,entrypointAddress:i,adminAccount:r}=a,n=await Ca({chain:t,client:a.client,entrypointAddress:i,userOp:e});if(r.signMessage){const c=await r.signMessage({chainId:t.id,message:{raw:ft(n)},originalMessage:z(e)});return{...e,signature:c}}throw new Error("signMessage not implemented in signingAccount")}async function Ca(a){const{userOp:e,chain:t,entrypointAddress:i}=a,r=k(i||S);let n;if(r==="v0.7"){const c=Pa(e);n=await Aa({contract:L({address:i||at,chain:t,client:a.client}),userOp:c})}else n=await la({contract:L({address:i||S,chain:t,client:a.client}),userOp:e});return n}async function _a(a){const{factoryContract:e,adminAddress:t,accountSalt:i,createAccountOverride:r}=a,n=Q({accountSalt:i,adminAddress:t,createAccountOverride:r,factoryContract:e});return E([e.address,await $(n)])}async function Ea(a){const{accountContract:e,chain:t,client:i,entrypointAddress:r,getNonceOverride:n}=a;return n?n(e):await da({contract:L({address:r||S,chain:t,client:i}),key:Et(),sender:e.address})}async function rt(a){const e=Date.now();for(;nt(a);){if(Date.now()-e>6e4)throw st(a),new Error("Account deployment is taking too long (over 1 minute). Please try again.");await new Promise(t=>setTimeout(t,500))}}const it=new WeakMap,R=new WeakMap;async function le(a,e){var p,w,A,G,g,f,m;const{personalAccount:t,client:i}=a;if(!t)throw new Error("No personal account provided for smart account connection");const r=e,n=e.chain,c="gasless"in r?r.gasless:r.sponsorGas;if(await lt(n))return[Ua({chain:n,connectionOptions:a,creationOptions:e,sponsorGas:c}),n];if(r.factoryAddress&&!((p=r.overrides)!=null&&p.entrypointAddress)){const u=await Ia(r.factoryAddress,i,n);u&&(r.overrides={...r.overrides,entrypointAddress:u})}(w=r.overrides)!=null&&w.tokenPaymaster&&!((A=r.overrides)!=null&&A.entrypointAddress)&&(r.overrides={...r.overrides,entrypointAddress:at});const s=r.factoryAddress??Ft((G=r.overrides)==null?void 0:G.entrypointAddress),o=L({address:s,chain:n,client:i}),d=await Tt({accountAddress:(g=r.overrides)==null?void 0:g.accountAddress,accountSalt:(f=r.overrides)==null?void 0:f.accountSalt,adminAddress:t.address,factoryContract:o,predictAddressOverride:(m=r.overrides)==null?void 0:m.predictAddress}).then(u=>u).catch(u=>{throw new Error(`Failed to get account address with factory contract ${o.address} on chain ID ${n.id}: ${(u==null?void 0:u.message)||"unknown error"}`,{cause:u})}),l=L({address:d,chain:n,client:i}),y=await Fa({...r,accountContract:l,chain:n,client:i,factoryContract:o,personalAccount:t,sponsorGas:c});if(it.set(t,y),R.set(y,t),r.sessionKey&&await sa({accountContract:l,newPermissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address})){const u=ea({account:t,contract:l,permissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address});await Ot({account:y,transaction:u})}return[y,n]}async function ye(a){const e=R.get(a);e&&(it.delete(e),R.delete(a))}async function Fa(a){var n,c;const e=(n=a.overrides)==null?void 0:n.tokenPaymaster;if(e&&k(((c=a.overrides)==null?void 0:c.entrypointAddress)||S)!=="v0.7")throw new Error("Token paymaster is only supported for entrypoint version v0.7");const t=a.sponsorGas;let i=a.accountContract;const r={address:K(i.address),async onTransactionRequested(s){var o,d;return(d=(o=a.personalAccount).onTransactionRequested)==null?void 0:d.call(o,s)},async sendBatchTransaction(s){var p,w;const o=Pt({accountContract:i,executeBatchOverride:(p=a.overrides)==null?void 0:p.executeBatch,transactions:s});if(s.length===0)throw new Error("No transactions to send");const d=s[0];if(!d)throw new Error("No transactions to send");const l=F(d.chainId),y=await N({executeTx:o,options:{...a,accountContract:i,chain:l}});return V({chainId:l.id,client:a.client,contractAddress:((w=s[0])==null?void 0:w.to)??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async sendTransaction(s){var p,w,A;let o;if(e){await Va({accountContract:i,erc20Paymaster:e,options:a});const G=async()=>({paymaster:e.paymasterAddress,paymasterData:"0x"});o=((p=a.overrides)==null?void 0:p.paymaster)||G}else o=(w=a.overrides)==null?void 0:w.paymaster;s.chainId!==i.chain.id&&(i=L({address:r.address,chain:F(s.chainId),client:a.client}));const d=J({accountContract:i,executeOverride:(A=a.overrides)==null?void 0:A.execute,transaction:s}),l=F(s.chainId),y=await N({executeTx:d,options:{...a,accountContract:i,chain:l,overrides:{...a.overrides,paymaster:o}}});return V({chainId:l.id,client:a.client,contractAddress:s.to??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async signMessage({message:s}){var d;if((d=a.overrides)!=null&&d.signMessage)return a.overrides.signMessage({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,message:s});const{smartAccountSignMessage:o}=await T(async()=>{const{smartAccountSignMessage:l}=await import("./signing-BxAbixw6.js").then(y=>y.Q);return{smartAccountSignMessage:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,message:s,options:a})},async signTypedData(s){var d;if((d=a.overrides)!=null&&d.signTypedData)return a.overrides.signTypedData({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,typedData:s});const{smartAccountSignTypedData:o}=await T(async()=>{const{smartAccountSignTypedData:l}=await import("./signing-BxAbixw6.js").then(y=>y.Q);return{smartAccountSignTypedData:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,options:a,typedData:s})},sendCalls:async s=>{const{inAppWalletSendCalls:o}=await T(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-DXx7lWeR.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),d=s.calls[0];if(!d)throw new Error("No calls to send");const l=d.client,y=d.chain||s.chain,p=await o({account:r,calls:s.calls,chain:y});return{chain:y,client:l,id:p}},getCallsStatus:async s=>{const{inAppWalletGetCallsStatus:o}=await T(async()=>{const{inAppWalletGetCallsStatus:d}=await import("./in-app-wallet-calls-DXx7lWeR.js");return{inAppWalletGetCallsStatus:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCallsStatusRaw:async s=>{const{inAppWalletGetCallsStatusRaw:o}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:d}=await import("./in-app-wallet-calls-DXx7lWeR.js");return{inAppWalletGetCallsStatusRaw:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCapabilities:async s=>({[s.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:t??!1}}})};return r}async function Va(a){var l;const{accountContract:e,erc20Paymaster:t,options:i}=a,r=t.tokenAddress,n=L({address:r,chain:e.chain,client:e.client});if(await $t({contract:n,owner:e.address,spender:t.paymasterAddress})>0n)return;const s=qt({amountWei:ra-1n,contract:n,spender:t.paymasterAddress}),o=await yt({from:e.address,transaction:s}),d=J({accountContract:e,executeOverride:(l=i.overrides)==null?void 0:l.execute,transaction:o});await N({executeTx:d,options:{...i,overrides:{...i.overrides,tokenPaymaster:void 0}}})}function Ua(a){const{creationOptions:e,connectionOptions:t,chain:i}=a,r={address:K(t.personalAccount.address),async onTransactionRequested(n){var c,s;return(s=(c=t.personalAccount).onTransactionRequested)==null?void 0:s.call(c,n)},async sendTransaction(n){var l,y,p,w;const c={chain:F(n.chainId),client:t.client,data:n.data,eip712:n.eip712,to:n.to??void 0,value:n.value??0n};let s=await Lt({account:r,transaction:c});if(a.sponsorGas&&!s.paymaster){const A=await Vt({options:{bundlerUrl:(l=e.overrides)==null?void 0:l.bundlerUrl,chain:i,client:t.client,entrypointAddress:(y=e.overrides)==null?void 0:y.entrypointAddress},transaction:s});s={...s,...A}}const o=await Dt({account:r,chainId:i.id,eip712Transaction:s}),d=await Ut({options:{bundlerUrl:(p=e.overrides)==null?void 0:p.bundlerUrl,chain:i,client:t.client,entrypointAddress:(w=e.overrides)==null?void 0:w.entrypointAddress},signedTransaction:o,transaction:s});return V({chainId:i.id,client:t.client,contractAddress:n.to??void 0,transactionHash:d.transactionHash,walletAddress:r.address,walletType:"smart"}),{chain:i,client:t.client,transactionHash:d.transactionHash}},async signMessage({message:n}){return t.personalAccount.signMessage({message:n})},async signTypedData(n){const c=xt(n);return t.personalAccount.signTypedData(c)},sendCalls:async n=>{const{inAppWalletSendCalls:c}=await T(async()=>{const{inAppWalletSendCalls:y}=await import("./in-app-wallet-calls-DXx7lWeR.js");return{inAppWalletSendCalls:y}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),s=n.calls[0];if(!s)throw new Error("No calls to send");const o=s.client,d=s.chain||n.chain,l=await c({account:r,calls:n.calls,chain:d});return{chain:d,client:o,id:l}},getCallsStatus:async n=>{const{inAppWalletGetCallsStatus:c}=await T(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-DXx7lWeR.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCallsStatusRaw:async n=>{const{inAppWalletGetCallsStatusRaw:c}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-DXx7lWeR.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCapabilities:async n=>({[n.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:a.sponsorGas??!1}}})};return r}async function N(a){var i,r,n;const{executeTx:e,options:t}=a;try{const c=await La({accountContract:t.accountContract,adminAddress:t.personalAccount.address,factoryContract:t.factoryContract,overrides:t.overrides,sponsorGas:t.sponsorGas,transaction:e}),s=await Sa({adminAccount:t.personalAccount,chain:t.chain,client:t.client,entrypointAddress:(i=t.overrides)==null?void 0:i.entrypointAddress,userOp:c}),o={bundlerUrl:(r=t.overrides)==null?void 0:r.bundlerUrl,chain:t.chain,client:t.client,entrypointAddress:(n=t.overrides)==null?void 0:n.entrypointAddress},d=await It({options:o,userOp:s}),l=await va({...o,userOpHash:d});return V({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),transactionHash:l.transactionHash,walletAddress:t.accountContract.address,walletType:"smart"}),{chain:t.chain,client:t.client,transactionHash:l.transactionHash}}catch(c){throw ct(c)&&ot({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),error:c,transactionValue:await D(e.value),walletAddress:t.accountContract.address}),c}finally{st(t.accountContract)}}async function Ia(a,e,t){const i=L({address:a,chain:t,client:e});try{return await C({contract:i,method:"function entrypoint() public view returns (address)"})}catch{return}}export{le as connectSmartAccount,ye as disconnectSmartAccount,Ia as getEntrypointFromFactory,Ae as isSmartWallet};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/decimals-CTAJwKFW.js","assets/utils-jd03xFBb.js","assets/sentry-B35L1FdR.js","assets/react-vyZjIDcS.js","assets/decimals-rMqzXjFU.js","assets/prepare-contract-call-BreQKHF6.js","assets/signing-BKT41maQ.js","assets/index-BMIuNfCB.js","assets/dcl-schemas-BICTSpB5.js","assets/ethers-CXBJm_wN.js","assets/intl-CBcMB1D2.js","assets/index-BMzstP-8.css","assets/to-serializable-transaction-BZX746C8.js","assets/transaction-8aHmZ7ni.js","assets/get-bytecode-Bg8NviKV.js","assets/in-app-wallet-calls-BI1PaW_x.js","assets/wait-for-tx-receipt-BEDrW5cD.js","assets/transactionReceipt-2D5Q3zvv.js","assets/sleep-mAKpSMLY.js","assets/send-batch-transaction-BHqPVqqQ.js","assets/send-transaction-0fPTuVE4.js","assets/execute-B3koRsQT.js","assets/detectExtension-0JcORGBX.js"])))=>i.map(i=>d[i]);
2
+ import{_ as T}from"./index-BMIuNfCB.js";import{t as V,i as ct,a as ot}from"./transaction-8aHmZ7ni.js";import{e as dt,i as mt,a as F}from"./utils-jd03xFBb.js";import{f as pt,h as q,e as $,i as ut,g as L,j as lt,t as yt}from"./to-serializable-transaction-BZX746C8.js";import{r as C,a5 as B,w as E,S as O,G as x,s as z,h as _,l as D,H as ft,k as wt,e as At,T as Gt,g as K}from"./prepare-contract-call-BreQKHF6.js";import{o as j,r as gt}from"./execute-B3koRsQT.js";import{Z,a as Y,p as Q,m as ht,b as Tt,d as J,e as Pt}from"./signing-BKT41maQ.js";import{t as vt,p as Lt,s as Dt}from"./send-eip712-transaction-D3zsFnZJ.js";import{s as Ot}from"./send-transaction-0fPTuVE4.js";import{p as xt}from"./linkAccount-D303ryxj.js";import{g as X,E as S,h as St,a as k,b as Ct,c as _t,d as Et,e as U,D as tt,f as at,i as Ft,j as Vt,k as Ut,l as It}from"./index-R3pS6x6y.js";import{M as Ae}from"./wallets-DQk0dtw_.js";import"./react-vyZjIDcS.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./detectExtension-0JcORGBX.js";import"./get-bytecode-Bg8NviKV.js";import"./eth_sendRawTransaction-DPdnXbFR.js";import"./sha256-NdAeiB0X.js";import"./ethereum-7duKFA0R.js";import"./types-DC0Zmj1B.js";import"./store-CraP4F4Y.js";import"./hashTypedData-BmEKHoZL.js";import"./index-B439DG-9.js";import"./events-DQ172AOg.js";import"./index-n-ShiY2h.js";import"./index-DgMAf2q5.js";import"./index-nibyPLVP.js";import"./index-CJdot1dH.js";import"./index-DNLfbOQJ.js";const bt="0xdd62ed3e",Rt=[{name:"owner",type:"address"},{name:"spender",type:"address"}],Nt=[{type:"uint256"}];async function $t(a){return C({contract:a.contract,method:[bt,Rt,Nt],params:[a.owner,a.spender]})}const kt="0x095ea7b3",Ht=[{name:"spender",type:"address"},{name:"value",type:"uint256"}],Mt=[{type:"bool"}];function Wt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[kt,Ht,Mt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.spender,t.value]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function qt(a){return Wt({asyncParams:async()=>{let e;if("amount"in a){const{decimals:t}=await T(async()=>{const{decimals:r}=await import("./decimals-CTAJwKFW.js");return{decimals:r}},__vite__mapDeps([0,1,2,3,4,5])),i=await t(a).catch(()=>18);e=pt(a.amount.toString(),i)}else e=a.amountWei;return{overrides:{erc20Value:{amountWei:e,tokenAddress:a.contract.address},...a.overrides},spender:a.spender,value:e}},contract:a.contract})}const Bt="0xf15d424e",zt=[{name:"signer",type:"address"}],Kt=[{components:[{name:"signer",type:"address"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"startTimestamp",type:"uint128"},{name:"endTimestamp",type:"uint128"}],name:"permissions",type:"tuple"}];async function jt(a){return C({contract:a.contract,method:[Bt,zt,Kt],params:[a.signer]})}const Zt="0x5892e236",Yt=[{components:[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}],name:"req",type:"tuple"},{name:"signature",type:"bytes"}],Qt=[];function Jt(a){const e=j(async()=>"asyncParams"in a?await a.asyncParams():a);return B({accessList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.accessList},authorizationList:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.authorizationList},contract:a.contract,erc20Value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.erc20Value},extraGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.extraGas},gas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gas},gasPrice:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.gasPrice},maxFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxFeePerGas},maxPriorityFeePerGas:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.maxPriorityFeePerGas},method:[Zt,Yt,Qt],nonce:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.nonce},params:async()=>{const t=await e();return[t.req,t.signature]},value:async()=>{var t;return(t=(await e()).overrides)==null?void 0:t.value}})}function W(){return new Date(Date.now()+1e3*60*60*24*365*10)}function b(a){return vt(Math.floor(a.getTime()/1e3))}const Xt=[{name:"signer",type:"address"},{name:"isAdmin",type:"uint8"},{name:"approvedTargets",type:"address[]"},{name:"nativeTokenLimitPerTransaction",type:"uint256"},{name:"permissionStartTimestamp",type:"uint128"},{name:"permissionEndTimestamp",type:"uint128"},{name:"reqValidityStartTimestamp",type:"uint128"},{name:"reqValidityEndTimestamp",type:"uint128"},{name:"uid",type:"bytes32"}];async function ta(a){const{account:e,contract:t,req:i}=a,r=await e.signTypedData({domain:{chainId:t.chain.id,name:"Account",verifyingContract:t.address,version:"1"},message:i,primaryType:"SignerPermissionRequest",types:{SignerPermissionRequest:Xt}});return{req:i,signature:r}}async function aa(a){var i;const{target:e,permissions:t}=a;return{approvedTargets:t.approvedTargets==="*"?[Z]:t.approvedTargets,isAdmin:0,nativeTokenLimitPerTransaction:q(((i=t.nativeTokenLimitPerTransaction)==null?void 0:i.toString())||"0"),permissionEndTimestamp:b(t.permissionEndTimestamp||W()),permissionStartTimestamp:b(t.permissionStartTimestamp||new Date(0)),reqValidityEndTimestamp:b(W()),reqValidityStartTimestamp:0n,signer:e,uid:await gt()}}function ea(a){const{contract:e,sessionKeyAddress:t,account:i,permissions:r}=a;return Jt({async asyncParams(){const{req:n,signature:c}=await ta({account:i,contract:e,req:await aa({permissions:r,target:t})});return{req:n,signature:c}},contract:e})}async function sa(a){var c;const{accountContract:e,sessionKeyAddress:t,newPermissions:i}=a;if(!await Y(e))return!0;const n=await jt({contract:e,signer:t});return!!(n.endTimestamp&&n.endTimestamp<Math.floor(Date.now()/1e3)||!na(n.approvedTargets,i.approvedTargets)||q(((c=i.nativeTokenLimitPerTransaction)==null?void 0:c.toString())??"0")>n.nativeTokenLimitPerTransaction)}function na(a,e){return e==="*"&&a.length===1&&a[0]===Z?!0:e!=="*"?e.map(t=>t.toLowerCase()).every(t=>a.map(i=>i.toLowerCase()).includes(t)):!1}const ra=2n**96n-1n,ia="0x35567e1a",ca=[{name:"sender",type:"address"},{name:"key",type:"uint192"}],oa=[{name:"nonce",type:"uint256"}];async function da(a){return C({contract:a.contract,method:[ia,ca,oa],params:[a.sender,a.key]})}const ma="0xa6193531",pa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],ua=[{type:"bytes32"}];async function la(a){return C({contract:a.contract,method:[ma,pa,ua],params:[a.userOp]})}const ya="0x22cdde4c",fa=[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],wa=[{type:"bytes32"}];async function Aa(a){return C({contract:a.contract,method:[ya,fa,wa],params:[a.userOp]})}function Ga(a){return a.factory?E([a.factory,a.factoryData||"0x"]):"0x"}function ga(a){return E([O(x(BigInt(a.verificationGasLimit)),{size:16}),O(x(BigInt(a.callGasLimit)),{size:16})])}function ha(a){return E([O(x(BigInt(a.maxPriorityFeePerGas)),{size:16}),O(x(BigInt(a.maxFeePerGas)),{size:16})])}function Ta(a){return a.paymaster?E([a.paymaster,O(x(BigInt(a.paymasterVerificationGasLimit||0)),{size:16}),O(x(BigInt(a.paymasterPostOpGasLimit||0)),{size:16}),a.paymasterData||"0x"]):"0x"}const Pa=a=>({accountGasLimits:ga(a),callData:a.callData,gasFees:ha(a),initCode:Ga(a),nonce:BigInt(a.nonce),paymasterAndData:Ta(a),preVerificationGas:BigInt(a.preVerificationGas),sender:a.sender,signature:a.signature});async function I(a){var A;const{userOp:e,paymasterOverride:t,client:i,chain:r,entrypointAddress:n}=a;if(t)return t(e);const c={"Content-Type":"application/json"},s=n??S,o=X(r),d={id:1,jsonrpc:"2.0",method:"pm_sponsorUserOperation",params:[St(e),s]},y=await dt(i)(o,{body:z(d),headers:c,method:"POST"});if(!y.ok){const G=await y.text()||y.statusText;throw new Error(`Paymaster error: ${y.status} - ${G}`)}const p=await y.json();if(p.result)return typeof p.result=="string"?{paymasterAndData:p.result}:(p.result.reason&&console.warn(`Paymaster policy rejected this transaction with reason: ${p.result.reason} ${p.result.policyId?`(policyId: ${p.result.policyId})`:""}`),{callGasLimit:p.result.callGasLimit?_(p.result.callGasLimit):void 0,paymaster:p.result.paymaster,paymasterAndData:p.result.paymasterAndData,paymasterData:p.result.paymasterData,paymasterPostOpGasLimit:p.result.paymasterPostOpGasLimit?_(p.result.paymasterPostOpGasLimit):void 0,paymasterVerificationGasLimit:p.result.paymasterVerificationGasLimit?_(p.result.paymasterVerificationGasLimit):void 0,preVerificationGas:p.result.preVerificationGas?_(p.result.preVerificationGas):void 0,verificationGasLimit:p.result.verificationGasLimit?_(p.result.verificationGasLimit):void 0});const w=((A=p.error)==null?void 0:A.message)||p.error||y.statusText||"unknown error";throw new Error(`Paymaster error from ${o}: ${w}`)}const H=new Set,M=a=>`${a.chain.id}:${a.address}`,et=a=>{H.add(M(a))},st=a=>{H.delete(M(a))},nt=a=>H.has(M(a));async function va(a){const e=a.timeoutMs||12e4,t=a.intervalMs||1e3,i=Date.now()+e;for(;Date.now()<i;){const r=await Ct(a);if(r)return r;await new Promise(n=>setTimeout(n,t))}throw new Error(`Timeout waiting for userOp to be mined on chain ${a.chain.id} with UserOp hash: ${a.userOpHash}`)}async function La(a){var P;const{transaction:e,accountContract:t,factoryContract:i,adminAddress:r,overrides:n,sponsorGas:c,waitForDeployment:s=!0,isDeployedOverride:o}=a,d=e.chain,l=e.client,y={bundlerUrl:n==null?void 0:n.bundlerUrl,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress},p=k(((P=a.overrides)==null?void 0:P.entrypointAddress)||S),[w,A,G,g,f]=await Promise.all([typeof o=="boolean"?o:Y(t).then(h=>h||nt(t)),$(e),D(e.gas),Da({bundlerOptions:y,chain:d,client:l,executeTx:e}),Ea({accountContract:t,chain:d,client:l,entrypointAddress:n==null?void 0:n.entrypointAddress,getNonceOverride:n==null?void 0:n.getAccountNonce})]),{maxFeePerGas:m,maxPriorityFeePerGas:u}=g;return p==="v0.7"?Oa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s}):xa({accountContract:t,adminAddress:r,bundlerOptions:y,callData:A,callGasLimit:G,factoryContract:i,isDeployed:w,maxFeePerGas:m,maxPriorityFeePerGas:u,nonce:f,overrides:n,sponsorGas:c,waitForDeployment:s})}async function Da(a){const{executeTx:e,bundlerOptions:t,chain:i,client:r}=a;let{maxFeePerGas:n,maxPriorityFeePerGas:c}=e;const s=(t==null?void 0:t.bundlerUrl)??X(i);if(mt(s)){const o=await _t({options:t});n=o.maxFeePerGas,c=o.maxPriorityFeePerGas}else{const[o,d]=await Promise.all([D(n),D(c)]);if(o&&d)n=o,c=d;else{const l=await ut(r,i);c=d??l.maxPriorityFeePerGas??0n,n=o??l.maxFeePerGas??0n}}return{maxFeePerGas:n,maxPriorityFeePerGas:c}}async function Oa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g,f;t?(f="0x",w&&await rt(r)):(g=i.address,f=await $(Q({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i})),w&&et(r));const m={callData:d,callGasLimit:l??0n,factory:g,factoryData:f,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymaster:void 0,paymasterData:"0x",paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n,preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const u=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});if(u.paymaster&&u.paymasterData&&(m.paymaster=u.paymaster,m.paymasterData=u.paymasterData),u.callGasLimit&&u.verificationGasLimit&&u.preVerificationGas&&u.paymasterPostOpGasLimit&&u.paymasterVerificationGasLimit)m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit;else{const P=s!=null&&s.tokenPaymaster?{[s.tokenPaymaster.tokenAddress]:{stateDiff:{[wt(At([{type:"address"},{type:"uint256"}],[r.address,s.tokenPaymaster.balanceStorageSlot]))]:Gt(ht,{size:32})}}}:void 0,h=await U({options:e,userOp:m},P);m.callGasLimit=h.callGasLimit,m.verificationGasLimit=h.verificationGasLimit,m.preVerificationGas=h.preVerificationGas,m.paymasterPostOpGasLimit=s!=null&&s.tokenPaymaster?500000n:h.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=h.paymasterVerificationGasLimit||0n;const v=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:m});v.paymaster&&v.paymasterData&&(m.paymaster=v.paymaster,m.paymasterData=v.paymasterData)}}else{const u=await U({options:e,userOp:m});m.callGasLimit=u.callGasLimit,m.verificationGasLimit=u.verificationGasLimit,m.preVerificationGas=u.preVerificationGas,m.paymasterPostOpGasLimit=u.paymasterPostOpGasLimit||0n,m.paymasterVerificationGasLimit=u.paymasterVerificationGasLimit||0n}return{...m,signature:"0x"}}async function xa(a){const{bundlerOptions:e,isDeployed:t,factoryContract:i,accountContract:r,adminAddress:n,sponsorGas:c,overrides:s,nonce:o,callData:d,callGasLimit:l,maxFeePerGas:y,maxPriorityFeePerGas:p,waitForDeployment:w}=a,{chain:A,client:G}=e;let g;t?(g="0x",w&&await rt(r)):(g=await _a({accountSalt:s==null?void 0:s.accountSalt,adminAddress:n,createAccountOverride:s==null?void 0:s.createAccount,factoryContract:i}),w&&et(r));const f={callData:d,callGasLimit:l??0n,initCode:g,maxFeePerGas:y,maxPriorityFeePerGas:p,nonce:o,paymasterAndData:"0x",preVerificationGas:0n,sender:r.address,signature:tt,verificationGasLimit:0n};if(c){const m=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),u="paymasterAndData"in m?m.paymasterAndData:"0x";if(u&&u!=="0x"&&(f.paymasterAndData=u),m.callGasLimit&&m.verificationGasLimit&&m.preVerificationGas)f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas;else{const P=await U({options:e,userOp:f});if(f.callGasLimit=P.callGasLimit,f.verificationGasLimit=P.verificationGasLimit,f.preVerificationGas=P.preVerificationGas,u&&u!=="0x"){const h=await I({chain:A,client:G,entrypointAddress:s==null?void 0:s.entrypointAddress,paymasterOverride:s==null?void 0:s.paymaster,userOp:f}),v="paymasterAndData"in h?h.paymasterAndData:"0x";v&&v!=="0x"&&(f.paymasterAndData=v)}}}else{const m=await U({options:e,userOp:f});f.callGasLimit=m.callGasLimit,f.verificationGasLimit=m.verificationGasLimit,f.preVerificationGas=m.preVerificationGas}return{...f,signature:"0x"}}async function Sa(a){const{userOp:e,chain:t,entrypointAddress:i,adminAccount:r}=a,n=await Ca({chain:t,client:a.client,entrypointAddress:i,userOp:e});if(r.signMessage){const c=await r.signMessage({chainId:t.id,message:{raw:ft(n)},originalMessage:z(e)});return{...e,signature:c}}throw new Error("signMessage not implemented in signingAccount")}async function Ca(a){const{userOp:e,chain:t,entrypointAddress:i}=a,r=k(i||S);let n;if(r==="v0.7"){const c=Pa(e);n=await Aa({contract:L({address:i||at,chain:t,client:a.client}),userOp:c})}else n=await la({contract:L({address:i||S,chain:t,client:a.client}),userOp:e});return n}async function _a(a){const{factoryContract:e,adminAddress:t,accountSalt:i,createAccountOverride:r}=a,n=Q({accountSalt:i,adminAddress:t,createAccountOverride:r,factoryContract:e});return E([e.address,await $(n)])}async function Ea(a){const{accountContract:e,chain:t,client:i,entrypointAddress:r,getNonceOverride:n}=a;return n?n(e):await da({contract:L({address:r||S,chain:t,client:i}),key:Et(),sender:e.address})}async function rt(a){const e=Date.now();for(;nt(a);){if(Date.now()-e>6e4)throw st(a),new Error("Account deployment is taking too long (over 1 minute). Please try again.");await new Promise(t=>setTimeout(t,500))}}const it=new WeakMap,R=new WeakMap;async function le(a,e){var p,w,A,G,g,f,m;const{personalAccount:t,client:i}=a;if(!t)throw new Error("No personal account provided for smart account connection");const r=e,n=e.chain,c="gasless"in r?r.gasless:r.sponsorGas;if(await lt(n))return[Ua({chain:n,connectionOptions:a,creationOptions:e,sponsorGas:c}),n];if(r.factoryAddress&&!((p=r.overrides)!=null&&p.entrypointAddress)){const u=await Ia(r.factoryAddress,i,n);u&&(r.overrides={...r.overrides,entrypointAddress:u})}(w=r.overrides)!=null&&w.tokenPaymaster&&!((A=r.overrides)!=null&&A.entrypointAddress)&&(r.overrides={...r.overrides,entrypointAddress:at});const s=r.factoryAddress??Ft((G=r.overrides)==null?void 0:G.entrypointAddress),o=L({address:s,chain:n,client:i}),d=await Tt({accountAddress:(g=r.overrides)==null?void 0:g.accountAddress,accountSalt:(f=r.overrides)==null?void 0:f.accountSalt,adminAddress:t.address,factoryContract:o,predictAddressOverride:(m=r.overrides)==null?void 0:m.predictAddress}).then(u=>u).catch(u=>{throw new Error(`Failed to get account address with factory contract ${o.address} on chain ID ${n.id}: ${(u==null?void 0:u.message)||"unknown error"}`,{cause:u})}),l=L({address:d,chain:n,client:i}),y=await Fa({...r,accountContract:l,chain:n,client:i,factoryContract:o,personalAccount:t,sponsorGas:c});if(it.set(t,y),R.set(y,t),r.sessionKey&&await sa({accountContract:l,newPermissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address})){const u=ea({account:t,contract:l,permissions:r.sessionKey.permissions,sessionKeyAddress:r.sessionKey.address});await Ot({account:y,transaction:u})}return[y,n]}async function ye(a){const e=R.get(a);e&&(it.delete(e),R.delete(a))}async function Fa(a){var n,c;const e=(n=a.overrides)==null?void 0:n.tokenPaymaster;if(e&&k(((c=a.overrides)==null?void 0:c.entrypointAddress)||S)!=="v0.7")throw new Error("Token paymaster is only supported for entrypoint version v0.7");const t=a.sponsorGas;let i=a.accountContract;const r={address:K(i.address),async onTransactionRequested(s){var o,d;return(d=(o=a.personalAccount).onTransactionRequested)==null?void 0:d.call(o,s)},async sendBatchTransaction(s){var p,w;const o=Pt({accountContract:i,executeBatchOverride:(p=a.overrides)==null?void 0:p.executeBatch,transactions:s});if(s.length===0)throw new Error("No transactions to send");const d=s[0];if(!d)throw new Error("No transactions to send");const l=F(d.chainId),y=await N({executeTx:o,options:{...a,accountContract:i,chain:l}});return V({chainId:l.id,client:a.client,contractAddress:((w=s[0])==null?void 0:w.to)??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async sendTransaction(s){var p,w,A;let o;if(e){await Va({accountContract:i,erc20Paymaster:e,options:a});const G=async()=>({paymaster:e.paymasterAddress,paymasterData:"0x"});o=((p=a.overrides)==null?void 0:p.paymaster)||G}else o=(w=a.overrides)==null?void 0:w.paymaster;s.chainId!==i.chain.id&&(i=L({address:r.address,chain:F(s.chainId),client:a.client}));const d=J({accountContract:i,executeOverride:(A=a.overrides)==null?void 0:A.execute,transaction:s}),l=F(s.chainId),y=await N({executeTx:d,options:{...a,accountContract:i,chain:l,overrides:{...a.overrides,paymaster:o}}});return V({chainId:l.id,client:a.client,contractAddress:s.to??void 0,transactionHash:y.transactionHash,walletAddress:a.accountContract.address,walletType:"smart"}),y},async signMessage({message:s}){var d;if((d=a.overrides)!=null&&d.signMessage)return a.overrides.signMessage({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,message:s});const{smartAccountSignMessage:o}=await T(async()=>{const{smartAccountSignMessage:l}=await import("./signing-BKT41maQ.js").then(y=>y.Q);return{smartAccountSignMessage:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,message:s,options:a})},async signTypedData(s){var d;if((d=a.overrides)!=null&&d.signTypedData)return a.overrides.signTypedData({accountContract:i,adminAccount:a.personalAccount,factoryContract:a.factoryContract,typedData:s});const{smartAccountSignTypedData:o}=await T(async()=>{const{smartAccountSignTypedData:l}=await import("./signing-BKT41maQ.js").then(y=>y.Q);return{smartAccountSignTypedData:l}},__vite__mapDeps([6,5,1,2,3,7,8,9,10,11,12,13,14]));return o({accountContract:i,factoryContract:a.factoryContract,options:a,typedData:s})},sendCalls:async s=>{const{inAppWalletSendCalls:o}=await T(async()=>{const{inAppWalletSendCalls:w}=await import("./in-app-wallet-calls-BI1PaW_x.js");return{inAppWalletSendCalls:w}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),d=s.calls[0];if(!d)throw new Error("No calls to send");const l=d.client,y=d.chain||s.chain,p=await o({account:r,calls:s.calls,chain:y});return{chain:y,client:l,id:p}},getCallsStatus:async s=>{const{inAppWalletGetCallsStatus:o}=await T(async()=>{const{inAppWalletGetCallsStatus:d}=await import("./in-app-wallet-calls-BI1PaW_x.js");return{inAppWalletGetCallsStatus:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCallsStatusRaw:async s=>{const{inAppWalletGetCallsStatusRaw:o}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:d}=await import("./in-app-wallet-calls-BI1PaW_x.js");return{inAppWalletGetCallsStatusRaw:d}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return o(s)},getCapabilities:async s=>({[s.chainId??1]:{atomic:{status:"supported"},paymasterService:{supported:t??!1}}})};return r}async function Va(a){var l;const{accountContract:e,erc20Paymaster:t,options:i}=a,r=t.tokenAddress,n=L({address:r,chain:e.chain,client:e.client});if(await $t({contract:n,owner:e.address,spender:t.paymasterAddress})>0n)return;const s=qt({amountWei:ra-1n,contract:n,spender:t.paymasterAddress}),o=await yt({from:e.address,transaction:s}),d=J({accountContract:e,executeOverride:(l=i.overrides)==null?void 0:l.execute,transaction:o});await N({executeTx:d,options:{...i,overrides:{...i.overrides,tokenPaymaster:void 0}}})}function Ua(a){const{creationOptions:e,connectionOptions:t,chain:i}=a,r={address:K(t.personalAccount.address),async onTransactionRequested(n){var c,s;return(s=(c=t.personalAccount).onTransactionRequested)==null?void 0:s.call(c,n)},async sendTransaction(n){var l,y,p,w;const c={chain:F(n.chainId),client:t.client,data:n.data,eip712:n.eip712,to:n.to??void 0,value:n.value??0n};let s=await Lt({account:r,transaction:c});if(a.sponsorGas&&!s.paymaster){const A=await Vt({options:{bundlerUrl:(l=e.overrides)==null?void 0:l.bundlerUrl,chain:i,client:t.client,entrypointAddress:(y=e.overrides)==null?void 0:y.entrypointAddress},transaction:s});s={...s,...A}}const o=await Dt({account:r,chainId:i.id,eip712Transaction:s}),d=await Ut({options:{bundlerUrl:(p=e.overrides)==null?void 0:p.bundlerUrl,chain:i,client:t.client,entrypointAddress:(w=e.overrides)==null?void 0:w.entrypointAddress},signedTransaction:o,transaction:s});return V({chainId:i.id,client:t.client,contractAddress:n.to??void 0,transactionHash:d.transactionHash,walletAddress:r.address,walletType:"smart"}),{chain:i,client:t.client,transactionHash:d.transactionHash}},async signMessage({message:n}){return t.personalAccount.signMessage({message:n})},async signTypedData(n){const c=xt(n);return t.personalAccount.signTypedData(c)},sendCalls:async n=>{const{inAppWalletSendCalls:c}=await T(async()=>{const{inAppWalletSendCalls:y}=await import("./in-app-wallet-calls-BI1PaW_x.js");return{inAppWalletSendCalls:y}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22])),s=n.calls[0];if(!s)throw new Error("No calls to send");const o=s.client,d=s.chain||n.chain,l=await c({account:r,calls:n.calls,chain:d});return{chain:d,client:o,id:l}},getCallsStatus:async n=>{const{inAppWalletGetCallsStatus:c}=await T(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-BI1PaW_x.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCallsStatusRaw:async n=>{const{inAppWalletGetCallsStatusRaw:c}=await T(async()=>{const{inAppWalletGetCallsStatusRaw:s}=await import("./in-app-wallet-calls-BI1PaW_x.js");return{inAppWalletGetCallsStatusRaw:s}},__vite__mapDeps([15,16,17,5,1,2,3,12,7,8,9,10,11,13,18,19,20,21,22]));return c(n)},getCapabilities:async n=>({[n.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:a.sponsorGas??!1}}})};return r}async function N(a){var i,r,n;const{executeTx:e,options:t}=a;try{const c=await La({accountContract:t.accountContract,adminAddress:t.personalAccount.address,factoryContract:t.factoryContract,overrides:t.overrides,sponsorGas:t.sponsorGas,transaction:e}),s=await Sa({adminAccount:t.personalAccount,chain:t.chain,client:t.client,entrypointAddress:(i=t.overrides)==null?void 0:i.entrypointAddress,userOp:c}),o={bundlerUrl:(r=t.overrides)==null?void 0:r.bundlerUrl,chain:t.chain,client:t.client,entrypointAddress:(n=t.overrides)==null?void 0:n.entrypointAddress},d=await It({options:o,userOp:s}),l=await va({...o,userOpHash:d});return V({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),transactionHash:l.transactionHash,walletAddress:t.accountContract.address,walletType:"smart"}),{chain:t.chain,client:t.client,transactionHash:l.transactionHash}}catch(c){throw ct(c)&&ot({chainId:t.chain.id,client:t.client,contractAddress:await D(e.to??void 0),error:c,transactionValue:await D(e.value),walletAddress:t.accountContract.address}),c}finally{st(t.accountContract)}}async function Ia(a,e,t){const i=L({address:a,chain:t,client:e});try{return await C({contract:i,method:"function entrypoint() public view returns (address)"})}catch{return}}export{le as connectSmartAccount,ye as disconnectSmartAccount,Ia as getEntrypointFromFactory,Ae as isSmartWallet};
@@ -1,4 +1,4 @@
1
- import{i as u,b as h}from"./lit-element-B3y9oplH.js";import{n as d,o as f}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CkBDyoGg.js";import{d as g,r as m,e as b}from"./index-b_a6Xe2g.js";const y=g`
1
+ import{i as u,b as h}from"./lit-element-B3y9oplH.js";import{n as d,o as f}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-hwCoxi9L.js";import{d as g,r as m,e as b}from"./index-BUo3wAlN.js";const y=g`
2
2
  :host {
3
3
  display: inline-flex;
4
4
  justify-content: center;
@@ -1 +1 @@
1
- import{g as x,k as N,r as i,j as f}from"./react-vyZjIDcS.js";import{a as v,g}from"./dcl-schemas-BICTSpB5.js";import{bp as L}from"./index-yJi2QIJf.js";import{r as q,g as he,h as ye}from"./createSvgIcon-DLpGC0um.js";import{n as M}from"./emotion-styled.browser.esm-Bl0xNQms.js";import{C as ve}from"./CircularProgress-BRaMu2HF.js";var A={},oe;function Ee(){if(oe)return A;oe=1,Object.defineProperty(A,"__esModule",{value:!0});function e(){let r,n;const t=new Promise((s,u)=>{r=c=>{s(c),t.isPending=!1},n=c=>{u(c),t.isPending=!1}}).catch(s=>Promise.reject(s));return t.resolve=r,t.reject=n,"finally"in t||(t.finally=s=>{t.then(s),t.catch(s)}),t.isPending=!0,t}return A.future=e,A.default=e,A}var we=Ee();const be=x(we);function se(e){return{all:e=e||new Map,on:function(r,n){var t=e.get(r);t?t.push(n):e.set(r,[n])},off:function(r,n){var t=e.get(r);t&&(n?t.splice(t.indexOf(n)>>>0,1):e.set(r,[]))},emit:function(r,n){var t=e.get(r);t&&t.slice().map(function(s){s(n)}),(t=e.get("*"))&&t.slice().map(function(s){s(r,n)})}}}const S=new Map,Y=new Map,Z=new Map,k=new Map;function ae(e){const r=document.getElementById(e);return!r||!r.contentWindow?!1:Z.get(r.contentWindow)??!1}function H(e){if(e.data&&e.data.type)try{switch(e.data.type){case v.PreviewMessageType.CONTROLLER_RESPONSE:{const r=e.data.payload,{id:n}=r,t=S.get(n);t&&(S.delete(n),r.ok?t.resolve(r.result):r.ok===!1&&t.reject(new Error(r.error)));break}case v.PreviewMessageType.EMOTE_EVENT:{const r=e.data.payload,{type:n,payload:t}=r,s=e.source?Y.get(e.source):null;s&&n&&s.emit(n,t);break}case v.PreviewMessageType.LOAD:{e.source&&(Z.set(e.source,!0),(k.get(e.source)||[]).filter(t=>{var s;return((s=t.data)==null?void 0:s.type)!==v.PreviewMessageType.LOAD}).forEach(H),k.delete(e.source));break}default:}}catch(r){console.error("Error processing WearablePreview message:",r)}}const Pe=e=>{var n;if(((n=e.data)==null?void 0:n.type)===v.PreviewMessageType.LOAD){H(e);return}if(!(e.source?Z.get(e.source):!1)&&e.source){const t=k.get(e.source)||[];t.push(e),k.set(e.source,t);return}H(e)};typeof window<"u"&&window.addEventListener("message",Pe,!1);let ie=0;function Se(e){return function(n,t,s){const u=document.getElementById(e);if(!u||!u.contentWindow){const d=new Error("iframe not found or not accessible");return Promise.reject(d)}const c=e+"-"+ie,l=be();S.set(c,l);const p=v.PreviewMessageType.CONTROLLER_REQUEST,y={id:c,namespace:n,method:t,params:s},m=setTimeout(()=>{S.delete(c),l.reject(new Error(`Request timeout for ${t}`))},1e4),a=l.resolve,j=l.reject;l.resolve=d=>{clearTimeout(m),a(d)},l.reject=d=>{clearTimeout(m),j(d)};try{v.sendMessage(u.contentWindow,p,y)}catch(d){const w=d instanceof Error?d.message:String(d);l.reject(new Error(`Failed to send message: ${w}`)),S.delete(c),clearTimeout(m)}return ie++,l}}function Me(e){const r=document.getElementById(e);if(!r)throw new Error(`Could not find an iframe with id="${e}"`);S.clear();const n=r.contentWindow?Y.get(r.contentWindow)??se():se();r.contentWindow&&Y.set(r.contentWindow,n);const t=Se(e);return{scene:{getScreenshot(s,u){return t("scene","getScreenshot",[s,u])},getMetrics(){return t("scene","getMetrics",[])},changeZoom:function(s){return t("scene","changeZoom",[s])},panCamera:function(s){return t("scene","panCamera",[s])},changeCameraPosition:function(s){return t("scene","changeCameraPosition",[s])},cleanup(){return t("scene","cleanup",[])},setUsername:function(s){return t("scene","setUsername",[s])}},emote:{getLength(){return t("emote","getLength",[])},isPlaying(){return t("emote","isPlaying",[])},goTo(s){return t("emote","goTo",[s])},play(){return t("emote","play",[])},pause(){return t("emote","pause",[])},stop(){return t("emote","stop",[])},enableSound(){return t("emote","enableSound",[])},disableSound(){return t("emote","disableSound",[])},hasSound(){return t("emote","hasSound",[])},isSocialEmote(){return t("emote","isSocialEmote",[])},getSocialEmoteAnimations(){return t("emote","getSocialEmoteAnimations",[])},getPlayingSocialEmoteAnimation(){return t("emote","getPlayingSocialEmoteAnimation",[])},emote:null,events:n},physics:{setSpringBonesParams(s,u){return t("physics","setSpringBonesParams",[s,u])}}}}var R={},ue;function Ae(){if(ue)return R;ue=1;var e=L();Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var r=e(q()),n=N();return R.default=(0,r.default)((0,n.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),R}var Re=Ae();const Te=x(Re);var T={},ce;function Ce(){if(ce)return T;ce=1;var e=L();Object.defineProperty(T,"__esModule",{value:!0}),T.default=void 0;var r=e(q()),n=N();return T.default=(0,r.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),T}var Ie=Ce();const xe=x(Ie);var C={},le;function je(){if(le)return C;le=1;var e=L();Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var r=e(q()),n=N();return C.default=(0,r.default)((0,n.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z"}),"VolumeOff"),C}var _e=je();const Oe=x(_e);var I={},de;function ke(){if(de)return I;de=1;var e=L();Object.defineProperty(I,"__esModule",{value:!0}),I.default=void 0;var r=e(q()),n=N();return I.default=(0,r.default)((0,n.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),I}var Ne=ke();const Le=x(Ne),qe=(e,r)=>{const n=i.useRef(null),[t,s]=i.useState(!1);return i.useEffect(()=>{const u=r??Me(e);if(n.current=u,ae(e)){s(!0);return}const c=document.getElementById(e);if(!c){console.error(`Could not find iframe with id="${e}"`);return}if(!c.contentWindow){console.error(`Iframe contentWindow is not accessible for id="${e}"`);return}const p=y=>{var m;((m=y.data)==null?void 0:m.type)===v.PreviewMessageType.LOAD&&ae(e)&&s(!0)};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),s(!1),n.current=null}},[e,r]),{controllerRef:n,isReady:t}},We={small:16,medium:20,large:24},me=({children:e,startIcon:r,endIcon:n,loading:t=!1,loadingIcon:s,loadingPosition:u="center",disabled:c=!1,size:l="medium",...p})=>{const y=f.jsx(ve,{color:"inherit",size:We[l]}),m=s||y,a=t&&u==="center"?m:e;return f.jsx(he,{disabled:c||t,startIcon:t&&u==="start"?m:r,endIcon:t&&u==="end"?m:n,size:l,...p,children:a})},Ve=M(ye)(({theme:e})=>({display:"flex",position:"absolute",width:"100%",bottom:0,margin:`${e.spacing(2)} 0`,padding:`0 ${e.spacing(3)}`,gap:e.spacing(2)})),Ue=M(me)(({theme:e})=>({width:56,height:44,padding:0,minWidth:"unset",background:"rgba(0, 0, 0, 0.64) !important","& svg":{marginLeft:e.spacing(.5)}})),De=M(me)(({theme:e,muted:r})=>({marginLeft:e.spacing(2.5),minWidth:25,background:"none",padding:0,opacity:r?.5:1})),Fe=M("input")(({theme:e})=>({flex:1,width:"100%",background:"none",WebkitAppearance:"none","&:focus":{outline:"none"},"&::-webkit-slider-thumb":{WebkitAppearance:"none",width:24,height:24,borderRadius:10,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",paddingBottom:e.spacing(.625),marginTop:e.spacing(-.5)},"&::-moz-range-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",border:"none"},"&::-ms-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer"},"&::-webkit-slider-runnable-track":{width:300,height:15,background:"rgba(115, 110, 125, 0.32)",border:"none",borderRadius:10},"&::-moz-range-track":{width:"100%",height:15,borderRadius:10,cursor:"pointer",background:"rgba(115, 110, 125, 0.32)"}})),Be=M("div")({display:"flex",alignItems:"center"}),ze=M("input")({width:56,height:44,borderRadius:5,background:"transparent",border:"1px solid rgba(115, 110, 125, 0.4)",color:"white",textAlign:"center","&:focus-visible":{outline:"1px solid"}}),$e=({wearablePreviewId:e,className:r,hideFrameInput:n,hideProgressInput:t,hidePlayButton:s,hideSoundButton:u,wearablePreviewController:c,renderPlayButton:l,renderSoundButton:p,renderProgressBar:y,renderFrameInput:m})=>{const{controllerRef:a,isReady:j}=qe(e,c),[d,w]=i.useState(0),[b,W]=i.useState(!1),[h,fe]=i.useState(void 0),[P,ge]=i.useState(!0),[_,G]=i.useState(void 0),[J,Q]=i.useState(!1),[K,X]=i.useState(!1),V=i.useCallback(()=>{w(0)},[]),U=i.useCallback(()=>{W(!1),w(o=>o>=Math.floor((h??0)*100)?0:o)},[h]),D=i.useCallback(()=>{W(!1)},[]),F=i.useCallback(async()=>{if(!K){let o=h;!h&&a.current&&(o=await a.current.emote.getLength()),W(!0),fe(o)}},[h,K,a]),B=i.useCallback(({length:o})=>{w(Math.ceil((o??0)*100))},[]);i.useEffect(()=>{const o=a.current;if(o)return o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_LOOP,V),()=>{o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_LOOP,V)}},[a,F,B,U,D,V]),i.useEffect(()=>{_===void 0&&j&&a.current&&a.current.emote.hasSound().then(o=>G(o)).catch(o=>{console.error("Error checking sound:",o),G(!1)})},[_,j,a]);const z=i.useCallback(async()=>{if(a.current)try{await a.current.emote.play()}catch(o){console.error("Error playing emote:",o)}},[a]),$=i.useCallback(async()=>{if(a.current)try{await a.current.emote.pause()}catch(o){console.error("Error pausing emote:",o)}},[a]),ee=i.useCallback(async()=>{b?await $():await z()},[b,z,$]),te=i.useCallback(()=>{var o,E;P?(o=a.current)==null||o.emote.disableSound():(E=a.current)==null||E.emote.enableSound(),ge(!P)},[P,a]),O=i.useCallback(async o=>{if(isNaN(o)||!a.current)return;let E=o;const ne=h??0;ne*100<o&&(E=ne*100),w(E),X(!0);try{b&&(await a.current.emote.pause(),Q(!0)),await a.current.emote.goTo(E/100)}catch(pe){console.error("Error changing frame:",pe)}},[h,b,a]),re=i.useCallback(async()=>{if(X(!1),J&&a.current){try{await a.current.emote.play()}catch(o){console.error("Error resuming play:",o)}Q(!1)}},[J,a]);return f.jsxs(Ve,{className:r,children:[s?null:l?l({isPlaying:b,onPlay:z,onPause:$,onToggle:ee}):f.jsx(Ue,{onClick:ee,children:b?f.jsx(Te,{}):f.jsx(xe,{})}),t?null:y?y({frame:d,length:h??0,onChange:O,onMouseUp:re}):f.jsx(Fe,{type:"range",value:d,max:Math.ceil((h??0)*100),min:0,step:1,onChange:o=>O(Number(o.target.value)),onMouseUp:re}),n?null:f.jsx(Be,{children:m?m({frame:Math.round(d/100),onChange:o=>O(o*100)}):f.jsx(ze,{type:"number",value:Math.round(d/100),onChange:o=>O(Number(o.target.value)*100)})}),u||!_?null:p?p({isSoundEnabled:P,hasSound:_,onToggle:te}):f.jsx(De,{muted:!P,onClick:te,children:P?f.jsx(Le,{}):f.jsx(Oe,{})})]})},Ke=Object.freeze(Object.defineProperty({__proto__:null,EmoteControls:$e},Symbol.toStringTag,{value:"Module"}));export{me as B,$e as E,Me as c,Ke as i,qe as u};
1
+ import{g as x,k as N,r as i,j as f}from"./react-vyZjIDcS.js";import{a as v,g}from"./dcl-schemas-BICTSpB5.js";import{bq as L}from"./index-BMIuNfCB.js";import{r as q,g as he,h as ye}from"./createSvgIcon-D6bh0MrS.js";import{n as M}from"./emotion-styled.browser.esm-uimCutsp.js";import{C as ve}from"./CircularProgress-CMZVAt1l.js";var A={},oe;function Ee(){if(oe)return A;oe=1,Object.defineProperty(A,"__esModule",{value:!0});function e(){let r,n;const t=new Promise((s,u)=>{r=c=>{s(c),t.isPending=!1},n=c=>{u(c),t.isPending=!1}}).catch(s=>Promise.reject(s));return t.resolve=r,t.reject=n,"finally"in t||(t.finally=s=>{t.then(s),t.catch(s)}),t.isPending=!0,t}return A.future=e,A.default=e,A}var we=Ee();const be=x(we);function se(e){return{all:e=e||new Map,on:function(r,n){var t=e.get(r);t?t.push(n):e.set(r,[n])},off:function(r,n){var t=e.get(r);t&&(n?t.splice(t.indexOf(n)>>>0,1):e.set(r,[]))},emit:function(r,n){var t=e.get(r);t&&t.slice().map(function(s){s(n)}),(t=e.get("*"))&&t.slice().map(function(s){s(r,n)})}}}const S=new Map,Y=new Map,Z=new Map,k=new Map;function ae(e){const r=document.getElementById(e);return!r||!r.contentWindow?!1:Z.get(r.contentWindow)??!1}function H(e){if(e.data&&e.data.type)try{switch(e.data.type){case v.PreviewMessageType.CONTROLLER_RESPONSE:{const r=e.data.payload,{id:n}=r,t=S.get(n);t&&(S.delete(n),r.ok?t.resolve(r.result):r.ok===!1&&t.reject(new Error(r.error)));break}case v.PreviewMessageType.EMOTE_EVENT:{const r=e.data.payload,{type:n,payload:t}=r,s=e.source?Y.get(e.source):null;s&&n&&s.emit(n,t);break}case v.PreviewMessageType.LOAD:{e.source&&(Z.set(e.source,!0),(k.get(e.source)||[]).filter(t=>{var s;return((s=t.data)==null?void 0:s.type)!==v.PreviewMessageType.LOAD}).forEach(H),k.delete(e.source));break}default:}}catch(r){console.error("Error processing WearablePreview message:",r)}}const Pe=e=>{var n;if(((n=e.data)==null?void 0:n.type)===v.PreviewMessageType.LOAD){H(e);return}if(!(e.source?Z.get(e.source):!1)&&e.source){const t=k.get(e.source)||[];t.push(e),k.set(e.source,t);return}H(e)};typeof window<"u"&&window.addEventListener("message",Pe,!1);let ie=0;function Se(e){return function(n,t,s){const u=document.getElementById(e);if(!u||!u.contentWindow){const d=new Error("iframe not found or not accessible");return Promise.reject(d)}const c=e+"-"+ie,l=be();S.set(c,l);const p=v.PreviewMessageType.CONTROLLER_REQUEST,y={id:c,namespace:n,method:t,params:s},m=setTimeout(()=>{S.delete(c),l.reject(new Error(`Request timeout for ${t}`))},1e4),a=l.resolve,j=l.reject;l.resolve=d=>{clearTimeout(m),a(d)},l.reject=d=>{clearTimeout(m),j(d)};try{v.sendMessage(u.contentWindow,p,y)}catch(d){const w=d instanceof Error?d.message:String(d);l.reject(new Error(`Failed to send message: ${w}`)),S.delete(c),clearTimeout(m)}return ie++,l}}function Me(e){const r=document.getElementById(e);if(!r)throw new Error(`Could not find an iframe with id="${e}"`);S.clear();const n=r.contentWindow?Y.get(r.contentWindow)??se():se();r.contentWindow&&Y.set(r.contentWindow,n);const t=Se(e);return{scene:{getScreenshot(s,u){return t("scene","getScreenshot",[s,u])},getMetrics(){return t("scene","getMetrics",[])},changeZoom:function(s){return t("scene","changeZoom",[s])},panCamera:function(s){return t("scene","panCamera",[s])},changeCameraPosition:function(s){return t("scene","changeCameraPosition",[s])},cleanup(){return t("scene","cleanup",[])},setUsername:function(s){return t("scene","setUsername",[s])}},emote:{getLength(){return t("emote","getLength",[])},isPlaying(){return t("emote","isPlaying",[])},goTo(s){return t("emote","goTo",[s])},play(){return t("emote","play",[])},pause(){return t("emote","pause",[])},stop(){return t("emote","stop",[])},enableSound(){return t("emote","enableSound",[])},disableSound(){return t("emote","disableSound",[])},hasSound(){return t("emote","hasSound",[])},isSocialEmote(){return t("emote","isSocialEmote",[])},getSocialEmoteAnimations(){return t("emote","getSocialEmoteAnimations",[])},getPlayingSocialEmoteAnimation(){return t("emote","getPlayingSocialEmoteAnimation",[])},emote:null,events:n},physics:{setSpringBonesParams(s,u){return t("physics","setSpringBonesParams",[s,u])}}}}var R={},ue;function Ae(){if(ue)return R;ue=1;var e=L();Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var r=e(q()),n=N();return R.default=(0,r.default)((0,n.jsx)("path",{d:"M6 19h4V5H6zm8-14v14h4V5z"}),"Pause"),R}var Re=Ae();const Te=x(Re);var T={},ce;function Ce(){if(ce)return T;ce=1;var e=L();Object.defineProperty(T,"__esModule",{value:!0}),T.default=void 0;var r=e(q()),n=N();return T.default=(0,r.default)((0,n.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),T}var Ie=Ce();const xe=x(Ie);var C={},le;function je(){if(le)return C;le=1;var e=L();Object.defineProperty(C,"__esModule",{value:!0}),C.default=void 0;var r=e(q()),n=N();return C.default=(0,r.default)((0,n.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63m2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71M4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9zM12 4 9.91 6.09 12 8.18z"}),"VolumeOff"),C}var _e=je();const Oe=x(_e);var I={},de;function ke(){if(de)return I;de=1;var e=L();Object.defineProperty(I,"__esModule",{value:!0}),I.default=void 0;var r=e(q()),n=N();return I.default=(0,r.default)((0,n.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),I}var Ne=ke();const Le=x(Ne),qe=(e,r)=>{const n=i.useRef(null),[t,s]=i.useState(!1);return i.useEffect(()=>{const u=r??Me(e);if(n.current=u,ae(e)){s(!0);return}const c=document.getElementById(e);if(!c){console.error(`Could not find iframe with id="${e}"`);return}if(!c.contentWindow){console.error(`Iframe contentWindow is not accessible for id="${e}"`);return}const p=y=>{var m;((m=y.data)==null?void 0:m.type)===v.PreviewMessageType.LOAD&&ae(e)&&s(!0)};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),s(!1),n.current=null}},[e,r]),{controllerRef:n,isReady:t}},We={small:16,medium:20,large:24},me=({children:e,startIcon:r,endIcon:n,loading:t=!1,loadingIcon:s,loadingPosition:u="center",disabled:c=!1,size:l="medium",...p})=>{const y=f.jsx(ve,{color:"inherit",size:We[l]}),m=s||y,a=t&&u==="center"?m:e;return f.jsx(he,{disabled:c||t,startIcon:t&&u==="start"?m:r,endIcon:t&&u==="end"?m:n,size:l,...p,children:a})},Ve=M(ye)(({theme:e})=>({display:"flex",position:"absolute",width:"100%",bottom:0,margin:`${e.spacing(2)} 0`,padding:`0 ${e.spacing(3)}`,gap:e.spacing(2)})),Ue=M(me)(({theme:e})=>({width:56,height:44,padding:0,minWidth:"unset",background:"rgba(0, 0, 0, 0.64) !important","& svg":{marginLeft:e.spacing(.5)}})),De=M(me)(({theme:e,muted:r})=>({marginLeft:e.spacing(2.5),minWidth:25,background:"none",padding:0,opacity:r?.5:1})),Fe=M("input")(({theme:e})=>({flex:1,width:"100%",background:"none",WebkitAppearance:"none","&:focus":{outline:"none"},"&::-webkit-slider-thumb":{WebkitAppearance:"none",width:24,height:24,borderRadius:10,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",paddingBottom:e.spacing(.625),marginTop:e.spacing(-.5)},"&::-moz-range-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer",border:"none"},"&::-ms-thumb":{width:24,height:24,borderRadius:20,backgroundColor:"#736e7d",overflow:"visible",cursor:"pointer"},"&::-webkit-slider-runnable-track":{width:300,height:15,background:"rgba(115, 110, 125, 0.32)",border:"none",borderRadius:10},"&::-moz-range-track":{width:"100%",height:15,borderRadius:10,cursor:"pointer",background:"rgba(115, 110, 125, 0.32)"}})),Be=M("div")({display:"flex",alignItems:"center"}),ze=M("input")({width:56,height:44,borderRadius:5,background:"transparent",border:"1px solid rgba(115, 110, 125, 0.4)",color:"white",textAlign:"center","&:focus-visible":{outline:"1px solid"}}),$e=({wearablePreviewId:e,className:r,hideFrameInput:n,hideProgressInput:t,hidePlayButton:s,hideSoundButton:u,wearablePreviewController:c,renderPlayButton:l,renderSoundButton:p,renderProgressBar:y,renderFrameInput:m})=>{const{controllerRef:a,isReady:j}=qe(e,c),[d,w]=i.useState(0),[b,W]=i.useState(!1),[h,fe]=i.useState(void 0),[P,ge]=i.useState(!0),[_,G]=i.useState(void 0),[J,Q]=i.useState(!1),[K,X]=i.useState(!1),V=i.useCallback(()=>{w(0)},[]),U=i.useCallback(()=>{W(!1),w(o=>o>=Math.floor((h??0)*100)?0:o)},[h]),D=i.useCallback(()=>{W(!1)},[]),F=i.useCallback(async()=>{if(!K){let o=h;!h&&a.current&&(o=await a.current.emote.getLength()),W(!0),fe(o)}},[h,K,a]),B=i.useCallback(({length:o})=>{w(Math.ceil((o??0)*100))},[]);i.useEffect(()=>{const o=a.current;if(o)return o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.on(g.PreviewEmoteEventType.ANIMATION_LOOP,V),()=>{o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAY,F),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PLAYING,B),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_END,U),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_PAUSE,D),o.emote.events.off(g.PreviewEmoteEventType.ANIMATION_LOOP,V)}},[a,F,B,U,D,V]),i.useEffect(()=>{_===void 0&&j&&a.current&&a.current.emote.hasSound().then(o=>G(o)).catch(o=>{console.error("Error checking sound:",o),G(!1)})},[_,j,a]);const z=i.useCallback(async()=>{if(a.current)try{await a.current.emote.play()}catch(o){console.error("Error playing emote:",o)}},[a]),$=i.useCallback(async()=>{if(a.current)try{await a.current.emote.pause()}catch(o){console.error("Error pausing emote:",o)}},[a]),ee=i.useCallback(async()=>{b?await $():await z()},[b,z,$]),te=i.useCallback(()=>{var o,E;P?(o=a.current)==null||o.emote.disableSound():(E=a.current)==null||E.emote.enableSound(),ge(!P)},[P,a]),O=i.useCallback(async o=>{if(isNaN(o)||!a.current)return;let E=o;const ne=h??0;ne*100<o&&(E=ne*100),w(E),X(!0);try{b&&(await a.current.emote.pause(),Q(!0)),await a.current.emote.goTo(E/100)}catch(pe){console.error("Error changing frame:",pe)}},[h,b,a]),re=i.useCallback(async()=>{if(X(!1),J&&a.current){try{await a.current.emote.play()}catch(o){console.error("Error resuming play:",o)}Q(!1)}},[J,a]);return f.jsxs(Ve,{className:r,children:[s?null:l?l({isPlaying:b,onPlay:z,onPause:$,onToggle:ee}):f.jsx(Ue,{onClick:ee,children:b?f.jsx(Te,{}):f.jsx(xe,{})}),t?null:y?y({frame:d,length:h??0,onChange:O,onMouseUp:re}):f.jsx(Fe,{type:"range",value:d,max:Math.ceil((h??0)*100),min:0,step:1,onChange:o=>O(Number(o.target.value)),onMouseUp:re}),n?null:f.jsx(Be,{children:m?m({frame:Math.round(d/100),onChange:o=>O(o*100)}):f.jsx(ze,{type:"number",value:Math.round(d/100),onChange:o=>O(Number(o.target.value)*100)})}),u||!_?null:p?p({isSoundEnabled:P,hasSound:_,onToggle:te}):f.jsx(De,{muted:!P,onClick:te,children:P?f.jsx(Le,{}):f.jsx(Oe,{})})]})},Ke=Object.freeze(Object.defineProperty({__proto__:null,EmoteControls:$e},Symbol.toStringTag,{value:"Module"}));export{me as B,$e as E,Me as c,Ke as i,qe as u};
@@ -1,4 +1,4 @@
1
- import{a as m,i as c,b as d}from"./lit-element-B3y9oplH.js";import{n as u,o as f}from"./class-map-CxwNmq0D.js";import{c as b}from"./index-CkBDyoGg.js";import{r as h}from"./index-b_a6Xe2g.js";import"./index-CKEG3W2m.js";const v=m`
1
+ import{a as m,i as c,b as d}from"./lit-element-B3y9oplH.js";import{n as u,o as f}from"./class-map-CxwNmq0D.js";import{c as b}from"./index-hwCoxi9L.js";import{r as h}from"./index-BUo3wAlN.js";import"./index-wfubccp5.js";const v=m`
2
2
  :host {
3
3
  position: relative;
4
4
  display: inline-block;