@wormhole-foundation/wormhole-connect 3.0.1-beta.2-development → 3.0.1-beta.4-development

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 (322) hide show
  1. package/dist/assets/{add-CA46SOZ1.js → add-Xg1xhVFF.js} +1 -1
  2. package/dist/assets/{all-wallets-B1qnLkOo.js → all-wallets-BoxRqCuD.js} +1 -1
  3. package/dist/assets/{app-store-NTpCK9MF.js → app-store-DWw_7TVB.js} +1 -1
  4. package/dist/assets/{apple-DRVt4JWr.js → apple-C3S_oS38.js} +1 -1
  5. package/dist/assets/{aptos-DkSiRwPH.js → aptos-BuLH7jck.js} +3 -3
  6. package/dist/assets/{aptos-63ExGocu.js → aptos-gb8snog6.js} +1 -1
  7. package/dist/assets/{arrow-bottom-CPth9tFV.js → arrow-bottom-TxaXdcXE.js} +1 -1
  8. package/dist/assets/{arrow-bottom-circle-BWo9DWoB.js → arrow-bottom-circle-zT0TMjGz.js} +1 -1
  9. package/dist/assets/{arrow-left-P6RmBJWT.js → arrow-left-DEymMKEb.js} +1 -1
  10. package/dist/assets/{arrow-right-BHHiE7kD.js → arrow-right-CrQ93Gth.js} +1 -1
  11. package/dist/assets/{arrow-top-D5GRFsZm.js → arrow-top-DO6PV0os.js} +1 -1
  12. package/dist/assets/{bank-C2WLfHR8.js → bank-D6rx1mBK.js} +1 -1
  13. package/dist/assets/{basic-BCJkH5GS.js → basic-C5fzEsEe.js} +1 -1
  14. package/dist/assets/{blake2b-Bb1VZYtg.js → blake2b-B2b685Yu.js} +1 -1
  15. package/dist/assets/{browser-BPjT1bN5.js → browser-Co04W0I6.js} +1 -1
  16. package/dist/assets/{card-JaBku5Bf.js → card-B2Z4mK1Z.js} +1 -1
  17. package/dist/assets/{ccip-CTrUg8DF.js → ccip-By49zU3M.js} +1 -1
  18. package/dist/assets/{chain-DF9mIQM9.js → chain-Du7paeNG.js} +1 -1
  19. package/dist/assets/{checkmark-BQL5JCw2.js → checkmark-C8HU5fja.js} +1 -1
  20. package/dist/assets/{checkmark-bold-DP1vE2RN.js → checkmark-bold-DIs1ZMqP.js} +1 -1
  21. package/dist/assets/{chevron-bottom-BV0Au0hP.js → chevron-bottom-BFsapVx9.js} +1 -1
  22. package/dist/assets/{chevron-left-C4v6Iui8.js → chevron-left-Fkdkr5ZY.js} +1 -1
  23. package/dist/assets/{chevron-right-CbVMuuvx.js → chevron-right-BfpUZvuC.js} +1 -1
  24. package/dist/assets/{chevron-top-CuIo_USv.js → chevron-top-CgQu63-4.js} +1 -1
  25. package/dist/assets/{chrome-store-fbydRQd1.js → chrome-store-GIO26gYx.js} +1 -1
  26. package/dist/assets/{chunk-KJH4KKG6-B7DCZZVY.js → chunk-KJH4KKG6-Po5MChR6.js} +1 -1
  27. package/dist/assets/{clock-D62L3EFP.js → clock-BDzvQcXR.js} +1 -1
  28. package/dist/assets/{close-BLRqO6Zn.js → close-JWa5ANIE.js} +1 -1
  29. package/dist/assets/{coinPlaceholder-0tmFvYYj.js → coinPlaceholder-a0UGO8gJ.js} +1 -1
  30. package/dist/assets/{compass-Ba8-RKca.js → compass-CEQdAwHs.js} +1 -1
  31. package/dist/assets/{contract-bGGxC9_m.js → contract-BhySpM-Z.js} +1 -1
  32. package/dist/assets/{copy-CWqrh_sD.js → copy-S_d5_yPl.js} +1 -1
  33. package/dist/assets/{create-CbRd6EbF.js → create-gkOVonha.js} +1 -1
  34. package/dist/assets/{cursor-DFYzmUAe.js → cursor-BhEbcCXK.js} +1 -1
  35. package/dist/assets/{cursor-transparent-IY3fA7aT.js → cursor-transparent-BcLVDVWp.js} +1 -1
  36. package/dist/assets/{desktop-DLudyYW3.js → desktop-DqSryZUj.js} +1 -1
  37. package/dist/assets/{disconnect-gShcPNrf.js → disconnect-YOsS0M4y.js} +1 -1
  38. package/dist/assets/{discord-S8T3fJF7.js → discord-CqeqTfSo.js} +1 -1
  39. package/dist/assets/{etherscan-C-ODOYjC.js → etherscan-DlH7X_ye.js} +1 -1
  40. package/dist/assets/{evm-DwqzhXfk.js → evm-CWAxZ2a7.js} +3 -3
  41. package/dist/assets/{evm-D65l_VUA.js → evm-fcQsoqVd.js} +4 -4
  42. package/dist/assets/{exclamation-triangle-I4hrUAkj.js → exclamation-triangle-B7tI_-cI.js} +1 -1
  43. package/dist/assets/{extension-C2E94rju.js → extension-DyHQJuRO.js} +1 -1
  44. package/dist/assets/{external-link-BE25aYRx.js → external-link-ChiVtGCq.js} +1 -1
  45. package/dist/assets/{facebook-VHvsuzqv.js → facebook-BIe7nERx.js} +1 -1
  46. package/dist/assets/{farcaster-sG7oFC35.js → farcaster-BTyklWGz.js} +1 -1
  47. package/dist/assets/{filters-D9VcvmFo.js → filters-De_gO5iz.js} +1 -1
  48. package/dist/assets/{github-BLJyKdzw.js → github-DQfZjMbN.js} +1 -1
  49. package/dist/assets/{google-C4YbBNSv.js → google-Gguig8Cy.js} +1 -1
  50. package/dist/assets/{help-circle-CMmVaOnp.js → help-circle-DHeCCsr1.js} +1 -1
  51. package/dist/assets/{id-g_mC9xVi.js → id-DjntBhAt.js} +1 -1
  52. package/dist/assets/{image-nAeKstDS.js → image-2J0s_97c.js} +1 -1
  53. package/dist/assets/{index-CKPf-3Vo.js → index--d0JCrsI.js} +1 -1
  54. package/dist/assets/{index-C0-WLpMA.js → index-BE55BSK7.js} +1 -1
  55. package/dist/assets/{index-Cu0b-jgK.js → index-BJYqkXUw.js} +1 -1
  56. package/dist/assets/{index-C_YTupmk.js → index-BYTZG2bF.js} +1 -1
  57. package/dist/assets/{index-CVqQ68io.js → index-BedU_k3i.js} +1 -1
  58. package/dist/assets/{index-BTkoFKAW.js → index-BgLBca6k.js} +1 -1
  59. package/dist/assets/{index-DynC8vQ4.js → index-BjvqCh5g.js} +1 -1
  60. package/dist/assets/{index-BqLA4xTj.js → index-BpI-Jtyb.js} +3 -3
  61. package/dist/assets/{index-GmuqTVr0.js → index-Breet2G4.js} +1 -1
  62. package/dist/assets/{index-BUtdFAj3.js → index-Bx8vjRmV.js} +1 -1
  63. package/dist/assets/{index-DusYxt7C.js → index-CfdmPAak.js} +3 -3
  64. package/dist/assets/{index-DA4wR-ie.js → index-DB7g9m_R.js} +1 -1
  65. package/dist/assets/{index-DKdokzug.js → index-DMWfYwZZ.js} +1 -1
  66. package/dist/assets/{index-COZ2cSR6.js → index-DSTd1tRp.js} +1 -1
  67. package/dist/assets/{index-CVqXQiSE.js → index-DZ96gAj4.js} +1 -1
  68. package/dist/assets/{index-CYFq9U58.js → index-TYicGq2L.js} +1 -1
  69. package/dist/assets/index-Z3Xir6L3.js +1 -0
  70. package/dist/assets/{index-DC3x_AFd.js → index-kF0xEQ0E.js} +1 -1
  71. package/dist/assets/{index-CCOXtJ1P.js → index-zEIfo2_n.js} +1 -1
  72. package/dist/assets/index.es-3Tq6bjFW.js +47 -0
  73. package/dist/assets/index.es-CBqWEk7T.js +15 -0
  74. package/dist/assets/{info-P71aU507.js → info-D4MdYH3E.js} +1 -1
  75. package/dist/assets/{info-circle-D8ZhpY4M.js → info-circle-2o2Bq9RM.js} +1 -1
  76. package/dist/assets/{lightbulb-CWL8Hapk.js → lightbulb-G1HZSu_o.js} +1 -1
  77. package/dist/assets/{mail-BKdMRnR2.js → mail-CYPzgN-C.js} +1 -1
  78. package/dist/assets/{mobile-Bw0EoBkW.js → mobile-G3tO8xk-.js} +1 -1
  79. package/dist/assets/{more-BSKGQd1b.js → more-nk1W6LmK.js} +1 -1
  80. package/dist/assets/{network-placeholder-B1xqyidN.js → network-placeholder-DakjB3wH.js} +1 -1
  81. package/dist/assets/{nftPlaceholder-CuCsNvkN.js → nftPlaceholder-JMholGYC.js} +1 -1
  82. package/dist/assets/{off-BX6zoZuA.js → off-SNO-Bsmr.js} +1 -1
  83. package/dist/assets/{play-store-CCveEK_B.js → play-store-BpxDB0NB.js} +1 -1
  84. package/dist/assets/{plus-C02SGp4V.js → plus-oY5qI4Lq.js} +1 -1
  85. package/dist/assets/{provider-jsonrpc-DTnJKzTS.js → provider-jsonrpc-CG-x8-V6.js} +1 -1
  86. package/dist/assets/{qr-code-DGe_aS_i.js → qr-code-jee4rxaz.js} +1 -1
  87. package/dist/assets/{recycle-horizontal-DtRomJbx.js → recycle-horizontal-BEF6XBYh.js} +1 -1
  88. package/dist/assets/{refresh-DPABcpes.js → refresh-aEpBxujB.js} +1 -1
  89. package/dist/assets/{reown-logo-DG2ULLka.js → reown-logo-CEo-n5QW.js} +1 -1
  90. package/dist/assets/{search-EURxday_.js → search-CrfJGGMS.js} +1 -1
  91. package/dist/assets/{secp256k1-D-G9AbtW.js → secp256k1-CBh6eQLF.js} +1 -1
  92. package/dist/assets/{secp256k1-DfnLU_Rr.js → secp256k1-OI4v3wvK.js} +1 -1
  93. package/dist/assets/{send-t6aoH9GB.js → send-ChU6l1_w.js} +1 -1
  94. package/dist/assets/signer-BRan8q4C.js +2 -0
  95. package/dist/assets/solana-B3bc0p0T.js +2 -0
  96. package/dist/assets/{solana-C-diloCa.js → solana-CxgaSoPj.js} +9 -9
  97. package/dist/assets/solanaEmbed.esm-Mnq6o_qa.js +10 -0
  98. package/dist/assets/{sui-Pc10JTxL.js → sui-CXoaI0gx.js} +2 -2
  99. package/dist/assets/{sui-DXg2Lhyt.js → sui-DXdm7DBB.js} +4 -4
  100. package/dist/assets/{swapHorizontal-Cd2Bq-oX.js → swapHorizontal-De2aXFHG.js} +1 -1
  101. package/dist/assets/{swapHorizontalBold-CK6YXqcD.js → swapHorizontalBold-CtwNUoVl.js} +1 -1
  102. package/dist/assets/{swapHorizontalMedium-BCT4Hlrg.js → swapHorizontalMedium-BsH9NNRL.js} +1 -1
  103. package/dist/assets/{swapHorizontalRoundedBold-C-NDd7Fq.js → swapHorizontalRoundedBold-ClK2_MrS.js} +1 -1
  104. package/dist/assets/{swapVertical-BfKszPb9.js → swapVertical-BVWoUs-p.js} +1 -1
  105. package/dist/assets/{telegram-D5sYoBZp.js → telegram-BgYefK90.js} +1 -1
  106. package/dist/assets/{three-dots-qiTqAG0h.js → three-dots-D6JqA1P-.js} +1 -1
  107. package/dist/assets/{tokens-BjeNFBPV.js → tokens-BwBlXmY1.js} +12 -12
  108. package/dist/assets/{twitch-1VH6BaUA.js → twitch-DSLx5P08.js} +1 -1
  109. package/dist/assets/{twitterIcon-hIEIDwcz.js → twitterIcon-DIhMC7Ie.js} +1 -1
  110. package/dist/assets/{verify-DxvRt34f.js → verify-Dh3yUwPE.js} +1 -1
  111. package/dist/assets/{verify-filled-RtidYdgS.js → verify-filled-mA5B8sgV.js} +1 -1
  112. package/dist/assets/{w3m-modal-DI_ypCY0.js → w3m-modal-DpvEw1mA.js} +1 -1
  113. package/dist/assets/{wallet-Cb9kcAk9.js → wallet-Bz3DYndO.js} +1 -1
  114. package/dist/assets/{wallet-placeholder-pTFD8Qr_.js → wallet-placeholder-BYYYxJZ1.js} +1 -1
  115. package/dist/assets/{walletconnect-DvJIx5jD.js → walletconnect-NKbhveni.js} +1 -1
  116. package/dist/assets/{warning-circle-CRzNiBlj.js → warning-circle-Dh13B0js.js} +1 -1
  117. package/dist/assets/{x-Dk-mK5uZ.js → x-B2DeHGEp.js} +1 -1
  118. package/dist/main.js +75 -75
  119. package/dist/src/config/index.d.ts.map +1 -1
  120. package/dist/src/config/tokens.d.ts +2 -2
  121. package/dist/src/config/tokens.d.ts.map +1 -1
  122. package/dist/src/config/types.d.ts +2 -0
  123. package/dist/src/config/types.d.ts.map +1 -1
  124. package/dist/src/utils/inProgressTxCache.d.ts.map +1 -1
  125. package/lib/{add-DrLWWjDN.mjs → add-CChCYI2G.mjs} +1 -1
  126. package/lib/{add-DVGSYBJf.js → add-CDVX1evr.js} +1 -1
  127. package/lib/{all-wallets-CjzZMHCA.mjs → all-wallets-D2JZa1Jx.mjs} +1 -1
  128. package/lib/{all-wallets-DGVJQYa0.js → all-wallets-Wql6lmNE.js} +1 -1
  129. package/lib/{app-store-BABxSxrd.js → app-store-1dBCl4tM.js} +1 -1
  130. package/lib/{app-store-kpf503GR.mjs → app-store-CLDcpqR0.mjs} +1 -1
  131. package/lib/{apple-C962M6Ax.js → apple-BHKwlbOf.js} +1 -1
  132. package/lib/{apple-C0AtBJDu.mjs → apple-DIxTUQFy.mjs} +1 -1
  133. package/lib/{aptos-uWJCRLoQ.js → aptos-BL0wRMvV.js} +1 -1
  134. package/lib/{aptos-XxQj_uxF.mjs → aptos-TAzFliq5.mjs} +1 -1
  135. package/lib/{arrow-bottom-D0wK6uMJ.mjs → arrow-bottom-BI4NLoaY.mjs} +1 -1
  136. package/lib/{arrow-bottom-circle-iOl-NxXR.js → arrow-bottom-circle-CAq7o5Oy.js} +1 -1
  137. package/lib/{arrow-bottom-circle-D5QwftYY.mjs → arrow-bottom-circle-HmnccP7v.mjs} +1 -1
  138. package/lib/{arrow-bottom-CIZJcZfr.js → arrow-bottom-lsBwXKtD.js} +1 -1
  139. package/lib/{arrow-left-BL0dHjzy.mjs → arrow-left-7ur69wUu.mjs} +1 -1
  140. package/lib/{arrow-left-C-RAtnQ2.js → arrow-left-BsQ-5Ptc.js} +1 -1
  141. package/lib/{arrow-right-COiq03Wj.js → arrow-right-D992kYZk.js} +1 -1
  142. package/lib/{arrow-right-DaZMOW_1.mjs → arrow-right-lENdnq4k.mjs} +1 -1
  143. package/lib/{arrow-top-7Srj2XLP.js → arrow-top-BO-2RkYj.js} +1 -1
  144. package/lib/{arrow-top-QPVhK81o.mjs → arrow-top-mSzeb_YL.mjs} +1 -1
  145. package/lib/{bank-C5lNHVtL.mjs → bank-CoEWKxhi.mjs} +1 -1
  146. package/lib/{bank-Bp2l8LtZ.js → bank-Hw0j97F3.js} +1 -1
  147. package/lib/{basic-C5W71-rE.mjs → basic-BaSePtpQ.mjs} +2 -2
  148. package/lib/{basic-DQ6ISwhI.js → basic-C2cAlU_P.js} +1 -1
  149. package/lib/{browser-DV0hL_fK.js → browser-BlvoS4as.js} +1 -1
  150. package/lib/{browser-CJhUYmz6.mjs → browser-rF5Wrb7Q.mjs} +1 -1
  151. package/lib/{card-yZLq1X6c.js → card-BMnXbbhN.js} +1 -1
  152. package/lib/{card-DSeabGLV.mjs → card-D_WE8NXm.mjs} +1 -1
  153. package/lib/{ccip-BCsOYNZd.js → ccip--ZxEFQf_.js} +1 -1
  154. package/lib/{ccip-CFqlillN.mjs → ccip-CqL9Anaf.mjs} +1 -1
  155. package/lib/{checkmark-BW4NeFlB.js → checkmark-CesSNUet.js} +1 -1
  156. package/lib/{checkmark-DhgNpDof.mjs → checkmark-OMVwQQ5U.mjs} +1 -1
  157. package/lib/{checkmark-bold-DnEFF9eL.js → checkmark-bold-BD-XO987.js} +1 -1
  158. package/lib/{checkmark-bold-CxJkyUOt.mjs → checkmark-bold-CD7QLi07.mjs} +1 -1
  159. package/lib/{chevron-bottom-Pi9qTSKk.mjs → chevron-bottom-BwVLFe30.mjs} +1 -1
  160. package/lib/{chevron-bottom-Tb5GYU7P.js → chevron-bottom-IMKe9YXA.js} +1 -1
  161. package/lib/{chevron-left-BRp6K_BQ.js → chevron-left-D9qVH2_2.js} +1 -1
  162. package/lib/{chevron-left-Cl35pkRv.mjs → chevron-left-Lf-ywM2h.mjs} +1 -1
  163. package/lib/{chevron-right-D1Ic6C28.js → chevron-right-WKiLOYc0.js} +1 -1
  164. package/lib/{chevron-right-pjH-xKxB.mjs → chevron-right-gRQ8_S61.mjs} +1 -1
  165. package/lib/{chevron-top-SdyRa8IE.js → chevron-top-Bxo7EgbN.js} +1 -1
  166. package/lib/{chevron-top-DSe-dX8z.mjs → chevron-top-DslLIugK.mjs} +1 -1
  167. package/lib/{chrome-store-0qgfQSAS.js → chrome-store-7358vPCZ.js} +1 -1
  168. package/lib/{chrome-store-ThoUGIhl.mjs → chrome-store-B7rWxuFe.mjs} +1 -1
  169. package/lib/{clock-B0sBEXQ5.mjs → clock-BGtDjqYb.mjs} +1 -1
  170. package/lib/{clock-2HqPHolX.js → clock-Ry96ruDh.js} +1 -1
  171. package/lib/{close-Bznv5frT.mjs → close-Bj7xcq2I.mjs} +1 -1
  172. package/lib/{close-BJQf5USo.js → close-C6sBVa0R.js} +1 -1
  173. package/lib/{coinPlaceholder-CvvSiYI-.js → coinPlaceholder-9HCA6YJ_.js} +1 -1
  174. package/lib/{coinPlaceholder-1gZoTAqN.mjs → coinPlaceholder-CUWHPX6Q.mjs} +1 -1
  175. package/lib/{compass-BE99mJOV.mjs → compass-B6RLv5bP.mjs} +1 -1
  176. package/lib/{compass-BBMA-82e.js → compass-CccZJ5Hi.js} +1 -1
  177. package/lib/{constants-Bp_337ur.mjs → constants-I50X20ow.mjs} +1 -1
  178. package/lib/{constants-BDS32jve.js → constants-o93Ip-ZI.js} +1 -1
  179. package/lib/{copy-B_JboG8P.js → copy-CQDBtuRc.js} +1 -1
  180. package/lib/{copy-Cwolsgnk.mjs → copy-ucy3iRHw.mjs} +1 -1
  181. package/lib/{cursor-C2jyr1Tt.js → cursor-CSvFFh4Q.js} +1 -1
  182. package/lib/{cursor-0EyS6nH4.mjs → cursor-CzBbQiJe.mjs} +1 -1
  183. package/lib/{cursor-transparent-ZUI7NwAo.mjs → cursor-transparent-BVPzLo6n.mjs} +1 -1
  184. package/lib/{cursor-transparent-BaVE19A2.js → cursor-transparent-OMlVLjL8.js} +1 -1
  185. package/lib/{desktop-Dmz61Quh.js → desktop-CPDPdHBV.js} +1 -1
  186. package/lib/{desktop-B1U1mc6q.mjs → desktop-shQ2mQoL.mjs} +1 -1
  187. package/lib/{disconnect-8HUMogEY.mjs → disconnect-BKVkn-S7.mjs} +1 -1
  188. package/lib/{disconnect-Bn_0Td6c.js → disconnect-DGSddjKW.js} +1 -1
  189. package/lib/{discord-4tBuPwio.js → discord-748YGKmQ.js} +1 -1
  190. package/lib/{discord-DNMu-4pj.mjs → discord-CU-xUnfX.mjs} +1 -1
  191. package/lib/{etherscan-DTafkFM9.mjs → etherscan-6_ieSOxb.mjs} +1 -1
  192. package/lib/{etherscan-CdfpxSFw.js → etherscan-Ccpuewtf.js} +1 -1
  193. package/lib/{evm-B5SS0axR.mjs → evm-DfM6aIHd.mjs} +3 -3
  194. package/lib/{evm-BZKMUp6E.js → evm-DoAUqshZ.js} +3 -3
  195. package/lib/{exclamation-triangle-BLb5RCv9.mjs → exclamation-triangle-B1yodgmL.mjs} +1 -1
  196. package/lib/{exclamation-triangle-W8wr4W3B.js → exclamation-triangle-BcTwNgcS.js} +1 -1
  197. package/lib/{extension-B3rp6j3f.js → extension-BwMlRm6l.js} +1 -1
  198. package/lib/{extension-DqXaH5V_.mjs → extension-CpR0U7JU.mjs} +1 -1
  199. package/lib/{external-link-DWSOPcgR.js → external-link-CSvt1sJd.js} +1 -1
  200. package/lib/{external-link-DupOMQca.mjs → external-link-D5LlQVjF.mjs} +1 -1
  201. package/lib/{facebook-C25qgXgI.mjs → facebook-Ch2fWEDP.mjs} +1 -1
  202. package/lib/{facebook-gaoSLwmV.js → facebook-DKN-SwlC.js} +1 -1
  203. package/lib/{farcaster-BKQVbYft.mjs → farcaster-CuhYu7xL.mjs} +1 -1
  204. package/lib/{farcaster-Dw_KFzSe.js → farcaster-Eo6frWYn.js} +1 -1
  205. package/lib/{filters-BSv2GVWx.js → filters-D8RfIYLp.js} +1 -1
  206. package/lib/{filters-BRj-u8fO.mjs → filters-hN9hAmqt.mjs} +1 -1
  207. package/lib/{github-CVSqx81G.js → github-Bj11sR8O.js} +1 -1
  208. package/lib/{github-B8zYv5B1.mjs → github-CBnfKu_p.mjs} +1 -1
  209. package/lib/{google-CJy4jhj7.mjs → google-DkNw7izD.mjs} +1 -1
  210. package/lib/{google-DWyFM_-_.js → google-ocyOtxA8.js} +1 -1
  211. package/lib/{help-circle-D2kyGnMD.mjs → help-circle-BYF3SQ07.mjs} +1 -1
  212. package/lib/{help-circle-BihX0QHp.js → help-circle-DIUT7rfs.js} +1 -1
  213. package/lib/hosted.js +1 -1
  214. package/lib/hosted.mjs +1 -1
  215. package/lib/{id-BvDoX2i7.mjs → id-C70TM1mY.mjs} +1 -1
  216. package/lib/{id-ZWI-bwNJ.js → id-CFPGVN7x.js} +1 -1
  217. package/lib/{image-CNQTgOF8.js → image-Csb5_nLh.js} +1 -1
  218. package/lib/{image-BeWwKKKj.mjs → image-N27_sf6L.mjs} +1 -1
  219. package/lib/{index-BXBTU3I5.mjs → index-BJokM0dj.mjs} +78 -78
  220. package/lib/{index-Dpl42t-y.mjs → index-BQI4s97M.mjs} +19199 -19189
  221. package/lib/index-CtU_yCFR.js +304 -0
  222. package/lib/{index-D2yjOpeA.js → index-DPTquT8S.js} +2 -2
  223. package/lib/{index.es-BvsB6Z8q.js → index.es-B-_H_cmu.js} +1 -1
  224. package/lib/{index.es-C4KG3MSj.mjs → index.es-DJiOqF7x.mjs} +1 -1
  225. package/lib/{index.es-C2112Y2b.js → index.es-WjSz4osV.js} +1 -1
  226. package/lib/{index.es-Cy_oFTNH.mjs → index.es-s7TRhhGL.mjs} +3 -3
  227. package/lib/index.js +1 -1
  228. package/lib/index.mjs +1 -1
  229. package/lib/{info-CjKZyXW_.mjs → info-AQVHCGaq.mjs} +1 -1
  230. package/lib/{info-C73QOiqc.js → info-CxmLliqa.js} +1 -1
  231. package/lib/{info-circle-DE-EmffO.js → info-circle-D2JXCfNS.js} +1 -1
  232. package/lib/{info-circle-CEpS6rzX.mjs → info-circle-y2TMBRYb.mjs} +1 -1
  233. package/lib/{lightbulb-BVq3C-EG.mjs → lightbulb-BKSrtaqH.mjs} +1 -1
  234. package/lib/{lightbulb-Dm6Hsfd3.js → lightbulb-BbhqbK_X.js} +1 -1
  235. package/lib/{mail-CqUQETIH.mjs → mail-BBgJ1r1U.mjs} +1 -1
  236. package/lib/{mail-GRon9tbg.js → mail-CoY6lTNd.js} +1 -1
  237. package/lib/{mobile-BmGmHmVh.js → mobile-Bctu3ihf.js} +1 -1
  238. package/lib/{mobile-CEbEFp0X.mjs → mobile-DNfcwXIc.mjs} +1 -1
  239. package/lib/{more-CnS-NcGa.js → more--vfXH0mk.js} +1 -1
  240. package/lib/{more-Cs0cmKvd.mjs → more-CH7etA30.mjs} +1 -1
  241. package/lib/{network-placeholder-CjPyqfGa.js → network-placeholder-6HdYNIFM.js} +1 -1
  242. package/lib/{network-placeholder-DYuB36S0.mjs → network-placeholder-ChGkSHiE.mjs} +1 -1
  243. package/lib/{nftPlaceholder-COJmgjQo.mjs → nftPlaceholder-BEC17VTi.mjs} +1 -1
  244. package/lib/{nftPlaceholder-CoY2NOAz.js → nftPlaceholder-CFV32cdU.js} +1 -1
  245. package/lib/{off-CZo3LYgL.mjs → off-ClkoZEBq.mjs} +1 -1
  246. package/lib/{off-B-WmBPpa.js → off-lYX-5yS0.js} +1 -1
  247. package/lib/{play-store-Chciiwp3.js → play-store-BG47IOEu.js} +1 -1
  248. package/lib/{play-store-Edmxg3AX.mjs → play-store-CkhMEAU7.mjs} +1 -1
  249. package/lib/{plus-D2jFkgs1.mjs → plus-BtTwbs2C.mjs} +1 -1
  250. package/lib/{plus-C93OSdaz.js → plus-DrlcozYb.js} +1 -1
  251. package/lib/{qr-code-c2tFySK0.mjs → qr-code-DYJJwRSj.mjs} +1 -1
  252. package/lib/{qr-code-y78Lk8wE.js → qr-code-v9_pM0Zk.js} +1 -1
  253. package/lib/{recycle-horizontal-PXk9BX3j.js → recycle-horizontal-BvzP-O-1.js} +1 -1
  254. package/lib/{recycle-horizontal-CWycpdDF.mjs → recycle-horizontal-EBM2ypKZ.mjs} +1 -1
  255. package/lib/{refresh-C77_db2T.mjs → refresh-BAhwdZGm.mjs} +1 -1
  256. package/lib/{refresh-mky0B17c.js → refresh-TpfixFZn.js} +1 -1
  257. package/lib/{reown-logo-0RkEf9EI.mjs → reown-logo-B0Su0Ter.mjs} +1 -1
  258. package/lib/{reown-logo-DceXhK36.js → reown-logo-DU1oKeQq.js} +1 -1
  259. package/lib/{search-BrMSW1-8.mjs → search-BPQ2hivJ.mjs} +1 -1
  260. package/lib/{search-CWru3218.js → search-Dmv7gbQ1.js} +1 -1
  261. package/lib/{secp256k1-C4P0dmMC.mjs → secp256k1-BZs3Z9mj.mjs} +1 -1
  262. package/lib/{secp256k1-BU-UfBCB.js → secp256k1-BjuZX5cP.js} +1 -1
  263. package/lib/{secp256k1-Cks0bicH.js → secp256k1-CLJ0hFH7.js} +1 -1
  264. package/lib/{secp256k1-CI3_SM8F.mjs → secp256k1-CtFVBB1y.mjs} +1 -1
  265. package/lib/{send-CRyBVD1k.js → send-BD36uDqC.js} +1 -1
  266. package/lib/{send-DFkvxnIh.mjs → send-BtmBm7An.mjs} +1 -1
  267. package/lib/{solana-BVnMWq13.js → solana-BCCsr1Cx.js} +4 -4
  268. package/lib/{solana-L02hbBDE.mjs → solana-CJwReM-9.mjs} +6 -6
  269. package/lib/{solanaEmbed.esm-DSwNdsgx.mjs → solanaEmbed.esm-DUeK0Aox.mjs} +1 -1
  270. package/lib/{solanaEmbed.esm-BG5cgKub.js → solanaEmbed.esm-TlHPGYbs.js} +1 -1
  271. package/lib/src/config/index.d.ts.map +1 -1
  272. package/lib/src/config/tokens.d.ts +2 -2
  273. package/lib/src/config/tokens.d.ts.map +1 -1
  274. package/lib/src/config/types.d.ts +2 -0
  275. package/lib/src/config/types.d.ts.map +1 -1
  276. package/lib/src/utils/inProgressTxCache.d.ts.map +1 -1
  277. package/lib/{sui-Dv1p0XoG.js → sui-CfpeqXfu.js} +1 -1
  278. package/lib/{sui-CN1tZAOs.mjs → sui-DCDjGAGw.mjs} +1 -1
  279. package/lib/{swapHorizontal-Bo_-2U6j.mjs → swapHorizontal-BrAMZxpk.mjs} +1 -1
  280. package/lib/{swapHorizontal-BiCkAPre.js → swapHorizontal-zZA0Pi1S.js} +1 -1
  281. package/lib/{swapHorizontalBold-BPL2XaSi.mjs → swapHorizontalBold-BcMCprxV.mjs} +1 -1
  282. package/lib/{swapHorizontalBold-CWHbSIEu.js → swapHorizontalBold-DiN_RSP7.js} +1 -1
  283. package/lib/{swapHorizontalMedium-CTsDFfzR.mjs → swapHorizontalMedium-BJ2Ste5L.mjs} +1 -1
  284. package/lib/{swapHorizontalMedium-D_2Z2Hfq.js → swapHorizontalMedium-CoOVPZkR.js} +1 -1
  285. package/lib/{swapHorizontalRoundedBold-8b5z2YJ_.mjs → swapHorizontalRoundedBold-Cjf3Fskk.mjs} +1 -1
  286. package/lib/{swapHorizontalRoundedBold-CDKFFagj.js → swapHorizontalRoundedBold-DxwvY3dz.js} +1 -1
  287. package/lib/{swapVertical-CNBatiM6.js → swapVertical-Bq0Lj7Jp.js} +1 -1
  288. package/lib/{swapVertical-UTCgpnIJ.mjs → swapVertical-p6z9y9EP.mjs} +1 -1
  289. package/lib/{telegram-lTj0r5My.js → telegram-dLc4G7r4.js} +1 -1
  290. package/lib/{telegram-CVvlgH_Z.mjs → telegram-ejEcBbcF.mjs} +1 -1
  291. package/lib/{three-dots-KK4NyvR7.mjs → three-dots-DaVRiDOk.mjs} +1 -1
  292. package/lib/{three-dots-DQLgK82o.js → three-dots-d_UVr-9U.js} +1 -1
  293. package/lib/{tokens-B2pmB4Ph.js → tokens-BWrHpkNL.js} +1 -1
  294. package/lib/{tokens-BQHmitaT.mjs → tokens-BnimC1zF.mjs} +1 -1
  295. package/lib/{twitch-CO4nmS5o.mjs → twitch-BHisrkgo.mjs} +1 -1
  296. package/lib/{twitch-wV3Yc6kA.js → twitch-C8keHWlC.js} +1 -1
  297. package/lib/{twitterIcon-pCNPPny7.js → twitterIcon-BQcavToi.js} +1 -1
  298. package/lib/{twitterIcon-BU99IvD2.mjs → twitterIcon-D3iLXIw6.mjs} +1 -1
  299. package/lib/{verify-Ci9XMhb8.mjs → verify-BWBTB_1a.mjs} +1 -1
  300. package/lib/{verify-B21LHiy7.js → verify-CXgbYH0A.js} +1 -1
  301. package/lib/{verify-filled-LUtqUhbS.mjs → verify-filled-D-Ce24N1.mjs} +1 -1
  302. package/lib/{verify-filled-DCMcHuAt.js → verify-filled-EtgRJyXw.js} +1 -1
  303. package/lib/{w3m-modal-DJRTg4Aa.js → w3m-modal-BRD-3_ln.js} +1 -1
  304. package/lib/{w3m-modal-BJkuxcj8.mjs → w3m-modal-jJj4CHrQ.mjs} +2 -2
  305. package/lib/{wallet-BqBebKQF.js → wallet-D5GlthNd.js} +1 -1
  306. package/lib/{wallet-USpq1vKL.mjs → wallet-D9nn7VuJ.mjs} +1 -1
  307. package/lib/{wallet-placeholder-CL_evZUb.mjs → wallet-placeholder-Bdm8Ey5Z.mjs} +1 -1
  308. package/lib/{wallet-placeholder-Cf1u-2wB.js → wallet-placeholder-CHDzAL0k.js} +1 -1
  309. package/lib/{walletconnect-Da6ZdP8w.js → walletconnect-CAKGYqr_.js} +1 -1
  310. package/lib/{walletconnect-3g5k3agX.mjs → walletconnect-DbTFPVUf.mjs} +1 -1
  311. package/lib/{warning-circle-B3ivLfCN.mjs → warning-circle-BNb3asEb.mjs} +1 -1
  312. package/lib/{warning-circle-CvTdOy7u.js → warning-circle-CQo0cKjW.js} +1 -1
  313. package/lib/{x-BOwtJrlH.mjs → x-35IydjAH.mjs} +1 -1
  314. package/lib/{x-DQCRmr2P.js → x-BeRG8E5j.js} +1 -1
  315. package/package.json +1 -1
  316. package/dist/assets/index-BZFyhaji.js +0 -1
  317. package/dist/assets/index.es-CWMLsIMc.js +0 -47
  318. package/dist/assets/index.es-g5_0R3zE.js +0 -15
  319. package/dist/assets/signer-7-tpWjBV.js +0 -2
  320. package/dist/assets/solana-C6mHMmQi.js +0 -2
  321. package/dist/assets/solanaEmbed.esm-DhAz8SOB.js +0 -10
  322. package/lib/index-DwMMfwYI.js +0 -304
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const d=o`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const d=o`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
2
2
  <path
