@dcl/blog-site 0.2.2-23649734878.commit-de1a383 → 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.
- package/assets/QueryClientProvider-mZKMZTwe.js +2 -0
- package/assets/RoobertPRO-Bold-DDyOqNrI.woff2 +0 -0
- package/assets/SignInRedirect-CXUOqOjy.js +11 -0
- package/assets/X-3yocgepi.js +15 -0
- package/assets/___vite-browser-external_commonjs-proxy-BqV5D26a.js +1 -0
- package/assets/__federation_expose_App-CMGDAIUH.js +1 -0
- package/assets/__federation_fn_import-C51lglKS.js +1 -0
- package/assets/__federation_shared_@dcl/hooks-Dm9PRmKy.js +535 -0
- package/assets/__federation_shared_@dcl/schemas-CVwtHlVJ.js +1 -0
- package/assets/__federation_shared_@emotion/react-AmEOkpjC.js +1 -0
- package/assets/__federation_shared_@emotion/styled-aZ9bk9Xh.js +1 -0
- package/assets/__federation_shared_@reduxjs/toolkit-DIZvwqf7.js +1 -0
- package/assets/__federation_shared_decentraland-ui2-KxrbFOTA.js +358 -0
- package/assets/__federation_shared_react-B3tlNTLg.js +1 -0
- package/assets/__federation_shared_react-dom-CCS4dT_K.js +1 -0
- package/assets/__federation_shared_react-redux-Ckcz2edF.js +13 -0
- package/assets/__federation_shared_react-router-dom-jUWpDOjR.js +49 -0
- package/assets/__federation_shared_viem-Cdp7wK0V.js +2 -0
- package/assets/__federation_shared_wagmi-CHWRoybR.js +17 -0
- package/assets/__vite-optional-peer-dep_lottie-react_decentraland-ui2-BIHI7g3E.js +1 -0
- package/assets/_commonjsHelpers-C4iS2aBk.js +1 -0
- package/assets/{add-zf09jsz8.js → add-DHMb_tRw.js} +2 -2
- package/assets/all-wallets-Bo3QRxXL.js +6 -0
- package/assets/{app-store-C64E-ygN.js → app-store-BHwDXU8D.js} +2 -2
- package/assets/{apple-B11br0RG.js → apple-BFX-plRw.js} +2 -2
- package/assets/arrow-bottom-Djx9NXV2.js +8 -0
- package/assets/{arrow-bottom-circle-BYISwBN-.js → arrow-bottom-circle-DcJnW2eo.js} +2 -2
- package/assets/arrow-left-BS_dJGSP.js +8 -0
- package/assets/arrow-right-B-mwy0Iu.js +8 -0
- package/assets/arrow-top-Di1bbZG1.js +8 -0
- package/assets/auto-track-pkMvCaah.js +1 -0
- package/assets/{bank-q4oLVSZ1.js → bank-B9SMq-ix.js} +2 -2
- package/assets/{basic-CGdBHVeA.js → basic-DijYF-IW.js} +124 -124
- package/assets/biconomy-CCw3vtwR.js +1 -0
- package/assets/{browser-BH_NdFte.js → browser-CdKdszu-.js} +2 -2
- package/assets/{card-CU8Sx8aZ.js → card-CQu4Eu8c.js} +2 -2
- package/assets/ccip-AgQ5AD9v.js +1 -0
- package/assets/chains-D88UzVoE.js +1 -0
- package/assets/{checkmark-CJQv14xB.js → checkmark-D2vezo75.js} +2 -2
- package/assets/{checkmark-bold-yZPChLqH.js → checkmark-bold-DriAapzP.js} +2 -2
- package/assets/chevron-bottom-CcFEOVdH.js +8 -0
- package/assets/chevron-left-BXS-ybhL.js +8 -0
- package/assets/chevron-right-TvO5COya.js +8 -0
- package/assets/chevron-top-D84SgxMg.js +8 -0
- package/assets/{chrome-store-uudWD7dl.js → chrome-store-rpsfVQln.js} +2 -2
- package/assets/{clock-BtHKgq8x.js → clock-BMJ2gt7b.js} +2 -2
- package/assets/close-kAWkeKAP.js +8 -0
- package/assets/{coinPlaceholder-4wrqCYAs.js → coinPlaceholder-Dz8MKewa.js} +2 -2
- package/assets/common-D37S_OFt.js +1 -0
- package/assets/{compass-DfOzkjuQ.js → compass-BednEqu-.js} +2 -2
- package/assets/controller-D0Gc4Hsp.js +2 -0
- package/assets/{copy-BDn55LjS.js → copy-D7rBk-hZ.js} +2 -2
- package/assets/core-Bn8Mr-tS.js +907 -0
- package/assets/create-submenu-Bu20F8-Z.webp +0 -0
- package/assets/createBundlerClient-DhRCLsYO.js +4 -0
- package/assets/createClient-C9QPJaZu.js +1 -0
- package/assets/cursor-C8UG2IDe.js +3 -0
- package/assets/{cursor-transparent-B0-Mw3Y1.js → cursor-transparent-CyP0H3C5.js} +2 -2
- package/assets/decimals-B7Pm5rZk.js +1 -0
- package/assets/decimals-DedKFk8m.js +1 -0
- package/assets/defineChain-7I0Ce1VT.js +1 -0
- package/assets/{desktop-Cm0fPOoG.js → desktop-LBcRpcZE.js} +2 -2
- package/assets/detectExtension-C2uVeK-n.js +1 -0
- package/assets/{disconnect-BuA91iia.js → disconnect-DEBEe-yK.js} +2 -2
- package/assets/{discord-CEAkeZ_H.js → discord-BlVFKMf0.js} +2 -2
- package/assets/emotion-react.browser.esm-BzYQLDSp.js +8 -0
- package/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-TsHx33zg.js +1 -0
- package/assets/encode-DvvW4ZKt.js +2 -0
- package/assets/engine-CD7SeAap.js +1 -0
- package/assets/estimate-gas-CeHGaIbG.js +3 -0
- package/assets/estimate-l1-fee-ClMO5l7U.js +1 -0
- package/assets/eth_estimateGas-C2ENZ_HR.js +1 -0
- package/assets/eth_getStorageAt-BHgF2qz5.js +1 -0
- package/assets/eth_getTransactionCount-DWnnw2mX.js +1 -0
- package/assets/ethereum-dN7ENYl_.js +1 -0
- package/assets/{etherscan-WCjozDmo.js → etherscan-C_pqcV9R.js} +2 -2
- package/assets/events-B5inrCVE.js +1 -0
- package/assets/{exclamation-triangle-CXoNKPez.js → exclamation-triangle-R9Xq3IaG.js} +2 -2
- package/assets/explore-submenu-BFVuYMi9.webp +0 -0
- package/assets/{extension-BszEBTVU.js → extension-DkA_7Cbg.js} +2 -2
- package/assets/external-link-BPOw_fuW.js +8 -0
- package/assets/extractIPFS-B4LGER25.js +1 -0
- package/assets/{facebook-4SsNdpO8.js → facebook-CMZk_t1A.js} +2 -2
- package/assets/{farcaster-ayvvFuu8.js → farcaster-CveILPqa.js} +2 -2
- package/assets/fee-data-BKBGP5kG.js +1 -0
- package/assets/fetchTokenMetadata-BLDHgO8L.js +2 -0
- package/assets/{filters-CaJPoSbo.js → filters-BspTrZpX.js} +2 -2
- package/assets/get-ecosystem-wallet-info-D3PrM5FE.js +1 -0
- package/assets/getBalance-D7nzATjL.js +2 -0
- package/assets/getInstalledModules-Ck_Gj8FO.js +1 -0
- package/assets/getNFT-BcCS23O_.js +1 -0
- package/assets/getNFT-DXdMP0Q5.js +2 -0
- package/assets/{github-Agge6OPm.js → github-DoFHEMIF.js} +2 -2
- package/assets/{google-BCp2rRpD.js → google-NTQi9GVe.js} +2 -2
- package/assets/governance-submenu-VTIKvCIL.webp +0 -0
- package/assets/{help-circle-BglhVJJg.js → help-circle-DV0uNPdn.js} +2 -2
- package/assets/hex-B0Rx0hII.js +2 -0
- package/assets/{id-DJWOh1yx.js → id-UAVc1FOO.js} +1 -1
- package/assets/{image-XVP-TFUR.js → image-BeHBzCPG.js} +2 -2
- package/assets/in-app-wallet-calls-CvFtsXP9.js +1 -0
- package/assets/index-B2OCb4Ez.js +1 -0
- package/assets/index-B65z14KI.js +4 -0
- package/assets/index-BAhlRyDG.js +1 -0
- package/assets/{index-DOqN8xaU.js → index-BTtTX-5z.js} +1 -1
- package/assets/index-BjzJcZq6.js +1 -0
- package/assets/index-BjzJcZq6__bundled.js +24 -0
- package/assets/index-BozJS3za.js +12 -0
- package/assets/index-C05H8NDX.js +1 -0
- package/assets/index-C1IoT2if.js +3 -0
- package/assets/index-C2hdqzGT.js +2 -0
- package/assets/index-CgMDPZul.js +13 -0
- package/assets/index-CjuQOkbh.js +2 -0
- package/assets/index-CpR9p5nk.js +1 -0
- package/assets/index-D1lXZVQu.js +45 -0
- package/assets/index-D6ZAha0r.js +395 -0
- package/assets/{index-X-a697cI.js → index-DJ7GgcJ9.js} +2 -2
- package/assets/index-DajuSfcu.js +2 -0
- package/assets/index-DeklogZX.js +1 -0
- package/assets/index-DmAaXUNv.js +1 -0
- package/assets/index-Dy0yjznp.js +1 -0
- package/assets/index-Dy0yjznp__bundled.js +9 -0
- package/assets/index-HvoTJwGm.js +1 -0
- package/assets/index-MYKNZAUu.js +8 -0
- package/assets/index-Tsk25L8E.js +1 -0
- package/assets/index.es-C8Kfv-K1.js +11 -0
- package/assets/index.es-CAXGMBEH.js +1 -0
- package/assets/index.es-D3pP9hN4.js +27 -0
- package/assets/index.es-D5YKsq2-.js +2 -0
- package/assets/index.umd-DK712HHb.js +1 -0
- package/assets/{info-Ce-k8YeY.js → info-CzcA85TO.js} +2 -2
- package/assets/{info-circle-DWKsUP7S.js → info-circle-D3Mr3R9u.js} +2 -2
- package/assets/is-plan-event-enabled-DeNtQvA5.js +1 -0
- package/assets/json-BHzNJmTy.js +1 -0
- package/assets/jsx-runtime-DncYoG30.js +1 -0
- package/assets/jsx-runtime-DncYoG30__bundled.js +9 -0
- package/assets/learn-submenu-sfxVP5Db.webp +0 -0
- package/assets/{lightbulb-WJ_BxNVb.js → lightbulb-B2FZtM_8.js} +2 -2
- package/assets/localBatchGatewayRequest-BIEAG3VG.js +1 -0
- package/assets/{mail-KoHfgvFC.js → mail-CkhGbows.js} +2 -2
- package/assets/marketplace-submenu-CixWTv8_.webp +0 -0
- package/assets/{mobile-DgiOcfZl.js → mobile-1H3FtqAS.js} +2 -2
- package/assets/{more-DQ2sX7uC.js → more-CZiQi624.js} +2 -2
- package/assets/{network-placeholder-J46GlKpA.js → network-placeholder-DA2bm2rC.js} +2 -2
- package/assets/{nftPlaceholder-DJzkRgNi.js → nftPlaceholder-C9t5Ydxp.js} +2 -2
- package/assets/off-D8z0OQ3M.js +8 -0
- package/assets/op-gas-fee-reducer-CfxMcvXl.js +1 -0
- package/assets/openzeppelin-ZKz6sLW9.js +1 -0
- package/assets/ownerOf-D1aXOt9Q.js +1 -0
- package/assets/parseNft-LjEwmOst.js +2 -0
- package/assets/passkeys-CTJ4NPfL.js +1 -0
- package/assets/{play-store-DnrAN_Zk.js → play-store-_X5LrPwx.js} +2 -2
- package/assets/{plus-CG21jVu3.js → plus-JriDhMxt.js} +2 -2
- package/assets/preload-helper-BorDCKdG.js +1 -0
- package/assets/publicKeyToAddress-CxEKPAKT.js +1 -0
- package/assets/{qr-code-DCN5HoIC.js → qr-code-DaB080BF.js} +2 -2
- package/assets/{qr-overlay-DZM2US31.js → qr-overlay-CGnFhcTk.js} +1 -1
- package/assets/{recycle-horizontal-pV5cKVIC.js → recycle-horizontal-CGeFmMrT.js} +2 -2
- package/assets/redux-BNDF-Lt-.js +1 -0
- package/assets/{refresh-DDAlbnMR.js → refresh-Dgvxxw5C.js} +2 -2
- package/assets/remoteEntry.js +1 -0
- package/assets/{reown-logo-BgBTRPqh.js → reown-logo-CBX48aN9.js} +2 -2
- package/assets/resolveImplementation-Cb2bL1tx.js +1 -0
- package/assets/rich-text-react-renderer.es5-D_tE7AHo.js +2 -0
- package/assets/rpc-ti0b0r_u.js +3 -0
- package/assets/search-DamXBOxM.js +8 -0
- package/assets/secp256k1-UEF-yOzn.js +1 -0
- package/assets/{send-1sOEDYYV.js → send-BLpUSx_G.js} +2 -2
- package/assets/send-batch-transaction-DnH876GL.js +1 -0
- package/assets/send-eip712-transaction-D_FU-Avh.js +2 -0
- package/assets/send-gasless-transaction-MP1Q_mLW.js +2 -0
- package/assets/serializeTransaction-mtsVBaO6.js +1 -0
- package/assets/session-proposal-CM3P7DaL.js +1 -0
- package/assets/session-request-Dqw67u3p.js +2 -0
- package/assets/sha256-DYtpy1Qz.js +1 -0
- package/assets/signing-BFeVjjPi.js +5 -0
- package/assets/store-DOLZnwHk.js +1 -0
- package/assets/{swapHorizontal-DwtkaBY9.js → swapHorizontal-Br-MZ1tO.js} +2 -2
- package/assets/{swapHorizontalBold-DjH3VBED.js → swapHorizontalBold-CkUNbZ1G.js} +2 -2
- package/assets/{swapHorizontalMedium-B8m-zSxH.js → swapHorizontalMedium-D3qEQNb5.js} +2 -2
- package/assets/{swapHorizontalRoundedBold-CcKr4oU5.js → swapHorizontalRoundedBold-CzzBPCtt.js} +2 -2
- package/assets/{swapVertical-Vhgw_9G1.js → swapVertical-Mrn3zm_W.js} +2 -2
- package/assets/{telegram-CItwttXQ.js → telegram-ZTLC9FiA.js} +2 -2
- package/assets/thirdweb-CHfVLLbM.js +1 -0
- package/assets/thirdweb-D5ezTmuN.js +27 -0
- package/assets/{three-dots-DcElkEG2.js → three-dots-DYl4uQjm.js} +2 -2
- package/assets/totalSupply-B5jHW8gx.js +1 -0
- package/assets/tslib.es6-DbvBTznf.js +1 -0
- package/assets/{twitch-DIYf-ntg.js → twitch-DPLkA98Q.js} +2 -2
- package/assets/{twitterIcon-xMs4TJuA.js → twitterIcon-BEY_UAyG.js} +2 -2
- package/assets/uid-D00jCazq.js +44 -0
- package/assets/{uint8-array-CjVHUazS.js → uint8-array-DZKEMhA1.js} +1 -1
- package/assets/utils-C7urdXtO.js +2 -0
- package/assets/utils-CozXUO91.js +1 -0
- package/assets/{verify-CJQEOvVE.js → verify-DuPdiufm.js} +2 -2
- package/assets/{verify-filled-Dm46z2W0.js → verify-filled-CdqEW5AP.js} +2 -2
- package/assets/{w3m-modal-ime9_H71.js → w3m-modal-BLzhBUlF.js} +34 -34
- package/assets/wait-for-tx-receipt-B-o5aPQ8.js +1 -0
- package/assets/{wallet-DsKK0DZZ.js → wallet-CZw1g3L8.js} +2 -2
- package/assets/{wallet-placeholder-lVvJajkJ.js → wallet-placeholder-OAkoJuru.js} +2 -2
- package/assets/{walletconnect-BzBoiyAH.js → walletconnect-BJ3w7-IU.js} +4 -4
- package/assets/wallets-Q5RcRyG6.js +16 -0
- package/assets/{warning-circle-DPKmaE0h.js → warning-circle-DpDeOZKv.js} +2 -2
- package/assets/web-connector-CB7tpRui.js +9 -0
- package/assets/webSocket-dQW3n9NM.js +3 -0
- package/assets/withCache-DYumIHzL.js +1 -0
- package/assets/{x-DEpEErGT.js → x-liJqLZUi.js} +2 -2
- package/assets/zora-sepolia-DNJ2DQat.js +1 -0
- package/index.html +17 -3
- package/package.json +3 -3
- package/assets/RoobertPRO-Bold-BLoSpx-h.otf +0 -0
- package/assets/all-wallets-tVLLlnWi.js +0 -6
- package/assets/arrow-bottom-DifqQKT2.js +0 -8
- package/assets/arrow-left-DTR_KHWL.js +0 -8
- package/assets/arrow-right-DU6_D0VV.js +0 -8
- package/assets/arrow-top-B_CgJVlG.js +0 -8
- package/assets/auto-track-BxXPoe4g.js +0 -1
- package/assets/biconomy-6NHz5Iqa.js +0 -1
- package/assets/ccip-BfmMG-TS.js +0 -1
- package/assets/chains-BJ1WS73W.js +0 -1
- package/assets/chevron-bottom-DTs-26Eq.js +0 -8
- package/assets/chevron-left-CWQcI0TP.js +0 -8
- package/assets/chevron-right-zjZwGM3P.js +0 -8
- package/assets/chevron-top-DiPqYm2O.js +0 -8
- package/assets/close-C0UXp_W-.js +0 -8
- package/assets/common-B5-2TPMC.js +0 -1
- package/assets/controller-zOLBxAda.js +0 -2
- package/assets/core-FalccOZQ.js +0 -908
- package/assets/create-submenu-DEFVbrc5.png +0 -0
- package/assets/createBundlerClient-ceEjCqsz.js +0 -8
- package/assets/cursor-BQJeaiqW.js +0 -3
- package/assets/decimals-BBBuCBiH.js +0 -1
- package/assets/decimals-DrdfxUxV.js +0 -1
- package/assets/detectExtension-CTJS_83C.js +0 -1
- package/assets/engine-1bZj5J3h.js +0 -1
- package/assets/estimate-l1-fee-C9trXYSy.js +0 -1
- package/assets/eth_estimateGas-DylIsdQK.js +0 -1
- package/assets/eth_getStorageAt-D6adTFW0.js +0 -1
- package/assets/eth_getTransactionCount-BIhOSWd4.js +0 -1
- package/assets/ethereum-Bb-GI0c-.js +0 -1
- package/assets/events-BSf9wyey.js +0 -1
- package/assets/explore-submenu-KVl6Dc-h.png +0 -0
- package/assets/external-link-Dd_ZWmsS.js +0 -8
- package/assets/extractIPFS-GqdL13gj.js +0 -1
- package/assets/fetchTokenMetadata-BVwYMovl.js +0 -2
- package/assets/get-ecosystem-wallet-info-Q0K86GGt.js +0 -1
- package/assets/getBalance-B57AUVbe.js +0 -1
- package/assets/getInstalledModules-CAje9rp8.js +0 -1
- package/assets/getNFT-Bb-t59ds.js +0 -2
- package/assets/getNFT-CpvjLK0Y.js +0 -1
- package/assets/governance-submenu-CXxLX9nT.png +0 -0
- package/assets/hashTypedData-621x-e3F.js +0 -1
- package/assets/in-app-wallet-calls-C4soc9zT.js +0 -1
- package/assets/index-B1P0UjN9.js +0 -1
- package/assets/index-BAkdueH0.js +0 -1
- package/assets/index-CUn0wuu2.js +0 -2
- package/assets/index-CecZD-vJ.js +0 -395
- package/assets/index-CmTH1mn1.js +0 -1
- package/assets/index-D4HP5DQC.js +0 -1
- package/assets/index-DSxj-vNU.js +0 -3
- package/assets/index-DX_PNZlK.js +0 -2
- package/assets/index-DlDkzdhK.js +0 -895
- package/assets/index-DoKNVID8.js +0 -2
- package/assets/index-Dw1-bBaI.js +0 -1
- package/assets/index-LCDpDH8Q.js +0 -4
- package/assets/index-Mb-EqEoD.js +0 -23
- package/assets/index-VloZUDIL.js +0 -12
- package/assets/index-X1qL-0B0.js +0 -13
- package/assets/index.es-B3ObrDkW.js +0 -27
- package/assets/index.es-ClZCnaxS.js +0 -1
- package/assets/index.es-DqGsvA8g.js +0 -12
- package/assets/index.es-vOkXvnBD.js +0 -2
- package/assets/index.umd-CrjosV4X.js +0 -1
- package/assets/is-plan-event-enabled-DS1Agtkw.js +0 -1
- package/assets/learn-submenu-Xs1jOwfy.png +0 -0
- package/assets/localBatchGatewayRequest-DbABcKyV.js +0 -1
- package/assets/marketplace-submenu-CjxTqNhj.png +0 -0
- package/assets/off-Bx4KjNoN.js +0 -8
- package/assets/openzeppelin-CDBEZ0A6.js +0 -1
- package/assets/ownerOf-H_15UHmZ.js +0 -1
- package/assets/parseNft-C-gFG5mL.js +0 -2
- package/assets/passkeys-CqFedyqV.js +0 -1
- package/assets/resolveImplementation--0Bj03XB.js +0 -1
- package/assets/rpc-BMTq3WxT.js +0 -3
- package/assets/search-F5Kt2PDD.js +0 -8
- package/assets/secp256k1-D0j47cev.js +0 -1
- package/assets/secp256k1-DTovG4r4.js +0 -1
- package/assets/secp256k1-HF3nQqZj.js +0 -1
- package/assets/send-batch-transaction-DexqN5g2.js +0 -1
- package/assets/send-eip712-transaction-CzOG_yjy.js +0 -2
- package/assets/send-gasless-transaction-BerY-rcr.js +0 -2
- package/assets/session-proposal-BxP6Eg-Q.js +0 -1
- package/assets/session-request-BmUVvzLs.js +0 -2
- package/assets/sha256-CBZo01eO.js +0 -1
- package/assets/signing-CQ15XHyj.js +0 -30
- package/assets/thirdweb-BEvIP-fy.js +0 -27
- package/assets/thirdweb-DZ2vK6IO.js +0 -1
- package/assets/totalSupply-DYVdetcS.js +0 -1
- package/assets/utils-B3vUvlNq.js +0 -1
- package/assets/wait-for-tx-receipt-BWZbdlKf.js +0 -1
- package/assets/wallets-CCAGQYIy.js +0 -17
- package/assets/web-connector-BiJHWbvm.js +0 -9
- package/assets/zora-sepolia-CZ4Tf1UH.js +0 -1
- package/dcl-blog-site-0.2.2-23649734878.commit-de1a383.tgz +0 -0
package/assets/index-VloZUDIL.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{f as ee,G as ko,H as En,I as wh,h as _h}from"./index-DlDkzdhK.js";import{e as Eh}from"./index-6E4L_h32.js";import{i as Mt}from"./inherits_browser-BlmhoU4v.js";import{p as Sh,a as Rh}from"./hooks.module-Cpp96UEK.js";import{e as ki}from"./events-BSf9wyey.js";function Mh(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 go={exports:{}},Ts,ga;function Ch(){if(ga)return Ts;ga=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;Ts=function(p,S){S=S||{};var w=typeof p;if(w==="string"&&p.length>0)return c(p);if(w==="number"&&isFinite(p))return S.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 S=/^(-?(?:\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(S){var w=parseFloat(S[1]),N=(S[2]||"ms").toLowerCase();switch(N){case"years":case"year":case"yrs":case"yr":case"y":return w*s;case"weeks":case"week":case"w":return w*i;case"days":case"day":case"d":return w*n;case"hours":case"hour":case"hrs":case"hr":case"h":return w*r;case"minutes":case"minute":case"mins":case"min":case"m":return w*t;case"seconds":case"second":case"secs":case"sec":case"s":return w*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function a(p){var S=Math.abs(p);return S>=n?Math.round(p/n)+"d":S>=r?Math.round(p/r)+"h":S>=t?Math.round(p/t)+"m":S>=e?Math.round(p/e)+"s":p+"ms"}function f(p){var S=Math.abs(p);return S>=n?g(p,S,n,"day"):S>=r?g(p,S,r,"hour"):S>=t?g(p,S,t,"minute"):S>=e?g(p,S,e,"second"):p+" ms"}function g(p,S,w,N){var U=S>=w*1.5;return Math.round(p/w)+" "+N+(U?"s":"")}return Ts}function Ih(e){r.debug=r,r.default=r,r.coerce=f,r.disable=c,r.enable=i,r.enabled=a,r.humanize=Ch(),r.destroy=g,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let S=0;for(let w=0;w<p.length;w++)S=(S<<5)-S+p.charCodeAt(w),S|=0;return r.colors[Math.abs(S)%r.colors.length]}r.selectColor=t;function r(p){let S,w=null,N,U;function F(...H){if(!F.enabled)return;const k=F,P=Number(new Date),O=P-(S||P);k.diff=O,k.prev=S,k.curr=P,S=P,H[0]=r.coerce(H[0]),typeof H[0]!="string"&&H.unshift("%O");let V=0;H[0]=H[0].replace(/%([a-zA-Z%])/g,(z,te)=>{if(z==="%%")return"%";V++;const Q=r.formatters[te];if(typeof Q=="function"){const Y=H[V];z=Q.call(k,Y),H.splice(V,1),V--}return z}),r.formatArgs.call(k,H),(k.log||r.log).apply(k,H)}return F.namespace=p,F.useColors=r.useColors(),F.color=r.selectColor(p),F.extend=n,F.destroy=r.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(N!==r.namespaces&&(N=r.namespaces,U=r.enabled(p)),U),set:H=>{w=H}}),typeof r.init=="function"&&r.init(F),F}function n(p,S){const w=r(this.namespace+(typeof S>"u"?":":S)+p);return w.log=this.log,w}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];const S=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const w of S)w[0]==="-"?r.skips.push(w.slice(1)):r.names.push(w)}function s(p,S){let w=0,N=0,U=-1,F=0;for(;w<p.length;)if(N<S.length&&(S[N]===p[w]||S[N]==="*"))S[N]==="*"?(U=N,F=w,N++):(w++,N++);else if(U!==-1)N=U+1,F++,w=F;else return!1;for(;N<S.length&&S[N]==="*";)N++;return N===S.length}function c(){const p=[...r.names,...r.skips.map(S=>"-"+S)].join(",");return r.enable(""),p}function a(p){for(const S of r.skips)if(s(p,S))return!1;for(const S of r.names)if(s(p,S))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 Ah=Ih;(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 S=0,w=0;g[0].replace(/%[a-zA-Z%]/g,N=>{N!=="%%"&&(S++,N==="%c"&&(w=S))}),g.splice(w,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=Ah(t);const{formatters:f}=e.exports;f.j=function(g){try{return JSON.stringify(g)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(go,go.exports);var kh=go.exports,xh=mn;mn.default=mn;mn.stable=nl;mn.stableStringify=nl;var Ei="[...]",tl="[Circular]",vr=[],pr=[];function rl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function mn(e,t,r,n){typeof n>"u"&&(n=rl()),yo(e,"",0,[],void 0,0,n);var i;try{pr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,il(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;vr.length!==0;){var s=vr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Vr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),vr.push([n,r,t,i])):pr.push([t,r,e]):(n[r]=e,vr.push([n,r,t]))}function yo(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){Vr(tl,e,t,i);return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Vr(Ei,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Vr(Ei,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)yo(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];yo(e[g],g,a,n,e,s,c)}}n.pop()}}function Th(e,t){return e<t?-1:e>t?1:0}function nl(e,t,r,n){typeof n>"u"&&(n=rl());var i=mo(e,"",0,[],void 0,0,n)||e,s;try{pr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,il(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;vr.length!==0;){var c=vr.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function mo(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){Vr(tl,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&s>c.depthLimit){Vr(Ei,e,t,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){Vr(Ei,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)mo(e[a],a,a,n,e,s,c);else{var f={},g=Object.keys(e).sort(Th);for(a=0;a<g.length;a++){var p=g[a];mo(e[p],p,a,n,e,s,c),f[p]=e[p]}if(typeof i<"u")vr.push([i,t,e]),i[t]=f;else return f}n.pop()}}function il(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(pr.length>0)for(var n=0;n<pr.length;n++){var i=pr[n];if(i[1]===t&&i[0]===r){r=i[2],pr.splice(n,1);break}}return e.call(this,t,r)}}var gi=Object.defineProperty||!1;if(gi)try{gi({},"a",{value:1})}catch{gi=!1}var xi=gi,sl=SyntaxError,Sn=TypeError,Bh=Object.getOwnPropertyDescriptor,yi=Bh;if(yi)try{yi([],"length")}catch{yi=null}var Rn=yi,ya=xi,Nh=sl,Br=Sn,ma=Rn,Ph=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Br("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Br("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Br("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Br("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Br("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Br("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,f=!!ma&&ma(t,r);if(ya)ya(t,r,{configurable:c===null&&f?f.configurable:!c,enumerable:i===null&&f?f.enumerable:!i,value:n,writable:s===null&&f?f.writable:!s});else if(a||!i&&!s&&!c)t[r]=n;else throw new Nh("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},vo=xi,ol=function(){return!!vo};ol.hasArrayLengthDefineBug=function(){if(!vo)return null;try{return vo([],"length",{value:1}).length!==1}catch{return!0}};var Lh=ol,al={exports:{}},cl=Object,Oh=Error,Fh=EvalError,Dh=RangeError,jh=ReferenceError,Uh=URIError,$h=Math.abs,Hh=Math.floor,Wh=Math.max,Vh=Math.min,qh=Math.pow,zh=Math.round,Gh=Number.isNaN||function(t){return t!==t},Jh=Gh,Zh=function(t){return Jh(t)||t===0?t:t<0?-1:1},ll=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0},va=typeof Symbol<"u"&&Symbol,Kh=ll,Yh=function(){return typeof va!="function"||typeof Symbol!="function"||typeof va("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Kh()},ul=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,Qh=cl,hl=Qh.getPrototypeOf||null,Xh="Function.prototype.bind called on incompatible ",ef=Object.prototype.toString,tf=Math.max,rf="[object Function]",ba=function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},nf=function(t,r){for(var n=[],i=r,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},sf=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},of=function(t){var r=this;if(typeof r!="function"||ef.apply(r)!==rf)throw new TypeError(Xh+r);for(var n=nf(arguments,1),i,s=function(){if(this instanceof i){var p=r.apply(this,ba(n,arguments));return Object(p)===p?p:this}return r.apply(t,ba(n,arguments))},c=tf(0,r.length-n.length),a=[],f=0;f<c;f++)a[f]="$"+f;if(i=Function("binder","return function ("+sf(a,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=function(){};g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},af=of,Mn=Function.prototype.bind||af,Bs,wa;function xo(){return wa||(wa=1,Bs=Function.prototype.call),Bs}var Ns,_a;function To(){return _a||(_a=1,Ns=Function.prototype.apply),Ns}var cf=typeof Reflect<"u"&&Reflect&&Reflect.apply,lf=Mn,uf=To(),hf=xo(),ff=cf,fl=ff||lf.call(hf,uf),df=Mn,pf=Sn,gf=xo(),yf=fl,Bo=function(t){if(t.length<1||typeof t[0]!="function")throw new pf("a function is required");return yf(df,gf,t)},mf=Bo,Ea=Rn,dl;try{dl=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ps=!!dl&&Ea&&Ea(Object.prototype,"__proto__"),pl=Object,Sa=pl.getPrototypeOf,vf=Ps&&typeof Ps.get=="function"?mf([Ps.get]):typeof Sa=="function"?function(t){return Sa(t==null?t:pl(t))}:!1,Ra=ul,Ma=hl,Ca=vf,gl=Ra?function(t){return Ra(t)}:Ma?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ma(t)}:Ca?function(t){return Ca(t)}:null,bf=Function.prototype.call,wf=Object.prototype.hasOwnProperty,_f=Mn,Ef=_f.call(bf,wf),ye,Sf=cl,Rf=Oh,Mf=Fh,Cf=Dh,If=jh,Zr=sl,qr=Sn,Af=Uh,kf=$h,xf=Hh,Tf=Wh,Bf=Vh,Nf=qh,Pf=zh,Lf=Zh,yl=Function,Ls=function(e){try{return yl('"use strict"; return ('+e+").constructor;")()}catch{}},vn=Rn,Of=xi,Os=function(){throw new qr},Ff=vn?function(){try{return arguments.callee,Os}catch{try{return vn(arguments,"callee").get}catch{return Os}}}():Os,Nr=Yh(),et=gl,Df=hl,jf=ul,ml=To(),Cn=xo(),Ur={},Uf=typeof Uint8Array>"u"||!et?ye:et(Uint8Array),yr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ye:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ye:ArrayBuffer,"%ArrayIteratorPrototype%":Nr&&et?et([][Symbol.iterator]()):ye,"%AsyncFromSyncIteratorPrototype%":ye,"%AsyncFunction%":Ur,"%AsyncGenerator%":Ur,"%AsyncGeneratorFunction%":Ur,"%AsyncIteratorPrototype%":Ur,"%Atomics%":typeof Atomics>"u"?ye:Atomics,"%BigInt%":typeof BigInt>"u"?ye:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ye:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ye:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ye:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Rf,"%eval%":eval,"%EvalError%":Mf,"%Float16Array%":typeof Float16Array>"u"?ye:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ye:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ye:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ye:FinalizationRegistry,"%Function%":yl,"%GeneratorFunction%":Ur,"%Int8Array%":typeof Int8Array>"u"?ye:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ye:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ye:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Nr&&et?et(et([][Symbol.iterator]())):ye,"%JSON%":typeof JSON=="object"?JSON:ye,"%Map%":typeof Map>"u"?ye:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Nr||!et?ye:et(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Sf,"%Object.getOwnPropertyDescriptor%":vn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ye:Promise,"%Proxy%":typeof Proxy>"u"?ye:Proxy,"%RangeError%":Cf,"%ReferenceError%":If,"%Reflect%":typeof Reflect>"u"?ye:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ye:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Nr||!et?ye:et(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ye:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Nr&&et?et(""[Symbol.iterator]()):ye,"%Symbol%":Nr?Symbol:ye,"%SyntaxError%":Zr,"%ThrowTypeError%":Ff,"%TypedArray%":Uf,"%TypeError%":qr,"%Uint8Array%":typeof Uint8Array>"u"?ye:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ye:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ye:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ye:Uint32Array,"%URIError%":Af,"%WeakMap%":typeof WeakMap>"u"?ye:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ye:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ye:WeakSet,"%Function.prototype.call%":Cn,"%Function.prototype.apply%":ml,"%Object.defineProperty%":Of,"%Object.getPrototypeOf%":Df,"%Math.abs%":kf,"%Math.floor%":xf,"%Math.max%":Tf,"%Math.min%":Bf,"%Math.pow%":Nf,"%Math.round%":Pf,"%Math.sign%":Lf,"%Reflect.getPrototypeOf%":jf};if(et)try{null.error}catch(e){var $f=et(et(e));yr["%Error.prototype%"]=$f}var Hf=function e(t){var r;if(t==="%AsyncFunction%")r=Ls("async function () {}");else if(t==="%GeneratorFunction%")r=Ls("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Ls("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&et&&(r=et(i.prototype))}return yr[t]=r,r},Ia={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},In=Mn,Si=Ef,Wf=In.call(Cn,Array.prototype.concat),Vf=In.call(ml,Array.prototype.splice),Aa=In.call(Cn,String.prototype.replace),Ri=In.call(Cn,String.prototype.slice),qf=In.call(Cn,RegExp.prototype.exec),zf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Gf=/\\(\\)?/g,Jf=function(t){var r=Ri(t,0,1),n=Ri(t,-1);if(r==="%"&&n!=="%")throw new Zr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Zr("invalid intrinsic syntax, expected opening `%`");var i=[];return Aa(t,zf,function(s,c,a,f){i[i.length]=a?Aa(f,Gf,"$1"):c||s}),i},Zf=function(t,r){var n=t,i;if(Si(Ia,n)&&(i=Ia[n],n="%"+i[0]+"%"),Si(yr,n)){var s=yr[n];if(s===Ur&&(s=Hf(n)),typeof s>"u"&&!r)throw new qr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Zr("intrinsic "+t+" does not exist!")},vl=function(t,r){if(typeof t!="string"||t.length===0)throw new qr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qr('"allowMissing" argument must be a boolean');if(qf(/^%?[^%]*%?$/,t)===null)throw new Zr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Jf(t),i=n.length>0?n[0]:"",s=Zf("%"+i+"%",r),c=s.name,a=s.value,f=!1,g=s.alias;g&&(i=g[0],Vf(n,Wf([0,1],g)));for(var p=1,S=!0;p<n.length;p+=1){var w=n[p],N=Ri(w,0,1),U=Ri(w,-1);if((N==='"'||N==="'"||N==="`"||U==='"'||U==="'"||U==="`")&&N!==U)throw new Zr("property names with quotes must have matching quotes");if((w==="constructor"||!S)&&(f=!0),i+="."+w,c="%"+i+"%",Si(yr,c))a=yr[c];else if(a!=null){if(!(w in a)){if(!r)throw new qr("base intrinsic for "+t+" exists, but the property is not available.");return}if(vn&&p+1>=n.length){var F=vn(a,w);S=!!F,S&&"get"in F&&!("originalValue"in F.get)?a=F.get:a=a[w]}else S=Si(a,w),a=a[w];S&&!f&&(yr[c]=a)}}return a},Kf=vl,ka=Ph,Yf=Lh(),xa=Rn,Ta=Sn,Qf=Kf("%Math.floor%"),Xf=function(t,r){if(typeof t!="function")throw new Ta("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Qf(r)!==r)throw new Ta("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&xa){var c=xa(t,"length");c&&!c.configurable&&(i=!1),c&&!c.writable&&(s=!1)}return(i||s||!n)&&(Yf?ka(t,"length",r,!0,!0):ka(t,"length",r)),t},ed=Mn,td=To(),rd=fl,nd=function(){return rd(ed,td,arguments)};(function(e){var t=Xf,r=xi,n=Bo,i=nd;e.exports=function(c){var a=n(arguments),f=c.length-(arguments.length-1);return t(a,1+(f>0?f:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i})(al);var id=al.exports,bl=vl,wl=Bo,sd=wl([bl("%String.prototype.indexOf%")]),_l=function(t,r){var n=bl(t,!!r);return typeof n=="function"&&sd(t,".prototype.")>-1?wl([n]):n},od=ll,ad=function(){return od()&&!!Symbol.toStringTag},cd={}.toString,ld=Array.isArray||function(e){return cd.call(e)=="[object Array]"},El=Function.prototype.toString,Hr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,bo,mi;if(typeof Hr=="function"&&typeof Object.defineProperty=="function")try{bo=Object.defineProperty({},"length",{get:function(){throw mi}}),mi={},Hr(function(){throw 42},null,bo)}catch(e){e!==mi&&(Hr=null)}else Hr=null;var ud=/^\s*class\b/,wo=function(t){try{var r=El.call(t);return ud.test(r)}catch{return!1}},Fs=function(t){try{return wo(t)?!1:(El.call(t),!0)}catch{return!1}},vi=Object.prototype.toString,hd="[object Object]",fd="[object Function]",dd="[object GeneratorFunction]",pd="[object HTMLAllCollection]",gd="[object HTML document.all class]",yd="[object HTMLCollection]",md=typeof Symbol=="function"&&!!Symbol.toStringTag,vd=!(0 in[,]),_o=function(){return!1};if(typeof document=="object"){var bd=document.all;vi.call(bd)===vi.call(document.all)&&(_o=function(t){if((vd||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=vi.call(t);return(r===pd||r===gd||r===yd||r===hd)&&t("")==null}catch{}return!1})}var wd=Hr?function(t){if(_o(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Hr(t,null,bo)}catch(r){if(r!==mi)return!1}return!wo(t)&&Fs(t)}:function(t){if(_o(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(md)return Fs(t);if(wo(t))return!1;var r=vi.call(t);return r!==fd&&r!==dd&&!/^\[object HTML/.test(r)?!1:Fs(t)},_d=wd,Ed=Object.prototype.toString,Sl=Object.prototype.hasOwnProperty,Sd=function(t,r,n){for(var i=0,s=t.length;i<s;i++)Sl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},Rd=function(t,r,n){for(var i=0,s=t.length;i<s;i++)n==null?r(t.charAt(i),i,t):r.call(n,t.charAt(i),i,t)},Md=function(t,r,n){for(var i in t)Sl.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function Cd(e){return Ed.call(e)==="[object Array]"}var Id=function(t,r,n){if(!_d(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),Cd(t)?Sd(t,r,i):typeof t=="string"?Rd(t,r,i):Md(t,r,i)},Ad=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Ds=Ad,kd=typeof globalThis>"u"?ee:globalThis,xd=function(){for(var t=[],r=0;r<Ds.length;r++)typeof kd[Ds[r]]=="function"&&(t[t.length]=Ds[r]);return t},Mi=Id,Td=xd,Ba=id,No=_l,bi=Rn,ti=gl,Bd=No("Object.prototype.toString"),Rl=ad(),Na=typeof globalThis>"u"?ee:globalThis,Eo=Td(),Po=No("String.prototype.slice"),Nd=No("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},Ci={__proto__:null};Rl&&bi&&ti?Mi(Eo,function(e){var t=new Na[e];if(Symbol.toStringTag in t&&ti){var r=ti(t),n=bi(r,Symbol.toStringTag);if(!n&&r){var i=ti(r);n=bi(i,Symbol.toStringTag)}if(n&&n.get){var s=Ba(n.get);Ci["$"+e]=s}}}):Mi(Eo,function(e){var t=new Na[e],r=t.slice||t.set;if(r){var n=Ba(r);Ci["$"+e]=n}});var Pd=function(t){var r=!1;return Mi(Ci,function(n,i){if(!r)try{"$"+n(t)===i&&(r=Po(i,1))}catch{}}),r},Ld=function(t){var r=!1;return Mi(Ci,function(n,i){if(!r)try{n(t),r=Po(i,1)}catch{}}),r},Od=function(t){if(!t||typeof t!="object")return!1;if(!Rl){var r=Po(Bd(t),8,-1);return Nd(Eo,r)>-1?r:r!=="Object"?!1:Ld(t)}return bi?Pd(t):null},Lo={},bn={},Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.walletLogo=void 0;const Fd=(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 `}};Ti.walletLogo=Fd;var Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.LINK_API_URL=void 0;Bi.LINK_API_URL="https://www.walletlink.org";var X={},Oo={exports:{}};Oo.exports;(function(e){(function(t,r){function n(A,o){if(!A)throw new Error(o||"Assertion failed")}function i(A,o){A.super_=o;var d=function(){};d.prototype=o.prototype,A.prototype=new d,A.prototype.constructor=A}function s(A,o,d){if(s.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,A!==null&&((o==="le"||o==="be")&&(d=o,o=10),this._init(A||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=ko.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,m){if(typeof o=="number")return this._initNumber(o,d,m);if(typeof o=="object")return this._initArray(o,d,m);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),o=o.toString().replace(/\s+/g,"");var v=0;o[0]==="-"&&(v++,this.negative=1),v<o.length&&(d===16?this._parseHex(o,v,m):(this._parseBase(o,d,v),m==="le"&&this._initArray(this.toArray(),d,m)))},s.prototype._initNumber=function(o,d,m){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),m==="le"&&this._initArray(this.toArray(),d,m)},s.prototype._initArray=function(o,d,m){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 v=0;v<this.length;v++)this.words[v]=0;var E,I,T=0;if(m==="be")for(v=o.length-1,E=0;v>=0;v-=3)I=o[v]|o[v-1]<<8|o[v-2]<<16,this.words[E]|=I<<T&67108863,this.words[E+1]=I>>>26-T&67108863,T+=24,T>=26&&(T-=26,E++);else if(m==="le")for(v=0,E=0;v<o.length;v+=3)I=o[v]|o[v+1]<<8|o[v+2]<<16,this.words[E]|=I<<T&67108863,this.words[E+1]=I>>>26-T&67108863,T+=24,T>=26&&(T-=26,E++);return this._strip()};function a(A,o){var d=A.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 "+A)}function f(A,o,d){var m=a(A,d);return d-1>=o&&(m|=a(A,d-1)<<4),m}s.prototype._parseHex=function(o,d,m){this.length=Math.ceil((o.length-d)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var E=0,I=0,T;if(m==="be")for(v=o.length-1;v>=d;v-=2)T=f(o,d,v)<<E,this.words[I]|=T&67108863,E>=18?(E-=18,I+=1,this.words[I]|=T>>>26):E+=8;else{var b=o.length-d;for(v=b%2===0?d+1:d;v<o.length;v+=2)T=f(o,d,v)<<E,this.words[I]|=T&67108863,E>=18?(E-=18,I+=1,this.words[I]|=T>>>26):E+=8}this._strip()};function g(A,o,d,m){for(var v=0,E=0,I=Math.min(A.length,d),T=o;T<I;T++){var b=A.charCodeAt(T)-48;v*=m,b>=49?E=b-49+10:b>=17?E=b-17+10:E=b,n(b>=0&&E<m,"Invalid character"),v+=E}return v}s.prototype._parseBase=function(o,d,m){this.words=[0],this.length=1;for(var v=0,E=1;E<=67108863;E*=d)v++;v--,E=E/d|0;for(var I=o.length-m,T=I%v,b=Math.min(I,I-T)+m,u=0,R=m;R<b;R+=v)u=g(o,R,R+v,d),this.imuln(E),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(T!==0){var K=1;for(u=g(o,R,o.length,d),R=0;R<T;R++)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(A,o){A.words=o.words,A.length=o.length,A.negative=o.negative,A.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")]=S}catch{s.prototype.inspect=S}else s.prototype.inspect=S;function S(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var w=["","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],U=[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 m;if(o===16||o==="hex"){m="";for(var v=0,E=0,I=0;I<this.length;I++){var T=this.words[I],b=((T<<v|E)&16777215).toString(16);E=T>>>24-v&16777215,v+=2,v>=26&&(v-=26,I--),E!==0||I!==this.length-1?m=w[6-b.length]+b+m:m=b+m}for(E!==0&&(m=E.toString(16)+m);m.length%d!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(o===(o|0)&&o>=2&&o<=36){var u=N[o],R=U[o];m="";var K=this.clone();for(K.negative=0;!K.isZero();){var J=K.modrn(R).toString(o);K=K.idivn(R),K.isZero()?m=J+m:m=w[u-J.length]+J+m}for(this.isZero()&&(m="0"+m);m.length%d!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}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 F=function(o,d){return o.allocUnsafe?o.allocUnsafe(d):new o(d)};s.prototype.toArrayLike=function(o,d,m){this._strip();var v=this.byteLength(),E=m||Math.max(1,v);n(v<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var I=F(o,E),T=d==="le"?"LE":"BE";return this["_toArrayLike"+T](I,v),I},s.prototype._toArrayLikeLE=function(o,d){for(var m=0,v=0,E=0,I=0;E<this.length;E++){var T=this.words[E]<<I|v;o[m++]=T&255,m<o.length&&(o[m++]=T>>8&255),m<o.length&&(o[m++]=T>>16&255),I===6?(m<o.length&&(o[m++]=T>>24&255),v=0,I=0):(v=T>>>24,I+=2)}if(m<o.length)for(o[m++]=v;m<o.length;)o[m++]=0},s.prototype._toArrayLikeBE=function(o,d){for(var m=o.length-1,v=0,E=0,I=0;E<this.length;E++){var T=this.words[E]<<I|v;o[m--]=T&255,m>=0&&(o[m--]=T>>8&255),m>=0&&(o[m--]=T>>16&255),I===6?(m>=0&&(o[m--]=T>>24&255),v=0,I=0):(v=T>>>24,I+=2)}if(m>=0)for(o[m--]=v;m>=0;)o[m--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var d=o,m=0;return d>=4096&&(m+=13,d>>>=13),d>=64&&(m+=7,d>>>=7),d>=8&&(m+=4,d>>>=4),d>=2&&(m+=2,d>>>=2),m+d},s.prototype._zeroBits=function(o){if(o===0)return 26;var d=o,m=0;return d&8191||(m+=13,d>>>=13),d&127||(m+=7,d>>>=7),d&15||(m+=4,d>>>=4),d&3||(m+=2,d>>>=2),d&1||m++,m},s.prototype.bitLength=function(){var o=this.words[this.length-1],d=this._countBits(o);return(this.length-1)*26+d};function H(A){for(var o=new Array(A.bitLength()),d=0;d<o.length;d++){var m=d/26|0,v=d%26;o[d]=A.words[m]>>>v&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,d=0;d<this.length;d++){var m=this._zeroBits(this.words[d]);if(o+=m,m!==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 m=0;m<d.length;m++)this.words[m]=this.words[m]&o.words[m];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,m;this.length>o.length?(d=this,m=o):(d=o,m=this);for(var v=0;v<m.length;v++)this.words[v]=d.words[v]^m.words[v];if(this!==d)for(;v<d.length;v++)this.words[v]=d.words[v];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,m=o%26;this._expand(d),m>0&&d--;for(var v=0;v<d;v++)this.words[v]=~this.words[v]&67108863;return m>0&&(this.words[v]=~this.words[v]&67108863>>26-m),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 m=o/26|0,v=o%26;return this._expand(m+1),d?this.words[m]=this.words[m]|1<<v:this.words[m]=this.words[m]&~(1<<v),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 m,v;this.length>o.length?(m=this,v=o):(m=o,v=this);for(var E=0,I=0;I<v.length;I++)d=(m.words[I]|0)+(v.words[I]|0)+E,this.words[I]=d&67108863,E=d>>>26;for(;E!==0&&I<m.length;I++)d=(m.words[I]|0)+E,this.words[I]=d&67108863,E=d>>>26;if(this.length=m.length,E!==0)this.words[this.length]=E,this.length++;else if(m!==this)for(;I<m.length;I++)this.words[I]=m.words[I];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 m=this.cmp(o);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,E;m>0?(v=this,E=o):(v=o,E=this);for(var I=0,T=0;T<E.length;T++)d=(v.words[T]|0)-(E.words[T]|0)+I,I=d>>26,this.words[T]=d&67108863;for(;I!==0&&T<v.length;T++)d=(v.words[T]|0)+I,I=d>>26,this.words[T]=d&67108863;if(I===0&&T<v.length&&v!==this)for(;T<v.length;T++)this.words[T]=v.words[T];return this.length=Math.max(this.length,T),v!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function k(A,o,d){d.negative=o.negative^A.negative;var m=A.length+o.length|0;d.length=m,m=m-1|0;var v=A.words[0]|0,E=o.words[0]|0,I=v*E,T=I&67108863,b=I/67108864|0;d.words[0]=T;for(var u=1;u<m;u++){for(var R=b>>>26,K=b&67108863,J=Math.min(u,o.length-1),x=Math.max(0,u-A.length+1);x<=J;x++){var L=u-x|0;v=A.words[L]|0,E=o.words[x]|0,I=v*E+K,R+=I/67108864|0,K=I&67108863}d.words[u]=K|0,b=R|0}return b!==0?d.words[u]=b|0:d.length--,d._strip()}var P=function(o,d,m){var v=o.words,E=d.words,I=m.words,T=0,b,u,R,K=v[0]|0,J=K&8191,x=K>>>13,L=v[1]|0,W=L&8191,Z=L>>>13,le=v[2]|0,M=le&8191,C=le>>>13,q=v[3]|0,G=q&8191,se=q>>>13,ue=v[4]|0,re=ue&8191,we=ue>>>13,dt=v[5]|0,Re=dt&8191,Se=dt>>>13,Ze=v[6]|0,_e=Ze&8191,Me=Ze>>>13,Qe=v[7]|0,Ee=Qe&8191,y=Qe>>>13,l=v[8]|0,h=l&8191,_=l>>>13,B=v[9]|0,D=B&8191,$=B>>>13,he=E[0]|0,ae=he&8191,ie=he>>>13,Ce=E[1]|0,ne=Ce&8191,Ie=Ce>>>13,Rr=E[2]|0,Ae=Rr&8191,ke=Rr>>>13,Mr=E[3]|0,xe=Mr&8191,Te=Mr>>>13,Cr=E[4]|0,Be=Cr&8191,Ne=Cr>>>13,Ir=E[5]|0,Pe=Ir&8191,Le=Ir>>>13,Ar=E[6]|0,Oe=Ar&8191,Fe=Ar>>>13,kr=E[7]|0,De=kr&8191,je=kr>>>13,xr=E[8]|0,Ue=xr&8191,$e=xr>>>13,Tr=E[9]|0,He=Tr&8191,We=Tr>>>13;m.negative=o.negative^d.negative,m.length=19,b=Math.imul(J,ae),u=Math.imul(J,ie),u=u+Math.imul(x,ae)|0,R=Math.imul(x,ie);var Jt=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,b=Math.imul(W,ae),u=Math.imul(W,ie),u=u+Math.imul(Z,ae)|0,R=Math.imul(Z,ie),b=b+Math.imul(J,ne)|0,u=u+Math.imul(J,Ie)|0,u=u+Math.imul(x,ne)|0,R=R+Math.imul(x,Ie)|0;var Zt=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,b=Math.imul(M,ae),u=Math.imul(M,ie),u=u+Math.imul(C,ae)|0,R=Math.imul(C,ie),b=b+Math.imul(W,ne)|0,u=u+Math.imul(W,Ie)|0,u=u+Math.imul(Z,ne)|0,R=R+Math.imul(Z,Ie)|0,b=b+Math.imul(J,Ae)|0,u=u+Math.imul(J,ke)|0,u=u+Math.imul(x,Ae)|0,R=R+Math.imul(x,ke)|0;var Kt=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,b=Math.imul(G,ae),u=Math.imul(G,ie),u=u+Math.imul(se,ae)|0,R=Math.imul(se,ie),b=b+Math.imul(M,ne)|0,u=u+Math.imul(M,Ie)|0,u=u+Math.imul(C,ne)|0,R=R+Math.imul(C,Ie)|0,b=b+Math.imul(W,Ae)|0,u=u+Math.imul(W,ke)|0,u=u+Math.imul(Z,Ae)|0,R=R+Math.imul(Z,ke)|0,b=b+Math.imul(J,xe)|0,u=u+Math.imul(J,Te)|0,u=u+Math.imul(x,xe)|0,R=R+Math.imul(x,Te)|0;var Yt=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(re,ae),u=Math.imul(re,ie),u=u+Math.imul(we,ae)|0,R=Math.imul(we,ie),b=b+Math.imul(G,ne)|0,u=u+Math.imul(G,Ie)|0,u=u+Math.imul(se,ne)|0,R=R+Math.imul(se,Ie)|0,b=b+Math.imul(M,Ae)|0,u=u+Math.imul(M,ke)|0,u=u+Math.imul(C,Ae)|0,R=R+Math.imul(C,ke)|0,b=b+Math.imul(W,xe)|0,u=u+Math.imul(W,Te)|0,u=u+Math.imul(Z,xe)|0,R=R+Math.imul(Z,Te)|0,b=b+Math.imul(J,Be)|0,u=u+Math.imul(J,Ne)|0,u=u+Math.imul(x,Be)|0,R=R+Math.imul(x,Ne)|0;var Qt=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(Re,ae),u=Math.imul(Re,ie),u=u+Math.imul(Se,ae)|0,R=Math.imul(Se,ie),b=b+Math.imul(re,ne)|0,u=u+Math.imul(re,Ie)|0,u=u+Math.imul(we,ne)|0,R=R+Math.imul(we,Ie)|0,b=b+Math.imul(G,Ae)|0,u=u+Math.imul(G,ke)|0,u=u+Math.imul(se,Ae)|0,R=R+Math.imul(se,ke)|0,b=b+Math.imul(M,xe)|0,u=u+Math.imul(M,Te)|0,u=u+Math.imul(C,xe)|0,R=R+Math.imul(C,Te)|0,b=b+Math.imul(W,Be)|0,u=u+Math.imul(W,Ne)|0,u=u+Math.imul(Z,Be)|0,R=R+Math.imul(Z,Ne)|0,b=b+Math.imul(J,Pe)|0,u=u+Math.imul(J,Le)|0,u=u+Math.imul(x,Pe)|0,R=R+Math.imul(x,Le)|0;var Xt=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(_e,ae),u=Math.imul(_e,ie),u=u+Math.imul(Me,ae)|0,R=Math.imul(Me,ie),b=b+Math.imul(Re,ne)|0,u=u+Math.imul(Re,Ie)|0,u=u+Math.imul(Se,ne)|0,R=R+Math.imul(Se,Ie)|0,b=b+Math.imul(re,Ae)|0,u=u+Math.imul(re,ke)|0,u=u+Math.imul(we,Ae)|0,R=R+Math.imul(we,ke)|0,b=b+Math.imul(G,xe)|0,u=u+Math.imul(G,Te)|0,u=u+Math.imul(se,xe)|0,R=R+Math.imul(se,Te)|0,b=b+Math.imul(M,Be)|0,u=u+Math.imul(M,Ne)|0,u=u+Math.imul(C,Be)|0,R=R+Math.imul(C,Ne)|0,b=b+Math.imul(W,Pe)|0,u=u+Math.imul(W,Le)|0,u=u+Math.imul(Z,Pe)|0,R=R+Math.imul(Z,Le)|0,b=b+Math.imul(J,Oe)|0,u=u+Math.imul(J,Fe)|0,u=u+Math.imul(x,Oe)|0,R=R+Math.imul(x,Fe)|0;var er=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(Ee,ae),u=Math.imul(Ee,ie),u=u+Math.imul(y,ae)|0,R=Math.imul(y,ie),b=b+Math.imul(_e,ne)|0,u=u+Math.imul(_e,Ie)|0,u=u+Math.imul(Me,ne)|0,R=R+Math.imul(Me,Ie)|0,b=b+Math.imul(Re,Ae)|0,u=u+Math.imul(Re,ke)|0,u=u+Math.imul(Se,Ae)|0,R=R+Math.imul(Se,ke)|0,b=b+Math.imul(re,xe)|0,u=u+Math.imul(re,Te)|0,u=u+Math.imul(we,xe)|0,R=R+Math.imul(we,Te)|0,b=b+Math.imul(G,Be)|0,u=u+Math.imul(G,Ne)|0,u=u+Math.imul(se,Be)|0,R=R+Math.imul(se,Ne)|0,b=b+Math.imul(M,Pe)|0,u=u+Math.imul(M,Le)|0,u=u+Math.imul(C,Pe)|0,R=R+Math.imul(C,Le)|0,b=b+Math.imul(W,Oe)|0,u=u+Math.imul(W,Fe)|0,u=u+Math.imul(Z,Oe)|0,R=R+Math.imul(Z,Fe)|0,b=b+Math.imul(J,De)|0,u=u+Math.imul(J,je)|0,u=u+Math.imul(x,De)|0,R=R+Math.imul(x,je)|0;var tr=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(h,ae),u=Math.imul(h,ie),u=u+Math.imul(_,ae)|0,R=Math.imul(_,ie),b=b+Math.imul(Ee,ne)|0,u=u+Math.imul(Ee,Ie)|0,u=u+Math.imul(y,ne)|0,R=R+Math.imul(y,Ie)|0,b=b+Math.imul(_e,Ae)|0,u=u+Math.imul(_e,ke)|0,u=u+Math.imul(Me,Ae)|0,R=R+Math.imul(Me,ke)|0,b=b+Math.imul(Re,xe)|0,u=u+Math.imul(Re,Te)|0,u=u+Math.imul(Se,xe)|0,R=R+Math.imul(Se,Te)|0,b=b+Math.imul(re,Be)|0,u=u+Math.imul(re,Ne)|0,u=u+Math.imul(we,Be)|0,R=R+Math.imul(we,Ne)|0,b=b+Math.imul(G,Pe)|0,u=u+Math.imul(G,Le)|0,u=u+Math.imul(se,Pe)|0,R=R+Math.imul(se,Le)|0,b=b+Math.imul(M,Oe)|0,u=u+Math.imul(M,Fe)|0,u=u+Math.imul(C,Oe)|0,R=R+Math.imul(C,Fe)|0,b=b+Math.imul(W,De)|0,u=u+Math.imul(W,je)|0,u=u+Math.imul(Z,De)|0,R=R+Math.imul(Z,je)|0,b=b+Math.imul(J,Ue)|0,u=u+Math.imul(J,$e)|0,u=u+Math.imul(x,Ue)|0,R=R+Math.imul(x,$e)|0;var rr=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul(D,ae),u=Math.imul(D,ie),u=u+Math.imul($,ae)|0,R=Math.imul($,ie),b=b+Math.imul(h,ne)|0,u=u+Math.imul(h,Ie)|0,u=u+Math.imul(_,ne)|0,R=R+Math.imul(_,Ie)|0,b=b+Math.imul(Ee,Ae)|0,u=u+Math.imul(Ee,ke)|0,u=u+Math.imul(y,Ae)|0,R=R+Math.imul(y,ke)|0,b=b+Math.imul(_e,xe)|0,u=u+Math.imul(_e,Te)|0,u=u+Math.imul(Me,xe)|0,R=R+Math.imul(Me,Te)|0,b=b+Math.imul(Re,Be)|0,u=u+Math.imul(Re,Ne)|0,u=u+Math.imul(Se,Be)|0,R=R+Math.imul(Se,Ne)|0,b=b+Math.imul(re,Pe)|0,u=u+Math.imul(re,Le)|0,u=u+Math.imul(we,Pe)|0,R=R+Math.imul(we,Le)|0,b=b+Math.imul(G,Oe)|0,u=u+Math.imul(G,Fe)|0,u=u+Math.imul(se,Oe)|0,R=R+Math.imul(se,Fe)|0,b=b+Math.imul(M,De)|0,u=u+Math.imul(M,je)|0,u=u+Math.imul(C,De)|0,R=R+Math.imul(C,je)|0,b=b+Math.imul(W,Ue)|0,u=u+Math.imul(W,$e)|0,u=u+Math.imul(Z,Ue)|0,R=R+Math.imul(Z,$e)|0,b=b+Math.imul(J,He)|0,u=u+Math.imul(J,We)|0,u=u+Math.imul(x,He)|0,R=R+Math.imul(x,We)|0;var nr=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul(D,ne),u=Math.imul(D,Ie),u=u+Math.imul($,ne)|0,R=Math.imul($,Ie),b=b+Math.imul(h,Ae)|0,u=u+Math.imul(h,ke)|0,u=u+Math.imul(_,Ae)|0,R=R+Math.imul(_,ke)|0,b=b+Math.imul(Ee,xe)|0,u=u+Math.imul(Ee,Te)|0,u=u+Math.imul(y,xe)|0,R=R+Math.imul(y,Te)|0,b=b+Math.imul(_e,Be)|0,u=u+Math.imul(_e,Ne)|0,u=u+Math.imul(Me,Be)|0,R=R+Math.imul(Me,Ne)|0,b=b+Math.imul(Re,Pe)|0,u=u+Math.imul(Re,Le)|0,u=u+Math.imul(Se,Pe)|0,R=R+Math.imul(Se,Le)|0,b=b+Math.imul(re,Oe)|0,u=u+Math.imul(re,Fe)|0,u=u+Math.imul(we,Oe)|0,R=R+Math.imul(we,Fe)|0,b=b+Math.imul(G,De)|0,u=u+Math.imul(G,je)|0,u=u+Math.imul(se,De)|0,R=R+Math.imul(se,je)|0,b=b+Math.imul(M,Ue)|0,u=u+Math.imul(M,$e)|0,u=u+Math.imul(C,Ue)|0,R=R+Math.imul(C,$e)|0,b=b+Math.imul(W,He)|0,u=u+Math.imul(W,We)|0,u=u+Math.imul(Z,He)|0,R=R+Math.imul(Z,We)|0;var ir=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul(D,Ae),u=Math.imul(D,ke),u=u+Math.imul($,Ae)|0,R=Math.imul($,ke),b=b+Math.imul(h,xe)|0,u=u+Math.imul(h,Te)|0,u=u+Math.imul(_,xe)|0,R=R+Math.imul(_,Te)|0,b=b+Math.imul(Ee,Be)|0,u=u+Math.imul(Ee,Ne)|0,u=u+Math.imul(y,Be)|0,R=R+Math.imul(y,Ne)|0,b=b+Math.imul(_e,Pe)|0,u=u+Math.imul(_e,Le)|0,u=u+Math.imul(Me,Pe)|0,R=R+Math.imul(Me,Le)|0,b=b+Math.imul(Re,Oe)|0,u=u+Math.imul(Re,Fe)|0,u=u+Math.imul(Se,Oe)|0,R=R+Math.imul(Se,Fe)|0,b=b+Math.imul(re,De)|0,u=u+Math.imul(re,je)|0,u=u+Math.imul(we,De)|0,R=R+Math.imul(we,je)|0,b=b+Math.imul(G,Ue)|0,u=u+Math.imul(G,$e)|0,u=u+Math.imul(se,Ue)|0,R=R+Math.imul(se,$e)|0,b=b+Math.imul(M,He)|0,u=u+Math.imul(M,We)|0,u=u+Math.imul(C,He)|0,R=R+Math.imul(C,We)|0;var sr=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(D,xe),u=Math.imul(D,Te),u=u+Math.imul($,xe)|0,R=Math.imul($,Te),b=b+Math.imul(h,Be)|0,u=u+Math.imul(h,Ne)|0,u=u+Math.imul(_,Be)|0,R=R+Math.imul(_,Ne)|0,b=b+Math.imul(Ee,Pe)|0,u=u+Math.imul(Ee,Le)|0,u=u+Math.imul(y,Pe)|0,R=R+Math.imul(y,Le)|0,b=b+Math.imul(_e,Oe)|0,u=u+Math.imul(_e,Fe)|0,u=u+Math.imul(Me,Oe)|0,R=R+Math.imul(Me,Fe)|0,b=b+Math.imul(Re,De)|0,u=u+Math.imul(Re,je)|0,u=u+Math.imul(Se,De)|0,R=R+Math.imul(Se,je)|0,b=b+Math.imul(re,Ue)|0,u=u+Math.imul(re,$e)|0,u=u+Math.imul(we,Ue)|0,R=R+Math.imul(we,$e)|0,b=b+Math.imul(G,He)|0,u=u+Math.imul(G,We)|0,u=u+Math.imul(se,He)|0,R=R+Math.imul(se,We)|0;var or=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul(D,Be),u=Math.imul(D,Ne),u=u+Math.imul($,Be)|0,R=Math.imul($,Ne),b=b+Math.imul(h,Pe)|0,u=u+Math.imul(h,Le)|0,u=u+Math.imul(_,Pe)|0,R=R+Math.imul(_,Le)|0,b=b+Math.imul(Ee,Oe)|0,u=u+Math.imul(Ee,Fe)|0,u=u+Math.imul(y,Oe)|0,R=R+Math.imul(y,Fe)|0,b=b+Math.imul(_e,De)|0,u=u+Math.imul(_e,je)|0,u=u+Math.imul(Me,De)|0,R=R+Math.imul(Me,je)|0,b=b+Math.imul(Re,Ue)|0,u=u+Math.imul(Re,$e)|0,u=u+Math.imul(Se,Ue)|0,R=R+Math.imul(Se,$e)|0,b=b+Math.imul(re,He)|0,u=u+Math.imul(re,We)|0,u=u+Math.imul(we,He)|0,R=R+Math.imul(we,We)|0;var ar=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul(D,Pe),u=Math.imul(D,Le),u=u+Math.imul($,Pe)|0,R=Math.imul($,Le),b=b+Math.imul(h,Oe)|0,u=u+Math.imul(h,Fe)|0,u=u+Math.imul(_,Oe)|0,R=R+Math.imul(_,Fe)|0,b=b+Math.imul(Ee,De)|0,u=u+Math.imul(Ee,je)|0,u=u+Math.imul(y,De)|0,R=R+Math.imul(y,je)|0,b=b+Math.imul(_e,Ue)|0,u=u+Math.imul(_e,$e)|0,u=u+Math.imul(Me,Ue)|0,R=R+Math.imul(Me,$e)|0,b=b+Math.imul(Re,He)|0,u=u+Math.imul(Re,We)|0,u=u+Math.imul(Se,He)|0,R=R+Math.imul(Se,We)|0;var Cs=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,b=Math.imul(D,Oe),u=Math.imul(D,Fe),u=u+Math.imul($,Oe)|0,R=Math.imul($,Fe),b=b+Math.imul(h,De)|0,u=u+Math.imul(h,je)|0,u=u+Math.imul(_,De)|0,R=R+Math.imul(_,je)|0,b=b+Math.imul(Ee,Ue)|0,u=u+Math.imul(Ee,$e)|0,u=u+Math.imul(y,Ue)|0,R=R+Math.imul(y,$e)|0,b=b+Math.imul(_e,He)|0,u=u+Math.imul(_e,We)|0,u=u+Math.imul(Me,He)|0,R=R+Math.imul(Me,We)|0;var Is=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(Is>>>26)|0,Is&=67108863,b=Math.imul(D,De),u=Math.imul(D,je),u=u+Math.imul($,De)|0,R=Math.imul($,je),b=b+Math.imul(h,Ue)|0,u=u+Math.imul(h,$e)|0,u=u+Math.imul(_,Ue)|0,R=R+Math.imul(_,$e)|0,b=b+Math.imul(Ee,He)|0,u=u+Math.imul(Ee,We)|0,u=u+Math.imul(y,He)|0,R=R+Math.imul(y,We)|0;var As=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(As>>>26)|0,As&=67108863,b=Math.imul(D,Ue),u=Math.imul(D,$e),u=u+Math.imul($,Ue)|0,R=Math.imul($,$e),b=b+Math.imul(h,He)|0,u=u+Math.imul(h,We)|0,u=u+Math.imul(_,He)|0,R=R+Math.imul(_,We)|0;var ks=(T+b|0)+((u&8191)<<13)|0;T=(R+(u>>>13)|0)+(ks>>>26)|0,ks&=67108863,b=Math.imul(D,He),u=Math.imul(D,We),u=u+Math.imul($,He)|0,R=Math.imul($,We);var xs=(T+b|0)+((u&8191)<<13)|0;return T=(R+(u>>>13)|0)+(xs>>>26)|0,xs&=67108863,I[0]=Jt,I[1]=Zt,I[2]=Kt,I[3]=Yt,I[4]=Qt,I[5]=Xt,I[6]=er,I[7]=tr,I[8]=rr,I[9]=nr,I[10]=ir,I[11]=sr,I[12]=or,I[13]=ar,I[14]=Cs,I[15]=Is,I[16]=As,I[17]=ks,I[18]=xs,T!==0&&(I[19]=T,m.length++),m};Math.imul||(P=k);function O(A,o,d){d.negative=o.negative^A.negative,d.length=A.length+o.length;for(var m=0,v=0,E=0;E<d.length-1;E++){var I=v;v=0;for(var T=m&67108863,b=Math.min(E,o.length-1),u=Math.max(0,E-A.length+1);u<=b;u++){var R=E-u,K=A.words[R]|0,J=o.words[u]|0,x=K*J,L=x&67108863;I=I+(x/67108864|0)|0,L=L+T|0,T=L&67108863,I=I+(L>>>26)|0,v+=I>>>26,I&=67108863}d.words[E]=T,m=I,I=v}return m!==0?d.words[E]=m:d.length--,d._strip()}function V(A,o,d){return O(A,o,d)}s.prototype.mulTo=function(o,d){var m,v=this.length+o.length;return this.length===10&&o.length===10?m=P(this,o,d):v<63?m=k(this,o,d):v<1024?m=O(this,o,d):m=V(this,o,d),m},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 m=0,v=0;v<this.length;v++){var E=(this.words[v]|0)*o,I=(E&67108863)+(m&67108863);m>>=26,m+=E/67108864|0,m+=I>>>26,this.words[v]=I&67108863}return m!==0&&(this.words[v]=m,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=H(o);if(d.length===0)return new s(1);for(var m=this,v=0;v<d.length&&d[v]===0;v++,m=m.sqr());if(++v<d.length)for(var E=m.sqr();v<d.length;v++,E=E.sqr())d[v]!==0&&(m=m.mul(E));return m},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var d=o%26,m=(o-d)/26,v=67108863>>>26-d<<26-d,E;if(d!==0){var I=0;for(E=0;E<this.length;E++){var T=this.words[E]&v,b=(this.words[E]|0)-T<<d;this.words[E]=b|I,I=T>>>26-d}I&&(this.words[E]=I,this.length++)}if(m!==0){for(E=this.length-1;E>=0;E--)this.words[E+m]=this.words[E];for(E=0;E<m;E++)this.words[E]=0;this.length+=m}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,d,m){n(typeof o=="number"&&o>=0);var v;d?v=(d-d%26)/26:v=0;var E=o%26,I=Math.min((o-E)/26,this.length),T=67108863^67108863>>>E<<E,b=m;if(v-=I,v=Math.max(0,v),b){for(var u=0;u<I;u++)b.words[u]=this.words[u];b.length=I}if(I!==0)if(this.length>I)for(this.length-=I,u=0;u<this.length;u++)this.words[u]=this.words[u+I];else this.words[0]=0,this.length=1;var R=0;for(u=this.length-1;u>=0&&(R!==0||u>=v);u--){var K=this.words[u]|0;this.words[u]=R<<26-E|K>>>E,R=K&T}return b&&R!==0&&(b.words[b.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,d,m){return n(this.negative===0),this.iushrn(o,d,m)},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,m=(o-d)/26,v=1<<d;if(this.length<=m)return!1;var E=this.words[m];return!!(E&v)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var d=o%26,m=(o-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(d!==0&&m++,this.length=Math.min(m,this.length),d!==0){var v=67108863^67108863>>>d<<d;this.words[this.length-1]&=v}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,m){var v=o.length+m,E;this._expand(v);var I,T=0;for(E=0;E<o.length;E++){I=(this.words[E+m]|0)+T;var b=(o.words[E]|0)*d;I-=b&67108863,T=(I>>26)-(b/67108864|0),this.words[E+m]=I&67108863}for(;E<this.length-m;E++)I=(this.words[E+m]|0)+T,T=I>>26,this.words[E+m]=I&67108863;if(T===0)return this._strip();for(n(T===-1),T=0,E=0;E<this.length;E++)I=-(this.words[E]|0)+T,T=I>>26,this.words[E]=I&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,d){var m=this.length-o.length,v=this.clone(),E=o,I=E.words[E.length-1]|0,T=this._countBits(I);m=26-T,m!==0&&(E=E.ushln(m),v.iushln(m),I=E.words[E.length-1]|0);var b=v.length-E.length,u;if(d!=="mod"){u=new s(null),u.length=b+1,u.words=new Array(u.length);for(var R=0;R<u.length;R++)u.words[R]=0}var K=v.clone()._ishlnsubmul(E,1,b);K.negative===0&&(v=K,u&&(u.words[b]=1));for(var J=b-1;J>=0;J--){var x=(v.words[E.length+J]|0)*67108864+(v.words[E.length+J-1]|0);for(x=Math.min(x/I|0,67108863),v._ishlnsubmul(E,x,J);v.negative!==0;)x--,v.negative=0,v._ishlnsubmul(E,1,J),v.isZero()||(v.negative^=1);u&&(u.words[J]=x)}return u&&u._strip(),v._strip(),d!=="div"&&m!==0&&v.iushrn(m),{div:u||null,mod:v}},s.prototype.divmod=function(o,d,m){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,E,I;return this.negative!==0&&o.negative===0?(I=this.neg().divmod(o,d),d!=="mod"&&(v=I.div.neg()),d!=="div"&&(E=I.mod.neg(),m&&E.negative!==0&&E.iadd(o)),{div:v,mod:E}):this.negative===0&&o.negative!==0?(I=this.divmod(o.neg(),d),d!=="mod"&&(v=I.div.neg()),{div:v,mod:I.mod}):this.negative&o.negative?(I=this.neg().divmod(o.neg(),d),d!=="div"&&(E=I.mod.neg(),m&&E.negative!==0&&E.isub(o)),{div:I.div,mod:E}):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 m=d.div.negative!==0?d.mod.isub(o):d.mod,v=o.ushrn(1),E=o.andln(1),I=m.cmp(v);return I<0||E===1&&I===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 m=(1<<26)%o,v=0,E=this.length-1;E>=0;E--)v=(m*v+(this.words[E]|0))%o;return d?-v:v},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 m=0,v=this.length-1;v>=0;v--){var E=(this.words[v]|0)+m*67108864;this.words[v]=E/o|0,m=E%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,m=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var v=new s(1),E=new s(0),I=new s(0),T=new s(1),b=0;d.isEven()&&m.isEven();)d.iushrn(1),m.iushrn(1),++b;for(var u=m.clone(),R=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;)(v.isOdd()||E.isOdd())&&(v.iadd(u),E.isub(R)),v.iushrn(1),E.iushrn(1);for(var x=0,L=1;!(m.words[0]&L)&&x<26;++x,L<<=1);if(x>0)for(m.iushrn(x);x-- >0;)(I.isOdd()||T.isOdd())&&(I.iadd(u),T.isub(R)),I.iushrn(1),T.iushrn(1);d.cmp(m)>=0?(d.isub(m),v.isub(I),E.isub(T)):(m.isub(d),I.isub(v),T.isub(E))}return{a:I,b:T,gcd:m.iushln(b)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var d=this,m=o.clone();d.negative!==0?d=d.umod(o):d=d.clone();for(var v=new s(1),E=new s(0),I=m.clone();d.cmpn(1)>0&&m.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;)v.isOdd()&&v.iadd(I),v.iushrn(1);for(var u=0,R=1;!(m.words[0]&R)&&u<26;++u,R<<=1);if(u>0)for(m.iushrn(u);u-- >0;)E.isOdd()&&E.iadd(I),E.iushrn(1);d.cmp(m)>=0?(d.isub(m),v.isub(E)):(m.isub(d),E.isub(v))}var K;return d.cmpn(1)===0?K=v:K=E,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(),m=o.clone();d.negative=0,m.negative=0;for(var v=0;d.isEven()&&m.isEven();v++)d.iushrn(1),m.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;m.isEven();)m.iushrn(1);var E=d.cmp(m);if(E<0){var I=d;d=m,m=I}else if(E===0||m.cmpn(1)===0)break;d.isub(m)}while(!0);return m.iushln(v)},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,m=(o-d)/26,v=1<<d;if(this.length<=m)return this._expand(m+1),this.words[m]|=v,this;for(var E=v,I=m;E!==0&&I<this.length;I++){var T=this.words[I]|0;T+=E,E=T>>>26,T&=67108863,this.words[I]=T}return E!==0&&(this.words[I]=E,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 m;if(this.length>1)m=1;else{d&&(o=-o),n(o<=67108863,"Number is too big");var v=this.words[0]|0;m=v===o?0:v<o?-1:1}return this.negative!==0?-m|0:m},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,m=this.length-1;m>=0;m--){var v=this.words[m]|0,E=o.words[m]|0;if(v!==E){v<E?d=-1:v>E&&(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 z(A,o){this.name=A,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()}z.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},z.prototype.ireduce=function(o){var d=o,m;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),m=d.bitLength();while(m>this.n);var v=m<this.n?-1:d.ucmp(this.p);return v===0?(d.words[0]=0,d.length=1):v>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},z.prototype.split=function(o,d){o.iushrn(this.n,0,d)},z.prototype.imulK=function(o){return o.imul(this.k)};function te(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(te,z),te.prototype.split=function(o,d){for(var m=4194303,v=Math.min(o.length,9),E=0;E<v;E++)d.words[E]=o.words[E];if(d.length=v,o.length<=9){o.words[0]=0,o.length=1;return}var I=o.words[9];for(d.words[d.length++]=I&m,E=10;E<o.length;E++){var T=o.words[E]|0;o.words[E-10]=(T&m)<<4|I>>>22,I=T}I>>>=22,o.words[E-10]=I,I===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,m=0;m<o.length;m++){var v=o.words[m]|0;d+=v*977,o.words[m]=d&67108863,d=v*64+(d/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function Q(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Q,z);function Y(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(Y,z);function de(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(de,z),de.prototype.imulK=function(o){for(var d=0,m=0;m<o.length;m++){var v=(o.words[m]|0)*19+d,E=v&67108863;v>>>=26,o.words[m]=E,d=v}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 Q;else if(o==="p192")d=new Y;else if(o==="p25519")d=new de;else throw new Error("Unknown prime "+o);return j[o]=d,d};function oe(A){if(typeof A=="string"){var o=s._prime(A);this.m=o.p,this.prime=o}else n(A.gtn(1),"modulus must be greater than 1"),this.m=A,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 m=o.add(d);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},oe.prototype.iadd=function(o,d){this._verify2(o,d);var m=o.iadd(d);return m.cmp(this.m)>=0&&m.isub(this.m),m},oe.prototype.sub=function(o,d){this._verify2(o,d);var m=o.sub(d);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},oe.prototype.isub=function(o,d){this._verify2(o,d);var m=o.isub(d);return m.cmpn(0)<0&&m.iadd(this.m),m},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 m=this.m.add(new s(1)).iushrn(2);return this.pow(o,m)}for(var v=this.m.subn(1),E=0;!v.isZero()&&v.andln(1)===0;)E++,v.iushrn(1);n(!v.isZero());var I=new s(1).toRed(this),T=I.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 R=this.pow(u,v),K=this.pow(o,v.addn(1).iushrn(1)),J=this.pow(o,v),x=E;J.cmp(I)!==0;){for(var L=J,W=0;L.cmp(I)!==0;W++)L=L.redSqr();n(W<x);var Z=this.pow(R,new s(1).iushln(x-W-1));K=K.redMul(Z),R=Z.redSqr(),J=J.redMul(R),x=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 m=4,v=new Array(1<<m);v[0]=new s(1).toRed(this),v[1]=o;for(var E=2;E<v.length;E++)v[E]=this.mul(v[E-1],o);var I=v[0],T=0,b=0,u=d.bitLength()%26;for(u===0&&(u=26),E=d.length-1;E>=0;E--){for(var R=d.words[E],K=u-1;K>=0;K--){var J=R>>K&1;if(I!==v[0]&&(I=this.sqr(I)),J===0&&T===0){b=0;continue}T<<=1,T|=J,b++,!(b!==m&&(E!==0||K!==0))&&(I=this.mul(I,v[T]),b=0,T=0)}u=26}return I},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(A){oe.call(this,A),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 m=o.imul(d),v=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(v).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},pe.prototype.mul=function(o,d){if(o.isZero()||d.isZero())return new s(0)._forceRed(this);var m=o.mul(d),v=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(v).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},pe.prototype.invm=function(o){var d=this.imod(o._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,ee)})(Oo);var Ni=Oo.exports,An={},jt={};Object.defineProperty(jt,"__esModule",{value:!0});jt.errorValues=jt.standardErrorCodes=void 0;jt.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}};jt.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 Pi={},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=jt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(w,N=r){if(w&&Number.isInteger(w)){const U=w.toString();if(p(t.errorValues,U))return t.errorValues[U].message;if(f(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return N}e.getMessageFromCode=n;function i(w){if(!Number.isInteger(w))return!1;const N=w.toString();return!!(t.errorValues[N]||f(w))}e.isValidCode=i;function s(w){var N;if(typeof w=="number")return w;if(c(w))return(N=w.code)!==null&&N!==void 0?N:w.errorCode}e.getErrorCode=s;function c(w){return typeof w=="object"&&w!==null&&(typeof w.code=="number"||typeof w.errorCode=="number")}function a(w,{shouldIncludeStack:N=!1}={}){const U={};if(w&&typeof w=="object"&&!Array.isArray(w)&&p(w,"code")&&i(w.code)){const F=w;U.code=F.code,F.message&&typeof F.message=="string"?(U.message=F.message,p(F,"data")&&(U.data=F.data)):(U.message=n(U.code),U.data={originalError:g(w)})}else U.code=t.standardErrorCodes.rpc.internal,U.message=S(w,"message")?w.message:r,U.data={originalError:g(w)};return N&&(U.stack=S(w,"stack")?w.stack:void 0),U}e.serialize=a;function f(w){return w>=-32099&&w<=-32e3}function g(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function p(w,N){return Object.prototype.hasOwnProperty.call(w,N)}function S(w,N){return typeof w=="object"&&w!==null&&N in w&&typeof w[N]=="string"}})(Li);Object.defineProperty(Pi,"__esModule",{value:!0});Pi.standardErrors=void 0;const rt=jt,Ml=Li;Pi.standardErrors={rpc:{parse:e=>pt(rt.standardErrorCodes.rpc.parse,e),invalidRequest:e=>pt(rt.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>pt(rt.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>pt(rt.standardErrorCodes.rpc.methodNotFound,e),internal:e=>pt(rt.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 pt(t,e)},invalidInput:e=>pt(rt.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>pt(rt.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>pt(rt.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>pt(rt.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>pt(rt.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>pt(rt.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Pr(rt.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Pr(rt.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Pr(rt.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Pr(rt.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Pr(rt.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Pr(rt.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 Al(t,r,n)}}};function pt(e,t){const[r,n]=Cl(t);return new Il(e,r||(0,Ml.getMessageFromCode)(e),n)}function Pr(e,t){const[r,n]=Cl(t);return new Al(e,r||(0,Ml.getMessageFromCode)(e),n)}function Cl(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 Il=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)}},Al=class extends Il{constructor(t,r,n){if(!Dd(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Dd(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Oi={},nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.isErrorResponse=void 0;function jd(e){return e.errorMessage!==void 0}nn.isErrorResponse=jd;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.LIB_VERSION=void 0;sn.LIB_VERSION="3.9.3";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.serializeError=void 0;const Ud=nn,$d=sn,Hd=jt,Wd=Li;function Vd(e,t){const r=(0,Wd.serialize)(qd(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",$d.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=zd(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Oi.serializeError=Vd;function qd(e){return typeof e=="string"?{message:e,code:Hd.standardErrorCodes.rpc.internal}:(0,Ud.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function zd(e,t){const r=e==null?void 0: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=jt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Pi;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Oi;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}})})(An);var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ProviderType=Ke.RegExpString=Ke.IntNumber=Ke.BigIntString=Ke.AddressString=Ke.HexString=Ke.OpaqueType=void 0;function kn(){return e=>e}Ke.OpaqueType=kn;Ke.HexString=kn();Ke.AddressString=kn();Ke.BigIntString=kn();function Gd(e){return Math.floor(e)}Ke.IntNumber=Gd;Ke.RegExpString=kn();var Pa;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Pa||(Ke.ProviderType=Pa={}));var Jd=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 Vt=Jd(Ni),wr=An,bt=Ke,kl=/^[0-9]*$/,xl=/^[a-f0-9]*$/;function Zd(e){return Tl(crypto.getRandomValues(new Uint8Array(e)))}X.randomBytesHex=Zd;function Tl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}X.uint8ArrayToHex=Tl;function Kd(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}X.hexStringToUint8Array=Kd;function Yd(e,t=!1){const r=e.toString("hex");return(0,bt.HexString)(t?`0x${r}`:r)}X.hexStringFromBuffer=Yd;function Qd(e){return(0,bt.BigIntString)(e.toString(10))}X.bigIntStringFromBN=Qd;function Xd(e){return(0,bt.IntNumber)(new Vt.default(Tn(e,!1),16).toNumber())}X.intNumberFromHexString=Xd;function e0(e){return(0,bt.HexString)(`0x${new Vt.default(e).toString(16)}`)}X.hexStringFromIntNumber=e0;function Fo(e){return e.startsWith("0x")||e.startsWith("0X")}X.has0xPrefix=Fo;function Fi(e){return Fo(e)?e.slice(2):e}X.strip0x=Fi;function Bl(e){return Fo(e)?`0x${e.slice(2)}`:`0x${e}`}X.prepend0x=Bl;function xn(e){if(typeof e!="string")return!1;const t=Fi(e).toLowerCase();return xl.test(t)}X.isHexString=xn;function Nl(e,t=!1){if(typeof e=="string"){const r=Fi(e).toLowerCase();if(xl.test(r))return(0,bt.HexString)(t?`0x${r}`:r)}throw wr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}X.ensureHexString=Nl;function Tn(e,t=!1){let r=Nl(e,!1);return r.length%2===1&&(r=(0,bt.HexString)(`0${r}`)),t?(0,bt.HexString)(`0x${r}`):r}X.ensureEvenLengthHexString=Tn;function t0(e){if(typeof e=="string"){const t=Fi(e).toLowerCase();if(xn(t)&&t.length===40)return(0,bt.AddressString)(Bl(t))}throw wr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}X.ensureAddressString=t0;function r0(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(xn(e)){const t=Tn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw wr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}X.ensureBuffer=r0;function Pl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,bt.IntNumber)(e);if(typeof e=="string"){if(kl.test(e))return(0,bt.IntNumber)(Number(e));if(xn(e))return(0,bt.IntNumber)(new Vt.default(Tn(e,!1),16).toNumber())}throw wr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureIntNumber=Pl;function n0(e){if(e instanceof RegExp)return(0,bt.RegExpString)(e.toString());throw wr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}X.ensureRegExpString=n0;function i0(e){if(e!==null&&(Vt.default.isBN(e)||Ll(e)))return new Vt.default(e.toString(10),10);if(typeof e=="number")return new Vt.default(Pl(e));if(typeof e=="string"){if(kl.test(e))return new Vt.default(e,10);if(xn(e))return new Vt.default(Tn(e,!1),16)}throw wr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}X.ensureBN=i0;function s0(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=s0;function Ll(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=Ll;function o0(e,t){return Array.from({length:t-e},(r,n)=>e+n)}X.range=o0;function a0(){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=a0;function c0(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=c0;function Ol(){try{return window.frameElement!==null}catch{return!1}}X.isInIFrame=Ol;function l0(){try{return Ol()&&window.top?window.top.location:window.location}catch{return window.location}}X.getLocation=l0;function u0(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}X.isMobileWeb=u0;var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.ScopedLocalStorage=void 0;class h0{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=h0;var Kr={},Bn={},Nn={},on={};Object.defineProperty(on,"__esModule",{value:!0});on.EVENTS=void 0;on.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 vt={};Object.defineProperty(vt,"__esModule",{value:!0});vt.RelayAbstract=vt.APP_VERSION_KEY=vt.LOCAL_STORAGE_ADDRESSES_KEY=vt.WALLET_USER_NAME_KEY=void 0;const La=An;vt.WALLET_USER_NAME_KEY="walletUsername";vt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";vt.APP_VERSION_KEY="AppVersion";class f0{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 La.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,La.serializeError)(s,t.method);return i})}}vt.RelayAbstract=f0;var an={},Fl={exports:{}},So={exports:{}},Pn={},ji={};ji.byteLength=g0;ji.toByteArray=m0;ji.fromByteArray=w0;var Bt=[],mt=[],d0=typeof Uint8Array<"u"?Uint8Array:Array,js="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Lr=0,p0=js.length;Lr<p0;++Lr)Bt[Lr]=js[Lr],mt[js.charCodeAt(Lr)]=Lr;mt[45]=62;mt[95]=63;function Dl(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 g0(e){var t=Dl(e),r=t[0],n=t[1];return(r+n)*3/4-n}function y0(e,t,r){return(t+r)*3/4-r}function m0(e){var t,r=Dl(e),n=r[0],i=r[1],s=new d0(y0(e,n,i)),c=0,a=i>0?n-4:n,f;for(f=0;f<a;f+=4)t=mt[e.charCodeAt(f)]<<18|mt[e.charCodeAt(f+1)]<<12|mt[e.charCodeAt(f+2)]<<6|mt[e.charCodeAt(f+3)],s[c++]=t>>16&255,s[c++]=t>>8&255,s[c++]=t&255;return i===2&&(t=mt[e.charCodeAt(f)]<<2|mt[e.charCodeAt(f+1)]>>4,s[c++]=t&255),i===1&&(t=mt[e.charCodeAt(f)]<<10|mt[e.charCodeAt(f+1)]<<4|mt[e.charCodeAt(f+2)]>>2,s[c++]=t>>8&255,s[c++]=t&255),s}function v0(e){return Bt[e>>18&63]+Bt[e>>12&63]+Bt[e>>6&63]+Bt[e&63]}function b0(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(v0(n));return i.join("")}function w0(e){for(var t,r=e.length,n=r%3,i=[],s=16383,c=0,a=r-n;c<a;c+=s)i.push(b0(e,c,c+s>a?a:c+s));return n===1?(t=e[r-1],i.push(Bt[t>>2]+Bt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(Bt[t>>10]+Bt[t>>4&63]+Bt[t<<2&63]+"=")),i.join("")}var Do={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Do.read=function(e,t,r,n,i){var s,c,a=i*8-n-1,f=(1<<a)-1,g=f>>1,p=-7,S=r?i-1:0,w=r?-1:1,N=e[t+S];for(S+=w,s=N&(1<<-p)-1,N>>=-p,p+=a;p>0;s=s*256+e[t+S],S+=w,p-=8);for(c=s&(1<<-p)-1,s>>=-p,p+=n;p>0;c=c*256+e[t+S],S+=w,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)};Do.write=function(e,t,r,n,i,s){var c,a,f,g=s*8-i-1,p=(1<<g)-1,S=p>>1,w=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=n?0:s-1,U=n?1:-1,F=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+S>=1?t+=w/f:t+=w*Math.pow(2,1-S),t*f>=2&&(c++,f/=2),c+S>=p?(a=0,c=p):c+S>=1?(a=(t*f-1)*Math.pow(2,i),c=c+S):(a=t*Math.pow(2,S-1)*Math.pow(2,i),c=0));i>=8;e[r+N]=a&255,N+=U,a/=256,i-=8);for(c=c<<i|a,g+=i;g>0;e[r+N]=c&255,N+=U,c/=256,g-=8);e[r+N-U]|=F*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=ji,r=Do,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=P,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 y=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(y,l),y.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(y){if(y>i)throw new RangeError('The value "'+y+'" is invalid for option "size"');const l=new Uint8Array(y);return Object.setPrototypeOf(l,a.prototype),l}function a(y,l,h){if(typeof y=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return S(y)}return f(y,l,h)}a.poolSize=8192;function f(y,l,h){if(typeof y=="string")return w(y,l);if(ArrayBuffer.isView(y))return U(y);if(y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof y);if(Ze(y,ArrayBuffer)||y&&Ze(y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ze(y,SharedArrayBuffer)||y&&Ze(y.buffer,SharedArrayBuffer)))return F(y,l,h);if(typeof y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const _=y.valueOf&&y.valueOf();if(_!=null&&_!==y)return a.from(_,l,h);const B=H(y);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof y[Symbol.toPrimitive]=="function")return a.from(y[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 y)}a.from=function(y,l,h){return f(y,l,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function g(y){if(typeof y!="number")throw new TypeError('"size" argument must be of type number');if(y<0)throw new RangeError('The value "'+y+'" is invalid for option "size"')}function p(y,l,h){return g(y),y<=0?c(y):l!==void 0?typeof h=="string"?c(y).fill(l,h):c(y).fill(l):c(y)}a.alloc=function(y,l,h){return p(y,l,h)};function S(y){return g(y),c(y<0?0:k(y)|0)}a.allocUnsafe=function(y){return S(y)},a.allocUnsafeSlow=function(y){return S(y)};function w(y,l){if((typeof l!="string"||l==="")&&(l="utf8"),!a.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const h=O(y,l)|0;let _=c(h);const B=_.write(y,l);return B!==h&&(_=_.slice(0,B)),_}function N(y){const l=y.length<0?0:k(y.length)|0,h=c(l);for(let _=0;_<l;_+=1)h[_]=y[_]&255;return h}function U(y){if(Ze(y,Uint8Array)){const l=new Uint8Array(y);return F(l.buffer,l.byteOffset,l.byteLength)}return N(y)}function F(y,l,h){if(l<0||y.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(y.byteLength<l+(h||0))throw new RangeError('"length" is outside of buffer bounds');let _;return l===void 0&&h===void 0?_=new Uint8Array(y):h===void 0?_=new Uint8Array(y,l):_=new Uint8Array(y,l,h),Object.setPrototypeOf(_,a.prototype),_}function H(y){if(a.isBuffer(y)){const l=k(y.length)|0,h=c(l);return h.length===0||y.copy(h,0,0,l),h}if(y.length!==void 0)return typeof y.length!="number"||_e(y.length)?c(0):N(y);if(y.type==="Buffer"&&Array.isArray(y.data))return N(y.data)}function k(y){if(y>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return y|0}function P(y){return+y!=y&&(y=0),a.alloc(+y)}a.isBuffer=function(l){return l!=null&&l._isBuffer===!0&&l!==a.prototype},a.compare=function(l,h){if(Ze(l,Uint8Array)&&(l=a.from(l,l.offset,l.byteLength)),Ze(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 _=l.length,B=h.length;for(let D=0,$=Math.min(_,B);D<$;++D)if(l[D]!==h[D]){_=l[D],B=h[D];break}return _<B?-1:B<_?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 _;if(h===void 0)for(h=0,_=0;_<l.length;++_)h+=l[_].length;const B=a.allocUnsafe(h);let D=0;for(_=0;_<l.length;++_){let $=l[_];if(Ze($,Uint8Array))D+$.length>B.length?(a.isBuffer($)||($=a.from($)),$.copy(B,D)):Uint8Array.prototype.set.call(B,$,D);else if(a.isBuffer($))$.copy(B,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=$.length}return B};function O(y,l){if(a.isBuffer(y))return y.length;if(ArrayBuffer.isView(y)||Ze(y,ArrayBuffer))return y.byteLength;if(typeof y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof y);const h=y.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&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(y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Re(y).length;default:if(B)return _?-1:re(y).length;l=(""+l).toLowerCase(),B=!0}}a.byteLength=O;function V(y,l,h){let _=!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(y||(y="utf8");;)switch(y){case"hex":return I(this,l,h);case"utf8":case"utf-8":return o(this,l,h);case"ascii":return v(this,l,h);case"latin1":case"binary":return E(this,l,h);case"base64":return A(this,l,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,l,h);default:if(_)throw new TypeError("Unknown encoding: "+y);y=(y+"").toLowerCase(),_=!0}}a.prototype._isBuffer=!0;function j(y,l,h){const _=y[l];y[l]=y[h],y[h]=_}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,_,B,D){if(Ze(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),_===void 0&&(_=l?l.length:0),B===void 0&&(B=0),D===void 0&&(D=this.length),h<0||_>l.length||B<0||D>this.length)throw new RangeError("out of range index");if(B>=D&&h>=_)return 0;if(B>=D)return-1;if(h>=_)return 1;if(h>>>=0,_>>>=0,B>>>=0,D>>>=0,this===l)return 0;let $=D-B,he=_-h;const ae=Math.min($,he),ie=this.slice(B,D),Ce=l.slice(h,_);for(let ne=0;ne<ae;++ne)if(ie[ne]!==Ce[ne]){$=ie[ne],he=Ce[ne];break}return $<he?-1:he<$?1:0};function z(y,l,h,_,B){if(y.length===0)return-1;if(typeof h=="string"?(_=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,_e(h)&&(h=B?0:y.length-1),h<0&&(h=y.length+h),h>=y.length){if(B)return-1;h=y.length-1}else if(h<0)if(B)h=0;else return-1;if(typeof l=="string"&&(l=a.from(l,_)),a.isBuffer(l))return l.length===0?-1:te(y,l,h,_,B);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(y,l,h):Uint8Array.prototype.lastIndexOf.call(y,l,h):te(y,[l],h,_,B);throw new TypeError("val must be string, number or Buffer")}function te(y,l,h,_,B){let D=1,$=y.length,he=l.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(y.length<2||l.length<2)return-1;D=2,$/=2,he/=2,h/=2}function ae(Ce,ne){return D===1?Ce[ne]:Ce.readUInt16BE(ne*D)}let ie;if(B){let Ce=-1;for(ie=h;ie<$;ie++)if(ae(y,ie)===ae(l,Ce===-1?0:ie-Ce)){if(Ce===-1&&(Ce=ie),ie-Ce+1===he)return Ce*D}else Ce!==-1&&(ie-=ie-Ce),Ce=-1}else for(h+he>$&&(h=$-he),ie=h;ie>=0;ie--){let Ce=!0;for(let ne=0;ne<he;ne++)if(ae(y,ie+ne)!==ae(l,ne)){Ce=!1;break}if(Ce)return ie}return-1}a.prototype.includes=function(l,h,_){return this.indexOf(l,h,_)!==-1},a.prototype.indexOf=function(l,h,_){return z(this,l,h,_,!0)},a.prototype.lastIndexOf=function(l,h,_){return z(this,l,h,_,!1)};function Q(y,l,h,_){h=Number(h)||0;const B=y.length-h;_?(_=Number(_),_>B&&(_=B)):_=B;const D=l.length;_>D/2&&(_=D/2);let $;for($=0;$<_;++$){const he=parseInt(l.substr($*2,2),16);if(_e(he))return $;y[h+$]=he}return $}function Y(y,l,h,_){return Se(re(l,y.length-h),y,h,_)}function de(y,l,h,_){return Se(we(l),y,h,_)}function oe(y,l,h,_){return Se(Re(l),y,h,_)}function pe(y,l,h,_){return Se(dt(l,y.length-h),y,h,_)}a.prototype.write=function(l,h,_,B){if(h===void 0)B="utf8",_=this.length,h=0;else if(_===void 0&&typeof h=="string")B=h,_=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(_)?(_=_>>>0,B===void 0&&(B="utf8")):(B=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const D=this.length-h;if((_===void 0||_>D)&&(_=D),l.length>0&&(_<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let $=!1;for(;;)switch(B){case"hex":return Q(this,l,h,_);case"utf8":case"utf-8":return Y(this,l,h,_);case"ascii":case"latin1":case"binary":return de(this,l,h,_);case"base64":return oe(this,l,h,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,l,h,_);default:if($)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),$=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(y,l,h){return l===0&&h===y.length?t.fromByteArray(y):t.fromByteArray(y.slice(l,h))}function o(y,l,h){h=Math.min(y.length,h);const _=[];let B=l;for(;B<h;){const D=y[B];let $=null,he=D>239?4:D>223?3:D>191?2:1;if(B+he<=h){let ae,ie,Ce,ne;switch(he){case 1:D<128&&($=D);break;case 2:ae=y[B+1],(ae&192)===128&&(ne=(D&31)<<6|ae&63,ne>127&&($=ne));break;case 3:ae=y[B+1],ie=y[B+2],(ae&192)===128&&(ie&192)===128&&(ne=(D&15)<<12|(ae&63)<<6|ie&63,ne>2047&&(ne<55296||ne>57343)&&($=ne));break;case 4:ae=y[B+1],ie=y[B+2],Ce=y[B+3],(ae&192)===128&&(ie&192)===128&&(Ce&192)===128&&(ne=(D&15)<<18|(ae&63)<<12|(ie&63)<<6|Ce&63,ne>65535&&ne<1114112&&($=ne))}}$===null?($=65533,he=1):$>65535&&($-=65536,_.push($>>>10&1023|55296),$=56320|$&1023),_.push($),B+=he}return m(_)}const d=4096;function m(y){const l=y.length;if(l<=d)return String.fromCharCode.apply(String,y);let h="",_=0;for(;_<l;)h+=String.fromCharCode.apply(String,y.slice(_,_+=d));return h}function v(y,l,h){let _="";h=Math.min(y.length,h);for(let B=l;B<h;++B)_+=String.fromCharCode(y[B]&127);return _}function E(y,l,h){let _="";h=Math.min(y.length,h);for(let B=l;B<h;++B)_+=String.fromCharCode(y[B]);return _}function I(y,l,h){const _=y.length;(!l||l<0)&&(l=0),(!h||h<0||h>_)&&(h=_);let B="";for(let D=l;D<h;++D)B+=Me[y[D]];return B}function T(y,l,h){const _=y.slice(l,h);let B="";for(let D=0;D<_.length-1;D+=2)B+=String.fromCharCode(_[D]+_[D+1]*256);return B}a.prototype.slice=function(l,h){const _=this.length;l=~~l,h=h===void 0?_:~~h,l<0?(l+=_,l<0&&(l=0)):l>_&&(l=_),h<0?(h+=_,h<0&&(h=0)):h>_&&(h=_),h<l&&(h=l);const B=this.subarray(l,h);return Object.setPrototypeOf(B,a.prototype),B};function b(y,l,h){if(y%1!==0||y<0)throw new RangeError("offset is not uint");if(y+l>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let B=this[l],D=1,$=0;for(;++$<h&&(D*=256);)B+=this[l+$]*D;return B},a.prototype.readUintBE=a.prototype.readUIntBE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let B=this[l+--h],D=1;for(;h>0&&(D*=256);)B+=this[l+--h]*D;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,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const B=h+this[++l]*2**8+this[++l]*2**16+this[++l]*2**24,D=this[++l]+this[++l]*2**8+this[++l]*2**16+_*2**24;return BigInt(B)+(BigInt(D)<<BigInt(32))}),a.prototype.readBigUInt64BE=Qe(function(l){l=l>>>0,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const B=h*2**24+this[++l]*2**16+this[++l]*2**8+this[++l],D=this[++l]*2**24+this[++l]*2**16+this[++l]*2**8+_;return(BigInt(B)<<BigInt(32))+BigInt(D)}),a.prototype.readIntLE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let B=this[l],D=1,$=0;for(;++$<h&&(D*=256);)B+=this[l+$]*D;return D*=128,B>=D&&(B-=Math.pow(2,8*h)),B},a.prototype.readIntBE=function(l,h,_){l=l>>>0,h=h>>>0,_||b(l,h,this.length);let B=h,D=1,$=this[l+--B];for(;B>0&&(D*=256);)$+=this[l+--B]*D;return D*=128,$>=D&&($-=Math.pow(2,8*h)),$},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 _=this[l]|this[l+1]<<8;return _&32768?_|4294901760:_},a.prototype.readInt16BE=function(l,h){l=l>>>0,h||b(l,2,this.length);const _=this[l+1]|this[l]<<8;return _&32768?_|4294901760:_},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,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===void 0)&&G(l,this.length-8);const B=this[l+4]+this[l+5]*2**8+this[l+6]*2**16+(_<<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,q(l,"offset");const h=this[l],_=this[l+7];(h===void 0||_===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+_)}),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(y,l,h,_,B,D){if(!a.isBuffer(y))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>B||l<D)throw new RangeError('"value" argument is out of bounds');if(h+_>y.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(l,h,_,B){if(l=+l,h=h>>>0,_=_>>>0,!B){const he=Math.pow(2,8*_)-1;u(this,l,h,_,he,0)}let D=1,$=0;for(this[h]=l&255;++$<_&&(D*=256);)this[h+$]=l/D&255;return h+_},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(l,h,_,B){if(l=+l,h=h>>>0,_=_>>>0,!B){const he=Math.pow(2,8*_)-1;u(this,l,h,_,he,0)}let D=_-1,$=1;for(this[h+D]=l&255;--D>=0&&($*=256);)this[h+D]=l/$&255;return h+_},a.prototype.writeUint8=a.prototype.writeUInt8=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,1,255,0),this[h]=l&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(l,h,_){return l=+l,h=h>>>0,_||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,_){return l=+l,h=h>>>0,_||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,_){return l=+l,h=h>>>0,_||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,_){return l=+l,h=h>>>0,_||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 R(y,l,h,_,B){C(l,_,B,y,h,7);let D=Number(l&BigInt(4294967295));y[h++]=D,D=D>>8,y[h++]=D,D=D>>8,y[h++]=D,D=D>>8,y[h++]=D;let $=Number(l>>BigInt(32)&BigInt(4294967295));return y[h++]=$,$=$>>8,y[h++]=$,$=$>>8,y[h++]=$,$=$>>8,y[h++]=$,h}function K(y,l,h,_,B){C(l,_,B,y,h,7);let D=Number(l&BigInt(4294967295));y[h+7]=D,D=D>>8,y[h+6]=D,D=D>>8,y[h+5]=D,D=D>>8,y[h+4]=D;let $=Number(l>>BigInt(32)&BigInt(4294967295));return y[h+3]=$,$=$>>8,y[h+2]=$,$=$>>8,y[h+1]=$,$=$>>8,y[h]=$,h+8}a.prototype.writeBigUInt64LE=Qe(function(l,h=0){return R(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,_,B){if(l=+l,h=h>>>0,!B){const ae=Math.pow(2,8*_-1);u(this,l,h,_,ae-1,-ae)}let D=0,$=1,he=0;for(this[h]=l&255;++D<_&&($*=256);)l<0&&he===0&&this[h+D-1]!==0&&(he=1),this[h+D]=(l/$>>0)-he&255;return h+_},a.prototype.writeIntBE=function(l,h,_,B){if(l=+l,h=h>>>0,!B){const ae=Math.pow(2,8*_-1);u(this,l,h,_,ae-1,-ae)}let D=_-1,$=1,he=0;for(this[h+D]=l&255;--D>=0&&($*=256);)l<0&&he===0&&this[h+D+1]!==0&&(he=1),this[h+D]=(l/$>>0)-he&255;return h+_},a.prototype.writeInt8=function(l,h,_){return l=+l,h=h>>>0,_||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,_){return l=+l,h=h>>>0,_||u(this,l,h,2,32767,-32768),this[h]=l&255,this[h+1]=l>>>8,h+2},a.prototype.writeInt16BE=function(l,h,_){return l=+l,h=h>>>0,_||u(this,l,h,2,32767,-32768),this[h]=l>>>8,this[h+1]=l&255,h+2},a.prototype.writeInt32LE=function(l,h,_){return l=+l,h=h>>>0,_||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,_){return l=+l,h=h>>>0,_||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 R(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(y,l,h,_,B,D){if(h+_>y.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function x(y,l,h,_,B){return l=+l,h=h>>>0,B||J(y,l,h,4),r.write(y,l,h,_,23,4),h+4}a.prototype.writeFloatLE=function(l,h,_){return x(this,l,h,!0,_)},a.prototype.writeFloatBE=function(l,h,_){return x(this,l,h,!1,_)};function L(y,l,h,_,B){return l=+l,h=h>>>0,B||J(y,l,h,8),r.write(y,l,h,_,52,8),h+8}a.prototype.writeDoubleLE=function(l,h,_){return L(this,l,h,!0,_)},a.prototype.writeDoubleBE=function(l,h,_){return L(this,l,h,!1,_)},a.prototype.copy=function(l,h,_,B){if(!a.isBuffer(l))throw new TypeError("argument should be a Buffer");if(_||(_=0),!B&&B!==0&&(B=this.length),h>=l.length&&(h=l.length),h||(h=0),B>0&&B<_&&(B=_),B===_||l.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=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-_&&(B=l.length-h+_);const D=B-_;return this===l&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,_,B):Uint8Array.prototype.set.call(l,this.subarray(_,B),h),D},a.prototype.fill=function(l,h,_,B){if(typeof l=="string"){if(typeof h=="string"?(B=h,h=0,_=this.length):typeof _=="string"&&(B=_,_=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 $=l.charCodeAt(0);(B==="utf8"&&$<128||B==="latin1")&&(l=$)}}else typeof l=="number"?l=l&255:typeof l=="boolean"&&(l=Number(l));if(h<0||this.length<h||this.length<_)throw new RangeError("Out of range index");if(_<=h)return this;h=h>>>0,_=_===void 0?this.length:_>>>0,l||(l=0);let D;if(typeof l=="number")for(D=h;D<_;++D)this[D]=l;else{const $=a.isBuffer(l)?l:a.from(l,B),he=$.length;if(he===0)throw new TypeError('The value "'+l+'" is invalid for argument "value"');for(D=0;D<_-h;++D)this[D+h]=$[D%he]}return this};const W={};function Z(y,l,h){W[y]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:l.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${y}]`,this.stack,delete this.name}get code(){return y}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${y}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(y){return y?`${y} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(y,l){return`The "${y}" argument must be of type number. Received type ${typeof l}`},TypeError),Z("ERR_OUT_OF_RANGE",function(y,l,h){let _=`The value of "${y}" 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"),_+=` It must be ${l}. Received ${B}`,_},RangeError);function le(y){let l="",h=y.length;const _=y[0]==="-"?1:0;for(;h>=_+4;h-=3)l=`_${y.slice(h-3,h)}${l}`;return`${y.slice(0,h)}${l}`}function M(y,l,h){q(l,"offset"),(y[l]===void 0||y[l+h]===void 0)&&G(l,y.length-(h+1))}function C(y,l,h,_,B,D){if(y>h||y<l){const $=typeof l=="bigint"?"n":"";let he;throw l===0||l===BigInt(0)?he=`>= 0${$} and < 2${$} ** ${(D+1)*8}${$}`:he=`>= -(2${$} ** ${(D+1)*8-1}${$}) and < 2 ** ${(D+1)*8-1}${$}`,new W.ERR_OUT_OF_RANGE("value",he,y)}M(_,B,D)}function q(y,l){if(typeof y!="number")throw new W.ERR_INVALID_ARG_TYPE(l,"number",y)}function G(y,l,h){throw Math.floor(y)!==y?(q(y,h),new W.ERR_OUT_OF_RANGE("offset","an integer",y)):l<0?new W.ERR_BUFFER_OUT_OF_BOUNDS:new W.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${l}`,y)}const se=/[^+/0-9A-Za-z-_]/g;function ue(y){if(y=y.split("=")[0],y=y.trim().replace(se,""),y.length<2)return"";for(;y.length%4!==0;)y=y+"=";return y}function re(y,l){l=l||1/0;let h;const _=y.length;let B=null;const D=[];for(let $=0;$<_;++$){if(h=y.charCodeAt($),h>55295&&h<57344){if(!B){if(h>56319){(l-=3)>-1&&D.push(239,191,189);continue}else if($+1===_){(l-=3)>-1&&D.push(239,191,189);continue}B=h;continue}if(h<56320){(l-=3)>-1&&D.push(239,191,189),B=h;continue}h=(B-55296<<10|h-56320)+65536}else B&&(l-=3)>-1&&D.push(239,191,189);if(B=null,h<128){if((l-=1)<0)break;D.push(h)}else if(h<2048){if((l-=2)<0)break;D.push(h>>6|192,h&63|128)}else if(h<65536){if((l-=3)<0)break;D.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((l-=4)<0)break;D.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return D}function we(y){const l=[];for(let h=0;h<y.length;++h)l.push(y.charCodeAt(h)&255);return l}function dt(y,l){let h,_,B;const D=[];for(let $=0;$<y.length&&!((l-=2)<0);++$)h=y.charCodeAt($),_=h>>8,B=h%256,D.push(B),D.push(_);return D}function Re(y){return t.toByteArray(ue(y))}function Se(y,l,h,_){let B;for(B=0;B<_&&!(B+h>=l.length||B>=y.length);++B)l[B+h]=y[B];return B}function Ze(y,l){return y instanceof l||y!=null&&y.constructor!=null&&y.constructor.name!=null&&y.constructor.name===l.name}function _e(y){return y!==y}const Me=function(){const y="0123456789abcdef",l=new Array(256);for(let h=0;h<16;++h){const _=h*16;for(let B=0;B<16;++B)l[_+B]=y[h]+y[B]}return l}();function Qe(y){return typeof BigInt>"u"?Ee:y}function Ee(){throw new Error("BigInt not supported")}})(Pn);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Pn,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)}})(So,So.exports);var $t=So.exports,Us,Oa;function _0(){if(Oa)return Us;Oa=1;var e=Od;return Us=function(r){return!!e(r)},Us}var E0=Sn,S0=_l,R0=S0("TypedArray.prototype.buffer",!0),M0=_0(),C0=R0||function(t){if(!M0(t))throw new E0("Not a Typed Array");return t.buffer},Rt=$t.Buffer,I0=ld,A0=C0,k0=ArrayBuffer.isView||function(t){try{return A0(t),!0}catch{return!1}},x0=typeof Uint8Array<"u",jl=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",T0=jl&&(Rt.prototype instanceof Uint8Array||Rt.TYPED_ARRAY_SUPPORT),B0=function(t,r){if(Rt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?Rt.from(t):t;if(typeof t=="string")return Rt.from(t,r);if(jl&&k0(t)){if(t.byteLength===0)return Rt.alloc(0);if(T0){var n=Rt.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=Rt.from(i);if(s.length===t.byteLength)return s}if(x0&&t instanceof Uint8Array)return Rt.from(t);var c=I0(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||Rt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return Rt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},N0=$t.Buffer,P0=B0;function Ui(e,t){this._block=N0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Ui.prototype.update=function(e,t){e=P0(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};Ui.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};Ui.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var cn=Ui,L0=Mt,Ul=cn,O0=$t.Buffer,F0=[1518500249,1859775393,-1894007588,-899497514],D0=new Array(80);function Ln(){this.init(),this._w=D0,Ul.call(this,64,56)}L0(Ln,Ul);Ln.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function j0(e){return e<<5|e>>>27}function U0(e){return e<<30|e>>>2}function $0(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Ln.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=j0(r)+$0(g,n,i,s)+c+t[f]+F0[g]|0;c=s,s=i,i=U0(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};Ln.prototype._hash=function(){var e=O0.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 H0=Ln,W0=Mt,$l=cn,V0=$t.Buffer,q0=[1518500249,1859775393,-1894007588,-899497514],z0=new Array(80);function On(){this.init(),this._w=z0,$l.call(this,64,56)}W0(On,$l);On.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function G0(e){return e<<1|e>>>31}function J0(e){return e<<5|e>>>27}function Z0(e){return e<<30|e>>>2}function K0(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}On.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]=G0(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var f=0;f<80;++f){var g=~~(f/20),p=J0(r)+K0(g,n,i,s)+c+t[f]+q0[g]|0;c=s,s=i,i=Z0(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};On.prototype._hash=function(){var e=V0.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 Y0=On,Q0=Mt,Hl=cn,X0=$t.Buffer,ep=[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],tp=new Array(64);function Fn(){this.init(),this._w=tp,Hl.call(this,64,56)}Q0(Fn,Hl);Fn.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 rp(e,t,r){return r^e&(t^r)}function np(e,t,r){return e&t|r&(e|t)}function ip(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sp(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function op(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ap(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Fn.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]=ap(t[p-2])+t[p-7]+op(t[p-15])+t[p-16]|0;for(var S=0;S<64;++S){var w=g+sp(c)+rp(c,a,f)+ep[S]+t[S]|0,N=ip(r)+np(r,n,i)|0;g=f,f=a,a=c,c=s+w|0,s=i,i=n,n=r,r=w+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};Fn.prototype._hash=function(){var e=X0.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 Wl=Fn,cp=Mt,lp=Wl,up=cn,hp=$t.Buffer,fp=new Array(64);function $i(){this.init(),this._w=fp,up.call(this,64,56)}cp($i,lp);$i.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};$i.prototype._hash=function(){var e=hp.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 dp=$i,pp=Mt,Vl=cn,gp=$t.Buffer,Fa=[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],yp=new Array(160);function Dn(){this.init(),this._w=yp,Vl.call(this,128,112)}pp(Dn,Vl);Dn.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 Da(e,t,r){return r^e&(t^r)}function ja(e,t,r){return e&t|r&(e|t)}function Ua(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function $a(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function mp(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function vp(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function bp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function wp(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Xe(e,t){return e>>>0<t>>>0?1:0}Dn.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,S=this._bl|0,w=this._cl|0,N=this._dl|0,U=this._el|0,F=this._fl|0,H=this._gl|0,k=this._hl|0,P=0;P<32;P+=2)t[P]=e.readInt32BE(P*4),t[P+1]=e.readInt32BE(P*4+4);for(;P<160;P+=2){var O=t[P-30],V=t[P-15*2+1],j=mp(O,V),z=vp(V,O);O=t[P-2*2],V=t[P-2*2+1];var te=bp(O,V),Q=wp(V,O),Y=t[P-7*2],de=t[P-7*2+1],oe=t[P-16*2],pe=t[P-16*2+1],A=z+de|0,o=j+Y+Xe(A,z)|0;A=A+Q|0,o=o+te+Xe(A,Q)|0,A=A+pe|0,o=o+oe+Xe(A,pe)|0,t[P]=o,t[P+1]=A}for(var d=0;d<160;d+=2){o=t[d],A=t[d+1];var m=ja(r,n,i),v=ja(p,S,w),E=Ua(r,p),I=Ua(p,r),T=$a(c,U),b=$a(U,c),u=Fa[d],R=Fa[d+1],K=Da(c,a,f),J=Da(U,F,H),x=k+b|0,L=g+T+Xe(x,k)|0;x=x+J|0,L=L+K+Xe(x,J)|0,x=x+R|0,L=L+u+Xe(x,R)|0,x=x+A|0,L=L+o+Xe(x,A)|0;var W=I+v|0,Z=E+m+Xe(W,I)|0;g=f,k=H,f=a,H=F,a=c,F=U,U=N+x|0,c=s+L+Xe(U,N)|0,s=i,N=w,i=n,w=S,n=r,S=p,p=x+W|0,r=L+Z+Xe(p,x)|0}this._al=this._al+p|0,this._bl=this._bl+S|0,this._cl=this._cl+w|0,this._dl=this._dl+N|0,this._el=this._el+U|0,this._fl=this._fl+F|0,this._gl=this._gl+H|0,this._hl=this._hl+k|0,this._ah=this._ah+r+Xe(this._al,p)|0,this._bh=this._bh+n+Xe(this._bl,S)|0,this._ch=this._ch+i+Xe(this._cl,w)|0,this._dh=this._dh+s+Xe(this._dl,N)|0,this._eh=this._eh+c+Xe(this._el,U)|0,this._fh=this._fh+a+Xe(this._fl,F)|0,this._gh=this._gh+f+Xe(this._gl,H)|0,this._hh=this._hh+g+Xe(this._hl,k)|0};Dn.prototype._hash=function(){var e=gp.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 ql=Dn,_p=Mt,Ep=ql,Sp=cn,Rp=$t.Buffer,Mp=new Array(160);function Hi(){this.init(),this._w=Mp,Sp.call(this,128,112)}_p(Hi,Ep);Hi.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};Hi.prototype._hash=function(){var e=Rp.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 Cp=Hi;(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=H0,e.exports.sha1=Y0,e.exports.sha224=dp,e.exports.sha256=Wl,e.exports.sha384=Cp,e.exports.sha512=ql})(Fl);var Ip=Fl.exports;Object.defineProperty(an,"__esModule",{value:!0});an.Session=void 0;const Ha=Ip,Wa=X,Va="session:id",qa="session:secret",za="session:linked";class jo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Wa.randomBytesHex)(16),this._secret=n||(0,Wa.randomBytesHex)(32),this._key=new Ha.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Va),n=t.getItem(za),i=t.getItem(qa);return r&&i?new jo(t,r,i,n==="1"):null}static hash(t){return new Ha.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(Va,this._id),this._storage.setItem(qa,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(za,this._linked?"1":"0")}}an.Session=jo;var Wi={},Vi={};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.Cipher=void 0;const ri=X;class Ap{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,ri.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),S=new Uint8Array(g),w=new Uint8Array([...n,...p,...S]);return(0,ri.uint8ArrayToHex)(w)}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,ri.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,ri.hexStringToUint8Array)(t),a=c.slice(0,12),f=c.slice(12,28),g=c.slice(28),p=new Uint8Array([...g,...f]),S={name:"AES-GCM",iv:new Uint8Array(a)};try{const w=await window.crypto.subtle.decrypt(S,s,p),N=new TextDecoder;n(N.decode(w))}catch(w){i(w)}})()})}}Vi.Cipher=Ap;var qi={};Object.defineProperty(qi,"__esModule",{value:!0});qi.WalletLinkHTTP=void 0;class kp{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==null?void 0: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}`)}}qi.WalletLinkHTTP=kp;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.WalletLinkWebSocket=Yr.ConnectionState=void 0;var Wr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Wr||(Yr.ConnectionState=Wr={}));class xp{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,Wr.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,Wr.DISCONNECTED)},i.onopen=s=>{var c;t(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Wr.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,Wr.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)}}Yr.WalletLinkWebSocket=xp;Object.defineProperty(Wi,"__esModule",{value:!0});Wi.WalletLinkConnection=void 0;const Or=Ke,Tp=Vi,It=on,Ga=vt,Fr=an,Bp=qi,ni=Yr,Ja=1e4,Np=6e4;class Pp{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Or.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 S=a[p];S!==void 0&&g(S)})},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(It.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Fr.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(It.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,f)=>{var g,p;try{const S=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.metadataUpdated(a,S)}catch{(p=this.diagnostic)===null||p===void 0||p.log(It.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Ga.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Ga.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,f)=>{var g,p;try{const S=await this.cipher.decrypt(a),w=await this.cipher.decrypt(f);(g=this.listener)===null||g===void 0||g.chainUpdated(S,w)}catch{(p=this.diagnostic)===null||p===void 0||p.log(It.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Tp.Cipher(t.secret),this.diagnostic=i,this.listener=n;const c=new ni.WalletLinkWebSocket(`${r}/rpc`,s);c.setConnectionStateListener(async a=>{var f;(f=this.diagnostic)===null||f===void 0||f.log(It.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Fr.Session.hash(t.id)});let g=!1;switch(a){case ni.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(S=>setTimeout(S,5e3)),this.destroyed||c.connect().catch(()=>{p()})};p()}break;case ni.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),g=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ja),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ni.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 S=a.type==="IsLinkedOK"?a.linked:void 0;(f=this.diagnostic)===null||f===void 0||f.log(It.EVENTS.LINKED,{sessionIdHash:Fr.Session.hash(t.id),linked:S,type:a.type,onlineGuests:a.onlineGuests}),this.linked=S||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(g=this.diagnostic)===null||g===void 0||g.log(It.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Fr.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 Bp.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(It.EVENTS.STARTED_CONNECTING,{sessionIdHash:Fr.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(It.EVENTS.DISCONNECTED,{sessionIdHash:Fr.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(It.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,Or.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,Or.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>Ja*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Np){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,Or.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,Or.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Or.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Wi.WalletLinkConnection=Pp;var jn={},Un={},Uo={};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.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 Lp=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Un,"__esModule",{value:!0});Un.injectCssReset=void 0;const Op=Lp(Uo);function Fp(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Op.default)),document.documentElement.appendChild(e)}Un.injectCssReset=Fp;var zi={};const ct=En(Sh);var Gi={};function zl(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=zl(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Za(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=zl(e))&&(n&&(n+=" "),n+=t);return n}const Dp=Object.freeze(Object.defineProperty({__proto__:null,clsx:Za,default:Za},Symbol.toStringTag,{value:"Module"})),$n=En(Dp),Ji=En(Rh);var Qr={},Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.CloseIcon=void 0;const Ka=ct;function jp(e){return(0,Ka.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ka.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"}))}Zi.CloseIcon=jp;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.CoinbaseWalletRound=void 0;const ii=ct;function Up(e){return(0,ii.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ii.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,ii.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,ii.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"}))}Ki.CoinbaseWalletRound=Up;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.QRCodeIcon=void 0;const dn=ct;function $p(e){return(0,dn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,dn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,dn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,dn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,dn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Yi.QRCodeIcon=$p;var Qi={};function Gl(e){this.mode=ht.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))}Gl.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 Pt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Pt.prototype={addData:function(e){var t=new Gl(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=Pt.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=qe.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=qe.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=qe.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=qe.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=qe.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}}}};Pt.PAD0=236;Pt.PAD1=17;Pt.createData=function(e,t,r){for(var n=Nt.getRSBlocks(e,t),i=new Jl,s=0;s<r.length;s++){var c=r[s];i.put(c.mode,4),i.put(c.getLength(),qe.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(Pt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Pt.PAD1,8);return Pt.createBytes(i,n)};Pt.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 S=qe.getErrorCorrectPolynomial(g),w=new zr(s[a],S.getLength()-1),N=w.mod(S);c[a]=new Array(S.getLength()-1);for(var p=0;p<c[a].length;p++){var U=p+N.getLength()-c[a].length;c[a][p]=U>=0?N.get(U):0}}for(var F=0,p=0;p<t.length;p++)F+=t[p].totalCount;for(var H=new Array(F),k=0,p=0;p<n;p++)for(var a=0;a<t.length;a++)p<s[a].length&&(H[k++]=s[a][p]);for(var p=0;p<i;p++)for(var a=0;a<t.length;a++)p<c[a].length&&(H[k++]=c[a][p]);return H};var ht={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},qt={L:1,M:0,Q:3,H:2},Ht={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},qe={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;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15)>=0;)t^=qe.G15<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G15);return(e<<10|t)^qe.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18)>=0;)t^=qe.G18<<qe.getBCHDigit(t)-qe.getBCHDigit(qe.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return qe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ht.PATTERN000:return(t+r)%2==0;case Ht.PATTERN001:return t%2==0;case Ht.PATTERN010:return r%3==0;case Ht.PATTERN011:return(t+r)%3==0;case Ht.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ht.PATTERN101:return t*r%2+t*r%3==0;case Ht.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ht.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new zr([1],0),r=0;r<e;r++)t=t.multiply(new zr([1,tt.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case ht.MODE_NUMBER:return 10;case ht.MODE_ALPHA_NUM:return 9;case ht.MODE_8BIT_BYTE:return 8;case ht.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case ht.MODE_NUMBER:return 12;case ht.MODE_ALPHA_NUM:return 11;case ht.MODE_8BIT_BYTE:return 16;case ht.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case ht.MODE_NUMBER:return 14;case ht.MODE_ALPHA_NUM:return 13;case ht.MODE_8BIT_BYTE:return 16;case ht.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 S=Math.abs(100*p/t/t-50)/5;return r+=S*10,r}},tt={glog:function(e){if(e<1)throw new Error("glog("+e+")");return tt.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return tt.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var nt=0;nt<8;nt++)tt.EXP_TABLE[nt]=1<<nt;for(var nt=8;nt<256;nt++)tt.EXP_TABLE[nt]=tt.EXP_TABLE[nt-4]^tt.EXP_TABLE[nt-5]^tt.EXP_TABLE[nt-6]^tt.EXP_TABLE[nt-8];for(var nt=0;nt<255;nt++)tt.LOG_TABLE[tt.EXP_TABLE[nt]]=nt;function zr(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]}zr.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]^=tt.gexp(tt.glog(this.get(r))+tt.glog(e.get(n)));return new zr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=tt.glog(this.get(0))-tt.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]^=tt.gexp(tt.glog(e.get(n))+t);return new zr(r,0).mod(e)}};function Nt(e,t){this.totalCount=e,this.dataCount=t}Nt.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]];Nt.getRSBlocks=function(e,t){var r=Nt.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 Nt(a,f));return i};Nt.getRsBlockTable=function(e,t){switch(t){case qt.L:return Nt.RS_BLOCK_TABLE[(e-1)*4+0];case qt.M:return Nt.RS_BLOCK_TABLE[(e-1)*4+1];case qt.Q:return Nt.RS_BLOCK_TABLE[(e-1)*4+2];case qt.H:return Nt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function Jl(){this.buffer=[],this.length=0}Jl.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 $s=[[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 Zl(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 qt.L;case"M":return qt.M;case"Q":return qt.Q;case"H":return qt.H;default:throw new Error("Unknwon error correction level: "+f)}}function n(f,g){for(var p=i(f),S=1,w=0,N=0,U=$s.length;N<=U;N++){var F=$s[N];if(!F)throw new Error("Content too long: expected "+w+" but got "+p);switch(g){case"L":w=F[0];break;case"M":w=F[1];break;case"Q":w=F[2];break;case"H":w=F[3];break;default:throw new Error("Unknwon error correction level: "+g)}if(p<=w)break;S++}if(S>$s.length)throw new Error("Content too long");return S}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 Pt(c,a),this.qrcode.addData(s),this.qrcode.make()}Zl.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),S=typeof t.join<"u"?!!t.join:!1,w=typeof t.swap<"u"?!!t.swap:!1,N=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,U=typeof t.predefined<"u"?!!t.predefined:!1,F=U?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+g+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",H=i+'<rect x="0" y="0" width="'+c+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,k="",P="",O=0;O<f;O++)for(var V=0;V<f;V++){var j=r[V][O];if(j){var z=V*g+t.padding*g,te=O*p+t.padding*p;if(w){var Q=z;z=te,te=Q}if(S){var Y=g+z,de=p+te;z=Number.isInteger(z)?Number(z):z.toFixed(2),te=Number.isInteger(te)?Number(te):te.toFixed(2),Y=Number.isInteger(Y)?Number(Y):Y.toFixed(2),de=Number.isInteger(de)?Number(de):de.toFixed(2),P+="M"+z+","+te+" V"+de+" H"+Y+" V"+te+" H"+z+" Z "}else U?k+=i+'<use x="'+z.toString()+'" y="'+te.toString()+'" href="#qrmodule" />'+s:k+=i+'<rect x="'+z.toString()+'" y="'+te.toString()+'" width="'+g+'" height="'+p+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}S&&(k=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+P+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const A=c*this.options.image.width/100,o=a*this.options.image.height/100,d=c/2-A/2,m=a/2-o/2;oe+=`<svg x="${d}" y="${m}" width="${A}" 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+=F+H+k,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+=F+H+k,pe+=oe,pe+="</svg>";break;case"g":pe+='<g width="'+c+'" height="'+a+'">'+s,pe+=F+H+k,pe+=oe,pe+="</g>";break;default:pe+=(F+H+k+oe).replace(/^\s+/,"");break}return pe};var Hp=Zl,Wp=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.QRCode=void 0;const Vp=ct,Ya=Ji,qp=Wp(Hp),zp=e=>{const[t,r]=(0,Ya.useState)("");return(0,Ya.useEffect)(()=>{var n,i;const s=new qp.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,Vp.h)("img",{src:t,alt:"QR Code"}):null};Qi.QRCode=zp;var Xi={},$o={};Object.defineProperty($o,"__esModule",{value:!0});$o.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 Gp=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.Spinner=void 0;const si=ct,Jp=Gp($o),Zp=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,si.h)("div",{class:"-cbwsdk-spinner"},(0,si.h)("style",null,Jp.default),(0,si.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,si.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Xi.Spinner=Zp;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.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 Kl=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.CoinbaseWalletSteps=Qr.ConnectContent=void 0;const mr=Kl($n),ve=ct,Kp=X,Yp=sn,Qp=Zi,Xp=Ki,eg=Yi,tg=Qi,rg=Xi,ng=Kl(Ho),Hs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Yl},ig=e=>e==="light"?"#FFFFFF":"#0A0B0D";function sg(e){const{theme:t}=e,r=(0,Kp.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Hs.steps;return(0,ve.h)("div",{"data-testid":"connect-content",className:(0,mr.default)("-cbwsdk-connect-content",t)},(0,ve.h)("style",null,ng.default),(0,ve.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ve.h)("h2",{className:(0,mr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ve.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ve.h)(Qp.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ve.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ve.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ve.h)(og,{title:Hs.title,description:Hs.description,theme:t})),(0,ve.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ve.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ve.h)(tg.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ve.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Yp.LIB_VERSION}),(0,ve.h)("input",{type:"hidden",value:r})),(0,ve.h)(n,{theme:t}),!e.isConnected&&(0,ve.h)("div",{"data-testid":"connecting-spinner",className:(0,mr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ve.h)(rg.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ve.h)("p",null,"Connecting...")))))}Qr.ConnectContent=sg;function og({title:e,description:t,theme:r}){return(0,ve.h)("div",{className:(0,mr.default)("-cbwsdk-connect-item",r)},(0,ve.h)("div",null,(0,ve.h)(Xp.CoinbaseWalletRound,null)),(0,ve.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ve.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ve.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Yl({theme:e}){return(0,ve.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ve.h)("li",{className:(0,mr.default)("-cbwsdk-wallet-steps-item",e)},(0,ve.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ve.h)("li",{className:(0,mr.default)("-cbwsdk-wallet-steps-item",e)},(0,ve.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ve.h)("span",null,"Tap ",(0,ve.h)("strong",null,"Scan")," "),(0,ve.h)("span",{className:(0,mr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ve.h)(eg.QRCodeIcon,{fill:ig(e)})))))}Qr.CoinbaseWalletSteps=Yl;var es={},ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.ArrowLeftIcon=void 0;const Qa=ct;function ag(e){return(0,Qa.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Qa.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"}))}ts.ArrowLeftIcon=ag;var rs={};Object.defineProperty(rs,"__esModule",{value:!0});rs.LaptopIcon=void 0;const Ws=ct;function cg(e){return(0,Ws.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ws.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ws.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"}))}rs.LaptopIcon=cg;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.SafeIcon=void 0;const Xa=ct;function lg(e){return(0,Xa.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Xa.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"}))}ns.SafeIcon=lg;var Wo={};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.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 Ql=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(es,"__esModule",{value:!0});es.TryExtensionContent=void 0;const cr=Ql($n),Je=ct,Vs=Ji,ug=ts,hg=rs,fg=ns,dg=Ql(Wo);function pg({theme:e}){const[t,r]=(0,Vs.useState)(!1),n=(0,Vs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Vs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Je.h)("div",{class:(0,cr.default)("-cbwsdk-try-extension",e)},(0,Je.h)("style",null,dg.default),(0,Je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Je.h)("h3",{class:(0,cr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Je.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Je.h)("button",{class:(0,cr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Je.h)("div",null,!t&&(0,Je.h)(ug.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Je.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Je.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Je.h)("span",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Je.h)(hg.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Je.h)("div",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Je.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Je.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Je.h)("span",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Je.h)(fg.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Je.h)("div",{class:(0,cr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}es.TryExtensionContent=pg;var Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.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 Xl=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.ConnectDialog=void 0;const qs=Xl($n),lr=ct,zs=Ji,gg=Qr,yg=es,mg=Xl(Vo),vg=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,zs.useState)(!t),[s,c]=(0,zs.useState)(!t);(0,zs.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,lr.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,lr.h)("style",null,mg.default),(0,lr.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,lr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,lr.h)("div",{class:(0,qs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,lr.h)(gg.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,lr.h)(yg.TryExtensionContent,{theme:a}))))};Gi.ConnectDialog=vg;Object.defineProperty(zi,"__esModule",{value:!0});zi.LinkFlow=void 0;const Gs=ct,bg=Gi;class wg{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,Gs.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,Gs.render)((0,Gs.h)(bg.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)}}zi.LinkFlow=wg;var qo={},zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.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(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t($n),n=ct,i=Ji,s=t(zo),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class f{constructor(w){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=w.darkMode}attach(w){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",w.appendChild(this.root),this.render()}presentItem(w){const N=this.nextItemKey++;return this.items.set(N,w),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(([w,N])=>(0,n.h)(e.SnackbarInstance,Object.assign({},N,{key:w}))))),this.root)}}e.Snackbar=f;const g=S=>(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"},S.children));e.SnackbarContainer=g;const p=({autoExpand:S,message:w,menuItems:N})=>{const[U,F]=(0,i.useState)(!0),[H,k]=(0,i.useState)(S??!1);(0,i.useEffect)(()=>{const O=[window.setTimeout(()=>{F(!1)},1),window.setTimeout(()=>{k(!0)},1e4)];return()=>{O.forEach(window.clearTimeout)}});const P=()=>{k(!H)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",U&&"-cbwsdk-snackbar-instance-hidden",H&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:P},(0,n.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},w),(0,n.h)("div",{class:"-gear-container"},!H&&(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})(qo);Object.defineProperty(jn,"__esModule",{value:!0});jn.WalletLinkRelayUI=void 0;const _g=Un,Eg=zi,Sg=qo;class Rg{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new Sg.Snackbar({darkMode:t.darkMode}),this.linkFlow=new Eg.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,_g.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}}jn.WalletLinkRelayUI=Rg;Object.defineProperty(Nn,"__esModule",{value:!0});Nn.WalletLinkRelay=void 0;const Dr=An,Mg=Ke,Ve=X,ur=on,ec=vt,Wt=an,Cg=Wi,hr=nn,Ig=jn;class Dt extends ec.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(ec.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 S=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(ur.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:S})}}},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]),Dt.accountRequestCallbackIds.size>0&&(Array.from(Dt.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}))}),Dt.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=Wt.Session.load(this.storage)||new Wt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new Cg.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(ur.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Wt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(ur.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Wt.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(ur.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,Ve.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Ve.hexStringFromBuffer)(t,!0),signature:(0,Ve.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ve.bigIntStringFromBN)(t.weiValue),data:(0,Ve.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Ve.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,Ve.bigIntStringFromBN)(t.weiValue),data:(0,Ve.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ve.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Ve.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Ve.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Ve.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Ve.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Ve.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,Ve.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,c),r==null||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==null||r(),(0,hr.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 Ig.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Wt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(ur.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Wt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(c=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(ur.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Wt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0: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(ur.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Dt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Dt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const c=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Dr.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,Ve.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,hr.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=Dr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}Dt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider"},n=(0,Ve.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,hr.isErrorResponse)(p))return a(new Error(p.errorMessage));c(p)});const f=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Mg.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,Ve.randomBytesHex)(8),p=w=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,a.method,w),f==null||f()};this.ui.inlineWatchAsset()||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const S=new Promise((w,N)=>{this.relayEventManager.callbacks.set(g,H=>{if(f==null||f(),(0,hr.isErrorResponse)(H))return N(new Error(H.errorMessage));w(H)});const U=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!1}})},F=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:F,onCancel:U,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:S}}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,Ve.randomBytesHex)(8),p=w=>{this.publishWeb3RequestCanceledEvent(g),this.handleErrorResponse(g,a.method,w),f==null||f()};return this.ui.inlineAddEthereumChain(t)||(f=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((w,N)=>{this.relayEventManager.callbacks.set(g,H=>{if(f==null||f(),(0,hr.isErrorResponse)(H))return N(new Error(H.errorMessage));w(H)});const U=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},F=H=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:g,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:H}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:U,onApprove:F,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,Ve.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,f)=>{this.relayEventManager.callbacks.set(i,S=>{if((0,hr.isErrorResponse)(S)&&S.errorCode)return f(Dr.standardErrors.provider.custom({code:S.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,hr.isErrorResponse)(S))return f(new Error(S.errorMessage));a(S)});const g=S=>{var w;if(S){const N=(w=(0,Dr.getErrorCode)(S))!==null&&w!==void 0?w:Dr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",S instanceof Error?S:Dr.standardErrors.provider.unsupportedChain(t),N)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:S}}})};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 Wt.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}}}Nn.WalletLinkRelay=Dt;Dt.accountRequestCallbackIds=new Set;var Hn={},is={},eu={};(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(qo,e)})(eu);var Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.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 tu=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(is,"__esModule",{value:!0});is.RedirectDialog=void 0;const Ag=tu($n),Tt=ct,kg=Un,xg=eu,Tg=tu(Go);class Bg{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,kg.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Tt.render)(null,this.root),t&&(0,Tt.render)((0,Tt.h)(Ng,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}is.RedirectDialog=Bg;const Ng=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Tt.h)(xg.SnackbarContainer,{darkMode:r},(0,Tt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Tt.h)("style",null,Tg.default),(0,Tt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Tt.h)("div",{class:(0,Ag.default)("-cbwsdk-redirect-dialog-box",s)},(0,Tt.h)("p",null,e),(0,Tt.h)("button",{onClick:n},t))))};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.MobileRelayUI=void 0;const Pg=is;class Lg{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Pg.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}}Hn.MobileRelayUI=Lg;Object.defineProperty(Bn,"__esModule",{value:!0});Bn.MobileRelay=void 0;const Og=X,Fg=Nn,Dg=Hn;class jg extends Fg.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,Og.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 Dg.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}})}}Bn.MobileRelay=jg;var Ro={exports:{}},ru=ki.EventEmitter,Js,tc;function Ug(){if(tc)return Js;tc=1;function e(U,F){var H=Object.keys(U);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(U);F&&(k=k.filter(function(P){return Object.getOwnPropertyDescriptor(U,P).enumerable})),H.push.apply(H,k)}return H}function t(U){for(var F=1;F<arguments.length;F++){var H=arguments[F]!=null?arguments[F]:{};F%2?e(Object(H),!0).forEach(function(k){r(U,k,H[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(H)):e(Object(H)).forEach(function(k){Object.defineProperty(U,k,Object.getOwnPropertyDescriptor(H,k))})}return U}function r(U,F,H){return F=c(F),F in U?Object.defineProperty(U,F,{value:H,enumerable:!0,configurable:!0,writable:!0}):U[F]=H,U}function n(U,F){if(!(U instanceof F))throw new TypeError("Cannot call a class as a function")}function i(U,F){for(var H=0;H<F.length;H++){var k=F[H];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(U,c(k.key),k)}}function s(U,F,H){return F&&i(U.prototype,F),Object.defineProperty(U,"prototype",{writable:!1}),U}function c(U){var F=a(U,"string");return typeof F=="symbol"?F:String(F)}function a(U,F){if(typeof U!="object"||U===null)return U;var H=U[Symbol.toPrimitive];if(H!==void 0){var k=H.call(U,F);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(U)}var f=Pn,g=f.Buffer,p=ko,S=p.inspect,w=S&&S.custom||"inspect";function N(U,F,H){g.prototype.copy.call(U,F,H)}return Js=function(){function U(){n(this,U),this.head=null,this.tail=null,this.length=0}return s(U,[{key:"push",value:function(H){var k={data:H,next:null};this.length>0?this.tail.next=k:this.head=k,this.tail=k,++this.length}},{key:"unshift",value:function(H){var k={data:H,next:this.head};this.length===0&&(this.tail=k),this.head=k,++this.length}},{key:"shift",value:function(){if(this.length!==0){var H=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,H}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(H){if(this.length===0)return"";for(var k=this.head,P=""+k.data;k=k.next;)P+=H+k.data;return P}},{key:"concat",value:function(H){if(this.length===0)return g.alloc(0);for(var k=g.allocUnsafe(H>>>0),P=this.head,O=0;P;)N(P.data,k,O),O+=P.data.length,P=P.next;return k}},{key:"consume",value:function(H,k){var P;return H<this.head.data.length?(P=this.head.data.slice(0,H),this.head.data=this.head.data.slice(H)):H===this.head.data.length?P=this.shift():P=k?this._getString(H):this._getBuffer(H),P}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(H){var k=this.head,P=1,O=k.data;for(H-=O.length;k=k.next;){var V=k.data,j=H>V.length?V.length:H;if(j===V.length?O+=V:O+=V.slice(0,H),H-=j,H===0){j===V.length?(++P,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=V.slice(j));break}++P}return this.length-=P,O}},{key:"_getBuffer",value:function(H){var k=g.allocUnsafe(H),P=this.head,O=1;for(P.data.copy(k),H-=P.data.length;P=P.next;){var V=P.data,j=H>V.length?V.length:H;if(V.copy(k,k.length-H,0,j),H-=j,H===0){j===V.length?(++O,P.next?this.head=P.next:this.head=this.tail=null):(this.head=P,P.data=V.slice(j));break}++O}return this.length-=O,k}},{key:w,value:function(H,k){return S(this,t(t({},k),{},{depth:0,customInspect:!1}))}}]),U}(),Js}function $g(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(Mo,this,e)):process.nextTick(Mo,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(wi,r):(r._writableState.errorEmitted=!0,process.nextTick(rc,r,s)):process.nextTick(rc,r,s):t?(process.nextTick(wi,r),t(s)):process.nextTick(wi,r)}),this)}function rc(e,t){Mo(e,t),wi(e)}function wi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Hg(){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 Mo(e,t){e.emit("error",t)}function Wg(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var nu={destroy:$g,undestroy:Hg,errorOrDestroy:Wg},_r={};function Vg(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var iu={};function _t(e,t,r){r||(r=Error);function n(s,c,a){return typeof t=="string"?t:t(s,c,a)}var i=function(s){Vg(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,iu[e]=i}function nc(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 qg(e,t,r){return e.substr(0,t.length)===t}function zg(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Gg(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}_t("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);_t("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&qg(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(zg(e," argument"))i="The ".concat(e," ").concat(n," ").concat(nc(t,"type"));else{var s=Gg(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(nc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);_t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");_t("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});_t("ERR_STREAM_PREMATURE_CLOSE","Premature close");_t("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});_t("ERR_MULTIPLE_CALLBACK","Callback called multiple times");_t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");_t("ERR_STREAM_WRITE_AFTER_END","write after end");_t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);_t("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);_t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");_r.codes=iu;var Jg=_r.codes.ERR_INVALID_OPT_VALUE;function Zg(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Kg(e,t,r,n){var i=Zg(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Jg(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var su={getHighWaterMark:Kg},Yg=Qg;function Qg(e,t){if(Zs("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Zs("throwDeprecation"))throw new Error(t);Zs("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Zs(e){try{if(!ee.localStorage)return!1}catch{return!1}var t=ee.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Ks,ic;function ou(){if(ic)return Ks;ic=1,Ks=Q;function e(x){var L=this;this.next=null,this.entry=null,this.finish=function(){J(L,x)}}var t;Q.WritableState=z;var r={deprecate:Yg},n=ru,i=Pn.Buffer,s=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(x){return i.from(x)}function a(x){return i.isBuffer(x)||x instanceof s}var f=nu,g=su,p=g.getHighWaterMark,S=_r.codes,w=S.ERR_INVALID_ARG_TYPE,N=S.ERR_METHOD_NOT_IMPLEMENTED,U=S.ERR_MULTIPLE_CALLBACK,F=S.ERR_STREAM_CANNOT_PIPE,H=S.ERR_STREAM_DESTROYED,k=S.ERR_STREAM_NULL_VALUES,P=S.ERR_STREAM_WRITE_AFTER_END,O=S.ERR_UNKNOWN_ENCODING,V=f.errorOrDestroy;Mt(Q,n);function j(){}function z(x,L,W){t=t||Xr(),x=x||{},typeof W!="boolean"&&(W=L instanceof t),this.objectMode=!!x.objectMode,W&&(this.objectMode=this.objectMode||!!x.writableObjectMode),this.highWaterMark=p(this,x,"writableHighWaterMark",W),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Z=x.decodeStrings===!1;this.decodeStrings=!Z,this.defaultEncoding=x.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(le){m(L,le)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=x.emitClose!==!1,this.autoDestroy=!!x.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var L=this.bufferedRequest,W=[];L;)W.push(L),L=L.next;return W},function(){try{Object.defineProperty(z.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(Q,Symbol.hasInstance,{value:function(L){return te.call(this,L)?!0:this!==Q?!1:L&&L._writableState instanceof z}})):te=function(L){return L instanceof this};function Q(x){t=t||Xr();var L=this instanceof t;if(!L&&!te.call(Q,this))return new Q(x);this._writableState=new z(x,this,L),this.writable=!0,x&&(typeof x.write=="function"&&(this._write=x.write),typeof x.writev=="function"&&(this._writev=x.writev),typeof x.destroy=="function"&&(this._destroy=x.destroy),typeof x.final=="function"&&(this._final=x.final)),n.call(this)}Q.prototype.pipe=function(){V(this,new F)};function Y(x,L){var W=new P;V(x,W),process.nextTick(L,W)}function de(x,L,W,Z){var le;return W===null?le=new k:typeof W!="string"&&!L.objectMode&&(le=new w("chunk",["string","Buffer"],W)),le?(V(x,le),process.nextTick(Z,le),!1):!0}Q.prototype.write=function(x,L,W){var Z=this._writableState,le=!1,M=!Z.objectMode&&a(x);return M&&!i.isBuffer(x)&&(x=c(x)),typeof L=="function"&&(W=L,L=null),M?L="buffer":L||(L=Z.defaultEncoding),typeof W!="function"&&(W=j),Z.ending?Y(this,W):(M||de(this,Z,x,W))&&(Z.pendingcb++,le=pe(this,Z,M,x,L,W)),le},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){var x=this._writableState;x.corked&&(x.corked--,!x.writing&&!x.corked&&!x.bufferProcessing&&x.bufferedRequest&&I(this,x))},Q.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=L.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new O(L);return this._writableState.defaultEncoding=L,this},Object.defineProperty(Q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(x,L,W){return!x.objectMode&&x.decodeStrings!==!1&&typeof L=="string"&&(L=i.from(L,W)),L}Object.defineProperty(Q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(x,L,W,Z,le,M){if(!W){var C=oe(L,Z,le);Z!==C&&(W=!0,le="buffer",Z=C)}var q=L.objectMode?1:Z.length;L.length+=q;var G=L.length<L.highWaterMark;if(G||(L.needDrain=!0),L.writing||L.corked){var se=L.lastBufferedRequest;L.lastBufferedRequest={chunk:Z,encoding:le,isBuf:W,callback:M,next:null},se?se.next=L.lastBufferedRequest:L.bufferedRequest=L.lastBufferedRequest,L.bufferedRequestCount+=1}else A(x,L,!1,q,Z,le,M);return G}function A(x,L,W,Z,le,M,C){L.writelen=Z,L.writecb=C,L.writing=!0,L.sync=!0,L.destroyed?L.onwrite(new H("write")):W?x._writev(le,L.onwrite):x._write(le,M,L.onwrite),L.sync=!1}function o(x,L,W,Z,le){--L.pendingcb,W?(process.nextTick(le,Z),process.nextTick(R,x,L),x._writableState.errorEmitted=!0,V(x,Z)):(le(Z),x._writableState.errorEmitted=!0,V(x,Z),R(x,L))}function d(x){x.writing=!1,x.writecb=null,x.length-=x.writelen,x.writelen=0}function m(x,L){var W=x._writableState,Z=W.sync,le=W.writecb;if(typeof le!="function")throw new U;if(d(W),L)o(x,W,Z,L,le);else{var M=T(W)||x.destroyed;!M&&!W.corked&&!W.bufferProcessing&&W.bufferedRequest&&I(x,W),Z?process.nextTick(v,x,W,M,le):v(x,W,M,le)}}function v(x,L,W,Z){W||E(x,L),L.pendingcb--,Z(),R(x,L)}function E(x,L){L.length===0&&L.needDrain&&(L.needDrain=!1,x.emit("drain"))}function I(x,L){L.bufferProcessing=!0;var W=L.bufferedRequest;if(x._writev&&W&&W.next){var Z=L.bufferedRequestCount,le=new Array(Z),M=L.corkedRequestsFree;M.entry=W;for(var C=0,q=!0;W;)le[C]=W,W.isBuf||(q=!1),W=W.next,C+=1;le.allBuffers=q,A(x,L,!0,L.length,le,"",M.finish),L.pendingcb++,L.lastBufferedRequest=null,M.next?(L.corkedRequestsFree=M.next,M.next=null):L.corkedRequestsFree=new e(L),L.bufferedRequestCount=0}else{for(;W;){var G=W.chunk,se=W.encoding,ue=W.callback,re=L.objectMode?1:G.length;if(A(x,L,!1,re,G,se,ue),W=W.next,L.bufferedRequestCount--,L.writing)break}W===null&&(L.lastBufferedRequest=null)}L.bufferedRequest=W,L.bufferProcessing=!1}Q.prototype._write=function(x,L,W){W(new N("_write()"))},Q.prototype._writev=null,Q.prototype.end=function(x,L,W){var Z=this._writableState;return typeof x=="function"?(W=x,x=null,L=null):typeof L=="function"&&(W=L,L=null),x!=null&&this.write(x,L),Z.corked&&(Z.corked=1,this.uncork()),Z.ending||K(this,Z,W),this},Object.defineProperty(Q.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function T(x){return x.ending&&x.length===0&&x.bufferedRequest===null&&!x.finished&&!x.writing}function b(x,L){x._final(function(W){L.pendingcb--,W&&V(x,W),L.prefinished=!0,x.emit("prefinish"),R(x,L)})}function u(x,L){!L.prefinished&&!L.finalCalled&&(typeof x._final=="function"&&!L.destroyed?(L.pendingcb++,L.finalCalled=!0,process.nextTick(b,x,L)):(L.prefinished=!0,x.emit("prefinish")))}function R(x,L){var W=T(L);if(W&&(u(x,L),L.pendingcb===0&&(L.finished=!0,x.emit("finish"),L.autoDestroy))){var Z=x._readableState;(!Z||Z.autoDestroy&&Z.endEmitted)&&x.destroy()}return W}function K(x,L,W){L.ending=!0,R(x,L),W&&(L.finished?process.nextTick(W):x.once("finish",W)),L.ended=!0,x.writable=!1}function J(x,L,W){var Z=x.entry;for(x.entry=null;Z;){var le=Z.callback;L.pendingcb--,le(W),Z=Z.next}L.corkedRequestsFree.next=x}return Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(L){this._writableState&&(this._writableState.destroyed=L)}}),Q.prototype.destroy=f.destroy,Q.prototype._undestroy=f.undestroy,Q.prototype._destroy=function(x,L){L(x)},Ks}var Ys,sc;function Xr(){if(sc)return Ys;sc=1;var e=Object.keys||function(g){var p=[];for(var S in g)p.push(S);return p};Ys=c;var t=cu(),r=ou();Mt(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)}}),Ys}var Qs={},oc;function ac(){if(oc)return Qs;oc=1;var e=$t.Buffer,t=e.isEncoding||function(k){switch(k=""+k,k&&k.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(k){if(!k)return"utf8";for(var P;;)switch(k){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 k;default:if(P)return;k=(""+k).toLowerCase(),P=!0}}function n(k){var P=r(k);if(typeof P!="string"&&(e.isEncoding===t||!t(k)))throw new Error("Unknown encoding: "+k);return P||k}Qs.StringDecoder=i;function i(k){this.encoding=n(k);var P;switch(this.encoding){case"utf16le":this.text=S,this.end=w,P=4;break;case"utf8":this.fillLast=f,P=4;break;case"base64":this.text=N,this.end=U,P=3;break;default:this.write=F,this.end=H;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(P)}i.prototype.write=function(k){if(k.length===0)return"";var P,O;if(this.lastNeed){if(P=this.fillLast(k),P===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O<k.length?P?P+this.text(k,O):this.text(k,O):P||""},i.prototype.end=p,i.prototype.text=g,i.prototype.fillLast=function(k){if(this.lastNeed<=k.length)return k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,this.lastTotal-this.lastNeed,0,k.length),this.lastNeed-=k.length};function s(k){return k<=127?0:k>>5===6?2:k>>4===14?3:k>>3===30?4:k>>6===2?-1:-2}function c(k,P,O){var V=P.length-1;if(V<O)return 0;var j=s(P[V]);return j>=0?(j>0&&(k.lastNeed=j-1),j):--V<O||j===-2?0:(j=s(P[V]),j>=0?(j>0&&(k.lastNeed=j-2),j):--V<O||j===-2?0:(j=s(P[V]),j>=0?(j>0&&(j===2?j=0:k.lastNeed=j-3),j):0))}function a(k,P,O){if((P[0]&192)!==128)return k.lastNeed=0,"�";if(k.lastNeed>1&&P.length>1){if((P[1]&192)!==128)return k.lastNeed=1,"�";if(k.lastNeed>2&&P.length>2&&(P[2]&192)!==128)return k.lastNeed=2,"�"}}function f(k){var P=this.lastTotal-this.lastNeed,O=a(this,k);if(O!==void 0)return O;if(this.lastNeed<=k.length)return k.copy(this.lastChar,P,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);k.copy(this.lastChar,P,0,k.length),this.lastNeed-=k.length}function g(k,P){var O=c(this,k,P);if(!this.lastNeed)return k.toString("utf8",P);this.lastTotal=O;var V=k.length-(O-this.lastNeed);return k.copy(this.lastChar,0,V),k.toString("utf8",P,V)}function p(k){var P=k&&k.length?this.write(k):"";return this.lastNeed?P+"�":P}function S(k,P){if((k.length-P)%2===0){var O=k.toString("utf16le",P);if(O){var V=O.charCodeAt(O.length-1);if(V>=55296&&V<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=k[k.length-1],k.toString("utf16le",P,k.length-1)}function w(k){var P=k&&k.length?this.write(k):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return P+this.lastChar.toString("utf16le",0,O)}return P}function N(k,P){var O=(k.length-P)%3;return O===0?k.toString("base64",P):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=k[k.length-1]:(this.lastChar[0]=k[k.length-2],this.lastChar[1]=k[k.length-1]),k.toString("base64",P,k.length-O))}function U(k){var P=k&&k.length?this.write(k):"";return this.lastNeed?P+this.lastChar.toString("base64",0,3-this.lastNeed):P}function F(k){return k.toString(this.encoding)}function H(k){return k&&k.length?this.write(k):""}return Qs}var cc=_r.codes.ERR_STREAM_PREMATURE_CLOSE;function Xg(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 e1(){}function t1(e){return e.setHeader&&typeof e.abort=="function"}function au(e,t,r){if(typeof t=="function")return au(e,null,t);t||(t={}),r=Xg(r||e1);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(U){r.call(e,U)},S=function(){var U;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(U=new cc),r.call(e,U);if(i&&!c)return(!e._writableState||!e._writableState.ended)&&(U=new cc),r.call(e,U)},w=function(){e.req.on("finish",a)};return t1(e)?(e.on("complete",a),e.on("abort",S),e.req?w():e.on("request",w)):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",S),function(){e.removeListener("complete",a),e.removeListener("abort",S),e.removeListener("request",w),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",S)}}var Jo=au,Xs,lc;function r1(){if(lc)return Xs;lc=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 z=j.call(O,V);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(V==="string"?String:Number)(O)}var i=Jo,s=Symbol("lastResolve"),c=Symbol("lastReject"),a=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),p=Symbol("handlePromise"),S=Symbol("stream");function w(O,V){return{value:O,done:V}}function N(O){var V=O[s];if(V!==null){var j=O[S].read();j!==null&&(O[g]=null,O[s]=null,O[c]=null,V(w(j,!1)))}}function U(O){process.nextTick(N,O)}function F(O,V){return function(j,z){O.then(function(){if(V[f]){j(w(void 0,!0));return}V[p](j,z)},z)}}var H=Object.getPrototypeOf(function(){}),k=Object.setPrototypeOf((e={get stream(){return this[S]},next:function(){var V=this,j=this[a];if(j!==null)return Promise.reject(j);if(this[f])return Promise.resolve(w(void 0,!0));if(this[S].destroyed)return new Promise(function(Y,de){process.nextTick(function(){V[a]?de(V[a]):Y(w(void 0,!0))})});var z=this[g],te;if(z)te=new Promise(F(z,this));else{var Q=this[S].read();if(Q!==null)return Promise.resolve(w(Q,!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,z){V[S].destroy(null,function(te){if(te){z(te);return}j(w(void 0,!0))})})}),e),H),P=function(V){var j,z=Object.create(k,(j={},t(j,S,{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(Q,Y){var de=z[S].read();de?(z[g]=null,z[s]=null,z[c]=null,Q(w(de,!1))):(z[s]=Q,z[c]=Y)},writable:!0}),j));return z[g]=null,i(V,function(te){if(te&&te.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Q=z[c];Q!==null&&(z[g]=null,z[s]=null,z[c]=null,Q(te)),z[a]=te;return}var Y=z[s];Y!==null&&(z[g]=null,z[s]=null,z[c]=null,Y(w(void 0,!0))),z[f]=!0}),V.on("readable",U.bind(null,z)),z};return Xs=P,Xs}var eo,uc;function n1(){return uc||(uc=1,eo=function(){throw new Error("Readable.from is not available in the browser")}),eo}var to,hc;function cu(){if(hc)return to;hc=1,to=Y;var e;Y.ReadableState=Q,ki.EventEmitter;var t=function(C,q){return C.listeners(q).length},r=ru,n=Pn.Buffer,i=(typeof ee<"u"?ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(M){return n.from(M)}function c(M){return n.isBuffer(M)||M instanceof i}var a=ko,f;a&&a.debuglog?f=a.debuglog("stream"):f=function(){};var g=Ug(),p=nu,S=su,w=S.getHighWaterMark,N=_r.codes,U=N.ERR_INVALID_ARG_TYPE,F=N.ERR_STREAM_PUSH_AFTER_EOF,H=N.ERR_METHOD_NOT_IMPLEMENTED,k=N.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,P,O,V;Mt(Y,r);var j=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function te(M,C,q){if(typeof M.prependListener=="function")return M.prependListener(C,q);!M._events||!M._events[C]?M.on(C,q):Array.isArray(M._events[C])?M._events[C].unshift(q):M._events[C]=[q,M._events[C]]}function Q(M,C,q){e=e||Xr(),M=M||{},typeof q!="boolean"&&(q=C instanceof e),this.objectMode=!!M.objectMode,q&&(this.objectMode=this.objectMode||!!M.readableObjectMode),this.highWaterMark=w(this,M,"readableHighWaterMark",q),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=M.emitClose!==!1,this.autoDestroy=!!M.autoDestroy,this.destroyed=!1,this.defaultEncoding=M.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,M.encoding&&(P||(P=ac().StringDecoder),this.decoder=new P(M.encoding),this.encoding=M.encoding)}function Y(M){if(e=e||Xr(),!(this instanceof Y))return new Y(M);var C=this instanceof e;this._readableState=new Q(M,this,C),this.readable=!0,M&&(typeof M.read=="function"&&(this._read=M.read),typeof M.destroy=="function"&&(this._destroy=M.destroy)),r.call(this)}Object.defineProperty(Y.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(C){this._readableState&&(this._readableState.destroyed=C)}}),Y.prototype.destroy=p.destroy,Y.prototype._undestroy=p.undestroy,Y.prototype._destroy=function(M,C){C(M)},Y.prototype.push=function(M,C){var q=this._readableState,G;return q.objectMode?G=!0:typeof M=="string"&&(C=C||q.defaultEncoding,C!==q.encoding&&(M=n.from(M,C),C=""),G=!0),de(this,M,C,!1,G)},Y.prototype.unshift=function(M){return de(this,M,null,!0,!1)};function de(M,C,q,G,se){f("readableAddChunk",C);var ue=M._readableState;if(C===null)ue.reading=!1,m(M,ue);else{var re;if(se||(re=pe(ue,C)),re)j(M,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(M,new k):oe(M,ue,C,!0);else if(ue.ended)j(M,new F);else{if(ue.destroyed)return!1;ue.reading=!1,ue.decoder&&!q?(C=ue.decoder.write(C),ue.objectMode||C.length!==0?oe(M,ue,C,!1):I(M,ue)):oe(M,ue,C,!1)}else G||(ue.reading=!1,I(M,ue))}return!ue.ended&&(ue.length<ue.highWaterMark||ue.length===0)}function oe(M,C,q,G){C.flowing&&C.length===0&&!C.sync?(C.awaitDrain=0,M.emit("data",q)):(C.length+=C.objectMode?1:q.length,G?C.buffer.unshift(q):C.buffer.push(q),C.needReadable&&v(M)),I(M,C)}function pe(M,C){var q;return!c(C)&&typeof C!="string"&&C!==void 0&&!M.objectMode&&(q=new U("chunk",["string","Buffer","Uint8Array"],C)),q}Y.prototype.isPaused=function(){return this._readableState.flowing===!1},Y.prototype.setEncoding=function(M){P||(P=ac().StringDecoder);var C=new P(M);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,G="";q!==null;)G+=C.write(q.data),q=q.next;return this._readableState.buffer.clear(),G!==""&&this._readableState.buffer.push(G),this._readableState.length=G.length,this};var A=1073741824;function o(M){return M>=A?M=A:(M--,M|=M>>>1,M|=M>>>2,M|=M>>>4,M|=M>>>8,M|=M>>>16,M++),M}function d(M,C){return M<=0||C.length===0&&C.ended?0:C.objectMode?1:M!==M?C.flowing&&C.length?C.buffer.head.data.length:C.length:(M>C.highWaterMark&&(C.highWaterMark=o(M)),M<=C.length?M:C.ended?C.length:(C.needReadable=!0,0))}Y.prototype.read=function(M){f("read",M),M=parseInt(M,10);var C=this._readableState,q=M;if(M!==0&&(C.emittedReadable=!1),M===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):v(this),null;if(M=d(M,C),M===0&&C.ended)return C.length===0&&W(this),null;var G=C.needReadable;f("need readable",G),(C.length===0||C.length-M<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||(M=d(q,C)));var se;return M>0?se=L(M,C):se=null,se===null?(C.needReadable=C.length<=C.highWaterMark,M=0):(C.length-=M,C.awaitDrain=0),C.length===0&&(C.ended||(C.needReadable=!0),q!==M&&C.ended&&W(this)),se!==null&&this.emit("data",se),se};function m(M,C){if(f("onEofChunk"),!C.ended){if(C.decoder){var q=C.decoder.end();q&&q.length&&(C.buffer.push(q),C.length+=C.objectMode?1:q.length)}C.ended=!0,C.sync?v(M):(C.needReadable=!1,C.emittedReadable||(C.emittedReadable=!0,E(M)))}}function v(M){var C=M._readableState;f("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(f("emitReadable",C.flowing),C.emittedReadable=!0,process.nextTick(E,M))}function E(M){var C=M._readableState;f("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&(C.length||C.ended)&&(M.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,x(M)}function I(M,C){C.readingMore||(C.readingMore=!0,process.nextTick(T,M,C))}function T(M,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){var q=C.length;if(f("maybeReadMore read 0"),M.read(0),q===C.length)break}C.readingMore=!1}Y.prototype._read=function(M){j(this,new H("_read()"))},Y.prototype.pipe=function(M,C){var q=this,G=this._readableState;switch(G.pipesCount){case 0:G.pipes=M;break;case 1:G.pipes=[G.pipes,M];break;default:G.pipes.push(M);break}G.pipesCount+=1,f("pipe count=%d opts=%j",G.pipesCount,C);var se=(!C||C.end!==!1)&&M!==process.stdout&&M!==process.stderr,ue=se?we:Ee;G.endEmitted?process.nextTick(ue):q.once("end",ue),M.on("unpipe",re);function re(y,l){f("onunpipe"),y===q&&l&&l.hasUnpiped===!1&&(l.hasUnpiped=!0,Se())}function we(){f("onend"),M.end()}var dt=b(q);M.on("drain",dt);var Re=!1;function Se(){f("cleanup"),M.removeListener("close",Me),M.removeListener("finish",Qe),M.removeListener("drain",dt),M.removeListener("error",_e),M.removeListener("unpipe",re),q.removeListener("end",we),q.removeListener("end",Ee),q.removeListener("data",Ze),Re=!0,G.awaitDrain&&(!M._writableState||M._writableState.needDrain)&&dt()}q.on("data",Ze);function Ze(y){f("ondata");var l=M.write(y);f("dest.write",l),l===!1&&((G.pipesCount===1&&G.pipes===M||G.pipesCount>1&&le(G.pipes,M)!==-1)&&!Re&&(f("false write response, pause",G.awaitDrain),G.awaitDrain++),q.pause())}function _e(y){f("onerror",y),Ee(),M.removeListener("error",_e),t(M,"error")===0&&j(M,y)}te(M,"error",_e);function Me(){M.removeListener("finish",Qe),Ee()}M.once("close",Me);function Qe(){f("onfinish"),M.removeListener("close",Me),Ee()}M.once("finish",Qe);function Ee(){f("unpipe"),q.unpipe(M)}return M.emit("pipe",q),G.flowing||(f("pipe resume"),q.resume()),M};function b(M){return function(){var q=M._readableState;f("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&t(M,"data")&&(q.flowing=!0,x(M))}}Y.prototype.unpipe=function(M){var C=this._readableState,q={hasUnpiped:!1};if(C.pipesCount===0)return this;if(C.pipesCount===1)return M&&M!==C.pipes?this:(M||(M=C.pipes),C.pipes=null,C.pipesCount=0,C.flowing=!1,M&&M.emit("unpipe",this,q),this);if(!M){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,M);return re===-1?this:(C.pipes.splice(re,1),C.pipesCount-=1,C.pipesCount===1&&(C.pipes=C.pipes[0]),M.emit("unpipe",this,q),this)},Y.prototype.on=function(M,C){var q=r.prototype.on.call(this,M,C),G=this._readableState;return M==="data"?(G.readableListening=this.listenerCount("readable")>0,G.flowing!==!1&&this.resume()):M==="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?v(this):G.reading||process.nextTick(R,this)),q},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(M,C){var q=r.prototype.removeListener.call(this,M,C);return M==="readable"&&process.nextTick(u,this),q},Y.prototype.removeAllListeners=function(M){var C=r.prototype.removeAllListeners.apply(this,arguments);return(M==="readable"||M===void 0)&&process.nextTick(u,this),C};function u(M){var C=M._readableState;C.readableListening=M.listenerCount("readable")>0,C.resumeScheduled&&!C.paused?C.flowing=!0:M.listenerCount("data")>0&&M.resume()}function R(M){f("readable nexttick read 0"),M.read(0)}Y.prototype.resume=function(){var M=this._readableState;return M.flowing||(f("resume"),M.flowing=!M.readableListening,K(this,M)),M.paused=!1,this};function K(M,C){C.resumeScheduled||(C.resumeScheduled=!0,process.nextTick(J,M,C))}function J(M,C){f("resume",C.reading),C.reading||M.read(0),C.resumeScheduled=!1,M.emit("resume"),x(M),C.flowing&&!C.reading&&M.read(0)}Y.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 x(M){var C=M._readableState;for(f("flow",C.flowing);C.flowing&&M.read()!==null;);}Y.prototype.wrap=function(M){var C=this,q=this._readableState,G=!1;M.on("end",function(){if(f("wrapped end"),q.decoder&&!q.ended){var re=q.decoder.end();re&&re.length&&C.push(re)}C.push(null)}),M.on("data",function(re){if(f("wrapped data"),q.decoder&&(re=q.decoder.write(re)),!(q.objectMode&&re==null)&&!(!q.objectMode&&(!re||!re.length))){var we=C.push(re);we||(G=!0,M.pause())}});for(var se in M)this[se]===void 0&&typeof M[se]=="function"&&(this[se]=function(we){return function(){return M[we].apply(M,arguments)}}(se));for(var ue=0;ue<z.length;ue++)M.on(z[ue],this.emit.bind(this,z[ue]));return this._read=function(re){f("wrapped _read",re),G&&(G=!1,M.resume())},this},typeof Symbol=="function"&&(Y.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=r1()),O(this)}),Object.defineProperty(Y.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Y.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Y.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(C){this._readableState&&(this._readableState.flowing=C)}}),Y._fromList=L,Object.defineProperty(Y.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(M,C){if(C.length===0)return null;var q;return C.objectMode?q=C.buffer.shift():!M||M>=C.length?(C.decoder?q=C.buffer.join(""):C.buffer.length===1?q=C.buffer.first():q=C.buffer.concat(C.length),C.buffer.clear()):q=C.buffer.consume(M,C.decoder),q}function W(M){var C=M._readableState;f("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,process.nextTick(Z,C,M))}function Z(M,C){if(f("endReadableNT",M.endEmitted,M.length),!M.endEmitted&&M.length===0&&(M.endEmitted=!0,C.readable=!1,C.emit("end"),M.autoDestroy)){var q=C._writableState;(!q||q.autoDestroy&&q.finished)&&C.destroy()}}typeof Symbol=="function"&&(Y.from=function(M,C){return V===void 0&&(V=n1()),V(Y,M,C)});function le(M,C){for(var q=0,G=M.length;q<G;q++)if(M[q]===C)return q;return-1}return to}var lu=Ut,ss=_r.codes,i1=ss.ERR_METHOD_NOT_IMPLEMENTED,s1=ss.ERR_MULTIPLE_CALLBACK,o1=ss.ERR_TRANSFORM_ALREADY_TRANSFORMING,a1=ss.ERR_TRANSFORM_WITH_LENGTH_0,os=Xr();Mt(Ut,os);function c1(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new s1);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 Ut(e){if(!(this instanceof Ut))return new Ut(e);os.call(this,e),this._transformState={afterTransform:c1.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",l1)}function l1(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){fc(e,t,r)}):fc(this,null,null)}Ut.prototype.push=function(e,t){return this._transformState.needTransform=!1,os.prototype.push.call(this,e,t)};Ut.prototype._transform=function(e,t,r){r(new i1("_transform()"))};Ut.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)}};Ut.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};Ut.prototype._destroy=function(e,t){os.prototype._destroy.call(this,e,function(r){t(r)})};function fc(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new a1;if(e._transformState.transforming)throw new o1;return e.push(null)}var u1=wn,uu=lu;Mt(wn,uu);function wn(e){if(!(this instanceof wn))return new wn(e);uu.call(this,e)}wn.prototype._transform=function(e,t,r){r(null,e)};var ro;function h1(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var hu=_r.codes,f1=hu.ERR_MISSING_ARGS,d1=hu.ERR_STREAM_DESTROYED;function dc(e){if(e)throw e}function p1(e){return e.setHeader&&typeof e.abort=="function"}function g1(e,t,r,n){n=h1(n);var i=!1;e.on("close",function(){i=!0}),ro===void 0&&(ro=Jo),ro(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,p1(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(c||new d1("pipe"))}}}function pc(e){e()}function y1(e,t){return e.pipe(t)}function m1(e){return!e.length||typeof e[e.length-1]!="function"?dc:e.pop()}function v1(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=m1(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new f1("streams");var i,s=t.map(function(c,a){var f=a<t.length-1,g=a>0;return g1(c,f,g,function(p){i||(i=p),p&&s.forEach(pc),!f&&(s.forEach(pc),n(i))})});return t.reduce(y1)}var b1=v1;(function(e,t){t=e.exports=cu(),t.Stream=t,t.Readable=t,t.Writable=ou(),t.Duplex=Xr(),t.Transform=lu,t.PassThrough=u1,t.finished=Jo,t.pipeline=b1})(Ro,Ro.exports);var fu=Ro.exports;const{Transform:w1}=fu;var _1=e=>class du extends w1{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 du(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:E1}=fu;var S1=e=>class pu extends E1{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 pu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const R1=_1,M1=S1;var C1=function(e){const t=R1(e),r=M1(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)}}},gu={};const gc=[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];gu.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],S=e[9]^e[19]^e[29]^e[39]^e[49];let w=p^(i<<1|s>>>31),N=S^(s<<1|i>>>31);const U=e[0]^w,F=e[1]^N,H=e[10]^w,k=e[11]^N,P=e[20]^w,O=e[21]^N,V=e[30]^w,j=e[31]^N,z=e[40]^w,te=e[41]^N;w=r^(c<<1|a>>>31),N=n^(a<<1|c>>>31);const Q=e[2]^w,Y=e[3]^N,de=e[12]^w,oe=e[13]^N,pe=e[22]^w,A=e[23]^N,o=e[32]^w,d=e[33]^N,m=e[42]^w,v=e[43]^N;w=i^(f<<1|g>>>31),N=s^(g<<1|f>>>31);const E=e[4]^w,I=e[5]^N,T=e[14]^w,b=e[15]^N,u=e[24]^w,R=e[25]^N,K=e[34]^w,J=e[35]^N,x=e[44]^w,L=e[45]^N;w=c^(p<<1|S>>>31),N=a^(S<<1|p>>>31);const W=e[6]^w,Z=e[7]^N,le=e[16]^w,M=e[17]^N,C=e[26]^w,q=e[27]^N,G=e[36]^w,se=e[37]^N,ue=e[46]^w,re=e[47]^N;w=f^(r<<1|n>>>31),N=g^(n<<1|r>>>31);const we=e[8]^w,dt=e[9]^N,Re=e[18]^w,Se=e[19]^N,Ze=e[28]^w,_e=e[29]^N,Me=e[38]^w,Qe=e[39]^N,Ee=e[48]^w,y=e[49]^N,l=U,h=F,_=k<<4|H>>>28,B=H<<4|k>>>28,D=P<<3|O>>>29,$=O<<3|P>>>29,he=j<<9|V>>>23,ae=V<<9|j>>>23,ie=z<<18|te>>>14,Ce=te<<18|z>>>14,ne=Q<<1|Y>>>31,Ie=Y<<1|Q>>>31,Rr=oe<<12|de>>>20,Ae=de<<12|oe>>>20,ke=pe<<10|A>>>22,Mr=A<<10|pe>>>22,xe=d<<13|o>>>19,Te=o<<13|d>>>19,Cr=m<<2|v>>>30,Be=v<<2|m>>>30,Ne=I<<30|E>>>2,Ir=E<<30|I>>>2,Pe=T<<6|b>>>26,Le=b<<6|T>>>26,Ar=R<<11|u>>>21,Oe=u<<11|R>>>21,Fe=K<<15|J>>>17,kr=J<<15|K>>>17,De=L<<29|x>>>3,je=x<<29|L>>>3,xr=W<<28|Z>>>4,Ue=Z<<28|W>>>4,$e=M<<23|le>>>9,Tr=le<<23|M>>>9,He=C<<25|q>>>7,We=q<<25|C>>>7,Jt=G<<21|se>>>11,Zt=se<<21|G>>>11,Kt=re<<24|ue>>>8,Yt=ue<<24|re>>>8,Qt=we<<27|dt>>>5,Xt=dt<<27|we>>>5,er=Re<<20|Se>>>12,tr=Se<<20|Re>>>12,rr=_e<<7|Ze>>>25,nr=Ze<<7|_e>>>25,ir=Me<<8|Qe>>>24,sr=Qe<<8|Me>>>24,or=Ee<<14|y>>>18,ar=y<<14|Ee>>>18;e[0]=l^~Rr&Ar,e[1]=h^~Ae&Oe,e[10]=xr^~er&D,e[11]=Ue^~tr&$,e[20]=ne^~Pe&He,e[21]=Ie^~Le&We,e[30]=Qt^~_&ke,e[31]=Xt^~B&Mr,e[40]=Ne^~$e&rr,e[41]=Ir^~Tr&nr,e[2]=Rr^~Ar&Jt,e[3]=Ae^~Oe&Zt,e[12]=er^~D&xe,e[13]=tr^~$&Te,e[22]=Pe^~He&ir,e[23]=Le^~We&sr,e[32]=_^~ke&Fe,e[33]=B^~Mr&kr,e[42]=$e^~rr&he,e[43]=Tr^~nr&ae,e[4]=Ar^~Jt&or,e[5]=Oe^~Zt&ar,e[14]=D^~xe&De,e[15]=$^~Te&je,e[24]=He^~ir&ie,e[25]=We^~sr&Ce,e[34]=ke^~Fe&Kt,e[35]=Mr^~kr&Yt,e[44]=rr^~he&Cr,e[45]=nr^~ae&Be,e[6]=Jt^~or&l,e[7]=Zt^~ar&h,e[16]=xe^~De&xr,e[17]=Te^~je&Ue,e[26]=ir^~ie&ne,e[27]=sr^~Ce&Ie,e[36]=Fe^~Kt&Qt,e[37]=kr^~Yt&Xt,e[46]=he^~Cr&Ne,e[47]=ae^~Be&Ir,e[8]=or^~l&Rr,e[9]=ar^~h&Ae,e[18]=De^~xr&er,e[19]=je^~Ue&tr,e[28]=ie^~ne&Pe,e[29]=Ce^~Ie&Le,e[38]=Kt^~Qt&_,e[39]=Yt^~Xt&B,e[48]=Cr^~Ne&$e,e[49]=Be^~Ir&Tr,e[0]^=gc[t*2],e[1]^=gc[t*2+1]}};const Ii=gu;function ln(){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}ln.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};ln.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&&(Ii.p1600(this.state),this.count=0)};ln.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&Ii.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Ii.p1600(this.state),this.count=0,this.squeezing=!0};ln.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&&(Ii.p1600(this.state),this.count=0);return t};ln.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 I1=ln,A1=C1(I1);const k1=A1,x1=Ni;function yu(e){return Buffer.allocUnsafe(e).fill(0)}function mu(e,t,r){const n=yu(t);return e=as(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 T1(e,t){return mu(e,t,!0)}function as(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")vu(e)?e=Buffer.from(P1(bu(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(x1.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function B1(e){return e=as(e),"0x"+e.toString("hex")}function N1(e,t){return e=as(e),t||(t=256),k1("keccak"+t).update(e).digest()}function P1(e){return e.length%2?"0"+e:e}function vu(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function bu(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var wu={zeros:yu,setLength:mu,setLengthRight:T1,isHexString:vu,stripHexPrefix:bu,toBuffer:as,bufferToHex:B1,keccak:N1};const br=wu,gr=Ni;function _u(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 Gr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function yc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Eu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function fr(e){var t=typeof e;if(t==="string")return br.isHexString(e)?new gr(br.stripHexPrefix(e),16):new gr(e,10);if(t==="number")return new gr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function xt(e,t){var r,n,i,s;if(e==="address")return xt("uint160",fr(t));if(e==="bool")return xt("uint8",t?1:0);if(e==="string")return xt("bytes",new Buffer(t,"utf8"));if(O1(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Eu(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(xt(e,t[s]));if(r==="dynamic"){var c=xt("uint256",t.length);i.unshift(c)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([xt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,br.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Gr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return br.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Gr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=fr(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=Gr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=fr(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=yc(e),n=fr(t),n<0)throw new Error("Supplied ufixed is negative");return xt("uint256",n.mul(new gr(2).pow(new gr(r[1]))))}else if(e.startsWith("fixed"))return r=yc(e),xt("int256",fr(t).mul(new gr(2).pow(new gr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function L1(e){return e==="string"||e==="bytes"||Eu(e)==="dynamic"}function O1(e){return e.lastIndexOf("]")===e.length-1}function F1(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var c=_u(e[s]),a=t[s],f=xt(c,a);L1(c)?(r.push(xt("uint256",i)),n.push(f),i+=f.length):r.push(f)}return Buffer.concat(r.concat(n))}function Su(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=_u(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(br.setLength(a,20));else if(c.startsWith("bytes")){if(r=Gr(c),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(br.setLengthRight(a,r))}else if(c.startsWith("uint")){if(r=Gr(c),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=fr(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=Gr(c),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=fr(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 D1(e,t){return br.keccak(Su(e,t))}var j1={rawEncode:F1,solidityPack:Su,soliditySHA3:D1};const St=wu,yn=j1,Ru={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"]},no={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":St.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",St.keccak(g)];if(f==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",St.keccak(g)];if(f.lastIndexOf("]")===f.length-1){const p=f.slice(0,f.lastIndexOf("[")),S=g.map(w=>c(a,p,w));return["bytes32",St.keccak(yn.rawEncode(S.map(([w])=>w),S.map(([,w])=>w)))]}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=St.keccak(a),s.push(a);else if(c.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=St.keccak(a),s.push(a);else if(r[c.type]!==void 0)i.push("bytes32"),a=St.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 yn.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 St.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return St.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Ru.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)),St.keccak(Buffer.concat(n))}};var U1={TYPED_MESSAGE_SCHEMA:Ru,TypedDataUtils:no,hashForSignTypedDataLegacy:function(e){return $1(e.data)},hashForSignTypedData_v3:function(e){return no.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return no.hash(e.data)}};function $1(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"?St.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 yn.soliditySHA3(["bytes32","bytes32"],[yn.soliditySHA3(new Array(e.length).fill("string"),i),yn.soliditySHA3(n,r)])}var en={};Object.defineProperty(en,"__esModule",{value:!0});en.filterFromParam=en.FilterPolyfill=void 0;const $r=Ke,ot=X,H1=5*60*1e3,dr={jsonrpc:"2.0",id:0};class W1{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,$r.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Mu(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,ot.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,ot.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,ot.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,ot.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,ot.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(oi())}async getFilterLogs(t){const r=(0,ot.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getLogs",params:[mc(n)]})):oi()}makeFilterId(){return(0,$r.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 oi();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return ai();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getLogs",params:[mc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(c.result)){const a=c.result.map(g=>(0,ot.intNumberFromHexString)(g.blockNumber||"0x0")),f=Math.max(...a);if(f&&f>n){const g=(0,$r.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 oi();const n=await this.getCurrentBlockHeight();if(r>n)return ai();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,ot.range)(r,n+1).map(c=>this.getBlockHashByNumber((0,$r.IntNumber)(c))))).filter(c=>!!c),s=(0,$r.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({},dr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(ai())}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)},H1);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({},dr),{method:"eth_blockNumber",params:[]}));return(0,ot.intNumberFromHexString)((0,ot.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getBlockByNumber",params:[(0,ot.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,ot.ensureHexString)(r.result.hash):null}}en.FilterPolyfill=W1;function Mu(e){return{fromBlock:vc(e.fromBlock),toBlock:vc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}en.filterFromParam=Mu;function mc(e){const t={fromBlock:bc(e.fromBlock),toBlock:bc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function vc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,$r.IntNumber)(0);if((0,ot.isHexString)(e))return(0,ot.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function bc(e){return e==="latest"?e:(0,ot.hexStringFromIntNumber)(e)}function oi(){return Object.assign(Object.assign({},dr),{error:{code:-32e3,message:"filter not found"}})}function ai(){return Object.assign(Object.assign({},dr),{result:[]})}var cs={},Cu={},ls={},Zo=V1;function V1(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 wc=(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 q1=(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):wc(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)?wc(s,t):s}return n},Wn={},Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});const z1=ki;function _c(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function G1(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let J1=class extends z1.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")_c(s,this,r);else{const c=s.length,a=G1(s);for(let f=0;f<c;f+=1)_c(a[f],this,r)}return!0}};Vn.default=J1;var Z1=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.BaseBlockTracker=void 0;const K1=Z1(Vn),Y1=1e3,Q1=(e,t)=>e+t,Ec=["sync","latest"];class X1 extends K1.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Y1,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){Ec.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 Ec.map(t=>this.listenerCount(t)).reduce(Q1)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Sc(t),i=Sc(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}}Wn.BaseBlockTracker=X1;function Sc(e){return Number.parseInt(e,16)}var Iu={},Au={},it={};class ku 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 ey(e){return wt(e)&&typeof e[Symbol.iterator]=="function"}function wt(e){return typeof e=="object"&&e!=null}function Rc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ye(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function ty(e){const{done:t,value:r}=e.next();return t?void 0:r}function ry(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: \`${Ye(n)}\``}=e;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:f}}function*Co(e,t,r,n){ey(e)||(e=[e]);for(const i of e){const s=ry(i,t,r,n);s&&(yield s)}}function*Ko(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"&&wt(t.schema)&&wt(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,S]of t.entries(e,a)){const w=Ko(p,S,{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 w)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):wt(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 Ge{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 Co(p,g,this,f)}:this.validator=()=>[],s?this.refiner=(f,g)=>{const p=s(f,g);return Co(p,g,this,f)}:this.refiner=()=>[]}assert(t,r){return xu(t,this,r)}create(t,r){return Tu(t,this,r)}is(t){return Yo(t,this)}mask(t,r){return Bu(t,this,r)}validate(t,r={}){return un(t,this,r)}}function xu(e,t,r){const n=un(e,t,{message:r});if(n[0])throw n[0]}function Tu(e,t,r){const n=un(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Bu(e,t,r){const n=un(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Yo(e,t){return!un(e,t)[0]}function un(e,t,r={}){const n=Ko(e,t,r),i=ty(n);return i[0]?[new ku(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function ny(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?zn(n):qn(n)}function lt(e,t){return new Ge({type:e,schema:null,validator:t})}function iy(e,t){return new Ge({...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 sy(e){return new Ge({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 oy(e){let t;return new Ge({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 ay(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return zn(n);default:return qn(n)}}function cy(e){const t=e instanceof Ge,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Nu(r[n]);return t&&e.type==="type"?zn(r):qn(r)}function ly(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return zn(n);default:return qn(n)}}function uy(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),lt(e,t)}function hy(){return lt("any",()=>!0)}function fy(e){return new Ge({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: ${Ye(t)}`}})}function dy(){return lt("bigint",e=>typeof e=="bigint")}function py(){return lt("boolean",e=>typeof e=="boolean")}function gy(){return lt("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ye(e)}`)}function yy(e){const t={},r=e.map(n=>Ye(n)).join();for(const n of e)t[n]=n;return new Ge({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ye(n)}`}})}function my(){return lt("func",e=>typeof e=="function"||`Expected a function, but received: ${Ye(e)}`)}function vy(e){return lt("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ye(t)}`)}function by(){return lt("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ye(e)}`)}function wy(e){return new Ge({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 _y(e){const t=Ye(e),r=typeof e;return new Ge({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ye(n)}`}})}function Ey(e,t){return new Ge({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: ${Ye(r)}`}})}function Qo(){return lt("never",()=>!1)}function Sy(e){return new Ge({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function Ry(){return lt("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ye(e)}`)}function qn(e){const t=e?Object.keys(e):[],r=Qo();return new Ge({type:"object",schema:e||null,*entries(n){if(e&&wt(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 wt(n)||`Expected an object, but received: ${Ye(n)}`},coercer(n){return wt(n)?{...n}:n}})}function Nu(e){return new Ge({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function My(e,t){return new Ge({type:"record",schema:null,*entries(r){if(wt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return wt(r)||`Expected an object, but received: ${Ye(r)}`}})}function Cy(){return lt("regexp",e=>e instanceof RegExp)}function Iy(e){return new Ge({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: ${Ye(t)}`}})}function Pu(){return lt("string",e=>typeof e=="string"||`Expected a string, but received: ${Ye(e)}`)}function Ay(e){const t=Qo();return new Ge({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: ${Ye(r)}`}})}function zn(e){const t=Object.keys(e);return new Ge({type:"type",schema:e,*entries(r){if(wt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return wt(r)||`Expected an object, but received: ${Ye(r)}`},coercer(r){return wt(r)?{...r}:r}})}function ky(e){const t=e.map(r=>r.type).join(" | ");return new Ge({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]=Ko(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: ${Ye(r)}`,...i]}})}function Lu(){return lt("unknown",()=>!0)}function Xo(e,t,r){return new Ge({...e,coercer:(n,i)=>Yo(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function xy(e,t,r={}){return Xo(e,Lu(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&Rc(n)&&Rc(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 Ty(e){return Xo(e,Pu(),t=>t.trim())}function By(e){return Er(e,"empty",t=>{const r=Ou(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Ou(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Ny(e,t,r={}){const{exclusive:n}=r;return Er(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Py(e,t,r={}){const{exclusive:n}=r;return Er(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Ly(e){return Er(e,"nonempty",t=>Ou(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Oy(e,t){return Er(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Fy(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Er(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 Er(e,t,r){return new Ge({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),c=Co(s,i,e,n);for(const a of c)yield{...a,refinement:t}}})}const Dy=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ge,StructError:ku,any:hy,array:fy,assert:xu,assign:ny,bigint:dy,boolean:py,coerce:Xo,create:Tu,date:gy,defaulted:xy,define:lt,deprecated:iy,dynamic:sy,empty:By,enums:yy,func:my,instance:vy,integer:by,intersection:wy,is:Yo,lazy:oy,literal:_y,map:Ey,mask:Bu,max:Ny,min:Py,never:Qo,nonempty:Ly,nullable:Sy,number:Ry,object:qn,omit:ay,optional:Nu,partial:cy,pattern:Oy,pick:ly,record:My,refine:Er,regexp:Cy,set:Iy,size:Fy,string:Pu,struct:uy,trimmed:Ty,tuple:Ay,type:zn,union:ky,unknown:Lu,validate:un},Symbol.toStringTag,{value:"Module"})),Sr=En(Dy);Object.defineProperty(it,"__esModule",{value:!0});it.assertExhaustive=it.assertStruct=it.assert=it.AssertionError=void 0;const jy=Sr;function Uy(e){return typeof e=="object"&&e!==null&&"message"in e}function $y(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function Hy(e){const t=Uy(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Fu(e,t){return $y(e)?new e({message:t}):e({message:t})}class ea extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}it.AssertionError=ea;function Wy(e,t="Assertion failed.",r=ea){if(!e)throw t instanceof Error?t:Fu(r,t)}it.assert=Wy;function Vy(e,t,r="Assertion failed",n=ea){try{(0,jy.assert)(e,t)}catch(i){throw Fu(n,`${r}: ${Hy(i)}.`)}}it.assertStruct=Vy;function qy(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}it.assertExhaustive=qy;var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.base64=void 0;const zy=Sr,Gy=it,Jy=(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,Gy.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,zy.pattern)(e,a)};Gn.base64=Jy;var be={},Jn={};(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=Sr,r=it;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})(Jn);Object.defineProperty(be,"__esModule",{value:!0});be.createDataView=be.concatBytes=be.valueToBytes=be.stringToBytes=be.numberToBytes=be.signedBigIntToBytes=be.bigIntToBytes=be.hexToBytes=be.bytesToString=be.bytesToNumber=be.bytesToSignedBigInt=be.bytesToBigInt=be.bytesToHex=be.assertIsBytes=be.isBytes=void 0;const ft=it,Io=Jn,Mc=48,Cc=58,Ic=87;function Zy(){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 Ky=Zy();function ta(e){return e instanceof Uint8Array}be.isBytes=ta;function hn(e){(0,ft.assert)(ta(e),"Value must be a Uint8Array.")}be.assertIsBytes=hn;function Du(e){if(hn(e),e.length===0)return"0x";const t=Ky(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Io.add0x)(r.join(""))}be.bytesToHex=Du;function ju(e){hn(e);const t=Du(e);return BigInt(t)}be.bytesToBigInt=ju;function Yy(e){hn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}be.bytesToSignedBigInt=Yy;function Qy(e){hn(e);const t=ju(e);return(0,ft.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}be.bytesToNumber=Qy;function Xy(e){return hn(e),new TextDecoder().decode(e)}be.bytesToString=Xy;function us(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Io.assertIsHexString)(e);const r=(0,Io.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<Cc?Mc:Ic),g=a-(a<Cc?Mc:Ic);i[s]=f*16+g}return i}be.hexToBytes=us;function Uu(e){(0,ft.assert)(typeof e=="bigint","Value must be a bigint."),(0,ft.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return us(t)}be.bigIntToBytes=Uu;function em(e,t){(0,ft.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function tm(e,t){(0,ft.assert)(typeof e=="bigint","Value must be a bigint."),(0,ft.assert)(typeof t=="number","Byte length must be a number."),(0,ft.assert)(t>0,"Byte length must be greater than 0."),(0,ft.assert)(em(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()}be.signedBigIntToBytes=tm;function $u(e){(0,ft.assert)(typeof e=="number","Value must be a number."),(0,ft.assert)(e>=0,"Value must be a non-negative number."),(0,ft.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return us(t)}be.numberToBytes=$u;function Hu(e){return(0,ft.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}be.stringToBytes=Hu;function Wu(e){if(typeof e=="bigint")return Uu(e);if(typeof e=="number")return $u(e);if(typeof e=="string")return e.startsWith("0x")?us(e):Hu(e);if(ta(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}be.valueToBytes=Wu;function rm(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=Wu(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}be.concatBytes=rm;function nm(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)}be.createDataView=nm;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.ChecksumStruct=void 0;const Ac=Sr,im=Gn;hs.ChecksumStruct=(0,Ac.size)((0,im.base64)((0,Ac.string)(),{paddingRequired:!0}),44,44);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.createHex=Lt.createBytes=Lt.createBigInt=Lt.createNumber=void 0;const ze=Sr,sm=it,Vu=be,fs=Jn,qu=(0,ze.union)([(0,ze.number)(),(0,ze.bigint)(),(0,ze.string)(),fs.StrictHexStruct]),om=(0,ze.coerce)((0,ze.number)(),qu,Number),am=(0,ze.coerce)((0,ze.bigint)(),qu,BigInt);(0,ze.union)([fs.StrictHexStruct,(0,ze.instance)(Uint8Array)]);const cm=(0,ze.coerce)((0,ze.instance)(Uint8Array),(0,ze.union)([fs.StrictHexStruct]),Vu.hexToBytes),lm=(0,ze.coerce)(fs.StrictHexStruct,(0,ze.instance)(Uint8Array),Vu.bytesToHex);function um(e){try{const t=(0,ze.create)(e,om);return(0,sm.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}}Lt.createNumber=um;function hm(e){try{return(0,ze.create)(e,am)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Lt.createBigInt=hm;function fm(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,ze.create)(e,cm)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Lt.createBytes=fm;function dm(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,ze.create)(e,lm)}catch(t){throw t instanceof ze.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Lt.createHex=dm;var tn={},zu=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},at=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)},Et,At;Object.defineProperty(tn,"__esModule",{value:!0});tn.FrozenSet=tn.FrozenMap=void 0;class ra{constructor(t){Et.set(this,void 0),zu(this,Et,new Map(t),"f"),Object.freeze(this)}get size(){return at(this,Et,"f").size}[(Et=new WeakMap,Symbol.iterator)](){return at(this,Et,"f")[Symbol.iterator]()}entries(){return at(this,Et,"f").entries()}forEach(t,r){return at(this,Et,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return at(this,Et,"f").get(t)}has(t){return at(this,Et,"f").has(t)}keys(){return at(this,Et,"f").keys()}values(){return at(this,Et,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}tn.FrozenMap=ra;class na{constructor(t){At.set(this,void 0),zu(this,At,new Set(t),"f"),Object.freeze(this)}get size(){return at(this,At,"f").size}[(At=new WeakMap,Symbol.iterator)](){return at(this,At,"f")[Symbol.iterator]()}entries(){return at(this,At,"f").entries()}forEach(t,r){return at(this,At,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return at(this,At,"f").has(t)}keys(){return at(this,At,"f").keys()}values(){return at(this,At,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}tn.FrozenSet=na;Object.freeze(ra);Object.freeze(ra.prototype);Object.freeze(na);Object.freeze(na.prototype);var Gu={};Object.defineProperty(Gu,"__esModule",{value:!0});var Ju={};(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=Sr,r=it,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,z)=>{function te(Q,Y){const oe=[...Y.validator(Q,z)];return oe.length>0?oe:!0}try{const Q=te(j,e.UnsafeJsonStruct);return Q!==!0?Q:te(JSON.parse(JSON.stringify(j)),e.UnsafeJsonStruct)}catch(Q){return Q 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 z=JSON.stringify(j);return new TextEncoder().encode(z).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,z){(0,r.assertStruct)(j,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}e.assertIsJsonRpcNotification=a;function f(j){return(0,t.is)(j,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=f;function g(j,z){(0,r.assertStruct)(j,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}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 S(j,z){(0,r.assertStruct)(j,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}e.assertIsPendingJsonRpcResponse=S;function w(j){return(0,t.is)(j,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=w;function N(j,z){(0,r.assertStruct)(j,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}e.assertIsJsonRpcResponse=N;function U(j){return(0,t.is)(j,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=U;function F(j,z){(0,r.assertStruct)(j,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}e.assertIsJsonRpcSuccess=F;function H(j){return(0,t.is)(j,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=H;function k(j,z){(0,r.assertStruct)(j,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}e.assertIsJsonRpcFailure=k;function P(j){return(0,t.is)(j,e.JsonRpcErrorStruct)}e.isJsonRpcError=P;function O(j,z){(0,r.assertStruct)(j,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}e.assertIsJsonRpcError=O;function V(j){const{permitEmptyString:z,permitFractions:te,permitNull:Q}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},j);return de=>!!(typeof de=="number"&&(te||Number.isInteger(de))||typeof de=="string"&&(z||de.length>0)||Q&&de===null)}e.getJsonRpcIdValidator=V})(Ju);var Zu={};Object.defineProperty(Zu,"__esModule",{value:!0});var rn={},pm=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rn,"__esModule",{value:!0});rn.createModuleLogger=rn.createProjectLogger=void 0;const gm=pm(kh),ym=(0,gm.default)("metamask");function mm(e){return ym.extend(e)}rn.createProjectLogger=mm;function vm(e,t){return e.extend(t)}rn.createModuleLogger=vm;var Ku={};(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((w,N)=>c(N)?w+1:w+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})(Ku);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.hexToBigInt=Ot.hexToNumber=Ot.bigIntToHex=Ot.numberToHex=void 0;const Jr=it,_n=Jn,bm=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,_n.add0x)(e.toString(16)));Ot.numberToHex=bm;const wm=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,_n.add0x)(e.toString(16)));Ot.bigIntToHex=wm;const _m=e=>{(0,_n.assertIsHexString)(e);const t=parseInt(e,16);return(0,Jr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ot.hexToNumber=_m;const Em=e=>((0,_n.assertIsHexString)(e),BigInt((0,_n.add0x)(e)));Ot.hexToBigInt=Em;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});var Qu={};(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})(Qu);var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0});var eh={},Ao={exports:{}};const Sm="2.0.0",th=256,Rm=Number.MAX_SAFE_INTEGER||9007199254740991,Mm=16,Cm=th-6,Im=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ds={MAX_LENGTH:th,MAX_SAFE_COMPONENT_LENGTH:Mm,MAX_SAFE_BUILD_LENGTH:Cm,MAX_SAFE_INTEGER:Rm,RELEASE_TYPES:Im,SEMVER_SPEC_VERSION:Sm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},io={};const Am=typeof process=="object"&&io&&io.NODE_DEBUG&&/\bsemver\b/i.test(io.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var ps=Am;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ds,s=ps;t=e.exports={};const c=t.re=[],a=t.safeRe=[],f=t.src=[],g=t.safeSrc=[],p=t.t={};let S=0;const w="[a-zA-Z0-9-]",N=[["\\s",1],["\\d",i],[w,n]],U=H=>{for(const[k,P]of N)H=H.split(`${k}*`).join(`${k}{0,${P}}`).split(`${k}+`).join(`${k}{1,${P}}`);return H},F=(H,k,P)=>{const O=U(k),V=S++;s(H,V,k),p[H]=V,f[V]=k,g[V]=O,c[V]=new RegExp(k,P?"g":void 0),a[V]=new RegExp(O,P?"g":void 0)};F("NUMERICIDENTIFIER","0|[1-9]\\d*"),F("NUMERICIDENTIFIERLOOSE","\\d+"),F("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w}*`),F("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),F("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),F("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),F("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),F("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),F("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),F("BUILDIDENTIFIER",`${w}+`),F("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),F("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),F("FULL",`^${f[p.FULLPLAIN]}$`),F("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),F("LOOSE",`^${f[p.LOOSEPLAIN]}$`),F("GTLT","((?:<|>)?=?)"),F("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),F("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),F("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),F("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),F("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),F("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),F("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),F("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),F("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),F("COERCERTL",f[p.COERCE],!0),F("COERCERTLFULL",f[p.COERCEFULL],!0),F("LONETILDE","(?:~>?)"),F("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",F("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),F("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),F("LONECARET","(?:\\^)"),F("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",F("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),F("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),F("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),F("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),F("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",F("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),F("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),F("STAR","(<|>)?=?\\s*\\*"),F("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),F("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ao,Ao.exports);var Zn=Ao.exports;const km=Object.freeze({loose:!0}),xm=Object.freeze({}),Tm=e=>e?typeof e!="object"?km:e:xm;var ia=Tm;const kc=/^[0-9]+$/,rh=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=kc.test(e),n=kc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Bm=(e,t)=>rh(t,e);var nh={compareIdentifiers:rh,rcompareIdentifiers:Bm};const ci=ps,{MAX_LENGTH:xc,MAX_SAFE_INTEGER:li}=ds,{safeRe:ui,t:hi}=Zn,Nm=ia,{compareIdentifiers:so}=nh;let Pm=class kt{constructor(t,r){if(r=Nm(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>xc)throw new TypeError(`version is longer than ${xc} characters`);ci("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?ui[hi.LOOSE]:ui[hi.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>li||this.major<0)throw new TypeError("Invalid major version");if(this.minor>li||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>li||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<li)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(ci("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(ci("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 so(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(ci("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 so(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?ui[hi.PRERELEASELOOSE]:ui[hi.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]),so(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 Kn=Pm;const Tc=Kn,Lm=(e,t,r=!1)=>{if(e instanceof Tc)return e;try{return new Tc(e,t)}catch(n){if(!r)return null;throw n}};var Om=Lm;const Fm=Om,Dm=(e,t)=>{const r=Fm(e,t);return r?r.version:null};var jm=Dm;const Bc=Kn,Um=(e,t,r)=>new Bc(e,r).compare(new Bc(t,r));var fn=Um;const $m=fn,Hm=(e,t,r)=>$m(e,t,r)>0;var sa=Hm;const Wm=fn,Vm=(e,t,r)=>Wm(e,t,r)<0;var ih=Vm;const qm=fn,zm=(e,t,r)=>qm(e,t,r)===0;var Gm=zm;const Jm=fn,Zm=(e,t,r)=>Jm(e,t,r)!==0;var Km=Zm;const Ym=fn,Qm=(e,t,r)=>Ym(e,t,r)>=0;var sh=Qm;const Xm=fn,ev=(e,t,r)=>Xm(e,t,r)<=0;var oh=ev;const tv=Gm,rv=Km,nv=sa,iv=sh,sv=ih,ov=oh,av=(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 tv(e,r,n);case"!=":return rv(e,r,n);case">":return nv(e,r,n);case">=":return iv(e,r,n);case"<":return sv(e,r,n);case"<=":return ov(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var cv=av;const{safeRe:qw,t:zw}=Zn;class lv{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 uv=lv,oo,Nc;function Ct(){if(Nc)return oo;Nc=1;const e=/\s+/g;class t{constructor(d,m){if(m=i(m),d instanceof t)return d.loose===!!m.loose&&d.includePrerelease===!!m.includePrerelease?d:new t(d.raw,m);if(d instanceof s)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=m,this.loose=!!m.loose,this.includePrerelease=!!m.includePrerelease,this.raw=d.trim().replace(e," "),this.set=this.raw.split("||").map(v=>this.parseRange(v.trim())).filter(v=>v.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const v=this.set[0];if(this.set=this.set.filter(E=>!F(E[0])),this.set.length===0)this.set=[v];else if(this.set.length>1){for(const E of this.set)if(E.length===1&&H(E[0])){this.set=[E];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 m=this.set[d];for(let v=0;v<m.length;v++)v>0&&(this.formatted+=" "),this.formatted+=m[v].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const v=((this.options.includePrerelease&&N)|(this.options.loose&&U))+":"+d,E=n.get(v);if(E)return E;const I=this.options.loose,T=I?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],S),c("tilde trim",d),d=d.replace(f[g.CARETTRIM],w),c("caret trim",d);let b=d.split(" ").map(J=>P(J,this.options)).join(" ").split(/\s+/).map(J=>oe(J,this.options));I&&(b=b.filter(J=>(c("loose invalid filter",J,this.options),!!J.match(f[g.COMPARATORLOOSE])))),c("range list",b);const u=new Map,R=b.map(J=>new s(J,this.options));for(const J of R){if(F(J))return[J];u.set(J.value,J)}u.size>1&&u.has("")&&u.delete("");const K=[...u.values()];return n.set(v,K),K}intersects(d,m){if(!(d instanceof t))throw new TypeError("a Range is required");return this.set.some(v=>k(v,m)&&d.set.some(E=>k(E,m)&&v.every(I=>E.every(T=>I.intersects(T,m)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}for(let m=0;m<this.set.length;m++)if(A(this.set[m],d,this.options))return!0;return!1}}oo=t;const r=uv,n=new r,i=ia,s=gs(),c=ps,a=Kn,{safeRe:f,t:g,comparatorTrimReplace:p,tildeTrimReplace:S,caretTrimReplace:w}=Zn,{FLAG_INCLUDE_PRERELEASE:N,FLAG_LOOSE:U}=ds,F=o=>o.value==="<0.0.0-0",H=o=>o.value==="",k=(o,d)=>{let m=!0;const v=o.slice();let E=v.pop();for(;m&&v.length;)m=v.every(I=>E.intersects(I,d)),E=v.pop();return m},P=(o,d)=>(o=o.replace(f[g.BUILD],""),c("comp",o,d),o=z(o,d),c("caret",o),o=V(o,d),c("tildes",o),o=Q(o,d),c("xrange",o),o=de(o,d),c("stars",o),o),O=o=>!o||o.toLowerCase()==="x"||o==="*",V=(o,d)=>o.trim().split(/\s+/).map(m=>j(m,d)).join(" "),j=(o,d)=>{const m=d.loose?f[g.TILDELOOSE]:f[g.TILDE];return o.replace(m,(v,E,I,T,b)=>{c("tilde",o,v,E,I,T,b);let u;return O(E)?u="":O(I)?u=`>=${E}.0.0 <${+E+1}.0.0-0`:O(T)?u=`>=${E}.${I}.0 <${E}.${+I+1}.0-0`:b?(c("replaceTilde pr",b),u=`>=${E}.${I}.${T}-${b} <${E}.${+I+1}.0-0`):u=`>=${E}.${I}.${T} <${E}.${+I+1}.0-0`,c("tilde return",u),u})},z=(o,d)=>o.trim().split(/\s+/).map(m=>te(m,d)).join(" "),te=(o,d)=>{c("caret",o,d);const m=d.loose?f[g.CARETLOOSE]:f[g.CARET],v=d.includePrerelease?"-0":"";return o.replace(m,(E,I,T,b,u)=>{c("caret",o,E,I,T,b,u);let R;return O(I)?R="":O(T)?R=`>=${I}.0.0${v} <${+I+1}.0.0-0`:O(b)?I==="0"?R=`>=${I}.${T}.0${v} <${I}.${+T+1}.0-0`:R=`>=${I}.${T}.0${v} <${+I+1}.0.0-0`:u?(c("replaceCaret pr",u),I==="0"?T==="0"?R=`>=${I}.${T}.${b}-${u} <${I}.${T}.${+b+1}-0`:R=`>=${I}.${T}.${b}-${u} <${I}.${+T+1}.0-0`:R=`>=${I}.${T}.${b}-${u} <${+I+1}.0.0-0`):(c("no pr"),I==="0"?T==="0"?R=`>=${I}.${T}.${b}${v} <${I}.${T}.${+b+1}-0`:R=`>=${I}.${T}.${b}${v} <${I}.${+T+1}.0-0`:R=`>=${I}.${T}.${b} <${+I+1}.0.0-0`),c("caret return",R),R})},Q=(o,d)=>(c("replaceXRanges",o,d),o.split(/\s+/).map(m=>Y(m,d)).join(" ")),Y=(o,d)=>{o=o.trim();const m=d.loose?f[g.XRANGELOOSE]:f[g.XRANGE];return o.replace(m,(v,E,I,T,b,u)=>{c("xRange",o,v,E,I,T,b,u);const R=O(I),K=R||O(T),J=K||O(b),x=J;return E==="="&&x&&(E=""),u=d.includePrerelease?"-0":"",R?E===">"||E==="<"?v="<0.0.0-0":v="*":E&&x?(K&&(T=0),b=0,E===">"?(E=">=",K?(I=+I+1,T=0,b=0):(T=+T+1,b=0)):E==="<="&&(E="<",K?I=+I+1:T=+T+1),E==="<"&&(u="-0"),v=`${E+I}.${T}.${b}${u}`):K?v=`>=${I}.0.0${u} <${+I+1}.0.0-0`:J&&(v=`>=${I}.${T}.0${u} <${I}.${+T+1}.0-0`),c("xRange return",v),v})},de=(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,m,v,E,I,T,b,u,R,K,J,x)=>(O(v)?m="":O(E)?m=`>=${v}.0.0${o?"-0":""}`:O(I)?m=`>=${v}.${E}.0${o?"-0":""}`:T?m=`>=${m}`:m=`>=${m}${o?"-0":""}`,O(R)?u="":O(K)?u=`<${+R+1}.0.0-0`:O(J)?u=`<${R}.${+K+1}.0-0`:x?u=`<=${R}.${K}.${J}-${x}`:o?u=`<${R}.${K}.${+J+1}-0`:u=`<=${u}`,`${m} ${u}`.trim()),A=(o,d,m)=>{for(let v=0;v<o.length;v++)if(!o[v].test(d))return!1;if(d.prerelease.length&&!m.includePrerelease){for(let v=0;v<o.length;v++)if(c(o[v].semver),o[v].semver!==s.ANY&&o[v].semver.prerelease.length>0){const E=o[v].semver;if(E.major===d.major&&E.minor===d.minor&&E.patch===d.patch)return!0}return!1}return!0};return oo}var ao,Pc;function gs(){if(Pc)return ao;Pc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,S){if(S=r(S),p instanceof t){if(p.loose===!!S.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),c("comparator",p,S),this.options=S,this.loose=!!S.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(p){const S=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],w=p.match(S);if(!w)throw new TypeError(`Invalid comparator: ${p}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new a(w[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,S){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new f(p.value,S).test(this.value):p.operator===""?p.value===""?!0:new f(this.value,S).test(p.semver):(S=r(S),S.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!S.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,S)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,S)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}ao=t;const r=ia,{safeRe:n,t:i}=Zn,s=cv,c=ps,a=Kn,f=Ct();return ao}const hv=Ct(),fv=(e,t,r)=>{try{t=new hv(t,r)}catch{return!1}return t.test(e)};var ah=fv;Ct();Ct();Ct();Ct();const dv=Ct(),pv=(e,t)=>{try{return new dv(e,t).range||"*"}catch{return null}};var gv=pv;const yv=Kn,ch=gs(),{ANY:mv}=ch,vv=Ct(),bv=ah,Lc=sa,Oc=ih,wv=oh,_v=sh,Ev=(e,t,r,n)=>{e=new yv(e,n),t=new vv(t,n);let i,s,c,a,f;switch(r){case">":i=Lc,s=wv,c=Oc,a=">",f=">=";break;case"<":i=Oc,s=_v,c=Lc,a="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(bv(e,t,n))return!1;for(let g=0;g<t.set.length;++g){const p=t.set[g];let S=null,w=null;if(p.forEach(N=>{N.semver===mv&&(N=new ch(">=0.0.0")),S=S||N,w=w||N,i(N.semver,S.semver,n)?S=N:c(N.semver,w.semver,n)&&(w=N)}),S.operator===a||S.operator===f||(!w.operator||w.operator===a)&&s(e,w.semver))return!1;if(w.operator===f&&c(e,w.semver))return!1}return!0};var Sv=Ev;const Rv=Sv,Mv=(e,t,r)=>Rv(e,t,">",r);var Cv=Mv;Ct();Ct();const oa=gs(),{ANY:Gw}=oa;new oa(">=0.0.0-0");new oa(">=0.0.0");const co=Zn,Fc=ds,Dc=nh,Iv=jm,Av=sa;gs();Ct();const kv=ah,xv=gv,Tv=Cv;var Bv={valid:Iv,gt:Av,satisfies:kv,validRange:xv,gtr:Tv,re:co.re,src:co.src,tokens:co.t,SEMVER_SPEC_VERSION:Fc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Fc.RELEASE_TYPES,compareIdentifiers:Dc.compareIdentifiers,rcompareIdentifiers:Dc.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=Bv,r=Sr,n=it;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",S=>(0,t.valid)(S)===null?`Expected SemVer version, got "${S}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",S=>(0,t.validRange)(S)===null?`Expected SemVer range, got "${S}"`:!0);function i(S){return(0,r.is)(S,e.VersionStruct)}e.isValidSemVerVersion=i;function s(S){return(0,r.is)(S,e.VersionRangeStruct)}e.isValidSemVerRange=s;function c(S){(0,n.assertStruct)(S,e.VersionStruct)}e.assertIsSemVerVersion=c;function a(S){(0,n.assertStruct)(S,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function f(S,w){return(0,t.gt)(S,w)}e.gtVersion=f;function g(S,w){return(0,t.gtr)(S,w)}e.gtRange=g;function p(S,w){return(0,t.satisfies)(S,w,{includePrerelease:!0})}e.satisfiesVersionRange=p})(eh);(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(it,e),r(Gn,e),r(be,e),r(hs,e),r(Lt,e),r(tn,e),r(Gu,e),r(Jn,e),r(Ju,e),r(Zu,e),r(rn,e),r(Ku,e),r(Ot,e),r(Yu,e),r(Qu,e),r(Xu,e),r(eh,e)})(Au);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Au;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Iu);var lh=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ls,"__esModule",{value:!0});ls.PollingBlockTracker=void 0;const Nv=lh(Zo),Pv=lh(q1),Lv=Wn,jc=Iu,Uc=(0,jc.createModuleLogger)(jc.projectLogger,"polling-block-tracker"),Ov=(0,Nv.default)(),Fv=1e3;class Dv extends Lv.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*Fv,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=$c(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=$c(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:Ov(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Uc("Making request",t);const r=await(0,Pv.default)(n=>this._provider.sendAsync(t,n))();if(Uc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
9
|
-
${r.error.message}`);return r.result}}ls.PollingBlockTracker=Dv;function $c(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var ys={},jv=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ys,"__esModule",{value:!0});ys.SubscribeBlockTracker=void 0;const Uv=jv(Zo),$v=Wn,Hv=(0,Uv.default)();class Wv extends $v.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:Hv(),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)}}ys.SubscribeBlockTracker=Wv;(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(ls,e),r(ys,e)})(Cu);var aa={},ms={},Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getUniqueId=void 0;const uh=4294967295;let lo=Math.floor(Math.random()*uh);function Vv(){return lo=(lo+1)%uh,lo}Yn.getUniqueId=Vv;Object.defineProperty(ms,"__esModule",{value:!0});ms.createIdRemapMiddleware=void 0;const qv=Yn;function zv(){return(e,t,r,n)=>{const i=e.id,s=qv.getUniqueId();e.id=s,t.id=s,r(c=>{e.id=i,t.id=i,c()})}}ms.createIdRemapMiddleware=zv;var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.createAsyncMiddleware=void 0;function Gv(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)}}}vs.createAsyncMiddleware=Gv;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.createScaffoldMiddleware=void 0;function Jv(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())}}bs.createScaffoldMiddleware=Jv;var Qn={},ca={};Object.defineProperty(ca,"__esModule",{value:!0});const Zv=ki;function Hc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Kv(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Yv=class extends Zv.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")Hc(s,this,r);else{const c=s.length,a=Kv(s);for(let f=0;f<c;f+=1)Hc(a[f],this,r)}return!0}};ca.default=Yv;var hh={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.EthereumProviderError=zt.EthereumRpcError=void 0;const Qv=xh;class fh 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 Qv.default(this.serialize(),tb,2)}}zt.EthereumRpcError=fh;class Xv extends fh{constructor(t,r,n){if(!eb(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}zt.EthereumProviderError=Xv;function eb(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function tb(e,t){if(t!=="[Circular]")return t}var la={},Gt={};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.errorValues=Gt.errorCodes=void 0;Gt.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}};Gt.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=Gt,r=zt,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(w,N=i){if(Number.isInteger(w)){const U=w.toString();if(S(t.errorValues,U))return t.errorValues[U].message;if(g(w))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return N}e.getMessageFromCode=c;function a(w){if(!Number.isInteger(w))return!1;const N=w.toString();return!!(t.errorValues[N]||g(w))}e.isValidCode=a;function f(w,{fallbackError:N=s,shouldIncludeStack:U=!1}={}){var F,H;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(w instanceof r.EthereumRpcError)return w.serialize();const k={};if(w&&typeof w=="object"&&!Array.isArray(w)&&S(w,"code")&&a(w.code)){const O=w;k.code=O.code,O.message&&typeof O.message=="string"?(k.message=O.message,S(O,"data")&&(k.data=O.data)):(k.message=c(k.code),k.data={originalError:p(w)})}else{k.code=N.code;const O=(F=w)===null||F===void 0?void 0:F.message;k.message=O&&typeof O=="string"?O:N.message,k.data={originalError:p(w)}}const P=(H=w)===null||H===void 0?void 0:H.stack;return U&&w&&P&&typeof P=="string"&&(k.stack=P),k}e.serializeError=f;function g(w){return w>=-32099&&w<=-32e3}function p(w){return w&&typeof w=="object"&&!Array.isArray(w)?Object.assign({},w):w}function S(w,N){return Object.prototype.hasOwnProperty.call(w,N)}})(la);var ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.ethErrors=void 0;const ua=zt,dh=la,st=Gt;ws.ethErrors={rpc:{parse:e=>gt(st.errorCodes.rpc.parse,e),invalidRequest:e=>gt(st.errorCodes.rpc.invalidRequest,e),invalidParams:e=>gt(st.errorCodes.rpc.invalidParams,e),methodNotFound:e=>gt(st.errorCodes.rpc.methodNotFound,e),internal:e=>gt(st.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 gt(t,e)},invalidInput:e=>gt(st.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>gt(st.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>gt(st.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>gt(st.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>gt(st.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>gt(st.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>pn(st.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>pn(st.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>pn(st.errorCodes.provider.unsupportedMethod,e),disconnected:e=>pn(st.errorCodes.provider.disconnected,e),chainDisconnected:e=>pn(st.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 ua.EthereumProviderError(t,r,n)}}};function gt(e,t){const[r,n]=ph(t);return new ua.EthereumRpcError(e,r||dh.getMessageFromCode(e),n)}function pn(e,t){const[r,n]=ph(t);return new ua.EthereumProviderError(e,r||dh.getMessageFromCode(e),n)}function ph(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=zt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=la;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=ws;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Gt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(hh);var rb=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.JsonRpcEngine=void 0;const nb=rb(ca),yt=hh;class Ft extends nb.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 Ft._runAllMiddleware(t,r,this._middleware);return c?(await Ft._runReturnHandlers(a),i(s)):n(async f=>{try{await Ft._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 yt.EthereumRpcError(yt.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 yt.EthereumRpcError(yt.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=yt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Ft._runAllMiddleware(t,r,this._middleware);if(Ft._checkForCompletion(t,r,i),await Ft._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 Ft._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=yt.serializeError(g)),s([g,!0])},a=f=>{r.error?c(r.error):(f&&(typeof f!="function"&&c(new yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof f}" for request:
|
|
10
|
-
${uo(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 yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
11
|
-
${uo(t)}`,{request:t});if(!n)throw new yt.EthereumRpcError(yt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
12
|
-
${uo(t)}`,{request:t})}}Qn.JsonRpcEngine=Ft;function uo(e){return JSON.stringify(e,null,2)}var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.mergeMiddleware=void 0;const ib=Qn;function sb(e){const t=new ib.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}_s.mergeMiddleware=sb;(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(ms,e),r(vs,e),r(bs,e),r(Yn,e),r(Qn,e),r(_s,e)})(aa);var gh={},ha={};const fa=En(wh);var Es={};Object.defineProperty(Es,"__esModule",{value:!0});var Wc=fa,ob=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 Wc.__awaiter(this,void 0,void 0,function(){var r,n,i;return Wc.__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}();Es.default=ob;Object.defineProperty(ha,"__esModule",{value:!0});var Vc=fa,ab=Es,cb=function(){function e(){this._semaphore=new ab.default(1)}return e.prototype.acquire=function(){return Vc.__awaiter(this,void 0,void 0,function(){var t,r;return Vc.__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}();ha.default=cb;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.withTimeout=void 0;var fi=fa;function lb(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return fi.__awaiter(n,void 0,void 0,function(){var c,a,f;return fi.__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 fi.__awaiter(this,void 0,void 0,function(){var s,c;return fi.__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()}}}Ss.withTimeout=lb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ha;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Es;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Ss;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(gh);var ub=fb,hb=Object.prototype.hasOwnProperty;function fb(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)hb.call(r,n)&&(e[n]=r[n])}return e}const db=ub,pb=Zo();var gb=ce;function ce(e){const t=this;t.currentProvider=e}ce.prototype.getBalance=Xn(2,"eth_getBalance");ce.prototype.getCode=Xn(2,"eth_getCode");ce.prototype.getTransactionCount=Xn(2,"eth_getTransactionCount");ce.prototype.getStorageAt=Xn(3,"eth_getStorageAt");ce.prototype.call=Xn(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(yb(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 Xn(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 yb(e){return db({id:pb(),jsonrpc:"2.0",params:[]},e)}const qc=(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)})},zc=new WeakMap;var mb=(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=zc.get(c);if(f||(f={},zc.set(c,f)),a in f)return f[a];const g=U=>typeof U=="string"||typeof a=="symbol"?a===U:U.test(a),p=Reflect.getOwnPropertyDescriptor(c,a),S=p===void 0||p.writable||p.configurable,N=(t.include?t.include.some(g):!t.exclude.some(g))&&S;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:qc(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=qc(f,t,s,c);return i.set(f,p),p}return f}});return s};const vb=Vn.default;let bb=class extends vb{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 da=bb;const wb=da;let _b=class extends wb{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 Eb=_b,ei={minBlockRef:Sb,bnToHex:Mb,blockRefIsNumber:Cb,hexToInt:Ai,incrementHexInt:Ib,intToHex:yh,unsafeRandomBytes:Ab};function Sb(...e){return Rb(e)[0]}function Rb(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Ai(t)-Ai(r))}function Mb(e){return"0x"+e.toString(16)}function Cb(e){return e&&!["earliest","latest","pending"].includes(e)}function Ai(e){return e==null?e:Number.parseInt(e,16)}function Ib(e){if(e==null)return e;const t=Ai(e);return yh(t+1)}function yh(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Ab(e){let t="0x";for(let r=0;r<e;r++)t+=Gc(),t+=Gc();return t}function Gc(){return Math.floor(Math.random()*16).toString(16)}const kb=gb,xb=mb,Tb=Eb,{bnToHex:Yw,hexToInt:di,incrementHexInt:Bb,minBlockRef:Nb,blockRefIsNumber:Pb}=ei;let Lb=class extends Tb{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new kb(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=Nb(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=Bb(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 xb(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(di(this.params.fromBlock)>=di(t.blockNumber)||Pb(this.params.toBlock)&&di(this.params.toBlock)<=di(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 Ob=Lb,pa=Fb;async function Fb({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=Jc(t),s=Jc(r)-n+1,c=Array(s).fill().map((f,g)=>n+g).map(Db);let a=await Promise.all(c.map(f=>Ub(e,"eth_getBlockByNumber",[f,!1])));return a=a.filter(f=>f!==null),a}function Jc(e){return e==null?e:Number.parseInt(e,16)}function Db(e){return e==null?e:"0x"+e.toString(16)}function jb(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 Ub(e,t,r){for(let n=0;n<3;n++)try{return await jb(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 $b=da,Hb=pa,{incrementHexInt:Wb}=ei;let Vb=class extends $b{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=Wb(t),c=(await Hb({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(c)}};var qb=Vb;const zb=da,Gb=pa,{incrementHexInt:Jb}=ei;let Zb=class extends zb{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Jb(t),i=await Gb({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const c of i)s.push(...c.transactions);this.addResults(s)}};var Kb=Zb;const Yb=gh.Mutex,{createAsyncMiddleware:Qb,createScaffoldMiddleware:Xb}=aa,ew=Ob,tw=qb,rw=Kb,{intToHex:mh,hexToInt:ho}=ei;var nw=iw;function iw({blockTracker:e,provider:t}){let r=0,n={};const i=new Yb,s=sw({mutex:i}),c=Xb({eth_newFilter:s(fo(f)),eth_newBlockFilter:s(fo(g)),eth_newPendingTransactionFilter:s(fo(p)),eth_uninstallFilter:s(_i(N)),eth_getFilterChanges:s(_i(S)),eth_getFilterLogs:s(_i(w))}),a=async({oldBlock:P,newBlock:O})=>{if(n.length===0)return;const V=await i.acquire();try{await Promise.all(jr(n).map(async j=>{try{await j.update({oldBlock:P,newBlock:O})}catch(z){console.error(z)}}))}catch(j){console.error(j)}V()};return c.newLogFilter=f,c.newBlockFilter=g,c.newPendingTransactionFilter=p,c.uninstallFilter=N,c.getFilterChanges=S,c.getFilterLogs=w,c.destroy=()=>{H()},c;async function f(P){const O=new ew({provider:t,params:P});return await U(O),O}async function g(){const P=new tw({provider:t});return await U(P),P}async function p(){const P=new rw({provider:t});return await U(P),P}async function S(P){const O=ho(P),V=n[O];if(!V)throw new Error(`No filter for index "${O}"`);return V.getChangesAndClear()}async function w(P){const O=ho(P),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(P){const O=ho(P),j=!!n[O];return j&&await F(O),j}async function U(P){const O=jr(n).length,V=await e.getLatestBlock();await P.initialize({currentBlock:V}),r++,n[r]=P,P.id=r,P.idHex=mh(r);const j=jr(n).length;return k({prevFilterCount:O,newFilterCount:j}),r}async function F(P){const O=jr(n).length;delete n[P];const V=jr(n).length;k({prevFilterCount:O,newFilterCount:V})}async function H(){const P=jr(n).length;n={},k({prevFilterCount:P,newFilterCount:0})}function k({prevFilterCount:P,newFilterCount:O}){if(P===0&&O>0){e.on("sync",a);return}if(P>0&&O===0){e.removeListener("sync",a);return}}}function fo(e){return _i(async(...t)=>{const r=await e(...t);return mh(r.id)})}function _i(e){return Qb(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function sw({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function jr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const ow=Vn.default,{createAsyncMiddleware:Zc,createScaffoldMiddleware:aw}=aa,cw=nw,{unsafeRandomBytes:lw,incrementHexInt:uw}=ei,hw=pa;var fw=dw;function dw({blockTracker:e,provider:t}){const r={},n=cw({blockTracker:e,provider:t});let i=!1;const s=new ow,c=aw({eth_subscribe:Zc(a),eth_unsubscribe:Zc(f)});return c.destroy=p,{events:s,middleware:c};async function a(S,w){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const N=S.params[0],U=lw(16);let F;switch(N){case"newHeads":F=H({subId:U});break;case"logs":const P=S.params[1],O=await n.newLogFilter(P);F=k({subId:U,filter:O});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${N}"`)}r[U]=F,w.result=U;return;function H({subId:P}){const O={type:N,destroy:async()=>{e.removeListener("sync",O.update)},update:async({oldBlock:V,newBlock:j})=>{const z=j,te=uw(V);(await hw({provider:t,fromBlock:te,toBlock:z})).map(pw).filter(de=>de!==null).forEach(de=>{g(P,de)})}};return e.on("sync",O.update),O}function k({subId:P,filter:O}){return O.on("update",j=>g(P,j)),{type:N,destroy:async()=>await n.uninstallFilter(O.idHex)}}}async function f(S,w){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const N=S.params[0],U=r[N];if(!U){w.result=!1;return}delete r[N],await U.destroy(),w.result=!0}function g(S,w){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:S,result:w}})}function p(){s.removeAllListeners();for(const S in r)r[S].destroy(),delete r[S];i=!0}}function pw(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(cs,"__esModule",{value:!0});cs.SubscriptionManager=void 0;const gw=Cu,yw=fw,Kc=()=>{};class mw{constructor(t){const r=new gw.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=yw({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Kc,Kc),r}destroy(){this.subscriptionMiddleware.destroy()}}cs.SubscriptionManager=mw;var vh=ee&&ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.CoinbaseWalletProvider=void 0;const vw=vh(Ni),bw=Eh,me=An,fe=X,ww=Bn,Yc=vt,pi=an,ut=nn,po=vh(U1),gn=on,_w=en,Ew=cs,Qc="DefaultChainId",Xc="DefaultJsonRpcUrl";class Sw extends bw.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new _w.FilterPolyfill(this),this._subscriptionManager=new Ew.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,fe.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const c=this._storage.getItem(Yc.LOCAL_STORAGE_ADDRESSES_KEY);if(c){const a=c.split(" ");a[0]!==""&&(this._addresses=a.map(f=>(0,fe.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,fe.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(Xc))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Xc,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(Qc,r.toString(10)),((0,fe.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==null?void 0:c.toString()).promise;return(0,ut.isErrorResponse)(f)?!1:!!f.result}async addEthereumChain(t,r,n,i,s,c){var a,f;if((0,fe.ensureIntNumber)(t)===this.getChainId())return!1;const g=await this.initializeRelay(),p=g.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await g.requestEthereumAccounts().promise;const S=await g.addEthereumChain(t.toString(),r,s,n,i,c).promise;return(0,ut.isErrorResponse)(S)?!1:(((a=S.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((f=S.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,ut.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(gn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?pi.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,fe.ensureRegExpString)(t)).promise;if((0,ut.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,ut.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(gn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?pi.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof ww.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ut.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,ut.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,fe.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Yc.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(gn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?pi.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,fe.ensureAddressString)(t);return this._addresses.map(i=>(0,fe.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(gn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,fe.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,fe.ensureAddressString)(t.to):null,i=t.value!=null?(0,fe.ensureBN)(t.value):new vw.default(0),s=t.data?(0,fe.ensureBuffer)(t.data):Buffer.alloc(0),c=t.nonce!=null?(0,fe.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,fe.ensureBN)(t.gasPrice):null,f=t.maxFeePerGas!=null?(0,fe.ensureBN)(t.maxFeePerGas):null,g=t.maxPriorityFeePerGas!=null?(0,fe.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,fe.ensureBN)(t.gas):null,S=t.chainId?(0,fe.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:S}}_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,ut.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,ut.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,fe.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Qc);if(!t)return(0,fe.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,fe.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(gn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?pi.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,ut.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,fe.ensureBuffer)(t[0]),n=(0,fe.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,ut.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,fe.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ut.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,ut.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,fe.ensureParsedJSONObject)(t[0]),n=(0,fe.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=po.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=po.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,fe.ensureAddressString)(t[0]),n=(0,fe.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=po.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==null?void 0:r.type)!=="ERC20")throw me.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw me.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&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,fe.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,fe.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,fe.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))}}Kr.CoinbaseWalletProvider=Sw;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.RelayEventManager=void 0;const Rw=X;class Mw{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,Rw.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Rs.RelayEventManager=Mw;Object.defineProperty(bn,"__esModule",{value:!0});bn.CoinbaseWalletSDK=void 0;const Cw=Ti,Iw=Bi,el=X,Aw=Di,kw=Kr,xw=Bn,Tw=Hn,Bw=Rs,Nw=jn,Pw=Nn,bh=sn;class Ms{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||Iw.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 Aw.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Ms.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new Bw.RelayEventManager;const f=(0,el.isMobileWeb)(),g=t.uiConstructor||(S=>f?new Tw.MobileRelayUI(S):new Nw.WalletLinkRelayUI(S)),p={linkAPIUrl:s,version:bh.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 xw.MobileRelay(p):new Pw.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 kw.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,el.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,Cw.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}}bn.CoinbaseWalletSDK=Ms;Ms.VERSION=bh.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=bn,r=Kr;var n=bn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Kr;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)})(Lo);const Lw=_h(Lo),t2=Mh({__proto__:null,default:Lw},[Lo]);export{t2 as i};
|