@dcl/blog-site 0.2.2 → 0.2.3-23948667956.commit-cfe47f9

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 (302) hide show
  1. package/assets/QueryClientProvider-mZKMZTwe.js +2 -0
  2. package/assets/RoobertPRO-Bold-DDyOqNrI.woff2 +0 -0
  3. package/assets/SignInRedirect-CXUOqOjy.js +11 -0
  4. package/assets/X-3yocgepi.js +15 -0
  5. package/assets/___vite-browser-external_commonjs-proxy-BqV5D26a.js +1 -0
  6. package/assets/__federation_expose_App-CMGDAIUH.js +1 -0
  7. package/assets/__federation_fn_import-C51lglKS.js +1 -0
  8. package/assets/__federation_shared_@dcl/hooks-Dm9PRmKy.js +535 -0
  9. package/assets/__federation_shared_@dcl/schemas-CVwtHlVJ.js +1 -0
  10. package/assets/__federation_shared_@emotion/react-AmEOkpjC.js +1 -0
  11. package/assets/__federation_shared_@emotion/styled-aZ9bk9Xh.js +1 -0
  12. package/assets/__federation_shared_@reduxjs/toolkit-DIZvwqf7.js +1 -0
  13. package/assets/__federation_shared_decentraland-ui2-KxrbFOTA.js +358 -0
  14. package/assets/__federation_shared_react-B3tlNTLg.js +1 -0
  15. package/assets/__federation_shared_react-dom-CCS4dT_K.js +1 -0
  16. package/assets/__federation_shared_react-redux-Ckcz2edF.js +13 -0
  17. package/assets/__federation_shared_react-router-dom-jUWpDOjR.js +49 -0
  18. package/assets/__federation_shared_viem-Cdp7wK0V.js +2 -0
  19. package/assets/__federation_shared_wagmi-CHWRoybR.js +17 -0
  20. package/assets/__vite-optional-peer-dep_lottie-react_decentraland-ui2-BIHI7g3E.js +1 -0
  21. package/assets/_commonjsHelpers-C4iS2aBk.js +1 -0
  22. package/assets/{add-Dnkf3E3Q.js → add-DHMb_tRw.js} +2 -2
  23. package/assets/all-wallets-Bo3QRxXL.js +6 -0
  24. package/assets/{app-store-C9FH4_zP.js → app-store-BHwDXU8D.js} +2 -2
  25. package/assets/{apple-Dm5w1W69.js → apple-BFX-plRw.js} +2 -2
  26. package/assets/arrow-bottom-Djx9NXV2.js +8 -0
  27. package/assets/{arrow-bottom-circle-Bgw9yiHN.js → arrow-bottom-circle-DcJnW2eo.js} +2 -2
  28. package/assets/arrow-left-BS_dJGSP.js +8 -0
  29. package/assets/arrow-right-B-mwy0Iu.js +8 -0
  30. package/assets/arrow-top-Di1bbZG1.js +8 -0
  31. package/assets/auto-track-pkMvCaah.js +1 -0
  32. package/assets/{bank-qNUWniDB.js → bank-B9SMq-ix.js} +2 -2
  33. package/assets/{basic-DJvhbg9L.js → basic-DijYF-IW.js} +124 -124
  34. package/assets/biconomy-CCw3vtwR.js +1 -0
  35. package/assets/{browser-Du0KKb8R.js → browser-CdKdszu-.js} +2 -2
  36. package/assets/{card-BpDAuOwe.js → card-CQu4Eu8c.js} +2 -2
  37. package/assets/ccip-AgQ5AD9v.js +1 -0
  38. package/assets/chains-D88UzVoE.js +1 -0
  39. package/assets/{checkmark-srdyV91l.js → checkmark-D2vezo75.js} +2 -2
  40. package/assets/{checkmark-bold-BYtPga6u.js → checkmark-bold-DriAapzP.js} +2 -2
  41. package/assets/chevron-bottom-CcFEOVdH.js +8 -0
  42. package/assets/chevron-left-BXS-ybhL.js +8 -0
  43. package/assets/chevron-right-TvO5COya.js +8 -0
  44. package/assets/chevron-top-D84SgxMg.js +8 -0
  45. package/assets/{chrome-store-D-UYtj15.js → chrome-store-rpsfVQln.js} +2 -2
  46. package/assets/{clock-BGyfn2Ix.js → clock-BMJ2gt7b.js} +2 -2
  47. package/assets/close-kAWkeKAP.js +8 -0
  48. package/assets/{coinPlaceholder-o1yCmFLN.js → coinPlaceholder-Dz8MKewa.js} +2 -2
  49. package/assets/common-D37S_OFt.js +1 -0
  50. package/assets/{compass-BrX88OdU.js → compass-BednEqu-.js} +2 -2
  51. package/assets/controller-D0Gc4Hsp.js +2 -0
  52. package/assets/{copy-CGKLgPMf.js → copy-D7rBk-hZ.js} +2 -2
  53. package/assets/core-Bn8Mr-tS.js +907 -0
  54. package/assets/create-submenu-Bu20F8-Z.webp +0 -0
  55. package/assets/createBundlerClient-DhRCLsYO.js +4 -0
  56. package/assets/createClient-C9QPJaZu.js +1 -0
  57. package/assets/cursor-C8UG2IDe.js +3 -0
  58. package/assets/{cursor-transparent--gaS-5ET.js → cursor-transparent-CyP0H3C5.js} +2 -2
  59. package/assets/decimals-B7Pm5rZk.js +1 -0
  60. package/assets/decimals-DedKFk8m.js +1 -0
  61. package/assets/defineChain-7I0Ce1VT.js +1 -0
  62. package/assets/{desktop-D3dzP-FX.js → desktop-LBcRpcZE.js} +2 -2
  63. package/assets/detectExtension-C2uVeK-n.js +1 -0
  64. package/assets/{disconnect-CsHX0nla.js → disconnect-DEBEe-yK.js} +2 -2
  65. package/assets/{discord-TnXCJHRv.js → discord-BlVFKMf0.js} +2 -2
  66. package/assets/emotion-react.browser.esm-BzYQLDSp.js +8 -0
  67. package/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-TsHx33zg.js +1 -0
  68. package/assets/encode-DvvW4ZKt.js +2 -0
  69. package/assets/engine-CD7SeAap.js +1 -0
  70. package/assets/estimate-gas-CeHGaIbG.js +3 -0
  71. package/assets/estimate-l1-fee-ClMO5l7U.js +1 -0
  72. package/assets/eth_estimateGas-C2ENZ_HR.js +1 -0
  73. package/assets/eth_getStorageAt-BHgF2qz5.js +1 -0
  74. package/assets/eth_getTransactionCount-DWnnw2mX.js +1 -0
  75. package/assets/ethereum-dN7ENYl_.js +1 -0
  76. package/assets/{etherscan-BNOTAlpJ.js → etherscan-C_pqcV9R.js} +2 -2
  77. package/assets/events-B5inrCVE.js +1 -0
  78. package/assets/{exclamation-triangle-3cTnBFEz.js → exclamation-triangle-R9Xq3IaG.js} +2 -2
  79. package/assets/explore-submenu-BFVuYMi9.webp +0 -0
  80. package/assets/{extension-C7i3kBcJ.js → extension-DkA_7Cbg.js} +2 -2
  81. package/assets/external-link-BPOw_fuW.js +8 -0
  82. package/assets/extractIPFS-B4LGER25.js +1 -0
  83. package/assets/{facebook-BtRXxuTh.js → facebook-CMZk_t1A.js} +2 -2
  84. package/assets/{farcaster-DuvCkOsj.js → farcaster-CveILPqa.js} +2 -2
  85. package/assets/fee-data-BKBGP5kG.js +1 -0
  86. package/assets/fetchTokenMetadata-BLDHgO8L.js +2 -0
  87. package/assets/{filters-q4uY0GXA.js → filters-BspTrZpX.js} +2 -2
  88. package/assets/get-ecosystem-wallet-info-D3PrM5FE.js +1 -0
  89. package/assets/getBalance-D7nzATjL.js +2 -0
  90. package/assets/getInstalledModules-Ck_Gj8FO.js +1 -0
  91. package/assets/getNFT-BcCS23O_.js +1 -0
  92. package/assets/getNFT-DXdMP0Q5.js +2 -0
  93. package/assets/{github-DdvkoPeB.js → github-DoFHEMIF.js} +2 -2
  94. package/assets/{google-d4Ql9qix.js → google-NTQi9GVe.js} +2 -2
  95. package/assets/governance-submenu-VTIKvCIL.webp +0 -0
  96. package/assets/{help-circle-BY_Weu8t.js → help-circle-DV0uNPdn.js} +2 -2
  97. package/assets/hex-B0Rx0hII.js +2 -0
  98. package/assets/{id-BJNb6vOI.js → id-UAVc1FOO.js} +1 -1
  99. package/assets/{image-DIsXNsXJ.js → image-BeHBzCPG.js} +2 -2
  100. package/assets/in-app-wallet-calls-CvFtsXP9.js +1 -0
  101. package/assets/index-B2OCb4Ez.js +1 -0
  102. package/assets/index-B65z14KI.js +4 -0
  103. package/assets/index-BAhlRyDG.js +1 -0
  104. package/assets/{index-DOqN8xaU.js → index-BTtTX-5z.js} +1 -1
  105. package/assets/index-BjzJcZq6.js +1 -0
  106. package/assets/index-BjzJcZq6__bundled.js +24 -0
  107. package/assets/index-BozJS3za.js +12 -0
  108. package/assets/index-C05H8NDX.js +1 -0
  109. package/assets/index-C1IoT2if.js +3 -0
  110. package/assets/index-C2hdqzGT.js +2 -0
  111. package/assets/index-CgMDPZul.js +13 -0
  112. package/assets/index-CjuQOkbh.js +2 -0
  113. package/assets/index-CpR9p5nk.js +1 -0
  114. package/assets/index-D1lXZVQu.js +45 -0
  115. package/assets/index-D6ZAha0r.js +395 -0
  116. package/assets/{index-X-a697cI.js → index-DJ7GgcJ9.js} +2 -2
  117. package/assets/index-DajuSfcu.js +2 -0
  118. package/assets/index-DeklogZX.js +1 -0
  119. package/assets/index-DmAaXUNv.js +1 -0
  120. package/assets/index-Dy0yjznp.js +1 -0
  121. package/assets/index-Dy0yjznp__bundled.js +9 -0
  122. package/assets/index-HvoTJwGm.js +1 -0
  123. package/assets/index-MYKNZAUu.js +8 -0
  124. package/assets/index-Tsk25L8E.js +1 -0
  125. package/assets/index.es-C8Kfv-K1.js +11 -0
  126. package/assets/index.es-CAXGMBEH.js +1 -0
  127. package/assets/index.es-D3pP9hN4.js +27 -0
  128. package/assets/index.es-D5YKsq2-.js +2 -0
  129. package/assets/index.umd-DK712HHb.js +1 -0
  130. package/assets/{info-BvPgRaaJ.js → info-CzcA85TO.js} +2 -2
  131. package/assets/{info-circle-sWcom9RD.js → info-circle-D3Mr3R9u.js} +2 -2
  132. package/assets/is-plan-event-enabled-DeNtQvA5.js +1 -0
  133. package/assets/json-BHzNJmTy.js +1 -0
  134. package/assets/jsx-runtime-DncYoG30.js +1 -0
  135. package/assets/jsx-runtime-DncYoG30__bundled.js +9 -0
  136. package/assets/learn-submenu-sfxVP5Db.webp +0 -0
  137. package/assets/{lightbulb-HJchniSu.js → lightbulb-B2FZtM_8.js} +2 -2
  138. package/assets/localBatchGatewayRequest-BIEAG3VG.js +1 -0
  139. package/assets/{mail-DlRijJmV.js → mail-CkhGbows.js} +2 -2
  140. package/assets/marketplace-submenu-CixWTv8_.webp +0 -0
  141. package/assets/{mobile-CoiDw6cg.js → mobile-1H3FtqAS.js} +2 -2
  142. package/assets/{more-LUiRL6x4.js → more-CZiQi624.js} +2 -2
  143. package/assets/{network-placeholder-Cj3jgVfo.js → network-placeholder-DA2bm2rC.js} +2 -2
  144. package/assets/{nftPlaceholder-LkhQmGFs.js → nftPlaceholder-C9t5Ydxp.js} +2 -2
  145. package/assets/off-D8z0OQ3M.js +8 -0
  146. package/assets/op-gas-fee-reducer-CfxMcvXl.js +1 -0
  147. package/assets/openzeppelin-ZKz6sLW9.js +1 -0
  148. package/assets/ownerOf-D1aXOt9Q.js +1 -0
  149. package/assets/parseNft-LjEwmOst.js +2 -0
  150. package/assets/passkeys-CTJ4NPfL.js +1 -0
  151. package/assets/{play-store-DBit2AoS.js → play-store-_X5LrPwx.js} +2 -2
  152. package/assets/{plus-CZe-WgSN.js → plus-JriDhMxt.js} +2 -2
  153. package/assets/preload-helper-BorDCKdG.js +1 -0
  154. package/assets/publicKeyToAddress-CxEKPAKT.js +1 -0
  155. package/assets/{qr-code-BhW7ZXY-.js → qr-code-DaB080BF.js} +2 -2
  156. package/assets/{qr-overlay-DsRPQv6v.js → qr-overlay-CGnFhcTk.js} +1 -1
  157. package/assets/{recycle-horizontal-DBnWoDRV.js → recycle-horizontal-CGeFmMrT.js} +2 -2
  158. package/assets/redux-BNDF-Lt-.js +1 -0
  159. package/assets/{refresh-qvocxvcf.js → refresh-Dgvxxw5C.js} +2 -2
  160. package/assets/remoteEntry.js +1 -0
  161. package/assets/{reown-logo-C-45v-AJ.js → reown-logo-CBX48aN9.js} +2 -2
  162. package/assets/resolveImplementation-Cb2bL1tx.js +1 -0
  163. package/assets/rich-text-react-renderer.es5-D_tE7AHo.js +2 -0
  164. package/assets/rpc-ti0b0r_u.js +3 -0
  165. package/assets/search-DamXBOxM.js +8 -0
  166. package/assets/secp256k1-UEF-yOzn.js +1 -0
  167. package/assets/{send-DI2x4DfJ.js → send-BLpUSx_G.js} +2 -2
  168. package/assets/send-batch-transaction-DnH876GL.js +1 -0
  169. package/assets/send-eip712-transaction-D_FU-Avh.js +2 -0
  170. package/assets/send-gasless-transaction-MP1Q_mLW.js +2 -0
  171. package/assets/serializeTransaction-mtsVBaO6.js +1 -0
  172. package/assets/session-proposal-CM3P7DaL.js +1 -0
  173. package/assets/session-request-Dqw67u3p.js +2 -0
  174. package/assets/sha256-DYtpy1Qz.js +1 -0
  175. package/assets/signing-BFeVjjPi.js +5 -0
  176. package/assets/store-DOLZnwHk.js +1 -0
  177. package/assets/{swapHorizontal-eTjjU7d8.js → swapHorizontal-Br-MZ1tO.js} +2 -2
  178. package/assets/{swapHorizontalBold-B86nJTAP.js → swapHorizontalBold-CkUNbZ1G.js} +2 -2
  179. package/assets/{swapHorizontalMedium-CNT7ELrN.js → swapHorizontalMedium-D3qEQNb5.js} +2 -2
  180. package/assets/{swapHorizontalRoundedBold-R_inXmIh.js → swapHorizontalRoundedBold-CzzBPCtt.js} +2 -2
  181. package/assets/{swapVertical-DBChOUj8.js → swapVertical-Mrn3zm_W.js} +2 -2
  182. package/assets/{telegram-DjYbgHgS.js → telegram-ZTLC9FiA.js} +2 -2
  183. package/assets/thirdweb-CHfVLLbM.js +1 -0
  184. package/assets/thirdweb-D5ezTmuN.js +27 -0
  185. package/assets/{three-dots-VoULPGrI.js → three-dots-DYl4uQjm.js} +2 -2
  186. package/assets/totalSupply-B5jHW8gx.js +1 -0
  187. package/assets/tslib.es6-DbvBTznf.js +1 -0
  188. package/assets/{twitch-ETBgqGHE.js → twitch-DPLkA98Q.js} +2 -2
  189. package/assets/{twitterIcon-N584dzfh.js → twitterIcon-BEY_UAyG.js} +2 -2
  190. package/assets/uid-D00jCazq.js +44 -0
  191. package/assets/{uint8-array-CjVHUazS.js → uint8-array-DZKEMhA1.js} +1 -1
  192. package/assets/utils-C7urdXtO.js +2 -0
  193. package/assets/utils-CozXUO91.js +1 -0
  194. package/assets/{verify-Dp4bztGk.js → verify-DuPdiufm.js} +2 -2
  195. package/assets/{verify-filled-B7WhO3Kn.js → verify-filled-CdqEW5AP.js} +2 -2
  196. package/assets/{w3m-modal-BmEHfmEu.js → w3m-modal-BLzhBUlF.js} +34 -34
  197. package/assets/wait-for-tx-receipt-B-o5aPQ8.js +1 -0
  198. package/assets/{wallet-tXSvlbUa.js → wallet-CZw1g3L8.js} +2 -2
  199. package/assets/{wallet-placeholder-B2e9Wl_u.js → wallet-placeholder-OAkoJuru.js} +2 -2
  200. package/assets/{walletconnect-D70wSjLs.js → walletconnect-BJ3w7-IU.js} +4 -4
  201. package/assets/wallets-Q5RcRyG6.js +16 -0
  202. package/assets/{warning-circle-CsTkZ4Rl.js → warning-circle-DpDeOZKv.js} +2 -2
  203. package/assets/web-connector-CB7tpRui.js +9 -0
  204. package/assets/webSocket-dQW3n9NM.js +3 -0
  205. package/assets/withCache-DYumIHzL.js +1 -0
  206. package/assets/{x-DwOCQuex.js → x-liJqLZUi.js} +2 -2
  207. package/assets/zora-sepolia-DNJ2DQat.js +1 -0
  208. package/index.html +17 -3
  209. package/package.json +3 -3
  210. package/assets/RoobertPRO-Bold-BLoSpx-h.otf +0 -0
  211. package/assets/all-wallets-C5N9p7Oh.js +0 -6
  212. package/assets/arrow-bottom-CXaxVEeb.js +0 -8
  213. package/assets/arrow-left-pgI3hg3C.js +0 -8
  214. package/assets/arrow-right-CyKp2yFa.js +0 -8
  215. package/assets/arrow-top-B2waxVPx.js +0 -8
  216. package/assets/auto-track-BvFI9h3i.js +0 -1
  217. package/assets/biconomy-DZsFbmF0.js +0 -1
  218. package/assets/ccip-CpLmER95.js +0 -1
  219. package/assets/chains-BJ1WS73W.js +0 -1
  220. package/assets/chevron-bottom-C2aa3E9i.js +0 -8
  221. package/assets/chevron-left-jGoftk_A.js +0 -8
  222. package/assets/chevron-right-Dt6SfcNy.js +0 -8
  223. package/assets/chevron-top-CBCgyIVe.js +0 -8
  224. package/assets/close-BQpWkcd5.js +0 -8
  225. package/assets/common-B5-2TPMC.js +0 -1
  226. package/assets/controller-BW9fJMCh.js +0 -2
  227. package/assets/core-f4taWsy5.js +0 -908
  228. package/assets/create-submenu-DEFVbrc5.png +0 -0
  229. package/assets/createBundlerClient-r1Kofl9Y.js +0 -8
  230. package/assets/cursor-l_ly71I2.js +0 -3
  231. package/assets/decimals-BB5yEnWu.js +0 -1
  232. package/assets/decimals-D7yTLBH-.js +0 -1
  233. package/assets/detectExtension-BOyq5ueD.js +0 -1
  234. package/assets/engine-COatTZhI.js +0 -1
  235. package/assets/estimate-l1-fee-gm3XrWSf.js +0 -1
  236. package/assets/eth_estimateGas-A6ba-Fl3.js +0 -1
  237. package/assets/eth_getStorageAt-DiqyV3Wq.js +0 -1
  238. package/assets/eth_getTransactionCount-CF50onAO.js +0 -1
  239. package/assets/ethereum-Bb-GI0c-.js +0 -1
  240. package/assets/events-CjOrSHaz.js +0 -1
  241. package/assets/explore-submenu-KVl6Dc-h.png +0 -0
  242. package/assets/external-link-C6RRSRES.js +0 -8
  243. package/assets/extractIPFS-BchHnCEN.js +0 -1
  244. package/assets/fetchTokenMetadata-ClRC5ORW.js +0 -2
  245. package/assets/get-ecosystem-wallet-info-C2CJ_2OU.js +0 -1
  246. package/assets/getBalance-DGuxWuYL.js +0 -1
  247. package/assets/getInstalledModules-A3tAP18V.js +0 -1
  248. package/assets/getNFT-C7cllYFm.js +0 -1
  249. package/assets/getNFT-CQKD7QHk.js +0 -2
  250. package/assets/governance-submenu-CXxLX9nT.png +0 -0
  251. package/assets/hashTypedData-7WNMs5EV.js +0 -1
  252. package/assets/in-app-wallet-calls-CIRR0eJZ.js +0 -1
  253. package/assets/index-B1P0UjN9.js +0 -1
  254. package/assets/index-BNdVKnva.js +0 -2
  255. package/assets/index-BtvcwkC4.js +0 -1
  256. package/assets/index-C3CMrfih.js +0 -1
  257. package/assets/index-C8ynIJrk.js +0 -395
  258. package/assets/index-Ca6sys5l.js +0 -3
  259. package/assets/index-CvqvWWYJ.js +0 -2
  260. package/assets/index-CxA55UWl.js +0 -1
  261. package/assets/index-D-W42D03.js +0 -12
  262. package/assets/index-DC9TKWAz.js +0 -23
  263. package/assets/index-DFfsl0Io.js +0 -4
  264. package/assets/index-DN2JqH-l.js +0 -895
  265. package/assets/index-DfqIHbWG.js +0 -2
  266. package/assets/index-pQ6ZXw4u.js +0 -13
  267. package/assets/index-qMD90g0X.js +0 -1
  268. package/assets/index.es-B2O4h03u.js +0 -12
  269. package/assets/index.es-BEAksKXY.js +0 -2
  270. package/assets/index.es-Dxxm_SKC.js +0 -1
  271. package/assets/index.es-MXG0VeeZ.js +0 -27
  272. package/assets/index.umd-DvfMpbcY.js +0 -1
  273. package/assets/is-plan-event-enabled-DS1Agtkw.js +0 -1
  274. package/assets/learn-submenu-Xs1jOwfy.png +0 -0
  275. package/assets/localBatchGatewayRequest-CHeIulW5.js +0 -1
  276. package/assets/marketplace-submenu-CjxTqNhj.png +0 -0
  277. package/assets/off-BCDn43Xl.js +0 -8
  278. package/assets/openzeppelin-_xpy9vRo.js +0 -1
  279. package/assets/ownerOf-ClSM4brX.js +0 -1
  280. package/assets/parseNft-BmEusGKu.js +0 -2
  281. package/assets/passkeys-CqFedyqV.js +0 -1
  282. package/assets/resolveImplementation-BssH7H5b.js +0 -1
  283. package/assets/rpc-DMtarHL0.js +0 -3
  284. package/assets/search-CAzZVrZw.js +0 -8
  285. package/assets/secp256k1-C_4ya0Qz.js +0 -1
  286. package/assets/secp256k1-CnKxz2gu.js +0 -1
  287. package/assets/secp256k1-oGq0B4P7.js +0 -1
  288. package/assets/send-batch-transaction-DfUNUZ4Z.js +0 -1
  289. package/assets/send-eip712-transaction-Ro5QmOlW.js +0 -2
  290. package/assets/send-gasless-transaction-B-Uu5KdW.js +0 -2
  291. package/assets/session-proposal-CRjqbz7W.js +0 -1
  292. package/assets/session-request-BI3BlMfs.js +0 -2
  293. package/assets/sha256-ChRob2fv.js +0 -1
  294. package/assets/signing-B1K_Jdsm.js +0 -30
  295. package/assets/thirdweb-0Fl_ECmE.js +0 -27
  296. package/assets/thirdweb-DZ2vK6IO.js +0 -1
  297. package/assets/totalSupply-ClM38QOc.js +0 -1
  298. package/assets/utils-B3vUvlNq.js +0 -1
  299. package/assets/wait-for-tx-receipt-pc2BJc62.js +0 -1
  300. package/assets/wallets-Dj6CY1yi.js +0 -17
  301. package/assets/web-connector-CiZO9RvI.js +0 -9
  302. package/assets/zora-sepolia-CZ4Tf1UH.js +0 -1