3
3
  fill-rule="evenodd"
4
4
  clip-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const n=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const n=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const a=o`<svg fill="none" viewBox="0 0 20 20">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const a=o`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const n=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const n=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1 +1 @@
1
- var zn=Object.defineProperty;var Me=s=>{throw TypeError(s)};var Jn=(s,t,e)=>t in s?zn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var u=(s,t,e)=>Jn(s,typeof t!="symbol"?t+"":t,e),Ee=(s,t,e)=>t.has(s)||Me("Cannot "+e);var h=(s,t,e)=>(Ee(s,t,"read from private field"),e?e.call(s):t.get(s)),P=(s,t,e)=>t.has(s)?Me("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),E=(s,t,e,n)=>(Ee(s,t,"write to private field"),n?n.call(s,e):t.set(s,e),e),T=(s,t,e)=>(Ee(s,t,"access private method"),e);var He=(s,t,e,n)=>({set _(r){E(s,t,r,e)},get _(){return h(s,t,n)}});import{p,q as w,a6 as S,al as fn,o as b,t as oe,ah as Kn,ad as St,ai as j,n as Le,ag as zt,aO as hn,aM as Jt,ac as Pe,z as pt,ay as ce,ak as It,aP as Wn,aL as Yn,ae as Oe,aQ as Xn,aN as dn,af as Kt}from"../main.js";const pe=BigInt(0),J=BigInt(1),ve=9007199254740991;function Zn(s,t){const e=ge(s,"value"),n=BigInt(ut(t,"width"));if(w(e>>n===pe,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:s}),e>>n-J){const r=(J<<n)-J;return-((~e&r)+J)}return e}function Qn(s,t){let e=gt(s,"value");const n=BigInt(ut(t,"width")),r=J<<n-J;if(e<pe){e=-e,w(e<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});const i=(J<<n)-J;return(~e&i)+J}else w(e<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});return e}function jt(s,t){const e=ge(s,"value"),n=BigInt(ut(t,"bits"));return e&(J<<n)-J}function gt(s,t){switch(typeof s){case"bigint":return s;case"number":return p(Number.isInteger(s),"underflow",t||"value",s),p(s>=-9007199254740991&&s<=ve,"overflow",t||"value",s),BigInt(s);case"string":try{if(s==="")throw new Error("empty string");return s[0]==="-"&&s[1]!=="-"?-BigInt(s.substring(1)):BigInt(s)}catch(e){p(!1,`invalid BigNumberish string: ${e.message}`,t||"value",s)}}p(!1,"invalid BigNumberish value",t||"value",s)}function ge(s,t){const e=gt(s,t);return w(e>=pe,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:s}),e}const ze="0123456789abcdef";function pn(s){if(s instanceof Uint8Array){let t="0x0";for(const e of s)t+=ze[e>>4],t+=ze[e&15];return BigInt(t)}return gt(s)}function ut(s,t){switch(typeof s){case"bigint":return p(s>=-9007199254740991&&s<=ve,"overflow",t||"value",s),Number(s);case"number":return p(Number.isInteger(s),"underflow",t||"value",s),p(s>=-9007199254740991&&s<=ve,"overflow",t||"value",s),s;case"string":try{if(s==="")throw new Error("empty string");return ut(BigInt(s),t)}catch(e){p(!1,`invalid numeric string: ${e.message}`,t||"value",s)}}p(!1,"invalid numeric value",t||"value",s)}function qn(s){return ut(pn(s))}function gn(s,t){let n=ge(s,"value").toString(16);if(t==null)n.length%2&&(n="0"+n);else{const r=ut(t,"width");for(w(r*2>=n.length,`value exceeds width (${r} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:s});n.length<r*2;)n="0"+n}return"0x"+n}function yn(s){const t=ge(s,"value");if(t===pe)return new Uint8Array([]);let e=t.toString(16);e.length%2&&(e="0"+e);const n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++){const i=r*2;n[r]=parseInt(e.substring(i,i+2),16)}return n}function ns(s){let t=S(fn(s)?s:yn(s)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}var Ft;class jn{constructor(t,e,n){u(this,"filter");u(this,"emitter");P(this,Ft);E(this,Ft,e),b(this,{emitter:t,filter:n})}async removeListener(){h(this,Ft)!=null&&await this.emitter.off(this.filter,h(this,Ft))}}Ft=new WeakMap;function tr(s,t,e,n,r){p(!1,`invalid codepoint at offset ${t}; ${s}`,"bytes",e)}function mn(s,t,e,n,r){if(s==="BAD_PREFIX"||s==="UNEXPECTED_CONTINUE"){let i=0;for(let a=t+1;a<e.length&&e[a]>>6===2;a++)i++;return i}return s==="OVERRUN"?e.length-t-1:0}function er(s,t,e,n,r){return s==="OVERLONG"?(p(typeof r=="number","invalid bad code point for replacement","badCodepoint",r),n.push(r),0):(n.push(65533),mn(s,t,e))}const nr=Object.freeze({error:tr,ignore:mn,replace:er});function rr(s,t){t==null&&(t=nr.error);const e=oe(s,"bytes"),n=[];let r=0;for(;r<e.length;){const i=e[r++];if(!(i>>7)){n.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?r+=t("UNEXPECTED_CONTINUE",r-1,e,n):r+=t("BAD_PREFIX",r-1,e,n);continue}if(r-1+a>=e.length){r+=t("OVERRUN",r-1,e,n);continue}let c=i&(1<<8-a-1)-1;for(let l=0;l<a;l++){let f=e[r];if((f&192)!=128){r+=t("MISSING_CONTINUE",r,e,n),c=null;break}c=c<<6|f&63,r++}if(c!==null){if(c>1114111){r+=t("OUT_OF_RANGE",r-1-a,e,n,c);continue}if(c>=55296&&c<=57343){r+=t("UTF16_SURROGATE",r-1-a,e,n,c);continue}if(c<=o){r+=t("OVERLONG",r-1-a,e,n,c);continue}n.push(c)}}return n}function wn(s,t){p(typeof s=="string","invalid string value","str",s),t!=null&&(Kn(t),s=s.normalize(t));let e=[];for(let n=0;n<s.length;n++){const r=s.charCodeAt(n);if(r<128)e.push(r);else if(r<2048)e.push(r>>6|192),e.push(r&63|128);else if((r&64512)==55296){n++;const i=s.charCodeAt(n);p(n<s.length&&(i&64512)===56320,"invalid surrogate pair","str",s);const a=65536+((r&1023)<<10)+(i&1023);e.push(a>>18|240),e.push(a>>12&63|128),e.push(a>>6&63|128),e.push(a&63|128)}else e.push(r>>12|224),e.push(r>>6&63|128),e.push(r&63|128)}return new Uint8Array(e)}function sr(s){return s.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function ir(s,t){return sr(rr(s,t))}const F=32,Te=new Uint8Array(F),ar=["then"],te={},bn=new WeakMap;function wt(s){return bn.get(s)}function Je(s,t){bn.set(s,t)}function Vt(s,t){const e=new Error(`deferred error during ABI decoding triggered accessing ${s}`);throw e.error=t,e}function Re(s,t,e){return s.indexOf(null)>=0?t.map((n,r)=>n instanceof _t?Re(wt(n),n,e):n):s.reduce((n,r,i)=>{let a=t.getValue(r);return r in n||(e&&a instanceof _t&&(a=Re(wt(a),a,e)),n[r]=a),n},{})}var Lt;const Bt=class Bt extends Array{constructor(...e){const n=e[0];let r=e[1],i=(e[2]||[]).slice(),a=!0;n!==te&&(r=e,i=[],a=!1);super(r.length);P(this,Lt);r.forEach((l,f)=>{this[f]=l});const o=i.reduce((l,f)=>(typeof f=="string"&&l.set(f,(l.get(f)||0)+1),l),new Map);if(Je(this,Object.freeze(r.map((l,f)=>{const d=i[f];return d!=null&&o.get(d)===1?d:null}))),E(this,Lt,[]),h(this,Lt)==null&&h(this,Lt),!a)return;Object.freeze(this);const c=new Proxy(this,{get:(l,f,d)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){const m=ut(f,"%index");if(m<0||m>=this.length)throw new RangeError("out of result range");const x=l[m];return x instanceof Error&&Vt(`index ${m}`,x),x}if(ar.indexOf(f)>=0)return Reflect.get(l,f,d);const g=l[f];if(g instanceof Function)return function(...m){return g.apply(this===d?l:this,m)};if(!(f in l))return l.getValue.apply(this===d?l:this,[f])}return Reflect.get(l,f,d)}});return Je(c,wt(this)),c}toArray(e){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Vt(`index ${i}`,r),e&&r instanceof Bt&&(r=r.toArray(e)),n.push(r)}),n}toObject(e){const n=wt(this);return n.reduce((r,i,a)=>(w(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Re(n,this,e)),{})}slice(e,n){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const r=wt(this),i=[],a=[];for(let o=e;o<n;o++)i.push(this[o]),a.push(r[o]);return new Bt(te,i,a)}filter(e,n){const r=wt(this),i=[],a=[];for(let o=0;o<this.length;o++){const c=this[o];c instanceof Error&&Vt(`index ${o}`,c),e.call(n,c,o,this)&&(i.push(c),a.push(r[o]))}return new Bt(te,i,a)}map(e,n){const r=[];for(let i=0;i<this.length;i++){const a=this[i];a instanceof Error&&Vt(`index ${i}`,a),r.push(e.call(n,a,i,this))}return r}getValue(e){const n=wt(this).indexOf(e);if(n===-1)return;const r=this[n];return r instanceof Error&&Vt(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,n){return new Bt(te,e,n)}};Lt=new WeakMap;let _t=Bt;function Ke(s){let t=yn(s);return w(t.length<=F,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:F,offset:t.length}),t.length!==F&&(t=j(St([Te.slice(t.length%F),t]))),t}class lt{constructor(t,e,n,r){u(this,"name");u(this,"type");u(this,"localName");u(this,"dynamic");b(this,{name:t,type:e,localName:n,dynamic:r},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){p(!1,t,this.localName,e)}}var st,xt,Dt,re;class ke{constructor(){P(this,Dt);P(this,st);P(this,xt);E(this,st,[]),E(this,xt,0)}get data(){return St(h(this,st))}get length(){return h(this,xt)}appendWriter(t){return T(this,Dt,re).call(this,j(t.data))}writeBytes(t){let e=j(t);const n=e.length%F;return n&&(e=j(St([e,Te.slice(n)]))),T(this,Dt,re).call(this,e)}writeValue(t){return T(this,Dt,re).call(this,Ke(t))}writeUpdatableValue(){const t=h(this,st).length;return h(this,st).push(Te),E(this,xt,h(this,xt)+F),e=>{h(this,st)[t]=Ke(e)}}}st=new WeakMap,xt=new WeakMap,Dt=new WeakSet,re=function(t){return h(this,st).push(t),E(this,xt,h(this,xt)+t.length),t.length};var D,M,Nt,Pt,ft,At,Ie,En;const _e=class _e{constructor(t,e,n){P(this,At);u(this,"allowLoose");P(this,D);P(this,M);P(this,Nt);P(this,Pt);P(this,ft);b(this,{allowLoose:!!e}),E(this,D,j(t)),E(this,Nt,0),E(this,Pt,null),E(this,ft,n??1024),E(this,M,0)}get data(){return S(h(this,D))}get dataLength(){return h(this,D).length}get consumed(){return h(this,M)}get bytes(){return new Uint8Array(h(this,D))}subReader(t){const e=new _e(h(this,D).slice(h(this,M)+t),this.allowLoose,h(this,ft));return E(e,Pt,this),e}readBytes(t,e){let n=T(this,At,En).call(this,0,t,!!e);return T(this,At,Ie).call(this,t),E(this,M,h(this,M)+n.length),n.slice(0,t)}readValue(){return pn(this.readBytes(F))}readIndex(){return qn(this.readBytes(F))}};D=new WeakMap,M=new WeakMap,Nt=new WeakMap,Pt=new WeakMap,ft=new WeakMap,At=new WeakSet,Ie=function(t){var e;if(h(this,Pt))return T(e=h(this,Pt),At,Ie).call(e,t);E(this,Nt,h(this,Nt)+t),w(h(this,ft)<1||h(this,Nt)<=h(this,ft)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${h(this,ft)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:j(h(this,D)),offset:h(this,M),length:t,info:{bytesRead:h(this,Nt),dataLength:this.dataLength}})},En=function(t,e,n){let r=Math.ceil(e/F)*F;return h(this,M)+r>h(this,D).length&&(this.allowLoose&&n&&h(this,M)+e<=h(this,D).length?r=e:w(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:j(h(this,D)),length:h(this,D).length,offset:h(this,M)+r})),h(this,D).slice(h(this,M),h(this,M)+r)};let Ae=_e;const et={};function y(s,t){let e=!1;return t<0&&(e=!0,t*=-1),new C(et,`${e?"":"u"}int${t}`,s,{signed:e,width:t})}function N(s,t){return new C(et,`bytes${t||""}`,s,{size:t})}const We=Symbol.for("_ethers_typed");var Ot;const nt=class nt{constructor(t,e,n,r){u(this,"type");u(this,"value");P(this,Ot);u(this,"_typedSymbol");r==null&&(r=null),Le(et,t,"Typed"),b(this,{_typedSymbol:We,type:e,value:n}),E(this,Ot,r),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return h(this,Ot)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return h(this,Ot)===!0?-1:h(this,Ot)===!1?this.value.length:null}static from(t,e){return new nt(et,t,e)}static uint8(t){return y(t,8)}static uint16(t){return y(t,16)}static uint24(t){return y(t,24)}static uint32(t){return y(t,32)}static uint40(t){return y(t,40)}static uint48(t){return y(t,48)}static uint56(t){return y(t,56)}static uint64(t){return y(t,64)}static uint72(t){return y(t,72)}static uint80(t){return y(t,80)}static uint88(t){return y(t,88)}static uint96(t){return y(t,96)}static uint104(t){return y(t,104)}static uint112(t){return y(t,112)}static uint120(t){return y(t,120)}static uint128(t){return y(t,128)}static uint136(t){return y(t,136)}static uint144(t){return y(t,144)}static uint152(t){return y(t,152)}static uint160(t){return y(t,160)}static uint168(t){return y(t,168)}static uint176(t){return y(t,176)}static uint184(t){return y(t,184)}static uint192(t){return y(t,192)}static uint200(t){return y(t,200)}static uint208(t){return y(t,208)}static uint216(t){return y(t,216)}static uint224(t){return y(t,224)}static uint232(t){return y(t,232)}static uint240(t){return y(t,240)}static uint248(t){return y(t,248)}static uint256(t){return y(t,256)}static uint(t){return y(t,256)}static int8(t){return y(t,-8)}static int16(t){return y(t,-16)}static int24(t){return y(t,-24)}static int32(t){return y(t,-32)}static int40(t){return y(t,-40)}static int48(t){return y(t,-48)}static int56(t){return y(t,-56)}static int64(t){return y(t,-64)}static int72(t){return y(t,-72)}static int80(t){return y(t,-80)}static int88(t){return y(t,-88)}static int96(t){return y(t,-96)}static int104(t){return y(t,-104)}static int112(t){return y(t,-112)}static int120(t){return y(t,-120)}static int128(t){return y(t,-128)}static int136(t){return y(t,-136)}static int144(t){return y(t,-144)}static int152(t){return y(t,-152)}static int160(t){return y(t,-160)}static int168(t){return y(t,-168)}static int176(t){return y(t,-176)}static int184(t){return y(t,-184)}static int192(t){return y(t,-192)}static int200(t){return y(t,-200)}static int208(t){return y(t,-208)}static int216(t){return y(t,-216)}static int224(t){return y(t,-224)}static int232(t){return y(t,-232)}static int240(t){return y(t,-240)}static int248(t){return y(t,-248)}static int256(t){return y(t,-256)}static int(t){return y(t,-256)}static bytes1(t){return N(t,1)}static bytes2(t){return N(t,2)}static bytes3(t){return N(t,3)}static bytes4(t){return N(t,4)}static bytes5(t){return N(t,5)}static bytes6(t){return N(t,6)}static bytes7(t){return N(t,7)}static bytes8(t){return N(t,8)}static bytes9(t){return N(t,9)}static bytes10(t){return N(t,10)}static bytes11(t){return N(t,11)}static bytes12(t){return N(t,12)}static bytes13(t){return N(t,13)}static bytes14(t){return N(t,14)}static bytes15(t){return N(t,15)}static bytes16(t){return N(t,16)}static bytes17(t){return N(t,17)}static bytes18(t){return N(t,18)}static bytes19(t){return N(t,19)}static bytes20(t){return N(t,20)}static bytes21(t){return N(t,21)}static bytes22(t){return N(t,22)}static bytes23(t){return N(t,23)}static bytes24(t){return N(t,24)}static bytes25(t){return N(t,25)}static bytes26(t){return N(t,26)}static bytes27(t){return N(t,27)}static bytes28(t){return N(t,28)}static bytes29(t){return N(t,29)}static bytes30(t){return N(t,30)}static bytes31(t){return N(t,31)}static bytes32(t){return N(t,32)}static address(t){return new nt(et,"address",t)}static bool(t){return new nt(et,"bool",!!t)}static bytes(t){return new nt(et,"bytes",t)}static string(t){return new nt(et,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new nt(et,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===We}static dereference(t,e){if(nt.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}};Ot=new WeakMap;let C=nt;class or extends lt{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=C.dereference(e,"string");try{n=zt(n)}catch(r){return this._throwError(r.message,e)}return t.writeValue(n)}decode(t){return zt(gn(t.readValue(),20))}}class cr extends lt{constructor(e){super(e.name,e.type,"_",e.dynamic);u(this,"coder");this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,n){return this.coder.encode(e,n)}decode(e){return this.coder.decode(e)}}function xn(s,t,e){let n=[];if(Array.isArray(e))n=e;else if(e&&typeof e=="object"){let c={};n=t.map(l=>{const f=l.localName;return w(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),w(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),c[f]=!0,e[f]})}else p(!1,"invalid tuple value","tuple",e);p(t.length===n.length,"types/value length mismatch","tuple",e);let r=new ke,i=new ke,a=[];t.forEach((c,l)=>{let f=n[l];if(c.dynamic){let d=i.length;c.encode(i,f);let g=r.writeUpdatableValue();a.push(m=>{g(m+d)})}else c.encode(r,f)}),a.forEach(c=>{c(r.length)});let o=s.appendWriter(r);return o+=s.appendWriter(i),o}function Nn(s,t){let e=[],n=[],r=s.subReader(0);return t.forEach(i=>{let a=null;if(i.dynamic){let o=s.readIndex(),c=r.subReader(o);try{a=i.decode(c)}catch(l){if(Jt(l,"BUFFER_OVERRUN"))throw l;a=l,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(s)}catch(o){if(Jt(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");e.push(a),n.push(i.localName||null)}),_t.fromItems(e,n)}class ur extends lt{constructor(e,n,r){const i=e.type+"["+(n>=0?n:"")+"]",a=n===-1||e.dynamic;super("array",i,r,a);u(this,"coder");u(this,"length");b(this,{coder:e,length:n})}defaultValue(){const e=this.coder.defaultValue(),n=[];for(let r=0;r<this.length;r++)n.push(e);return n}encode(e,n){const r=C.dereference(n,"array");Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,e.writeValue(r.length)),hn(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<r.length;o++)a.push(this.coder);return xn(e,a,r)}decode(e){let n=this.length;n===-1&&(n=e.readIndex(),w(n*F<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:n*F,length:e.dataLength}));let r=[];for(let i=0;i<n;i++)r.push(new cr(this.coder));return Nn(e,r)}}class lr extends lt{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=C.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class Pn extends lt{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=j(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class fr extends Pn{constructor(t){super("bytes",t)}decode(t){return S(super.decode(t))}}class hr extends lt{constructor(e,n){let r="bytes"+String(e);super(r,r,n,!1);u(this,"size");b(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,n){let r=j(C.dereference(n,this.type));return r.length!==this.size&&this._throwError("incorrect data length",n),e.writeBytes(r)}decode(e){return S(e.readBytes(this.size))}}const dr=new Uint8Array([]);class pr extends lt{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes(dr)}decode(t){return t.readBytes(0),null}}const gr=BigInt(0),yr=BigInt(1),mr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class wr extends lt{constructor(e,n,r){const i=(n?"int":"uint")+e*8;super(i,i,r,!1);u(this,"size");u(this,"signed");b(this,{size:e,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,n){let r=gt(C.dereference(n,this.type)),i=jt(mr,F*8);if(this.signed){let a=jt(i,this.size*8-1);(r>a||r<-(a+yr))&&this._throwError("value out-of-bounds",n),r=Qn(r,8*F)}else(r<gr||r>jt(i,this.size*8))&&this._throwError("value out-of-bounds",n);return e.writeValue(r)}decode(e){let n=jt(e.readValue(),this.size*8);return this.signed&&(n=Zn(n,this.size*8)),n}}class br extends Pn{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,wn(C.dereference(e,"string")))}decode(t){return ir(super.decode(t))}}class ee extends lt{constructor(e,n){let r=!1;const i=[];e.forEach(o=>{o.dynamic&&(r=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,n,r);u(this,"coders");b(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(r=>{e.push(r.defaultValue())});const n=this.coders.reduce((r,i)=>{const a=i.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,i)=>{let a=r.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,n){const r=C.dereference(n,"tuple");return xn(e,this.coders,r)}decode(e){return Nn(e,this.coders)}}function Wt(s){return Pe(wn(s))}function xe(s,t){return{address:zt(s),storageKeys:t.map((e,n)=>(p(pt(e,32),"invalid slot",`storageKeys[${n}]`,e),e.toLowerCase()))}}function Er(s){if(Array.isArray(s))return s.map((e,n)=>Array.isArray(e)?(p(e.length===2,"invalid slot set",`value[${n}]`,e),xe(e[0],e[1])):(p(e!=null&&typeof e=="object","invalid address-slot set","value",s),xe(e.address,e.storageKeys)));p(s!=null&&typeof s=="object","invalid access list","value",s);const t=Object.keys(s).map(e=>{const n=s[e].reduce((r,i)=>(r[i]=!0,r),{});return xe(e,Object.keys(n).sort())});return t.sort((e,n)=>e.address.localeCompare(n.address)),t}function L(s){const t=new Set;return s.forEach(e=>t.add(e)),Object.freeze(t)}const xr="external public payable override",Nr=L(xr.split(" ")),On="constant external internal payable private public pure view override",Pr=L(On.split(" ")),vn="constructor error event fallback function receive struct",Tn=L(vn.split(" ")),Rn="calldata memory storage payable indexed",Or=L(Rn.split(" ")),vr="tuple returns",Tr=[vn,Rn,vr,On].join(" "),Rr=L(Tr.split(" ")),kr={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Ar=new RegExp("^(\\s*)"),Ir=new RegExp("^([0-9]+)"),Ur=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),kn=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),An=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var I,z,Xt,Ue;const he=class he{constructor(t){P(this,Xt);P(this,I);P(this,z);E(this,I,0),E(this,z,t.slice())}get offset(){return h(this,I)}get length(){return h(this,z).length-h(this,I)}clone(){return new he(h(this,z))}reset(){E(this,I,0)}popKeyword(t){const e=this.peek();if(e.type!=="KEYWORD"||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=T(this,Xt,Ue).call(this,h(this,I)+1,t.match+1);return E(this,I,t.match+1),e}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=[];for(;h(this,I)<t.match-1;){const n=this.peek().linkNext;e.push(T(this,Xt,Ue).call(this,h(this,I)+1,n)),E(this,I,n)}return E(this,I,t.match+1),e}peek(){if(h(this,I)>=h(this,z).length)throw new Error("out-of-bounds");return h(this,z)[h(this,I)]}peekKeyword(t){const e=this.peekType("KEYWORD");return e!=null&&t.has(e)?e:null}peekType(t){if(this.length===0)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return He(this,I)._++,t}toString(){const t=[];for(let e=h(this,I);e<h(this,z).length;e++){const n=h(this,z)[e];t.push(`${n.type}:${n.text}`)}return`<TokenString ${t.join(" ")}>`}};I=new WeakMap,z=new WeakMap,Xt=new WeakSet,Ue=function(t=0,e=0){return new he(h(this,z).slice(t,e).map(n=>Object.freeze(Object.assign({},n,{match:n.match-t,linkBack:n.linkBack-t,linkNext:n.linkNext-t}))))};let K=he;function yt(s){const t=[],e=a=>{const o=i<s.length?JSON.stringify(s[i]):"$EOI";throw new Error(`invalid token ${o} at ${i}: ${a}`)};let n=[],r=[],i=0;for(;i<s.length;){let a=s.substring(i),o=a.match(Ar);o&&(i+=o[1].length,a=s.substring(i));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};t.push(c);let l=kr[a[0]]||"";if(l){if(c.type=l,c.text=a[0],i++,l==="OPEN_PAREN")n.push(t.length-1),r.push(t.length-1);else if(l=="CLOSE_PAREN")n.length===0&&e("no matching open bracket"),c.match=n.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=r.pop(),t[c.linkBack].linkNext=t.length-1;else if(l==="COMMA")c.linkBack=r.pop(),t[c.linkBack].linkNext=t.length-1,r.push(t.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let f=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const d=t.pop().text;f=d+f,t[t.length-1].value=ut(d)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=f}continue}if(o=a.match(Ur),o){if(c.text=o[1],i+=c.text.length,Rr.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(An)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(Ir),o){c.text=o[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new K(t.map(a=>Object.freeze(a)))}function Ye(s,t){let e=[];for(const n in t.keys())s.has(n)&&e.push(n);if(e.length>1)throw new Error(`conflicting types: ${e.join(", ")}`)}function ye(s,t){if(t.peekKeyword(Tn)){const e=t.pop().text;if(e!==s)throw new Error(`expected ${s}, got ${e}`)}return t.popType("ID")}function ct(s,t){const e=new Set;for(;;){const n=s.peekType("KEYWORD");if(n==null||t&&!t.has(n))break;if(s.pop(),e.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);e.add(n)}return Object.freeze(e)}function In(s){let t=ct(s,Pr);return Ye(t,L("constant payable nonpayable".split(" "))),Ye(t,L("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function ot(s,t){return s.popParams().map(e=>U.from(e,t))}function Un(s){if(s.peekType("AT")){if(s.pop(),s.peekType("NUMBER"))return gt(s.pop().text);throw new Error("invalid gas")}return null}function Tt(s){if(s.length)throw new Error(`unexpected tokens at offset ${s.offset}: ${s.toString()}`)}const Br=new RegExp(/^(.*)\[([0-9]*)\]$/);function Xe(s){const t=s.match(An);if(p(t,"invalid type","type",s),s==="uint")return"uint256";if(s==="int")return"int256";if(t[2]){const e=parseInt(t[2]);p(e!==0&&e<=32,"invalid bytes length","type",s)}else if(t[3]){const e=parseInt(t[3]);p(e!==0&&e<=256&&e%8===0,"invalid numeric width","type",s)}return s}const R={},G=Symbol.for("_ethers_internal"),Ze="_ParamTypeInternal",Qe="_ErrorInternal",qe="_EventInternal",je="_ConstructorInternal",tn="_FallbackInternal",en="_FunctionInternal",nn="_StructInternal";var $t,se;const H=class H{constructor(t,e,n,r,i,a,o,c){P(this,$t);u(this,"name");u(this,"type");u(this,"baseType");u(this,"indexed");u(this,"components");u(this,"arrayLength");u(this,"arrayChildren");if(Le(t,R,"ParamType"),Object.defineProperty(this,G,{value:Ze}),a&&(a=Object.freeze(a.slice())),r==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(r==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");b(this,{name:e,type:n,baseType:r,indexed:i,components:a,arrayLength:o,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="json"){const n=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const r={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(i=>JSON.parse(i.format(t)))),JSON.stringify(r)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map(n=>n.format(t)).join(t==="full"?", ":",")+")":e+=this.type,t!=="sighash"&&(this.indexed===!0&&(e+=" indexed"),t==="full"&&this.name&&(e+=" "+this.name)),e}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map(r=>n.arrayChildren.walk(r,e))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map((r,i)=>n.components[i].walk(r,e))}return e(this.type,t)}async walkAsync(t,e){const n=[],r=[t];return T(this,$t,se).call(this,n,t,e,i=>{r[0]=i}),n.length&&await Promise.all(n),r[0]}static from(t,e){if(H.isParamType(t))return t;if(typeof t=="string")try{return H.from(yt(t),e)}catch{p(!1,"invalid param type","obj",t)}else if(t instanceof K){let o="",c="",l=null;ct(t,L(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",l=t.popParams().map(v=>H.from(v)),o=`tuple(${l.map(v=>v.format()).join(",")})`):(o=Xe(t.popType("TYPE")),c=o);let f=null,d=null;for(;t.length&&t.peekType("BRACKET");){const v=t.pop();f=new H(R,"",o,c,null,l,d,f),d=v.value,o+=v.text,c="array",l=null}let g=null;if(ct(t,Or).has("indexed")){if(!e)throw new Error("");g=!0}const x=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new H(R,x,o,c,g,l,d,f)}const n=t.name;p(!n||typeof n=="string"&&n.match(kn),"invalid name","obj.name",n);let r=t.indexed;r!=null&&(p(e,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,a=i.match(Br);if(a){const o=parseInt(a[2]||"-1"),c=H.from({type:a[1],components:t.components});return new H(R,n||"",i,"array",r,null,o,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const o=t.components!=null?t.components.map(l=>H.from(l)):null;return new H(R,n||"",i,"tuple",r,o,null,null)}return i=Xe(t.type),new H(R,n||"",i,i,r,null,null,null)}static isParamType(t){return t&&t[G]===Ze}};$t=new WeakSet,se=function(t,e,n,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=e.slice();o.forEach((c,l)=>{var f;T(f=a,$t,se).call(f,t,c,n,d=>{o[l]=d})}),r(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(e))o=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in e))throw new Error(`missing value for component ${c.name}`);return e[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,l)=>{var f;T(f=a[l],$t,se).call(f,t,c,n,d=>{o[l]=d})}),r(o);return}const i=n(this.type,e);i.then?t.push(async function(){r(await i)}()):r(i)};let U=H;class Rt{constructor(t,e,n){u(this,"type");u(this,"inputs");Le(t,R,"Fragment"),n=Object.freeze(n.slice()),b(this,{type:e,inputs:n})}static from(t){if(typeof t=="string"){try{Rt.from(JSON.parse(t))}catch{}return Rt.from(yt(t))}if(t instanceof K)switch(t.peekKeyword(Tn)){case"constructor":return at.from(t);case"error":return $.from(t);case"event":return Q.from(t);case"fallback":case"receive":return rt.from(t);case"function":return q.from(t);case"struct":return vt.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return at.from(t);case"error":return $.from(t);case"event":return Q.from(t);case"fallback":case"receive":return rt.from(t);case"function":return q.from(t);case"struct":return vt.from(t)}w(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}p(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return at.isFragment(t)}static isError(t){return $.isFragment(t)}static isEvent(t){return Q.isFragment(t)}static isFunction(t){return q.isFragment(t)}static isStruct(t){return vt.isFragment(t)}}class me extends Rt{constructor(e,n,r,i){super(e,n,i);u(this,"name");p(typeof r=="string"&&r.match(kn),"invalid identifier","name",r),i=Object.freeze(i.slice()),b(this,{name:r})}}function Yt(s,t){return"("+t.map(e=>e.format(s)).join(s==="full"?", ":",")+")"}class $ extends me{constructor(t,e,n){super(t,"error",e,n),Object.defineProperty(this,G,{value:Qe})}get selector(){return Wt(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});const e=[];return t!=="sighash"&&e.push("error"),e.push(this.name+Yt(t,this.inputs)),e.join(" ")}static from(t){if($.isFragment(t))return t;if(typeof t=="string")return $.from(yt(t));if(t instanceof K){const e=ye("error",t),n=ot(t);return Tt(t),new $(R,e,n)}return new $(R,t.name,t.inputs?t.inputs.map(U.from):[])}static isFragment(t){return t&&t[G]===Qe}}class Q extends me{constructor(e,n,r,i){super(e,"event",n,r);u(this,"anonymous");Object.defineProperty(this,G,{value:qe}),b(this,{anonymous:i})}get topicHash(){return Wt(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("event"),n.push(this.name+Yt(e,this.inputs)),e!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(e,n){return n=(n||[]).map(i=>U.from(i)),new Q(R,e,n,!1).topicHash}static from(e){if(Q.isFragment(e))return e;if(typeof e=="string")try{return Q.from(yt(e))}catch{p(!1,"invalid event fragment","obj",e)}else if(e instanceof K){const n=ye("event",e),r=ot(e,!0),i=!!ct(e,L(["anonymous"])).has("anonymous");return Tt(e),new Q(R,n,r,i)}return new Q(R,e.name,e.inputs?e.inputs.map(n=>U.from(n,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[G]===qe}}class at extends Rt{constructor(e,n,r,i,a){super(e,n,r);u(this,"payable");u(this,"gas");Object.defineProperty(this,G,{value:je}),b(this,{payable:i,gas:a})}format(e){if(w(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[`constructor${Yt(e,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(e){if(at.isFragment(e))return e;if(typeof e=="string")try{return at.from(yt(e))}catch{p(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof K){ct(e,L(["constructor"]));const n=ot(e),r=!!ct(e,Nr).has("payable"),i=Un(e);return Tt(e),new at(R,"constructor",n,r,i)}return new at(R,"constructor",e.inputs?e.inputs.map(U.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[G]===je}}class rt extends Rt{constructor(e,n,r){super(e,"fallback",n);u(this,"payable");Object.defineProperty(this,G,{value:tn}),b(this,{payable:r})}format(e){const n=this.inputs.length===0?"receive":"fallback";if(e==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:r})}return`${n}()${this.payable?" payable":""}`}static from(e){if(rt.isFragment(e))return e;if(typeof e=="string")try{return rt.from(yt(e))}catch{p(!1,"invalid fallback fragment","obj",e)}else if(e instanceof K){const n=e.toString(),r=e.peekKeyword(L(["fallback","receive"]));if(p(r,"type must be fallback or receive","obj",n),e.popKeyword(L(["fallback","receive"]))==="receive"){const c=ot(e);return p(c.length===0,"receive cannot have arguments","obj.inputs",c),ct(e,L(["payable"])),Tt(e),new rt(R,[],!0)}let a=ot(e);a.length?p(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(c=>c.format("minimal")).join(", ")):a=[U.from("bytes")];const o=In(e);if(p(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),ct(e,L(["returns"])).has("returns")){const c=ot(e);p(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Tt(e),new rt(R,a,o==="payable")}if(e.type==="receive")return new rt(R,[],!0);if(e.type==="fallback"){const n=[U.from("bytes")],r=e.stateMutability==="payable";return new rt(R,n,r)}p(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[G]===tn}}class q extends me{constructor(e,n,r,i,a,o){super(e,"function",n,i);u(this,"constant");u(this,"outputs");u(this,"stateMutability");u(this,"payable");u(this,"gas");Object.defineProperty(this,G,{value:en}),a=Object.freeze(a.slice()),b(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Wt(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e))),outputs:this.outputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("function"),n.push(this.name+Yt(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Yt(e,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(e,n){return n=(n||[]).map(i=>U.from(i)),new q(R,e,"view",n,[],null).selector}static from(e){if(q.isFragment(e))return e;if(typeof e=="string")try{return q.from(yt(e))}catch{p(!1,"invalid function fragment","obj",e)}else if(e instanceof K){const r=ye("function",e),i=ot(e),a=In(e);let o=[];ct(e,L(["returns"])).has("returns")&&(o=ot(e));const c=Un(e);return Tt(e),new q(R,r,a,i,o,c)}let n=e.stateMutability;return n==null&&(n="payable",typeof e.constant=="boolean"?(n="view",e.constant||(n="payable",typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable")),new q(R,e.name,n,e.inputs?e.inputs.map(U.from):[],e.outputs?e.outputs.map(U.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[G]===en}}class vt extends me{constructor(t,e,n){super(t,"struct",e,n),Object.defineProperty(this,G,{value:nn})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return vt.from(yt(t))}catch{p(!1,"invalid struct fragment","obj",t)}else if(t instanceof K){const e=ye("struct",t),n=ot(t);return Tt(t),new vt(R,e,n)}return new vt(R,t.name,t.inputs?t.inputs.map(U.from):[])}static isFragment(t){return t&&t[G]===nn}}const W=new Map;W.set(0,"GENERIC_PANIC");W.set(1,"ASSERT_FALSE");W.set(17,"OVERFLOW");W.set(18,"DIVIDE_BY_ZERO");W.set(33,"ENUM_RANGE_ERROR");W.set(34,"BAD_STORAGE_DATA");W.set(49,"STACK_UNDERFLOW");W.set(50,"ARRAY_RANGE_ERROR");W.set(65,"OUT_OF_MEMORY");W.set(81,"UNINITIALIZED_FUNCTION_CALL");const Sr=new RegExp(/^bytes([0-9]*)$/),Cr=new RegExp(/^(u?int)([0-9]*)$/);let Ne=null,rn=1024;function Fr(s,t,e,n){let r="missing revert data",i=null;const a=null;let o=null;if(e){r="execution reverted";const l=oe(e);if(e=S(e),l.length===0)r+=" (no data present; likely require(false) occurred",i="require(false)";else if(l.length%32!==4)r+=" (could not decode reason; invalid data length)";else if(S(l.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],l.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},r+=`: ${JSON.stringify(i)}`}catch{r+=" (could not decode reason; invalid string data)"}else if(S(l.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],l.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},i=`Panic due to ${W.get(f)||"UNKNOWN"}(${f})`,r+=`: ${i}`}catch{r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const c={to:t.to?zt(t.to):null,data:t.data||"0x"};return t.from&&(c.from=zt(t.from)),ce(r,"CALL_EXCEPTION",{action:s,data:e,reason:i,transaction:c,invocation:a,revert:o})}var ht,Ut;const de=class de{constructor(){P(this,ht)}getDefaultValue(t){const e=t.map(r=>T(this,ht,Ut).call(this,U.from(r)));return new ee(e,"_").defaultValue()}encode(t,e){hn(e.length,t.length,"types/values length mismatch");const n=t.map(a=>T(this,ht,Ut).call(this,U.from(a))),r=new ee(n,"_"),i=new ke;return r.encode(i,e),i.data}decode(t,e,n){const r=t.map(a=>T(this,ht,Ut).call(this,U.from(a)));return new ee(r,"_").decode(new Ae(e,n,rn))}static _setDefaultMaxInflation(t){p(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),rn=t}static defaultAbiCoder(){return Ne==null&&(Ne=new de),Ne}static getBuiltinCallException(t,e,n){return Fr(t,e,n,de.defaultAbiCoder())}};ht=new WeakSet,Ut=function(t){if(t.isArray())return new ur(T(this,ht,Ut).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new ee(t.components.map(n=>T(this,ht,Ut).call(this,n)),t.name);switch(t.baseType){case"address":return new or(t.name);case"bool":return new lr(t.name);case"string":return new br(t.name);case"bytes":return new fr(t.name);case"":return new pr(t.name)}let e=t.type.match(Cr);if(e){let n=parseInt(e[2]||"256");return p(n!==0&&n<=256&&n%8===0,"invalid "+e[1]+" bit length","param",t),new wr(n/8,e[1]==="int",t.name)}if(e=t.type.match(Sr),e){let n=parseInt(e[1]);return p(n!==0&&n<=32,"invalid bytes length","param",t),new hr(n,t.name)}p(!1,"invalid type","type",t.type)};let ue=de;class Lr{constructor(t,e,n){u(this,"fragment");u(this,"name");u(this,"signature");u(this,"topic");u(this,"args");const r=t.name,i=t.format();b(this,{fragment:t,name:r,signature:i,topic:e,args:n})}}class Dr{constructor(t,e,n,r){u(this,"fragment");u(this,"name");u(this,"args");u(this,"signature");u(this,"selector");u(this,"value");const i=t.name,a=t.format();b(this,{fragment:t,name:i,args:n,signature:a,selector:e,value:r})}}class $r{constructor(t,e,n){u(this,"fragment");u(this,"name");u(this,"args");u(this,"signature");u(this,"selector");const r=t.name,i=t.format();b(this,{fragment:t,name:r,args:n,signature:i,selector:e})}}class sn{constructor(t){u(this,"hash");u(this,"_isIndexed");b(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const an={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},on={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:s=>`reverted with reason string ${JSON.stringify(s)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:s=>{let t="unknown panic code";return s>=0&&s<=255&&an[s.toString()]&&(t=an[s.toString()]),`reverted with panic code 0x${s.toString(16)} (${t})`}}};var Y,X,Z,B,tt,ie,ae;const bt=class bt{constructor(t){P(this,tt);u(this,"fragments");u(this,"deploy");u(this,"fallback");u(this,"receive");P(this,Y);P(this,X);P(this,Z);P(this,B);let e=[];typeof t=="string"?e=JSON.parse(t):e=t,E(this,Z,new Map),E(this,Y,new Map),E(this,X,new Map);const n=[];for(const a of e)try{n.push(Rt.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}b(this,{fragments:Object.freeze(n)});let r=null,i=!1;E(this,B,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}b(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(p(!r||a.payable!==r.payable,"conflicting fallback fragments",`fragments[${o}]`,a),r=a,i=r.payable);return;case"function":c=h(this,Z);break;case"event":c=h(this,X);break;case"error":c=h(this,Y);break;default:return}const l=a.format();c.has(l)||c.set(l,a)}),this.deploy||b(this,{deploy:at.from("constructor()")}),b(this,{fallback:r,receive:i})}format(t){const e=t?"minimal":"full";return this.fragments.map(r=>r.format(e))}formatJson(){const t=this.fragments.map(e=>e.format("json"));return JSON.stringify(t.map(e=>JSON.parse(e)))}getAbiCoder(){return ue.defaultAbiCoder()}getFunctionName(t){const e=T(this,tt,ie).call(this,t,null,!1);return p(e,"no matching function","key",t),e.name}hasFunction(t){return!!T(this,tt,ie).call(this,t,null,!1)}getFunction(t,e){return T(this,tt,ie).call(this,t,e||null,!0)}forEachFunction(t){const e=Array.from(h(this,Z).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(h(this,Z).get(r),n)}}getEventName(t){const e=T(this,tt,ae).call(this,t,null,!1);return p(e,"no matching event","key",t),e.name}hasEvent(t){return!!T(this,tt,ae).call(this,t,null,!1)}getEvent(t,e){return T(this,tt,ae).call(this,t,e||null,!0)}forEachEvent(t){const e=Array.from(h(this,X).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(h(this,X).get(r),n)}}getError(t,e){if(pt(t)){const r=t.toLowerCase();if(on[r])return $.from(on[r].signature);for(const i of h(this,Y).values())if(r===i.selector)return i;return null}if(t.indexOf("(")===-1){const r=[];for(const[i,a]of h(this,Y))i.split("(")[0]===t&&r.push(a);if(r.length===0)return t==="Error"?$.from("error Error(string)"):t==="Panic"?$.from("error Panic(uint256)"):null;if(r.length>1){const i=r.map(a=>JSON.stringify(a.format())).join(", ");p(!1,`ambiguous error description (i.e. ${i})`,"name",t)}return r[0]}if(t=$.from(t).format(),t==="Error(string)")return $.from("error Error(string)");if(t==="Panic(uint256)")return $.from("error Panic(uint256)");const n=h(this,Y).get(t);return n||null}forEachError(t){const e=Array.from(h(this,Y).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(h(this,Y).get(r),n)}}_decodeParams(t,e){return h(this,B).decode(t,e)}_encodeParams(t,e){return h(this,B).encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if(typeof t=="string"){const n=this.getError(t);p(n,"unknown error","fragment",t),t=n}return p(It(e,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,It(e,4))}encodeErrorResult(t,e){if(typeof t=="string"){const n=this.getError(t);p(n,"unknown error","fragment",t),t=n}return St([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if(typeof t=="string"){const n=this.getFunction(t);p(n,"unknown function","fragment",t),t=n}return p(It(e,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,It(e,4))}encodeFunctionData(t,e){if(typeof t=="string"){const n=this.getFunction(t);p(n,"unknown function","fragment",t),t=n}return St([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if(typeof t=="string"){const i=this.getFunction(t);p(i,"unknown function","fragment",t),t=i}let n="invalid length for result data";const r=j(e);if(r.length%32===0)try{return h(this,B).decode(t.outputs,r)}catch{n="could not decode result data"}w(!1,n,"BAD_DATA",{value:S(r),info:{method:t.name,signature:t.format()}})}makeError(t,e){const n=oe(t,"data"),r=ue.getBuiltinCallException("call",e,n);if(r.message.startsWith("execution reverted (unknown custom error)")){const o=S(n.slice(0,4)),c=this.getError(o);if(c)try{const l=h(this,B).decode(c.inputs,n.slice(4));r.revert={name:c.name,signature:c.format(),args:l},r.reason=r.revert.signature,r.message=`execution reverted: ${r.reason}`}catch{r.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(e);return a&&(r.invocation={method:a.name,signature:a.signature,args:a.args}),r}encodeFunctionResult(t,e){if(typeof t=="string"){const n=this.getFunction(t);p(n,"unknown function","fragment",t),t=n}return S(h(this,B).encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if(typeof t=="string"){const i=this.getEvent(t);p(i,"unknown event","eventFragment",t),t=i}w(e.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const n=[];t.anonymous||n.push(t.topicHash);const r=(i,a)=>i.type==="string"?Wt(a):i.type==="bytes"?Pe(S(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=gn(a):i.type.match(/^bytes/)?a=Wn(a,32):i.type==="address"&&h(this,B).encode(["address"],[a]),Yn(S(a),32));for(e.forEach((i,a)=>{const o=t.inputs[a];if(!o.indexed){p(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?p(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?n.push(i.map(c=>r(o,c))):n.push(r(o,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(t,e){if(typeof t=="string"){const a=this.getEvent(t);p(a,"unknown event","eventFragment",t),t=a}const n=[],r=[],i=[];return t.anonymous||n.push(t.topicHash),p(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach((a,o)=>{const c=e[o];if(a.indexed)if(a.type==="string")n.push(Wt(c));else if(a.type==="bytes")n.push(Pe(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(h(this,B).encode([a.type],[c]))}else r.push(a),i.push(c)}),{data:h(this,B).encode(r,i),topics:n}}decodeEventLog(t,e,n){if(typeof t=="string"){const m=this.getEvent(t);p(m,"unknown event","eventFragment",t),t=m}if(n!=null&&!t.anonymous){const m=t.topicHash;p(pt(n[0],32)&&n[0].toLowerCase()===m,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],a=[];t.inputs.forEach((m,x)=>{m.indexed?m.type==="string"||m.type==="bytes"||m.baseType==="tuple"||m.baseType==="array"?(r.push(U.from({type:"bytes32",name:m.name})),a.push(!0)):(r.push(m),a.push(!1)):(i.push(m),a.push(!1))});const o=n!=null?h(this,B).decode(r,St(n)):null,c=h(this,B).decode(i,e,!0),l=[],f=[];let d=0,g=0;return t.inputs.forEach((m,x)=>{let v=null;if(m.indexed)if(o==null)v=new sn(null);else if(a[x])v=new sn(o[g++]);else try{v=o[g++]}catch(k){v=k}else try{v=c[d++]}catch(k){v=k}l.push(v),f.push(m.name||null)}),_t.fromItems(l,f)}parseTransaction(t){const e=oe(t.data,"tx.data"),n=gt(t.value!=null?t.value:0,"tx.value"),r=this.getFunction(S(e.slice(0,4)));if(!r)return null;const i=h(this,B).decode(r.inputs,e.slice(4));return new Dr(r,r.selector,i,n)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Lr(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=S(t),n=this.getError(It(e,0,4));if(!n)return null;const r=h(this,B).decode(n.inputs,It(e,4));return new $r(n,n.selector,r)}static from(t){return t instanceof bt?t:typeof t=="string"?new bt(JSON.parse(t)):typeof t.formatJson=="function"?new bt(t.formatJson()):typeof t.format=="function"?new bt(t.format("json")):new bt(t)}};Y=new WeakMap,X=new WeakMap,Z=new WeakMap,B=new WeakMap,tt=new WeakSet,ie=function(t,e,n){if(pt(t)){const i=t.toLowerCase();for(const a of h(this,Z).values())if(i===a.selector)return a;return null}if(t.indexOf("(")===-1){const i=[];for(const[a,o]of h(this,Z))a.split("(")[0]===t&&i.push(o);if(e){const a=e.length>0?e[e.length-1]:null;let o=e.length,c=!0;C.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let l=i.length-1;l>=0;l--){const f=i[l].inputs.length;f!==o&&(!c||f!==o-1)&&i.splice(l,1)}for(let l=i.length-1;l>=0;l--){const f=i[l].inputs;for(let d=0;d<e.length;d++)if(C.isTyped(e[d])){if(d>=f.length){if(e[d].type==="overrides")continue;i.splice(l,1);break}if(e[d].type!==f[d].baseType){i.splice(l,1);break}}}}if(i.length===1&&e&&e.length!==i[0].inputs.length){const a=e[e.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");p(!1,`ambiguous function description (i.e. matches ${a})`,"key",t)}return i[0]}const r=h(this,Z).get(q.from(t).format());return r||null},ae=function(t,e,n){if(pt(t)){const i=t.toLowerCase();for(const a of h(this,X).values())if(i===a.topicHash)return a;return null}if(t.indexOf("(")===-1){const i=[];for(const[a,o]of h(this,X))a.split("(")[0]===t&&i.push(o);if(e){for(let a=i.length-1;a>=0;a--)i[a].inputs.length<e.length&&i.splice(a,1);for(let a=i.length-1;a>=0;a--){const o=i[a].inputs;for(let c=0;c<e.length;c++)if(C.isTyped(e[c])&&e[c].type!==o[c].baseType){i.splice(a,1);break}}}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");p(!1,`ambiguous event description (i.e. matches ${a})`,"key",t)}return i[0]}const r=h(this,X).get(Q.from(t).format());return r||null};let Be=bt;const Bn=BigInt(0);function Ct(s){return s??null}function A(s){return s==null?null:s.toString()}class rs{constructor(t,e,n){u(this,"gasPrice");u(this,"maxFeePerGas");u(this,"maxPriorityFeePerGas");b(this,{gasPrice:Ct(t),maxFeePerGas:Ct(e),maxPriorityFeePerGas:Ct(n)})}toJSON(){const{gasPrice:t,maxFeePerGas:e,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:A(t),maxFeePerGas:A(e),maxPriorityFeePerGas:A(n)}}}function Gr(s){const t={};s.to&&(t.to=s.to),s.from&&(t.from=s.from),s.data&&(t.data=S(s.data));const e="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of e)!(r in s)||s[r]==null||(t[r]=gt(s[r],`request.${r}`));const n="type,nonce".split(/,/);for(const r of n)!(r in s)||s[r]==null||(t[r]=ut(s[r],`request.${r}`));return s.accessList&&(t.accessList=Er(s.accessList)),"blockTag"in s&&(t.blockTag=s.blockTag),"enableCcipRead"in s&&(t.enableCcipRead=!!s.enableCcipRead),"customData"in s&&(t.customData=s.customData),"blobVersionedHashes"in s&&s.blobVersionedHashes&&(t.blobVersionedHashes=s.blobVersionedHashes.slice()),"kzg"in s&&(t.kzg=s.kzg),"blobs"in s&&s.blobs&&(t.blobs=s.blobs.map(r=>fn(r)?S(r):Object.assign({},r))),t}var it;class ss{constructor(t,e){u(this,"provider");u(this,"number");u(this,"hash");u(this,"timestamp");u(this,"parentHash");u(this,"parentBeaconBlockRoot");u(this,"nonce");u(this,"difficulty");u(this,"gasLimit");u(this,"gasUsed");u(this,"stateRoot");u(this,"receiptsRoot");u(this,"blobGasUsed");u(this,"excessBlobGas");u(this,"miner");u(this,"prevRandao");u(this,"extraData");u(this,"baseFeePerGas");P(this,it);E(this,it,t.transactions.map(n=>typeof n!="string"?new le(n,e):n)),b(this,{provider:e,hash:Ct(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:Ct(t.prevRandao),extraData:t.extraData,baseFeePerGas:Ct(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return h(this,it).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=h(this,it).slice();return t.length===0?[]:(w(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:e,extraData:n,gasLimit:r,gasUsed:i,hash:a,miner:o,prevRandao:c,nonce:l,number:f,parentHash:d,parentBeaconBlockRoot:g,stateRoot:m,receiptsRoot:x,timestamp:v,transactions:k}=this;return{_type:"Block",baseFeePerGas:A(t),difficulty:A(e),extraData:n,gasLimit:A(r),gasUsed:A(i),blobGasUsed:A(this.blobGasUsed),excessBlobGas:A(this.excessBlobGas),hash:a,miner:o,prevRandao:c,nonce:l,number:f,parentHash:d,timestamp:v,parentBeaconBlockRoot:g,stateRoot:m,receiptsRoot:x,transactions:k}}[Symbol.iterator](){let t=0;const e=this.transactions;return{next:()=>t<this.length?{value:e[t++],done:!1}:{value:void 0,done:!0}}}get length(){return h(this,it).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let e;if(typeof t=="number")e=h(this,it)[t];else{const n=t.toLowerCase();for(const r of h(this,it))if(typeof r=="string"){if(r!==n)continue;e=r;break}else{if(r.hash!==n)continue;e=r;break}}if(e==null)throw new Error("no such tx");return typeof e=="string"?await this.provider.getTransaction(e):e}getPrefetchedTransaction(t){const e=this.prefetchedTransactions;if(typeof t=="number")return e[t];t=t.toLowerCase();for(const n of e)if(n.hash===t)return n;p(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Vr(this)}}it=new WeakMap;class we{constructor(t,e){u(this,"provider");u(this,"transactionHash");u(this,"blockHash");u(this,"blockNumber");u(this,"removed");u(this,"address");u(this,"data");u(this,"topics");u(this,"index");u(this,"transactionIndex");this.provider=e;const n=Object.freeze(t.topics.slice());b(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:n,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:e,blockNumber:n,data:r,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:t,blockHash:e,blockNumber:n,data:r,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:l}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return w(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return w(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return w(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return Mr(this)}}var Zt;class _r{constructor(t,e){u(this,"provider");u(this,"to");u(this,"from");u(this,"contractAddress");u(this,"hash");u(this,"index");u(this,"blockHash");u(this,"blockNumber");u(this,"logsBloom");u(this,"gasUsed");u(this,"blobGasUsed");u(this,"cumulativeGasUsed");u(this,"gasPrice");u(this,"blobGasPrice");u(this,"type");u(this,"status");u(this,"root");P(this,Zt);E(this,Zt,Object.freeze(t.logs.map(r=>new we(r,e))));let n=Bn;t.effectiveGasPrice!=null?n=t.effectiveGasPrice:t.gasPrice!=null&&(n=t.gasPrice),b(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:n,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return h(this,Zt)}toJSON(){const{to:t,from:e,contractAddress:n,hash:r,index:i,blockHash:a,blockNumber:o,logsBloom:c,logs:l,status:f,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:A(this.cumulativeGasUsed),from:e,gasPrice:A(this.gasPrice),blobGasUsed:A(this.blobGasUsed),blobGasPrice:A(this.blobGasPrice),gasUsed:A(this.gasUsed),hash:r,index:i,logs:l,logsBloom:c,root:d,status:f,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return Cn(this)}reorderedEvent(t){return w(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),Sn(this,t)}}Zt=new WeakMap;var dt;const Ve=class Ve{constructor(t,e){u(this,"provider");u(this,"blockNumber");u(this,"blockHash");u(this,"index");u(this,"hash");u(this,"type");u(this,"to");u(this,"from");u(this,"nonce");u(this,"gasLimit");u(this,"gasPrice");u(this,"maxPriorityFeePerGas");u(this,"maxFeePerGas");u(this,"maxFeePerBlobGas");u(this,"data");u(this,"value");u(this,"chainId");u(this,"signature");u(this,"accessList");u(this,"blobVersionedHashes");P(this,dt);this.provider=e,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,E(this,dt,-1)}toJSON(){const{blockNumber:t,blockHash:e,index:n,hash:r,type:i,to:a,from:o,nonce:c,data:l,signature:f,accessList:d,blobVersionedHashes:g}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:t,blockHash:e,blobVersionedHashes:g,chainId:A(this.chainId),data:l,from:o,gasLimit:A(this.gasLimit),gasPrice:A(this.gasPrice),hash:r,maxFeePerGas:A(this.maxFeePerGas),maxPriorityFeePerGas:A(this.maxPriorityFeePerGas),maxFeePerBlobGas:A(this.maxFeePerBlobGas),nonce:c,signature:f,to:a,index:n,type:i,value:A(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const n=await this.getTransaction();n&&(t=n.blockNumber)}if(t==null)return null;const e=this.provider.getBlock(t);if(e==null)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:e,blockNumber:n}=await Oe({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:n-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,e){const n=t??1,r=e??0;let i=h(this,dt),a=-1,o=i===-1;const c=async()=>{if(o)return null;const{blockNumber:g,nonce:m}=await Oe({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(m<this.nonce){i=g;return}if(o)return null;const x=await this.getTransaction();if(!(x&&x.blockNumber!=null))for(a===-1&&(a=i-3,a<h(this,dt)&&(a=h(this,dt)));a<=g;){if(o)return null;const v=await this.provider.getBlock(a,!0);if(v==null)return;for(const k of v)if(k===this.hash)return;for(let k=0;k<v.length;k++){const O=await v.getTransaction(k);if(O.from===this.from&&O.nonce===this.nonce){if(o)return null;const _=await this.provider.getTransactionReceipt(O.hash);if(_==null||g-_.blockNumber+1<n)return;let mt="replaced";O.data===this.data&&O.to===this.to&&O.value===this.value?mt="repriced":O.data==="0x"&&O.from===O.to&&O.value===Bn&&(mt="cancelled"),w(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:mt==="replaced"||mt==="cancelled",reason:mt,replacement:O.replaceableTransaction(i),hash:O.hash,receipt:_})}}a++}},l=g=>{if(g==null||g.status!==0)return g;w(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(f);if(f){if(await f.confirmations()>=n)return l(f)}else if(await c(),n===0)return null;return await new Promise((g,m)=>{const x=[],v=()=>{x.forEach(O=>O())};if(x.push(()=>{o=!0}),r>0){const O=setTimeout(()=>{v(),m(ce("wait for transaction timeout","TIMEOUT"))},r);x.push(()=>{clearTimeout(O)})}const k=async O=>{if(await O.confirmations()>=n){v();try{g(l(O))}catch(_){m(_)}}};if(x.push(()=>{this.provider.off(this.hash,k)}),this.provider.on(this.hash,k),i>=0){const O=async()=>{try{await c()}catch(_){if(Jt(_,"TRANSACTION_REPLACED")){v(),m(_);return}}o||this.provider.once("block",O)};x.push(()=>{this.provider.off("block",O)}),this.provider.once("block",O)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return w(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Cn(this)}reorderedEvent(t){return w(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),w(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Sn(this,t)}replaceableTransaction(t){p(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const e=new Ve(this,this.provider);return E(e,dt,t),e}};dt=new WeakMap;let le=Ve;function Vr(s){return{orphan:"drop-block",hash:s.hash,number:s.number}}function Sn(s,t){return{orphan:"reorder-transaction",tx:s,other:t}}function Cn(s){return{orphan:"drop-transaction",tx:s}}function Mr(s){return{orphan:"drop-log",log:{transactionHash:s.transactionHash,blockHash:s.blockHash,blockNumber:s.blockNumber,address:s.address,data:s.data,topics:Object.freeze(s.topics.slice()),index:s.index}}}class De extends we{constructor(e,n,r){super(e,e.provider);u(this,"interface");u(this,"fragment");u(this,"args");const i=n.decodeEventLog(r,e.data,e.topics);b(this,{args:i,fragment:r,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Fn extends we{constructor(e,n){super(e,e.provider);u(this,"error");b(this,{error:n})}}var Gt;class Hr extends _r{constructor(e,n,r){super(r,n);P(this,Gt);E(this,Gt,e)}get logs(){return super.logs.map(e=>{const n=e.topics.length?h(this,Gt).getEvent(e.topics[0]):null;if(n)try{return new De(e,h(this,Gt),n)}catch(r){return new Fn(e,r)}return e})}}Gt=new WeakMap;var Qt;class $e extends le{constructor(e,n,r){super(r,n);P(this,Qt);E(this,Qt,e)}async wait(e,n){const r=await super.wait(e,n);return r==null?null:new Hr(h(this,Qt),this.provider,r)}}Qt=new WeakMap;class Ln extends jn{constructor(e,n,r,i){super(e,n,r);u(this,"log");b(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class zr extends Ln{constructor(t,e,n,r,i){super(t,e,n,new De(i,t.interface,r));const a=t.interface.decodeEventLog(r,this.log.data,this.log.topics);b(this,{args:a,fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const cn=BigInt(0);function Dn(s){return s&&typeof s.call=="function"}function $n(s){return s&&typeof s.estimateGas=="function"}function be(s){return s&&typeof s.resolveName=="function"}function Gn(s){return s&&typeof s.sendTransaction=="function"}function _n(s){if(s!=null){if(be(s))return s;if(s.provider)return s.provider}}var qt;class Jr{constructor(t,e,n){P(this,qt);u(this,"fragment");if(b(this,{fragment:e}),e.inputs.length<n.length)throw new Error("too many arguments");const r=kt(t.runner,"resolveName"),i=be(r)?r:null;E(this,qt,async function(){const a=await Promise.all(e.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,d)=>f==="address"?Array.isArray(d)?Promise.all(d.map(g=>Kt(g,i))):Kt(d,i):d)));return t.interface.encodeFilterTopics(e,a)}())}getTopicFilter(){return h(this,qt)}}qt=new WeakMap;function kt(s,t){return s==null?null:typeof s[t]=="function"?s:s.provider&&typeof s.provider[t]=="function"?s.provider:null}function Et(s){return s==null?null:s.provider||null}async function Vn(s,t){const e=C.dereference(s,"overrides");p(typeof e=="object","invalid overrides parameter","overrides",s);const n=Gr(e);return p(n.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),p(n.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Kr(s,t,e){const n=kt(s,"resolveName"),r=be(n)?n:null;return await Promise.all(t.map((i,a)=>i.walkAsync(e[a],(o,c)=>(c=C.dereference(c,o),o==="address"?Kt(c,r):c))))}function Wr(s){const t=async function(a){const o=await Vn(a,["data"]);o.to=await s.getAddress(),o.from&&(o.from=await Kt(o.from,_n(s.runner)));const c=s.interface,l=gt(o.value||cn,"overrides.value")===cn,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!l&&p(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),p(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);const d=c.receive||c.fallback&&c.fallback.payable;return p(d||l,"cannot send value to non-payable fallback","overrides.value",o.value),p(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},e=async function(a){const o=kt(s.runner,"call");w(Dn(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await t(a);try{return await o.call(c)}catch(l){throw dn(l)&&l.data?s.interface.makeError(l.data,c):l}},n=async function(a){const o=s.runner;w(Gn(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await t(a)),l=Et(s.runner);return new $e(s.interface,l,c)},r=async function(a){const o=kt(s.runner,"estimateGas");return w($n(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await t(a))},i=async a=>await n(a);return b(i,{_contract:s,estimateGas:r,populateTransaction:t,send:n,staticCall:e}),i}function Yr(s,t){const e=function(...l){const f=s.interface.getFunction(t,l);return w(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:l}}),f},n=async function(...l){const f=e(...l);let d={};if(f.inputs.length+1===l.length&&(d=await Vn(l.pop()),d.from&&(d.from=await Kt(d.from,_n(s.runner)))),f.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const g=await Kr(s.runner,f.inputs,l);return Object.assign({},d,await Oe({to:s.getAddress(),data:s.interface.encodeFunctionData(f,g)}))},r=async function(...l){const f=await o(...l);return f.length===1?f[0]:f},i=async function(...l){const f=s.runner;w(Gn(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await f.sendTransaction(await n(...l)),g=Et(s.runner);return new $e(s.interface,g,d)},a=async function(...l){const f=kt(s.runner,"estimateGas");return w($n(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...l))},o=async function(...l){const f=kt(s.runner,"call");w(Dn(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await n(...l);let g="0x";try{g=await f.call(d)}catch(x){throw dn(x)&&x.data?s.interface.makeError(x.data,d):x}const m=e(...l);return s.interface.decodeFunctionResult(m,g)},c=async(...l)=>e(...l).constant?await r(...l):await i(...l);return b(c,{name:s.interface.getFunctionName(t),_contract:s,_key:t,getFragment:e,estimateGas:a,populateTransaction:n,send:i,staticCall:r,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=s.interface.getFunction(t);return w(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),l}}),c}function Xr(s,t){const e=function(...r){const i=s.interface.getEvent(t,r);return w(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),i},n=function(...r){return new Jr(s,e(...r),r)};return b(n,{name:s.interface.getEventName(t),_contract:s,_key:t,getFragment:e}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=s.interface.getEvent(t);return w(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}const fe=Symbol.for("_ethersInternal_contract"),Mn=new WeakMap;function Zr(s,t){Mn.set(s[fe],t)}function V(s){return Mn.get(s[fe])}function Qr(s){return s&&typeof s=="object"&&"getTopicFilter"in s&&typeof s.getTopicFilter=="function"&&s.fragment}async function Ge(s,t){let e,n=null;if(Array.isArray(t)){const i=function(a){if(pt(a,32))return a;const o=s.interface.getEvent(a);return p(o,"unknown fragment","name",a),o.topicHash};e=t.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else t==="*"?e=[null]:typeof t=="string"?pt(t,32)?e=[t]:(n=s.interface.getEvent(t),p(n,"unknown fragment","event",t),e=[n.topicHash]):Qr(t)?e=await t.getTopicFilter():"fragment"in t?(n=t.fragment,e=[n.topicHash]):p(!1,"unknown event name","event",t);e=e.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const r=e.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:r,topics:e}}async function Mt(s,t){const{subs:e}=V(s);return e.get((await Ge(s,t)).tag)||null}async function un(s,t,e){const n=Et(s.runner);w(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:r,tag:i,topics:a}=await Ge(s,e),{addr:o,subs:c}=V(s);let l=c.get(i);if(!l){const d={address:o||s,topics:a},g=k=>{let O=r;if(O==null)try{O=s.interface.getEvent(k.topics[0])}catch{}if(O){const _=O,mt=r?s.interface.decodeEventLog(r,k.data,k.topics):[];Ce(s,e,mt,Hn=>new zr(s,Hn,e,_,k))}else Ce(s,e,[],_=>new Ln(s,_,e,k))};let m=[];l={tag:i,listeners:[],start:()=>{m.length||m.push(n.on(d,g))},stop:async()=>{if(m.length==0)return;let k=m;m=[],await Promise.all(k),n.off(d,g)}},c.set(i,l)}return l}let Se=Promise.resolve();async function qr(s,t,e,n){await Se;const r=await Mt(s,t);if(!r)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const c=Array.from(e);n&&c.push(n(o?null:a));try{a.call(s,...c)}catch{}return!o}),r.listeners.length===0&&(r.stop(),V(s).subs.delete(r.tag)),i>0}async function Ce(s,t,e,n){try{await Se}catch{}const r=qr(s,t,e,n);return Se=r,await r}const ne=["then"];var ln;ln=fe;const Ht=class Ht{constructor(t,e,n,r){u(this,"target");u(this,"interface");u(this,"runner");u(this,"filters");u(this,ln);u(this,"fallback");p(typeof t=="string"||Xn(t),"invalid value for Contract target","target",t),n==null&&(n=null);const i=Be.from(e);b(this,{target:t,runner:n,interface:i}),Object.defineProperty(this,fe,{value:{}});let a,o=null,c=null;if(r){const d=Et(n);c=new $e(this.interface,d,r)}let l=new Map;if(typeof t=="string")if(pt(t))o=t,a=Promise.resolve(t);else{const d=kt(n,"resolveName");if(!be(d))throw ce("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(t).then(g=>{if(g==null)throw ce("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return V(this).addr=g,g})}else a=t.getAddress().then(d=>{if(d==null)throw new Error("TODO");return V(this).addr=d,d});Zr(this,{addrPromise:a,addr:o,deployTx:c,subs:l});const f=new Proxy({},{get:(d,g,m)=>{if(typeof g=="symbol"||ne.indexOf(g)>=0)return Reflect.get(d,g,m);try{return this.getEvent(g)}catch(x){if(!Jt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,g)=>ne.indexOf(g)>=0?Reflect.has(d,g):Reflect.has(d,g)||this.interface.hasEvent(String(g))});return b(this,{filters:f}),b(this,{fallback:i.receive||i.fallback?Wr(this):null}),new Proxy(this,{get:(d,g,m)=>{if(typeof g=="symbol"||g in d||ne.indexOf(g)>=0)return Reflect.get(d,g,m);try{return d.getFunction(g)}catch(x){if(!Jt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,g)=>typeof g=="symbol"||g in d||ne.indexOf(g)>=0?Reflect.has(d,g):d.interface.hasFunction(g)})}connect(t){return new Ht(this.target,this.interface,t)}attach(t){return new Ht(t,this.interface,this.runner)}async getAddress(){return await V(this).addrPromise}async getDeployedCode(){const t=Et(this.runner);w(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const e=await t.getCode(await this.getAddress());return e==="0x"?null:e}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Et(this.runner);return w(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((r,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return r(this);n.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return V(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),Yr(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),Xr(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e,n){e==null&&(e=0),n==null&&(n="latest");const{addr:r,addrPromise:i}=V(this),a=r||await i,{fragment:o,topics:c}=await Ge(this,t),l={address:a,topics:c,fromBlock:e,toBlock:n},f=Et(this.runner);return w(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(l)).map(d=>{let g=o;if(g==null)try{g=this.interface.getEvent(d.topics[0])}catch{}if(g)try{return new De(d,this.interface,g)}catch(m){return new Fn(d,m)}return new we(d,f)})}async on(t,e){const n=await un(this,"on",t);return n.listeners.push({listener:e,once:!1}),n.start(),this}async once(t,e){const n=await un(this,"once",t);return n.listeners.push({listener:e,once:!0}),n.start(),this}async emit(t,...e){return await Ce(this,t,e,null)}async listenerCount(t){if(t){const r=await Mt(this,t);return r?r.listeners.length:0}const{subs:e}=V(this);let n=0;for(const{listeners:r}of e.values())n+=r.length;return n}async listeners(t){if(t){const r=await Mt(this,t);return r?r.listeners.map(({listener:i})=>i):[]}const{subs:e}=V(this);let n=[];for(const{listeners:r}of e.values())n=n.concat(r.map(({listener:i})=>i));return n}async off(t,e){const n=await Mt(this,t);if(!n)return this;if(e){const r=n.listeners.map(({listener:i})=>i).indexOf(e);r>=0&&n.listeners.splice(r,1)}return(e==null||n.listeners.length===0)&&(n.stop(),V(this).subs.delete(n.tag)),this}async removeAllListeners(t){if(t){const e=await Mt(this,t);if(!e)return this;e.stop(),V(this).subs.delete(e.tag)}else{const{subs:e}=V(this);for(const{tag:n,stop:r}of e.values())r(),e.delete(n)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){class e extends Ht{constructor(r,i=null){super(r,t,i)}}return e}static from(t,e,n){return n==null&&(n=null),new this(t,e,n)}};let Fe=Ht;function jr(){return Fe}class is extends jr(){}export{ue as A,Fe as B,is as C,jn as E,rs as F,Be as I,we as L,_r as T,gt as a,gn as b,wn as c,Vn as d,Gr as e,Zn as f,ut as g,yn as h,Wt as i,ir as j,Er as k,Qn as l,jt as m,ns as n,ss as o,le as p,Kr as r,pn as t};
1
+ var zn=Object.defineProperty;var Me=s=>{throw TypeError(s)};var Jn=(s,t,e)=>t in s?zn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var u=(s,t,e)=>Jn(s,typeof t!="symbol"?t+"":t,e),Ee=(s,t,e)=>t.has(s)||Me("Cannot "+e);var h=(s,t,e)=>(Ee(s,t,"read from private field"),e?e.call(s):t.get(s)),P=(s,t,e)=>t.has(s)?Me("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,e),E=(s,t,e,n)=>(Ee(s,t,"write to private field"),n?n.call(s,e):t.set(s,e),e),T=(s,t,e)=>(Ee(s,t,"access private method"),e);var He=(s,t,e,n)=>({set _(r){E(s,t,r,e)},get _(){return h(s,t,n)}});import{p,q as w,a5 as S,ak as fn,o as b,t as oe,ag as Kn,ac as St,ah as j,n as Le,af as zt,aN as hn,aL as Jt,ab as Pe,z as pt,ax as ce,aj as It,aO as Wn,aK as Yn,ad as Oe,aP as Xn,aM as dn,ae as Kt}from"../main.js";const pe=BigInt(0),J=BigInt(1),ve=9007199254740991;function Zn(s,t){const e=ge(s,"value"),n=BigInt(ut(t,"width"));if(w(e>>n===pe,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:s}),e>>n-J){const r=(J<<n)-J;return-((~e&r)+J)}return e}function Qn(s,t){let e=gt(s,"value");const n=BigInt(ut(t,"width")),r=J<<n-J;if(e<pe){e=-e,w(e<=r,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});const i=(J<<n)-J;return(~e&i)+J}else w(e<r,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:s});return e}function jt(s,t){const e=ge(s,"value"),n=BigInt(ut(t,"bits"));return e&(J<<n)-J}function gt(s,t){switch(typeof s){case"bigint":return s;case"number":return p(Number.isInteger(s),"underflow",t||"value",s),p(s>=-9007199254740991&&s<=ve,"overflow",t||"value",s),BigInt(s);case"string":try{if(s==="")throw new Error("empty string");return s[0]==="-"&&s[1]!=="-"?-BigInt(s.substring(1)):BigInt(s)}catch(e){p(!1,`invalid BigNumberish string: ${e.message}`,t||"value",s)}}p(!1,"invalid BigNumberish value",t||"value",s)}function ge(s,t){const e=gt(s,t);return w(e>=pe,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:s}),e}const ze="0123456789abcdef";function pn(s){if(s instanceof Uint8Array){let t="0x0";for(const e of s)t+=ze[e>>4],t+=ze[e&15];return BigInt(t)}return gt(s)}function ut(s,t){switch(typeof s){case"bigint":return p(s>=-9007199254740991&&s<=ve,"overflow",t||"value",s),Number(s);case"number":return p(Number.isInteger(s),"underflow",t||"value",s),p(s>=-9007199254740991&&s<=ve,"overflow",t||"value",s),s;case"string":try{if(s==="")throw new Error("empty string");return ut(BigInt(s),t)}catch(e){p(!1,`invalid numeric string: ${e.message}`,t||"value",s)}}p(!1,"invalid numeric value",t||"value",s)}function qn(s){return ut(pn(s))}function gn(s,t){let n=ge(s,"value").toString(16);if(t==null)n.length%2&&(n="0"+n);else{const r=ut(t,"width");for(w(r*2>=n.length,`value exceeds width (${r} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:s});n.length<r*2;)n="0"+n}return"0x"+n}function yn(s){const t=ge(s,"value");if(t===pe)return new Uint8Array([]);let e=t.toString(16);e.length%2&&(e="0"+e);const n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++){const i=r*2;n[r]=parseInt(e.substring(i,i+2),16)}return n}function ns(s){let t=S(fn(s)?s:yn(s)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return t===""&&(t="0"),"0x"+t}var Ft;class jn{constructor(t,e,n){u(this,"filter");u(this,"emitter");P(this,Ft);E(this,Ft,e),b(this,{emitter:t,filter:n})}async removeListener(){h(this,Ft)!=null&&await this.emitter.off(this.filter,h(this,Ft))}}Ft=new WeakMap;function tr(s,t,e,n,r){p(!1,`invalid codepoint at offset ${t}; ${s}`,"bytes",e)}function mn(s,t,e,n,r){if(s==="BAD_PREFIX"||s==="UNEXPECTED_CONTINUE"){let i=0;for(let a=t+1;a<e.length&&e[a]>>6===2;a++)i++;return i}return s==="OVERRUN"?e.length-t-1:0}function er(s,t,e,n,r){return s==="OVERLONG"?(p(typeof r=="number","invalid bad code point for replacement","badCodepoint",r),n.push(r),0):(n.push(65533),mn(s,t,e))}const nr=Object.freeze({error:tr,ignore:mn,replace:er});function rr(s,t){t==null&&(t=nr.error);const e=oe(s,"bytes"),n=[];let r=0;for(;r<e.length;){const i=e[r++];if(!(i>>7)){n.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?r+=t("UNEXPECTED_CONTINUE",r-1,e,n):r+=t("BAD_PREFIX",r-1,e,n);continue}if(r-1+a>=e.length){r+=t("OVERRUN",r-1,e,n);continue}let c=i&(1<<8-a-1)-1;for(let l=0;l<a;l++){let f=e[r];if((f&192)!=128){r+=t("MISSING_CONTINUE",r,e,n),c=null;break}c=c<<6|f&63,r++}if(c!==null){if(c>1114111){r+=t("OUT_OF_RANGE",r-1-a,e,n,c);continue}if(c>=55296&&c<=57343){r+=t("UTF16_SURROGATE",r-1-a,e,n,c);continue}if(c<=o){r+=t("OVERLONG",r-1-a,e,n,c);continue}n.push(c)}}return n}function wn(s,t){p(typeof s=="string","invalid string value","str",s),t!=null&&(Kn(t),s=s.normalize(t));let e=[];for(let n=0;n<s.length;n++){const r=s.charCodeAt(n);if(r<128)e.push(r);else if(r<2048)e.push(r>>6|192),e.push(r&63|128);else if((r&64512)==55296){n++;const i=s.charCodeAt(n);p(n<s.length&&(i&64512)===56320,"invalid surrogate pair","str",s);const a=65536+((r&1023)<<10)+(i&1023);e.push(a>>18|240),e.push(a>>12&63|128),e.push(a>>6&63|128),e.push(a&63|128)}else e.push(r>>12|224),e.push(r>>6&63|128),e.push(r&63|128)}return new Uint8Array(e)}function sr(s){return s.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function ir(s,t){return sr(rr(s,t))}const F=32,Te=new Uint8Array(F),ar=["then"],te={},bn=new WeakMap;function wt(s){return bn.get(s)}function Je(s,t){bn.set(s,t)}function Vt(s,t){const e=new Error(`deferred error during ABI decoding triggered accessing ${s}`);throw e.error=t,e}function Re(s,t,e){return s.indexOf(null)>=0?t.map((n,r)=>n instanceof _t?Re(wt(n),n,e):n):s.reduce((n,r,i)=>{let a=t.getValue(r);return r in n||(e&&a instanceof _t&&(a=Re(wt(a),a,e)),n[r]=a),n},{})}var Lt;const Bt=class Bt extends Array{constructor(...e){const n=e[0];let r=e[1],i=(e[2]||[]).slice(),a=!0;n!==te&&(r=e,i=[],a=!1);super(r.length);P(this,Lt);r.forEach((l,f)=>{this[f]=l});const o=i.reduce((l,f)=>(typeof f=="string"&&l.set(f,(l.get(f)||0)+1),l),new Map);if(Je(this,Object.freeze(r.map((l,f)=>{const d=i[f];return d!=null&&o.get(d)===1?d:null}))),E(this,Lt,[]),h(this,Lt)==null&&h(this,Lt),!a)return;Object.freeze(this);const c=new Proxy(this,{get:(l,f,d)=>{if(typeof f=="string"){if(f.match(/^[0-9]+$/)){const m=ut(f,"%index");if(m<0||m>=this.length)throw new RangeError("out of result range");const x=l[m];return x instanceof Error&&Vt(`index ${m}`,x),x}if(ar.indexOf(f)>=0)return Reflect.get(l,f,d);const g=l[f];if(g instanceof Function)return function(...m){return g.apply(this===d?l:this,m)};if(!(f in l))return l.getValue.apply(this===d?l:this,[f])}return Reflect.get(l,f,d)}});return Je(c,wt(this)),c}toArray(e){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Vt(`index ${i}`,r),e&&r instanceof Bt&&(r=r.toArray(e)),n.push(r)}),n}toObject(e){const n=wt(this);return n.reduce((r,i,a)=>(w(i!=null,`value at index ${a} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Re(n,this,e)),{})}slice(e,n){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),n==null&&(n=this.length),n<0&&(n+=this.length,n<0&&(n=0)),n>this.length&&(n=this.length);const r=wt(this),i=[],a=[];for(let o=e;o<n;o++)i.push(this[o]),a.push(r[o]);return new Bt(te,i,a)}filter(e,n){const r=wt(this),i=[],a=[];for(let o=0;o<this.length;o++){const c=this[o];c instanceof Error&&Vt(`index ${o}`,c),e.call(n,c,o,this)&&(i.push(c),a.push(r[o]))}return new Bt(te,i,a)}map(e,n){const r=[];for(let i=0;i<this.length;i++){const a=this[i];a instanceof Error&&Vt(`index ${i}`,a),r.push(e.call(n,a,i,this))}return r}getValue(e){const n=wt(this).indexOf(e);if(n===-1)return;const r=this[n];return r instanceof Error&&Vt(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,n){return new Bt(te,e,n)}};Lt=new WeakMap;let _t=Bt;function Ke(s){let t=yn(s);return w(t.length<=F,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:F,offset:t.length}),t.length!==F&&(t=j(St([Te.slice(t.length%F),t]))),t}class lt{constructor(t,e,n,r){u(this,"name");u(this,"type");u(this,"localName");u(this,"dynamic");b(this,{name:t,type:e,localName:n,dynamic:r},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(t,e){p(!1,t,this.localName,e)}}var st,xt,Dt,re;class ke{constructor(){P(this,Dt);P(this,st);P(this,xt);E(this,st,[]),E(this,xt,0)}get data(){return St(h(this,st))}get length(){return h(this,xt)}appendWriter(t){return T(this,Dt,re).call(this,j(t.data))}writeBytes(t){let e=j(t);const n=e.length%F;return n&&(e=j(St([e,Te.slice(n)]))),T(this,Dt,re).call(this,e)}writeValue(t){return T(this,Dt,re).call(this,Ke(t))}writeUpdatableValue(){const t=h(this,st).length;return h(this,st).push(Te),E(this,xt,h(this,xt)+F),e=>{h(this,st)[t]=Ke(e)}}}st=new WeakMap,xt=new WeakMap,Dt=new WeakSet,re=function(t){return h(this,st).push(t),E(this,xt,h(this,xt)+t.length),t.length};var D,M,Nt,Pt,ft,At,Ie,En;const _e=class _e{constructor(t,e,n){P(this,At);u(this,"allowLoose");P(this,D);P(this,M);P(this,Nt);P(this,Pt);P(this,ft);b(this,{allowLoose:!!e}),E(this,D,j(t)),E(this,Nt,0),E(this,Pt,null),E(this,ft,n??1024),E(this,M,0)}get data(){return S(h(this,D))}get dataLength(){return h(this,D).length}get consumed(){return h(this,M)}get bytes(){return new Uint8Array(h(this,D))}subReader(t){const e=new _e(h(this,D).slice(h(this,M)+t),this.allowLoose,h(this,ft));return E(e,Pt,this),e}readBytes(t,e){let n=T(this,At,En).call(this,0,t,!!e);return T(this,At,Ie).call(this,t),E(this,M,h(this,M)+n.length),n.slice(0,t)}readValue(){return pn(this.readBytes(F))}readIndex(){return qn(this.readBytes(F))}};D=new WeakMap,M=new WeakMap,Nt=new WeakMap,Pt=new WeakMap,ft=new WeakMap,At=new WeakSet,Ie=function(t){var e;if(h(this,Pt))return T(e=h(this,Pt),At,Ie).call(e,t);E(this,Nt,h(this,Nt)+t),w(h(this,ft)<1||h(this,Nt)<=h(this,ft)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${h(this,ft)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:j(h(this,D)),offset:h(this,M),length:t,info:{bytesRead:h(this,Nt),dataLength:this.dataLength}})},En=function(t,e,n){let r=Math.ceil(e/F)*F;return h(this,M)+r>h(this,D).length&&(this.allowLoose&&n&&h(this,M)+e<=h(this,D).length?r=e:w(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:j(h(this,D)),length:h(this,D).length,offset:h(this,M)+r})),h(this,D).slice(h(this,M),h(this,M)+r)};let Ae=_e;const et={};function y(s,t){let e=!1;return t<0&&(e=!0,t*=-1),new C(et,`${e?"":"u"}int${t}`,s,{signed:e,width:t})}function N(s,t){return new C(et,`bytes${t||""}`,s,{size:t})}const We=Symbol.for("_ethers_typed");var Ot;const nt=class nt{constructor(t,e,n,r){u(this,"type");u(this,"value");P(this,Ot);u(this,"_typedSymbol");r==null&&(r=null),Le(et,t,"Typed"),b(this,{_typedSymbol:We,type:e,value:n}),E(this,Ot,r),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(t=>t.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return h(this,Ot)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return h(this,Ot)===!0?-1:h(this,Ot)===!1?this.value.length:null}static from(t,e){return new nt(et,t,e)}static uint8(t){return y(t,8)}static uint16(t){return y(t,16)}static uint24(t){return y(t,24)}static uint32(t){return y(t,32)}static uint40(t){return y(t,40)}static uint48(t){return y(t,48)}static uint56(t){return y(t,56)}static uint64(t){return y(t,64)}static uint72(t){return y(t,72)}static uint80(t){return y(t,80)}static uint88(t){return y(t,88)}static uint96(t){return y(t,96)}static uint104(t){return y(t,104)}static uint112(t){return y(t,112)}static uint120(t){return y(t,120)}static uint128(t){return y(t,128)}static uint136(t){return y(t,136)}static uint144(t){return y(t,144)}static uint152(t){return y(t,152)}static uint160(t){return y(t,160)}static uint168(t){return y(t,168)}static uint176(t){return y(t,176)}static uint184(t){return y(t,184)}static uint192(t){return y(t,192)}static uint200(t){return y(t,200)}static uint208(t){return y(t,208)}static uint216(t){return y(t,216)}static uint224(t){return y(t,224)}static uint232(t){return y(t,232)}static uint240(t){return y(t,240)}static uint248(t){return y(t,248)}static uint256(t){return y(t,256)}static uint(t){return y(t,256)}static int8(t){return y(t,-8)}static int16(t){return y(t,-16)}static int24(t){return y(t,-24)}static int32(t){return y(t,-32)}static int40(t){return y(t,-40)}static int48(t){return y(t,-48)}static int56(t){return y(t,-56)}static int64(t){return y(t,-64)}static int72(t){return y(t,-72)}static int80(t){return y(t,-80)}static int88(t){return y(t,-88)}static int96(t){return y(t,-96)}static int104(t){return y(t,-104)}static int112(t){return y(t,-112)}static int120(t){return y(t,-120)}static int128(t){return y(t,-128)}static int136(t){return y(t,-136)}static int144(t){return y(t,-144)}static int152(t){return y(t,-152)}static int160(t){return y(t,-160)}static int168(t){return y(t,-168)}static int176(t){return y(t,-176)}static int184(t){return y(t,-184)}static int192(t){return y(t,-192)}static int200(t){return y(t,-200)}static int208(t){return y(t,-208)}static int216(t){return y(t,-216)}static int224(t){return y(t,-224)}static int232(t){return y(t,-232)}static int240(t){return y(t,-240)}static int248(t){return y(t,-248)}static int256(t){return y(t,-256)}static int(t){return y(t,-256)}static bytes1(t){return N(t,1)}static bytes2(t){return N(t,2)}static bytes3(t){return N(t,3)}static bytes4(t){return N(t,4)}static bytes5(t){return N(t,5)}static bytes6(t){return N(t,6)}static bytes7(t){return N(t,7)}static bytes8(t){return N(t,8)}static bytes9(t){return N(t,9)}static bytes10(t){return N(t,10)}static bytes11(t){return N(t,11)}static bytes12(t){return N(t,12)}static bytes13(t){return N(t,13)}static bytes14(t){return N(t,14)}static bytes15(t){return N(t,15)}static bytes16(t){return N(t,16)}static bytes17(t){return N(t,17)}static bytes18(t){return N(t,18)}static bytes19(t){return N(t,19)}static bytes20(t){return N(t,20)}static bytes21(t){return N(t,21)}static bytes22(t){return N(t,22)}static bytes23(t){return N(t,23)}static bytes24(t){return N(t,24)}static bytes25(t){return N(t,25)}static bytes26(t){return N(t,26)}static bytes27(t){return N(t,27)}static bytes28(t){return N(t,28)}static bytes29(t){return N(t,29)}static bytes30(t){return N(t,30)}static bytes31(t){return N(t,31)}static bytes32(t){return N(t,32)}static address(t){return new nt(et,"address",t)}static bool(t){return new nt(et,"bool",!!t)}static bytes(t){return new nt(et,"bytes",t)}static string(t){return new nt(et,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new nt(et,"overrides",Object.assign({},t))}static isTyped(t){return t&&typeof t=="object"&&"_typedSymbol"in t&&t._typedSymbol===We}static dereference(t,e){if(nt.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}};Ot=new WeakMap;let C=nt;class or extends lt{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=C.dereference(e,"string");try{n=zt(n)}catch(r){return this._throwError(r.message,e)}return t.writeValue(n)}decode(t){return zt(gn(t.readValue(),20))}}class cr extends lt{constructor(e){super(e.name,e.type,"_",e.dynamic);u(this,"coder");this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,n){return this.coder.encode(e,n)}decode(e){return this.coder.decode(e)}}function xn(s,t,e){let n=[];if(Array.isArray(e))n=e;else if(e&&typeof e=="object"){let c={};n=t.map(l=>{const f=l.localName;return w(f,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),w(!c[f],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:l},value:e}),c[f]=!0,e[f]})}else p(!1,"invalid tuple value","tuple",e);p(t.length===n.length,"types/value length mismatch","tuple",e);let r=new ke,i=new ke,a=[];t.forEach((c,l)=>{let f=n[l];if(c.dynamic){let d=i.length;c.encode(i,f);let g=r.writeUpdatableValue();a.push(m=>{g(m+d)})}else c.encode(r,f)}),a.forEach(c=>{c(r.length)});let o=s.appendWriter(r);return o+=s.appendWriter(i),o}function Nn(s,t){let e=[],n=[],r=s.subReader(0);return t.forEach(i=>{let a=null;if(i.dynamic){let o=s.readIndex(),c=r.subReader(o);try{a=i.decode(c)}catch(l){if(Jt(l,"BUFFER_OVERRUN"))throw l;a=l,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(s)}catch(o){if(Jt(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");e.push(a),n.push(i.localName||null)}),_t.fromItems(e,n)}class ur extends lt{constructor(e,n,r){const i=e.type+"["+(n>=0?n:"")+"]",a=n===-1||e.dynamic;super("array",i,r,a);u(this,"coder");u(this,"length");b(this,{coder:e,length:n})}defaultValue(){const e=this.coder.defaultValue(),n=[];for(let r=0;r<this.length;r++)n.push(e);return n}encode(e,n){const r=C.dereference(n,"array");Array.isArray(r)||this._throwError("expected array value",r);let i=this.length;i===-1&&(i=r.length,e.writeValue(r.length)),hn(r.length,i,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let o=0;o<r.length;o++)a.push(this.coder);return xn(e,a,r)}decode(e){let n=this.length;n===-1&&(n=e.readIndex(),w(n*F<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:n*F,length:e.dataLength}));let r=[];for(let i=0;i<n;i++)r.push(new cr(this.coder));return Nn(e,r)}}class lr extends lt{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){const n=C.dereference(e,"bool");return t.writeValue(n?1:0)}decode(t){return!!t.readValue()}}class Pn extends lt{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){e=j(e);let n=t.writeValue(e.length);return n+=t.writeBytes(e),n}decode(t){return t.readBytes(t.readIndex(),!0)}}class fr extends Pn{constructor(t){super("bytes",t)}decode(t){return S(super.decode(t))}}class hr extends lt{constructor(e,n){let r="bytes"+String(e);super(r,r,n,!1);u(this,"size");b(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,n){let r=j(C.dereference(n,this.type));return r.length!==this.size&&this._throwError("incorrect data length",n),e.writeBytes(r)}decode(e){return S(e.readBytes(this.size))}}const dr=new Uint8Array([]);class pr extends lt{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return e!=null&&this._throwError("not null",e),t.writeBytes(dr)}decode(t){return t.readBytes(0),null}}const gr=BigInt(0),yr=BigInt(1),mr=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class wr extends lt{constructor(e,n,r){const i=(n?"int":"uint")+e*8;super(i,i,r,!1);u(this,"size");u(this,"signed");b(this,{size:e,signed:n},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,n){let r=gt(C.dereference(n,this.type)),i=jt(mr,F*8);if(this.signed){let a=jt(i,this.size*8-1);(r>a||r<-(a+yr))&&this._throwError("value out-of-bounds",n),r=Qn(r,8*F)}else(r<gr||r>jt(i,this.size*8))&&this._throwError("value out-of-bounds",n);return e.writeValue(r)}decode(e){let n=jt(e.readValue(),this.size*8);return this.signed&&(n=Zn(n,this.size*8)),n}}class br extends Pn{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,wn(C.dereference(e,"string")))}decode(t){return ir(super.decode(t))}}class ee extends lt{constructor(e,n){let r=!1;const i=[];e.forEach(o=>{o.dynamic&&(r=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,n,r);u(this,"coders");b(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(r=>{e.push(r.defaultValue())});const n=this.coders.reduce((r,i)=>{const a=i.localName;return a&&(r[a]||(r[a]=0),r[a]++),r},{});return this.coders.forEach((r,i)=>{let a=r.localName;!a||n[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,n){const r=C.dereference(n,"tuple");return xn(e,this.coders,r)}decode(e){return Nn(e,this.coders)}}function Wt(s){return Pe(wn(s))}function xe(s,t){return{address:zt(s),storageKeys:t.map((e,n)=>(p(pt(e,32),"invalid slot",`storageKeys[${n}]`,e),e.toLowerCase()))}}function Er(s){if(Array.isArray(s))return s.map((e,n)=>Array.isArray(e)?(p(e.length===2,"invalid slot set",`value[${n}]`,e),xe(e[0],e[1])):(p(e!=null&&typeof e=="object","invalid address-slot set","value",s),xe(e.address,e.storageKeys)));p(s!=null&&typeof s=="object","invalid access list","value",s);const t=Object.keys(s).map(e=>{const n=s[e].reduce((r,i)=>(r[i]=!0,r),{});return xe(e,Object.keys(n).sort())});return t.sort((e,n)=>e.address.localeCompare(n.address)),t}function L(s){const t=new Set;return s.forEach(e=>t.add(e)),Object.freeze(t)}const xr="external public payable override",Nr=L(xr.split(" ")),On="constant external internal payable private public pure view override",Pr=L(On.split(" ")),vn="constructor error event fallback function receive struct",Tn=L(vn.split(" ")),Rn="calldata memory storage payable indexed",Or=L(Rn.split(" ")),vr="tuple returns",Tr=[vn,Rn,vr,On].join(" "),Rr=L(Tr.split(" ")),kr={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Ar=new RegExp("^(\\s*)"),Ir=new RegExp("^([0-9]+)"),Ur=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),kn=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),An=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var I,z,Xt,Ue;const he=class he{constructor(t){P(this,Xt);P(this,I);P(this,z);E(this,I,0),E(this,z,t.slice())}get offset(){return h(this,I)}get length(){return h(this,z).length-h(this,I)}clone(){return new he(h(this,z))}reset(){E(this,I,0)}popKeyword(t){const e=this.peek();if(e.type!=="KEYWORD"||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=T(this,Xt,Ue).call(this,h(this,I)+1,t.match+1);return E(this,I,t.match+1),e}popParams(){const t=this.peek();if(t.type!=="OPEN_PAREN")throw new Error("bad start");const e=[];for(;h(this,I)<t.match-1;){const n=this.peek().linkNext;e.push(T(this,Xt,Ue).call(this,h(this,I)+1,n)),E(this,I,n)}return E(this,I,t.match+1),e}peek(){if(h(this,I)>=h(this,z).length)throw new Error("out-of-bounds");return h(this,z)[h(this,I)]}peekKeyword(t){const e=this.peekType("KEYWORD");return e!=null&&t.has(e)?e:null}peekType(t){if(this.length===0)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return He(this,I)._++,t}toString(){const t=[];for(let e=h(this,I);e<h(this,z).length;e++){const n=h(this,z)[e];t.push(`${n.type}:${n.text}`)}return`<TokenString ${t.join(" ")}>`}};I=new WeakMap,z=new WeakMap,Xt=new WeakSet,Ue=function(t=0,e=0){return new he(h(this,z).slice(t,e).map(n=>Object.freeze(Object.assign({},n,{match:n.match-t,linkBack:n.linkBack-t,linkNext:n.linkNext-t}))))};let K=he;function yt(s){const t=[],e=a=>{const o=i<s.length?JSON.stringify(s[i]):"$EOI";throw new Error(`invalid token ${o} at ${i}: ${a}`)};let n=[],r=[],i=0;for(;i<s.length;){let a=s.substring(i),o=a.match(Ar);o&&(i+=o[1].length,a=s.substring(i));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};t.push(c);let l=kr[a[0]]||"";if(l){if(c.type=l,c.text=a[0],i++,l==="OPEN_PAREN")n.push(t.length-1),r.push(t.length-1);else if(l=="CLOSE_PAREN")n.length===0&&e("no matching open bracket"),c.match=n.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=r.pop(),t[c.linkBack].linkNext=t.length-1;else if(l==="COMMA")c.linkBack=r.pop(),t[c.linkBack].linkNext=t.length-1,r.push(t.length-1);else if(l==="OPEN_BRACKET")c.type="BRACKET";else if(l==="CLOSE_BRACKET"){let f=t.pop().text;if(t.length>0&&t[t.length-1].type==="NUMBER"){const d=t.pop().text;f=d+f,t[t.length-1].value=ut(d)}if(t.length===0||t[t.length-1].type!=="BRACKET")throw new Error("missing opening bracket");t[t.length-1].text+=f}continue}if(o=a.match(Ur),o){if(c.text=o[1],i+=c.text.length,Rr.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(An)){c.type="TYPE";continue}c.type="ID";continue}if(o=a.match(Ir),o){c.text=o[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new K(t.map(a=>Object.freeze(a)))}function Ye(s,t){let e=[];for(const n in t.keys())s.has(n)&&e.push(n);if(e.length>1)throw new Error(`conflicting types: ${e.join(", ")}`)}function ye(s,t){if(t.peekKeyword(Tn)){const e=t.pop().text;if(e!==s)throw new Error(`expected ${s}, got ${e}`)}return t.popType("ID")}function ct(s,t){const e=new Set;for(;;){const n=s.peekType("KEYWORD");if(n==null||t&&!t.has(n))break;if(s.pop(),e.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);e.add(n)}return Object.freeze(e)}function In(s){let t=ct(s,Pr);return Ye(t,L("constant payable nonpayable".split(" "))),Ye(t,L("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function ot(s,t){return s.popParams().map(e=>U.from(e,t))}function Un(s){if(s.peekType("AT")){if(s.pop(),s.peekType("NUMBER"))return gt(s.pop().text);throw new Error("invalid gas")}return null}function Tt(s){if(s.length)throw new Error(`unexpected tokens at offset ${s.offset}: ${s.toString()}`)}const Br=new RegExp(/^(.*)\[([0-9]*)\]$/);function Xe(s){const t=s.match(An);if(p(t,"invalid type","type",s),s==="uint")return"uint256";if(s==="int")return"int256";if(t[2]){const e=parseInt(t[2]);p(e!==0&&e<=32,"invalid bytes length","type",s)}else if(t[3]){const e=parseInt(t[3]);p(e!==0&&e<=256&&e%8===0,"invalid numeric width","type",s)}return s}const R={},G=Symbol.for("_ethers_internal"),Ze="_ParamTypeInternal",Qe="_ErrorInternal",qe="_EventInternal",je="_ConstructorInternal",tn="_FallbackInternal",en="_FunctionInternal",nn="_StructInternal";var $t,se;const H=class H{constructor(t,e,n,r,i,a,o,c){P(this,$t);u(this,"name");u(this,"type");u(this,"baseType");u(this,"indexed");u(this,"components");u(this,"arrayLength");u(this,"arrayChildren");if(Le(t,R,"ParamType"),Object.defineProperty(this,G,{value:Ze}),a&&(a=Object.freeze(a.slice())),r==="array"){if(o==null||c==null)throw new Error("")}else if(o!=null||c!=null)throw new Error("");if(r==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");b(this,{name:e,type:n,baseType:r,indexed:i,components:a,arrayLength:o,arrayChildren:c})}format(t){if(t==null&&(t="sighash"),t==="json"){const n=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const r={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(i=>JSON.parse(i.format(t)))),JSON.stringify(r)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map(n=>n.format(t)).join(t==="full"?", ":",")+")":e+=this.type,t!=="sighash"&&(this.indexed===!0&&(e+=" indexed"),t==="full"&&this.name&&(e+=" "+this.name)),e}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(t,e){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const n=this;return t.map(r=>n.arrayChildren.walk(r,e))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map((r,i)=>n.components[i].walk(r,e))}return e(this.type,t)}async walkAsync(t,e){const n=[],r=[t];return T(this,$t,se).call(this,n,t,e,i=>{r[0]=i}),n.length&&await Promise.all(n),r[0]}static from(t,e){if(H.isParamType(t))return t;if(typeof t=="string")try{return H.from(yt(t),e)}catch{p(!1,"invalid param type","obj",t)}else if(t instanceof K){let o="",c="",l=null;ct(t,L(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(c="tuple",l=t.popParams().map(v=>H.from(v)),o=`tuple(${l.map(v=>v.format()).join(",")})`):(o=Xe(t.popType("TYPE")),c=o);let f=null,d=null;for(;t.length&&t.peekType("BRACKET");){const v=t.pop();f=new H(R,"",o,c,null,l,d,f),d=v.value,o+=v.text,c="array",l=null}let g=null;if(ct(t,Or).has("indexed")){if(!e)throw new Error("");g=!0}const x=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new H(R,x,o,c,g,l,d,f)}const n=t.name;p(!n||typeof n=="string"&&n.match(kn),"invalid name","obj.name",n);let r=t.indexed;r!=null&&(p(e,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,a=i.match(Br);if(a){const o=parseInt(a[2]||"-1"),c=H.from({type:a[1],components:t.components});return new H(R,n||"",i,"array",r,null,o,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const o=t.components!=null?t.components.map(l=>H.from(l)):null;return new H(R,n||"",i,"tuple",r,o,null,null)}return i=Xe(t.type),new H(R,n||"",i,i,r,null,null,null)}static isParamType(t){return t&&t[G]===Ze}};$t=new WeakSet,se=function(t,e,n,r){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=e.slice();o.forEach((c,l)=>{var f;T(f=a,$t,se).call(f,t,c,n,d=>{o[l]=d})}),r(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(e))o=e.slice();else{if(e==null||typeof e!="object")throw new Error("invalid tuple value");o=a.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in e))throw new Error(`missing value for component ${c.name}`);return e[c.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((c,l)=>{var f;T(f=a[l],$t,se).call(f,t,c,n,d=>{o[l]=d})}),r(o);return}const i=n(this.type,e);i.then?t.push(async function(){r(await i)}()):r(i)};let U=H;class Rt{constructor(t,e,n){u(this,"type");u(this,"inputs");Le(t,R,"Fragment"),n=Object.freeze(n.slice()),b(this,{type:e,inputs:n})}static from(t){if(typeof t=="string"){try{Rt.from(JSON.parse(t))}catch{}return Rt.from(yt(t))}if(t instanceof K)switch(t.peekKeyword(Tn)){case"constructor":return at.from(t);case"error":return $.from(t);case"event":return Q.from(t);case"fallback":case"receive":return rt.from(t);case"function":return q.from(t);case"struct":return vt.from(t)}else if(typeof t=="object"){switch(t.type){case"constructor":return at.from(t);case"error":return $.from(t);case"event":return Q.from(t);case"fallback":case"receive":return rt.from(t);case"function":return q.from(t);case"struct":return vt.from(t)}w(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}p(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return at.isFragment(t)}static isError(t){return $.isFragment(t)}static isEvent(t){return Q.isFragment(t)}static isFunction(t){return q.isFragment(t)}static isStruct(t){return vt.isFragment(t)}}class me extends Rt{constructor(e,n,r,i){super(e,n,i);u(this,"name");p(typeof r=="string"&&r.match(kn),"invalid identifier","name",r),i=Object.freeze(i.slice()),b(this,{name:r})}}function Yt(s,t){return"("+t.map(e=>e.format(s)).join(s==="full"?", ":",")+")"}class $ extends me{constructor(t,e,n){super(t,"error",e,n),Object.defineProperty(this,G,{value:Qe})}get selector(){return Wt(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});const e=[];return t!=="sighash"&&e.push("error"),e.push(this.name+Yt(t,this.inputs)),e.join(" ")}static from(t){if($.isFragment(t))return t;if(typeof t=="string")return $.from(yt(t));if(t instanceof K){const e=ye("error",t),n=ot(t);return Tt(t),new $(R,e,n)}return new $(R,t.name,t.inputs?t.inputs.map(U.from):[])}static isFragment(t){return t&&t[G]===Qe}}class Q extends me{constructor(e,n,r,i){super(e,"event",n,r);u(this,"anonymous");Object.defineProperty(this,G,{value:qe}),b(this,{anonymous:i})}get topicHash(){return Wt(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("event"),n.push(this.name+Yt(e,this.inputs)),e!=="sighash"&&this.anonymous&&n.push("anonymous"),n.join(" ")}static getTopicHash(e,n){return n=(n||[]).map(i=>U.from(i)),new Q(R,e,n,!1).topicHash}static from(e){if(Q.isFragment(e))return e;if(typeof e=="string")try{return Q.from(yt(e))}catch{p(!1,"invalid event fragment","obj",e)}else if(e instanceof K){const n=ye("event",e),r=ot(e,!0),i=!!ct(e,L(["anonymous"])).has("anonymous");return Tt(e),new Q(R,n,r,i)}return new Q(R,e.name,e.inputs?e.inputs.map(n=>U.from(n,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[G]===qe}}class at extends Rt{constructor(e,n,r,i,a){super(e,n,r);u(this,"payable");u(this,"gas");Object.defineProperty(this,G,{value:je}),b(this,{payable:i,gas:a})}format(e){if(w(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[`constructor${Yt(e,this.inputs)}`];return this.payable&&n.push("payable"),this.gas!=null&&n.push(`@${this.gas.toString()}`),n.join(" ")}static from(e){if(at.isFragment(e))return e;if(typeof e=="string")try{return at.from(yt(e))}catch{p(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof K){ct(e,L(["constructor"]));const n=ot(e),r=!!ct(e,Nr).has("payable"),i=Un(e);return Tt(e),new at(R,"constructor",n,r,i)}return new at(R,"constructor",e.inputs?e.inputs.map(U.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[G]===je}}class rt extends Rt{constructor(e,n,r){super(e,"fallback",n);u(this,"payable");Object.defineProperty(this,G,{value:tn}),b(this,{payable:r})}format(e){const n=this.inputs.length===0?"receive":"fallback";if(e==="json"){const r=this.payable?"payable":"nonpayable";return JSON.stringify({type:n,stateMutability:r})}return`${n}()${this.payable?" payable":""}`}static from(e){if(rt.isFragment(e))return e;if(typeof e=="string")try{return rt.from(yt(e))}catch{p(!1,"invalid fallback fragment","obj",e)}else if(e instanceof K){const n=e.toString(),r=e.peekKeyword(L(["fallback","receive"]));if(p(r,"type must be fallback or receive","obj",n),e.popKeyword(L(["fallback","receive"]))==="receive"){const c=ot(e);return p(c.length===0,"receive cannot have arguments","obj.inputs",c),ct(e,L(["payable"])),Tt(e),new rt(R,[],!0)}let a=ot(e);a.length?p(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(c=>c.format("minimal")).join(", ")):a=[U.from("bytes")];const o=In(e);if(p(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),ct(e,L(["returns"])).has("returns")){const c=ot(e);p(c.length===1&&c[0].type==="bytes","invalid fallback outputs","obj.outputs",c.map(l=>l.format("minimal")).join(", "))}return Tt(e),new rt(R,a,o==="payable")}if(e.type==="receive")return new rt(R,[],!0);if(e.type==="fallback"){const n=[U.from("bytes")],r=e.stateMutability==="payable";return new rt(R,n,r)}p(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[G]===tn}}class q extends me{constructor(e,n,r,i,a,o){super(e,"function",n,i);u(this,"constant");u(this,"outputs");u(this,"stateMutability");u(this,"payable");u(this,"gas");Object.defineProperty(this,G,{value:en}),a=Object.freeze(a.slice()),b(this,{constant:r==="view"||r==="pure",gas:o,outputs:a,payable:r==="payable",stateMutability:r})}get selector(){return Wt(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(r=>JSON.parse(r.format(e))),outputs:this.outputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("function"),n.push(this.name+Yt(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&n.push(this.stateMutability),this.outputs&&this.outputs.length&&(n.push("returns"),n.push(Yt(e,this.outputs))),this.gas!=null&&n.push(`@${this.gas.toString()}`)),n.join(" ")}static getSelector(e,n){return n=(n||[]).map(i=>U.from(i)),new q(R,e,"view",n,[],null).selector}static from(e){if(q.isFragment(e))return e;if(typeof e=="string")try{return q.from(yt(e))}catch{p(!1,"invalid function fragment","obj",e)}else if(e instanceof K){const r=ye("function",e),i=ot(e),a=In(e);let o=[];ct(e,L(["returns"])).has("returns")&&(o=ot(e));const c=Un(e);return Tt(e),new q(R,r,a,i,o,c)}let n=e.stateMutability;return n==null&&(n="payable",typeof e.constant=="boolean"?(n="view",e.constant||(n="payable",typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(n="nonpayable")),new q(R,e.name,n,e.inputs?e.inputs.map(U.from):[],e.outputs?e.outputs.map(U.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[G]===en}}class vt extends me{constructor(t,e,n){super(t,"struct",e,n),Object.defineProperty(this,G,{value:nn})}format(){throw new Error("@TODO")}static from(t){if(typeof t=="string")try{return vt.from(yt(t))}catch{p(!1,"invalid struct fragment","obj",t)}else if(t instanceof K){const e=ye("struct",t),n=ot(t);return Tt(t),new vt(R,e,n)}return new vt(R,t.name,t.inputs?t.inputs.map(U.from):[])}static isFragment(t){return t&&t[G]===nn}}const W=new Map;W.set(0,"GENERIC_PANIC");W.set(1,"ASSERT_FALSE");W.set(17,"OVERFLOW");W.set(18,"DIVIDE_BY_ZERO");W.set(33,"ENUM_RANGE_ERROR");W.set(34,"BAD_STORAGE_DATA");W.set(49,"STACK_UNDERFLOW");W.set(50,"ARRAY_RANGE_ERROR");W.set(65,"OUT_OF_MEMORY");W.set(81,"UNINITIALIZED_FUNCTION_CALL");const Sr=new RegExp(/^bytes([0-9]*)$/),Cr=new RegExp(/^(u?int)([0-9]*)$/);let Ne=null,rn=1024;function Fr(s,t,e,n){let r="missing revert data",i=null;const a=null;let o=null;if(e){r="execution reverted";const l=oe(e);if(e=S(e),l.length===0)r+=" (no data present; likely require(false) occurred",i="require(false)";else if(l.length%32!==4)r+=" (could not decode reason; invalid data length)";else if(S(l.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],l.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},r+=`: ${JSON.stringify(i)}`}catch{r+=" (could not decode reason; invalid string data)"}else if(S(l.slice(0,4))==="0x4e487b71")try{const f=Number(n.decode(["uint256"],l.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[f]},i=`Panic due to ${W.get(f)||"UNKNOWN"}(${f})`,r+=`: ${i}`}catch{r+=" (could not decode panic code)"}else r+=" (unknown custom error)"}const c={to:t.to?zt(t.to):null,data:t.data||"0x"};return t.from&&(c.from=zt(t.from)),ce(r,"CALL_EXCEPTION",{action:s,data:e,reason:i,transaction:c,invocation:a,revert:o})}var ht,Ut;const de=class de{constructor(){P(this,ht)}getDefaultValue(t){const e=t.map(r=>T(this,ht,Ut).call(this,U.from(r)));return new ee(e,"_").defaultValue()}encode(t,e){hn(e.length,t.length,"types/values length mismatch");const n=t.map(a=>T(this,ht,Ut).call(this,U.from(a))),r=new ee(n,"_"),i=new ke;return r.encode(i,e),i.data}decode(t,e,n){const r=t.map(a=>T(this,ht,Ut).call(this,U.from(a)));return new ee(r,"_").decode(new Ae(e,n,rn))}static _setDefaultMaxInflation(t){p(typeof t=="number"&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),rn=t}static defaultAbiCoder(){return Ne==null&&(Ne=new de),Ne}static getBuiltinCallException(t,e,n){return Fr(t,e,n,de.defaultAbiCoder())}};ht=new WeakSet,Ut=function(t){if(t.isArray())return new ur(T(this,ht,Ut).call(this,t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new ee(t.components.map(n=>T(this,ht,Ut).call(this,n)),t.name);switch(t.baseType){case"address":return new or(t.name);case"bool":return new lr(t.name);case"string":return new br(t.name);case"bytes":return new fr(t.name);case"":return new pr(t.name)}let e=t.type.match(Cr);if(e){let n=parseInt(e[2]||"256");return p(n!==0&&n<=256&&n%8===0,"invalid "+e[1]+" bit length","param",t),new wr(n/8,e[1]==="int",t.name)}if(e=t.type.match(Sr),e){let n=parseInt(e[1]);return p(n!==0&&n<=32,"invalid bytes length","param",t),new hr(n,t.name)}p(!1,"invalid type","type",t.type)};let ue=de;class Lr{constructor(t,e,n){u(this,"fragment");u(this,"name");u(this,"signature");u(this,"topic");u(this,"args");const r=t.name,i=t.format();b(this,{fragment:t,name:r,signature:i,topic:e,args:n})}}class Dr{constructor(t,e,n,r){u(this,"fragment");u(this,"name");u(this,"args");u(this,"signature");u(this,"selector");u(this,"value");const i=t.name,a=t.format();b(this,{fragment:t,name:i,args:n,signature:a,selector:e,value:r})}}class $r{constructor(t,e,n){u(this,"fragment");u(this,"name");u(this,"args");u(this,"signature");u(this,"selector");const r=t.name,i=t.format();b(this,{fragment:t,name:r,args:n,signature:i,selector:e})}}class sn{constructor(t){u(this,"hash");u(this,"_isIndexed");b(this,{hash:t,_isIndexed:!0})}static isIndexed(t){return!!(t&&t._isIndexed)}}const an={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},on={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:s=>`reverted with reason string ${JSON.stringify(s)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:s=>{let t="unknown panic code";return s>=0&&s<=255&&an[s.toString()]&&(t=an[s.toString()]),`reverted with panic code 0x${s.toString(16)} (${t})`}}};var Y,X,Z,B,tt,ie,ae;const bt=class bt{constructor(t){P(this,tt);u(this,"fragments");u(this,"deploy");u(this,"fallback");u(this,"receive");P(this,Y);P(this,X);P(this,Z);P(this,B);let e=[];typeof t=="string"?e=JSON.parse(t):e=t,E(this,Z,new Map),E(this,Y,new Map),E(this,X,new Map);const n=[];for(const a of e)try{n.push(Rt.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}b(this,{fragments:Object.freeze(n)});let r=null,i=!1;E(this,B,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let c;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}b(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(p(!r||a.payable!==r.payable,"conflicting fallback fragments",`fragments[${o}]`,a),r=a,i=r.payable);return;case"function":c=h(this,Z);break;case"event":c=h(this,X);break;case"error":c=h(this,Y);break;default:return}const l=a.format();c.has(l)||c.set(l,a)}),this.deploy||b(this,{deploy:at.from("constructor()")}),b(this,{fallback:r,receive:i})}format(t){const e=t?"minimal":"full";return this.fragments.map(r=>r.format(e))}formatJson(){const t=this.fragments.map(e=>e.format("json"));return JSON.stringify(t.map(e=>JSON.parse(e)))}getAbiCoder(){return ue.defaultAbiCoder()}getFunctionName(t){const e=T(this,tt,ie).call(this,t,null,!1);return p(e,"no matching function","key",t),e.name}hasFunction(t){return!!T(this,tt,ie).call(this,t,null,!1)}getFunction(t,e){return T(this,tt,ie).call(this,t,e||null,!0)}forEachFunction(t){const e=Array.from(h(this,Z).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(h(this,Z).get(r),n)}}getEventName(t){const e=T(this,tt,ae).call(this,t,null,!1);return p(e,"no matching event","key",t),e.name}hasEvent(t){return!!T(this,tt,ae).call(this,t,null,!1)}getEvent(t,e){return T(this,tt,ae).call(this,t,e||null,!0)}forEachEvent(t){const e=Array.from(h(this,X).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(h(this,X).get(r),n)}}getError(t,e){if(pt(t)){const r=t.toLowerCase();if(on[r])return $.from(on[r].signature);for(const i of h(this,Y).values())if(r===i.selector)return i;return null}if(t.indexOf("(")===-1){const r=[];for(const[i,a]of h(this,Y))i.split("(")[0]===t&&r.push(a);if(r.length===0)return t==="Error"?$.from("error Error(string)"):t==="Panic"?$.from("error Panic(uint256)"):null;if(r.length>1){const i=r.map(a=>JSON.stringify(a.format())).join(", ");p(!1,`ambiguous error description (i.e. ${i})`,"name",t)}return r[0]}if(t=$.from(t).format(),t==="Error(string)")return $.from("error Error(string)");if(t==="Panic(uint256)")return $.from("error Panic(uint256)");const n=h(this,Y).get(t);return n||null}forEachError(t){const e=Array.from(h(this,Y).keys());e.sort((n,r)=>n.localeCompare(r));for(let n=0;n<e.length;n++){const r=e[n];t(h(this,Y).get(r),n)}}_decodeParams(t,e){return h(this,B).decode(t,e)}_encodeParams(t,e){return h(this,B).encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){if(typeof t=="string"){const n=this.getError(t);p(n,"unknown error","fragment",t),t=n}return p(It(e,0,4)===t.selector,`data signature does not match error ${t.name}.`,"data",e),this._decodeParams(t.inputs,It(e,4))}encodeErrorResult(t,e){if(typeof t=="string"){const n=this.getError(t);p(n,"unknown error","fragment",t),t=n}return St([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionData(t,e){if(typeof t=="string"){const n=this.getFunction(t);p(n,"unknown function","fragment",t),t=n}return p(It(e,0,4)===t.selector,`data signature does not match function ${t.name}.`,"data",e),this._decodeParams(t.inputs,It(e,4))}encodeFunctionData(t,e){if(typeof t=="string"){const n=this.getFunction(t);p(n,"unknown function","fragment",t),t=n}return St([t.selector,this._encodeParams(t.inputs,e||[])])}decodeFunctionResult(t,e){if(typeof t=="string"){const i=this.getFunction(t);p(i,"unknown function","fragment",t),t=i}let n="invalid length for result data";const r=j(e);if(r.length%32===0)try{return h(this,B).decode(t.outputs,r)}catch{n="could not decode result data"}w(!1,n,"BAD_DATA",{value:S(r),info:{method:t.name,signature:t.format()}})}makeError(t,e){const n=oe(t,"data"),r=ue.getBuiltinCallException("call",e,n);if(r.message.startsWith("execution reverted (unknown custom error)")){const o=S(n.slice(0,4)),c=this.getError(o);if(c)try{const l=h(this,B).decode(c.inputs,n.slice(4));r.revert={name:c.name,signature:c.format(),args:l},r.reason=r.revert.signature,r.message=`execution reverted: ${r.reason}`}catch{r.message="execution reverted (coult not decode custom error)"}}const a=this.parseTransaction(e);return a&&(r.invocation={method:a.name,signature:a.signature,args:a.args}),r}encodeFunctionResult(t,e){if(typeof t=="string"){const n=this.getFunction(t);p(n,"unknown function","fragment",t),t=n}return S(h(this,B).encode(t.outputs,e||[]))}encodeFilterTopics(t,e){if(typeof t=="string"){const i=this.getEvent(t);p(i,"unknown event","eventFragment",t),t=i}w(e.length<=t.inputs.length,`too many arguments for ${t.format()}`,"UNEXPECTED_ARGUMENT",{count:e.length,expectedCount:t.inputs.length});const n=[];t.anonymous||n.push(t.topicHash);const r=(i,a)=>i.type==="string"?Wt(a):i.type==="bytes"?Pe(S(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=gn(a):i.type.match(/^bytes/)?a=Wn(a,32):i.type==="address"&&h(this,B).encode(["address"],[a]),Yn(S(a),32));for(e.forEach((i,a)=>{const o=t.inputs[a];if(!o.indexed){p(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?p(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?n.push(i.map(c=>r(o,c))):n.push(r(o,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(t,e){if(typeof t=="string"){const a=this.getEvent(t);p(a,"unknown event","eventFragment",t),t=a}const n=[],r=[],i=[];return t.anonymous||n.push(t.topicHash),p(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach((a,o)=>{const c=e[o];if(a.indexed)if(a.type==="string")n.push(Wt(c));else if(a.type==="bytes")n.push(Pe(c));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");n.push(h(this,B).encode([a.type],[c]))}else r.push(a),i.push(c)}),{data:h(this,B).encode(r,i),topics:n}}decodeEventLog(t,e,n){if(typeof t=="string"){const m=this.getEvent(t);p(m,"unknown event","eventFragment",t),t=m}if(n!=null&&!t.anonymous){const m=t.topicHash;p(pt(n[0],32)&&n[0].toLowerCase()===m,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],i=[],a=[];t.inputs.forEach((m,x)=>{m.indexed?m.type==="string"||m.type==="bytes"||m.baseType==="tuple"||m.baseType==="array"?(r.push(U.from({type:"bytes32",name:m.name})),a.push(!0)):(r.push(m),a.push(!1)):(i.push(m),a.push(!1))});const o=n!=null?h(this,B).decode(r,St(n)):null,c=h(this,B).decode(i,e,!0),l=[],f=[];let d=0,g=0;return t.inputs.forEach((m,x)=>{let v=null;if(m.indexed)if(o==null)v=new sn(null);else if(a[x])v=new sn(o[g++]);else try{v=o[g++]}catch(k){v=k}else try{v=c[d++]}catch(k){v=k}l.push(v),f.push(m.name||null)}),_t.fromItems(l,f)}parseTransaction(t){const e=oe(t.data,"tx.data"),n=gt(t.value!=null?t.value:0,"tx.value"),r=this.getFunction(S(e.slice(0,4)));if(!r)return null;const i=h(this,B).decode(r.inputs,e.slice(4));return new Dr(r,r.selector,i,n)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new Lr(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=S(t),n=this.getError(It(e,0,4));if(!n)return null;const r=h(this,B).decode(n.inputs,It(e,4));return new $r(n,n.selector,r)}static from(t){return t instanceof bt?t:typeof t=="string"?new bt(JSON.parse(t)):typeof t.formatJson=="function"?new bt(t.formatJson()):typeof t.format=="function"?new bt(t.format("json")):new bt(t)}};Y=new WeakMap,X=new WeakMap,Z=new WeakMap,B=new WeakMap,tt=new WeakSet,ie=function(t,e,n){if(pt(t)){const i=t.toLowerCase();for(const a of h(this,Z).values())if(i===a.selector)return a;return null}if(t.indexOf("(")===-1){const i=[];for(const[a,o]of h(this,Z))a.split("(")[0]===t&&i.push(o);if(e){const a=e.length>0?e[e.length-1]:null;let o=e.length,c=!0;C.isTyped(a)&&a.type==="overrides"&&(c=!1,o--);for(let l=i.length-1;l>=0;l--){const f=i[l].inputs.length;f!==o&&(!c||f!==o-1)&&i.splice(l,1)}for(let l=i.length-1;l>=0;l--){const f=i[l].inputs;for(let d=0;d<e.length;d++)if(C.isTyped(e[d])){if(d>=f.length){if(e[d].type==="overrides")continue;i.splice(l,1);break}if(e[d].type!==f[d].baseType){i.splice(l,1);break}}}}if(i.length===1&&e&&e.length!==i[0].inputs.length){const a=e[e.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");p(!1,`ambiguous function description (i.e. matches ${a})`,"key",t)}return i[0]}const r=h(this,Z).get(q.from(t).format());return r||null},ae=function(t,e,n){if(pt(t)){const i=t.toLowerCase();for(const a of h(this,X).values())if(i===a.topicHash)return a;return null}if(t.indexOf("(")===-1){const i=[];for(const[a,o]of h(this,X))a.split("(")[0]===t&&i.push(o);if(e){for(let a=i.length-1;a>=0;a--)i[a].inputs.length<e.length&&i.splice(a,1);for(let a=i.length-1;a>=0;a--){const o=i[a].inputs;for(let c=0;c<e.length;c++)if(C.isTyped(e[c])&&e[c].type!==o[c].baseType){i.splice(a,1);break}}}if(i.length===0)return null;if(i.length>1&&n){const a=i.map(o=>JSON.stringify(o.format())).join(", ");p(!1,`ambiguous event description (i.e. matches ${a})`,"key",t)}return i[0]}const r=h(this,X).get(Q.from(t).format());return r||null};let Be=bt;const Bn=BigInt(0);function Ct(s){return s??null}function A(s){return s==null?null:s.toString()}class rs{constructor(t,e,n){u(this,"gasPrice");u(this,"maxFeePerGas");u(this,"maxPriorityFeePerGas");b(this,{gasPrice:Ct(t),maxFeePerGas:Ct(e),maxPriorityFeePerGas:Ct(n)})}toJSON(){const{gasPrice:t,maxFeePerGas:e,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:A(t),maxFeePerGas:A(e),maxPriorityFeePerGas:A(n)}}}function Gr(s){const t={};s.to&&(t.to=s.to),s.from&&(t.from=s.from),s.data&&(t.data=S(s.data));const e="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const r of e)!(r in s)||s[r]==null||(t[r]=gt(s[r],`request.${r}`));const n="type,nonce".split(/,/);for(const r of n)!(r in s)||s[r]==null||(t[r]=ut(s[r],`request.${r}`));return s.accessList&&(t.accessList=Er(s.accessList)),"blockTag"in s&&(t.blockTag=s.blockTag),"enableCcipRead"in s&&(t.enableCcipRead=!!s.enableCcipRead),"customData"in s&&(t.customData=s.customData),"blobVersionedHashes"in s&&s.blobVersionedHashes&&(t.blobVersionedHashes=s.blobVersionedHashes.slice()),"kzg"in s&&(t.kzg=s.kzg),"blobs"in s&&s.blobs&&(t.blobs=s.blobs.map(r=>fn(r)?S(r):Object.assign({},r))),t}var it;class ss{constructor(t,e){u(this,"provider");u(this,"number");u(this,"hash");u(this,"timestamp");u(this,"parentHash");u(this,"parentBeaconBlockRoot");u(this,"nonce");u(this,"difficulty");u(this,"gasLimit");u(this,"gasUsed");u(this,"stateRoot");u(this,"receiptsRoot");u(this,"blobGasUsed");u(this,"excessBlobGas");u(this,"miner");u(this,"prevRandao");u(this,"extraData");u(this,"baseFeePerGas");P(this,it);E(this,it,t.transactions.map(n=>typeof n!="string"?new le(n,e):n)),b(this,{provider:e,hash:Ct(t.hash),number:t.number,timestamp:t.timestamp,parentHash:t.parentHash,parentBeaconBlockRoot:t.parentBeaconBlockRoot,nonce:t.nonce,difficulty:t.difficulty,gasLimit:t.gasLimit,gasUsed:t.gasUsed,blobGasUsed:t.blobGasUsed,excessBlobGas:t.excessBlobGas,miner:t.miner,prevRandao:Ct(t.prevRandao),extraData:t.extraData,baseFeePerGas:Ct(t.baseFeePerGas),stateRoot:t.stateRoot,receiptsRoot:t.receiptsRoot})}get transactions(){return h(this,it).map(t=>typeof t=="string"?t:t.hash)}get prefetchedTransactions(){const t=h(this,it).slice();return t.length===0?[]:(w(typeof t[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),t)}toJSON(){const{baseFeePerGas:t,difficulty:e,extraData:n,gasLimit:r,gasUsed:i,hash:a,miner:o,prevRandao:c,nonce:l,number:f,parentHash:d,parentBeaconBlockRoot:g,stateRoot:m,receiptsRoot:x,timestamp:v,transactions:k}=this;return{_type:"Block",baseFeePerGas:A(t),difficulty:A(e),extraData:n,gasLimit:A(r),gasUsed:A(i),blobGasUsed:A(this.blobGasUsed),excessBlobGas:A(this.excessBlobGas),hash:a,miner:o,prevRandao:c,nonce:l,number:f,parentHash:d,timestamp:v,parentBeaconBlockRoot:g,stateRoot:m,receiptsRoot:x,transactions:k}}[Symbol.iterator](){let t=0;const e=this.transactions;return{next:()=>t<this.length?{value:e[t++],done:!1}:{value:void 0,done:!0}}}get length(){return h(this,it).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(t){let e;if(typeof t=="number")e=h(this,it)[t];else{const n=t.toLowerCase();for(const r of h(this,it))if(typeof r=="string"){if(r!==n)continue;e=r;break}else{if(r.hash!==n)continue;e=r;break}}if(e==null)throw new Error("no such tx");return typeof e=="string"?await this.provider.getTransaction(e):e}getPrefetchedTransaction(t){const e=this.prefetchedTransactions;if(typeof t=="number")return e[t];t=t.toLowerCase();for(const n of e)if(n.hash===t)return n;p(!1,"no matching transaction","indexOrHash",t)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Vr(this)}}it=new WeakMap;class we{constructor(t,e){u(this,"provider");u(this,"transactionHash");u(this,"blockHash");u(this,"blockNumber");u(this,"removed");u(this,"address");u(this,"data");u(this,"topics");u(this,"index");u(this,"transactionIndex");this.provider=e;const n=Object.freeze(t.topics.slice());b(this,{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,removed:t.removed,address:t.address,data:t.data,topics:n,index:t.index,transactionIndex:t.transactionIndex})}toJSON(){const{address:t,blockHash:e,blockNumber:n,data:r,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:l}=this;return{_type:"log",address:t,blockHash:e,blockNumber:n,data:r,index:i,removed:a,topics:o,transactionHash:c,transactionIndex:l}}async getBlock(){const t=await this.provider.getBlock(this.blockHash);return w(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransaction(){const t=await this.provider.getTransaction(this.transactionHash);return w(!!t,"failed to find transaction","UNKNOWN_ERROR",{}),t}async getTransactionReceipt(){const t=await this.provider.getTransactionReceipt(this.transactionHash);return w(!!t,"failed to find transaction receipt","UNKNOWN_ERROR",{}),t}removedEvent(){return Mr(this)}}var Zt;class _r{constructor(t,e){u(this,"provider");u(this,"to");u(this,"from");u(this,"contractAddress");u(this,"hash");u(this,"index");u(this,"blockHash");u(this,"blockNumber");u(this,"logsBloom");u(this,"gasUsed");u(this,"blobGasUsed");u(this,"cumulativeGasUsed");u(this,"gasPrice");u(this,"blobGasPrice");u(this,"type");u(this,"status");u(this,"root");P(this,Zt);E(this,Zt,Object.freeze(t.logs.map(r=>new we(r,e))));let n=Bn;t.effectiveGasPrice!=null?n=t.effectiveGasPrice:t.gasPrice!=null&&(n=t.gasPrice),b(this,{provider:e,to:t.to,from:t.from,contractAddress:t.contractAddress,hash:t.hash,index:t.index,blockHash:t.blockHash,blockNumber:t.blockNumber,logsBloom:t.logsBloom,gasUsed:t.gasUsed,cumulativeGasUsed:t.cumulativeGasUsed,blobGasUsed:t.blobGasUsed,gasPrice:n,blobGasPrice:t.blobGasPrice,type:t.type,status:t.status,root:t.root})}get logs(){return h(this,Zt)}toJSON(){const{to:t,from:e,contractAddress:n,hash:r,index:i,blockHash:a,blockNumber:o,logsBloom:c,logs:l,status:f,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:n,cumulativeGasUsed:A(this.cumulativeGasUsed),from:e,gasPrice:A(this.gasPrice),blobGasUsed:A(this.blobGasUsed),blobGasPrice:A(this.blobGasPrice),gasUsed:A(this.gasUsed),hash:r,index:i,logs:l,logsBloom:c,root:d,status:f,to:t}}get length(){return this.logs.length}[Symbol.iterator](){let t=0;return{next:()=>t<this.length?{value:this.logs[t++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const t=await this.provider.getBlock(this.blockHash);if(t==null)throw new Error("TODO");return t}async getTransaction(){const t=await this.provider.getTransaction(this.hash);if(t==null)throw new Error("TODO");return t}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return Cn(this)}reorderedEvent(t){return w(!t||t.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),Sn(this,t)}}Zt=new WeakMap;var dt;const Ve=class Ve{constructor(t,e){u(this,"provider");u(this,"blockNumber");u(this,"blockHash");u(this,"index");u(this,"hash");u(this,"type");u(this,"to");u(this,"from");u(this,"nonce");u(this,"gasLimit");u(this,"gasPrice");u(this,"maxPriorityFeePerGas");u(this,"maxFeePerGas");u(this,"maxFeePerBlobGas");u(this,"data");u(this,"value");u(this,"chainId");u(this,"signature");u(this,"accessList");u(this,"blobVersionedHashes");P(this,dt);this.provider=e,this.blockNumber=t.blockNumber!=null?t.blockNumber:null,this.blockHash=t.blockHash!=null?t.blockHash:null,this.hash=t.hash,this.index=t.index,this.type=t.type,this.from=t.from,this.to=t.to||null,this.gasLimit=t.gasLimit,this.nonce=t.nonce,this.data=t.data,this.value=t.value,this.gasPrice=t.gasPrice,this.maxPriorityFeePerGas=t.maxPriorityFeePerGas!=null?t.maxPriorityFeePerGas:null,this.maxFeePerGas=t.maxFeePerGas!=null?t.maxFeePerGas:null,this.maxFeePerBlobGas=t.maxFeePerBlobGas!=null?t.maxFeePerBlobGas:null,this.chainId=t.chainId,this.signature=t.signature,this.accessList=t.accessList!=null?t.accessList:null,this.blobVersionedHashes=t.blobVersionedHashes!=null?t.blobVersionedHashes:null,E(this,dt,-1)}toJSON(){const{blockNumber:t,blockHash:e,index:n,hash:r,type:i,to:a,from:o,nonce:c,data:l,signature:f,accessList:d,blobVersionedHashes:g}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:t,blockHash:e,blobVersionedHashes:g,chainId:A(this.chainId),data:l,from:o,gasLimit:A(this.gasLimit),gasPrice:A(this.gasPrice),hash:r,maxFeePerGas:A(this.maxFeePerGas),maxPriorityFeePerGas:A(this.maxPriorityFeePerGas),maxFeePerBlobGas:A(this.maxFeePerBlobGas),nonce:c,signature:f,to:a,index:n,type:i,value:A(this.value)}}async getBlock(){let t=this.blockNumber;if(t==null){const n=await this.getTransaction();n&&(t=n.blockNumber)}if(t==null)return null;const e=this.provider.getBlock(t);if(e==null)throw new Error("TODO");return e}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:e,blockNumber:n}=await Oe({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return e==null||e.blockNumber==null?0:n-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(t,e){const n=t??1,r=e??0;let i=h(this,dt),a=-1,o=i===-1;const c=async()=>{if(o)return null;const{blockNumber:g,nonce:m}=await Oe({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(m<this.nonce){i=g;return}if(o)return null;const x=await this.getTransaction();if(!(x&&x.blockNumber!=null))for(a===-1&&(a=i-3,a<h(this,dt)&&(a=h(this,dt)));a<=g;){if(o)return null;const v=await this.provider.getBlock(a,!0);if(v==null)return;for(const k of v)if(k===this.hash)return;for(let k=0;k<v.length;k++){const O=await v.getTransaction(k);if(O.from===this.from&&O.nonce===this.nonce){if(o)return null;const _=await this.provider.getTransactionReceipt(O.hash);if(_==null||g-_.blockNumber+1<n)return;let mt="replaced";O.data===this.data&&O.to===this.to&&O.value===this.value?mt="repriced":O.data==="0x"&&O.from===O.to&&O.value===Bn&&(mt="cancelled"),w(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:mt==="replaced"||mt==="cancelled",reason:mt,replacement:O.replaceableTransaction(i),hash:O.hash,receipt:_})}}a++}},l=g=>{if(g==null||g.status!==0)return g;w(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:g.to,from:g.from,data:""},receipt:g})},f=await this.provider.getTransactionReceipt(this.hash);if(n===0)return l(f);if(f){if(await f.confirmations()>=n)return l(f)}else if(await c(),n===0)return null;return await new Promise((g,m)=>{const x=[],v=()=>{x.forEach(O=>O())};if(x.push(()=>{o=!0}),r>0){const O=setTimeout(()=>{v(),m(ce("wait for transaction timeout","TIMEOUT"))},r);x.push(()=>{clearTimeout(O)})}const k=async O=>{if(await O.confirmations()>=n){v();try{g(l(O))}catch(_){m(_)}}};if(x.push(()=>{this.provider.off(this.hash,k)}),this.provider.on(this.hash,k),i>=0){const O=async()=>{try{await c()}catch(_){if(Jt(_,"TRANSACTION_REPLACED")){v(),m(_);return}}o||this.provider.once("block",O)};x.push(()=>{this.provider.off("block",O)}),this.provider.once("block",O)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return w(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Cn(this)}reorderedEvent(t){return w(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),w(!t||t.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Sn(this,t)}replaceableTransaction(t){p(Number.isInteger(t)&&t>=0,"invalid startBlock","startBlock",t);const e=new Ve(this,this.provider);return E(e,dt,t),e}};dt=new WeakMap;let le=Ve;function Vr(s){return{orphan:"drop-block",hash:s.hash,number:s.number}}function Sn(s,t){return{orphan:"reorder-transaction",tx:s,other:t}}function Cn(s){return{orphan:"drop-transaction",tx:s}}function Mr(s){return{orphan:"drop-log",log:{transactionHash:s.transactionHash,blockHash:s.blockHash,blockNumber:s.blockNumber,address:s.address,data:s.data,topics:Object.freeze(s.topics.slice()),index:s.index}}}class De extends we{constructor(e,n,r){super(e,e.provider);u(this,"interface");u(this,"fragment");u(this,"args");const i=n.decodeEventLog(r,e.data,e.topics);b(this,{args:i,fragment:r,interface:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Fn extends we{constructor(e,n){super(e,e.provider);u(this,"error");b(this,{error:n})}}var Gt;class Hr extends _r{constructor(e,n,r){super(r,n);P(this,Gt);E(this,Gt,e)}get logs(){return super.logs.map(e=>{const n=e.topics.length?h(this,Gt).getEvent(e.topics[0]):null;if(n)try{return new De(e,h(this,Gt),n)}catch(r){return new Fn(e,r)}return e})}}Gt=new WeakMap;var Qt;class $e extends le{constructor(e,n,r){super(r,n);P(this,Qt);E(this,Qt,e)}async wait(e,n){const r=await super.wait(e,n);return r==null?null:new Hr(h(this,Qt),this.provider,r)}}Qt=new WeakMap;class Ln extends jn{constructor(e,n,r,i){super(e,n,r);u(this,"log");b(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class zr extends Ln{constructor(t,e,n,r,i){super(t,e,n,new De(i,t.interface,r));const a=t.interface.decodeEventLog(r,this.log.data,this.log.topics);b(this,{args:a,fragment:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const cn=BigInt(0);function Dn(s){return s&&typeof s.call=="function"}function $n(s){return s&&typeof s.estimateGas=="function"}function be(s){return s&&typeof s.resolveName=="function"}function Gn(s){return s&&typeof s.sendTransaction=="function"}function _n(s){if(s!=null){if(be(s))return s;if(s.provider)return s.provider}}var qt;class Jr{constructor(t,e,n){P(this,qt);u(this,"fragment");if(b(this,{fragment:e}),e.inputs.length<n.length)throw new Error("too many arguments");const r=kt(t.runner,"resolveName"),i=be(r)?r:null;E(this,qt,async function(){const a=await Promise.all(e.inputs.map((o,c)=>n[c]==null?null:o.walkAsync(n[c],(f,d)=>f==="address"?Array.isArray(d)?Promise.all(d.map(g=>Kt(g,i))):Kt(d,i):d)));return t.interface.encodeFilterTopics(e,a)}())}getTopicFilter(){return h(this,qt)}}qt=new WeakMap;function kt(s,t){return s==null?null:typeof s[t]=="function"?s:s.provider&&typeof s.provider[t]=="function"?s.provider:null}function Et(s){return s==null?null:s.provider||null}async function Vn(s,t){const e=C.dereference(s,"overrides");p(typeof e=="object","invalid overrides parameter","overrides",s);const n=Gr(e);return p(n.to==null||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),p(n.data==null||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}async function Kr(s,t,e){const n=kt(s,"resolveName"),r=be(n)?n:null;return await Promise.all(t.map((i,a)=>i.walkAsync(e[a],(o,c)=>(c=C.dereference(c,o),o==="address"?Kt(c,r):c))))}function Wr(s){const t=async function(a){const o=await Vn(a,["data"]);o.to=await s.getAddress(),o.from&&(o.from=await Kt(o.from,_n(s.runner)));const c=s.interface,l=gt(o.value||cn,"overrides.value")===cn,f=(o.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!f&&!l&&p(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),p(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data);const d=c.receive||c.fallback&&c.fallback.payable;return p(d||l,"cannot send value to non-payable fallback","overrides.value",o.value),p(c.fallback||f,"cannot send data to receive-only contract","overrides.data",o.data),o},e=async function(a){const o=kt(s.runner,"call");w(Dn(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const c=await t(a);try{return await o.call(c)}catch(l){throw dn(l)&&l.data?s.interface.makeError(l.data,c):l}},n=async function(a){const o=s.runner;w(Gn(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const c=await o.sendTransaction(await t(a)),l=Et(s.runner);return new $e(s.interface,l,c)},r=async function(a){const o=kt(s.runner,"estimateGas");return w($n(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await t(a))},i=async a=>await n(a);return b(i,{_contract:s,estimateGas:r,populateTransaction:t,send:n,staticCall:e}),i}function Yr(s,t){const e=function(...l){const f=s.interface.getFunction(t,l);return w(f,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:l}}),f},n=async function(...l){const f=e(...l);let d={};if(f.inputs.length+1===l.length&&(d=await Vn(l.pop()),d.from&&(d.from=await Kt(d.from,_n(s.runner)))),f.inputs.length!==l.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const g=await Kr(s.runner,f.inputs,l);return Object.assign({},d,await Oe({to:s.getAddress(),data:s.interface.encodeFunctionData(f,g)}))},r=async function(...l){const f=await o(...l);return f.length===1?f[0]:f},i=async function(...l){const f=s.runner;w(Gn(f),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await f.sendTransaction(await n(...l)),g=Et(s.runner);return new $e(s.interface,g,d)},a=async function(...l){const f=kt(s.runner,"estimateGas");return w($n(f),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await f.estimateGas(await n(...l))},o=async function(...l){const f=kt(s.runner,"call");w(Dn(f),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await n(...l);let g="0x";try{g=await f.call(d)}catch(x){throw dn(x)&&x.data?s.interface.makeError(x.data,d):x}const m=e(...l);return s.interface.decodeFunctionResult(m,g)},c=async(...l)=>e(...l).constant?await r(...l):await i(...l);return b(c,{name:s.interface.getFunctionName(t),_contract:s,_key:t,getFragment:e,estimateGas:a,populateTransaction:n,send:i,staticCall:r,staticCallResult:o}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{const l=s.interface.getFunction(t);return w(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),l}}),c}function Xr(s,t){const e=function(...r){const i=s.interface.getEvent(t,r);return w(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),i},n=function(...r){return new Jr(s,e(...r),r)};return b(n,{name:s.interface.getEventName(t),_contract:s,_key:t,getFragment:e}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=s.interface.getEvent(t);return w(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}const fe=Symbol.for("_ethersInternal_contract"),Mn=new WeakMap;function Zr(s,t){Mn.set(s[fe],t)}function V(s){return Mn.get(s[fe])}function Qr(s){return s&&typeof s=="object"&&"getTopicFilter"in s&&typeof s.getTopicFilter=="function"&&s.fragment}async function Ge(s,t){let e,n=null;if(Array.isArray(t)){const i=function(a){if(pt(a,32))return a;const o=s.interface.getEvent(a);return p(o,"unknown fragment","name",a),o.topicHash};e=t.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else t==="*"?e=[null]:typeof t=="string"?pt(t,32)?e=[t]:(n=s.interface.getEvent(t),p(n,"unknown fragment","event",t),e=[n.topicHash]):Qr(t)?e=await t.getTopicFilter():"fragment"in t?(n=t.fragment,e=[n.topicHash]):p(!1,"unknown event name","event",t);e=e.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const r=e.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:r,topics:e}}async function Mt(s,t){const{subs:e}=V(s);return e.get((await Ge(s,t)).tag)||null}async function un(s,t,e){const n=Et(s.runner);w(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:r,tag:i,topics:a}=await Ge(s,e),{addr:o,subs:c}=V(s);let l=c.get(i);if(!l){const d={address:o||s,topics:a},g=k=>{let O=r;if(O==null)try{O=s.interface.getEvent(k.topics[0])}catch{}if(O){const _=O,mt=r?s.interface.decodeEventLog(r,k.data,k.topics):[];Ce(s,e,mt,Hn=>new zr(s,Hn,e,_,k))}else Ce(s,e,[],_=>new Ln(s,_,e,k))};let m=[];l={tag:i,listeners:[],start:()=>{m.length||m.push(n.on(d,g))},stop:async()=>{if(m.length==0)return;let k=m;m=[],await Promise.all(k),n.off(d,g)}},c.set(i,l)}return l}let Se=Promise.resolve();async function qr(s,t,e,n){await Se;const r=await Mt(s,t);if(!r)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const c=Array.from(e);n&&c.push(n(o?null:a));try{a.call(s,...c)}catch{}return!o}),r.listeners.length===0&&(r.stop(),V(s).subs.delete(r.tag)),i>0}async function Ce(s,t,e,n){try{await Se}catch{}const r=qr(s,t,e,n);return Se=r,await r}const ne=["then"];var ln;ln=fe;const Ht=class Ht{constructor(t,e,n,r){u(this,"target");u(this,"interface");u(this,"runner");u(this,"filters");u(this,ln);u(this,"fallback");p(typeof t=="string"||Xn(t),"invalid value for Contract target","target",t),n==null&&(n=null);const i=Be.from(e);b(this,{target:t,runner:n,interface:i}),Object.defineProperty(this,fe,{value:{}});let a,o=null,c=null;if(r){const d=Et(n);c=new $e(this.interface,d,r)}let l=new Map;if(typeof t=="string")if(pt(t))o=t,a=Promise.resolve(t);else{const d=kt(n,"resolveName");if(!be(d))throw ce("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(t).then(g=>{if(g==null)throw ce("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:t});return V(this).addr=g,g})}else a=t.getAddress().then(d=>{if(d==null)throw new Error("TODO");return V(this).addr=d,d});Zr(this,{addrPromise:a,addr:o,deployTx:c,subs:l});const f=new Proxy({},{get:(d,g,m)=>{if(typeof g=="symbol"||ne.indexOf(g)>=0)return Reflect.get(d,g,m);try{return this.getEvent(g)}catch(x){if(!Jt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,g)=>ne.indexOf(g)>=0?Reflect.has(d,g):Reflect.has(d,g)||this.interface.hasEvent(String(g))});return b(this,{filters:f}),b(this,{fallback:i.receive||i.fallback?Wr(this):null}),new Proxy(this,{get:(d,g,m)=>{if(typeof g=="symbol"||g in d||ne.indexOf(g)>=0)return Reflect.get(d,g,m);try{return d.getFunction(g)}catch(x){if(!Jt(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(d,g)=>typeof g=="symbol"||g in d||ne.indexOf(g)>=0?Reflect.has(d,g):d.interface.hasFunction(g)})}connect(t){return new Ht(this.target,this.interface,t)}attach(t){return new Ht(t,this.interface,this.runner)}async getAddress(){return await V(this).addrPromise}async getDeployedCode(){const t=Et(this.runner);w(t,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const e=await t.getCode(await this.getAddress());return e==="0x"?null:e}async waitForDeployment(){const t=this.deploymentTransaction();if(t)return await t.wait(),this;if(await this.getDeployedCode()!=null)return this;const n=Et(this.runner);return w(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((r,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return r(this);n.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return V(this).deployTx}getFunction(t){return typeof t!="string"&&(t=t.format()),Yr(this,t)}getEvent(t){return typeof t!="string"&&(t=t.format()),Xr(this,t)}async queryTransaction(t){throw new Error("@TODO")}async queryFilter(t,e,n){e==null&&(e=0),n==null&&(n="latest");const{addr:r,addrPromise:i}=V(this),a=r||await i,{fragment:o,topics:c}=await Ge(this,t),l={address:a,topics:c,fromBlock:e,toBlock:n},f=Et(this.runner);return w(f,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await f.getLogs(l)).map(d=>{let g=o;if(g==null)try{g=this.interface.getEvent(d.topics[0])}catch{}if(g)try{return new De(d,this.interface,g)}catch(m){return new Fn(d,m)}return new we(d,f)})}async on(t,e){const n=await un(this,"on",t);return n.listeners.push({listener:e,once:!1}),n.start(),this}async once(t,e){const n=await un(this,"once",t);return n.listeners.push({listener:e,once:!0}),n.start(),this}async emit(t,...e){return await Ce(this,t,e,null)}async listenerCount(t){if(t){const r=await Mt(this,t);return r?r.listeners.length:0}const{subs:e}=V(this);let n=0;for(const{listeners:r}of e.values())n+=r.length;return n}async listeners(t){if(t){const r=await Mt(this,t);return r?r.listeners.map(({listener:i})=>i):[]}const{subs:e}=V(this);let n=[];for(const{listeners:r}of e.values())n=n.concat(r.map(({listener:i})=>i));return n}async off(t,e){const n=await Mt(this,t);if(!n)return this;if(e){const r=n.listeners.map(({listener:i})=>i).indexOf(e);r>=0&&n.listeners.splice(r,1)}return(e==null||n.listeners.length===0)&&(n.stop(),V(this).subs.delete(n.tag)),this}async removeAllListeners(t){if(t){const e=await Mt(this,t);if(!e)return this;e.stop(),V(this).subs.delete(e.tag)}else{const{subs:e}=V(this);for(const{tag:n,stop:r}of e.values())r(),e.delete(n)}return this}async addListener(t,e){return await this.on(t,e)}async removeListener(t,e){return await this.off(t,e)}static buildClass(t){class e extends Ht{constructor(r,i=null){super(r,t,i)}}return e}static from(t,e,n){return n==null&&(n=null),new this(t,e,n)}};let Fe=Ht;function jr(){return Fe}class is extends jr(){}export{ue as A,Fe as B,is as C,jn as E,rs as F,Be as I,we as L,_r as T,gt as a,gn as b,wn as c,Vn as d,Gr as e,Zn as f,ut as g,yn as h,Wt as i,ir as j,Er as k,Qn as l,jt as m,ns as n,ss as o,le as p,Kr as r,pn as t};
@@ -1,4 +1,4 @@
1
- import{l as C}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const n=C`<svg
1
+ import{l as C}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const n=C`<svg
2
2
  xmlns="http://www.w3.org/2000/svg"
3
3
  width="16"
4
4
  height="16"
@@ -1 +1 @@
1
- import{d8 as r,d9 as d,u,d3 as n,da as i,db as m,dc as y}from"../main.js";function s(e){return[...i,m(e)]}function p(e,o){const[t,c]=r(e),a=d(s(e),o);return{protocolName:t,payloadName:c,payloadLiteral:e,...d(y,o),...a,hash:u(n(s(e),a))}}export{p as c};
1
+ import{d7 as r,d8 as d,u,d2 as n,d9 as i,da as m,db as y}from"../main.js";function s(e){return[...i,m(e)]}function p(e,o){const[t,c]=r(e),a=d(s(e),o);return{protocolName:t,payloadName:c,payloadLiteral:e,...d(y,o),...a,hash:u(n(s(e),a))}}export{p as c};
@@ -1,3 +1,3 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const n=o` <svg fill="none" viewBox="0 0 13 4">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const n=o` <svg fill="none" viewBox="0 0 13 4">
2
2
  <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
3
3
  </svg>`;export{n as cursorSvg};
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const m=o`<svg fill="none" viewBox="0 0 14 6">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const m=o`<svg fill="none" viewBox="0 0 14 6">
2
2
  <path style="fill: var(--wui-color-bg-150);" d="M0 1h14L9.21 5.12a3.31 3.31 0 0 1-4.49 0L0 1Z" />
3
3
  <path
4
4
  style="stroke: var(--wui-color-inverse-100);"
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const m=o`<svg fill="none" viewBox="0 0 20 20">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const m=o`<svg fill="none" viewBox="0 0 20 20">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const m=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const m=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  fill-rule="evenodd"
@@ -1,4 +1,4 @@
1
- import{l}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const e=l`<svg fill="none" viewBox="0 0 40 40">
1
+ import{l}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const e=l`<svg fill="none" viewBox="0 0 40 40">
2
2
  <g clip-path="url(#a)">
3
3
  <g clip-path="url(#b)">
4
4
  <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
@@ -1,4 +1,4 @@
1
- import{l as o}from"./solana-C-diloCa.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-7-tpWjBV.js";import"./chain-DF9mIQM9.js";import"./index-Czf_KRcW.js";import"./index.es-g5_0R3zE.js";const l=o`<svg fill="none" viewBox="0 0 16 16">
1
+ import{l as o}from"./solana-CxgaSoPj.js";import"../main.js";import"./util-C_16CLeU.js";import"./wallets-B2cUxj0w.js";import"./signer-BRan8q4C.js";import"./chain-Du7paeNG.js";import"./index.es-CBqWEk7T.js";import"./index-Czf_KRcW.js";const l=o`<svg fill="none" viewBox="0 0 16 16">
2
2
  <path
3
3
  fill="currentColor"
4
4
  d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"