@@ -0,0 +1,12 @@
1
+ import{c as ee,g as dn,a as Gl}from"./_commonjsHelpers-C4iS2aBk.js";import{r as Vs}from"./___vite-browser-external_commonjs-proxy-BqV5D26a.js";import{e as Jl}from"./index-6E4L_h32.js";import{i as St}from"./inherits_browser-BlmhoU4v.js";import{w as Zl,t as Kl,c as Ql,i as Yl}from"./index-Tsk25L8E.js";import{p as Xl,a as eu}from"./hooks.module-Cpp96UEK.js";import{e as ii}from"./events-B5inrCVE.js";import{t as tu}from"./tslib.es6-DbvBTznf.js";function ru(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var zs={},cn={},si={};Object.defineProperty(si,"__esModule",{value:!0});si.walletLogo=void 0;const nu=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};si.walletLogo=nu;var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.LINK_API_URL=void 0;oi.LINK_API_URL="https://www.walletlink.org";var X={},qs={exports:{}};qs.exports;(function(e){(function(t,r){function n(I,o){if(!I)throw new Error(o||"Assertion failed")}function i(I,o){I.super_=o;var d=function(){};d.prototype=o.prototype,I.prototype=new d,I.prototype.constructor=I}function s(I,o,d){if(s.isBN(I))return I;this.negative=0,this.words=null,this.length=0,this.red=null,I!==null&&((o==="le"||o==="be")&&(d=o,o=10),this._init(I||0,o||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=Vs.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,d){return o.cmp(d)>0?o:d},s.min=function(o,d){return o.cmp(d)<0?o:d},s.prototype._init=function(o,d,w){if(typeof o=="number")return this._initNumber(o,d,w);if(typeof o=="object")return this._initArray(o,d,w);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),o=o.toString().replace(/\s+/g,"");var y=0;o[0]==="-"&&(y++,this.negative=1),y<o.length&&(d===16?this._parseHex(o,y,w):(this._parseBase(o,d,y),w==="le"&&this._initArray(this.toArray(),d,w)))},s.prototype._initNumber=function(o,d,w){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),w==="le"&&this._initArray(this.toArray(),d,w)},s.prototype._initArray=function(o,d,w){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var _,k,T=0;if(w==="be")for(y=o.length-1,_=0;y>=0;y-=3)k=o[y]|o[y-1]<<8|o[y-2]<<16,this.words[_]|=k<<T&67108863,this.words[_+1]=k>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(w==="le")for(y=0,_=0;y<o.length;y+=3)k=o[y]|o[y+1]<<8|o[y+2]<<16,this.words[_]|=k<<T&67108863,this.words[_+1]=k>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this._strip()};function a(I,o){var d=I.charCodeAt(o);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+I)}function f(I,o,d){var w=a(I,d);return d-1>=o&&(w|=a(I,d-1)<<4),w}s.prototype._parseHex=function(o,d,w){this.length=Math.ceil((o.length-d)/6),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var _=0,k=0,T;if(w==="be")for(y=o.length-1;y>=d;y-=2)T=f(o,d,y)<<_,this.words[k]|=T&67108863,_>=18?(_-=18,k+=1,this.words[k]|=T>>>26):_+=8;else{var b=o.length-d;for(y=b%2===0?d+1:d;y<o.length;y+=2)T=f(o,d,y)<<_,this.words[k]|=T&67108863,_>=18?(_-=18,k+=1,this.words[k]|=T>>>26):_+=8}this._strip()};function g(I,o,d,w){for(var y=0,_=0,k=Math.min(I.length,d),T=o;T<k;T++){var b=I.charCodeAt(T)-48;y*=w,b>=49?_=b-49+10:b>=17?_=b-17+10:_=b,n(b>=0&&_<w,"Invalid character"),y+=_}return y}s.prototype._parseBase=function(o,d,w){this.words=[0],this.length=1;for(var y=0,_=1;_<=67108863;_*=d)y++;y--,_=_/d|0;for(var k=o.length-w,T=k%y,b=Math.min(k,k-T)+w,u=0,S=w;S<b;S+=y)u=g(o,S,S+y,d),this.imuln(_),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(T!==0){var K=1;for(u=g(o,S,o.length,d),S=0;S<T;S++)K*=d;this.imuln(K),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},s.prototype.copy=function(o){o.words=new Array(this.length);for(var d=0;d<this.length;d++)o.words[d]=this.words[d];o.length=this.length,o.negative=this.negative,o.red=this.red};function p(I,o){I.words=o.words,I.length=o.length,I.negative=o.negative,I.red=o.red}if(s.prototype._move=function(o){p(o,this)},s.prototype.clone=function(){var o=new s(null);return this.copy(o),o},s.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=M}catch{s.prototype.inspect=M}else s.prototype.inspect=M;function M(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],N=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],H=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,d){o=o||10,d=d|0||1;var w;if(o===16||o==="hex"){w="";for(var y=0,_=0,k=0;k<this.length;k++){var T=this.words[k],b=((T<<y|_)&16777215).toString(16);_=T>>>24-y&16777215,y+=2,y>=26&&(y-=26,k--),_!==0||k!==this.length-1?w=E[6-b.length]+b+w:w=b+w}for(_!==0&&(w=_.toString(16)+w);w.length%d!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}if(o===(o|0)&&o>=2&&o<=36){var u=N[o],S=H[o];w="";var K=this.clone();for(K.negative=0;!K.isZero();){var J=K.modrn(S).toString(o);K=K.idivn(S),K.isZero()?w=J+w:w=E[u-J.length]+J+w}for(this.isZero()&&(w="0"+w);w.length%d!==0;)w="0"+w;return this.negative!==0&&(w="-"+w),w}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},c&&(s.prototype.toBuffer=function(o,d){return this.toArrayLike(c,o,d)}),s.prototype.toArray=function(o,d){return this.toArrayLike(Array,o,d)};var D=function(o,d){return o.allocUnsafe?o.allocUnsafe(d):new o(d)};s.prototype.toArrayLike=function(o,d,w){this._strip();var y=this.byteLength(),_=w||Math.max(1,y);n(y<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var k=D(o,_),T=d==="le"?"LE":"BE";return this["_toArrayLike"+T](k,y),k},s.prototype._toArrayLikeLE=function(o,d){for(var w=0,y=0,_=0,k=0;_<this.length;_++){var T=this.words[_]<<k|y;o[w++]=T&255,w<o.length&&(o[w++]=T>>8&255),w<o.length&&(o[w++]=T>>16&255),k===6?(w<o.length&&(o[w++]=T>>24&255),y=0,k=0):(y=T>>>24,k+=2)}if(w<o.length)for(o[w++]=y;w<o.length;)o[w++]=0},s.prototype._toArrayLikeBE=function(o,d){for(var w=o.length-1,y=0,_=0,k=0;_<this.length;_++){var T=this.words[_]<<k|y;o[w--]=T&255,w>=0&&(o[w--]=T>>8&255),w>=0&&(o[w--]=T>>16&255),k===6?(w>=0&&(o[w--]=T>>24&255),y=0,k=0):(y=T>>>24,k+=2)}if(w>=0)for(o[w--]=y;w>=0;)o[w--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var d=o,w=0;return d>=4096&&(w+=13,d>>>=13),d>=64&&(w+=7,d>>>=7),d>=8&&(w+=4,d>>>=4),d>=2&&(w+=2,d>>>=2),w+d},s.prototype._zeroBits=function(o){if(o===0)return 26;var d=o,w=0;return d&8191||(w+=13,d>>>=13),d&127||(w+=7,d>>>=7),d&15||(w+=4,d>>>=4),d&3||(w+=2,d>>>=2),d&1||w++,w},s.prototype.bitLength=function(){var o=this.words[this.length-1],d=this._countBits(o);return(this.length-1)*26+d};function $(I){for(var o=new Array(I.bitLength()),d=0;d<o.length;d++){var w=d/26|0,y=d%26;o[d]=I.words[w]>>>y&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,d=0;d<this.length;d++){var w=this._zeroBits(this.words[d]);if(o+=w,w!==26)break}return o},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},s.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var d=0;d<o.length;d++)this.words[d]=this.words[d]|o.words[d];return this._strip()},s.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},s.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var d;this.length>o.length?d=o:d=this;for(var w=0;w<d.length;w++)this.words[w]=this.words[w]&o.words[w];return this.length=d.length,this._strip()},s.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},s.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var d,w;this.length>o.length?(d=this,w=o):(d=o,w=this);for(var y=0;y<w.length;y++)this.words[y]=d.words[y]^w.words[y];if(this!==d)for(;y<d.length;y++)this.words[y]=d.words[y];return this.length=d.length,this._strip()},s.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},s.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var d=Math.ceil(o/26)|0,w=o%26;this._expand(d),w>0&&d--;for(var y=0;y<d;y++)this.words[y]=~this.words[y]&67108863;return w>0&&(this.words[y]=~this.words[y]&67108863>>26-w),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,d){n(typeof o=="number"&&o>=0);var w=o/26|0,y=o%26;return this._expand(w+1),d?this.words[w]=this.words[w]|1<<y:this.words[w]=this.words[w]&~(1<<y),this._strip()},s.prototype.iadd=function(o){var d;if(this.negative!==0&&o.negative===0)return this.negative=0,d=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,d=this.isub(o),o.negative=1,d._normSign();var w,y;this.length>o.length?(w=this,y=o):(w=o,y=this);for(var _=0,k=0;k<y.length;k++)d=(w.words[k]|0)+(y.words[k]|0)+_,this.words[k]=d&67108863,_=d>>>26;for(;_!==0&&k<w.length;k++)d=(w.words[k]|0)+_,this.words[k]=d&67108863,_=d>>>26;if(this.length=w.length,_!==0)this.words[this.length]=_,this.length++;else if(w!==this)for(;k<w.length;k++)this.words[k]=w.words[k];return this},s.prototype.add=function(o){var d;return o.negative!==0&&this.negative===0?(o.negative=0,d=this.sub(o),o.negative^=1,d):o.negative===0&&this.negative!==0?(this.negative=0,d=o.sub(this),this.negative=1,d):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var d=this.iadd(o);return o.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var w=this.cmp(o);if(w===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,_;w>0?(y=this,_=o):(y=o,_=this);for(var k=0,T=0;T<_.length;T++)d=(y.words[T]|0)-(_.words[T]|0)+k,k=d>>26,this.words[T]=d&67108863;for(;k!==0&&T<y.length;T++)d=(y.words[T]|0)+k,k=d>>26,this.words[T]=d&67108863;if(k===0&&T<y.length&&y!==this)for(;T<y.length;T++)this.words[T]=y.words[T];return this.length=Math.max(this.length,T),y!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function x(I,o,d){d.negative=o.negative^I.negative;var w=I.length+o.length|0;d.length=w,w=w-1|0;var y=I.words[0]|0,_=o.words[0]|0,k=y*_,T=k&67108863,b=k/67108864|0;d.words[0]=T;for(var u=1;u<w;u++){for(var S=b>>>26,K=b&67108863,J=Math.min(u,o.length-1),A=Math.max(0,u-I.length+1);A<=J;A++){var P=u-A|0;y=I.words[P]|0,_=o.words[A]|0,k=y*_+K,S+=k/67108864|0,K=k&67108863}d.words[u]=K|0,b=S|0}return b!==0?d.words[u]=b|0:d.length--,d._strip()}var L=function(o,d,w){var y=o.words,_=d.words,k=w.words,T=0,b,u,S,K=y[0]|0,J=K&8191,A=K>>>13,P=y[1]|0,W=P&8191,Z=P>>>13,le=y[2]|0,R=le&8191,C=le>>>13,z=y[3]|0,G=z&8191,se=z>>>13,ue=y[4]|0,re=ue&8191,be=ue>>>13,ht=y[5]|0,Se=ht&8191,Ee=ht>>>13,Je=y[6]|0,ve=Je&8191,Re=Je>>>13,Qe=y[7]|0,_e=Qe&8191,m=Qe>>>13,l=y[8]|0,h=l&8191,v=l>>>13,B=y[9]|0,F=B&8191,U=B>>>13,he=_[0]|0,ae=he&8191,ie=he>>>13,Me=_[1]|0,ne=Me&8191,Ce=Me>>>13,_r=_[2]|0,ke=_r&8191,Ie=_r>>>13,Er=_[3]|0,xe=Er&8191,Ae=Er>>>13,Sr=_[4]|0,Te=Sr&8191,Be=Sr>>>13,Rr=_[5]|0,Ne=Rr&8191,Le=Rr>>>13,Mr=_[6]|0,Pe=Mr&8191,Oe=Mr>>>13,Cr=_[7]|0,Fe=Cr&8191,De=Cr>>>13,kr=_[8]|0,je=kr&8191,Ue=kr>>>13,Ir=_[9]|0,He=Ir&8191,$e=Ir>>>13;w.negative=o.negative^d.negative,w.length=19,b=Math.imul(J,ae),u=Math.imul(J,ie),u=u+Math.imul(A,ae)|0,S=Math.imul(A,ie);var qt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(qt>>>26)|0,qt&=67108863,b=Math.imul(W,ae),u=Math.imul(W,ie),u=u+Math.imul(Z,ae)|0,S=Math.imul(Z,ie),b=b+Math.imul(J,ne)|0,u=u+Math.imul(J,Ce)|0,u=u+Math.imul(A,ne)|0,S=S+Math.imul(A,Ce)|0;var Gt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,b=Math.imul(R,ae),u=Math.imul(R,ie),u=u+Math.imul(C,ae)|0,S=Math.imul(C,ie),b=b+Math.imul(W,ne)|0,u=u+Math.imul(W,Ce)|0,u=u+Math.imul(Z,ne)|0,S=S+Math.imul(Z,Ce)|0,b=b+Math.imul(J,ke)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(A,ke)|0,S=S+Math.imul(A,Ie)|0;var Jt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(G,ae),u=Math.imul(G,ie),u=u+Math.imul(se,ae)|0,S=Math.imul(se,ie),b=b+Math.imul(R,ne)|0,u=u+Math.imul(R,Ce)|0,u=u+Math.imul(C,ne)|0,S=S+Math.imul(C,Ce)|0,b=b+Math.imul(W,ke)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(Z,ke)|0,S=S+Math.imul(Z,Ie)|0,b=b+Math.imul(J,xe)|0,u=u+Math.imul(J,Ae)|0,u=u+Math.imul(A,xe)|0,S=S+Math.imul(A,Ae)|0;var Zt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,b=Math.imul(re,ae),u=Math.imul(re,ie),u=u+Math.imul(be,ae)|0,S=Math.imul(be,ie),b=b+Math.imul(G,ne)|0,u=u+Math.imul(G,Ce)|0,u=u+Math.imul(se,ne)|0,S=S+Math.imul(se,Ce)|0,b=b+Math.imul(R,ke)|0,u=u+Math.imul(R,Ie)|0,u=u+Math.imul(C,ke)|0,S=S+Math.imul(C,Ie)|0,b=b+Math.imul(W,xe)|0,u=u+Math.imul(W,Ae)|0,u=u+Math.imul(Z,xe)|0,S=S+Math.imul(Z,Ae)|0,b=b+Math.imul(J,Te)|0,u=u+Math.imul(J,Be)|0,u=u+Math.imul(A,Te)|0,S=S+Math.imul(A,Be)|0;var Kt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,b=Math.imul(Se,ae),u=Math.imul(Se,ie),u=u+Math.imul(Ee,ae)|0,S=Math.imul(Ee,ie),b=b+Math.imul(re,ne)|0,u=u+Math.imul(re,Ce)|0,u=u+Math.imul(be,ne)|0,S=S+Math.imul(be,Ce)|0,b=b+Math.imul(G,ke)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(se,ke)|0,S=S+Math.imul(se,Ie)|0,b=b+Math.imul(R,xe)|0,u=u+Math.imul(R,Ae)|0,u=u+Math.imul(C,xe)|0,S=S+Math.imul(C,Ae)|0,b=b+Math.imul(W,Te)|0,u=u+Math.imul(W,Be)|0,u=u+Math.imul(Z,Te)|0,S=S+Math.imul(Z,Be)|0,b=b+Math.imul(J,Ne)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(A,Ne)|0,S=S+Math.imul(A,Le)|0;var Qt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(ve,ae),u=Math.imul(ve,ie),u=u+Math.imul(Re,ae)|0,S=Math.imul(Re,ie),b=b+Math.imul(Se,ne)|0,u=u+Math.imul(Se,Ce)|0,u=u+Math.imul(Ee,ne)|0,S=S+Math.imul(Ee,Ce)|0,b=b+Math.imul(re,ke)|0,u=u+Math.imul(re,Ie)|0,u=u+Math.imul(be,ke)|0,S=S+Math.imul(be,Ie)|0,b=b+Math.imul(G,xe)|0,u=u+Math.imul(G,Ae)|0,u=u+Math.imul(se,xe)|0,S=S+Math.imul(se,Ae)|0,b=b+Math.imul(R,Te)|0,u=u+Math.imul(R,Be)|0,u=u+Math.imul(C,Te)|0,S=S+Math.imul(C,Be)|0,b=b+Math.imul(W,Ne)|0,u=u+Math.imul(W,Le)|0,u=u+Math.imul(Z,Ne)|0,S=S+Math.imul(Z,Le)|0,b=b+Math.imul(J,Pe)|0,u=u+Math.imul(J,Oe)|0,u=u+Math.imul(A,Pe)|0,S=S+Math.imul(A,Oe)|0;var Yt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(_e,ae),u=Math.imul(_e,ie),u=u+Math.imul(m,ae)|0,S=Math.imul(m,ie),b=b+Math.imul(ve,ne)|0,u=u+Math.imul(ve,Ce)|0,u=u+Math.imul(Re,ne)|0,S=S+Math.imul(Re,Ce)|0,b=b+Math.imul(Se,ke)|0,u=u+Math.imul(Se,Ie)|0,u=u+Math.imul(Ee,ke)|0,S=S+Math.imul(Ee,Ie)|0,b=b+Math.imul(re,xe)|0,u=u+Math.imul(re,Ae)|0,u=u+Math.imul(be,xe)|0,S=S+Math.imul(be,Ae)|0,b=b+Math.imul(G,Te)|0,u=u+Math.imul(G,Be)|0,u=u+Math.imul(se,Te)|0,S=S+Math.imul(se,Be)|0,b=b+Math.imul(R,Ne)|0,u=u+Math.imul(R,Le)|0,u=u+Math.imul(C,Ne)|0,S=S+Math.imul(C,Le)|0,b=b+Math.imul(W,Pe)|0,u=u+Math.imul(W,Oe)|0,u=u+Math.imul(Z,Pe)|0,S=S+Math.imul(Z,Oe)|0,b=b+Math.imul(J,Fe)|0,u=u+Math.imul(J,De)|0,u=u+Math.imul(A,Fe)|0,S=S+Math.imul(A,De)|0;var Xt=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(h,ae),u=Math.imul(h,ie),u=u+Math.imul(v,ae)|0,S=Math.imul(v,ie),b=b+Math.imul(_e,ne)|0,u=u+Math.imul(_e,Ce)|0,u=u+Math.imul(m,ne)|0,S=S+Math.imul(m,Ce)|0,b=b+Math.imul(ve,ke)|0,u=u+Math.imul(ve,Ie)|0,u=u+Math.imul(Re,ke)|0,S=S+Math.imul(Re,Ie)|0,b=b+Math.imul(Se,xe)|0,u=u+Math.imul(Se,Ae)|0,u=u+Math.imul(Ee,xe)|0,S=S+Math.imul(Ee,Ae)|0,b=b+Math.imul(re,Te)|0,u=u+Math.imul(re,Be)|0,u=u+Math.imul(be,Te)|0,S=S+Math.imul(be,Be)|0,b=b+Math.imul(G,Ne)|0,u=u+Math.imul(G,Le)|0,u=u+Math.imul(se,Ne)|0,S=S+Math.imul(se,Le)|0,b=b+Math.imul(R,Pe)|0,u=u+Math.imul(R,Oe)|0,u=u+Math.imul(C,Pe)|0,S=S+Math.imul(C,Oe)|0,b=b+Math.imul(W,Fe)|0,u=u+Math.imul(W,De)|0,u=u+Math.imul(Z,Fe)|0,S=S+Math.imul(Z,De)|0,b=b+Math.imul(J,je)|0,u=u+Math.imul(J,Ue)|0,u=u+Math.imul(A,je)|0,S=S+Math.imul(A,Ue)|0;var er=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(F,ae),u=Math.imul(F,ie),u=u+Math.imul(U,ae)|0,S=Math.imul(U,ie),b=b+Math.imul(h,ne)|0,u=u+Math.imul(h,Ce)|0,u=u+Math.imul(v,ne)|0,S=S+Math.imul(v,Ce)|0,b=b+Math.imul(_e,ke)|0,u=u+Math.imul(_e,Ie)|0,u=u+Math.imul(m,ke)|0,S=S+Math.imul(m,Ie)|0,b=b+Math.imul(ve,xe)|0,u=u+Math.imul(ve,Ae)|0,u=u+Math.imul(Re,xe)|0,S=S+Math.imul(Re,Ae)|0,b=b+Math.imul(Se,Te)|0,u=u+Math.imul(Se,Be)|0,u=u+Math.imul(Ee,Te)|0,S=S+Math.imul(Ee,Be)|0,b=b+Math.imul(re,Ne)|0,u=u+Math.imul(re,Le)|0,u=u+Math.imul(be,Ne)|0,S=S+Math.imul(be,Le)|0,b=b+Math.imul(G,Pe)|0,u=u+Math.imul(G,Oe)|0,u=u+Math.imul(se,Pe)|0,S=S+Math.imul(se,Oe)|0,b=b+Math.imul(R,Fe)|0,u=u+Math.imul(R,De)|0,u=u+Math.imul(C,Fe)|0,S=S+Math.imul(C,De)|0,b=b+Math.imul(W,je)|0,u=u+Math.imul(W,Ue)|0,u=u+Math.imul(Z,je)|0,S=S+Math.imul(Z,Ue)|0,b=b+Math.imul(J,He)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(A,He)|0,S=S+Math.imul(A,$e)|0;var tr=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(F,ne),u=Math.imul(F,Ce),u=u+Math.imul(U,ne)|0,S=Math.imul(U,Ce),b=b+Math.imul(h,ke)|0,u=u+Math.imul(h,Ie)|0,u=u+Math.imul(v,ke)|0,S=S+Math.imul(v,Ie)|0,b=b+Math.imul(_e,xe)|0,u=u+Math.imul(_e,Ae)|0,u=u+Math.imul(m,xe)|0,S=S+Math.imul(m,Ae)|0,b=b+Math.imul(ve,Te)|0,u=u+Math.imul(ve,Be)|0,u=u+Math.imul(Re,Te)|0,S=S+Math.imul(Re,Be)|0,b=b+Math.imul(Se,Ne)|0,u=u+Math.imul(Se,Le)|0,u=u+Math.imul(Ee,Ne)|0,S=S+Math.imul(Ee,Le)|0,b=b+Math.imul(re,Pe)|0,u=u+Math.imul(re,Oe)|0,u=u+Math.imul(be,Pe)|0,S=S+Math.imul(be,Oe)|0,b=b+Math.imul(G,Fe)|0,u=u+Math.imul(G,De)|0,u=u+Math.imul(se,Fe)|0,S=S+Math.imul(se,De)|0,b=b+Math.imul(R,je)|0,u=u+Math.imul(R,Ue)|0,u=u+Math.imul(C,je)|0,S=S+Math.imul(C,Ue)|0,b=b+Math.imul(W,He)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(Z,He)|0,S=S+Math.imul(Z,$e)|0;var rr=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul(F,ke),u=Math.imul(F,Ie),u=u+Math.imul(U,ke)|0,S=Math.imul(U,Ie),b=b+Math.imul(h,xe)|0,u=u+Math.imul(h,Ae)|0,u=u+Math.imul(v,xe)|0,S=S+Math.imul(v,Ae)|0,b=b+Math.imul(_e,Te)|0,u=u+Math.imul(_e,Be)|0,u=u+Math.imul(m,Te)|0,S=S+Math.imul(m,Be)|0,b=b+Math.imul(ve,Ne)|0,u=u+Math.imul(ve,Le)|0,u=u+Math.imul(Re,Ne)|0,S=S+Math.imul(Re,Le)|0,b=b+Math.imul(Se,Pe)|0,u=u+Math.imul(Se,Oe)|0,u=u+Math.imul(Ee,Pe)|0,S=S+Math.imul(Ee,Oe)|0,b=b+Math.imul(re,Fe)|0,u=u+Math.imul(re,De)|0,u=u+Math.imul(be,Fe)|0,S=S+Math.imul(be,De)|0,b=b+Math.imul(G,je)|0,u=u+Math.imul(G,Ue)|0,u=u+Math.imul(se,je)|0,S=S+Math.imul(se,Ue)|0,b=b+Math.imul(R,He)|0,u=u+Math.imul(R,$e)|0,u=u+Math.imul(C,He)|0,S=S+Math.imul(C,$e)|0;var nr=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul(F,xe),u=Math.imul(F,Ae),u=u+Math.imul(U,xe)|0,S=Math.imul(U,Ae),b=b+Math.imul(h,Te)|0,u=u+Math.imul(h,Be)|0,u=u+Math.imul(v,Te)|0,S=S+Math.imul(v,Be)|0,b=b+Math.imul(_e,Ne)|0,u=u+Math.imul(_e,Le)|0,u=u+Math.imul(m,Ne)|0,S=S+Math.imul(m,Le)|0,b=b+Math.imul(ve,Pe)|0,u=u+Math.imul(ve,Oe)|0,u=u+Math.imul(Re,Pe)|0,S=S+Math.imul(Re,Oe)|0,b=b+Math.imul(Se,Fe)|0,u=u+Math.imul(Se,De)|0,u=u+Math.imul(Ee,Fe)|0,S=S+Math.imul(Ee,De)|0,b=b+Math.imul(re,je)|0,u=u+Math.imul(re,Ue)|0,u=u+Math.imul(be,je)|0,S=S+Math.imul(be,Ue)|0,b=b+Math.imul(G,He)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(se,He)|0,S=S+Math.imul(se,$e)|0;var ir=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul(F,Te),u=Math.imul(F,Be),u=u+Math.imul(U,Te)|0,S=Math.imul(U,Be),b=b+Math.imul(h,Ne)|0,u=u+Math.imul(h,Le)|0,u=u+Math.imul(v,Ne)|0,S=S+Math.imul(v,Le)|0,b=b+Math.imul(_e,Pe)|0,u=u+Math.imul(_e,Oe)|0,u=u+Math.imul(m,Pe)|0,S=S+Math.imul(m,Oe)|0,b=b+Math.imul(ve,Fe)|0,u=u+Math.imul(ve,De)|0,u=u+Math.imul(Re,Fe)|0,S=S+Math.imul(Re,De)|0,b=b+Math.imul(Se,je)|0,u=u+Math.imul(Se,Ue)|0,u=u+Math.imul(Ee,je)|0,S=S+Math.imul(Ee,Ue)|0,b=b+Math.imul(re,He)|0,u=u+Math.imul(re,$e)|0,u=u+Math.imul(be,He)|0,S=S+Math.imul(be,$e)|0;var sr=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(F,Ne),u=Math.imul(F,Le),u=u+Math.imul(U,Ne)|0,S=Math.imul(U,Le),b=b+Math.imul(h,Pe)|0,u=u+Math.imul(h,Oe)|0,u=u+Math.imul(v,Pe)|0,S=S+Math.imul(v,Oe)|0,b=b+Math.imul(_e,Fe)|0,u=u+Math.imul(_e,De)|0,u=u+Math.imul(m,Fe)|0,S=S+Math.imul(m,De)|0,b=b+Math.imul(ve,je)|0,u=u+Math.imul(ve,Ue)|0,u=u+Math.imul(Re,je)|0,S=S+Math.imul(Re,Ue)|0,b=b+Math.imul(Se,He)|0,u=u+Math.imul(Se,$e)|0,u=u+Math.imul(Ee,He)|0,S=S+Math.imul(Ee,$e)|0;var es=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(es>>>26)|0,es&=67108863,b=Math.imul(F,Pe),u=Math.imul(F,Oe),u=u+Math.imul(U,Pe)|0,S=Math.imul(U,Oe),b=b+Math.imul(h,Fe)|0,u=u+Math.imul(h,De)|0,u=u+Math.imul(v,Fe)|0,S=S+Math.imul(v,De)|0,b=b+Math.imul(_e,je)|0,u=u+Math.imul(_e,Ue)|0,u=u+Math.imul(m,je)|0,S=S+Math.imul(m,Ue)|0,b=b+Math.imul(ve,He)|0,u=u+Math.imul(ve,$e)|0,u=u+Math.imul(Re,He)|0,S=S+Math.imul(Re,$e)|0;var ts=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(ts>>>26)|0,ts&=67108863,b=Math.imul(F,Fe),u=Math.imul(F,De),u=u+Math.imul(U,Fe)|0,S=Math.imul(U,De),b=b+Math.imul(h,je)|0,u=u+Math.imul(h,Ue)|0,u=u+Math.imul(v,je)|0,S=S+Math.imul(v,Ue)|0,b=b+Math.imul(_e,He)|0,u=u+Math.imul(_e,$e)|0,u=u+Math.imul(m,He)|0,S=S+Math.imul(m,$e)|0;var rs=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(rs>>>26)|0,rs&=67108863,b=Math.imul(F,je),u=Math.imul(F,Ue),u=u+Math.imul(U,je)|0,S=Math.imul(U,Ue),b=b+Math.imul(h,He)|0,u=u+Math.imul(h,$e)|0,u=u+Math.imul(v,He)|0,S=S+Math.imul(v,$e)|0;var ns=(T+b|0)+((u&8191)<<13)|0;T=(S+(u>>>13)|0)+(ns>>>26)|0,ns&=67108863,b=Math.imul(F,He),u=Math.imul(F,$e),u=u+Math.imul(U,He)|0,S=Math.imul(U,$e);var is=(T+b|0)+((u&8191)<<13)|0;return T=(S+(u>>>13)|0)+(is>>>26)|0,is&=67108863,k[0]=qt,k[1]=Gt,k[2]=Jt,k[3]=Zt,k[4]=Kt,k[5]=Qt,k[6]=Yt,k[7]=Xt,k[8]=er,k[9]=tr,k[10]=rr,k[11]=nr,k[12]=ir,k[13]=sr,k[14]=es,k[15]=ts,k[16]=rs,k[17]=ns,k[18]=is,T!==0&&(k[19]=T,w.length++),w};Math.imul||(L=x);function O(I,o,d){d.negative=o.negative^I.negative,d.length=I.length+o.length;for(var w=0,y=0,_=0;_<d.length-1;_++){var k=y;y=0;for(var T=w&67108863,b=Math.min(_,o.length-1),u=Math.max(0,_-I.length+1);u<=b;u++){var S=_-u,K=I.words[S]|0,J=o.words[u]|0,A=K*J,P=A&67108863;k=k+(A/67108864|0)|0,P=P+T|0,T=P&67108863,k=k+(P>>>26)|0,y+=k>>>26,k&=67108863}d.words[_]=T,w=k,k=y}return w!==0?d.words[_]=w:d.length--,d._strip()}function V(I,o,d){return O(I,o,d)}s.prototype.mulTo=function(o,d){var w,y=this.length+o.length;return this.length===10&&o.length===10?w=L(this,o,d):y<63?w=x(this,o,d):y<1024?w=O(this,o,d):w=V(this,o,d),w},s.prototype.mul=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),this.mulTo(o,d)},s.prototype.mulf=function(o){var d=new s(null);return d.words=new Array(this.length+o.length),V(this,o,d)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var d=o<0;d&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var w=0,y=0;y<this.length;y++){var _=(this.words[y]|0)*o,k=(_&67108863)+(w&67108863);w>>=26,w+=_/67108864|0,w+=k>>>26,this.words[y]=k&67108863}return w!==0&&(this.words[y]=w,this.length++),this.length=o===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var d=$(o);if(d.length===0)return new s(1);for(var w=this,y=0;y<d.length&&d[y]===0;y++,w=w.sqr());if(++y<d.length)for(var _=w.sqr();y<d.length;y++,_=_.sqr())d[y]!==0&&(w=w.mul(_));return w},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var d=o%26,w=(o-d)/26,y=67108863>>>26-d<<26-d,_;if(d!==0){var k=0;for(_=0;_<this.length;_++){var T=this.words[_]&y,b=(this.words[_]|0)-T<<d;this.words[_]=b|k,k=T>>>26-d}k&&(this.words[_]=k,this.length++)}if(w!==0){for(_=this.length-1;_>=0;_--)this.words[_+w]=this.words[_];for(_=0;_<w;_++)this.words[_]=0;this.length+=w}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,d,w){n(typeof o=="number"&&o>=0);var y;d?y=(d-d%26)/26:y=0;var _=o%26,k=Math.min((o-_)/26,this.length),T=67108863^67108863>>>_<<_,b=w;if(y-=k,y=Math.max(0,y),b){for(var u=0;u<k;u++)b.words[u]=this.words[u];b.length=k}if(k!==0)if(this.length>k)for(this.length-=k,u=0;u<this.length;u++)this.words[u]=this.words[u+k];else this.words[0]=0,this.length=1;var S=0;for(u=this.length-1;u>=0&&(S!==0||u>=y);u--){var K=this.words[u]|0;this.words[u]=S<<26-_|K>>>_,S=K&T}return b&&S!==0&&(b.words[b.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,d,w){return n(this.negative===0),this.iushrn(o,d,w)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,w=(o-d)/26,y=1<<d;if(this.length<=w)return!1;var _=this.words[w];return!!(_&y)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,w=(o-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=w)return this;if(d!==0&&w++,this.length=Math.min(w,this.length),d!==0){var y=67108863^67108863>>>d<<d;this.words[this.length-1]&=y}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.maskn=function(o){return this.clone().imaskn(o)},s.prototype.iaddn=function(o){return n(typeof o=="number"),n(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},s.prototype._iaddn=function(o){this.words[0]+=o;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(o){return this.clone().iaddn(o)},s.prototype.subn=function(o){return this.clone().isubn(o)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(o,d,w){var y=o.length+w,_;this._expand(y);var k,T=0;for(_=0;_<o.length;_++){k=(this.words[_+w]|0)+T;var b=(o.words[_]|0)*d;k-=b&67108863,T=(k>>26)-(b/67108864|0),this.words[_+w]=k&67108863}for(;_<this.length-w;_++)k=(this.words[_+w]|0)+T,T=k>>26,this.words[_+w]=k&67108863;if(T===0)return this._strip();for(n(T===-1),T=0,_=0;_<this.length;_++)k=-(this.words[_]|0)+T,T=k>>26,this.words[_]=k&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,d){var w=this.length-o.length,y=this.clone(),_=o,k=_.words[_.length-1]|0,T=this._countBits(k);w=26-T,w!==0&&(_=_.ushln(w),y.iushln(w),k=_.words[_.length-1]|0);var b=y.length-_.length,u;if(d!=="mod"){u=new s(null),u.length=b+1,u.words=new Array(u.length);for(var S=0;S<u.length;S++)u.words[S]=0}var K=y.clone()._ishlnsubmul(_,1,b);K.negative===0&&(y=K,u&&(u.words[b]=1));for(var J=b-1;J>=0;J--){var A=(y.words[_.length+J]|0)*67108864+(y.words[_.length+J-1]|0);for(A=Math.min(A/k|0,67108863),y._ishlnsubmul(_,A,J);y.negative!==0;)A--,y.negative=0,y._ishlnsubmul(_,1,J),y.isZero()||(y.negative^=1);u&&(u.words[J]=A)}return u&&u._strip(),y._strip(),d!=="div"&&w!==0&&y.iushrn(w),{div:u||null,mod:y}},s.prototype.divmod=function(o,d,w){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var y,_,k;return this.negative!==0&&o.negative===0?(k=this.neg().divmod(o,d),d!=="mod"&&(y=k.div.neg()),d!=="div"&&(_=k.mod.neg(),w&&_.negative!==0&&_.iadd(o)),{div:y,mod:_}):this.negative===0&&o.negative!==0?(k=this.divmod(o.neg(),d),d!=="mod"&&(y=k.div.neg()),{div:y,mod:k.mod}):this.negative&o.negative?(k=this.neg().divmod(o.neg(),d),d!=="div"&&(_=k.mod.neg(),w&&_.negative!==0&&_.isub(o)),{div:k.div,mod:_}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?d==="div"?{div:this.divn(o.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,d)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var d=this.divmod(o);if(d.mod.isZero())return d.div;var w=d.div.negative!==0?d.mod.isub(o):d.mod,y=o.ushrn(1),_=o.andln(1),k=w.cmp(y);return k<0||_===1&&k===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var w=(1<<26)%o,y=0,_=this.length-1;_>=0;_--)y=(w*y+(this.words[_]|0))%o;return d?-y:y},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var d=o<0;d&&(o=-o),n(o<=67108863);for(var w=0,y=this.length-1;y>=0;y--){var _=(this.words[y]|0)+w*67108864;this.words[y]=_/o|0,w=_%o}return this._strip(),d?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var d=this,w=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var y=new s(1),_=new s(0),k=new s(0),T=new s(1),b=0;d.isEven()&&w.isEven();)d.iushrn(1),w.iushrn(1),++b;for(var u=w.clone(),S=d.clone();!d.isZero();){for(var K=0,J=1;!(d.words[0]&J)&&K<26;++K,J<<=1);if(K>0)for(d.iushrn(K);K-- >0;)(y.isOdd()||_.isOdd())&&(y.iadd(u),_.isub(S)),y.iushrn(1),_.iushrn(1);for(var A=0,P=1;!(w.words[0]&P)&&A<26;++A,P<<=1);if(A>0)for(w.iushrn(A);A-- >0;)(k.isOdd()||T.isOdd())&&(k.iadd(u),T.isub(S)),k.iushrn(1),T.iushrn(1);d.cmp(w)>=0?(d.isub(w),y.isub(k),_.isub(T)):(w.isub(d),k.isub(y),T.isub(_))}return{a:k,b:T,gcd:w.iushln(b)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var d=this,w=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var y=new s(1),_=new s(0),k=w.clone();d.cmpn(1)>0&&w.cmpn(1)>0;){for(var T=0,b=1;!(d.words[0]&b)&&T<26;++T,b<<=1);if(T>0)for(d.iushrn(T);T-- >0;)y.isOdd()&&y.iadd(k),y.iushrn(1);for(var u=0,S=1;!(w.words[0]&S)&&u<26;++u,S<<=1);if(u>0)for(w.iushrn(u);u-- >0;)_.isOdd()&&_.iadd(k),_.iushrn(1);d.cmp(w)>=0?(d.isub(w),y.isub(_)):(w.isub(d),_.isub(y))}var K;return d.cmpn(1)===0?K=y:K=_,K.cmpn(0)<0&&K.iadd(o),K},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var d=this.clone(),w=o.clone();d.negative=0,w.negative=0;for(var y=0;d.isEven()&&w.isEven();y++)d.iushrn(1),w.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;w.isEven();)w.iushrn(1);var _=d.cmp(w);if(_<0){var k=d;d=w,w=k}else if(_===0||w.cmpn(1)===0)break;d.isub(w)}while(!0);return w.iushln(y)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var d=o%26,w=(o-d)/26,y=1<<d;if(this.length<=w)return this._expand(w+1),this.words[w]|=y,this;for(var _=y,k=w;_!==0&&k<this.length;k++){var T=this.words[k]|0;T+=_,_=T>>>26,T&=67108863,this.words[k]=T}return _!==0&&(this.words[k]=_,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var d=o<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var w;if(this.length>1)w=1;else{d&&(o=-o),n(o<=67108863,"Number is too big");var y=this.words[0]|0;w=y===o?0:y<o?-1:1}return this.negative!==0?-w|0:w},s.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var d=this.ucmp(o);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var d=0,w=this.length-1;w>=0;w--){var y=this.words[w]|0,_=o.words[w]|0;if(y!==_){y<_?d=-1:y>_&&(d=1);break}}return d},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new oe(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var j={k256:null,p224:null,p192:null,p25519:null};function q(I,o){this.name=I,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},q.prototype.ireduce=function(o){var d=o,w;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),w=d.bitLength();while(w>this.n);var y=w<this.n?-1:d.ucmp(this.p);return y===0?(d.words[0]=0,d.length=1):y>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},q.prototype.split=function(o,d){o.iushrn(this.n,0,d)},q.prototype.imulK=function(o){return o.imul(this.k)};function te(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(te,q),te.prototype.split=function(o,d){for(var w=4194303,y=Math.min(o.length,9),_=0;_<y;_++)d.words[_]=o.words[_];if(d.length=y,o.length<=9){o.words[0]=0,o.length=1;return}var k=o.words[9];for(d.words[d.length++]=k&w,_=10;_<o.length;_++){var T=o.words[_]|0;o.words[_-10]=(T&w)<<4|k>>>22,k=T}k>>>=22,o.words[_-10]=k,k===0&&o.length>10?o.length-=10:o.length-=9},te.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var d=0,w=0;w<o.length;w++){var y=o.words[w]|0;d+=y*977,o.words[w]=d&67108863,d=y*64+(d/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Y(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Y,q);function Q(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Q,q);function fe(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(fe,q),fe.prototype.imulK=function(o){for(var d=0,w=0;w<o.length;w++){var y=(o.words[w]|0)*19+d,_=y&67108863;y>>>=26,o.words[w]=_,d=y}return d!==0&&(o.words[o.length++]=d),o},s._prime=function(o){if(j[o])return j[o];var d;if(o==="k256")d=new te;else if(o==="p224")d=new Y;else if(o==="p192")d=new Q;else if(o==="p25519")d=new fe;else throw new Error("Unknown prime "+o);return j[o]=d,d};function oe(I){if(typeof I=="string"){var o=s._prime(I);this.m=o.p,this.prime=o}else n(I.gtn(1),"modulus must be greater than 1"),this.m=I,this.prime=null}oe.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},oe.prototype._verify2=function(o,d){n((o.negative|d.negative)===0,"red works only with positives"),n(o.red&&o.red===d.red,"red works only with red numbers")},oe.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(p(o,o.umod(this.m)._forceRed(this)),o)},oe.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},oe.prototype.add=function(o,d){this._verify2(o,d);var w=o.add(d);return w.cmp(this.m)>=0&&w.isub(this.m),w._forceRed(this)},oe.prototype.iadd=function(o,d){this._verify2(o,d);var w=o.iadd(d);return w.cmp(this.m)>=0&&w.isub(this.m),w},oe.prototype.sub=function(o,d){this._verify2(o,d);var w=o.sub(d);return w.cmpn(0)<0&&w.iadd(this.m),w._forceRed(this)},oe.prototype.isub=function(o,d){this._verify2(o,d);var w=o.isub(d);return w.cmpn(0)<0&&w.iadd(this.m),w},oe.prototype.shl=function(o,d){return this._verify1(o),this.imod(o.ushln(d))},oe.prototype.imul=function(o,d){return this._verify2(o,d),this.imod(o.imul(d))},oe.prototype.mul=function(o,d){return this._verify2(o,d),this.imod(o.mul(d))},oe.prototype.isqr=function(o){return this.imul(o,o.clone())},oe.prototype.sqr=function(o){return this.mul(o,o)},oe.prototype.sqrt=function(o){if(o.isZero())return o.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var w=this.m.add(new s(1)).iushrn(2);return this.pow(o,w)}for(var y=this.m.subn(1),_=0;!y.isZero()&&y.andln(1)===0;)_++,y.iushrn(1);n(!y.isZero());var k=new s(1).toRed(this),T=k.redNeg(),b=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);this.pow(u,b).cmp(T)!==0;)u.redIAdd(T);for(var S=this.pow(u,y),K=this.pow(o,y.addn(1).iushrn(1)),J=this.pow(o,y),A=_;J.cmp(k)!==0;){for(var P=J,W=0;P.cmp(k)!==0;W++)P=P.redSqr();n(W<A);var Z=this.pow(S,new s(1).iushln(A-W-1));K=K.redMul(Z),S=Z.redSqr(),J=J.redMul(S),A=W}return K},oe.prototype.invm=function(o){var d=o._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},oe.prototype.pow=function(o,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return o.clone();var w=4,y=new Array(1<<w);y[0]=new s(1).toRed(this),y[1]=o;for(var _=2;_<y.length;_++)y[_]=this.mul(y[_-1],o);var k=y[0],T=0,b=0,u=d.bitLength()%26;for(u===0&&(u=26),_=d.length-1;_>=0;_--){for(var S=d.words[_],K=u-1;K>=0;K--){var J=S>>K&1;if(k!==y[0]&&(k=this.sqr(k)),J===0&&T===0){b=0;continue}T<<=1,T|=J,b++,!(b!==w&&(_!==0||K!==0))&&(k=this.mul(k,y[T]),b=0,T=0)}u=26}return k},oe.prototype.convertTo=function(o){var d=o.umod(this.m);return d===o?d.clone():d},oe.prototype.convertFrom=function(o){var d=o.clone();return d.red=null,d},s.mont=function(o){return new pe(o)};function pe(I){oe.call(this,I),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(pe,oe),pe.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},pe.prototype.convertFrom=function(o){var d=this.imod(o.mul(this.rinv));return d.red=null,d},pe.prototype.imul=function(o,d){if(o.isZero()||d.isZero())return o.words[0]=0,o.length=1,o;var w=o.imul(d),y=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=w.isub(y).iushrn(this.shift),k=_;return _.cmp(this.m)>=0?k=_.isub(this.m):_.cmpn(0)<0&&(k=_.iadd(this.m)),k._forceRed(this)},pe.prototype.mul=function(o,d){if(o.isZero()||d.isZero())return new s(0)._forceRed(this);var w=o.mul(d),y=w.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=w.isub(y).iushrn(this.shift),k=_;return _.cmp(this.m)>=0?k=_.isub(this.m):_.cmpn(0)<0&&(k=_.iadd(this.m)),k._forceRed(this)},pe.prototype.invm=function(o){var d=this.imod(o._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,ee)})(qs);var ai=qs.exports,fn={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.errorValues=Ft.standardErrorCodes=void 0;Ft.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Ft.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var ci={},li={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ft,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(E,N=r){if(E&&Number.isInteger(E)){const H=E.toString();if(p(t.errorValues,H))return t.errorValues[H].message;if(f(E))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return N}e.getMessageFromCode=n;function i(E){if(!Number.isInteger(E))return!1;const N=E.toString();return!!(t.errorValues[N]||f(E))}e.isValidCode=i;function s(E){var N;if(typeof E=="number")return E;if(c(E))return(N=E.code)!==null&&N!==void 0?N:E.errorCode}e.getErrorCode=s;function c(E){return typeof E=="object"&&E!==null&&(typeof E.code=="number"||typeof E.errorCode=="number")}function a(E,{shouldIncludeStack:N=!1}={}){const H={};if(E&&typeof E=="object"&&!Array.isArray(E)&&p(E,"code")&&i(E.code)){const D=E;H.code=D.code,D.message&&typeof D.message=="string"?(H.message=D.message,p(D,"data")&&(H.data=D.data)):(H.message=n(H.code),H.data={originalError:g(E)})}else H.code=t.standardErrorCodes.rpc.internal,H.message=M(E,"message")?E.message:r,H.data={originalError:g(E)};return N&&(H.stack=M(E,"stack")?E.stack:void 0),H}e.serialize=a;function f(E){return E>=-32099&&E<=-32e3}function g(E){return E&&typeof E=="object"&&!Array.isArray(E)?Object.assign({},E):E}function p(E,N){return Object.prototype.hasOwnProperty.call(E,N)}function M(E,N){return typeof E=="object"&&E!==null&&N in E&&typeof E[N]=="string"}})(li);Object.defineProperty(ci,"__esModule",{value:!0});ci.standardErrors=void 0;const et=Ft,Ja=li;ci.standardErrors={rpc:{parse:e=>dt(et.standardErrorCodes.rpc.parse,e),invalidRequest:e=>dt(et.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>dt(et.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>dt(et.standardErrorCodes.rpc.methodNotFound,e),internal:e=>dt(et.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return dt(t,e)},invalidInput:e=>dt(et.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>dt(et.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>dt(et.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>dt(et.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>dt(et.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>dt(et.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>xr(et.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>xr(et.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>xr(et.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>xr(et.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>xr(et.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>xr(et.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Qa(t,r,n)}}};function dt(e,t){const[r,n]=Za(t);return new Ka(e,r||(0,Ja.getMessageFromCode)(e),n)}function xr(e,t){const[r,n]=Za(t);return new Qa(e,r||(0,Ja.getMessageFromCode)(e),n)}function Za(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Ka=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},Qa=class extends Ka{constructor(t,r,n){if(!iu(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function iu(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var ui={},Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isErrorResponse=void 0;function su(e){return e.errorMessage!==void 0}Jr.isErrorResponse=su;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.LIB_VERSION=void 0;Zr.LIB_VERSION="3.9.3";Object.defineProperty(ui,"__esModule",{value:!0});ui.serializeError=void 0;const ou=Jr,au=Zr,cu=Ft,lu=li;function uu(e,t){const r=(0,lu.serialize)(hu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",au.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=du(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ui.serializeError=uu;function hu(e){return typeof e=="string"?{message:e,code:cu.standardErrorCodes.rpc.internal}:(0,ou.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function du(e,t){const r=e?.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ft;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=ci;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=ui;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=li;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(fn);var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.ProviderType=Ze.RegExpString=Ze.IntNumber=Ze.BigIntString=Ze.AddressString=Ze.HexString=Ze.OpaqueType=void 0;function pn(){return e=>e}Ze.OpaqueType=pn;Ze.HexString=pn();Ze.AddressString=pn();Ze.BigIntString=pn();function fu(e){return Math.floor(e)}Ze.IntNumber=fu;Ze.RegExpString=pn();var Co;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Co||(Ze.ProviderType=Co={}));var pu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.isMobileWeb=X.getLocation=X.isInIFrame=X.createQrUrl=X.getFavicon=X.range=X.isBigNumber=X.ensureParsedJSONObject=X.ensureBN=X.ensureRegExpString=X.ensureIntNumber=X.ensureBuffer=X.ensureAddressString=X.ensureEvenLengthHexString=X.ensureHexString=X.isHexString=X.prepend0x=X.strip0x=X.has0xPrefix=X.hexStringFromIntNumber=X.intNumberFromHexString=X.bigIntStringFromBN=X.hexStringFromBuffer=X.hexStringToUint8Array=X.uint8ArrayToHex=X.randomBytesHex=void 0;const $t=pu(ai),wr=fn,wt=Ze,Ya=/^[0-9]*$/,Xa=/^[a-f0-9]*$/;function gu(e){return ec(crypto.getRandomValues(new Uint8Array(e)))}X.randomBytesHex=gu;function ec(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=ec;function mu(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}X.hexStringToUint8Array=mu;function wu(e,t=!1){const r=e.toString("hex");return(0,wt.HexString)(t?`0x${r}`:r)}X.hexStringFromBuffer=wu;function yu(e){return(0,wt.BigIntString)(e.toString(10))}X.bigIntStringFromBN=yu;function bu(e){return(0,wt.IntNumber)(new $t.default(mn(e,!1),16).toNumber())}X.intNumberFromHexString=bu;function vu(e){return(0,wt.HexString)(`0x${new $t.default(e).toString(16)}`)}X.hexStringFromIntNumber=vu;function Gs(e){return e.startsWith("0x")||e.startsWith("0X")}X.has0xPrefix=Gs;function hi(e){return Gs(e)?e.slice(2):e}X.strip0x=hi;function tc(e){return Gs(e)?`0x${e.slice(2)}`:`0x${e}`}X.prepend0x=tc;function gn(e){if(typeof e!="string")return!1;const t=hi(e).toLowerCase();return Xa.test(t)}X.isHexString=gn;function rc(e,t=!1){if(typeof e=="string"){const r=hi(e).toLowerCase();if(Xa.test(r))return(0,wt.HexString)(t?`0x${r}`:r)}throw wr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}X.ensureHexString=rc;function mn(e,t=!1){let r=rc(e,!1);return r.length%2===1&&(r=(0,wt.HexString)(`0${r}`)),t?(0,wt.HexString)(`0x${r}`):r}X.ensureEvenLengthHexString=mn;function _u(e){if(typeof e=="string"){const t=hi(e).toLowerCase();if(gn(t)&&t.length===40)return(0,wt.AddressString)(tc(t))}throw wr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}X.ensureAddressString=_u;function Eu(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(gn(e)){const t=mn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw wr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}X.ensureBuffer=Eu;function nc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,wt.IntNumber)(e);if(typeof e=="string"){if(Ya.test(e))return(0,wt.IntNumber)(Number(e));if(gn(e))return(0,wt.IntNumber)(new $t.default(mn(e,!1),16).toNumber())}throw wr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureIntNumber=nc;function Su(e){if(e instanceof RegExp)return(0,wt.RegExpString)(e.toString());throw wr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}X.ensureRegExpString=Su;function Ru(e){if(e!==null&&($t.default.isBN(e)||ic(e)))return new $t.default(e.toString(10),10);if(typeof e=="number")return new $t.default(nc(e));if(typeof e=="string"){if(Ya.test(e))return new $t.default(e,10);if(gn(e))return new $t.default(mn(e,!1),16)}throw wr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureBN=Ru;function Mu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw wr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}X.ensureParsedJSONObject=Mu;function ic(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}X.isBigNumber=ic;function Cu(e,t){return Array.from({length:t-e},(r,n)=>e+n)}X.range=Cu;function ku(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}X.getFavicon=ku;function Iu(e,t,r,n,i,s){const c=n?"parent-id":"id",a=new URLSearchParams({[c]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${a}`}X.createQrUrl=Iu;function sc(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=sc;function xu(){try{return sc()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=xu;function Au(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window?.navigator)===null||e===void 0?void 0:e.userAgent)}X.isMobileWeb=Au;var di={};Object.defineProperty(di,"__esModule",{value:!0});di.ScopedLocalStorage=void 0;class Tu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}di.ScopedLocalStorage=Tu;var Hr={},wn={},yn={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.EVENTS=void 0;Kr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.RelayAbstract=mt.APP_VERSION_KEY=mt.LOCAL_STORAGE_ADDRESSES_KEY=mt.WALLET_USER_NAME_KEY=void 0;const ko=fn;mt.WALLET_USER_NAME_KEY="walletUsername";mt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";mt.APP_VERSION_KEY="AppVersion";class Bu{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw ko.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,ko.serializeError)(s,t.method);return i})}}mt.RelayAbstract=Bu;var Qr={},oc={exports:{}},Ps={exports:{}},bn={},fi={};fi.byteLength=Pu;fi.toByteArray=Fu;fi.fromByteArray=Uu;var At=[],gt=[],Nu=typeof Uint8Array<"u"?Uint8Array:Array,ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ar=0,Lu=ss.length;Ar<Lu;++Ar)At[Ar]=ss[Ar],gt[ss.charCodeAt(Ar)]=Ar;gt[45]=62;gt[95]=63;function ac(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function Pu(e){var t=ac(e),r=t[0],n=t[1];return(r+n)*3/4-n}function Ou(e,t,r){return(t+r)*3/4-r}function Fu(e){var t,r=ac(e),n=r[0],i=r[1],s=new Nu(Ou(e,n,i)),c=0,a=i>0?n-4:n,f;for(f=0;f<a;f+=4)t=gt[e.charCodeAt(f)]<<18|gt[e.charCodeAt(f+1)]<<12|gt[e.charCodeAt(f+2)]<<6|gt[e.charCodeAt(f+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=gt[e.charCodeAt(f)]<<2|gt[e.charCodeAt(f+1)]>>4,s[c++]=t&255),i===1&&(t=gt[e.charCodeAt(f)]<<10|gt[e.charCodeAt(f+1)]<<4|gt[e.charCodeAt(f+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function Du(e){return At[e>>18&63]+At[e>>12&63]+At[e>>6&63]+At[e&63]}function ju(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(e[s+2]&255),i.push(Du(n));return i.join("")}function Uu(e){for(var t,r=e.length,n=r%3,i=[],s=16383,c=0,a=r-n;c<a;c+=s)i.push(ju(e,c,c+s>a?a:c+s));return n===1?(t=e[r-1],i.push(At[t>>2]+At[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(At[t>>10]+At[t>>4&63]+At[t<<2&63]+"=")),i.join("")}var Js={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Js.read=function(e,t,r,n,i){var s,c,a=i*8-n-1,f=(1<<a)-1,g=f>>1,p=-7,M=r?i-1:0,E=r?-1:1,N=e[t+M];for(M+=E,s=N&(1<<-p)-1,N>>=-p,p+=a;p>0;s=s*256+e[t+M],M+=E,p-=8);for(c=s&(1<<-p)-1,s>>=-p,p+=n;p>0;c=c*256+e[t+M],M+=E,p-=8);if(s===0)s=1-g;else{if(s===f)return c?NaN:(N?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-g}return(N?-1:1)*c*Math.pow(2,s-n)};Js.write=function(e,t,r,n,i,s){var c,a,f,g=s*8-i-1,p=(1<<g)-1,M=p>>1,E=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=n?0:s-1,H=n?1:-1,D=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,c=p):(c=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-c))<1&&(c--,f*=2),c+M>=1?t+=E/f:t+=E*Math.pow(2,1-M),t*f>=2&&(c++,f/=2),c+M>=p?(a=0,c=p):c+M>=1?(a=(t*f-1)*Math.pow(2,i),c=c+M):(a=t*Math.pow(2,M-1)*Math.pow(2,i),c=0));i>=8;e[r+N]=a&255,N+=H,a/=256,i-=8);for(c=c<<i|a,g+=i;g>0;e[r+N]=c&255,N+=H,c/=256,g-=8);e[r+N-H]|=D*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(e){const t=fi,r=Js,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=L,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const m=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(m,l),m.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function c(m){if(m>i)throw new RangeError('The value "'+m+'" is invalid for option "size"');const l=new Uint8Array(m);return Object.setPrototypeOf(l,a.prototype),l}function a(m,l,h){if(typeof m=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(m)}return f(m,l,h)}a.poolSize=8192;function f(m,l,h){if(typeof m=="string")return E(m,l);if(ArrayBuffer.isView(m))return H(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(Je(m,ArrayBuffer)||m&&Je(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Je(m,SharedArrayBuffer)||m&&Je(m.buffer,SharedArrayBuffer)))return D(m,l,h);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const v=m.valueOf&&m.valueOf();if(v!=null&&v!==m)return a.from(v,l,h);const B=$(m);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return a.from(m[Symbol.toPrimitive]("string"),l,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}a.from=function(m,l,h){return f(m,l,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function g(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function p(m,l,h){return g(m),m<=0?c(m):l!==void 0?typeof h=="string"?c(m).fill(l,h):c(m).fill(l):c(m)}a.alloc=function(m,l,h){return p(m,l,h)};function M(m){return g(m),c(m<0?0:x(m)|0)}a.allocUnsafe=function(m){return M(m)},a.allocUnsafeSlow=function(m){return M(m)};function E(m,l){if((typeof l!="string"||l==="")&&(l="utf8"),!a.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const h=O(m,l)|0;let v=c(h);const B=v.write(m,l);return B!==h&&(v=v.slice(0,B)),v}function N(m){const l=m.length<0?0:x(m.length)|0,h=c(l);for(let v=0;v<l;v+=1)h[v]=m[v]&255;return h}function H(m){if(Je(m,Uint8Array)){const l=new Uint8Array(m);return D(l.buffer,l.byteOffset,l.byteLength)}return N(m)}function D(m,l,h){if(l<0||m.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<l+(h||0))throw new RangeError('"length" is outside of buffer bounds');let v;return l===void 0&&h===void 0?v=new Uint8Array(m):h===void 0?v=new Uint8Array(m,l):v=new Uint8Array(m,l,h),Object.setPrototypeOf(v,a.prototype),v}function $(m){if(a.isBuffer(m)){const l=x(m.length)|0,h=c(l);return h.length===0||m.copy(h,0,0,l),h}if(m.length!==void 0)return typeof m.length!="number"||ve(m.length)?c(0):N(m);if(m.type==="Buffer"&&Array.isArray(m.data))return N(m.data)}function x(m){if(m>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return m|0}function L(m){return+m!=m&&(m=0),a.alloc(+m)}a.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==a.prototype},a.compare=function(l,h){if(Je(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),Je(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(l)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(l===h)return 0;let v=l.length,B=h.length;for(let F=0,U=Math.min(v,B);F<U;++F)if(l[F]!==h[F]){v=l[F],B=h[F];break}return v<B?-1:B<v?1:0},a.isEncoding=function(l){switch(String(l).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(l,h){if(!Array.isArray(l))throw new TypeError('"list" argument must be an Array of Buffers');if(l.length===0)return a.alloc(0);let v;if(h===void 0)for(h=0,v=0;v<l.length;++v)h+=l[v].length;const B=a.allocUnsafe(h);let F=0;for(v=0;v<l.length;++v){let U=l[v];if(Je(U,Uint8Array))F+U.length>B.length?(a.isBuffer(U)||(U=a.from(U)),U.copy(B,F)):Uint8Array.prototype.set.call(B,U,F);else if(a.isBuffer(U))U.copy(B,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=U.length}return B};function O(m,l){if(a.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||Je(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);const h=m.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&h===0)return 0;let B=!1;for(;;)switch(l){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return re(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Se(m).length;default:if(B)return v?-1:re(m).length;l=(""+l).toLowerCase(),B=!0}}a.byteLength=O;function V(m,l,h){let v=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,l>>>=0,h<=l))return"";for(m||(m="utf8");;)switch(m){case"hex":return k(this,l,h);case"utf8":case"utf-8":return o(this,l,h);case"ascii":return y(this,l,h);case"latin1":case"binary":return _(this,l,h);case"base64":return I(this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,l,h);default:if(v)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),v=!0}}a.prototype._isBuffer=!0;function j(m,l,h){const v=m[l];m[l]=m[h],m[h]=v}a.prototype.swap16=function(){const l=this.length;if(l%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<l;h+=2)j(this,h,h+1);return this},a.prototype.swap32=function(){const l=this.length;if(l%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<l;h+=4)j(this,h,h+3),j(this,h+1,h+2);return this},a.prototype.swap64=function(){const l=this.length;if(l%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<l;h+=8)j(this,h,h+7),j(this,h+1,h+6),j(this,h+2,h+5),j(this,h+3,h+4);return this},a.prototype.toString=function(){const l=this.length;return l===0?"":arguments.length===0?o(this,0,l):V.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(l){if(!a.isBuffer(l))throw new TypeError("Argument must be a Buffer");return this===l?!0:a.compare(this,l)===0},a.prototype.inspect=function(){let l="";const h=e.INSPECT_MAX_BYTES;return l=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(l+=" ... "),"<Buffer "+l+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(l,h,v,B,F){if(Je(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),!a.isBuffer(l))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof l);if(h===void 0&&(h=0),v===void 0&&(v=l?l.length:0),B===void 0&&(B=0),F===void 0&&(F=this.length),h<0||v>l.length||B<0||F>this.length)throw new RangeError("out of range index");if(B>=F&&h>=v)return 0;if(B>=F)return-1;if(h>=v)return 1;if(h>>>=0,v>>>=0,B>>>=0,F>>>=0,this===l)return 0;let U=F-B,he=v-h;const ae=Math.min(U,he),ie=this.slice(B,F),Me=l.slice(h,v);for(let ne=0;ne<ae;++ne)if(ie[ne]!==Me[ne]){U=ie[ne],he=Me[ne];break}return U<he?-1:he<U?1:0};function q(m,l,h,v,B){if(m.length===0)return-1;if(typeof h=="string"?(v=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,ve(h)&&(h=B?0:m.length-1),h<0&&(h=m.length+h),h>=m.length){if(B)return-1;h=m.length-1}else if(h<0)if(B)h=0;else return-1;if(typeof l=="string"&&(l=a.from(l,v)),a.isBuffer(l))return l.length===0?-1:te(m,l,h,v,B);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(m,l,h):Uint8Array.prototype.lastIndexOf.call(m,l,h):te(m,[l],h,v,B);throw new TypeError("val must be string, number or Buffer")}function te(m,l,h,v,B){let F=1,U=m.length,he=l.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(m.length<2||l.length<2)return-1;F=2,U/=2,he/=2,h/=2}function ae(Me,ne){return F===1?Me[ne]:Me.readUInt16BE(ne*F)}let ie;if(B){let Me=-1;for(ie=h;ie<U;ie++)if(ae(m,ie)===ae(l,Me===-1?0:ie-Me)){if(Me===-1&&(Me=ie),ie-Me+1===he)return Me*F}else Me!==-1&&(ie-=ie-Me),Me=-1}else for(h+he>U&&(h=U-he),ie=h;ie>=0;ie--){let Me=!0;for(let ne=0;ne<he;ne++)if(ae(m,ie+ne)!==ae(l,ne)){Me=!1;break}if(Me)return ie}return-1}a.prototype.includes=function(l,h,v){return this.indexOf(l,h,v)!==-1},a.prototype.indexOf=function(l,h,v){return q(this,l,h,v,!0)},a.prototype.lastIndexOf=function(l,h,v){return q(this,l,h,v,!1)};function Y(m,l,h,v){h=Number(h)||0;const B=m.length-h;v?(v=Number(v),v>B&&(v=B)):v=B;const F=l.length;v>F/2&&(v=F/2);let U;for(U=0;U<v;++U){const he=parseInt(l.substr(U*2,2),16);if(ve(he))return U;m[h+U]=he}return U}function Q(m,l,h,v){return Ee(re(l,m.length-h),m,h,v)}function fe(m,l,h,v){return Ee(be(l),m,h,v)}function oe(m,l,h,v){return Ee(Se(l),m,h,v)}function pe(m,l,h,v){return Ee(ht(l,m.length-h),m,h,v)}a.prototype.write=function(l,h,v,B){if(h===void 0)B="utf8",v=this.length,h=0;else if(v===void 0&&typeof h=="string")B=h,v=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(v)?(v=v>>>0,B===void 0&&(B="utf8")):(B=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-h;if((v===void 0||v>F)&&(v=F),l.length>0&&(v<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let U=!1;for(;;)switch(B){case"hex":return Y(this,l,h,v);case"utf8":case"utf-8":return Q(this,l,h,v);case"ascii":case"latin1":case"binary":return fe(this,l,h,v);case"base64":return oe(this,l,h,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,l,h,v);default:if(U)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),U=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(m,l,h){return l===0&&h===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(l,h))}function o(m,l,h){h=Math.min(m.length,h);const v=[];let B=l;for(;B<h;){const F=m[B];let U=null,he=F>239?4:F>223?3:F>191?2:1;if(B+he<=h){let ae,ie,Me,ne;switch(he){case 1:F<128&&(U=F);break;case 2:ae=m[B+1],(ae&192)===128&&(ne=(F&31)<<6|ae&63,ne>127&&(U=ne));break;case 3:ae=m[B+1],ie=m[B+2],(ae&192)===128&&(ie&192)===128&&(ne=(F&15)<<12|(ae&63)<<6|ie&63,ne>2047&&(ne<55296||ne>57343)&&(U=ne));break;case 4:ae=m[B+1],ie=m[B+2],Me=m[B+3],(ae&192)===128&&(ie&192)===128&&(Me&192)===128&&(ne=(F&15)<<18|(ae&63)<<12|(ie&63)<<6|Me&63,ne>65535&&ne<1114112&&(U=ne))}}U===null?(U=65533,he=1):U>65535&&(U-=65536,v.push(U>>>10&1023|55296),U=56320|U&1023),v.push(U),B+=he}return w(v)}const d=4096;function w(m){const l=m.length;if(l<=d)return String.fromCharCode.apply(String,m);let h="",v=0;for(;v<l;)h+=String.fromCharCode.apply(String,m.slice(v,v+=d));return h}function y(m,l,h){let v="";h=Math.min(m.length,h);for(let B=l;B<h;++B)v+=String.fromCharCode(m[B]&127);return v}function _(m,l,h){let v="";h=Math.min(m.length,h);for(let B=l;B<h;++B)v+=String.fromCharCode(m[B]);return v}function k(m,l,h){const v=m.length;(!l||l<0)&&(l=0),(!h||h<0||h>v)&&(h=v);let B="";for(let F=l;F<h;++F)B+=Re[m[F]];return B}function T(m,l,h){const v=m.slice(l,h);let B="";for(let F=0;F<v.length-1;F+=2)B+=String.fromCharCode(v[F]+v[F+1]*256);return B}a.prototype.slice=function(l,h){const v=this.length;l=~~l,h=h===void 0?v:~~h,l<0?(l+=v,l<0&&(l=0)):l>v&&(l=v),h<0?(h+=v,h<0&&(h=0)):h>v&&(h=v),h<l&&(h=l);const B=this.subarray(l,h);return Object.setPrototypeOf(B,a.prototype),B};function b(m,l,h){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+l>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(l,h,v){l=l>>>0,h=h>>>0,v||b(l,h,this.length);let B=this[l],F=1,U=0;for(;++U<h&&(F*=256);)B+=this[l+U]*F;return B},a.prototype.readUintBE=a.prototype.readUIntBE=function(l,h,v){l=l>>>0,h=h>>>0,v||b(l,h,this.length);let B=this[l+--h],F=1;for(;h>0&&(F*=256);)B+=this[l+--h]*F;return B},a.prototype.readUint8=a.prototype.readUInt8=function(l,h){return l=l>>>0,h||b(l,1,this.length),this[l]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(l,h){return l=l>>>0,h||b(l,2,this.length),this[l]|this[l+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(l,h){return l=l>>>0,h||b(l,2,this.length),this[l]<<8|this[l+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(l,h){return l=l>>>0,h||b(l,4,this.length),(this[l]|this[l+1]<<8|this[l+2]<<16)+this[l+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(l,h){return l=l>>>0,h||b(l,4,this.length),this[l]*16777216+(this[l+1]<<16|this[l+2]<<8|this[l+3])},a.prototype.readBigUInt64LE=Qe(function(l){l=l>>>0,z(l,"offset");const h=this[l],v=this[l+7];(h===void 0||v===void 0)&&G(l,this.length-8);const B=h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,F=this[++l]+this[++l]*2**8+this[++l]*2**16+v*2**24;return BigInt(B)+(BigInt(F)<<BigInt(32))}),a.prototype.readBigUInt64BE=Qe(function(l){l=l>>>0,z(l,"offset");const h=this[l],v=this[l+7];(h===void 0||v===void 0)&&G(l,this.length-8);const B=h*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],F=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+v;return(BigInt(B)<<BigInt(32))+BigInt(F)}),a.prototype.readIntLE=function(l,h,v){l=l>>>0,h=h>>>0,v||b(l,h,this.length);let B=this[l],F=1,U=0;for(;++U<h&&(F*=256);)B+=this[l+U]*F;return F*=128,B>=F&&(B-=Math.pow(2,8*h)),B},a.prototype.readIntBE=function(l,h,v){l=l>>>0,h=h>>>0,v||b(l,h,this.length);let B=h,F=1,U=this[l+--B];for(;B>0&&(F*=256);)U+=this[l+--B]*F;return F*=128,U>=F&&(U-=Math.pow(2,8*h)),U},a.prototype.readInt8=function(l,h){return l=l>>>0,h||b(l,1,this.length),this[l]&128?(255-this[l]+1)*-1:this[l]},a.prototype.readInt16LE=function(l,h){l=l>>>0,h||b(l,2,this.length);const v=this[l]|this[l+1]<<8;return v&32768?v|4294901760:v},a.prototype.readInt16BE=function(l,h){l=l>>>0,h||b(l,2,this.length);const v=this[l+1]|this[l]<<8;return v&32768?v|4294901760:v},a.prototype.readInt32LE=function(l,h){return l=l>>>0,h||b(l,4,this.length),this[l]|this[l+1]<<8|this[l+2]<<16|this[l+3]<<24},a.prototype.readInt32BE=function(l,h){return l=l>>>0,h||b(l,4,this.length),this[l]<<24|this[l+1]<<16|this[l+2]<<8|this[l+3]},a.prototype.readBigInt64LE=Qe(function(l){l=l>>>0,z(l,"offset");const h=this[l],v=this[l+7];(h===void 0||v===void 0)&&G(l,this.length-8);const B=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(v<<24);return(BigInt(B)<<BigInt(32))+BigInt(h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24)}),a.prototype.readBigInt64BE=Qe(function(l){l=l>>>0,z(l,"offset");const h=this[l],v=this[l+7];(h===void 0||v===void 0)&&G(l,this.length-8);const B=(h<<24)+this[++l]*2**16+this[++l]*2**8+this[++l];return(BigInt(B)<<BigInt(32))+BigInt(this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+v)}),a.prototype.readFloatLE=function(l,h){return l=l>>>0,h||b(l,4,this.length),r.read(this,l,!0,23,4)},a.prototype.readFloatBE=function(l,h){return l=l>>>0,h||b(l,4,this.length),r.read(this,l,!1,23,4)},a.prototype.readDoubleLE=function(l,h){return l=l>>>0,h||b(l,8,this.length),r.read(this,l,!0,52,8)},a.prototype.readDoubleBE=function(l,h){return l=l>>>0,h||b(l,8,this.length),r.read(this,l,!1,52,8)};function u(m,l,h,v,B,F){if(!a.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>B||l<F)throw new RangeError('"value" argument is out of bounds');if(h+v>m.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(l,h,v,B){if(l=+l,h=h>>>0,v=v>>>0,!B){const he=Math.pow(2,8*v)-1;u(this,l,h,v,he,0)}let F=1,U=0;for(this[h]=l&255;++U<v&&(F*=256);)this[h+U]=l/F&255;return h+v},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(l,h,v,B){if(l=+l,h=h>>>0,v=v>>>0,!B){const he=Math.pow(2,8*v)-1;u(this,l,h,v,he,0)}let F=v-1,U=1;for(this[h+F]=l&255;--F>=0&&(U*=256);)this[h+F]=l/U&255;return h+v},a.prototype.writeUint8=a.prototype.writeUInt8=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,1,255,0),this[h]=l&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,2,65535,0),this[h]=l&255,this[h+1]=l>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,2,65535,0),this[h]=l>>>8,this[h+1]=l&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,4,4294967295,0),this[h+3]=l>>>24,this[h+2]=l>>>16,this[h+1]=l>>>8,this[h]=l&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,4,4294967295,0),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4};function S(m,l,h,v,B){C(l,v,B,m,h,7);let F=Number(l&BigInt(4294967295));m[h++]=F,F=F>>8,m[h++]=F,F=F>>8,m[h++]=F,F=F>>8,m[h++]=F;let U=Number(l>>BigInt(32)&BigInt(4294967295));return m[h++]=U,U=U>>8,m[h++]=U,U=U>>8,m[h++]=U,U=U>>8,m[h++]=U,h}function K(m,l,h,v,B){C(l,v,B,m,h,7);let F=Number(l&BigInt(4294967295));m[h+7]=F,F=F>>8,m[h+6]=F,F=F>>8,m[h+5]=F,F=F>>8,m[h+4]=F;let U=Number(l>>BigInt(32)&BigInt(4294967295));return m[h+3]=U,U=U>>8,m[h+2]=U,U=U>>8,m[h+1]=U,U=U>>8,m[h]=U,h+8}a.prototype.writeBigUInt64LE=Qe(function(l,h=0){return S(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Qe(function(l,h=0){return K(this,l,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(l,h,v,B){if(l=+l,h=h>>>0,!B){const ae=Math.pow(2,8*v-1);u(this,l,h,v,ae-1,-ae)}let F=0,U=1,he=0;for(this[h]=l&255;++F<v&&(U*=256);)l<0&&he===0&&this[h+F-1]!==0&&(he=1),this[h+F]=(l/U>>0)-he&255;return h+v},a.prototype.writeIntBE=function(l,h,v,B){if(l=+l,h=h>>>0,!B){const ae=Math.pow(2,8*v-1);u(this,l,h,v,ae-1,-ae)}let F=v-1,U=1,he=0;for(this[h+F]=l&255;--F>=0&&(U*=256);)l<0&&he===0&&this[h+F+1]!==0&&(he=1),this[h+F]=(l/U>>0)-he&255;return h+v},a.prototype.writeInt8=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,1,127,-128),l<0&&(l=255+l+1),this[h]=l&255,h+1},a.prototype.writeInt16LE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,2,32767,-32768),this[h]=l&255,this[h+1]=l>>>8,h+2},a.prototype.writeInt16BE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,2,32767,-32768),this[h]=l>>>8,this[h+1]=l&255,h+2},a.prototype.writeInt32LE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,4,2147483647,-2147483648),this[h]=l&255,this[h+1]=l>>>8,this[h+2]=l>>>16,this[h+3]=l>>>24,h+4},a.prototype.writeInt32BE=function(l,h,v){return l=+l,h=h>>>0,v||u(this,l,h,4,2147483647,-2147483648),l<0&&(l=4294967295+l+1),this[h]=l>>>24,this[h+1]=l>>>16,this[h+2]=l>>>8,this[h+3]=l&255,h+4},a.prototype.writeBigInt64LE=Qe(function(l,h=0){return S(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Qe(function(l,h=0){return K(this,l,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(m,l,h,v,B,F){if(h+v>m.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function A(m,l,h,v,B){return l=+l,h=h>>>0,B||J(m,l,h,4),r.write(m,l,h,v,23,4),h+4}a.prototype.writeFloatLE=function(l,h,v){return A(this,l,h,!0,v)},a.prototype.writeFloatBE=function(l,h,v){return A(this,l,h,!1,v)};function P(m,l,h,v,B){return l=+l,h=h>>>0,B||J(m,l,h,8),r.write(m,l,h,v,52,8),h+8}a.prototype.writeDoubleLE=function(l,h,v){return P(this,l,h,!0,v)},a.prototype.writeDoubleBE=function(l,h,v){return P(this,l,h,!1,v)},a.prototype.copy=function(l,h,v,B){if(!a.isBuffer(l))throw new TypeError("argument should be a Buffer");if(v||(v=0),!B&&B!==0&&(B=this.length),h>=l.length&&(h=l.length),h||(h=0),B>0&&B<v&&(B=v),B===v||l.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),l.length-h<B-v&&(B=l.length-h+v);const F=B-v;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,v,B):Uint8Array.prototype.set.call(l,this.subarray(v,B),h),F},a.prototype.fill=function(l,h,v,B){if(typeof l=="string"){if(typeof h=="string"?(B=h,h=0,v=this.length):typeof v=="string"&&(B=v,v=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!a.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(l.length===1){const U=l.charCodeAt(0);(B==="utf8"&&U<128||B==="latin1")&&(l=U)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(h<0||this.length<h||this.length<v)throw new RangeError("Out of range index");if(v<=h)return this;h=h>>>0,v=v===void 0?this.length:v>>>0,l||(l=0);let F;if(typeof l=="number")for(F=h;F<v;++F)this[F]=l;else{const U=a.isBuffer(l)?l:a.from(l,B),he=U.length;if(he===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(F=0;F<v-h;++F)this[F+h]=U[F%he]}return this};const W={};function Z(m,l,h){W[m]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(m,l){return`The "${m}" argument must be of type number. Received type ${typeof l}`},TypeError),Z("ERR_OUT_OF_RANGE",function(m,l,h){let v=`The value of "${m}" is out of range.`,B=h;return Number.isInteger(h)&&Math.abs(h)>2**32?B=le(String(h)):typeof h=="bigint"&&(B=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(B=le(B)),B+="n"),v+=` It must be ${l}. Received ${B}`,v},RangeError);function le(m){let l="",h=m.length;const v=m[0]==="-"?1:0;for(;h>=v+4;h-=3)l=`_${m.slice(h-3,h)}${l}`;return`${m.slice(0,h)}${l}`}function R(m,l,h){z(l,"offset"),(m[l]===void 0||m[l+h]===void 0)&&G(l,m.length-(h+1))}function C(m,l,h,v,B,F){if(m>h||m<l){const U=typeof l=="bigint"?"n":"";let he;throw l===0||l===BigInt(0)?he=`>= 0${U} and < 2${U} ** ${(F+1)*8}${U}`:he=`>= -(2${U} ** ${(F+1)*8-1}${U}) and < 2 ** ${(F+1)*8-1}${U}`,new W.ERR_OUT_OF_RANGE("value",he,m)}R(v,B,F)}function z(m,l){if(typeof m!="number")throw new W.ERR_INVALID_ARG_TYPE(l,"number",m)}function G(m,l,h){throw Math.floor(m)!==m?(z(m,h),new W.ERR_OUT_OF_RANGE("offset","an integer",m)):l<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,m)}const se=/[^+/0-9A-Za-z-_]/g;function ue(m){if(m=m.split("=")[0],m=m.trim().replace(se,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function re(m,l){l=l||1/0;let h;const v=m.length;let B=null;const F=[];for(let U=0;U<v;++U){if(h=m.charCodeAt(U),h>55295&&h<57344){if(!B){if(h>56319){(l-=3)>-1&&F.push(239,191,189);continue}else if(U+1===v){(l-=3)>-1&&F.push(239,191,189);continue}B=h;continue}if(h<56320){(l-=3)>-1&&F.push(239,191,189),B=h;continue}h=(B-55296<<10|h-56320)+65536}else B&&(l-=3)>-1&&F.push(239,191,189);if(B=null,h<128){if((l-=1)<0)break;F.push(h)}else if(h<2048){if((l-=2)<0)break;F.push(h>>6|192,h&63|128)}else if(h<65536){if((l-=3)<0)break;F.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((l-=4)<0)break;F.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return F}function be(m){const l=[];for(let h=0;h<m.length;++h)l.push(m.charCodeAt(h)&255);return l}function ht(m,l){let h,v,B;const F=[];for(let U=0;U<m.length&&!((l-=2)<0);++U)h=m.charCodeAt(U),v=h>>8,B=h%256,F.push(B),F.push(v);return F}function Se(m){return t.toByteArray(ue(m))}function Ee(m,l,h,v){let B;for(B=0;B<v&&!(B+h>=l.length||B>=m.length);++B)l[B+h]=m[B];return B}function Je(m,l){return m instanceof l||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===l.name}function ve(m){return m!==m}const Re=function(){const m="0123456789abcdef",l=new Array(256);for(let h=0;h<16;++h){const v=h*16;for(let B=0;B<16;++B)l[v+B]=m[h]+m[B]}return l}();function Qe(m){return typeof BigInt>"u"?_e:m}function _e(){throw new Error("BigInt not supported")}})(bn);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=bn,n=r.Buffer;function i(c,a){for(var f in c)a[f]=c[f]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(c,a,f){return n(c,a,f)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(c,a,f){if(typeof c=="number")throw new TypeError("Argument must not be a number");return n(c,a,f)},s.alloc=function(c,a,f){if(typeof c!="number")throw new TypeError("Argument must be a number");var g=n(c);return a!==void 0?typeof f=="string"?g.fill(a,f):g.fill(a):g.fill(0),g},s.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n(c)},s.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(c)}})(Ps,Ps.exports);var jt=Ps.exports,os,Io;function Hu(){if(Io)return os;Io=1;var e=Zl;return os=function(r){return!!e(r)},os}var $u=Kl,Wu=Ql,Vu=Wu("TypedArray.prototype.buffer",!0),zu=Hu(),qu=Vu||function(t){if(!zu(t))throw new $u("Not a Typed Array");return t.buffer},Et=jt.Buffer,Gu=Yl,Ju=qu,Zu=ArrayBuffer.isView||function(t){try{return Ju(t),!0}catch{return!1}},Ku=typeof Uint8Array<"u",cc=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Qu=cc&&(Et.prototype instanceof Uint8Array||Et.TYPED_ARRAY_SUPPORT),Yu=function(t,r){if(Et.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Et.from(t):t;if(typeof t=="string")return Et.from(t,r);if(cc&&Zu(t)){if(t.byteLength===0)return Et.alloc(0);if(Qu){var n=Et.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=Et.from(i);if(s.length===t.byteLength)return s}if(Ku&&t instanceof Uint8Array)return Et.from(t);var c=Gu(t);if(c)for(var a=0;a<t.length;a+=1){var f=t[a];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(c||Et.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Et.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Xu=jt.Buffer,eh=Yu;function pi(e,t){this._block=Xu.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}pi.prototype.update=function(e,t){e=eh(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,c=0;c<i;){for(var a=s%n,f=Math.min(i-c,n-a),g=0;g<f;g++)r[a+g]=e[c+g];s+=f,c+=f,s%n===0&&this._update(r)}return this._len+=i,this};pi.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};pi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Yr=pi,th=St,lc=Yr,rh=jt.Buffer,nh=[1518500249,1859775393,-1894007588,-899497514],ih=new Array(80);function vn(){this.init(),this._w=ih,lc.call(this,64,56)}th(vn,lc);vn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function sh(e){return e<<5|e>>>27}function oh(e){return e<<30|e>>>2}function ah(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}vn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,c=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var f=0;f<80;++f){var g=~~(f/20),p=sh(r)+ah(g,n,i,s)+c+t[f]+nh[g]|0;c=s,s=i,i=oh(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};vn.prototype._hash=function(){var e=rh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var ch=vn,lh=St,uc=Yr,uh=jt.Buffer,hh=[1518500249,1859775393,-1894007588,-899497514],dh=new Array(80);function _n(){this.init(),this._w=dh,uc.call(this,64,56)}lh(_n,uc);_n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function fh(e){return e<<1|e>>>31}function ph(e){return e<<5|e>>>27}function gh(e){return e<<30|e>>>2}function mh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}_n.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,c=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=fh(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var f=0;f<80;++f){var g=~~(f/20),p=ph(r)+mh(g,n,i,s)+c+t[f]+hh[g]|0;c=s,s=i,i=gh(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0};_n.prototype._hash=function(){var e=uh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var wh=_n,yh=St,hc=Yr,bh=jt.Buffer,vh=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],_h=new Array(64);function En(){this.init(),this._w=_h,hc.call(this,64,56)}yh(En,hc);En.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Eh(e,t,r){return r^e&(t^r)}function Sh(e,t,r){return e&t|r&(e|t)}function Rh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Mh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Ch(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function kh(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}En.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,c=this._e|0,a=this._f|0,f=this._g|0,g=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=kh(t[p-2])+t[p-7]+Ch(t[p-15])+t[p-16]|0;for(var M=0;M<64;++M){var E=g+Mh(c)+Eh(c,a,f)+vh[M]+t[M]|0,N=Rh(r)+Sh(r,n,i)|0;g=f,f=a,a=c,c=s+E|0,s=i,i=n,n=r,r=E+N|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=a+this._f|0,this._g=f+this._g|0,this._h=g+this._h|0};En.prototype._hash=function(){var e=bh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var dc=En,Ih=St,xh=dc,Ah=Yr,Th=jt.Buffer,Bh=new Array(64);function gi(){this.init(),this._w=Bh,Ah.call(this,64,56)}Ih(gi,xh);gi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};gi.prototype._hash=function(){var e=Th.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Nh=gi,Lh=St,fc=Yr,Ph=jt.Buffer,xo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Oh=new Array(160);function Sn(){this.init(),this._w=Oh,fc.call(this,128,112)}Lh(Sn,fc);Sn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ao(e,t,r){return r^e&(t^r)}function To(e,t,r){return e&t|r&(e|t)}function Bo(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function No(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Fh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Dh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function jh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Uh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ye(e,t){return e>>>0<t>>>0?1:0}Sn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,c=this._eh|0,a=this._fh|0,f=this._gh|0,g=this._hh|0,p=this._al|0,M=this._bl|0,E=this._cl|0,N=this._dl|0,H=this._el|0,D=this._fl|0,$=this._gl|0,x=this._hl|0,L=0;L<32;L+=2)t[L]=e.readInt32BE(L*4),t[L+1]=e.readInt32BE(L*4+4);for(;L<160;L+=2){var O=t[L-30],V=t[L-15*2+1],j=Fh(O,V),q=Dh(V,O);O=t[L-2*2],V=t[L-2*2+1];var te=jh(O,V),Y=Uh(V,O),Q=t[L-7*2],fe=t[L-7*2+1],oe=t[L-16*2],pe=t[L-16*2+1],I=q+fe|0,o=j+Q+Ye(I,q)|0;I=I+Y|0,o=o+te+Ye(I,Y)|0,I=I+pe|0,o=o+oe+Ye(I,pe)|0,t[L]=o,t[L+1]=I}for(var d=0;d<160;d+=2){o=t[d],I=t[d+1];var w=To(r,n,i),y=To(p,M,E),_=Bo(r,p),k=Bo(p,r),T=No(c,H),b=No(H,c),u=xo[d],S=xo[d+1],K=Ao(c,a,f),J=Ao(H,D,$),A=x+b|0,P=g+T+Ye(A,x)|0;A=A+J|0,P=P+K+Ye(A,J)|0,A=A+S|0,P=P+u+Ye(A,S)|0,A=A+I|0,P=P+o+Ye(A,I)|0;var W=k+y|0,Z=_+w+Ye(W,k)|0;g=f,x=$,f=a,$=D,a=c,D=H,H=N+A|0,c=s+P+Ye(H,N)|0,s=i,N=E,i=n,E=M,n=r,M=p,p=A+W|0,r=P+Z+Ye(p,A)|0}this._al=this._al+p|0,this._bl=this._bl+M|0,this._cl=this._cl+E|0,this._dl=this._dl+N|0,this._el=this._el+H|0,this._fl=this._fl+D|0,this._gl=this._gl+$|0,this._hl=this._hl+x|0,this._ah=this._ah+r+Ye(this._al,p)|0,this._bh=this._bh+n+Ye(this._bl,M)|0,this._ch=this._ch+i+Ye(this._cl,E)|0,this._dh=this._dh+s+Ye(this._dl,N)|0,this._eh=this._eh+c+Ye(this._el,H)|0,this._fh=this._fh+a+Ye(this._fl,D)|0,this._gh=this._gh+f+Ye(this._gl,$)|0,this._hh=this._hh+g+Ye(this._hl,x)|0};Sn.prototype._hash=function(){var e=Ph.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var pc=Sn,Hh=St,$h=pc,Wh=Yr,Vh=jt.Buffer,zh=new Array(160);function mi(){this.init(),this._w=zh,Wh.call(this,128,112)}Hh(mi,$h);mi.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};mi.prototype._hash=function(){var e=Vh.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var qh=mi;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=ch,e.exports.sha1=wh,e.exports.sha224=Nh,e.exports.sha256=dc,e.exports.sha384=qh,e.exports.sha512=pc})(oc);var Gh=oc.exports;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Session=void 0;const Lo=Gh,Po=X,Oo="session:id",Fo="session:secret",Do="session:linked";class Zs{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Po.randomBytesHex)(16),this._secret=n||(0,Po.randomBytesHex)(32),this._key=new Lo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Oo),n=t.getItem(Do),i=t.getItem(Fo);return r&&i?new Zs(t,r,i,n==="1"):null}static hash(t){return new Lo.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Oo,this._id),this._storage.setItem(Fo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Do,this._linked?"1":"0")}}Qr.Session=Zs;var wi={},yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.Cipher=void 0;const Un=X;class Jh{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,Un.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),a=16,f=c.slice(c.byteLength-a),g=c.slice(0,c.byteLength-a),p=new Uint8Array(f),M=new Uint8Array(g),E=new Uint8Array([...n,...p,...M]);return(0,Un.uint8ArrayToHex)(E)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,Un.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,Un.hexStringToUint8Array)(t),a=c.slice(0,12),f=c.slice(12,28),g=c.slice(28),p=new Uint8Array([...g,...f]),M={name:"AES-GCM",iv:new Uint8Array(a)};try{const E=await window.crypto.subtle.decrypt(M,s,p),N=new TextDecoder;n(N.decode(E))}catch(E){i(E)}})()})}}yi.Cipher=Jh;var bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.WalletLinkHTTP=void 0;class Zh{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n?.filter(c=>c.event==="Web3Response").map(c=>({type:"Event",sessionId:this.sessionId,eventId:c.id,event:c.event,data:c.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}bi.WalletLinkHTTP=Zh;var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.WalletLinkWebSocket=$r.ConnectionState=void 0;var Or;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Or||($r.ConnectionState=Or={}));class Kh{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Or.CONNECTING),i.onclose=s=>{var c;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Or.DISCONNECTED)},i.onopen=s=>{var c;t(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Or.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(f=>this.sendData(f)),this.pendingData=[])},i.onmessage=s=>{var c,a;if(s.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const f=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,f)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Or.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}$r.WalletLinkWebSocket=Kh;Object.defineProperty(wi,"__esModule",{value:!0});wi.WalletLinkConnection=void 0;const Tr=Ze,Qh=yi,Mt=Kr,jo=mt,Br=Qr,Yh=bi,Hn=$r,Uo=1e4,Xh=6e4;class ed{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Tr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",g=>a.JsonRpcUrl&&this.handleChainUpdated(g,a.JsonRpcUrl)]]).forEach((g,p)=>{const M=a[p];M!==void 0&&g(M)})},this.handleDestroyed=a=>{var f,g;a==="1"&&((f=this.listener)===null||f===void 0||f.resetAndReload(),(g=this.diagnostic)===null||g===void 0||g.log(Mt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Br.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var f,g;try{const p=await this.cipher.decrypt(a);(f=this.listener)===null||f===void 0||f.accountUpdated(p)}catch{(g=this.diagnostic)===null||g===void 0||g.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,f)=>{var g,p;try{const M=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.metadataUpdated(a,M)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(jo.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(jo.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,f)=>{var g,p;try{const M=await this.cipher.decrypt(a),E=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.chainUpdated(M,E)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Qh.Cipher(t.secret),this.diagnostic=i,this.listener=n;const c=new Hn.WalletLinkWebSocket(`${r}/rpc`,s);c.setConnectionStateListener(async a=>{var f;(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Br.Session.hash(t.id)});let g=!1;switch(a){case Hn.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(M=>setTimeout(M,5e3)),this.destroyed||c.connect().catch(()=>{p()})};p()}break;case Hn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Uo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Hn.ConnectionState.CONNECTING:break}this.connected!==g&&(this.connected=g)}),c.setIncomingDataListener(a=>{var f,g,p;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const M=a.type==="IsLinkedOK"?a.linked:void 0;(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.LINKED,{sessionIdHash:Br.Session.hash(t.id),linked:M,type:a.type,onlineGuests:a.onlineGuests}),this.linked=M||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(Mt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Br.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((p=this.requestResolutions.get(a.id))===null||p===void 0||p(a))}),this.ws=c,this.http=new Yh.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Br.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Mt.EVENTS.DISCONNECTED,{sessionIdHash:Br.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const c=await this.makeRequest(s);if(c.type==="Fail")throw new Error(c.error||"failed to publish event");return c.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Uo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Xh){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,c)=>{i=window.setTimeout(()=>{c(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,c=>{clearTimeout(i),s(c),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}wi.WalletLinkConnection=ed;var Rn={},Mn={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var td=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.injectCssReset=void 0;const rd=td(Ks);function nd(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(rd.default)),document.documentElement.appendChild(e)}Mn.injectCssReset=nd;var vi={};const ot=dn(Xl);var _i={};function gc(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=gc(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ho(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=gc(e))&&(n&&(n+=" "),n+=t);return n}const id=Object.freeze(Object.defineProperty({__proto__:null,clsx:Ho,default:Ho},Symbol.toStringTag,{value:"Module"})),Cn=dn(id),Ei=dn(eu);var Wr={},Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.CloseIcon=void 0;const $o=ot;function sd(e){return(0,$o.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,$o.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Si.CloseIcon=sd;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.CoinbaseWalletRound=void 0;const $n=ot;function od(e){return(0,$n.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,$n.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,$n.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,$n.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}Ri.CoinbaseWalletRound=od;var Mi={};Object.defineProperty(Mi,"__esModule",{value:!0});Mi.QRCodeIcon=void 0;const nn=ot;function ad(e){return(0,nn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,nn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,nn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,nn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,nn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Mi.QRCodeIcon=ad;var Ci={};function mc(e){this.mode=lt.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}mc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Bt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Bt.prototype={addData:function(e){var t=new mc(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Bt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=Ve.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var c=s*i,a=0;a<this.modules[s].length;a++){var f=a*i,g=this.modules[s][a];g&&(n.beginFill(0,100),n.moveTo(f,c),n.lineTo(f+i,c),n.lineTo(f+i,c+i),n.lineTo(f,c+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=Ve.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var c=-2;c<=2;c++)s==-2||s==2||c==-2||c==2||s==0&&c==0?this.modules[n+s][i+c]=!0:this.modules[n+s][i+c]=!1}},setupTypeNumber:function(e){for(var t=Ve.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=Ve.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,c=this.moduleCount-1;c>0;c-=2)for(c==6&&c--;;){for(var a=0;a<2;a++)if(this.modules[n][c-a]==null){var f=!1;s<e.length&&(f=(e[s]>>>i&1)==1);var g=Ve.getMask(t,n,c-a);g&&(f=!f),this.modules[n][c-a]=f,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Bt.PAD0=236;Bt.PAD1=17;Bt.createData=function(e,t,r){for(var n=Tt.getRSBlocks(e,t),i=new wc,s=0;s<r.length;s++){var c=r[s];i.put(c.mode,4),i.put(c.getLength(),Ve.getLengthInBits(c.mode,e)),c.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(Bt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Bt.PAD1,8);return Bt.createBytes(i,n)};Bt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),c=new Array(t.length),a=0;a<t.length;a++){var f=t[a].dataCount,g=t[a].totalCount-f;n=Math.max(n,f),i=Math.max(i,g),s[a]=new Array(f);for(var p=0;p<s[a].length;p++)s[a][p]=255&e.buffer[p+r];r+=f;var M=Ve.getErrorCorrectPolynomial(g),E=new Fr(s[a],M.getLength()-1),N=E.mod(M);c[a]=new Array(M.getLength()-1);for(var p=0;p<c[a].length;p++){var H=p+N.getLength()-c[a].length;c[a][p]=H>=0?N.get(H):0}}for(var D=0,p=0;p<t.length;p++)D+=t[p].totalCount;for(var $=new Array(D),x=0,p=0;p<n;p++)for(var a=0;a<t.length;a++)p<s[a].length&&($[x++]=s[a][p]);for(var p=0;p<i;p++)for(var a=0;a<t.length;a++)p<c[a].length&&($[x++]=c[a][p]);return $};var lt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Wt={L:1,M:0,Q:3,H:2},Ut={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ve={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G15)>=0;)t^=Ve.G15<<Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G15);return(e<<10|t)^Ve.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G18)>=0;)t^=Ve.G18<<Ve.getBCHDigit(t)-Ve.getBCHDigit(Ve.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return Ve.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ut.PATTERN000:return(t+r)%2==0;case Ut.PATTERN001:return t%2==0;case Ut.PATTERN010:return r%3==0;case Ut.PATTERN011:return(t+r)%3==0;case Ut.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ut.PATTERN101:return t*r%2+t*r%3==0;case Ut.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ut.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Fr([1],0),r=0;r<e;r++)t=t.multiply(new Fr([1,Xe.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case lt.MODE_NUMBER:return 10;case lt.MODE_ALPHA_NUM:return 9;case lt.MODE_8BIT_BYTE:return 8;case lt.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case lt.MODE_NUMBER:return 12;case lt.MODE_ALPHA_NUM:return 11;case lt.MODE_8BIT_BYTE:return 16;case lt.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case lt.MODE_NUMBER:return 14;case lt.MODE_ALPHA_NUM:return 13;case lt.MODE_8BIT_BYTE:return 16;case lt.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,c=e.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var f=-1;f<=1;f++)i+f<0||t<=i+f||a==0&&f==0||c==e.isDark(n+a,i+f)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var g=0;e.isDark(n,i)&&g++,e.isDark(n+1,i)&&g++,e.isDark(n,i+1)&&g++,e.isDark(n+1,i+1)&&g++,(g==0||g==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var p=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&p++;var M=Math.abs(100*p/t/t-50)/5;return r+=M*10,r}},Xe={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Xe.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Xe.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var tt=0;tt<8;tt++)Xe.EXP_TABLE[tt]=1<<tt;for(var tt=8;tt<256;tt++)Xe.EXP_TABLE[tt]=Xe.EXP_TABLE[tt-4]^Xe.EXP_TABLE[tt-5]^Xe.EXP_TABLE[tt-6]^Xe.EXP_TABLE[tt-8];for(var tt=0;tt<255;tt++)Xe.LOG_TABLE[Xe.EXP_TABLE[tt]]=tt;function Fr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}Fr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Xe.gexp(Xe.glog(this.get(r))+Xe.glog(e.get(n)));return new Fr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Xe.glog(this.get(0))-Xe.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Xe.gexp(Xe.glog(e.get(n))+t);return new Fr(r,0).mod(e)}};function Tt(e,t){this.totalCount=e,this.dataCount=t}Tt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];Tt.getRSBlocks=function(e,t){var r=Tt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var c=r[s*3+0],a=r[s*3+1],f=r[s*3+2],g=0;g<c;g++)i.push(new Tt(a,f));return i};Tt.getRsBlockTable=function(e,t){switch(t){case Wt.L:return Tt.RS_BLOCK_TABLE[(e-1)*4+0];case Wt.M:return Tt.RS_BLOCK_TABLE[(e-1)*4+1];case Wt.Q:return Tt.RS_BLOCK_TABLE[(e-1)*4+2];case Wt.H:return Tt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function wc(){this.buffer=[],this.length=0}wc.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var as=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function yc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(f){switch(f){case"L":return Wt.L;case"M":return Wt.M;case"Q":return Wt.Q;case"H":return Wt.H;default:throw new Error("Unknwon error correction level: "+f)}}function n(f,g){for(var p=i(f),M=1,E=0,N=0,H=as.length;N<=H;N++){var D=as[N];if(!D)throw new Error("Content too long: expected "+E+" but got "+p);switch(g){case"L":E=D[0];break;case"M":E=D[1];break;case"Q":E=D[2];break;case"H":E=D[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(p<=E)break;M++}if(M>as.length)throw new Error("Content too long");return M}function i(f){var g=encodeURI(f).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return g.length+(g.length!=f?3:0)}var s=this.options.content,c=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Bt(c,a),this.qrcode.addData(s),this.qrcode.make()}yc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r
7
+ `:"",c=t.width,a=t.height,f=r.length,g=c/(f+2*t.padding),p=a/(f+2*t.padding),M=typeof t.join<"u"?!!t.join:!1,E=typeof t.swap<"u"?!!t.swap:!1,N=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,H=typeof t.predefined<"u"?!!t.predefined:!1,D=H?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+g+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",$=i+'<rect x="0" y="0" width="'+c+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,x="",L="",O=0;O<f;O++)for(var V=0;V<f;V++){var j=r[V][O];if(j){var q=V*g+t.padding*g,te=O*p+t.padding*p;if(E){var Y=q;q=te,te=Y}if(M){var Q=g+q,fe=p+te;q=Number.isInteger(q)?Number(q):q.toFixed(2),te=Number.isInteger(te)?Number(te):te.toFixed(2),Q=Number.isInteger(Q)?Number(Q):Q.toFixed(2),fe=Number.isInteger(fe)?Number(fe):fe.toFixed(2),L+="M"+q+","+te+" V"+fe+" H"+Q+" V"+te+" H"+q+" Z "}else H?x+=i+'<use x="'+q.toString()+'" y="'+te.toString()+'" href="#qrmodule" />'+s:x+=i+'<rect x="'+q.toString()+'" y="'+te.toString()+'" width="'+g+'" height="'+p+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}M&&(x=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+L+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const I=c*this.options.image.width/100,o=a*this.options.image.height/100,d=c/2-I/2,w=a/2-o/2;oe+=`<svg x="${d}" y="${w}" width="${I}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+s,oe+="</svg>"}var pe="";switch(e.container){case"svg":N&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+c+'" height="'+a+'">'+s,pe+=D+$+x,pe+=oe,pe+="</svg>";break;case"svg-viewbox":N&&(pe+='<?xml version="1.0" standalone="yes"?>'+s),pe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+c+" "+a+'">'+s,pe+=D+$+x,pe+=oe,pe+="</svg>";break;case"g":pe+='<g width="'+c+'" height="'+a+'">'+s,pe+=D+$+x,pe+=oe,pe+="</g>";break;default:pe+=(D+$+x+oe).replace(/^\s+/,"");break}return pe};var cd=yc,ld=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.QRCode=void 0;const ud=ot,Wo=Ei,hd=ld(cd),dd=e=>{const[t,r]=(0,Wo.useState)("");return(0,Wo.useEffect)(()=>{var n,i;const s=new hd.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),c=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${c}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,ud.h)("img",{src:t,alt:"QR Code"}):null};Ci.QRCode=dd;var ki={},Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var fd=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ki,"__esModule",{value:!0});ki.Spinner=void 0;const Wn=ot,pd=fd(Qs),gd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Wn.h)("div",{class:"-cbwsdk-spinner"},(0,Wn.h)("style",null,pd.default),(0,Wn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Wn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ki.Spinner=gd;var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var bc=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.CoinbaseWalletSteps=Wr.ConnectContent=void 0;const pr=bc(Cn),we=ot,md=X,wd=Zr,yd=Si,bd=Ri,vd=Mi,_d=Ci,Ed=ki,Sd=bc(Ys),cs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:vc},Rd=e=>e==="light"?"#FFFFFF":"#0A0B0D";function Md(e){const{theme:t}=e,r=(0,md.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=cs.steps;return(0,we.h)("div",{"data-testid":"connect-content",className:(0,pr.default)("-cbwsdk-connect-content",t)},(0,we.h)("style",null,Sd.default),(0,we.h)("div",{className:"-cbwsdk-connect-content-header"},(0,we.h)("h2",{className:(0,pr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,we.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,we.h)(yd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,we.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,we.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,we.h)(Cd,{title:cs.title,description:cs.description,theme:t})),(0,we.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,we.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,we.h)(_d.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,we.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:wd.LIB_VERSION}),(0,we.h)("input",{type:"hidden",value:r})),(0,we.h)(n,{theme:t}),!e.isConnected&&(0,we.h)("div",{"data-testid":"connecting-spinner",className:(0,pr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,we.h)(Ed.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,we.h)("p",null,"Connecting...")))))}Wr.ConnectContent=Md;function Cd({title:e,description:t,theme:r}){return(0,we.h)("div",{className:(0,pr.default)("-cbwsdk-connect-item",r)},(0,we.h)("div",null,(0,we.h)(bd.CoinbaseWalletRound,null)),(0,we.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,we.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,we.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function vc({theme:e}){return(0,we.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,we.h)("li",{className:(0,pr.default)("-cbwsdk-wallet-steps-item",e)},(0,we.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,we.h)("li",{className:(0,pr.default)("-cbwsdk-wallet-steps-item",e)},(0,we.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,we.h)("span",null,"Tap ",(0,we.h)("strong",null,"Scan")," "),(0,we.h)("span",{className:(0,pr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,we.h)(vd.QRCodeIcon,{fill:Rd(e)})))))}Wr.CoinbaseWalletSteps=vc;var Ii={},xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.ArrowLeftIcon=void 0;const Vo=ot;function kd(e){return(0,Vo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Vo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}xi.ArrowLeftIcon=kd;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.LaptopIcon=void 0;const ls=ot;function Id(e){return(0,ls.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ls.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ls.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Ai.LaptopIcon=Id;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.SafeIcon=void 0;const zo=ot;function xd(e){return(0,zo.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,zo.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Ti.SafeIcon=xd;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var _c=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TryExtensionContent=void 0;const or=_c(Cn),Ge=ot,us=Ei,Ad=xi,Td=Ai,Bd=Ti,Nd=_c(Xs);function Ld({theme:e}){const[t,r]=(0,us.useState)(!1),n=(0,us.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,us.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Ge.h)("div",{class:(0,or.default)("-cbwsdk-try-extension",e)},(0,Ge.h)("style",null,Nd.default),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("h3",{class:(0,or.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ge.h)("button",{class:(0,or.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Ge.h)("div",null,!t&&(0,Ge.h)(Ad.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,or.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(Td.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,or.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,or.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(Bd.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,or.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Ii.TryExtensionContent=Ld;var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Ec=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_i,"__esModule",{value:!0});_i.ConnectDialog=void 0;const hs=Ec(Cn),ar=ot,ds=Ei,Pd=Wr,Od=Ii,Fd=Ec(eo),Dd=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,ds.useState)(!t),[s,c]=(0,ds.useState)(!t);(0,ds.useEffect)(()=>{const f=[window.setTimeout(()=>{c(!t)},10)];return t?i(!1):f.push(window.setTimeout(()=>{i(!0)},360)),()=>{f.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,ar.h)("div",{class:(0,hs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,ar.h)("style",null,Fd.default),(0,ar.h)("div",{class:(0,hs.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,ar.h)("div",{class:"-cbwsdk-connect-dialog"},(0,ar.h)("div",{class:(0,hs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,ar.h)(Pd.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,ar.h)(Od.TryExtensionContent,{theme:a}))))};_i.ConnectDialog=Dd;Object.defineProperty(vi,"__esModule",{value:!0});vi.LinkFlow=void 0;const fs=ot,jd=_i;class Ud{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,fs.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,fs.render)((0,fs.h)(jd.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}vi.LinkFlow=Ud;var to={},ro={};Object.defineProperty(ro,"__esModule",{value:!0});ro.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=ee&&ee.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Cn),n=ot,i=Ei,s=t(ro),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class f{constructor(E){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=E.darkMode}attach(E){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",E.appendChild(this.root),this.render()}presentItem(E){const N=this.nextItemKey++;return this.items.set(N,E),this.render(),()=>{this.items.delete(N),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([E,N])=>(0,n.h)(e.SnackbarInstance,Object.assign({},N,{key:E}))))),this.root)}}e.Snackbar=f;const g=M=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},M.children));e.SnackbarContainer=g;const p=({autoExpand:M,message:E,menuItems:N})=>{const[H,D]=(0,i.useState)(!0),[$,x]=(0,i.useState)(M??!1);(0,i.useEffect)(()=>{const O=[window.setTimeout(()=>{D(!1)},1),window.setTimeout(()=>{x(!0)},1e4)];return()=>{O.forEach(window.clearTimeout)}});const L=()=>{x(!$)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",H&&"-cbwsdk-snackbar-instance-hidden",$&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:L},(0,n.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},E),(0,n.h)("div",{class:"-gear-container"},!$&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),N&&N.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},N.map((O,V)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",O.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:O.onClick,key:V},(0,n.h)("svg",{width:O.svgWidth,height:O.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":O.defaultFillRule,"clip-rule":O.defaultClipRule,d:O.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",O.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},O.info)))))};e.SnackbarInstance=p})(to);Object.defineProperty(Rn,"__esModule",{value:!0});Rn.WalletLinkRelayUI=void 0;const Hd=Mn,$d=vi,Wd=to;class Vd{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new Wd.Snackbar({darkMode:t.darkMode}),this.linkFlow=new $d.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,Hd.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Rn.WalletLinkRelayUI=Vd;Object.defineProperty(yn,"__esModule",{value:!0});yn.WalletLinkRelay=void 0;const Nr=fn,zd=Ze,We=X,cr=Kr,qo=mt,Ht=Qr,qd=wi,lr=Jr,Gd=Rn;class Ot extends qo.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=c=>{var a;this.isLinked=c;const f=this.storage.getItem(qo.LOCAL_STORAGE_ADDRESSES_KEY);if(c&&(this.session.linked=c),this.isUnlinkedErrorState=!1,f){const g=f.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(g[0]!==""&&!c&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const M=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(cr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:M})}}},this.metadataUpdated=(c,a)=>{this.storage.setItem(c,a)},this.chainUpdated=(c,a)=>{this.chainCallbackParams.chainId===c&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:c,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(c,a))},this.accountUpdated=c=>{this.accountsCallback&&this.accountsCallback([c]),Ot.accountRequestCallbackIds.size>0&&(Array.from(Ot.accountRequestCallbackIds.values()).forEach(a=>{const f={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[c]}};this.invokeCallback(Object.assign(Object.assign({},f),{id:a}))}),Ot.accountRequestCallbackIds.clear())},this.connectedUpdated=c=>{this.ui.setConnected(c)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=Ht.Session.load(this.storage)||new Ht.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new qd.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:c}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:c,session:t});return i.connect(),{session:t,ui:a,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(cr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Ht.Session.load(this.storage);if(i?.id===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(cr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ht.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:c,connection:a}=this.subscribe();this._session=s,this.connection=a,this.ui=c,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(cr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,We.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,We.hexStringFromBuffer)(t,!0),signature:(0,We.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,We.bigIntStringFromBN)(t.weiValue),data:(0,We.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,We.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,We.bigIntStringFromBN)(t.weiValue),data:(0,We.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,We.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,We.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,We.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,We.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,We.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,We.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,We.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,c),r?.()};return{promise:new Promise((c,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,f=>{if(r?.(),(0,lr.isErrorResponse)(f))return a(new Error(f.errorMessage));c(f)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof Gd.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Ht.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(cr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ht.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(c=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(cr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ht.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()})}).catch(c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:c.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(cr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ot.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Ot.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const c=(s=n?.message)!==null&&s!==void 0?s:(0,Nr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:c,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,We.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,c)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,lr.isErrorResponse)(a))return c(new Error(a.errorMessage));s(a)}),this.ui.inlineAccountsResponse()){const a=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:f}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=Nr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}Ot.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider"},n=(0,We.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,c)},s=new Promise((c,a)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,lr.isErrorResponse)(p))return a(new Error(p.errorMessage));c(p)});const f=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:zd.ProviderType.Unselected}})},g=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:g,onCancel:f,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,c){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:c}};let f=null;const g=(0,We.randomBytesHex)(8),p=E=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,a.method,E),f?.()};this.ui.inlineWatchAsset()||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const M=new Promise((E,N)=>{this.relayEventManager.callbacks.set(g,$=>{if(f?.(),(0,lr.isErrorResponse)($))return N(new Error($.errorMessage));E($)});const H=$=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!1}})},D=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:D,onCancel:H,type:t,address:r,symbol:n,decimals:i,image:s,chainId:c}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,a)});return{cancel:p,promise:M}}addEthereumChain(t,r,n,i,s,c){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:c}};let f=null;const g=(0,We.randomBytesHex)(8),p=E=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,a.method,E),f?.()};return this.ui.inlineAddEthereumChain(t)||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((E,N)=>{this.relayEventManager.callbacks.set(g,$=>{if(f?.(),(0,lr.isErrorResponse)($))return N(new Error($.errorMessage));E($)});const H=$=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},D=$=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:$}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:H,onApprove:D,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(g,a)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,We.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,f)=>{this.relayEventManager.callbacks.set(i,M=>{if((0,lr.isErrorResponse)(M)&&M.errorCode)return f(Nr.standardErrors.provider.custom({code:M.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,lr.isErrorResponse)(M))return f(new Error(M.errorMessage));a(M)});const g=M=>{var E;if(M){const N=(E=(0,Nr.getErrorCode)(M))!==null&&E!==void 0?E:Nr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",M instanceof Error?M:Nr.standardErrors.provider.unsupportedChain(t),N)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=M=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:M}}})};this.ui.switchEthereumChain({onCancel:g,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Ht.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}yn.WalletLinkRelay=Ot;Ot.accountRequestCallbackIds=new Set;var kn={},Bi={},Sc={};(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,a)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(to,e)})(Sc);var no={};Object.defineProperty(no,"__esModule",{value:!0});no.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Rc=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.RedirectDialog=void 0;const Jd=Rc(Cn),xt=ot,Zd=Mn,Kd=Sc,Qd=Rc(no);class Yd{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,Zd.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,xt.render)(null,this.root),t&&(0,xt.render)((0,xt.h)(Xd,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Bi.RedirectDialog=Yd;const Xd=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,xt.h)(Kd.SnackbarContainer,{darkMode:r},(0,xt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,xt.h)("style",null,Qd.default),(0,xt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,xt.h)("div",{class:(0,Jd.default)("-cbwsdk-redirect-dialog-box",s)},(0,xt.h)("p",null,e),(0,xt.h)("button",{onClick:n},t))))};Object.defineProperty(kn,"__esModule",{value:!0});kn.MobileRelayUI=void 0;const ef=Bi;class tf{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new ef.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}kn.MobileRelayUI=tf;Object.defineProperty(wn,"__esModule",{value:!0});wn.MobileRelay=void 0;const rf=X,nf=yn,sf=kn;class of extends nf.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,rf.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof sf.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}wn.MobileRelay=of;var Os={exports:{}},Mc=ii.EventEmitter,ps,Go;function af(){if(Go)return ps;Go=1;function e(H,D){var $=Object.keys(H);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(H);D&&(x=x.filter(function(L){return Object.getOwnPropertyDescriptor(H,L).enumerable})),$.push.apply($,x)}return $}function t(H){for(var D=1;D<arguments.length;D++){var $=arguments[D]!=null?arguments[D]:{};D%2?e(Object($),!0).forEach(function(x){r(H,x,$[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors($)):e(Object($)).forEach(function(x){Object.defineProperty(H,x,Object.getOwnPropertyDescriptor($,x))})}return H}function r(H,D,$){return D=c(D),D in H?Object.defineProperty(H,D,{value:$,enumerable:!0,configurable:!0,writable:!0}):H[D]=$,H}function n(H,D){if(!(H instanceof D))throw new TypeError("Cannot call a class as a function")}function i(H,D){for(var $=0;$<D.length;$++){var x=D[$];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(H,c(x.key),x)}}function s(H,D,$){return D&&i(H.prototype,D),Object.defineProperty(H,"prototype",{writable:!1}),H}function c(H){var D=a(H,"string");return typeof D=="symbol"?D:String(D)}function a(H,D){if(typeof H!="object"||H===null)return H;var $=H[Symbol.toPrimitive];if($!==void 0){var x=$.call(H,D);if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}var f=bn,g=f.Buffer,p=Vs,M=p.inspect,E=M&&M.custom||"inspect";function N(H,D,$){g.prototype.copy.call(H,D,$)}return ps=function(){function H(){n(this,H),this.head=null,this.tail=null,this.length=0}return s(H,[{key:"push",value:function($){var x={data:$,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function($){var x={data:$,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var $=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,$}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function($){if(this.length===0)return"";for(var x=this.head,L=""+x.data;x=x.next;)L+=$+x.data;return L}},{key:"concat",value:function($){if(this.length===0)return g.alloc(0);for(var x=g.allocUnsafe($>>>0),L=this.head,O=0;L;)N(L.data,x,O),O+=L.data.length,L=L.next;return x}},{key:"consume",value:function($,x){var L;return $<this.head.data.length?(L=this.head.data.slice(0,$),this.head.data=this.head.data.slice($)):$===this.head.data.length?L=this.shift():L=x?this._getString($):this._getBuffer($),L}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function($){var x=this.head,L=1,O=x.data;for($-=O.length;x=x.next;){var V=x.data,j=$>V.length?V.length:$;if(j===V.length?O+=V:O+=V.slice(0,$),$-=j,$===0){j===V.length?(++L,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=V.slice(j));break}++L}return this.length-=L,O}},{key:"_getBuffer",value:function($){var x=g.allocUnsafe($),L=this.head,O=1;for(L.data.copy(x),$-=L.data.length;L=L.next;){var V=L.data,j=$>V.length?V.length:$;if(V.copy(x,x.length-$,0,j),$-=j,$===0){j===V.length?(++O,L.next?this.head=L.next:this.head=this.tail=null):(this.head=L,L.data=V.slice(j));break}++O}return this.length-=O,x}},{key:E,value:function($,x){return M(this,t(t({},x),{},{depth:0,customInspect:!1}))}}]),H}(),ps}function cf(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Fs,this,e)):process.nextTick(Fs,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Xn,r):(r._writableState.errorEmitted=!0,process.nextTick(Jo,r,s)):process.nextTick(Jo,r,s):t?(process.nextTick(Xn,r),t(s)):process.nextTick(Xn,r)}),this)}function Jo(e,t){Fs(e,t),Xn(e)}function Xn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function lf(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Fs(e,t){e.emit("error",t)}function uf(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Cc={destroy:cf,undestroy:lf,errorOrDestroy:uf},yr={};function hf(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var kc={};function bt(e,t,r){r||(r=Error);function n(s,c,a){return typeof t=="string"?t:t(s,c,a)}var i=function(s){hf(c,s);function c(a,f,g){return s.call(this,n(a,f,g))||this}return c}(r);i.prototype.name=r.name,i.prototype.code=e,kc[e]=i}function Zo(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function df(e,t,r){return e.substr(0,t.length)===t}function ff(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function pf(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}bt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);bt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&df(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(ff(e," argument"))i="The ".concat(e," ").concat(n," ").concat(Zo(t,"type"));else{var s=pf(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(Zo(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);bt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");bt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});bt("ERR_STREAM_PREMATURE_CLOSE","Premature close");bt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});bt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");bt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");bt("ERR_STREAM_WRITE_AFTER_END","write after end");bt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);bt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);bt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");yr.codes=kc;var gf=yr.codes.ERR_INVALID_OPT_VALUE;function mf(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function wf(e,t,r,n){var i=mf(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new gf(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Ic={getHighWaterMark:wf},yf=bf;function bf(e,t){if(gs("noDeprecation"))return e;var r=!1;function n(){if(!r){if(gs("throwDeprecation"))throw new Error(t);gs("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function gs(e){try{if(!ee.localStorage)return!1}catch{return!1}var t=ee.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var ms,Ko;function xc(){if(Ko)return ms;Ko=1,ms=Y;function e(A){var P=this;this.next=null,this.entry=null,this.finish=function(){J(P,A)}}var t;Y.WritableState=q;var r={deprecate:yf},n=Mc,i=bn.Buffer,s=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(A){return i.from(A)}function a(A){return i.isBuffer(A)||A instanceof s}var f=Cc,g=Ic,p=g.getHighWaterMark,M=yr.codes,E=M.ERR_INVALID_ARG_TYPE,N=M.ERR_METHOD_NOT_IMPLEMENTED,H=M.ERR_MULTIPLE_CALLBACK,D=M.ERR_STREAM_CANNOT_PIPE,$=M.ERR_STREAM_DESTROYED,x=M.ERR_STREAM_NULL_VALUES,L=M.ERR_STREAM_WRITE_AFTER_END,O=M.ERR_UNKNOWN_ENCODING,V=f.errorOrDestroy;St(Y,n);function j(){}function q(A,P,W){t=t||Vr(),A=A||{},typeof W!="boolean"&&(W=P instanceof t),this.objectMode=!!A.objectMode,W&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=p(this,A,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Z=A.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){w(P,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}q.prototype.getBuffer=function(){for(var P=this.bufferedRequest,W=[];P;)W.push(P),P=P.next;return W},function(){try{Object.defineProperty(q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var te;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(te=Function.prototype[Symbol.hasInstance],Object.defineProperty(Y,Symbol.hasInstance,{value:function(P){return te.call(this,P)?!0:this!==Y?!1:P&&P._writableState instanceof q}})):te=function(P){return P instanceof this};function Y(A){t=t||Vr();var P=this instanceof t;if(!P&&!te.call(Y,this))return new Y(A);this._writableState=new q(A,this,P),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),n.call(this)}Y.prototype.pipe=function(){V(this,new D)};function Q(A,P){var W=new L;V(A,W),process.nextTick(P,W)}function fe(A,P,W,Z){var le;return W===null?le=new x:typeof W!="string"&&!P.objectMode&&(le=new E("chunk",["string","Buffer"],W)),le?(V(A,le),process.nextTick(Z,le),!1):!0}Y.prototype.write=function(A,P,W){var Z=this._writableState,le=!1,R=!Z.objectMode&&a(A);return R&&!i.isBuffer(A)&&(A=c(A)),typeof P=="function"&&(W=P,P=null),R?P="buffer":P||(P=Z.defaultEncoding),typeof W!="function"&&(W=j),Z.ending?Q(this,W):(R||fe(this,Z,A,W))&&(Z.pendingcb++,le=pe(this,Z,R,A,P,W)),le},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&k(this,A))},Y.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=P.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((P+"").toLowerCase())>-1))throw new O(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(Y.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(A,P,W){return!A.objectMode&&A.decodeStrings!==!1&&typeof P=="string"&&(P=i.from(P,W)),P}Object.defineProperty(Y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(A,P,W,Z,le,R){if(!W){var C=oe(P,Z,le);Z!==C&&(W=!0,le="buffer",Z=C)}var z=P.objectMode?1:Z.length;P.length+=z;var G=P.length<P.highWaterMark;if(G||(P.needDrain=!0),P.writing||P.corked){var se=P.lastBufferedRequest;P.lastBufferedRequest={chunk:Z,encoding:le,isBuf:W,callback:R,next:null},se?se.next=P.lastBufferedRequest:P.bufferedRequest=P.lastBufferedRequest,P.bufferedRequestCount+=1}else I(A,P,!1,z,Z,le,R);return G}function I(A,P,W,Z,le,R,C){P.writelen=Z,P.writecb=C,P.writing=!0,P.sync=!0,P.destroyed?P.onwrite(new $("write")):W?A._writev(le,P.onwrite):A._write(le,R,P.onwrite),P.sync=!1}function o(A,P,W,Z,le){--P.pendingcb,W?(process.nextTick(le,Z),process.nextTick(S,A,P),A._writableState.errorEmitted=!0,V(A,Z)):(le(Z),A._writableState.errorEmitted=!0,V(A,Z),S(A,P))}function d(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}function w(A,P){var W=A._writableState,Z=W.sync,le=W.writecb;if(typeof le!="function")throw new H;if(d(W),P)o(A,W,Z,P,le);else{var R=T(W)||A.destroyed;!R&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&k(A,W),Z?process.nextTick(y,A,W,R,le):y(A,W,R,le)}}function y(A,P,W,Z){W||_(A,P),P.pendingcb--,Z(),S(A,P)}function _(A,P){P.length===0&&P.needDrain&&(P.needDrain=!1,A.emit("drain"))}function k(A,P){P.bufferProcessing=!0;var W=P.bufferedRequest;if(A._writev&&W&&W.next){var Z=P.bufferedRequestCount,le=new Array(Z),R=P.corkedRequestsFree;R.entry=W;for(var C=0,z=!0;W;)le[C]=W,W.isBuf||(z=!1),W=W.next,C+=1;le.allBuffers=z,I(A,P,!0,P.length,le,"",R.finish),P.pendingcb++,P.lastBufferedRequest=null,R.next?(P.corkedRequestsFree=R.next,R.next=null):P.corkedRequestsFree=new e(P),P.bufferedRequestCount=0}else{for(;W;){var G=W.chunk,se=W.encoding,ue=W.callback,re=P.objectMode?1:G.length;if(I(A,P,!1,re,G,se,ue),W=W.next,P.bufferedRequestCount--,P.writing)break}W===null&&(P.lastBufferedRequest=null)}P.bufferedRequest=W,P.bufferProcessing=!1}Y.prototype._write=function(A,P,W){W(new N("_write()"))},Y.prototype._writev=null,Y.prototype.end=function(A,P,W){var Z=this._writableState;return typeof A=="function"?(W=A,A=null,P=null):typeof P=="function"&&(W=P,P=null),A!=null&&this.write(A,P),Z.corked&&(Z.corked=1,this.uncork()),Z.ending||K(this,Z,W),this},Object.defineProperty(Y.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function T(A){return A.ending&&A.length===0&&A.bufferedRequest===null&&!A.finished&&!A.writing}function b(A,P){A._final(function(W){P.pendingcb--,W&&V(A,W),P.prefinished=!0,A.emit("prefinish"),S(A,P)})}function u(A,P){!P.prefinished&&!P.finalCalled&&(typeof A._final=="function"&&!P.destroyed?(P.pendingcb++,P.finalCalled=!0,process.nextTick(b,A,P)):(P.prefinished=!0,A.emit("prefinish")))}function S(A,P){var W=T(P);if(W&&(u(A,P),P.pendingcb===0&&(P.finished=!0,A.emit("finish"),P.autoDestroy))){var Z=A._readableState;(!Z||Z.autoDestroy&&Z.endEmitted)&&A.destroy()}return W}function K(A,P,W){P.ending=!0,S(A,P),W&&(P.finished?process.nextTick(W):A.once("finish",W)),P.ended=!0,A.writable=!1}function J(A,P,W){var Z=A.entry;for(A.entry=null;Z;){var le=Z.callback;P.pendingcb--,le(W),Z=Z.next}P.corkedRequestsFree.next=A}return Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),Y.prototype.destroy=f.destroy,Y.prototype._undestroy=f.undestroy,Y.prototype._destroy=function(A,P){P(A)},ms}var ws,Qo;function Vr(){if(Qo)return ws;Qo=1;var e=Object.keys||function(g){var p=[];for(var M in g)p.push(M);return p};ws=c;var t=Tc(),r=xc();St(c,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];c.prototype[s]||(c.prototype[s]=r.prototype[s])}function c(g){if(!(this instanceof c))return new c(g);t.call(this,g),r.call(this,g),this.allowHalfOpen=!0,g&&(g.readable===!1&&(this.readable=!1),g.writable===!1&&(this.writable=!1),g.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(f,this)}function f(g){g.end()}return Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),ws}var ys={},Yo;function Xo(){if(Yo)return ys;Yo=1;var e=jt.Buffer,t=e.isEncoding||function(x){switch(x=""+x,x&&x.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(x){if(!x)return"utf8";for(var L;;)switch(x){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return x;default:if(L)return;x=(""+x).toLowerCase(),L=!0}}function n(x){var L=r(x);if(typeof L!="string"&&(e.isEncoding===t||!t(x)))throw new Error("Unknown encoding: "+x);return L||x}ys.StringDecoder=i;function i(x){this.encoding=n(x);var L;switch(this.encoding){case"utf16le":this.text=M,this.end=E,L=4;break;case"utf8":this.fillLast=f,L=4;break;case"base64":this.text=N,this.end=H,L=3;break;default:this.write=D,this.end=$;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(L)}i.prototype.write=function(x){if(x.length===0)return"";var L,O;if(this.lastNeed){if(L=this.fillLast(x),L===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O<x.length?L?L+this.text(x,O):this.text(x,O):L||""},i.prototype.end=p,i.prototype.text=g,i.prototype.fillLast=function(x){if(this.lastNeed<=x.length)return x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,x.length),this.lastNeed-=x.length};function s(x){return x<=127?0:x>>5===6?2:x>>4===14?3:x>>3===30?4:x>>6===2?-1:-2}function c(x,L,O){var V=L.length-1;if(V<O)return 0;var j=s(L[V]);return j>=0?(j>0&&(x.lastNeed=j-1),j):--V<O||j===-2?0:(j=s(L[V]),j>=0?(j>0&&(x.lastNeed=j-2),j):--V<O||j===-2?0:(j=s(L[V]),j>=0?(j>0&&(j===2?j=0:x.lastNeed=j-3),j):0))}function a(x,L,O){if((L[0]&192)!==128)return x.lastNeed=0,"�";if(x.lastNeed>1&&L.length>1){if((L[1]&192)!==128)return x.lastNeed=1,"�";if(x.lastNeed>2&&L.length>2&&(L[2]&192)!==128)return x.lastNeed=2,"�"}}function f(x){var L=this.lastTotal-this.lastNeed,O=a(this,x);if(O!==void 0)return O;if(this.lastNeed<=x.length)return x.copy(this.lastChar,L,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,L,0,x.length),this.lastNeed-=x.length}function g(x,L){var O=c(this,x,L);if(!this.lastNeed)return x.toString("utf8",L);this.lastTotal=O;var V=x.length-(O-this.lastNeed);return x.copy(this.lastChar,0,V),x.toString("utf8",L,V)}function p(x){var L=x&&x.length?this.write(x):"";return this.lastNeed?L+"�":L}function M(x,L){if((x.length-L)%2===0){var O=x.toString("utf16le",L);if(O){var V=O.charCodeAt(O.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=x[x.length-1],x.toString("utf16le",L,x.length-1)}function E(x){var L=x&&x.length?this.write(x):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return L+this.lastChar.toString("utf16le",0,O)}return L}function N(x,L){var O=(x.length-L)%3;return O===0?x.toString("base64",L):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=x[x.length-1]:(this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1]),x.toString("base64",L,x.length-O))}function H(x){var L=x&&x.length?this.write(x):"";return this.lastNeed?L+this.lastChar.toString("base64",0,3-this.lastNeed):L}function D(x){return x.toString(this.encoding)}function $(x){return x&&x.length?this.write(x):""}return ys}var ea=yr.codes.ERR_STREAM_PREMATURE_CLOSE;function vf(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function _f(){}function Ef(e){return e.setHeader&&typeof e.abort=="function"}function Ac(e,t,r){if(typeof t=="function")return Ac(e,null,t);t||(t={}),r=vf(r||_f);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||a()},c=e._writableState&&e._writableState.finished,a=function(){i=!1,c=!0,n||r.call(e)},f=e._readableState&&e._readableState.endEmitted,g=function(){n=!1,f=!0,i||r.call(e)},p=function(H){r.call(e,H)},M=function(){var H;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(H=new ea),r.call(e,H);if(i&&!c)return(!e._writableState||!e._writableState.ended)&&(H=new ea),r.call(e,H)},E=function(){e.req.on("finish",a)};return Ef(e)?(e.on("complete",a),e.on("abort",M),e.req?E():e.on("request",E)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",g),e.on("finish",a),t.error!==!1&&e.on("error",p),e.on("close",M),function(){e.removeListener("complete",a),e.removeListener("abort",M),e.removeListener("request",E),e.req&&e.req.removeListener("finish",a),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",a),e.removeListener("end",g),e.removeListener("error",p),e.removeListener("close",M)}}var io=Ac,bs,ta;function Sf(){if(ta)return bs;ta=1;var e;function t(O,V,j){return V=r(V),V in O?Object.defineProperty(O,V,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[V]=j,O}function r(O){var V=n(O,"string");return typeof V=="symbol"?V:String(V)}function n(O,V){if(typeof O!="object"||O===null)return O;var j=O[Symbol.toPrimitive];if(j!==void 0){var q=j.call(O,V);if(typeof q!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(O)}var i=io,s=Symbol("lastResolve"),c=Symbol("lastReject"),a=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),p=Symbol("handlePromise"),M=Symbol("stream");function E(O,V){return{value:O,done:V}}function N(O){var V=O[s];if(V!==null){var j=O[M].read();j!==null&&(O[g]=null,O[s]=null,O[c]=null,V(E(j,!1)))}}function H(O){process.nextTick(N,O)}function D(O,V){return function(j,q){O.then(function(){if(V[f]){j(E(void 0,!0));return}V[p](j,q)},q)}}var $=Object.getPrototypeOf(function(){}),x=Object.setPrototypeOf((e={get stream(){return this[M]},next:function(){var V=this,j=this[a];if(j!==null)return Promise.reject(j);if(this[f])return Promise.resolve(E(void 0,!0));if(this[M].destroyed)return new Promise(function(Q,fe){process.nextTick(function(){V[a]?fe(V[a]):Q(E(void 0,!0))})});var q=this[g],te;if(q)te=new Promise(D(q,this));else{var Y=this[M].read();if(Y!==null)return Promise.resolve(E(Y,!1));te=new Promise(this[p])}return this[g]=te,te}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var V=this;return new Promise(function(j,q){V[M].destroy(null,function(te){if(te){q(te);return}j(E(void 0,!0))})})}),e),$),L=function(V){var j,q=Object.create(x,(j={},t(j,M,{value:V,writable:!0}),t(j,s,{value:null,writable:!0}),t(j,c,{value:null,writable:!0}),t(j,a,{value:null,writable:!0}),t(j,f,{value:V._readableState.endEmitted,writable:!0}),t(j,p,{value:function(Y,Q){var fe=q[M].read();fe?(q[g]=null,q[s]=null,q[c]=null,Y(E(fe,!1))):(q[s]=Y,q[c]=Q)},writable:!0}),j));return q[g]=null,i(V,function(te){if(te&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Y=q[c];Y!==null&&(q[g]=null,q[s]=null,q[c]=null,Y(te)),q[a]=te;return}var Q=q[s];Q!==null&&(q[g]=null,q[s]=null,q[c]=null,Q(E(void 0,!0))),q[f]=!0}),V.on("readable",H.bind(null,q)),q};return bs=L,bs}var vs,ra;function Rf(){return ra||(ra=1,vs=function(){throw new Error("Readable.from is not available in the browser")}),vs}var _s,na;function Tc(){if(na)return _s;na=1,_s=Q;var e;Q.ReadableState=Y,ii.EventEmitter;var t=function(C,z){return C.listeners(z).length},r=Mc,n=bn.Buffer,i=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(R){return n.from(R)}function c(R){return n.isBuffer(R)||R instanceof i}var a=Vs,f;a&&a.debuglog?f=a.debuglog("stream"):f=function(){};var g=af(),p=Cc,M=Ic,E=M.getHighWaterMark,N=yr.codes,H=N.ERR_INVALID_ARG_TYPE,D=N.ERR_STREAM_PUSH_AFTER_EOF,$=N.ERR_METHOD_NOT_IMPLEMENTED,x=N.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,L,O,V;St(Q,r);var j=p.errorOrDestroy,q=["error","close","destroy","pause","resume"];function te(R,C,z){if(typeof R.prependListener=="function")return R.prependListener(C,z);!R._events||!R._events[C]?R.on(C,z):Array.isArray(R._events[C])?R._events[C].unshift(z):R._events[C]=[z,R._events[C]]}function Y(R,C,z){e=e||Vr(),R=R||{},typeof z!="boolean"&&(z=C instanceof e),this.objectMode=!!R.objectMode,z&&(this.objectMode=this.objectMode||!!R.readableObjectMode),this.highWaterMark=E(this,R,"readableHighWaterMark",z),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(L||(L=Xo().StringDecoder),this.decoder=new L(R.encoding),this.encoding=R.encoding)}function Q(R){if(e=e||Vr(),!(this instanceof Q))return new Q(R);var C=this instanceof e;this._readableState=new Y(R,this,C),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),r.call(this)}Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(C){this._readableState&&(this._readableState.destroyed=C)}}),Q.prototype.destroy=p.destroy,Q.prototype._undestroy=p.undestroy,Q.prototype._destroy=function(R,C){C(R)},Q.prototype.push=function(R,C){var z=this._readableState,G;return z.objectMode?G=!0:typeof R=="string"&&(C=C||z.defaultEncoding,C!==z.encoding&&(R=n.from(R,C),C=""),G=!0),fe(this,R,C,!1,G)},Q.prototype.unshift=function(R){return fe(this,R,null,!0,!1)};function fe(R,C,z,G,se){f("readableAddChunk",C);var ue=R._readableState;if(C===null)ue.reading=!1,w(R,ue);else{var re;if(se||(re=pe(ue,C)),re)j(R,re);else if(ue.objectMode||C&&C.length>0)if(typeof C!="string"&&!ue.objectMode&&Object.getPrototypeOf(C)!==n.prototype&&(C=s(C)),G)ue.endEmitted?j(R,new x):oe(R,ue,C,!0);else if(ue.ended)j(R,new D);else{if(ue.destroyed)return!1;ue.reading=!1,ue.decoder&&!z?(C=ue.decoder.write(C),ue.objectMode||C.length!==0?oe(R,ue,C,!1):k(R,ue)):oe(R,ue,C,!1)}else G||(ue.reading=!1,k(R,ue))}return!ue.ended&&(ue.length<ue.highWaterMark||ue.length===0)}function oe(R,C,z,G){C.flowing&&C.length===0&&!C.sync?(C.awaitDrain=0,R.emit("data",z)):(C.length+=C.objectMode?1:z.length,G?C.buffer.unshift(z):C.buffer.push(z),C.needReadable&&y(R)),k(R,C)}function pe(R,C){var z;return!c(C)&&typeof C!="string"&&C!==void 0&&!R.objectMode&&(z=new H("chunk",["string","Buffer","Uint8Array"],C)),z}Q.prototype.isPaused=function(){return this._readableState.flowing===!1},Q.prototype.setEncoding=function(R){L||(L=Xo().StringDecoder);var C=new L(R);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;for(var z=this._readableState.buffer.head,G="";z!==null;)G+=C.write(z.data),z=z.next;return this._readableState.buffer.clear(),G!==""&&this._readableState.buffer.push(G),this._readableState.length=G.length,this};var I=1073741824;function o(R){return R>=I?R=I:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function d(R,C){return R<=0||C.length===0&&C.ended?0:C.objectMode?1:R!==R?C.flowing&&C.length?C.buffer.head.data.length:C.length:(R>C.highWaterMark&&(C.highWaterMark=o(R)),R<=C.length?R:C.ended?C.length:(C.needReadable=!0,0))}Q.prototype.read=function(R){f("read",R),R=parseInt(R,10);var C=this._readableState,z=R;if(R!==0&&(C.emittedReadable=!1),R===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return f("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?W(this):y(this),null;if(R=d(R,C),R===0&&C.ended)return C.length===0&&W(this),null;var G=C.needReadable;f("need readable",G),(C.length===0||C.length-R<C.highWaterMark)&&(G=!0,f("length less than watermark",G)),C.ended||C.reading?(G=!1,f("reading or ended",G)):G&&(f("do read"),C.reading=!0,C.sync=!0,C.length===0&&(C.needReadable=!0),this._read(C.highWaterMark),C.sync=!1,C.reading||(R=d(z,C)));var se;return R>0?se=P(R,C):se=null,se===null?(C.needReadable=C.length<=C.highWaterMark,R=0):(C.length-=R,C.awaitDrain=0),C.length===0&&(C.ended||(C.needReadable=!0),z!==R&&C.ended&&W(this)),se!==null&&this.emit("data",se),se};function w(R,C){if(f("onEofChunk"),!C.ended){if(C.decoder){var z=C.decoder.end();z&&z.length&&(C.buffer.push(z),C.length+=C.objectMode?1:z.length)}C.ended=!0,C.sync?y(R):(C.needReadable=!1,C.emittedReadable||(C.emittedReadable=!0,_(R)))}}function y(R){var C=R._readableState;f("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(f("emitReadable",C.flowing),C.emittedReadable=!0,process.nextTick(_,R))}function _(R){var C=R._readableState;f("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&(C.length||C.ended)&&(R.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,A(R)}function k(R,C){C.readingMore||(C.readingMore=!0,process.nextTick(T,R,C))}function T(R,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){var z=C.length;if(f("maybeReadMore read 0"),R.read(0),z===C.length)break}C.readingMore=!1}Q.prototype._read=function(R){j(this,new $("_read()"))},Q.prototype.pipe=function(R,C){var z=this,G=this._readableState;switch(G.pipesCount){case 0:G.pipes=R;break;case 1:G.pipes=[G.pipes,R];break;default:G.pipes.push(R);break}G.pipesCount+=1,f("pipe count=%d opts=%j",G.pipesCount,C);var se=(!C||C.end!==!1)&&R!==process.stdout&&R!==process.stderr,ue=se?be:_e;G.endEmitted?process.nextTick(ue):z.once("end",ue),R.on("unpipe",re);function re(m,l){f("onunpipe"),m===z&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Ee())}function be(){f("onend"),R.end()}var ht=b(z);R.on("drain",ht);var Se=!1;function Ee(){f("cleanup"),R.removeListener("close",Re),R.removeListener("finish",Qe),R.removeListener("drain",ht),R.removeListener("error",ve),R.removeListener("unpipe",re),z.removeListener("end",be),z.removeListener("end",_e),z.removeListener("data",Je),Se=!0,G.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&ht()}z.on("data",Je);function Je(m){f("ondata");var l=R.write(m);f("dest.write",l),l===!1&&((G.pipesCount===1&&G.pipes===R||G.pipesCount>1&&le(G.pipes,R)!==-1)&&!Se&&(f("false write response, pause",G.awaitDrain),G.awaitDrain++),z.pause())}function ve(m){f("onerror",m),_e(),R.removeListener("error",ve),t(R,"error")===0&&j(R,m)}te(R,"error",ve);function Re(){R.removeListener("finish",Qe),_e()}R.once("close",Re);function Qe(){f("onfinish"),R.removeListener("close",Re),_e()}R.once("finish",Qe);function _e(){f("unpipe"),z.unpipe(R)}return R.emit("pipe",z),G.flowing||(f("pipe resume"),z.resume()),R};function b(R){return function(){var z=R._readableState;f("pipeOnDrain",z.awaitDrain),z.awaitDrain&&z.awaitDrain--,z.awaitDrain===0&&t(R,"data")&&(z.flowing=!0,A(R))}}Q.prototype.unpipe=function(R){var C=this._readableState,z={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return R&&R!==C.pipes?this:(R||(R=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,R&&R.emit("unpipe",this,z),this);if(!R){var G=C.pipes,se=C.pipesCount;C.pipes=null,C.pipesCount=0,C.flowing=!1;for(var ue=0;ue<se;ue++)G[ue].emit("unpipe",this,{hasUnpiped:!1});return this}var re=le(C.pipes,R);return re===-1?this:(C.pipes.splice(re,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),R.emit("unpipe",this,z),this)},Q.prototype.on=function(R,C){var z=r.prototype.on.call(this,R,C),G=this._readableState;return R==="data"?(G.readableListening=this.listenerCount("readable")>0,G.flowing!==!1&&this.resume()):R==="readable"&&!G.endEmitted&&!G.readableListening&&(G.readableListening=G.needReadable=!0,G.flowing=!1,G.emittedReadable=!1,f("on readable",G.length,G.reading),G.length?y(this):G.reading||process.nextTick(S,this)),z},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(R,C){var z=r.prototype.removeListener.call(this,R,C);return R==="readable"&&process.nextTick(u,this),z},Q.prototype.removeAllListeners=function(R){var C=r.prototype.removeAllListeners.apply(this,arguments);return(R==="readable"||R===void 0)&&process.nextTick(u,this),C};function u(R){var C=R._readableState;C.readableListening=R.listenerCount("readable")>0,C.resumeScheduled&&!C.paused?C.flowing=!0:R.listenerCount("data")>0&&R.resume()}function S(R){f("readable nexttick read 0"),R.read(0)}Q.prototype.resume=function(){var R=this._readableState;return R.flowing||(f("resume"),R.flowing=!R.readableListening,K(this,R)),R.paused=!1,this};function K(R,C){C.resumeScheduled||(C.resumeScheduled=!0,process.nextTick(J,R,C))}function J(R,C){f("resume",C.reading),C.reading||R.read(0),C.resumeScheduled=!1,R.emit("resume"),A(R),C.flowing&&!C.reading&&R.read(0)}Q.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(R){var C=R._readableState;for(f("flow",C.flowing);C.flowing&&R.read()!==null;);}Q.prototype.wrap=function(R){var C=this,z=this._readableState,G=!1;R.on("end",function(){if(f("wrapped end"),z.decoder&&!z.ended){var re=z.decoder.end();re&&re.length&&C.push(re)}C.push(null)}),R.on("data",function(re){if(f("wrapped data"),z.decoder&&(re=z.decoder.write(re)),!(z.objectMode&&re==null)&&!(!z.objectMode&&(!re||!re.length))){var be=C.push(re);be||(G=!0,R.pause())}});for(var se in R)this[se]===void 0&&typeof R[se]=="function"&&(this[se]=function(be){return function(){return R[be].apply(R,arguments)}}(se));for(var ue=0;ue<q.length;ue++)R.on(q[ue],this.emit.bind(this,q[ue]));return this._read=function(re){f("wrapped _read",re),G&&(G=!1,R.resume())},this},typeof Symbol=="function"&&(Q.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=Sf()),O(this)}),Object.defineProperty(Q.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Q.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Q.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(C){this._readableState&&(this._readableState.flowing=C)}}),Q._fromList=P,Object.defineProperty(Q.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function P(R,C){if(C.length===0)return null;var z;return C.objectMode?z=C.buffer.shift():!R||R>=C.length?(C.decoder?z=C.buffer.join(""):C.buffer.length===1?z=C.buffer.first():z=C.buffer.concat(C.length),C.buffer.clear()):z=C.buffer.consume(R,C.decoder),z}function W(R){var C=R._readableState;f("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,process.nextTick(Z,C,R))}function Z(R,C){if(f("endReadableNT",R.endEmitted,R.length),!R.endEmitted&&R.length===0&&(R.endEmitted=!0,C.readable=!1,C.emit("end"),R.autoDestroy)){var z=C._writableState;(!z||z.autoDestroy&&z.finished)&&C.destroy()}}typeof Symbol=="function"&&(Q.from=function(R,C){return V===void 0&&(V=Rf()),V(Q,R,C)});function le(R,C){for(var z=0,G=R.length;z<G;z++)if(R[z]===C)return z;return-1}return _s}var Bc=Dt,Ni=yr.codes,Mf=Ni.ERR_METHOD_NOT_IMPLEMENTED,Cf=Ni.ERR_MULTIPLE_CALLBACK,kf=Ni.ERR_TRANSFORM_ALREADY_TRANSFORMING,If=Ni.ERR_TRANSFORM_WITH_LENGTH_0,Li=Vr();St(Dt,Li);function xf(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Cf);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dt(e){if(!(this instanceof Dt))return new Dt(e);Li.call(this,e),this._transformState={afterTransform:xf.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Af)}function Af(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){ia(e,t,r)}):ia(this,null,null)}Dt.prototype.push=function(e,t){return this._transformState.needTransform=!1,Li.prototype.push.call(this,e,t)};Dt.prototype._transform=function(e,t,r){r(new Mf("_transform()"))};Dt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dt.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Dt.prototype._destroy=function(e,t){Li.prototype._destroy.call(this,e,function(r){t(r)})};function ia(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new If;if(e._transformState.transforming)throw new kf;return e.push(null)}var Tf=ln,Nc=Bc;St(ln,Nc);function ln(e){if(!(this instanceof ln))return new ln(e);Nc.call(this,e)}ln.prototype._transform=function(e,t,r){r(null,e)};var Es;function Bf(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Lc=yr.codes,Nf=Lc.ERR_MISSING_ARGS,Lf=Lc.ERR_STREAM_DESTROYED;function sa(e){if(e)throw e}function Pf(e){return e.setHeader&&typeof e.abort=="function"}function Of(e,t,r,n){n=Bf(n);var i=!1;e.on("close",function(){i=!0}),Es===void 0&&(Es=io),Es(e,{readable:t,writable:r},function(c){if(c)return n(c);i=!0,n()});var s=!1;return function(c){if(!i&&!s){if(s=!0,Pf(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(c||new Lf("pipe"))}}}function oa(e){e()}function Ff(e,t){return e.pipe(t)}function Df(e){return!e.length||typeof e[e.length-1]!="function"?sa:e.pop()}function jf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Df(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Nf("streams");var i,s=t.map(function(c,a){var f=a<t.length-1,g=a>0;return Of(c,f,g,function(p){i||(i=p),p&&s.forEach(oa),!f&&(s.forEach(oa),n(i))})});return t.reduce(Ff)}var Uf=jf;(function(e,t){t=e.exports=Tc(),t.Stream=t,t.Readable=t,t.Writable=xc(),t.Duplex=Vr(),t.Transform=Bc,t.PassThrough=Tf,t.finished=io,t.pipeline=Uf})(Os,Os.exports);var Pc=Os.exports;const{Transform:Hf}=Pc;var $f=e=>class Oc extends Hf{constructor(r,n,i,s,c){super(c),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=c,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(c){s=c}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Oc(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Wf}=Pc;var Vf=e=>class Fc extends Wf{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(c){s=c}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Fc(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const zf=$f,qf=Vf;var Gf=function(e){const t=zf(e),r=qf(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Dc={};const aa=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Dc.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],g=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],M=e[9]^e[19]^e[29]^e[39]^e[49];let E=p^(i<<1|s>>>31),N=M^(s<<1|i>>>31);const H=e[0]^E,D=e[1]^N,$=e[10]^E,x=e[11]^N,L=e[20]^E,O=e[21]^N,V=e[30]^E,j=e[31]^N,q=e[40]^E,te=e[41]^N;E=r^(c<<1|a>>>31),N=n^(a<<1|c>>>31);const Y=e[2]^E,Q=e[3]^N,fe=e[12]^E,oe=e[13]^N,pe=e[22]^E,I=e[23]^N,o=e[32]^E,d=e[33]^N,w=e[42]^E,y=e[43]^N;E=i^(f<<1|g>>>31),N=s^(g<<1|f>>>31);const _=e[4]^E,k=e[5]^N,T=e[14]^E,b=e[15]^N,u=e[24]^E,S=e[25]^N,K=e[34]^E,J=e[35]^N,A=e[44]^E,P=e[45]^N;E=c^(p<<1|M>>>31),N=a^(M<<1|p>>>31);const W=e[6]^E,Z=e[7]^N,le=e[16]^E,R=e[17]^N,C=e[26]^E,z=e[27]^N,G=e[36]^E,se=e[37]^N,ue=e[46]^E,re=e[47]^N;E=f^(r<<1|n>>>31),N=g^(n<<1|r>>>31);const be=e[8]^E,ht=e[9]^N,Se=e[18]^E,Ee=e[19]^N,Je=e[28]^E,ve=e[29]^N,Re=e[38]^E,Qe=e[39]^N,_e=e[48]^E,m=e[49]^N,l=H,h=D,v=x<<4|$>>>28,B=$<<4|x>>>28,F=L<<3|O>>>29,U=O<<3|L>>>29,he=j<<9|V>>>23,ae=V<<9|j>>>23,ie=q<<18|te>>>14,Me=te<<18|q>>>14,ne=Y<<1|Q>>>31,Ce=Q<<1|Y>>>31,_r=oe<<12|fe>>>20,ke=fe<<12|oe>>>20,Ie=pe<<10|I>>>22,Er=I<<10|pe>>>22,xe=d<<13|o>>>19,Ae=o<<13|d>>>19,Sr=w<<2|y>>>30,Te=y<<2|w>>>30,Be=k<<30|_>>>2,Rr=_<<30|k>>>2,Ne=T<<6|b>>>26,Le=b<<6|T>>>26,Mr=S<<11|u>>>21,Pe=u<<11|S>>>21,Oe=K<<15|J>>>17,Cr=J<<15|K>>>17,Fe=P<<29|A>>>3,De=A<<29|P>>>3,kr=W<<28|Z>>>4,je=Z<<28|W>>>4,Ue=R<<23|le>>>9,Ir=le<<23|R>>>9,He=C<<25|z>>>7,$e=z<<25|C>>>7,qt=G<<21|se>>>11,Gt=se<<21|G>>>11,Jt=re<<24|ue>>>8,Zt=ue<<24|re>>>8,Kt=be<<27|ht>>>5,Qt=ht<<27|be>>>5,Yt=Se<<20|Ee>>>12,Xt=Ee<<20|Se>>>12,er=ve<<7|Je>>>25,tr=Je<<7|ve>>>25,rr=Re<<8|Qe>>>24,nr=Qe<<8|Re>>>24,ir=_e<<14|m>>>18,sr=m<<14|_e>>>18;e[0]=l^~_r&Mr,e[1]=h^~ke&Pe,e[10]=kr^~Yt&F,e[11]=je^~Xt&U,e[20]=ne^~Ne&He,e[21]=Ce^~Le&$e,e[30]=Kt^~v&Ie,e[31]=Qt^~B&Er,e[40]=Be^~Ue&er,e[41]=Rr^~Ir&tr,e[2]=_r^~Mr&qt,e[3]=ke^~Pe&Gt,e[12]=Yt^~F&xe,e[13]=Xt^~U&Ae,e[22]=Ne^~He&rr,e[23]=Le^~$e&nr,e[32]=v^~Ie&Oe,e[33]=B^~Er&Cr,e[42]=Ue^~er&he,e[43]=Ir^~tr&ae,e[4]=Mr^~qt&ir,e[5]=Pe^~Gt&sr,e[14]=F^~xe&Fe,e[15]=U^~Ae&De,e[24]=He^~rr&ie,e[25]=$e^~nr&Me,e[34]=Ie^~Oe&Jt,e[35]=Er^~Cr&Zt,e[44]=er^~he&Sr,e[45]=tr^~ae&Te,e[6]=qt^~ir&l,e[7]=Gt^~sr&h,e[16]=xe^~Fe&kr,e[17]=Ae^~De&je,e[26]=rr^~ie&ne,e[27]=nr^~Me&Ce,e[36]=Oe^~Jt&Kt,e[37]=Cr^~Zt&Qt,e[46]=he^~Sr&Be,e[47]=ae^~Te&Rr,e[8]=ir^~l&_r,e[9]=sr^~h&ke,e[18]=Fe^~kr&Yt,e[19]=De^~je&Xt,e[28]=ie^~ne&Ne,e[29]=Me^~Ce&Le,e[38]=Jt^~Kt&v,e[39]=Zt^~Qt&B,e[48]=Sr^~Be&Ue,e[49]=Te^~Rr&Ir,e[0]^=aa[t*2],e[1]^=aa[t*2+1]}};const ti=Dc;function Xr(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Xr.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Xr.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(ti.p1600(this.state),this.count=0)};Xr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&ti.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),ti.p1600(this.state),this.count=0,this.squeezing=!0};Xr.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(ti.p1600(this.state),this.count=0);return t};Xr.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Jf=Xr,Zf=Gf(Jf);const Kf=Zf,Qf=ai;function jc(e){return Buffer.allocUnsafe(e).fill(0)}function Uc(e,t,r){const n=jc(t);return e=Pi(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function Yf(e,t){return Uc(e,t,!0)}function Pi(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")Hc(e)?e=Buffer.from(t0($c(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(Qf.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function Xf(e){return e=Pi(e),"0x"+e.toString("hex")}function e0(e,t){return e=Pi(e),t||(t=256),Kf("keccak"+t).update(e).digest()}function t0(e){return e.length%2?"0"+e:e}function Hc(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function $c(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var Wc={zeros:jc,setLength:Uc,setLengthRight:Yf,isHexString:Hc,stripHexPrefix:$c,toBuffer:Pi,bufferToHex:Xf,keccak:e0};const gr=Wc,dr=ai;function Vc(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Dr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function ca(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function zc(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function ur(e){var t=typeof e;if(t==="string")return gr.isHexString(e)?new dr(gr.stripHexPrefix(e),16):new dr(e,10);if(t==="number")return new dr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function It(e,t){var r,n,i,s;if(e==="address")return It("uint160",ur(t));if(e==="bool")return It("uint8",t?1:0);if(e==="string")return It("bytes",new Buffer(t,"utf8"));if(n0(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=zc(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(It(e,t[s]));if(r==="dynamic"){var c=It("uint256",t.length);i.unshift(c)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([It("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,gr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Dr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return gr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Dr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=ur(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Dr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=ur(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=ca(e),n=ur(t),n<0)throw new Error("Supplied ufixed is negative");return It("uint256",n.mul(new dr(2).pow(new dr(r[1]))))}else if(e.startsWith("fixed"))return r=ca(e),It("int256",ur(t).mul(new dr(2).pow(new dr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function r0(e){return e==="string"||e==="bytes"||zc(e)==="dynamic"}function n0(e){return e.lastIndexOf("]")===e.length-1}function i0(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var c=Vc(e[s]),a=t[s],f=It(c,a);r0(c)?(r.push(It("uint256",i)),n.push(f),i+=f.length):r.push(f)}return Buffer.concat(r.concat(n))}function qc(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var c=Vc(e[s]),a=t[s];if(c==="bytes")i.push(a);else if(c==="string")i.push(new Buffer(a,"utf8"));else if(c==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(c==="address")i.push(gr.setLength(a,20));else if(c.startsWith("bytes")){if(r=Dr(c),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(gr.setLengthRight(a,r))}else if(c.startsWith("uint")){if(r=Dr(c),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=ur(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(c.startsWith("int")){if(r=Dr(c),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=ur(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+c)}return Buffer.concat(i)}function s0(e,t){return gr.keccak(qc(e,t))}var o0={rawEncode:i0,solidityPack:qc,soliditySHA3:s0};const _t=Wc,an=o0,Gc={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Ss={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const c=(a,f,g)=>{if(r[f]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":_t.keccak(this.encodeData(f,g,r,n))];if(g===void 0)throw new Error(`missing value for field ${a} of type ${f}`);if(f==="bytes")return["bytes32",_t.keccak(g)];if(f==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",_t.keccak(g)];if(f.lastIndexOf("]")===f.length-1){const p=f.slice(0,f.lastIndexOf("[")),M=g.map(E=>c(a,p,E));return["bytes32",_t.keccak(an.rawEncode(M.map(([E])=>E),M.map(([,E])=>E)))]}return[f,g]};for(const a of r[e]){const[f,g]=c(a.name,a.type,t[a.name]);i.push(f),s.push(g)}}else for(const c of r[e]){let a=t[c.name];if(a!==void 0)if(c.type==="bytes")i.push("bytes32"),a=_t.keccak(a),s.push(a);else if(c.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=_t.keccak(a),s.push(a);else if(r[c.type]!==void 0)i.push("bytes32"),a=_t.keccak(this.encodeData(c.type,a,r,n)),s.push(a);else{if(c.type.lastIndexOf("]")===c.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(c.type),s.push(a)}}return an.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:c,type:a})=>a+" "+c).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return _t.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return _t.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Gc.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),_t.keccak(Buffer.concat(n))}};var a0={TYPED_MESSAGE_SCHEMA:Gc,TypedDataUtils:Ss,hashForSignTypedDataLegacy:function(e){return c0(e.data)},hashForSignTypedData_v3:function(e){return Ss.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Ss.hash(e.data)}};function c0(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?_t.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return an.soliditySHA3(["bytes32","bytes32"],[an.soliditySHA3(new Array(e.length).fill("string"),i),an.soliditySHA3(n,r)])}var zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.filterFromParam=zr.FilterPolyfill=void 0;const Pr=Ze,it=X,l0=5*60*1e3,hr={jsonrpc:"2.0",id:0};class u0{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Pr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Jc(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,it.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,it.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,it.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,it.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,it.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Vn())}async getFilterLogs(t){const r=(0,it.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getLogs",params:[la(n)]})):Vn()}makeFilterId(){return(0,Pr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Vn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return zn();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getLogs",params:[la(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(c.result)){const a=c.result.map(g=>(0,it.intNumberFromHexString)(g.blockNumber||"0x0")),f=Math.max(...a);if(f&&f>n){const g=(0,Pr.IntNumber)(f+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${g}`),this.cursors.set(t,g)}}return c}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Vn();const n=await this.getCurrentBlockHeight();if(r>n)return zn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,it.range)(r,n+1).map(c=>this.getBlockHashByNumber((0,Pr.IntNumber)(c))))).filter(c=>!!c),s=(0,Pr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},hr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(zn())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},l0);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_blockNumber",params:[]}));return(0,it.intNumberFromHexString)((0,it.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getBlockByNumber",params:[(0,it.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,it.ensureHexString)(r.result.hash):null}}zr.FilterPolyfill=u0;function Jc(e){return{fromBlock:ua(e.fromBlock),toBlock:ua(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}zr.filterFromParam=Jc;function la(e){const t={fromBlock:ha(e.fromBlock),toBlock:ha(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function ua(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Pr.IntNumber)(0);if((0,it.isHexString)(e))return(0,it.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function ha(e){return e==="latest"?e:(0,it.hexStringFromIntNumber)(e)}function Vn(){return Object.assign(Object.assign({},hr),{error:{code:-32e3,message:"filter not found"}})}function zn(){return Object.assign(Object.assign({},hr),{result:[]})}var Oi={},Zc={},Fi={},so=h0;function h0(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const da=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(c,a){if(t.multiArgs){const f=new Array(arguments.length-1);for(let g=1;g<arguments.length;g++)f[g-1]=arguments[g];c?(f.unshift(c),s(f)):i(f)}else c?s(c):i(a)}):n.push(function(c){if(t.multiArgs){const a=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)a[f]=arguments[f];i(a)}else i(c)}),e.apply(this,n)})};var d0=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=c=>typeof c=="string"?i===c:c.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):da(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?da(s,t):s}return n},In={},xn={};Object.defineProperty(xn,"__esModule",{value:!0});const f0=ii;function fa(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function p0(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let g0=class extends f0.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const a=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw a.context=c,a}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")fa(s,this,r);else{const c=s.length,a=p0(s);for(let f=0;f<c;f+=1)fa(a[f],this,r)}return!0}};xn.default=g0;var m0=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(In,"__esModule",{value:!0});In.BaseBlockTracker=void 0;const w0=m0(xn),y0=1e3,b0=(e,t)=>e+t,pa=["sync","latest"];class v0 extends w0.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*y0,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){pa.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return pa.map(t=>this.listenerCount(t)).reduce(b0)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=ga(t),i=ga(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}In.BaseBlockTracker=v0;function ga(e){return Number.parseInt(e,16)}var Kc={},Qc={},rt={};class Yc extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...c}=t,{path:a}=t,f=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??f),s!=null&&(this.cause=f),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function _0(e){return yt(e)&&typeof e[Symbol.iterator]=="function"}function yt(e){return typeof e=="object"&&e!=null}function ma(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ke(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function E0(e){const{done:t,value:r}=e.next();return t?void 0:r}function S0(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:c}=r,{refinement:a,message:f=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${Ke(n)}\``}=e;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:f}}function*Ds(e,t,r,n){_0(e)||(e=[e]);for(const i of e){const s=S0(i,t,r,n);s&&(yield s)}}function*oo(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),c&&t.type!=="type"&&yt(t.schema)&&yt(e)&&!Array.isArray(e)))for(const g in e)t.schema[g]===void 0&&delete e[g];let f="valid";for(const g of t.validator(e,a))g.explanation=r.message,f="not_valid",yield[g,void 0];for(let[g,p,M]of t.entries(e,a)){const E=oo(p,M,{path:g===void 0?n:[...n,g],branch:g===void 0?i:[...i,p],coerce:s,mask:c,message:r.message});for(const N of E)N[0]?(f=N[0].refinement!=null?"not_refined":"not_valid",yield[N[0],void 0]):s&&(p=N[1],g===void 0?e=p:e instanceof Map?e.set(g,p):e instanceof Set?e.add(p):yt(e)&&(p!==void 0||g in e)&&(e[g]=p))}if(f!=="not_valid")for(const g of t.refiner(e,a))g.explanation=r.message,f="not_refined",yield[g,void 0];f==="valid"&&(yield[void 0,e])}class qe{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:c=f=>f,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(f,g)=>{const p=i(f,g);return Ds(p,g,this,f)}:this.validator=()=>[],s?this.refiner=(f,g)=>{const p=s(f,g);return Ds(p,g,this,f)}:this.refiner=()=>[]}assert(t,r){return Xc(t,this,r)}create(t,r){return el(t,this,r)}is(t){return ao(t,this)}mask(t,r){return tl(t,this,r)}validate(t,r={}){return en(t,this,r)}}function Xc(e,t,r){const n=en(e,t,{message:r});if(n[0])throw n[0]}function el(e,t,r){const n=en(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function tl(e,t,r){const n=en(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ao(e,t){return!en(e,t)[0]}function en(e,t,r={}){const n=oo(e,t,r),i=E0(n);return i[0]?[new Yc(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function R0(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Tn(n):An(n)}function at(e,t){return new qe({type:e,schema:null,validator:t})}function M0(e,t){return new qe({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function C0(e){return new qe({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function k0(e){let t;return new qe({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function I0(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Tn(n);default:return An(n)}}function x0(e){const t=e instanceof qe,r=t?{...e.schema}:{...e};for(const n in r)r[n]=rl(r[n]);return t&&e.type==="type"?Tn(r):An(r)}function A0(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Tn(n);default:return An(n)}}function T0(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),at(e,t)}function B0(){return at("any",()=>!0)}function N0(e){return new qe({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ke(t)}`}})}function L0(){return at("bigint",e=>typeof e=="bigint")}function P0(){return at("boolean",e=>typeof e=="boolean")}function O0(){return at("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ke(e)}`)}function F0(e){const t={},r=e.map(n=>Ke(n)).join();for(const n of e)t[n]=n;return new qe({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ke(n)}`}})}function D0(){return at("func",e=>typeof e=="function"||`Expected a function, but received: ${Ke(e)}`)}function j0(e){return at("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ke(t)}`)}function U0(){return at("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ke(e)}`)}function H0(e){return new qe({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function $0(e){const t=Ke(e),r=typeof e;return new qe({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ke(n)}`}})}function W0(e,t){return new qe({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Ke(r)}`}})}function co(){return at("never",()=>!1)}function V0(e){return new qe({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function z0(){return at("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ke(e)}`)}function An(e){const t=e?Object.keys(e):[],r=co();return new qe({type:"object",schema:e||null,*entries(n){if(e&&yt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return yt(n)||`Expected an object, but received: ${Ke(n)}`},coercer(n){return yt(n)?{...n}:n}})}function rl(e){return new qe({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function q0(e,t){return new qe({type:"record",schema:null,*entries(r){if(yt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return yt(r)||`Expected an object, but received: ${Ke(r)}`}})}function G0(){return at("regexp",e=>e instanceof RegExp)}function J0(e){return new qe({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Ke(t)}`}})}function nl(){return at("string",e=>typeof e=="string"||`Expected a string, but received: ${Ke(e)}`)}function Z0(e){const t=co();return new qe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Ke(r)}`}})}function Tn(e){const t=Object.keys(e);return new qe({type:"type",schema:e,*entries(r){if(yt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return yt(r)||`Expected an object, but received: ${Ke(r)}`},coercer(r){return yt(r)?{...r}:r}})}function K0(e){const t=e.map(r=>r.type).join(" | ");return new qe({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...c]=oo(r,s,n),[a]=c;if(a[0])for(const[f]of c)f&&i.push(f);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ke(r)}`,...i]}})}function il(){return at("unknown",()=>!0)}function lo(e,t,r){return new qe({...e,coercer:(n,i)=>ao(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function Q0(e,t,r={}){return lo(e,il(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&ma(n)&&ma(i)){const s={...n};let c=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],c=!0);if(c)return s}return n})}function Y0(e){return lo(e,nl(),t=>t.trim())}function X0(e){return br(e,"empty",t=>{const r=sl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function sl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function ep(e,t,r={}){const{exclusive:n}=r;return br(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function tp(e,t,r={}){const{exclusive:n}=r;return br(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function rp(e){return br(e,"nonempty",t=>sl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function np(e,t){return br(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function ip(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return br(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:c}=s;return t<=c&&c<=r||`${n} with a size ${i} but received one with a size of \`${c}\``}else{const{length:c}=s;return t<=c&&c<=r||`${n} with a length ${i} but received one with a length of \`${c}\``}})}function br(e,t,r){return new qe({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),c=Ds(s,i,e,n);for(const a of c)yield{...a,refinement:t}}})}const sp=Object.freeze(Object.defineProperty({__proto__:null,Struct:qe,StructError:Yc,any:B0,array:N0,assert:Xc,assign:R0,bigint:L0,boolean:P0,coerce:lo,create:el,date:O0,defaulted:Q0,define:at,deprecated:M0,dynamic:C0,empty:X0,enums:F0,func:D0,instance:j0,integer:U0,intersection:H0,is:ao,lazy:k0,literal:$0,map:W0,mask:tl,max:ep,min:tp,never:co,nonempty:rp,nullable:V0,number:z0,object:An,omit:I0,optional:rl,partial:x0,pattern:np,pick:A0,record:q0,refine:br,regexp:G0,set:J0,size:ip,string:nl,struct:T0,trimmed:Y0,tuple:Z0,type:Tn,union:K0,unknown:il,validate:en},Symbol.toStringTag,{value:"Module"})),vr=dn(sp);Object.defineProperty(rt,"__esModule",{value:!0});rt.assertExhaustive=rt.assertStruct=rt.assert=rt.AssertionError=void 0;const op=vr;function ap(e){return typeof e=="object"&&e!==null&&"message"in e}function cp(e){var t,r;return typeof((r=(t=e?.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function lp(e){const t=ap(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function ol(e,t){return cp(e)?new e({message:t}):e({message:t})}class uo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}rt.AssertionError=uo;function up(e,t="Assertion failed.",r=uo){if(!e)throw t instanceof Error?t:ol(r,t)}rt.assert=up;function hp(e,t,r="Assertion failed",n=uo){try{(0,op.assert)(e,t)}catch(i){throw ol(n,`${r}: ${lp(i)}.`)}}rt.assertStruct=hp;function dp(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}rt.assertExhaustive=dp;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.base64=void 0;const fp=vr,pp=rt,gp=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let c;s==="base64"?c=String.raw`[A-Za-z0-9+\/]`:((0,pp.assert)(s==="base64url"),c=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):a=new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,fp.pattern)(e,a)};Bn.base64=gp;var ye={},Nn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=vr,r=rt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(g){return(0,t.is)(g,e.HexStruct)}e.isHexString=n;function i(g){return(0,t.is)(g,e.StrictHexStruct)}e.isStrictHexString=i;function s(g){(0,r.assert)(n(g),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function c(g){(0,r.assert)(i(g),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=c;function a(g){return g.startsWith("0x")?g:g.startsWith("0X")?`0x${g.substring(2)}`:`0x${g}`}e.add0x=a;function f(g){return g.startsWith("0x")||g.startsWith("0X")?g.substring(2):g}e.remove0x=f})(Nn);Object.defineProperty(ye,"__esModule",{value:!0});ye.createDataView=ye.concatBytes=ye.valueToBytes=ye.stringToBytes=ye.numberToBytes=ye.signedBigIntToBytes=ye.bigIntToBytes=ye.hexToBytes=ye.bytesToString=ye.bytesToNumber=ye.bytesToSignedBigInt=ye.bytesToBigInt=ye.bytesToHex=ye.assertIsBytes=ye.isBytes=void 0;const ut=rt,js=Nn,wa=48,ya=58,ba=87;function mp(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const wp=mp();function ho(e){return e instanceof Uint8Array}ye.isBytes=ho;function tn(e){(0,ut.assert)(ho(e),"Value must be a Uint8Array.")}ye.assertIsBytes=tn;function al(e){if(tn(e),e.length===0)return"0x";const t=wp(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,js.add0x)(r.join(""))}ye.bytesToHex=al;function cl(e){tn(e);const t=al(e);return BigInt(t)}ye.bytesToBigInt=cl;function yp(e){tn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}ye.bytesToSignedBigInt=yp;function bp(e){tn(e);const t=cl(e);return(0,ut.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}ye.bytesToNumber=bp;function vp(e){return tn(e),new TextDecoder().decode(e)}ye.bytesToString=vp;function Di(e){var t;if(((t=e?.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,js.assertIsHexString)(e);const r=(0,js.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const c=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),f=c-(c<ya?wa:ba),g=a-(a<ya?wa:ba);i[s]=f*16+g}return i}ye.hexToBytes=Di;function ll(e){(0,ut.assert)(typeof e=="bigint","Value must be a bigint."),(0,ut.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Di(t)}ye.bigIntToBytes=ll;function _p(e,t){(0,ut.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Ep(e,t){(0,ut.assert)(typeof e=="bigint","Value must be a bigint."),(0,ut.assert)(typeof t=="number","Byte length must be a number."),(0,ut.assert)(t>0,"Byte length must be greater than 0."),(0,ut.assert)(_p(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}ye.signedBigIntToBytes=Ep;function ul(e){(0,ut.assert)(typeof e=="number","Value must be a number."),(0,ut.assert)(e>=0,"Value must be a non-negative number."),(0,ut.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Di(t)}ye.numberToBytes=ul;function hl(e){return(0,ut.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ye.stringToBytes=hl;function dl(e){if(typeof e=="bigint")return ll(e);if(typeof e=="number")return ul(e);if(typeof e=="string")return e.startsWith("0x")?Di(e):hl(e);if(ho(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ye.valueToBytes=dl;function Sp(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=dl(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}ye.concatBytes=Sp;function Rp(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}ye.createDataView=Rp;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.ChecksumStruct=void 0;const va=vr,Mp=Bn;ji.ChecksumStruct=(0,va.size)((0,Mp.base64)((0,va.string)(),{paddingRequired:!0}),44,44);var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createHex=Nt.createBytes=Nt.createBigInt=Nt.createNumber=void 0;const ze=vr,Cp=rt,fl=ye,Ui=Nn,pl=(0,ze.union)([(0,ze.number)(),(0,ze.bigint)(),(0,ze.string)(),Ui.StrictHexStruct]),kp=(0,ze.coerce)((0,ze.number)(),pl,Number),Ip=(0,ze.coerce)((0,ze.bigint)(),pl,BigInt);(0,ze.union)([Ui.StrictHexStruct,(0,ze.instance)(Uint8Array)]);const xp=(0,ze.coerce)((0,ze.instance)(Uint8Array),(0,ze.union)([Ui.StrictHexStruct]),fl.hexToBytes),Ap=(0,ze.coerce)(Ui.StrictHexStruct,(0,ze.instance)(Uint8Array),fl.bytesToHex);function Tp(e){try{const t=(0,ze.create)(e,kp);return(0,Cp.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Nt.createNumber=Tp;function Bp(e){try{return(0,ze.create)(e,Ip)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Nt.createBigInt=Bp;function Np(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,ze.create)(e,xp)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Nt.createBytes=Np;function Lp(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,ze.create)(e,Ap)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Nt.createHex=Lp;var qr={},gl=ee&&ee.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},st=ee&&ee.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},vt,Ct;Object.defineProperty(qr,"__esModule",{value:!0});qr.FrozenSet=qr.FrozenMap=void 0;class fo{constructor(t){vt.set(this,void 0),gl(this,vt,new Map(t),"f"),Object.freeze(this)}get size(){return st(this,vt,"f").size}[(vt=new WeakMap,Symbol.iterator)](){return st(this,vt,"f")[Symbol.iterator]()}entries(){return st(this,vt,"f").entries()}forEach(t,r){return st(this,vt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return st(this,vt,"f").get(t)}has(t){return st(this,vt,"f").has(t)}keys(){return st(this,vt,"f").keys()}values(){return st(this,vt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}qr.FrozenMap=fo;class po{constructor(t){Ct.set(this,void 0),gl(this,Ct,new Set(t),"f"),Object.freeze(this)}get size(){return st(this,Ct,"f").size}[(Ct=new WeakMap,Symbol.iterator)](){return st(this,Ct,"f")[Symbol.iterator]()}entries(){return st(this,Ct,"f").entries()}forEach(t,r){return st(this,Ct,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return st(this,Ct,"f").has(t)}keys(){return st(this,Ct,"f").keys()}values(){return st(this,Ct,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}qr.FrozenSet=po;Object.freeze(fo);Object.freeze(fo.prototype);Object.freeze(po);Object.freeze(po.prototype);var ml={};Object.defineProperty(ml,"__esModule",{value:!0});var wl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=vr,r=rt,n=()=>(0,t.define)("finite number",j=>(0,t.is)(j,(0,t.number)())&&Number.isFinite(j));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(j,q)=>{function te(Y,Q){const oe=[...Q.validator(Y,q)];return oe.length>0?oe:!0}try{const Y=te(j,e.UnsafeJsonStruct);return Y!==!0?Y:te(JSON.parse(JSON.stringify(j)),e.UnsafeJsonStruct)}catch(Y){return Y instanceof RangeError?"Circular reference detected":!1}});function i(j){return(0,t.is)(j,e.JsonStruct)}e.isValidJson=i;function s(j){(0,r.assertStruct)(j,e.JsonStruct,"Invalid JSON value");const q=JSON.stringify(j);return new TextEncoder().encode(q).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function c(j){return(0,t.is)(j,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=c;function a(j,q){(0,r.assertStruct)(j,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",q)}e.assertIsJsonRpcNotification=a;function f(j){return(0,t.is)(j,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function g(j,q){(0,r.assertStruct)(j,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",q)}e.assertIsJsonRpcRequest=g,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function p(j){return(0,t.is)(j,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function M(j,q){(0,r.assertStruct)(j,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",q)}e.assertIsPendingJsonRpcResponse=M;function E(j){return(0,t.is)(j,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=E;function N(j,q){(0,r.assertStruct)(j,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",q)}e.assertIsJsonRpcResponse=N;function H(j){return(0,t.is)(j,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=H;function D(j,q){(0,r.assertStruct)(j,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",q)}e.assertIsJsonRpcSuccess=D;function $(j){return(0,t.is)(j,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=$;function x(j,q){(0,r.assertStruct)(j,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",q)}e.assertIsJsonRpcFailure=x;function L(j){return(0,t.is)(j,e.JsonRpcErrorStruct)}e.isJsonRpcError=L;function O(j,q){(0,r.assertStruct)(j,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",q)}e.assertIsJsonRpcError=O;function V(j){const{permitEmptyString:q,permitFractions:te,permitNull:Y}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},j);return fe=>!!(typeof fe=="number"&&(te||Number.isInteger(fe))||typeof fe=="string"&&(q||fe.length>0)||Y&&fe===null)}e.getJsonRpcIdValidator=V})(wl);var yl={};Object.defineProperty(yl,"__esModule",{value:!0});var Gr={},Us={exports:{}},Rs,_a;function Pp(){if(_a)return Rs;_a=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;Rs=function(p,M){M=M||{};var E=typeof p;if(E==="string"&&p.length>0)return c(p);if(E==="number"&&isFinite(p))return M.long?f(p):a(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function c(p){if(p=String(p),!(p.length>100)){var M=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(M){var E=parseFloat(M[1]),N=(M[2]||"ms").toLowerCase();switch(N){case"years":case"year":case"yrs":case"yr":case"y":return E*s;case"weeks":case"week":case"w":return E*i;case"days":case"day":case"d":return E*n;case"hours":case"hour":case"hrs":case"hr":case"h":return E*r;case"minutes":case"minute":case"mins":case"min":case"m":return E*t;case"seconds":case"second":case"secs":case"sec":case"s":return E*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return E;default:return}}}}function a(p){var M=Math.abs(p);return M>=n?Math.round(p/n)+"d":M>=r?Math.round(p/r)+"h":M>=t?Math.round(p/t)+"m":M>=e?Math.round(p/e)+"s":p+"ms"}function f(p){var M=Math.abs(p);return M>=n?g(p,M,n,"day"):M>=r?g(p,M,r,"hour"):M>=t?g(p,M,t,"minute"):M>=e?g(p,M,e,"second"):p+" ms"}function g(p,M,E,N){var H=M>=E*1.5;return Math.round(p/E)+" "+N+(H?"s":"")}return Rs}function Op(e){r.debug=r,r.default=r,r.coerce=f,r.disable=c,r.enable=i,r.enabled=a,r.humanize=Pp(),r.destroy=g,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let M=0;for(let E=0;E<p.length;E++)M=(M<<5)-M+p.charCodeAt(E),M|=0;return r.colors[Math.abs(M)%r.colors.length]}r.selectColor=t;function r(p){let M,E=null,N,H;function D(...$){if(!D.enabled)return;const x=D,L=Number(new Date),O=L-(M||L);x.diff=O,x.prev=M,x.curr=L,M=L,$[0]=r.coerce($[0]),typeof $[0]!="string"&&$.unshift("%O");let V=0;$[0]=$[0].replace(/%([a-zA-Z%])/g,(q,te)=>{if(q==="%%")return"%";V++;const Y=r.formatters[te];if(typeof Y=="function"){const Q=$[V];q=Y.call(x,Q),$.splice(V,1),V--}return q}),r.formatArgs.call(x,$),(x.log||r.log).apply(x,$)}return D.namespace=p,D.useColors=r.useColors(),D.color=r.selectColor(p),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>E!==null?E:(N!==r.namespaces&&(N=r.namespaces,H=r.enabled(p)),H),set:$=>{E=$}}),typeof r.init=="function"&&r.init(D),D}function n(p,M){const E=r(this.namespace+(typeof M>"u"?":":M)+p);return E.log=this.log,E}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];const M=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const E of M)E[0]==="-"?r.skips.push(E.slice(1)):r.names.push(E)}function s(p,M){let E=0,N=0,H=-1,D=0;for(;E<p.length;)if(N<M.length&&(M[N]===p[E]||M[N]==="*"))M[N]==="*"?(H=N,D=E,N++):(E++,N++);else if(H!==-1)N=H+1,D++,E=D;else return!1;for(;N<M.length&&M[N]==="*";)N++;return N===M.length}function c(){const p=[...r.names,...r.skips.map(M=>"-"+M)].join(",");return r.enable(""),p}function a(p){for(const M of r.skips)if(s(p,M))return!1;for(const M of r.names)if(s(p,M))return!0;return!1}function f(p){return p instanceof Error?p.stack||p.message:p}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Fp=Op;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=c,t.useColors=n,t.storage=a(),t.destroy=(()=>{let g=!1;return()=>{g||(g=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let g;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(g=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(g[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(g){if(g[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+g[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;g.splice(1,0,p,"color: inherit");let M=0,E=0;g[0].replace(/%[a-zA-Z%]/g,N=>{N!=="%%"&&(M++,N==="%c"&&(E=M))}),g.splice(E,0,p)}t.log=console.debug||console.log||(()=>{});function s(g){try{g?t.storage.setItem("debug",g):t.storage.removeItem("debug")}catch{}}function c(){let g;try{g=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!g&&typeof process<"u"&&"env"in process&&(g=r.DEBUG),g}function a(){try{return localStorage}catch{}}e.exports=Fp(t);const{formatters:f}=e.exports;f.j=function(g){try{return JSON.stringify(g)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(Us,Us.exports);var Dp=Us.exports,jp=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.createModuleLogger=Gr.createProjectLogger=void 0;const Up=jp(Dp),Hp=(0,Up.default)("metamask");function $p(e){return Hp.extend(e)}Gr.createProjectLogger=$p;function Wp(e,t){return e.extend(t)}Gr.createModuleLogger=Wp;var bl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(g){return Array.isArray(g)&&g.length>0}e.isNonEmptyArray=t;function r(g){return g==null}e.isNullOrUndefined=r;function n(g){return!!g&&typeof g=="object"&&!Array.isArray(g)}e.isObject=n;const i=(g,p)=>Object.hasOwnProperty.call(g,p);e.hasProperty=i,function(g){g[g.Null=4]="Null",g[g.Comma=1]="Comma",g[g.Wrapper=1]="Wrapper",g[g.True=4]="True",g[g.False=5]="False",g[g.Quote=1]="Quote",g[g.Colon=1]="Colon",g[g.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(g){if(typeof g!="object"||g===null)return!1;try{let p=g;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(g)===p}catch{return!1}}e.isPlainObject=s;function c(g){return g.charCodeAt(0)<=127}e.isASCII=c;function a(g){var p;return g.split("").reduce((E,N)=>c(N)?E+1:E+2,0)+((p=g.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=a;function f(g){return g.toString().length}e.calculateNumberSize=f})(bl);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.hexToBigInt=Lt.hexToNumber=Lt.bigIntToHex=Lt.numberToHex=void 0;const jr=rt,un=Nn,Vp=e=>((0,jr.assert)(typeof e=="number","Value must be a number."),(0,jr.assert)(e>=0,"Value must be a non-negative number."),(0,jr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,un.add0x)(e.toString(16)));Lt.numberToHex=Vp;const zp=e=>((0,jr.assert)(typeof e=="bigint","Value must be a bigint."),(0,jr.assert)(e>=0,"Value must be a non-negative bigint."),(0,un.add0x)(e.toString(16)));Lt.bigIntToHex=zp;const qp=e=>{(0,un.assertIsHexString)(e);const t=parseInt(e,16);return(0,jr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Lt.hexToNumber=qp;const Gp=e=>((0,un.assertIsHexString)(e),BigInt((0,un.add0x)(e)));Lt.hexToBigInt=Gp;var vl={};Object.defineProperty(vl,"__esModule",{value:!0});var _l={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,c)=>{if(!t(s))throw new Error(`"${c}" must be a non-negative integer. Received: "${s}".`)};function n(s,c){return r(s,"count"),s*c}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(_l);var El={};Object.defineProperty(El,"__esModule",{value:!0});var Sl={},Hs={exports:{}};const Jp="2.0.0",Rl=256,Zp=Number.MAX_SAFE_INTEGER||9007199254740991,Kp=16,Qp=Rl-6,Yp=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Hi={MAX_LENGTH:Rl,MAX_SAFE_COMPONENT_LENGTH:Kp,MAX_SAFE_BUILD_LENGTH:Qp,MAX_SAFE_INTEGER:Zp,RELEASE_TYPES:Yp,SEMVER_SPEC_VERSION:Jp,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Ms={};const Xp=typeof process=="object"&&Ms&&Ms.NODE_DEBUG&&/\bsemver\b/i.test(Ms.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var $i=Xp;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Hi,s=$i;t=e.exports={};const c=t.re=[],a=t.safeRe=[],f=t.src=[],g=t.safeSrc=[],p=t.t={};let M=0;const E="[a-zA-Z0-9-]",N=[["\\s",1],["\\d",i],[E,n]],H=$=>{for(const[x,L]of N)$=$.split(`${x}*`).join(`${x}{0,${L}}`).split(`${x}+`).join(`${x}{1,${L}}`);return $},D=($,x,L)=>{const O=H(x),V=M++;s($,V,x),p[$]=V,f[V]=x,g[V]=O,c[V]=new RegExp(x,L?"g":void 0),a[V]=new RegExp(O,L?"g":void 0)};D("NUMERICIDENTIFIER","0|[1-9]\\d*"),D("NUMERICIDENTIFIERLOOSE","\\d+"),D("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E}*`),D("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),D("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),D("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),D("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),D("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),D("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),D("BUILDIDENTIFIER",`${E}+`),D("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),D("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),D("FULL",`^${f[p.FULLPLAIN]}$`),D("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),D("LOOSE",`^${f[p.LOOSEPLAIN]}$`),D("GTLT","((?:<|>)?=?)"),D("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),D("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),D("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),D("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),D("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),D("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),D("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),D("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),D("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),D("COERCERTL",f[p.COERCE],!0),D("COERCERTLFULL",f[p.COERCEFULL],!0),D("LONETILDE","(?:~>?)"),D("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",D("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),D("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),D("LONECARET","(?:\\^)"),D("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",D("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),D("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),D("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),D("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),D("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",D("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),D("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),D("STAR","(<|>)?=?\\s*\\*"),D("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),D("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Hs,Hs.exports);var Ln=Hs.exports;const eg=Object.freeze({loose:!0}),tg=Object.freeze({}),rg=e=>e?typeof e!="object"?eg:e:tg;var go=rg;const Ea=/^[0-9]+$/,Ml=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=Ea.test(e),n=Ea.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},ng=(e,t)=>Ml(t,e);var Cl={compareIdentifiers:Ml,rcompareIdentifiers:ng};const qn=$i,{MAX_LENGTH:Sa,MAX_SAFE_INTEGER:Gn}=Hi,{safeRe:Jn,t:Zn}=Ln,ig=go,{compareIdentifiers:Cs}=Cl;let sg=class kt{constructor(t,r){if(r=ig(r),t instanceof kt){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Sa)throw new TypeError(`version is longer than ${Sa} characters`);qn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Jn[Zn.LOOSE]:Jn[Zn.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Gn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Gn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Gn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<Gn)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(qn("SemVer.compare",this.version,this.options,t),!(t instanceof kt)){if(typeof t=="string"&&t===this.version)return 0;t=new kt(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof kt||(t=new kt(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof kt||(t=new kt(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(qn("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Cs(n,i)}while(++r)}compareBuild(t){t instanceof kt||(t=new kt(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(qn("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Cs(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const i=`-${r}`.match(this.options.loose?Jn[Zn.PRERELEASELOOSE]:Jn[Zn.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Cs(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Pn=sg;const Ra=Pn,og=(e,t,r=!1)=>{if(e instanceof Ra)return e;try{return new Ra(e,t)}catch(n){if(!r)return null;throw n}};var ag=og;const cg=ag,lg=(e,t)=>{const r=cg(e,t);return r?r.version:null};var ug=lg;const Ma=Pn,hg=(e,t,r)=>new Ma(e,r).compare(new Ma(t,r));var rn=hg;const dg=rn,fg=(e,t,r)=>dg(e,t,r)>0;var mo=fg;const pg=rn,gg=(e,t,r)=>pg(e,t,r)<0;var kl=gg;const mg=rn,wg=(e,t,r)=>mg(e,t,r)===0;var yg=wg;const bg=rn,vg=(e,t,r)=>bg(e,t,r)!==0;var _g=vg;const Eg=rn,Sg=(e,t,r)=>Eg(e,t,r)>=0;var Il=Sg;const Rg=rn,Mg=(e,t,r)=>Rg(e,t,r)<=0;var xl=Mg;const Cg=yg,kg=_g,Ig=mo,xg=Il,Ag=kl,Tg=xl,Bg=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Cg(e,r,n);case"!=":return kg(e,r,n);case">":return Ig(e,r,n);case">=":return xg(e,r,n);case"<":return Ag(e,r,n);case"<=":return Tg(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Ng=Bg;const{safeRe:_w,t:Ew}=Ln;class Lg{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var Pg=Lg,ks,Ca;function Rt(){if(Ca)return ks;Ca=1;const e=/\s+/g;class t{constructor(d,w){if(w=i(w),d instanceof t)return d.loose===!!w.loose&&d.includePrerelease===!!w.includePrerelease?d:new t(d.raw,w);if(d instanceof s)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=w,this.loose=!!w.loose,this.includePrerelease=!!w.includePrerelease,this.raw=d.trim().replace(e," "),this.set=this.raw.split("||").map(y=>this.parseRange(y.trim())).filter(y=>y.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const y=this.set[0];if(this.set=this.set.filter(_=>!D(_[0])),this.set.length===0)this.set=[y];else if(this.set.length>1){for(const _ of this.set)if(_.length===1&&$(_[0])){this.set=[_];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let d=0;d<this.set.length;d++){d>0&&(this.formatted+="||");const w=this.set[d];for(let y=0;y<w.length;y++)y>0&&(this.formatted+=" "),this.formatted+=w[y].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const y=((this.options.includePrerelease&&N)|(this.options.loose&&H))+":"+d,_=n.get(y);if(_)return _;const k=this.options.loose,T=k?f[g.HYPHENRANGELOOSE]:f[g.HYPHENRANGE];d=d.replace(T,pe(this.options.includePrerelease)),c("hyphen replace",d),d=d.replace(f[g.COMPARATORTRIM],p),c("comparator trim",d),d=d.replace(f[g.TILDETRIM],M),c("tilde trim",d),d=d.replace(f[g.CARETTRIM],E),c("caret trim",d);let b=d.split(" ").map(J=>L(J,this.options)).join(" ").split(/\s+/).map(J=>oe(J,this.options));k&&(b=b.filter(J=>(c("loose invalid filter",J,this.options),!!J.match(f[g.COMPARATORLOOSE])))),c("range list",b);const u=new Map,S=b.map(J=>new s(J,this.options));for(const J of S){if(D(J))return[J];u.set(J.value,J)}u.size>1&&u.has("")&&u.delete("");const K=[...u.values()];return n.set(y,K),K}intersects(d,w){if(!(d instanceof t))throw new TypeError("a Range is required");return this.set.some(y=>x(y,w)&&d.set.some(_=>x(_,w)&&y.every(k=>_.every(T=>k.intersects(T,w)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}for(let w=0;w<this.set.length;w++)if(I(this.set[w],d,this.options))return!0;return!1}}ks=t;const r=Pg,n=new r,i=go,s=Wi(),c=$i,a=Pn,{safeRe:f,t:g,comparatorTrimReplace:p,tildeTrimReplace:M,caretTrimReplace:E}=Ln,{FLAG_INCLUDE_PRERELEASE:N,FLAG_LOOSE:H}=Hi,D=o=>o.value==="<0.0.0-0",$=o=>o.value==="",x=(o,d)=>{let w=!0;const y=o.slice();let _=y.pop();for(;w&&y.length;)w=y.every(k=>_.intersects(k,d)),_=y.pop();return w},L=(o,d)=>(o=o.replace(f[g.BUILD],""),c("comp",o,d),o=q(o,d),c("caret",o),o=V(o,d),c("tildes",o),o=Y(o,d),c("xrange",o),o=fe(o,d),c("stars",o),o),O=o=>!o||o.toLowerCase()==="x"||o==="*",V=(o,d)=>o.trim().split(/\s+/).map(w=>j(w,d)).join(" "),j=(o,d)=>{const w=d.loose?f[g.TILDELOOSE]:f[g.TILDE];return o.replace(w,(y,_,k,T,b)=>{c("tilde",o,y,_,k,T,b);let u;return O(_)?u="":O(k)?u=`>=${_}.0.0 <${+_+1}.0.0-0`:O(T)?u=`>=${_}.${k}.0 <${_}.${+k+1}.0-0`:b?(c("replaceTilde pr",b),u=`>=${_}.${k}.${T}-${b} <${_}.${+k+1}.0-0`):u=`>=${_}.${k}.${T} <${_}.${+k+1}.0-0`,c("tilde return",u),u})},q=(o,d)=>o.trim().split(/\s+/).map(w=>te(w,d)).join(" "),te=(o,d)=>{c("caret",o,d);const w=d.loose?f[g.CARETLOOSE]:f[g.CARET],y=d.includePrerelease?"-0":"";return o.replace(w,(_,k,T,b,u)=>{c("caret",o,_,k,T,b,u);let S;return O(k)?S="":O(T)?S=`>=${k}.0.0${y} <${+k+1}.0.0-0`:O(b)?k==="0"?S=`>=${k}.${T}.0${y} <${k}.${+T+1}.0-0`:S=`>=${k}.${T}.0${y} <${+k+1}.0.0-0`:u?(c("replaceCaret pr",u),k==="0"?T==="0"?S=`>=${k}.${T}.${b}-${u} <${k}.${T}.${+b+1}-0`:S=`>=${k}.${T}.${b}-${u} <${k}.${+T+1}.0-0`:S=`>=${k}.${T}.${b}-${u} <${+k+1}.0.0-0`):(c("no pr"),k==="0"?T==="0"?S=`>=${k}.${T}.${b}${y} <${k}.${T}.${+b+1}-0`:S=`>=${k}.${T}.${b}${y} <${k}.${+T+1}.0-0`:S=`>=${k}.${T}.${b} <${+k+1}.0.0-0`),c("caret return",S),S})},Y=(o,d)=>(c("replaceXRanges",o,d),o.split(/\s+/).map(w=>Q(w,d)).join(" ")),Q=(o,d)=>{o=o.trim();const w=d.loose?f[g.XRANGELOOSE]:f[g.XRANGE];return o.replace(w,(y,_,k,T,b,u)=>{c("xRange",o,y,_,k,T,b,u);const S=O(k),K=S||O(T),J=K||O(b),A=J;return _==="="&&A&&(_=""),u=d.includePrerelease?"-0":"",S?_===">"||_==="<"?y="<0.0.0-0":y="*":_&&A?(K&&(T=0),b=0,_===">"?(_=">=",K?(k=+k+1,T=0,b=0):(T=+T+1,b=0)):_==="<="&&(_="<",K?k=+k+1:T=+T+1),_==="<"&&(u="-0"),y=`${_+k}.${T}.${b}${u}`):K?y=`>=${k}.0.0${u} <${+k+1}.0.0-0`:J&&(y=`>=${k}.${T}.0${u} <${k}.${+T+1}.0-0`),c("xRange return",y),y})},fe=(o,d)=>(c("replaceStars",o,d),o.trim().replace(f[g.STAR],"")),oe=(o,d)=>(c("replaceGTE0",o,d),o.trim().replace(f[d.includePrerelease?g.GTE0PRE:g.GTE0],"")),pe=o=>(d,w,y,_,k,T,b,u,S,K,J,A)=>(O(y)?w="":O(_)?w=`>=${y}.0.0${o?"-0":""}`:O(k)?w=`>=${y}.${_}.0${o?"-0":""}`:T?w=`>=${w}`:w=`>=${w}${o?"-0":""}`,O(S)?u="":O(K)?u=`<${+S+1}.0.0-0`:O(J)?u=`<${S}.${+K+1}.0-0`:A?u=`<=${S}.${K}.${J}-${A}`:o?u=`<${S}.${K}.${+J+1}-0`:u=`<=${u}`,`${w} ${u}`.trim()),I=(o,d,w)=>{for(let y=0;y<o.length;y++)if(!o[y].test(d))return!1;if(d.prerelease.length&&!w.includePrerelease){for(let y=0;y<o.length;y++)if(c(o[y].semver),o[y].semver!==s.ANY&&o[y].semver.prerelease.length>0){const _=o[y].semver;if(_.major===d.major&&_.minor===d.minor&&_.patch===d.patch)return!0}return!1}return!0};return ks}var Is,ka;function Wi(){if(ka)return Is;ka=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,M){if(M=r(M),p instanceof t){if(p.loose===!!M.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),c("comparator",p,M),this.options=M,this.loose=!!M.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(p){const M=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],E=p.match(M);if(!E)throw new TypeError(`Invalid comparator: ${p}`);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new a(E[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(c("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new a(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,M){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(p.value,M).test(this.value):p.operator===""?p.value===""?!0:new f(this.value,M).test(p.semver):(M=r(M),M.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!M.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,M)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,M)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}Is=t;const r=go,{safeRe:n,t:i}=Ln,s=Ng,c=$i,a=Pn,f=Rt();return Is}const Og=Rt(),Fg=(e,t,r)=>{try{t=new Og(t,r)}catch{return!1}return t.test(e)};var Al=Fg;Rt();Rt();Rt();Rt();const Dg=Rt(),jg=(e,t)=>{try{return new Dg(e,t).range||"*"}catch{return null}};var Ug=jg;const Hg=Pn,Tl=Wi(),{ANY:$g}=Tl,Wg=Rt(),Vg=Al,Ia=mo,xa=kl,zg=xl,qg=Il,Gg=(e,t,r,n)=>{e=new Hg(e,n),t=new Wg(t,n);let i,s,c,a,f;switch(r){case">":i=Ia,s=zg,c=xa,a=">",f=">=";break;case"<":i=xa,s=qg,c=Ia,a="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Vg(e,t,n))return!1;for(let g=0;g<t.set.length;++g){const p=t.set[g];let M=null,E=null;if(p.forEach(N=>{N.semver===$g&&(N=new Tl(">=0.0.0")),M=M||N,E=E||N,i(N.semver,M.semver,n)?M=N:c(N.semver,E.semver,n)&&(E=N)}),M.operator===a||M.operator===f||(!E.operator||E.operator===a)&&s(e,E.semver))return!1;if(E.operator===f&&c(e,E.semver))return!1}return!0};var Jg=Gg;const Zg=Jg,Kg=(e,t,r)=>Zg(e,t,">",r);var Qg=Kg;Rt();Rt();const wo=Wi(),{ANY:Sw}=wo;new wo(">=0.0.0-0");new wo(">=0.0.0");const xs=Ln,Aa=Hi,Ta=Cl,Yg=ug,Xg=mo;Wi();Rt();const e1=Al,t1=Ug,r1=Qg;var n1={valid:Yg,gt:Xg,satisfies:e1,validRange:t1,gtr:r1,re:xs.re,src:xs.src,tokens:xs.t,SEMVER_SPEC_VERSION:Aa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Aa.RELEASE_TYPES,compareIdentifiers:Ta.compareIdentifiers,rcompareIdentifiers:Ta.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=n1,r=vr,n=rt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",M=>(0,t.valid)(M)===null?`Expected SemVer version, got "${M}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",M=>(0,t.validRange)(M)===null?`Expected SemVer range, got "${M}"`:!0);function i(M){return(0,r.is)(M,e.VersionStruct)}e.isValidSemVerVersion=i;function s(M){return(0,r.is)(M,e.VersionRangeStruct)}e.isValidSemVerRange=s;function c(M){(0,n.assertStruct)(M,e.VersionStruct)}e.assertIsSemVerVersion=c;function a(M){(0,n.assertStruct)(M,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function f(M,E){return(0,t.gt)(M,E)}e.gtVersion=f;function g(M,E){return(0,t.gtr)(M,E)}e.gtRange=g;function p(M,E){return(0,t.satisfies)(M,E,{includePrerelease:!0})}e.satisfiesVersionRange=p})(Sl);(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,a)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(rt,e),r(Bn,e),r(ye,e),r(ji,e),r(Nt,e),r(qr,e),r(ml,e),r(Nn,e),r(wl,e),r(yl,e),r(Gr,e),r(bl,e),r(Lt,e),r(vl,e),r(_l,e),r(El,e),r(Sl,e)})(Qc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Qc;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Kc);var Bl=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.PollingBlockTracker=void 0;const i1=Bl(so),s1=Bl(d0),o1=In,Ba=Kc,Na=(0,Ba.createModuleLogger)(Ba.projectLogger,"polling-block-tracker"),a1=(0,i1.default)(),c1=1e3;class l1 extends o1.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*c1,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=La(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
8
+ ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=La(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:a1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Na("Making request",t);const r=await(0,s1.default)(n=>this._provider.sendAsync(t,n))();if(Na("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
9
+ ${r.error.message}`);return r.result}}Fi.PollingBlockTracker=l1;function La(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Vi={},u1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.SubscribeBlockTracker=void 0;const h1=u1(so),d1=In,f1=(0,h1.default)();class p1 extends d1.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:f1(),method:t,params:r,jsonrpc:"2.0"},(s,c)=>{s?i(s):n(c.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Vi.SubscribeBlockTracker=p1;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Fi,e),r(Vi,e)})(Zc);var yo={},zi={},On={};Object.defineProperty(On,"__esModule",{value:!0});On.getUniqueId=void 0;const Nl=4294967295;let As=Math.floor(Math.random()*Nl);function g1(){return As=(As+1)%Nl,As}On.getUniqueId=g1;Object.defineProperty(zi,"__esModule",{value:!0});zi.createIdRemapMiddleware=void 0;const m1=On;function w1(){return(e,t,r,n)=>{const i=e.id,s=m1.getUniqueId();e.id=s,t.id=s,r(c=>{e.id=i,t.id=i,c()})}}zi.createIdRemapMiddleware=w1;var qi={};Object.defineProperty(qi,"__esModule",{value:!0});qi.createAsyncMiddleware=void 0;function y1(e){return async(t,r,n,i)=>{let s;const c=new Promise(p=>{s=p});let a=null,f=!1;const g=async()=>{f=!0,n(p=>{a=p,s()}),await c};try{await e(t,r,g),f?(await c,a(null)):i(null)}catch(p){a?a(p):i(p)}}}qi.createAsyncMiddleware=y1;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.createScaffoldMiddleware=void 0;function b1(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}Gi.createScaffoldMiddleware=b1;var Fn={},bo={};Object.defineProperty(bo,"__esModule",{value:!0});const v1=ii;function Pa(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function _1(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let E1=class extends v1.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let c;if(r.length>0&&([c]=r),c instanceof Error)throw c;const a=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw a.context=c,a}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Pa(s,this,r);else{const c=s.length,a=_1(s);for(let f=0;f<c;f+=1)Pa(a[f],this,r)}return!0}};bo.default=E1;var Ll={},Vt={},S1=hn;hn.default=hn;hn.stable=Fl;hn.stableStringify=Fl;var ri="[...]",Pl="[Circular]",mr=[],fr=[];function Ol(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function hn(e,t,r,n){typeof n>"u"&&(n=Ol()),$s(e,"",0,[],void 0,0,n);var i;try{fr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Dl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;mr.length!==0;){var s=mr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Ur(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),mr.push([n,r,t,i])):fr.push([t,r,e]):(n[r]=e,mr.push([n,r,t]))}function $s(e,t,r,n,i,s,c){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ur(Pl,e,t,i);return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Ur(ri,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Ur(ri,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)$s(e[a],a,a,n,e,s,c);else{var f=Object.keys(e);for(a=0;a<f.length;a++){var g=f[a];$s(e[g],g,a,n,e,s,c)}}n.pop()}}function R1(e,t){return e<t?-1:e>t?1:0}function Fl(e,t,r,n){typeof n>"u"&&(n=Ol());var i=Ws(e,"",0,[],void 0,0,n)||e,s;try{fr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Dl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;mr.length!==0;){var c=mr.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function Ws(e,t,r,n,i,s,c){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Ur(Pl,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Ur(ri,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Ur(ri,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Ws(e[a],a,a,n,e,s,c);else{var f={},g=Object.keys(e).sort(R1);for(a=0;a<g.length;a++){var p=g[a];Ws(e[p],p,a,n,e,s,c),f[p]=e[p]}if(typeof i<"u")mr.push([i,t,e]),i[t]=f;else return f}n.pop()}}function Dl(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(fr.length>0)for(var n=0;n<fr.length;n++){var i=fr[n];if(i[1]===t&&i[0]===r){r=i[2],fr.splice(n,1);break}}return e.call(this,t,r)}}Object.defineProperty(Vt,"__esModule",{value:!0});Vt.EthereumProviderError=Vt.EthereumRpcError=void 0;const M1=S1;class jl extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return M1.default(this.serialize(),I1,2)}}Vt.EthereumRpcError=jl;class C1 extends jl{constructor(t,r,n){if(!k1(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}Vt.EthereumProviderError=C1;function k1(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function I1(e,t){if(t!=="[Circular]")return t}var vo={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.errorValues=zt.errorCodes=void 0;zt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};zt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=zt,r=Vt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:c(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(E,N=i){if(Number.isInteger(E)){const H=E.toString();if(M(t.errorValues,H))return t.errorValues[H].message;if(g(E))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return N}e.getMessageFromCode=c;function a(E){if(!Number.isInteger(E))return!1;const N=E.toString();return!!(t.errorValues[N]||g(E))}e.isValidCode=a;function f(E,{fallbackError:N=s,shouldIncludeStack:H=!1}={}){var D,$;if(!N||!Number.isInteger(N.code)||typeof N.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(E instanceof r.EthereumRpcError)return E.serialize();const x={};if(E&&typeof E=="object"&&!Array.isArray(E)&&M(E,"code")&&a(E.code)){const O=E;x.code=O.code,O.message&&typeof O.message=="string"?(x.message=O.message,M(O,"data")&&(x.data=O.data)):(x.message=c(x.code),x.data={originalError:p(E)})}else{x.code=N.code;const O=(D=E)===null||D===void 0?void 0:D.message;x.message=O&&typeof O=="string"?O:N.message,x.data={originalError:p(E)}}const L=($=E)===null||$===void 0?void 0:$.stack;return H&&E&&L&&typeof L=="string"&&(x.stack=L),x}e.serializeError=f;function g(E){return E>=-32099&&E<=-32e3}function p(E){return E&&typeof E=="object"&&!Array.isArray(E)?Object.assign({},E):E}function M(E,N){return Object.prototype.hasOwnProperty.call(E,N)}})(vo);var Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.ethErrors=void 0;const _o=Vt,Ul=vo,nt=zt;Ji.ethErrors={rpc:{parse:e=>ft(nt.errorCodes.rpc.parse,e),invalidRequest:e=>ft(nt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ft(nt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ft(nt.errorCodes.rpc.methodNotFound,e),internal:e=>ft(nt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ft(t,e)},invalidInput:e=>ft(nt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ft(nt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ft(nt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ft(nt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ft(nt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ft(nt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>sn(nt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>sn(nt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>sn(nt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>sn(nt.errorCodes.provider.disconnected,e),chainDisconnected:e=>sn(nt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new _o.EthereumProviderError(t,r,n)}}};function ft(e,t){const[r,n]=Hl(t);return new _o.EthereumRpcError(e,r||Ul.getMessageFromCode(e),n)}function sn(e,t){const[r,n]=Hl(t);return new _o.EthereumProviderError(e,r||Ul.getMessageFromCode(e),n)}function Hl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Vt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=vo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ji;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=zt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Ll);var x1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.JsonRpcEngine=void 0;const A1=x1(bo),pt=Ll;class Pt extends A1.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,c,a]=await Pt._runAllMiddleware(t,r,this._middleware);return c?(await Pt._runReturnHandlers(a),i(s)):n(async f=>{try{await Pt._runReturnHandlers(a)}catch(g){return f(g)}return f()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const c=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(c,{id:void 0,jsonrpc:"2.0",error:c})}if(typeof t.method!="string"){const c=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(c,{id:t.id,jsonrpc:"2.0",error:c})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(c){s=c}return s&&(delete i.result,i.error||(i.error=pt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Pt._runAllMiddleware(t,r,this._middleware);if(Pt._checkForCompletion(t,r,i),await Pt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,c=!1;for(const a of n)if([s,c]=await Pt._runMiddleware(t,r,a,i),c)break;return[s,c,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const c=f=>{const g=f||r.error;g&&(r.error=pt.serializeError(g)),s([g,!0])},a=f=>{r.error?c(r.error):(f&&(typeof f!="function"&&c(new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof f}" for request:
10
+ ${Ts(t)}`,{request:t})),i.push(f)),s([null,!1]))};try{n(t,r,a,c)}catch(f){c(f)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
11
+ ${Ts(t)}`,{request:t});if(!n)throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
12
+ ${Ts(t)}`,{request:t})}}Fn.JsonRpcEngine=Pt;function Ts(e){return JSON.stringify(e,null,2)}var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.mergeMiddleware=void 0;const T1=Fn;function B1(e){const t=new T1.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Zi.mergeMiddleware=B1;(function(e){var t=ee&&ee.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=ee&&ee.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(zi,e),r(qi,e),r(Gi,e),r(On,e),r(Fn,e),r(Zi,e)})(yo);var $l={},Eo={};const So=dn(tu);var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});var Oa=So,N1=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return Oa.__awaiter(this,void 0,void 0,function(){var r,n,i;return Oa.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Ki.default=N1;Object.defineProperty(Eo,"__esModule",{value:!0});var Fa=So,L1=Ki,P1=function(){function e(){this._semaphore=new L1.default(1)}return e.prototype.acquire=function(){return Fa.__awaiter(this,void 0,void 0,function(){var t,r;return Fa.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();Eo.default=P1;var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.withTimeout=void 0;var Kn=So;function O1(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Kn.__awaiter(n,void 0,void 0,function(){var c,a,f;return Kn.__generator(this,function(g){switch(g.label){case 0:return c=!1,setTimeout(function(){c=!0,s(r)},t),[4,e.acquire()];case 1:return a=g.sent(),c?(f=Array.isArray(a)?a[1]:a,f()):i(a),[2]}})})})},runExclusive:function(i){return Kn.__awaiter(this,void 0,void 0,function(){var s,c;return Kn.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=a.sent(),Array.isArray(c)?(s=c[1],[4,i(c[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=c,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Qi.withTimeout=O1;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=Eo;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Ki;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Qi;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})($l);var F1=j1,D1=Object.prototype.hasOwnProperty;function j1(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)D1.call(r,n)&&(e[n]=r[n])}return e}const U1=F1,H1=so();var $1=ce;function ce(e){const t=this;t.currentProvider=e}ce.prototype.getBalance=Dn(2,"eth_getBalance");ce.prototype.getCode=Dn(2,"eth_getCode");ce.prototype.getTransactionCount=Dn(2,"eth_getTransactionCount");ce.prototype.getStorageAt=Dn(3,"eth_getStorageAt");ce.prototype.call=Dn(2,"eth_call");ce.prototype.protocolVersion=ge("eth_protocolVersion");ce.prototype.syncing=ge("eth_syncing");ce.prototype.coinbase=ge("eth_coinbase");ce.prototype.mining=ge("eth_mining");ce.prototype.hashrate=ge("eth_hashrate");ce.prototype.gasPrice=ge("eth_gasPrice");ce.prototype.accounts=ge("eth_accounts");ce.prototype.blockNumber=ge("eth_blockNumber");ce.prototype.getBlockTransactionCountByHash=ge("eth_getBlockTransactionCountByHash");ce.prototype.getBlockTransactionCountByNumber=ge("eth_getBlockTransactionCountByNumber");ce.prototype.getUncleCountByBlockHash=ge("eth_getUncleCountByBlockHash");ce.prototype.getUncleCountByBlockNumber=ge("eth_getUncleCountByBlockNumber");ce.prototype.sign=ge("eth_sign");ce.prototype.sendTransaction=ge("eth_sendTransaction");ce.prototype.sendRawTransaction=ge("eth_sendRawTransaction");ce.prototype.estimateGas=ge("eth_estimateGas");ce.prototype.getBlockByHash=ge("eth_getBlockByHash");ce.prototype.getBlockByNumber=ge("eth_getBlockByNumber");ce.prototype.getTransactionByHash=ge("eth_getTransactionByHash");ce.prototype.getTransactionByBlockHashAndIndex=ge("eth_getTransactionByBlockHashAndIndex");ce.prototype.getTransactionByBlockNumberAndIndex=ge("eth_getTransactionByBlockNumberAndIndex");ce.prototype.getTransactionReceipt=ge("eth_getTransactionReceipt");ce.prototype.getUncleByBlockHashAndIndex=ge("eth_getUncleByBlockHashAndIndex");ce.prototype.getUncleByBlockNumberAndIndex=ge("eth_getUncleByBlockNumberAndIndex");ce.prototype.getCompilers=ge("eth_getCompilers");ce.prototype.compileLLL=ge("eth_compileLLL");ce.prototype.compileSolidity=ge("eth_compileSolidity");ce.prototype.compileSerpent=ge("eth_compileSerpent");ce.prototype.newFilter=ge("eth_newFilter");ce.prototype.newBlockFilter=ge("eth_newBlockFilter");ce.prototype.newPendingTransactionFilter=ge("eth_newPendingTransactionFilter");ce.prototype.uninstallFilter=ge("eth_uninstallFilter");ce.prototype.getFilterChanges=ge("eth_getFilterChanges");ce.prototype.getFilterLogs=ge("eth_getFilterLogs");ce.prototype.getLogs=ge("eth_getLogs");ce.prototype.getWork=ge("eth_getWork");ce.prototype.submitWork=ge("eth_submitWork");ce.prototype.submitHashrate=ge("eth_submitHashrate");ce.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(W1(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ge(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Dn(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function W1(e){return U1({id:H1(),jsonrpc:"2.0",params:[]},e)}const Da=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((c,a)=>{t.multiArgs?i.push((...g)=>{t.errorFirst?g[0]?a(g):(g.shift(),c(g)):c(g)}):t.errorFirst?i.push((g,p)=>{g?a(g):c(p)}):i.push(c),Reflect.apply(e,this===r?n:this,i)})},ja=new WeakMap;var V1=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(c,a)=>{let f=ja.get(c);if(f||(f={},ja.set(c,f)),a in f)return f[a];const g=H=>typeof H=="string"||typeof a=="symbol"?a===H:H.test(a),p=Reflect.getOwnPropertyDescriptor(c,a),M=p===void 0||p.writable||p.configurable,N=(t.include?t.include.some(g):!t.exclude.some(g))&&M;return f[a]=N,N},i=new WeakMap,s=new Proxy(e,{apply(c,a,f){const g=i.get(c);if(g)return Reflect.apply(g,a,f);const p=t.excludeMain?c:Da(c,t,s,c);return i.set(c,p),Reflect.apply(p,a,f)},get(c,a){const f=c[a];if(!n(c,a)||f===Function.prototype[a])return f;const g=i.get(f);if(g)return g;if(typeof f=="function"){const p=Da(f,t,s,c);return i.set(f,p),p}return f}});return s};const z1=xn.default;let q1=class extends z1{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var Ro=q1;const G1=Ro;let J1=class extends G1{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var Z1=J1,jn={minBlockRef:K1,bnToHex:Y1,blockRefIsNumber:X1,hexToInt:ni,incrementHexInt:em,intToHex:Wl,unsafeRandomBytes:tm};function K1(...e){return Q1(e)[0]}function Q1(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:ni(t)-ni(r))}function Y1(e){return"0x"+e.toString(16)}function X1(e){return e&&!["earliest","latest","pending"].includes(e)}function ni(e){return e==null?e:Number.parseInt(e,16)}function em(e){if(e==null)return e;const t=ni(e);return Wl(t+1)}function Wl(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function tm(e){let t="0x";for(let r=0;r<e;r++)t+=Ua(),t+=Ua();return t}function Ua(){return Math.floor(Math.random()*16).toString(16)}const rm=$1,nm=V1,im=Z1,{bnToHex:kw,hexToInt:Qn,incrementHexInt:sm,minBlockRef:om,blockRefIsNumber:am}=jn;let cm=class extends im{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new rm(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=om(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=sm(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(f=>this.matchLog(f));this.addResults(a)}async _fetchLogs(t){return await nm(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Qn(this.params.fromBlock)>=Qn(t.blockNumber)||am(this.params.toBlock)&&Qn(this.params.toBlock)<=Qn(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let c=t.topics[s];if(!c)return!1;c=c.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(p=>p.toLowerCase()),a.includes(c))})}};var lm=cm,Mo=um;async function um({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Ha(t),s=Ha(r)-n+1,c=Array(s).fill().map((f,g)=>n+g).map(hm);let a=await Promise.all(c.map(f=>fm(e,"eth_getBlockByNumber",[f,!1])));return a=a.filter(f=>f!==null),a}function Ha(e){return e==null?e:Number.parseInt(e,16)}function hm(e){return e==null?e:"0x"+e.toString(16)}function dm(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function fm(e,t,r){for(let n=0;n<3;n++)try{return await dm(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const pm=Ro,gm=Mo,{incrementHexInt:mm}=jn;let wm=class extends pm{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=mm(t),c=(await gm({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(c)}};var ym=wm;const bm=Ro,vm=Mo,{incrementHexInt:_m}=jn;let Em=class extends bm{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=_m(t),i=await vm({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const c of i)s.push(...c.transactions);this.addResults(s)}};var Sm=Em;const Rm=$l.Mutex,{createAsyncMiddleware:Mm,createScaffoldMiddleware:Cm}=yo,km=lm,Im=ym,xm=Sm,{intToHex:Vl,hexToInt:Bs}=jn;var Am=Tm;function Tm({blockTracker:e,provider:t}){let r=0,n={};const i=new Rm,s=Bm({mutex:i}),c=Cm({eth_newFilter:s(Ns(f)),eth_newBlockFilter:s(Ns(g)),eth_newPendingTransactionFilter:s(Ns(p)),eth_uninstallFilter:s(ei(N)),eth_getFilterChanges:s(ei(M)),eth_getFilterLogs:s(ei(E))}),a=async({oldBlock:L,newBlock:O})=>{if(n.length===0)return;const V=await i.acquire();try{await Promise.all(Lr(n).map(async j=>{try{await j.update({oldBlock:L,newBlock:O})}catch(q){console.error(q)}}))}catch(j){console.error(j)}V()};return c.newLogFilter=f,c.newBlockFilter=g,c.newPendingTransactionFilter=p,c.uninstallFilter=N,c.getFilterChanges=M,c.getFilterLogs=E,c.destroy=()=>{$()},c;async function f(L){const O=new km({provider:t,params:L});return await H(O),O}async function g(){const L=new Im({provider:t});return await H(L),L}async function p(){const L=new xm({provider:t});return await H(L),L}async function M(L){const O=Bs(L),V=n[O];if(!V)throw new Error(`No filter for index "${O}"`);return V.getChangesAndClear()}async function E(L){const O=Bs(L),V=n[O];if(!V)throw new Error(`No filter for index "${O}"`);let j=[];return V.type==="log"&&(j=V.getAllResults()),j}async function N(L){const O=Bs(L),j=!!n[O];return j&&await D(O),j}async function H(L){const O=Lr(n).length,V=await e.getLatestBlock();await L.initialize({currentBlock:V}),r++,n[r]=L,L.id=r,L.idHex=Vl(r);const j=Lr(n).length;return x({prevFilterCount:O,newFilterCount:j}),r}async function D(L){const O=Lr(n).length;delete n[L];const V=Lr(n).length;x({prevFilterCount:O,newFilterCount:V})}async function $(){const L=Lr(n).length;n={},x({prevFilterCount:L,newFilterCount:0})}function x({prevFilterCount:L,newFilterCount:O}){if(L===0&&O>0){e.on("sync",a);return}if(L>0&&O===0){e.removeListener("sync",a);return}}}function Ns(e){return ei(async(...t)=>{const r=await e(...t);return Vl(r.id)})}function ei(e){return Mm(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function Bm({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Lr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const Nm=xn.default,{createAsyncMiddleware:$a,createScaffoldMiddleware:Lm}=yo,Pm=Am,{unsafeRandomBytes:Om,incrementHexInt:Fm}=jn,Dm=Mo;var jm=Um;function Um({blockTracker:e,provider:t}){const r={},n=Pm({blockTracker:e,provider:t});let i=!1;const s=new Nm,c=Lm({eth_subscribe:$a(a),eth_unsubscribe:$a(f)});return c.destroy=p,{events:s,middleware:c};async function a(M,E){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const N=M.params[0],H=Om(16);let D;switch(N){case"newHeads":D=$({subId:H});break;case"logs":const L=M.params[1],O=await n.newLogFilter(L);D=x({subId:H,filter:O});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${N}"`)}r[H]=D,E.result=H;return;function $({subId:L}){const O={type:N,destroy:async()=>{e.removeListener("sync",O.update)},update:async({oldBlock:V,newBlock:j})=>{const q=j,te=Fm(V);(await Dm({provider:t,fromBlock:te,toBlock:q})).map(Hm).filter(fe=>fe!==null).forEach(fe=>{g(L,fe)})}};return e.on("sync",O.update),O}function x({subId:L,filter:O}){return O.on("update",j=>g(L,j)),{type:N,destroy:async()=>await n.uninstallFilter(O.idHex)}}}async function f(M,E){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const N=M.params[0],H=r[N];if(!H){E.result=!1;return}delete r[N],await H.destroy(),E.result=!0}function g(M,E){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:M,result:E}})}function p(){s.removeAllListeners();for(const M in r)r[M].destroy(),delete r[M];i=!0}}function Hm(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(Oi,"__esModule",{value:!0});Oi.SubscriptionManager=void 0;const $m=Zc,Wm=jm,Wa=()=>{};class Vm{constructor(t){const r=new $m.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Wm({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Wa,Wa),r}destroy(){this.subscriptionMiddleware.destroy()}}Oi.SubscriptionManager=Vm;var zl=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.CoinbaseWalletProvider=void 0;const zm=zl(ai),qm=Jl,me=fn,de=X,Gm=wn,Va=mt,Yn=Qr,ct=Jr,Ls=zl(a0),on=Kr,Jm=zr,Zm=Oi,za="DefaultChainId",qa="DefaultJsonRpcUrl";class Km extends qm.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new Jm.FilterPolyfill(this),this._subscriptionManager=new Zm.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,de.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const c=this._storage.getItem(Va.LOCAL_STORAGE_ADDRESSES_KEY);if(c){const a=c.split(" ");a[0]!==""&&(this._addresses=a.map(f=>(0,de.ensureAddressString)(f)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var f;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const g=a.data.data.chainId,p=(f=a.data.data.jsonRpcUrl)!==null&&f!==void 0?f:this.jsonRpcUrl;this.updateProviderInfo(p,Number(g))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,de.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(qa))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(qa,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(za,r.toString(10)),((0,de.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,c){const f=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,c?.toString()).promise;return(0,ct.isErrorResponse)(f)?!1:!!f.result}async addEthereumChain(t,r,n,i,s,c){var a,f;if((0,de.ensureIntNumber)(t)===this.getChainId())return!1;const g=await this.initializeRelay(),p=g.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await g.requestEthereumAccounts().promise;const M=await g.addEthereumChain(t.toString(),r,s,n,i,c).promise;return(0,ct.isErrorResponse)(M)?!1:(((a=M.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((f=M.result)===null||f===void 0?void 0:f.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ct.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===me.standardErrorCodes.provider.unsupportedChain?me.standardErrors.provider.unsupportedChain():me.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(on.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,me.serializeError)(i,t)})}catch(n){throw(0,me.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],c={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(c).then(a=>a.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,me.serializeError)(n,t)})}catch(n){return Promise.reject((0,me.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,me.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,me.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw me.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw me.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw me.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,de.ensureRegExpString)(t)).promise;if((0,ct.isErrorResponse)(n))throw(0,me.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,me.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,ct.isErrorResponse)(i))throw(0,me.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,me.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(on.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof Gm.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ct.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,ct.isErrorResponse)(n))throw(0,me.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,me.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,de.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Va.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const c=this._handleSubscriptionMethods(t);if(c!==void 0){c.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var c;throw(s.code===me.standardErrorCodes.rpc.methodNotFound||s.code===me.standardErrorCodes.rpc.methodNotSupported)&&((c=this.diagnostic)===null||c===void 0||c.log(on.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,de.ensureAddressString)(t);return this._addresses.map(i=>(0,de.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(on.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,de.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,de.ensureAddressString)(t.to):null,i=t.value!=null?(0,de.ensureBN)(t.value):new zm.default(0),s=t.data?(0,de.ensureBuffer)(t.data):Buffer.alloc(0),c=t.nonce!=null?(0,de.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,de.ensureBN)(t.gasPrice):null,f=t.maxFeePerGas!=null?(0,de.ensureBN)(t.maxFeePerGas):null,g=t.maxPriorityFeePerGas!=null?(0,de.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,de.ensureBN)(t.gas):null,M=t.chainId?(0,de.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:c,gasPriceInWei:a,maxFeePerGas:f,maxPriorityFeePerGas:g,gasLimit:p,chainId:M}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw me.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw me.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const c=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ct.isErrorResponse)(c))throw new Error(c.errorMessage);return{jsonrpc:"2.0",id:0,result:c.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,ct.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,de.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(za);if(!t)return(0,de.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,de.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(on.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,ct.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,de.ensureAddressString)(t[0]),n=(0,de.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,de.ensureBuffer)(t[0]),n=(0,de.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,de.ensureBuffer)(t[0]),n=(0,de.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,de.ensureBuffer)(t[0]),n=(0,de.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,ct.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,de.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ct.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,ct.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?me.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,de.ensureParsedJSONObject)(t[0]),n=(0,de.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Ls.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,de.ensureAddressString)(t[0]),n=(0,de.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Ls.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,de.ensureAddressString)(t[0]),n=(0,de.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Ls.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const c=t[0];if(((r=c.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!c.chainName||c.chainName.trim()==="")throw me.standardErrors.rpc.invalidParams("chainName is a required field");if(!c.nativeCurrency)throw me.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(c.chainId,16);return await this.addEthereumChain(a,(n=c.rpcUrls)!==null&&n!==void 0?n:[],(i=c.blockExplorerUrls)!==null&&i!==void 0?i:[],c.chainName,(s=c.iconUrls)!==null&&s!==void 0?s:[],c.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw me.standardErrors.rpc.invalidParams("Type is required");if(r?.type!=="ERC20")throw me.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!r?.options)throw me.standardErrors.rpc.invalidParams("Options are required");if(!r?.options.address)throw me.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:c,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,c,n)}}_eth_uninstallFilter(t){const r=(0,de.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,de.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,de.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Hr.CoinbaseWalletProvider=Km;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.RelayEventManager=void 0;const Qm=X;class Ym{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,Qm.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Yi.RelayEventManager=Ym;Object.defineProperty(cn,"__esModule",{value:!0});cn.CoinbaseWalletSDK=void 0;const Xm=si,ew=oi,Ga=X,tw=di,rw=Hr,nw=wn,iw=kn,sw=Yi,ow=Rn,aw=yn,ql=Zr;class Xi{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||ew.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const c=new URL(s),a=`${c.protocol}//${c.host}`;if(this._storage=new tw.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Xi.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new sw.RelayEventManager;const f=(0,Ga.isMobileWeb)(),g=t.uiConstructor||(M=>f?new iw.MobileRelayUI(M):new ow.WalletLinkRelayUI(M)),p={linkAPIUrl:s,version:ql.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:g,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=f?new nw.MobileRelay(p):new aw.WalletLinkRelay(p),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new rw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,Ga.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,Xm.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}cn.CoinbaseWalletSDK=Xi;Xi.VERSION=ql.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=cn,r=Hr;var n=cn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Hr;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(zs);const cw=Gl(zs),Tw=ru({__proto__:null,default:cw},[zs]);export{Tw as i};