@wormhole-foundation/wormhole-connect 4.1.0-beta.0-development → 4.2.0-beta.0-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/{aptos-C9pj8h2Q.js → aptos-DgUCX7ng.js} +3 -3
- package/dist/assets/{evm-DCydYqBI.js → evm-B6bqAPTR.js} +4 -4
- package/dist/assets/{evm-CJXv6IQV.js → evm-Ve5nG8Fs.js} +1 -1
- package/dist/assets/{index-LvDsy6wR.js → index-BJokXZAc.js} +1 -1
- package/dist/assets/{index-BqxX-Ey7.js → index-BJv9sngo.js} +1 -1
- package/dist/assets/{index-C9cy4cDs.js → index-BjZMFLjq.js} +1 -1
- package/dist/assets/{index-FJ-n91Op.js → index-BwbPlAQZ.js} +1 -1
- package/dist/assets/{index-Clu5I99l.js → index-Bzg4DNh9.js} +1 -1
- package/dist/assets/{index-ezhfpCvx.js → index-CKXa657f.js} +1 -1
- package/dist/assets/index-CXiuP738.js +1 -0
- package/dist/assets/{index-CNExx9Zb.js → index-CvTvoHH-.js} +1 -1
- package/dist/assets/{index-C25bHdOM.js → index-D1ULRVbZ.js} +1 -1
- package/dist/assets/{index-DpabQJOX.js → index-DlH9IMQl.js} +1 -1
- package/dist/assets/{index-C8u74RER.js → index-Dsb-5apv.js} +1 -1
- package/dist/assets/{index-D9ApKauA.js → index-_YFUWLUM.js} +1 -1
- package/dist/assets/{index-CoIvdDsX.js → index-jg26xdEi.js} +1 -1
- package/dist/assets/{provider-jsonrpc-DuMpLBV0.js → provider-jsonrpc-DNgUKjG6.js} +1 -1
- package/dist/assets/{solana-DWuIx6gK.js → solana-D4RepnSA.js} +2 -2
- package/dist/assets/{sui-BcTGBE_4.js → sui-Du5h-f8S.js} +3 -3
- package/dist/main.mjs +185 -140
- package/dist/src/components/ConfigurablePageHeader.d.ts +1 -1
- package/dist/src/components/ConfigurablePageHeader.d.ts.map +1 -1
- package/dist/src/components/Header.d.ts +1 -0
- package/dist/src/components/Header.d.ts.map +1 -1
- package/dist/src/components/PageHeader.d.ts +1 -3
- package/dist/src/components/PageHeader.d.ts.map +1 -1
- package/dist/src/components/SampleApp/index.d.ts.map +1 -1
- package/dist/src/components/v3/BackButton.d.ts +6 -0
- package/dist/src/components/v3/BackButton.d.ts.map +1 -0
- package/dist/src/components/v3/FormContent.d.ts +5 -0
- package/dist/src/components/v3/FormContent.d.ts.map +1 -0
- package/dist/src/config/constants.d.ts.map +1 -1
- package/dist/src/config/events.d.ts +2 -1
- package/dist/src/config/events.d.ts.map +1 -1
- package/dist/src/config/mainnet/chains.d.ts.map +1 -1
- package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
- package/dist/src/config/mainnet/wrappedTokens.d.ts +6 -0
- package/dist/src/config/mainnet/wrappedTokens.d.ts.map +1 -1
- package/dist/src/config/testnet/chains.d.ts.map +1 -1
- package/dist/src/config/testnet/rpcs.d.ts.map +1 -1
- package/dist/src/config/testnet/tokens.d.ts.map +1 -1
- package/dist/src/config/types.d.ts +6 -11
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/config/ui.d.ts +9 -0
- package/dist/src/config/ui.d.ts.map +1 -1
- package/dist/src/consts/wallet.d.ts.map +1 -1
- package/dist/src/hooks/useAutoEnableGasDropoff.d.ts +3 -1
- package/dist/src/hooks/useAutoEnableGasDropoff.d.ts.map +1 -1
- package/dist/src/hooks/useConnectToLastUsedWallet.d.ts.map +1 -1
- package/dist/src/hooks/useSortedRoutesWithQuotes.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryLiFi.d.ts +2 -0
- package/dist/src/hooks/useTransactionHistoryLiFi.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryMayan.d.ts +2 -0
- package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/dist/src/hooks/useTransactionHistoryWHScan.d.ts +2 -1
- package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/dist/src/icons/PoweredBy.d.ts.map +1 -1
- package/dist/src/icons/TokenIcons.d.ts.map +1 -1
- package/dist/src/icons/Tokens/AUSD.d.ts +4 -0
- package/dist/src/icons/Tokens/AUSD.d.ts.map +1 -0
- package/dist/src/routes/lifi/LiFiRoute.d.ts.map +1 -1
- package/dist/src/routes/mayan/utils.d.ts.map +1 -1
- package/dist/src/routes/monad/consts.d.ts +1 -0
- package/dist/src/routes/monad/consts.d.ts.map +1 -1
- package/dist/src/routes/monad/monad.test.d.ts +1 -0
- package/dist/src/routes/monad/monad.test.d.ts.map +1 -0
- package/dist/src/routes/monad/utils.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/dist/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/dist/src/telemetry/types.d.ts +4 -2
- package/dist/src/telemetry/types.d.ts.map +1 -1
- package/dist/src/theme.d.ts +4 -3
- package/dist/src/theme.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/utils/fees.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/sdkv2.d.ts.map +1 -1
- package/dist/src/utils/wallet/index.d.ts +1 -0
- package/dist/src/utils/wallet/index.d.ts.map +1 -1
- package/dist/src/views/Terms.d.ts.map +1 -1
- package/dist/src/views/TxSearch.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts +17 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts +8 -0
- package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts +2 -0
- package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts +2 -0
- package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/Routes/index.d.ts +2 -1
- package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts +9 -0
- package/dist/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/WalletConnector/WalletPickerContent.d.ts.map +1 -1
- package/dist/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts +2 -0
- package/dist/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts.map +1 -0
- package/dist/src/views/v3/Bridge/index.d.ts.map +1 -1
- package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/dist/src/views/v3/Redeem/index.d.ts.map +1 -1
- package/dist/src/views/v3/TxHistory/Item/index.d.ts.map +1 -1
- package/dist/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -1
- package/lib/{account-cIQhxn1E.js → account-K005OXgL.js} +1 -1
- package/lib/{account-BVl6Reot.mjs → account-TXlxMyv4.mjs} +2 -2
- package/lib/{address-rVHWlcKQ.mjs → address-CX0E32ut.mjs} +1 -1
- package/lib/{address-W9jn6Qdk.js → address-DqbIfKOu.js} +1 -1
- package/lib/{aptos-BRApiL_4.mjs → aptos-B1Gf2eCD.mjs} +5 -5
- package/lib/{aptos-CNHYHK9c.js → aptos-CnswqE-C.js} +2 -2
- package/lib/{aptos-D1WFzBMy.mjs → aptos-DRfXJ8Ba.mjs} +7 -7
- package/lib/{aptos-d56Mw8DO.js → aptos-DcdKyekw.js} +1 -1
- package/lib/{associatedTokenAccount-C4vEEbG5.js → associatedTokenAccount-CeqdaO2m.js} +1 -1
- package/lib/{associatedTokenAccount-DF6phO3l.mjs → associatedTokenAccount-Dsm4Hq32.mjs} +3 -3
- package/lib/{basic-BxzNlZH2.js → basic-BS7Z1PMG.js} +1 -1
- package/lib/{basic-Bj1RjRlj.js → basic-C6VXQ7m-.js} +1 -1
- package/lib/{basic-DR75AlQZ.mjs → basic-CFbslwLM.mjs} +3 -3
- package/lib/{basic-DjAbnFVK.mjs → basic-DnhL0oWa.mjs} +3 -3
- package/lib/{chunk-KJH4KKG6-Brt4fyqz.mjs → chunk-KJH4KKG6-BfVMUPsB.mjs} +3 -3
- package/lib/{chunk-KJH4KKG6-BbF5W1_N.js → chunk-KJH4KKG6-CJx-rDa6.js} +1 -1
- package/lib/constants-BCFTvlgh.js +1 -0
- package/lib/{constants-PWEvTwIh.mjs → constants-CTJ_-E0d.mjs} +5 -4
- package/lib/{core-CkIseV8K.mjs → core-DT6TBPQP.mjs} +6 -6
- package/lib/{core-CCO0WKg_.js → core-RRp0K__1.js} +3 -3
- package/lib/{create-CChLkbGc.mjs → create-C5dhTMHL.mjs} +1 -1
- package/lib/{create-4w0DrcRO.js → create-bA3Gyivs.js} +1 -1
- package/lib/{evm-BAU31wxF.js → evm-BwCfQIyJ.js} +2 -2
- package/lib/{evm-CMxUV_bG.mjs → evm-BxF9XPn4.mjs} +7 -7
- package/lib/{evm-9NnChBii.js → evm-C3B8jHD7.js} +1 -1
- package/lib/{evm-2dSclZz6.mjs → evm-DlOCiplA.mjs} +5 -5
- package/lib/executor.js +1 -1
- package/lib/executor.mjs +13 -15
- package/lib/hosted.js +1 -1
- package/lib/hosted.mjs +1 -1
- package/lib/hypercore-DbqOAqKF.js +4 -0
- package/lib/{hypercore-Bmlyd4uI.mjs → hypercore-H7pw_pN4.mjs} +4858 -3107
- package/lib/{index-qL4D-cpk.js → index-1T4sIL8n.js} +1 -1
- package/lib/{index-Ap7250Gf.mjs → index-39tU5Y5t.mjs} +6 -6
- package/lib/{index-D7gCsil9.js → index-6m7yero0.js} +1 -1
- package/lib/{index-C5I7QiZ7.mjs → index-B6Ppg6EZ.mjs} +3 -3
- package/lib/{index-xvG6cxNx.js → index-BEIFBxtP.js} +1 -1
- package/lib/{index-zIzzPp6D.mjs → index-BHpJUZne.mjs} +3 -3
- package/lib/{index-CS6YnwIH.js → index-BJ0xVutl.js} +1 -1
- package/lib/{index-DUyGY36L.js → index-BNpkgexR.js} +1 -1
- package/lib/{index-C61IKE_V.mjs → index-BSIPYyeZ.mjs} +2 -2
- package/lib/{index-EbSw7SbC.js → index-BTjUHY0e.js} +1 -1
- package/lib/{index-BuHdMHLz.mjs → index-Ba1zbu3Q.mjs} +2 -2
- package/lib/{index-CPGWCfWD.js → index-BbE02hdW.js} +8 -8
- package/lib/{index-BU35GfG0.mjs → index-Bdtj4LUz.mjs} +2 -2
- package/lib/{index-BCKX-m7h.mjs → index-BmP0jPVN.mjs} +12 -11
- package/lib/{index-hyk_rzOj.mjs → index-BnKf2rOm.mjs} +3246 -3039
- package/lib/{index-Ds7-hb1n.mjs → index-BtU67kjy.mjs} +1 -1
- package/lib/{index-Cl9Df47-.mjs → index-BuEKhdrW.mjs} +3 -3
- package/lib/{index-CN7M4gwf.mjs → index-BviSNDV7.mjs} +5 -5
- package/lib/{index-Cys9e11O.js → index-C-SMuVS3.js} +1 -1
- package/lib/{index-Cg1Xo1eZ.js → index-C85u3Gj5.js} +1 -1
- package/lib/{index-arjwwpj2.mjs → index-CGqJokTg.mjs} +1 -1
- package/lib/{index-Da9rvmCc.js → index-Cb0UWLGI.js} +1 -1
- package/lib/{index-DHnmtpvA.mjs → index-CcbY14s5.mjs} +4 -4
- package/lib/{index-BKgliEPZ.mjs → index-CrWTw0Se.mjs} +2 -2
- package/lib/{index-B16yfCYF.mjs → index-CsLyPoC6.mjs} +4 -4
- package/lib/{index-B_JJ50Y-.mjs → index-D-HUNEka.mjs} +4 -4
- package/lib/index-DAJZN12d.js +1 -0
- package/lib/{index-BhMcIAHt.js → index-DJ2w1fz1.js} +1 -1
- package/lib/{index-C5j1HoFr.js → index-DVm_f5E1.js} +1 -1
- package/lib/{index-CO4ZoIAU.mjs → index-DjmVBSGQ.mjs} +4 -4
- package/lib/{index-Co3mm7UN.mjs → index-DrJE8udd.mjs} +1 -1
- package/lib/{index-fTUcaKb4.js → index-DuhYwr0t.js} +1 -1
- package/lib/{index-BQ0lWQfT.mjs → index-DwEx1Hn-.mjs} +2 -2
- package/lib/{index-DBofyYkS.js → index-DziujHu1.js} +1 -1
- package/lib/{index-Dou5sFku.js → index-JWbF-m3e.js} +1 -1
- package/lib/{index-_IZO0QRl.mjs → index-NAUBlFLG.mjs} +4 -4
- package/lib/{index-D1odbjeH.mjs → index-VnJcNK62.mjs} +3 -3
- package/lib/{index-DVxmRy4C.js → index-WrXSs0ic.js} +1 -1
- package/lib/{index-CsdD1TNi.js → index-aMKUba1k.js} +1 -1
- package/lib/{index-BXsTZ9x_.mjs → index-dufPAW5T.mjs} +298 -267
- package/lib/{index-lZY5fTXF.js → index-lAqXlt-a.js} +1 -1
- package/lib/{index-cRi8si5A.js → index-mikg85u5.js} +1 -1
- package/lib/{index-BScgBddV.mjs → index-o1SAPXm_.mjs} +3 -3
- package/lib/{index-CZHdN9pg.js → index-pn6NZmOS.js} +1 -1
- package/lib/{index-DNZ-Pkpm.mjs → index-rxQSA9t0.mjs} +6 -6
- package/lib/{index-CHvWl09c.js → index-t_koRpGi.js} +1 -1
- package/lib/{index-DALvn9lg.js → index-v7w8krM0.js} +1 -1
- package/lib/{index-japympio.js → index-wadjmD_G.js} +1 -1
- package/lib/{index.es-BC9c-IV7.mjs → index.es-3KAM8l3G.mjs} +4 -4
- package/lib/{index.es-DxdcaWwJ.js → index.es-B3FwsRfN.js} +3 -3
- package/lib/{index.es-ByyzusUN.mjs → index.es-CYyuSfPG.mjs} +4 -4
- package/lib/{index.es-BmZ1Eaml.js → index.es-ClIr5Gv-.js} +1 -1
- package/lib/index.js +78 -33
- package/lib/index.mjs +9157 -8833
- package/lib/{keypair-DWucLGoA.js → keypair-DCgXFOw5.js} +1 -1
- package/lib/{keypair-CP7syX9B.mjs → keypair-vpG2fl-q.mjs} +3 -3
- package/lib/lifi.js +1 -1
- package/lib/lifi.mjs +75 -76
- package/lib/mayan.js +2 -2
- package/lib/mayan.mjs +11 -10
- package/lib/{mint-CoNdQTGM.mjs → mint-BPrKG-Zc.mjs} +3 -3
- package/lib/{mint-CxQ6P5lT.js → mint-DW-XgF68.js} +1 -1
- package/lib/monad.js +1 -1
- package/lib/monad.mjs +91 -58
- package/lib/multiToken-B9BoSxdr.js +1 -0
- package/lib/{multiToken-Bm-K5dRJ.mjs → multiToken-DMllgxzT.mjs} +4 -3
- package/lib/ntt.js +2 -2
- package/lib/ntt.mjs +77 -86
- package/lib/{platform-Cil_UtAQ.mjs → platform-CSpAb386.mjs} +2788 -2748
- package/lib/{platform-BMKYxqvv.js → platform-Csj1Outc.js} +1 -1
- package/lib/platform-DCcL7jHP.js +11 -0
- package/lib/{platform-vRQufc6j.mjs → platform-YzJZdSCf.mjs} +3 -3
- package/lib/{secp256k1-D24BZJAq.js → secp256k1-B2G0zB-5.js} +1 -1
- package/lib/{secp256k1-CXRI4XfW.mjs → secp256k1-BZFiBDHQ.mjs} +1 -1
- package/lib/{secp256k1-r0ke-jeG.js → secp256k1-Bz-QjKBU.js} +1 -1
- package/lib/{secp256k1-rufcCDcw.mjs → secp256k1-Cteng3v9.mjs} +1 -1
- package/lib/{secp256k1-BLiUzGcX.js → secp256k1-CxjctkO3.js} +1 -1
- package/lib/{secp256k1-ZQ8UIhmk.mjs → secp256k1-D3i7kc2M.mjs} +1 -1
- package/lib/{signer-0hWrZ5BZ.mjs → signer-D2GRgRrw.mjs} +2 -2
- package/lib/{signer-DyqulDUM.js → signer-gjSiV5v3.js} +1 -1
- package/lib/{solana-CXtk3UX1.js → solana-BE2DAanS.js} +4 -4
- package/lib/{solana-lhrSUH_P.mjs → solana-Df231Yni.mjs} +10 -10
- package/lib/solana-DfW5T_64.mjs +18 -0
- package/lib/solana-Edd9tIkX.js +1 -0
- package/lib/{solanaEmbed.esm-CFu0h50b.mjs → solanaEmbed.esm-B9WG-Afi.mjs} +4 -4
- package/lib/{solanaEmbed.esm-BMynjubZ.js → solanaEmbed.esm-BqcrHrhl.js} +1 -1
- package/lib/{solidity-CbDkqHjE.js → solidity-BW7c8rFv.js} +1 -1
- package/lib/{solidity-Dk_mvceo.mjs → solidity-D9gSgFcp.mjs} +1 -1
- package/lib/src/components/ConfigurablePageHeader.d.ts +1 -1
- package/lib/src/components/ConfigurablePageHeader.d.ts.map +1 -1
- package/lib/src/components/Header.d.ts +1 -0
- package/lib/src/components/Header.d.ts.map +1 -1
- package/lib/src/components/PageHeader.d.ts +1 -3
- package/lib/src/components/PageHeader.d.ts.map +1 -1
- package/lib/src/components/SampleApp/index.d.ts.map +1 -1
- package/lib/src/components/v3/BackButton.d.ts +6 -0
- package/lib/src/components/v3/BackButton.d.ts.map +1 -0
- package/lib/src/components/v3/FormContent.d.ts +5 -0
- package/lib/src/components/v3/FormContent.d.ts.map +1 -0
- package/lib/src/config/constants.d.ts.map +1 -1
- package/lib/src/config/events.d.ts +2 -1
- package/lib/src/config/events.d.ts.map +1 -1
- package/lib/src/config/mainnet/chains.d.ts.map +1 -1
- package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
- package/lib/src/config/mainnet/wrappedTokens.d.ts +6 -0
- package/lib/src/config/mainnet/wrappedTokens.d.ts.map +1 -1
- package/lib/src/config/testnet/chains.d.ts.map +1 -1
- package/lib/src/config/testnet/rpcs.d.ts.map +1 -1
- package/lib/src/config/testnet/tokens.d.ts.map +1 -1
- package/lib/src/config/types.d.ts +6 -11
- package/lib/src/config/types.d.ts.map +1 -1
- package/lib/src/config/ui.d.ts +9 -0
- package/lib/src/config/ui.d.ts.map +1 -1
- package/lib/src/consts/wallet.d.ts.map +1 -1
- package/lib/src/hooks/useAutoEnableGasDropoff.d.ts +3 -1
- package/lib/src/hooks/useAutoEnableGasDropoff.d.ts.map +1 -1
- package/lib/src/hooks/useConnectToLastUsedWallet.d.ts.map +1 -1
- package/lib/src/hooks/useSortedRoutesWithQuotes.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistory.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryLiFi.d.ts +2 -0
- package/lib/src/hooks/useTransactionHistoryLiFi.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryMayan.d.ts +2 -0
- package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
- package/lib/src/hooks/useTransactionHistoryWHScan.d.ts +2 -1
- package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
- package/lib/src/icons/PoweredBy.d.ts.map +1 -1
- package/lib/src/icons/TokenIcons.d.ts.map +1 -1
- package/lib/src/icons/Tokens/AUSD.d.ts +4 -0
- package/lib/src/icons/Tokens/AUSD.d.ts.map +1 -0
- package/lib/src/routes/lifi/LiFiRoute.d.ts.map +1 -1
- package/lib/src/routes/mayan/utils.d.ts.map +1 -1
- package/lib/src/routes/monad/consts.d.ts +1 -0
- package/lib/src/routes/monad/consts.d.ts.map +1 -1
- package/lib/src/routes/monad/monad.test.d.ts +1 -0
- package/lib/src/routes/monad/monad.test.d.ts.map +1 -0
- package/lib/src/routes/monad/utils.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
- package/lib/src/sdklegacy/config/TESTNET.d.ts.map +1 -1
- package/lib/src/telemetry/types.d.ts +4 -2
- package/lib/src/telemetry/types.d.ts.map +1 -1
- package/lib/src/theme.d.ts +4 -3
- package/lib/src/theme.d.ts.map +1 -1
- package/lib/src/utils/errors.d.ts.map +1 -1
- package/lib/src/utils/fees.d.ts.map +1 -1
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/sdkv2.d.ts.map +1 -1
- package/lib/src/utils/wallet/index.d.ts +1 -0
- package/lib/src/utils/wallet/index.d.ts.map +1 -1
- package/lib/src/views/Terms.d.ts.map +1 -1
- package/lib/src/views/TxSearch.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts +17 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts +8 -0
- package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts +2 -0
- package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts +2 -0
- package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/Routes/index.d.ts +2 -1
- package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts +9 -0
- package/lib/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/WalletConnector/WalletPickerContent.d.ts.map +1 -1
- package/lib/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts +2 -0
- package/lib/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts.map +1 -0
- package/lib/src/views/v3/Bridge/index.d.ts.map +1 -1
- package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
- package/lib/src/views/v3/Redeem/index.d.ts.map +1 -1
- package/lib/src/views/v3/TxHistory/Item/index.d.ts.map +1 -1
- package/lib/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -1
- package/lib/{sui-CZNJPZ5q.mjs → sui-B9tYcgyb.mjs} +4 -4
- package/lib/{sui-CBxh7zmc.js → sui-BVwNcgQT.js} +1 -1
- package/lib/{sui-LiXjD27c.js → sui-BtyZE8YC.js} +1 -1
- package/lib/{sui-cpCvd7RC.mjs → sui-QP4AZGNc.mjs} +6 -6
- package/lib/{tokenHelpers-DT6mPtNP.mjs → tokenHelpers-C53sepsl.mjs} +1 -1
- package/lib/{tokenHelpers-DZRdlDO-.js → tokenHelpers-DITWDel1.js} +1 -1
- package/lib/{tokens-FIs8YBYj.mjs → tokens-CO0YQ3R2.mjs} +3 -3
- package/lib/{tokens--uOMY2-j.js → tokens-CiSHS7oi.js} +1 -1
- package/lib/types-CgveSjsw.js +1 -0
- package/lib/{types-iFgwQ7vG.mjs → types-Dxx2g1wS.mjs} +170 -168
- package/lib/{unsignedTransaction-DCDxTFq8.mjs → unsignedTransaction-D2Ja0SuN.mjs} +2 -2
- package/lib/{unsignedTransaction-DA4tlY5u.js → unsignedTransaction-qRBv5Cnd.js} +2 -2
- package/lib/{utils-DMf7wRGI.js → utils-BEljbqMf.js} +1 -1
- package/lib/{utils-BSxsyW2c.mjs → utils-mBHX3Jpu.mjs} +4 -4
- package/lib/{w3m-modal-CBYJj-sR.mjs → w3m-modal-5v-rsnN8.mjs} +2 -2
- package/lib/{w3m-modal-B3FfPDki.js → w3m-modal-B0Lu-6W8.js} +1 -1
- package/lib/{w3m-modal-B5PtkowQ.js → w3m-modal-B2xHxAWg.js} +1 -1
- package/lib/{w3m-modal-h85Jyy9l.mjs → w3m-modal-SlcSCSnx.mjs} +2 -2
- package/lib/{wallet-CMTEE6Oa.mjs → wallet-Cyosy4Hc.mjs} +1 -1
- package/lib/{wallet-BMli0fbu.js → wallet-a0_jwP8j.js} +1 -1
- package/lib/{web3-CUwFm9Lx.mjs → web3-CdErAVj5.mjs} +2 -2
- package/lib/{web3-DdUeM7iQ.js → web3-x1WCGDiy.js} +1 -1
- package/package.json +49 -47
- package/dist/assets/index-_UMHESh0.js +0 -1
- package/dist/src/components/Button.d.ts +0 -13
- package/dist/src/components/Button.d.ts.map +0 -1
- package/dist/src/icons/Down.d.ts +0 -5
- package/dist/src/icons/Down.d.ts.map +0 -1
- package/lib/constants-Bkyn6tLV.js +0 -1
- package/lib/hypercore-DJV-pPts.js +0 -4
- package/lib/index-BYuhx88C.js +0 -1
- package/lib/multiToken-YoNvxjur.js +0 -1
- package/lib/platform-CCG_jgOO.js +0 -11
- package/lib/solana-DKFJvqX8.mjs +0 -18
- package/lib/solana-Dmje_Si8.js +0 -1
- package/lib/src/components/Button.d.ts +0 -13
- package/lib/src/components/Button.d.ts.map +0 -1
- package/lib/src/icons/Down.d.ts +0 -5
- package/lib/src/icons/Down.d.ts.map +0 -1
- package/lib/types-CjNs2oB0.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qe=require("./platform-CCG_jgOO.js"),xe=require("./unsignedTransaction-DA4tlY5u.js"),rr=require("./index-CPGWCfWD.js"),ta=require("./index.es-BmZ1Eaml.js");require("./index-BxM99sFL.js");var ra=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,on=Math.ceil,Ve=Math.floor,We="[BigNumber Error] ",Ai=We+"Number primitive has more than 15 significant digits: ",et=1e14,pe=14,sn=9007199254740991,an=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],wt=1e7,Ce=1e9;function Ho(r){var e,t,n,i=c.prototype={constructor:c,toString:null,valueOf:null},s=new c(1),o=20,l=4,d=-7,w=21,N=-1e7,O=1e7,I=!1,k=1,B=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",u=!0;function c(a,m){var f,g,_,h,C,p,A,P,E=this;if(!(E instanceof c))return new c(a,m);if(m==null){if(a&&a._isBigNumber===!0){E.s=a.s,!a.c||a.e>O?E.c=E.e=null:a.e<N?E.c=[E.e=0]:(E.e=a.e,E.c=a.c.slice());return}if((p=typeof a=="number")&&a*0==0){if(E.s=1/a<0?(a=-a,-1):1,a===~~a){for(h=0,C=a;C>=10;C/=10,h++);h>O?E.c=E.e=null:(E.e=h,E.c=[a]);return}P=String(a)}else{if(!ra.test(P=String(a)))return n(E,P,p);E.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(h=P.indexOf("."))>-1&&(P=P.replace(".","")),(C=P.search(/e/i))>0?(h<0&&(h=C),h+=+P.slice(C+1),P=P.substring(0,C)):h<0&&(h=P.length)}else{if(Re(m,2,b.length,"Base"),m==10&&u)return E=new c(a),J(E,o+E.e+1,l);if(P=String(a),p=typeof a=="number"){if(a*0!=0)return n(E,P,p,m);if(E.s=1/a<0?(P=P.slice(1),-1):1,c.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Ai+a)}else E.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(f=b.slice(0,m),h=C=0,A=P.length;C<A;C++)if(f.indexOf(g=P.charAt(C))<0){if(g=="."){if(C>h){h=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,C=-1,h=0;continue}return n(E,String(a),p,m)}p=!1,P=t(P,m,10,E.s),(h=P.indexOf("."))>-1?P=P.replace(".",""):h=P.length}for(C=0;P.charCodeAt(C)===48;C++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(C,++A)){if(A-=C,p&&c.DEBUG&&A>15&&(a>sn||a!==Ve(a)))throw Error(Ai+E.s*a);if((h=h-C-1)>O)E.c=E.e=null;else if(h<N)E.c=[E.e=0];else{if(E.e=h,E.c=[],C=(h+1)%pe,h<0&&(C+=pe),C<A){for(C&&E.c.push(+P.slice(0,C)),A-=pe;C<A;)E.c.push(+P.slice(C,C+=pe));C=pe-(P=P.slice(C)).length}else C-=A;for(;C--;P+="0");E.c.push(+P)}}else E.c=[E.e=0]}c.clone=Ho,c.ROUND_UP=0,c.ROUND_DOWN=1,c.ROUND_CEIL=2,c.ROUND_FLOOR=3,c.ROUND_HALF_UP=4,c.ROUND_HALF_DOWN=5,c.ROUND_HALF_EVEN=6,c.ROUND_HALF_CEIL=7,c.ROUND_HALF_FLOOR=8,c.EUCLID=9,c.config=c.set=function(a){var m,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(m="DECIMAL_PLACES")&&(f=a[m],Re(f,0,Ce,m),o=f),a.hasOwnProperty(m="ROUNDING_MODE")&&(f=a[m],Re(f,0,8,m),l=f),a.hasOwnProperty(m="EXPONENTIAL_AT")&&(f=a[m],f&&f.pop?(Re(f[0],-Ce,0,m),Re(f[1],0,Ce,m),d=f[0],w=f[1]):(Re(f,-Ce,Ce,m),d=-(w=f<0?-f:f))),a.hasOwnProperty(m="RANGE"))if(f=a[m],f&&f.pop)Re(f[0],-Ce,-1,m),Re(f[1],1,Ce,m),N=f[0],O=f[1];else if(Re(f,-Ce,Ce,m),f)N=-(O=f<0?-f:f);else throw Error(We+m+" cannot be zero: "+f);if(a.hasOwnProperty(m="CRYPTO"))if(f=a[m],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))I=f;else throw I=!f,Error(We+"crypto unavailable");else I=f;else throw Error(We+m+" not true or false: "+f);if(a.hasOwnProperty(m="MODULO_MODE")&&(f=a[m],Re(f,0,9,m),k=f),a.hasOwnProperty(m="POW_PRECISION")&&(f=a[m],Re(f,0,Ce,m),B=f),a.hasOwnProperty(m="FORMAT"))if(f=a[m],typeof f=="object")y=f;else throw Error(We+m+" not an object: "+f);if(a.hasOwnProperty(m="ALPHABET"))if(f=a[m],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))u=f.slice(0,10)=="0123456789",b=f;else throw Error(We+m+" invalid: "+f)}else throw Error(We+"Object expected: "+a);return{DECIMAL_PLACES:o,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,w],RANGE:[N,O],CRYPTO:I,MODULO_MODE:k,POW_PRECISION:B,FORMAT:y,ALPHABET:b}},c.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!c.DEBUG)return!0;var m,f,g=a.c,_=a.e,h=a.s;e:if({}.toString.call(g)=="[object Array]"){if((h===1||h===-1)&&_>=-Ce&&_<=Ce&&_===Ve(_)){if(g[0]===0){if(_===0&&g.length===1)return!0;break e}if(m=(_+1)%pe,m<1&&(m+=pe),String(g[0]).length==m){for(m=0;m<g.length;m++)if(f=g[m],f<0||f>=et||f!==Ve(f))break e;if(f!==0)return!0}}}else if(g===null&&_===null&&(h===null||h===1||h===-1))return!0;throw Error(We+"Invalid BigNumber: "+a)},c.maximum=c.max=function(){return G(arguments,-1)},c.minimum=c.min=function(){return G(arguments,1)},c.random=(function(){var a=9007199254740992,m=Math.random()*a&2097151?function(){return Ve(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var g,_,h,C,p,A=0,P=[],E=new c(s);if(f==null?f=o:Re(f,0,Ce),C=on(f/pe),I)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(C*=2));A<C;)p=g[A]*131072+(g[A+1]>>>11),p>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),g[A]=_[0],g[A+1]=_[1]):(P.push(p%1e14),A+=2);A=C/2}else if(crypto.randomBytes){for(g=crypto.randomBytes(C*=7);A<C;)p=(g[A]&31)*281474976710656+g[A+1]*1099511627776+g[A+2]*4294967296+g[A+3]*16777216+(g[A+4]<<16)+(g[A+5]<<8)+g[A+6],p>=9e15?crypto.randomBytes(7).copy(g,A):(P.push(p%1e14),A+=7);A=C/7}else throw I=!1,Error(We+"crypto unavailable");if(!I)for(;A<C;)p=m(),p<9e15&&(P[A++]=p%1e14);for(C=P[--A],f%=pe,C&&f&&(p=an[pe-f],P[A]=Ve(C/p)*p);P[A]===0;P.pop(),A--);if(A<0)P=[h=0];else{for(h=-1;P[0]===0;P.splice(0,1),h-=pe);for(A=1,p=P[0];p>=10;p/=10,A++);A<pe&&(h-=pe-A)}return E.e=h,E.c=P,E}})(),c.sum=function(){for(var a=1,m=arguments,f=new c(m[0]);a<m.length;)f=f.plus(m[a++]);return f},t=(function(){var a="0123456789";function m(f,g,_,h){for(var C,p=[0],A,P=0,E=f.length;P<E;){for(A=p.length;A--;p[A]*=g);for(p[0]+=h.indexOf(f.charAt(P++)),C=0;C<p.length;C++)p[C]>_-1&&(p[C+1]==null&&(p[C+1]=0),p[C+1]+=p[C]/_|0,p[C]%=_)}return p.reverse()}return function(f,g,_,h,C){var p,A,P,E,M,S,j,K,W=f.indexOf("."),ee=o,Q=l;for(W>=0&&(E=B,B=0,f=f.replace(".",""),K=new c(g),S=K.pow(f.length-W),B=E,K.c=m(lt(ze(S.c),S.e,"0"),10,_,a),K.e=K.c.length),j=m(f,g,_,C?(p=b,a):(p=a,b)),P=E=j.length;j[--E]==0;j.pop());if(!j[0])return p.charAt(0);if(W<0?--P:(S.c=j,S.e=P,S.s=h,S=e(S,K,ee,Q,_),j=S.c,M=S.r,P=S.e),A=P+ee+1,W=j[A],E=_/2,M=M||A<0||j[A+1]!=null,M=Q<4?(W!=null||M)&&(Q==0||Q==(S.s<0?3:2)):W>E||W==E&&(Q==4||M||Q==6&&j[A-1]&1||Q==(S.s<0?8:7)),A<1||!j[0])f=M?lt(p.charAt(1),-ee,p.charAt(0)):p.charAt(0);else{if(j.length=A,M)for(--_;++j[--A]>_;)j[A]=0,A||(++P,j=[1].concat(j));for(E=j.length;!j[--E];);for(W=0,f="";W<=E;f+=p.charAt(j[W++]));f=lt(f,P,p.charAt(0))}return f}})(),e=(function(){function a(g,_,h){var C,p,A,P,E=0,M=g.length,S=_%wt,j=_/wt|0;for(g=g.slice();M--;)A=g[M]%wt,P=g[M]/wt|0,C=j*A+P*S,p=S*A+C%wt*wt+E,E=(p/h|0)+(C/wt|0)+j*P,g[M]=p%h;return E&&(g=[E].concat(g)),g}function m(g,_,h,C){var p,A;if(h!=C)A=h>C?1:-1;else for(p=A=0;p<h;p++)if(g[p]!=_[p]){A=g[p]>_[p]?1:-1;break}return A}function f(g,_,h,C){for(var p=0;h--;)g[h]-=p,p=g[h]<_[h]?1:0,g[h]=p*C+g[h]-_[h];for(;!g[0]&&g.length>1;g.splice(0,1));}return function(g,_,h,C,p){var A,P,E,M,S,j,K,W,ee,Q,le,ue,z,V,oe,ce,fe,L=g.s==_.s?1:-1,D=g.c,F=_.c;if(!D||!D[0]||!F||!F[0])return new c(!g.s||!_.s||(D?F&&D[0]==F[0]:!F)?NaN:D&&D[0]==0||!F?L*0:L/0);for(W=new c(L),ee=W.c=[],P=g.e-_.e,L=h+P+1,p||(p=et,P=Ke(g.e/pe)-Ke(_.e/pe),L=L/pe|0),E=0;F[E]==(D[E]||0);E++);if(F[E]>(D[E]||0)&&P--,L<0)ee.push(1),M=!0;else{for(V=D.length,ce=F.length,E=0,L+=2,S=Ve(p/(F[0]+1)),S>1&&(F=a(F,S,p),D=a(D,S,p),ce=F.length,V=D.length),z=ce,Q=D.slice(0,ce),le=Q.length;le<ce;Q[le++]=0);fe=F.slice(),fe=[0].concat(fe),oe=F[0],F[1]>=p/2&&oe++;do{if(S=0,A=m(F,Q,ce,le),A<0){if(ue=Q[0],ce!=le&&(ue=ue*p+(Q[1]||0)),S=Ve(ue/oe),S>1)for(S>=p&&(S=p-1),j=a(F,S,p),K=j.length,le=Q.length;m(j,Q,K,le)==1;)S--,f(j,ce<K?fe:F,K,p),K=j.length,A=1;else S==0&&(A=S=1),j=F.slice(),K=j.length;if(K<le&&(j=[0].concat(j)),f(Q,j,le,p),le=Q.length,A==-1)for(;m(F,Q,ce,le)<1;)S++,f(Q,ce<le?fe:F,le,p),le=Q.length}else A===0&&(S++,Q=[0]);ee[E++]=S,Q[0]?Q[le++]=D[z]||0:(Q=[D[z]],le=1)}while((z++<V||Q[0]!=null)&&L--);M=Q[0]!=null,ee[0]||ee.splice(0,1)}if(p==et){for(E=1,L=ee[0];L>=10;L/=10,E++);J(W,h+(W.e=E+P*pe-1)+1,C,M)}else W.e=P,W.r=+M;return W}})();function v(a,m,f,g){var _,h,C,p,A;if(f==null?f=l:Re(f,0,8),!a.c)return a.toString();if(_=a.c[0],C=a.e,m==null)A=ze(a.c),A=g==1||g==2&&(C<=d||C>=w)?Sr(A,C):lt(A,C,"0");else if(a=J(new c(a),m,f),h=a.e,A=ze(a.c),p=A.length,g==1||g==2&&(m<=h||h<=d)){for(;p<m;A+="0",p++);A=Sr(A,h)}else if(m-=C+(g===2&&h>C),A=lt(A,h,"0"),h+1>p){if(--m>0)for(A+=".";m--;A+="0");}else if(m+=h-p,m>0)for(h+1==p&&(A+=".");m--;A+="0");return a.s<0&&_?"-"+A:A}function G(a,m){for(var f,g,_=1,h=new c(a[0]);_<a.length;_++)g=new c(a[_]),(!g.s||(f=Rt(h,g))===m||f===0&&h.s===m)&&(h=g);return h}function $(a,m,f){for(var g=1,_=m.length;!m[--_];m.pop());for(_=m[0];_>=10;_/=10,g++);return(f=g+f*pe-1)>O?a.c=a.e=null:f<N?a.c=[a.e=0]:(a.e=f,a.c=m),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,f=/^\.([^.]+)$/,g=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(h,C,p,A){var P,E=p?C:C.replace(_,"");if(g.test(E))h.s=isNaN(E)?null:E<0?-1:1;else{if(!p&&(E=E.replace(a,function(M,S,j){return P=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!A||A==P?S:M}),A&&(P=A,E=E.replace(m,"$1").replace(f,"0.$1")),C!=E))return new c(E,P);if(c.DEBUG)throw Error(We+"Not a"+(A?" base "+A:"")+" number: "+C);h.s=null}h.c=h.e=null}})();function J(a,m,f,g){var _,h,C,p,A,P,E,M=a.c,S=an;if(M){e:{for(_=1,p=M[0];p>=10;p/=10,_++);if(h=m-_,h<0)h+=pe,C=m,A=M[P=0],E=Ve(A/S[_-C-1]%10);else if(P=on((h+1)/pe),P>=M.length)if(g){for(;M.length<=P;M.push(0));A=E=0,_=1,h%=pe,C=h-pe+1}else break e;else{for(A=p=M[P],_=1;p>=10;p/=10,_++);h%=pe,C=h-pe+_,E=C<0?0:Ve(A/S[_-C-1]%10)}if(g=g||m<0||M[P+1]!=null||(C<0?A:A%S[_-C-1]),g=f<4?(E||g)&&(f==0||f==(a.s<0?3:2)):E>5||E==5&&(f==4||g||f==6&&(h>0?C>0?A/S[_-C]:0:M[P-1])%10&1||f==(a.s<0?8:7)),m<1||!M[0])return M.length=0,g?(m-=a.e+1,M[0]=S[(pe-m%pe)%pe],a.e=-m||0):M[0]=a.e=0,a;if(h==0?(M.length=P,p=1,P--):(M.length=P+1,p=S[pe-h],M[P]=C>0?Ve(A/S[_-C]%S[C])*p:0),g)for(;;)if(P==0){for(h=1,C=M[0];C>=10;C/=10,h++);for(C=M[0]+=p,p=1;C>=10;C/=10,p++);h!=p&&(a.e++,M[0]==et&&(M[0]=1));break}else{if(M[P]+=p,M[P]!=et)break;M[P--]=0,p=1}for(h=M.length;M[--h]===0;M.pop());}a.e>O?a.c=a.e=null:a.e<N&&(a.c=[a.e=0])}return a}function X(a){var m,f=a.e;return f===null?a.toString():(m=ze(a.c),m=f<=d||f>=w?Sr(m,f):lt(m,f,"0"),a.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var a=new c(this);return a.s<0&&(a.s=1),a},i.comparedTo=function(a,m){return Rt(this,new c(a,m))},i.decimalPlaces=i.dp=function(a,m){var f,g,_,h=this;if(a!=null)return Re(a,0,Ce),m==null?m=l:Re(m,0,8),J(new c(h),a+h.e+1,m);if(!(f=h.c))return null;if(g=((_=f.length-1)-Ke(this.e/pe))*pe,_=f[_])for(;_%10==0;_/=10,g--);return g<0&&(g=0),g},i.dividedBy=i.div=function(a,m){return e(this,new c(a,m),o,l)},i.dividedToIntegerBy=i.idiv=function(a,m){return e(this,new c(a,m),0,1)},i.exponentiatedBy=i.pow=function(a,m){var f,g,_,h,C,p,A,P,E,M=this;if(a=new c(a),a.c&&!a.isInteger())throw Error(We+"Exponent not an integer: "+X(a));if(m!=null&&(m=new c(m)),p=a.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!a.c||!a.c[0])return E=new c(Math.pow(+X(M),p?a.s*(2-Er(a)):+X(a))),m?E.mod(m):E;if(A=a.s<0,m){if(m.c?!m.c[0]:!m.s)return new c(NaN);g=!A&&M.isInteger()&&m.isInteger(),g&&(M=M.mod(m))}else{if(a.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||p&&M.c[1]>=24e7:M.c[0]<8e13||p&&M.c[0]<=9999975e7)))return h=M.s<0&&Er(a)?-0:0,M.e>-1&&(h=1/h),new c(A?1/h:h);B&&(h=on(B/pe+2))}for(p?(f=new c(.5),A&&(a.s=1),P=Er(a)):(_=Math.abs(+X(a)),P=_%2),E=new c(s);;){if(P){if(E=E.times(M),!E.c)break;h?E.c.length>h&&(E.c.length=h):g&&(E=E.mod(m))}if(_){if(_=Ve(_/2),_===0)break;P=_%2}else if(a=a.times(f),J(a,a.e+1,1),a.e>14)P=Er(a);else{if(_=+X(a),_===0)break;P=_%2}M=M.times(M),h?M.c&&M.c.length>h&&(M.c.length=h):g&&(M=M.mod(m))}return g?E:(A&&(E=s.div(E)),m?E.mod(m):h?J(E,B,l,C):E)},i.integerValue=function(a){var m=new c(this);return a==null?a=l:Re(a,0,8),J(m,m.e+1,a)},i.isEqualTo=i.eq=function(a,m){return Rt(this,new c(a,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(a,m){return Rt(this,new c(a,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(a,m){return(m=Rt(this,new c(a,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Ke(this.e/pe)>this.c.length-2},i.isLessThan=i.lt=function(a,m){return Rt(this,new c(a,m))<0},i.isLessThanOrEqualTo=i.lte=function(a,m){return(m=Rt(this,new c(a,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(a,m){var f,g,_,h,C=this,p=C.s;if(a=new c(a,m),m=a.s,!p||!m)return new c(NaN);if(p!=m)return a.s=-m,C.plus(a);var A=C.e/pe,P=a.e/pe,E=C.c,M=a.c;if(!A||!P){if(!E||!M)return E?(a.s=-m,a):new c(M?C:NaN);if(!E[0]||!M[0])return M[0]?(a.s=-m,a):new c(E[0]?C:l==3?-0:0)}if(A=Ke(A),P=Ke(P),E=E.slice(),p=A-P){for((h=p<0)?(p=-p,_=E):(P=A,_=M),_.reverse(),m=p;m--;_.push(0));_.reverse()}else for(g=(h=(p=E.length)<(m=M.length))?p:m,p=m=0;m<g;m++)if(E[m]!=M[m]){h=E[m]<M[m];break}if(h&&(_=E,E=M,M=_,a.s=-a.s),m=(g=M.length)-(f=E.length),m>0)for(;m--;E[f++]=0);for(m=et-1;g>p;){if(E[--g]<M[g]){for(f=g;f&&!E[--f];E[f]=m);--E[f],E[g]+=et}E[g]-=M[g]}for(;E[0]==0;E.splice(0,1),--P);return E[0]?$(a,E,P):(a.s=l==3?-1:1,a.c=[a.e=0],a)},i.modulo=i.mod=function(a,m){var f,g,_=this;return a=new c(a,m),!_.c||!a.s||a.c&&!a.c[0]?new c(NaN):!a.c||_.c&&!_.c[0]?new c(_):(k==9?(g=a.s,a.s=1,f=e(_,a,0,3),a.s=g,f.s*=g):f=e(_,a,0,k),a=_.minus(f.times(a)),!a.c[0]&&k==1&&(a.s=_.s),a)},i.multipliedBy=i.times=function(a,m){var f,g,_,h,C,p,A,P,E,M,S,j,K,W,ee,Q=this,le=Q.c,ue=(a=new c(a,m)).c;if(!le||!ue||!le[0]||!ue[0])return!Q.s||!a.s||le&&!le[0]&&!ue||ue&&!ue[0]&&!le?a.c=a.e=a.s=null:(a.s*=Q.s,!le||!ue?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(g=Ke(Q.e/pe)+Ke(a.e/pe),a.s*=Q.s,A=le.length,M=ue.length,A<M&&(K=le,le=ue,ue=K,_=A,A=M,M=_),_=A+M,K=[];_--;K.push(0));for(W=et,ee=wt,_=M;--_>=0;){for(f=0,S=ue[_]%ee,j=ue[_]/ee|0,C=A,h=_+C;h>_;)P=le[--C]%ee,E=le[C]/ee|0,p=j*P+E*S,P=S*P+p%ee*ee+K[h]+f,f=(P/W|0)+(p/ee|0)+j*E,K[h--]=P%W;K[h]=f}return f?++g:K.splice(0,1),$(a,K,g)},i.negated=function(){var a=new c(this);return a.s=-a.s||null,a},i.plus=function(a,m){var f,g=this,_=g.s;if(a=new c(a,m),m=a.s,!_||!m)return new c(NaN);if(_!=m)return a.s=-m,g.minus(a);var h=g.e/pe,C=a.e/pe,p=g.c,A=a.c;if(!h||!C){if(!p||!A)return new c(_/0);if(!p[0]||!A[0])return A[0]?a:new c(p[0]?g:_*0)}if(h=Ke(h),C=Ke(C),p=p.slice(),_=h-C){for(_>0?(C=h,f=A):(_=-_,f=p),f.reverse();_--;f.push(0));f.reverse()}for(_=p.length,m=A.length,_-m<0&&(f=A,A=p,p=f,m=_),_=0;m;)_=(p[--m]=p[m]+A[m]+_)/et|0,p[m]=et===p[m]?0:p[m]%et;return _&&(p=[_].concat(p),++C),$(a,p,C)},i.precision=i.sd=function(a,m){var f,g,_,h=this;if(a!=null&&a!==!!a)return Re(a,1,Ce),m==null?m=l:Re(m,0,8),J(new c(h),a,m);if(!(f=h.c))return null;if(_=f.length-1,g=_*pe+1,_=f[_]){for(;_%10==0;_/=10,g--);for(_=f[0];_>=10;_/=10,g++);}return a&&h.e+1>g&&(g=h.e+1),g},i.shiftedBy=function(a){return Re(a,-sn,sn),this.times("1e"+a)},i.squareRoot=i.sqrt=function(){var a,m,f,g,_,h=this,C=h.c,p=h.s,A=h.e,P=o+4,E=new c("0.5");if(p!==1||!C||!C[0])return new c(!p||p<0&&(!C||C[0])?NaN:C?h:1/0);if(p=Math.sqrt(+X(h)),p==0||p==1/0?(m=ze(C),(m.length+A)%2==0&&(m+="0"),p=Math.sqrt(+m),A=Ke((A+1)/2)-(A<0||A%2),p==1/0?m="5e"+A:(m=p.toExponential(),m=m.slice(0,m.indexOf("e")+1)+A),f=new c(m)):f=new c(p+""),f.c[0]){for(A=f.e,p=A+P,p<3&&(p=0);;)if(_=f,f=E.times(_.plus(e(h,_,P,1))),ze(_.c).slice(0,p)===(m=ze(f.c)).slice(0,p))if(f.e<A&&--p,m=m.slice(p-3,p+1),m=="9999"||!g&&m=="4999"){if(!g&&(J(_,_.e+o+2,0),_.times(_).eq(h))){f=_;break}P+=4,p+=4,g=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(J(f,f.e+o+2,1),a=!f.times(f).eq(h));break}}return J(f,f.e+o+1,l,a)},i.toExponential=function(a,m){return a!=null&&(Re(a,0,Ce),a++),v(this,a,m,1)},i.toFixed=function(a,m){return a!=null&&(Re(a,0,Ce),a=a+this.e+1),v(this,a,m)},i.toFormat=function(a,m,f){var g,_=this;if(f==null)a!=null&&m&&typeof m=="object"?(f=m,m=null):a&&typeof a=="object"?(f=a,a=m=null):f=y;else if(typeof f!="object")throw Error(We+"Argument not an object: "+f);if(g=_.toFixed(a,m),_.c){var h,C=g.split("."),p=+f.groupSize,A=+f.secondaryGroupSize,P=f.groupSeparator||"",E=C[0],M=C[1],S=_.s<0,j=S?E.slice(1):E,K=j.length;if(A&&(h=p,p=A,A=h,K-=h),p>0&&K>0){for(h=K%p||p,E=j.substr(0,h);h<K;h+=p)E+=P+j.substr(h,p);A>0&&(E+=P+j.slice(h)),S&&(E="-"+E)}g=M?E+(f.decimalSeparator||"")+((A=+f.fractionGroupSize)?M.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):M):E}return(f.prefix||"")+g+(f.suffix||"")},i.toFraction=function(a){var m,f,g,_,h,C,p,A,P,E,M,S,j=this,K=j.c;if(a!=null&&(p=new c(a),!p.isInteger()&&(p.c||p.s!==1)||p.lt(s)))throw Error(We+"Argument "+(p.isInteger()?"out of range: ":"not an integer: ")+X(p));if(!K)return new c(j);for(m=new c(s),P=f=new c(s),g=A=new c(s),S=ze(K),h=m.e=S.length-j.e-1,m.c[0]=an[(C=h%pe)<0?pe+C:C],a=!a||p.comparedTo(m)>0?h>0?m:P:p,C=O,O=1/0,p=new c(S),A.c[0]=0;E=e(p,m,0,1),_=f.plus(E.times(g)),_.comparedTo(a)!=1;)f=g,g=_,P=A.plus(E.times(_=P)),A=_,m=p.minus(E.times(_=m)),p=_;return _=e(a.minus(f),g,0,1),A=A.plus(_.times(P)),f=f.plus(_.times(g)),A.s=P.s=j.s,h=h*2,M=e(P,g,h,l).minus(j).abs().comparedTo(e(A,f,h,l).minus(j).abs())<1?[P,g]:[A,f],O=C,M},i.toNumber=function(){return+X(this)},i.toPrecision=function(a,m){return a!=null&&Re(a,1,Ce),v(this,a,m,2)},i.toString=function(a){var m,f=this,g=f.s,_=f.e;return _===null?g?(m="Infinity",g<0&&(m="-"+m)):m="NaN":(a==null?m=_<=d||_>=w?Sr(ze(f.c),_):lt(ze(f.c),_,"0"):a===10&&u?(f=J(new c(f),o+_+1,l),m=lt(ze(f.c),f.e,"0")):(Re(a,2,b.length,"Base"),m=t(lt(ze(f.c),_,"0"),10,a,g,!0)),g<0&&f.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return X(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,r!=null&&c.set(r),c}function Ke(r){var e=r|0;return r>0||r===e?e:e-1}function ze(r){for(var e,t,n=1,i=r.length,s=r[0]+"";n<i;){for(e=r[n++]+"",t=pe-e.length;t--;e="0"+e);s+=e}for(i=s.length;s.charCodeAt(--i)===48;);return s.slice(0,i+1||1)}function Rt(r,e){var t,n,i=r.c,s=e.c,o=r.s,l=e.s,d=r.e,w=e.e;if(!o||!l)return null;if(t=i&&!i[0],n=s&&!s[0],t||n)return t?n?0:-l:o;if(o!=l)return o;if(t=o<0,n=d==w,!i||!s)return n?0:!i^t?1:-1;if(!n)return d>w^t?1:-1;for(l=(d=i.length)<(w=s.length)?d:w,o=0;o<l;o++)if(i[o]!=s[o])return i[o]>s[o]^t?1:-1;return d==w?0:d>w^t?1:-1}function Re(r,e,t,n){if(r<e||r>t||r!==Ve(r))throw Error(We+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function Er(r){var e=r.c.length-1;return Ke(r.e/pe)==e&&r.c[e]%2!=0}function Sr(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function lt(r,e,t){var n,i;if(e<0){for(i=t+".";++e;i+=t);r=i+r}else if(n=r.length,++e>n){for(i=t,e-=n;--e;i+=t);r+=i}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}Ho();var ln={},It={},un,Ri;function zo(){if(Ri)return un;Ri=1,un=s,s.default=s,s.stable=w,s.stableStringify=w;var r="[...]",e="[Circular]",t=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(I,k,B,y){typeof y>"u"&&(y=i()),l(I,"",0,[],void 0,0,y);var b;try{n.length===0?b=JSON.stringify(I,k,B):b=JSON.stringify(I,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var u=t.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return b}function o(I,k,B,y){var b=Object.getOwnPropertyDescriptor(y,B);b.get!==void 0?b.configurable?(Object.defineProperty(y,B,{value:I}),t.push([y,B,k,b])):n.push([k,B,I]):(y[B]=I,t.push([y,B,k]))}function l(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)l(I[v],v,v,y,I,u,c);else{var G=Object.keys(I);for(v=0;v<G.length;v++){var $=G[v];l(I[$],$,v,y,I,u,c)}}y.pop()}}function d(I,k){return I<k?-1:I>k?1:0}function w(I,k,B,y){typeof y>"u"&&(y=i());var b=N(I,"",0,[],void 0,0,y)||I,u;try{n.length===0?u=JSON.stringify(b,k,B):u=JSON.stringify(b,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var c=t.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return u}function N(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}try{if(typeof I.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)N(I[v],v,v,y,I,u,c);else{var G={},$=Object.keys(I).sort(d);for(v=0;v<$.length;v++){var J=$[v];N(I[J],J,v,y,I,u,c),G[J]=I[J]}if(typeof b<"u")t.push([b,k,I]),b[k]=G;else return G}y.pop()}}function O(I){return I=typeof I<"u"?I:function(k,B){return B},function(k,B){if(n.length>0)for(var y=0;y<n.length;y++){var b=n[y];if(b[1]===k&&b[0]===B){B=b[2],n.splice(y,1);break}}return I.call(this,k,B)}}return un}var Ii;function ti(){if(Ii)return It;Ii=1,Object.defineProperty(It,"__esModule",{value:!0}),It.EthereumProviderError=It.EthereumRpcError=void 0;const r=zo();class e extends Error{constructor(o,l,d){if(!Number.isInteger(o))throw new Error('"code" must be an integer.');if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string.');super(l),this.code=o,d!==void 0&&(this.data=d)}serialize(){const o={code:this.code,message:this.message};return this.data!==void 0&&(o.data=this.data),this.stack&&(o.stack=this.stack),o}toString(){return r.default(this.serialize(),i,2)}}It.EthereumRpcError=e;class t extends e{constructor(o,l,d){if(!n(o))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(o,l,d)}}It.EthereumProviderError=t;function n(s){return Number.isInteger(s)&&s>=1e3&&s<=4999}function i(s,o){if(o!=="[Circular]")return o}return It}var fn={},Tt={},Ti;function ri(){return Ti||(Ti=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.errorValues=Tt.errorCodes=void 0,Tt.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}},Tt.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."}}),Tt}var xi;function Go(){return xi||(xi=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ri(),t=ti(),n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(I,k=i){if(Number.isInteger(I)){const B=I.toString();if(O(e.errorValues,B))return e.errorValues[B].message;if(w(I))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return k}r.getMessageFromCode=o;function l(I){if(!Number.isInteger(I))return!1;const k=I.toString();return!!(e.errorValues[k]||w(I))}r.isValidCode=l;function d(I,{fallbackError:k=s,shouldIncludeStack:B=!1}={}){var y,b;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(I instanceof t.EthereumRpcError)return I.serialize();const u={};if(I&&typeof I=="object"&&!Array.isArray(I)&&O(I,"code")&&l(I.code)){const v=I;u.code=v.code,v.message&&typeof v.message=="string"?(u.message=v.message,O(v,"data")&&(u.data=v.data)):(u.message=o(u.code),u.data={originalError:N(I)})}else{u.code=k.code;const v=(y=I)===null||y===void 0?void 0:y.message;u.message=v&&typeof v=="string"?v:k.message,u.data={originalError:N(I)}}const c=(b=I)===null||b===void 0?void 0:b.stack;return B&&I&&c&&typeof c=="string"&&(u.stack=c),u}r.serializeError=d;function w(I){return I>=-32099&&I<=-32e3}function N(I){return I&&typeof I=="object"&&!Array.isArray(I)?Object.assign({},I):I}function O(I,k){return Object.prototype.hasOwnProperty.call(I,k)}})(fn)),fn}var Kt={},Oi;function na(){if(Oi)return Kt;Oi=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.ethErrors=void 0;const r=ti(),e=Go(),t=ri();Kt.ethErrors={rpc:{parse:o=>n(t.errorCodes.rpc.parse,o),invalidRequest:o=>n(t.errorCodes.rpc.invalidRequest,o),invalidParams:o=>n(t.errorCodes.rpc.invalidParams,o),methodNotFound:o=>n(t.errorCodes.rpc.methodNotFound,o),internal:o=>n(t.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:l}=o;if(!Number.isInteger(l)||l>-32005||l<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(l,o)},invalidInput:o=>n(t.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>n(t.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>n(t.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>n(t.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>n(t.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>n(t.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>i(t.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>i(t.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>i(t.errorCodes.provider.unsupportedMethod,o),disconnected:o=>i(t.errorCodes.provider.disconnected,o),chainDisconnected:o=>i(t.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:l,message:d,data:w}=o;if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(l,d,w)}}};function n(o,l){const[d,w]=s(l);return new r.EthereumRpcError(o,d||e.getMessageFromCode(o),w)}function i(o,l){const[d,w]=s(l);return new r.EthereumProviderError(o,d||e.getMessageFromCode(o),w)}function s(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:l,data:d}=o;if(l&&typeof l!="string")throw new Error("Must specify string message.");return[l||void 0,d]}}return[]}return Kt}var Ni;function ia(){return Ni||(Ni=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const e=ti();Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const t=Go();Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const n=na();Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ri();Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(ln)),ln}function Qt(r){"@babel/helpers - typeof";return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qt(r)}function oa(r,e){if(Qt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Qt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function sa(r){var e=oa(r,"string");return Qt(e)=="symbol"?e:e+""}function ge(r,e,t){return(e=sa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ci(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Je(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ci(Object(t),!0).forEach(function(n){ge(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ci(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var cn={exports:{}},dn={exports:{}},hn,Pi;function Ie(){if(Pi)return hn;Pi=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let i=0;i<t.length;i++)n+=` ${t[i].stack}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qe=require("./platform-DCcL7jHP.js"),xe=require("./unsignedTransaction-qRBv5Cnd.js"),rr=require("./index-BbE02hdW.js"),ta=require("./index.es-ClIr5Gv-.js");require("./index-BxM99sFL.js");var ra=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,on=Math.ceil,Ve=Math.floor,We="[BigNumber Error] ",Ai=We+"Number primitive has more than 15 significant digits: ",et=1e14,pe=14,sn=9007199254740991,an=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],wt=1e7,Ce=1e9;function Ho(r){var e,t,n,i=c.prototype={constructor:c,toString:null,valueOf:null},s=new c(1),o=20,l=4,d=-7,w=21,N=-1e7,O=1e7,I=!1,k=1,B=0,y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",u=!0;function c(a,m){var f,g,_,h,C,p,A,P,E=this;if(!(E instanceof c))return new c(a,m);if(m==null){if(a&&a._isBigNumber===!0){E.s=a.s,!a.c||a.e>O?E.c=E.e=null:a.e<N?E.c=[E.e=0]:(E.e=a.e,E.c=a.c.slice());return}if((p=typeof a=="number")&&a*0==0){if(E.s=1/a<0?(a=-a,-1):1,a===~~a){for(h=0,C=a;C>=10;C/=10,h++);h>O?E.c=E.e=null:(E.e=h,E.c=[a]);return}P=String(a)}else{if(!ra.test(P=String(a)))return n(E,P,p);E.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(h=P.indexOf("."))>-1&&(P=P.replace(".","")),(C=P.search(/e/i))>0?(h<0&&(h=C),h+=+P.slice(C+1),P=P.substring(0,C)):h<0&&(h=P.length)}else{if(Re(m,2,b.length,"Base"),m==10&&u)return E=new c(a),J(E,o+E.e+1,l);if(P=String(a),p=typeof a=="number"){if(a*0!=0)return n(E,P,p,m);if(E.s=1/a<0?(P=P.slice(1),-1):1,c.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Ai+a)}else E.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(f=b.slice(0,m),h=C=0,A=P.length;C<A;C++)if(f.indexOf(g=P.charAt(C))<0){if(g=="."){if(C>h){h=A;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,C=-1,h=0;continue}return n(E,String(a),p,m)}p=!1,P=t(P,m,10,E.s),(h=P.indexOf("."))>-1?P=P.replace(".",""):h=P.length}for(C=0;P.charCodeAt(C)===48;C++);for(A=P.length;P.charCodeAt(--A)===48;);if(P=P.slice(C,++A)){if(A-=C,p&&c.DEBUG&&A>15&&(a>sn||a!==Ve(a)))throw Error(Ai+E.s*a);if((h=h-C-1)>O)E.c=E.e=null;else if(h<N)E.c=[E.e=0];else{if(E.e=h,E.c=[],C=(h+1)%pe,h<0&&(C+=pe),C<A){for(C&&E.c.push(+P.slice(0,C)),A-=pe;C<A;)E.c.push(+P.slice(C,C+=pe));C=pe-(P=P.slice(C)).length}else C-=A;for(;C--;P+="0");E.c.push(+P)}}else E.c=[E.e=0]}c.clone=Ho,c.ROUND_UP=0,c.ROUND_DOWN=1,c.ROUND_CEIL=2,c.ROUND_FLOOR=3,c.ROUND_HALF_UP=4,c.ROUND_HALF_DOWN=5,c.ROUND_HALF_EVEN=6,c.ROUND_HALF_CEIL=7,c.ROUND_HALF_FLOOR=8,c.EUCLID=9,c.config=c.set=function(a){var m,f;if(a!=null)if(typeof a=="object"){if(a.hasOwnProperty(m="DECIMAL_PLACES")&&(f=a[m],Re(f,0,Ce,m),o=f),a.hasOwnProperty(m="ROUNDING_MODE")&&(f=a[m],Re(f,0,8,m),l=f),a.hasOwnProperty(m="EXPONENTIAL_AT")&&(f=a[m],f&&f.pop?(Re(f[0],-Ce,0,m),Re(f[1],0,Ce,m),d=f[0],w=f[1]):(Re(f,-Ce,Ce,m),d=-(w=f<0?-f:f))),a.hasOwnProperty(m="RANGE"))if(f=a[m],f&&f.pop)Re(f[0],-Ce,-1,m),Re(f[1],1,Ce,m),N=f[0],O=f[1];else if(Re(f,-Ce,Ce,m),f)N=-(O=f<0?-f:f);else throw Error(We+m+" cannot be zero: "+f);if(a.hasOwnProperty(m="CRYPTO"))if(f=a[m],f===!!f)if(f)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))I=f;else throw I=!f,Error(We+"crypto unavailable");else I=f;else throw Error(We+m+" not true or false: "+f);if(a.hasOwnProperty(m="MODULO_MODE")&&(f=a[m],Re(f,0,9,m),k=f),a.hasOwnProperty(m="POW_PRECISION")&&(f=a[m],Re(f,0,Ce,m),B=f),a.hasOwnProperty(m="FORMAT"))if(f=a[m],typeof f=="object")y=f;else throw Error(We+m+" not an object: "+f);if(a.hasOwnProperty(m="ALPHABET"))if(f=a[m],typeof f=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(f))u=f.slice(0,10)=="0123456789",b=f;else throw Error(We+m+" invalid: "+f)}else throw Error(We+"Object expected: "+a);return{DECIMAL_PLACES:o,ROUNDING_MODE:l,EXPONENTIAL_AT:[d,w],RANGE:[N,O],CRYPTO:I,MODULO_MODE:k,POW_PRECISION:B,FORMAT:y,ALPHABET:b}},c.isBigNumber=function(a){if(!a||a._isBigNumber!==!0)return!1;if(!c.DEBUG)return!0;var m,f,g=a.c,_=a.e,h=a.s;e:if({}.toString.call(g)=="[object Array]"){if((h===1||h===-1)&&_>=-Ce&&_<=Ce&&_===Ve(_)){if(g[0]===0){if(_===0&&g.length===1)return!0;break e}if(m=(_+1)%pe,m<1&&(m+=pe),String(g[0]).length==m){for(m=0;m<g.length;m++)if(f=g[m],f<0||f>=et||f!==Ve(f))break e;if(f!==0)return!0}}}else if(g===null&&_===null&&(h===null||h===1||h===-1))return!0;throw Error(We+"Invalid BigNumber: "+a)},c.maximum=c.max=function(){return G(arguments,-1)},c.minimum=c.min=function(){return G(arguments,1)},c.random=(function(){var a=9007199254740992,m=Math.random()*a&2097151?function(){return Ve(Math.random()*a)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(f){var g,_,h,C,p,A=0,P=[],E=new c(s);if(f==null?f=o:Re(f,0,Ce),C=on(f/pe),I)if(crypto.getRandomValues){for(g=crypto.getRandomValues(new Uint32Array(C*=2));A<C;)p=g[A]*131072+(g[A+1]>>>11),p>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),g[A]=_[0],g[A+1]=_[1]):(P.push(p%1e14),A+=2);A=C/2}else if(crypto.randomBytes){for(g=crypto.randomBytes(C*=7);A<C;)p=(g[A]&31)*281474976710656+g[A+1]*1099511627776+g[A+2]*4294967296+g[A+3]*16777216+(g[A+4]<<16)+(g[A+5]<<8)+g[A+6],p>=9e15?crypto.randomBytes(7).copy(g,A):(P.push(p%1e14),A+=7);A=C/7}else throw I=!1,Error(We+"crypto unavailable");if(!I)for(;A<C;)p=m(),p<9e15&&(P[A++]=p%1e14);for(C=P[--A],f%=pe,C&&f&&(p=an[pe-f],P[A]=Ve(C/p)*p);P[A]===0;P.pop(),A--);if(A<0)P=[h=0];else{for(h=-1;P[0]===0;P.splice(0,1),h-=pe);for(A=1,p=P[0];p>=10;p/=10,A++);A<pe&&(h-=pe-A)}return E.e=h,E.c=P,E}})(),c.sum=function(){for(var a=1,m=arguments,f=new c(m[0]);a<m.length;)f=f.plus(m[a++]);return f},t=(function(){var a="0123456789";function m(f,g,_,h){for(var C,p=[0],A,P=0,E=f.length;P<E;){for(A=p.length;A--;p[A]*=g);for(p[0]+=h.indexOf(f.charAt(P++)),C=0;C<p.length;C++)p[C]>_-1&&(p[C+1]==null&&(p[C+1]=0),p[C+1]+=p[C]/_|0,p[C]%=_)}return p.reverse()}return function(f,g,_,h,C){var p,A,P,E,M,S,j,K,W=f.indexOf("."),ee=o,Q=l;for(W>=0&&(E=B,B=0,f=f.replace(".",""),K=new c(g),S=K.pow(f.length-W),B=E,K.c=m(lt(ze(S.c),S.e,"0"),10,_,a),K.e=K.c.length),j=m(f,g,_,C?(p=b,a):(p=a,b)),P=E=j.length;j[--E]==0;j.pop());if(!j[0])return p.charAt(0);if(W<0?--P:(S.c=j,S.e=P,S.s=h,S=e(S,K,ee,Q,_),j=S.c,M=S.r,P=S.e),A=P+ee+1,W=j[A],E=_/2,M=M||A<0||j[A+1]!=null,M=Q<4?(W!=null||M)&&(Q==0||Q==(S.s<0?3:2)):W>E||W==E&&(Q==4||M||Q==6&&j[A-1]&1||Q==(S.s<0?8:7)),A<1||!j[0])f=M?lt(p.charAt(1),-ee,p.charAt(0)):p.charAt(0);else{if(j.length=A,M)for(--_;++j[--A]>_;)j[A]=0,A||(++P,j=[1].concat(j));for(E=j.length;!j[--E];);for(W=0,f="";W<=E;f+=p.charAt(j[W++]));f=lt(f,P,p.charAt(0))}return f}})(),e=(function(){function a(g,_,h){var C,p,A,P,E=0,M=g.length,S=_%wt,j=_/wt|0;for(g=g.slice();M--;)A=g[M]%wt,P=g[M]/wt|0,C=j*A+P*S,p=S*A+C%wt*wt+E,E=(p/h|0)+(C/wt|0)+j*P,g[M]=p%h;return E&&(g=[E].concat(g)),g}function m(g,_,h,C){var p,A;if(h!=C)A=h>C?1:-1;else for(p=A=0;p<h;p++)if(g[p]!=_[p]){A=g[p]>_[p]?1:-1;break}return A}function f(g,_,h,C){for(var p=0;h--;)g[h]-=p,p=g[h]<_[h]?1:0,g[h]=p*C+g[h]-_[h];for(;!g[0]&&g.length>1;g.splice(0,1));}return function(g,_,h,C,p){var A,P,E,M,S,j,K,W,ee,Q,le,ue,z,V,oe,ce,fe,L=g.s==_.s?1:-1,D=g.c,F=_.c;if(!D||!D[0]||!F||!F[0])return new c(!g.s||!_.s||(D?F&&D[0]==F[0]:!F)?NaN:D&&D[0]==0||!F?L*0:L/0);for(W=new c(L),ee=W.c=[],P=g.e-_.e,L=h+P+1,p||(p=et,P=Ke(g.e/pe)-Ke(_.e/pe),L=L/pe|0),E=0;F[E]==(D[E]||0);E++);if(F[E]>(D[E]||0)&&P--,L<0)ee.push(1),M=!0;else{for(V=D.length,ce=F.length,E=0,L+=2,S=Ve(p/(F[0]+1)),S>1&&(F=a(F,S,p),D=a(D,S,p),ce=F.length,V=D.length),z=ce,Q=D.slice(0,ce),le=Q.length;le<ce;Q[le++]=0);fe=F.slice(),fe=[0].concat(fe),oe=F[0],F[1]>=p/2&&oe++;do{if(S=0,A=m(F,Q,ce,le),A<0){if(ue=Q[0],ce!=le&&(ue=ue*p+(Q[1]||0)),S=Ve(ue/oe),S>1)for(S>=p&&(S=p-1),j=a(F,S,p),K=j.length,le=Q.length;m(j,Q,K,le)==1;)S--,f(j,ce<K?fe:F,K,p),K=j.length,A=1;else S==0&&(A=S=1),j=F.slice(),K=j.length;if(K<le&&(j=[0].concat(j)),f(Q,j,le,p),le=Q.length,A==-1)for(;m(F,Q,ce,le)<1;)S++,f(Q,ce<le?fe:F,le,p),le=Q.length}else A===0&&(S++,Q=[0]);ee[E++]=S,Q[0]?Q[le++]=D[z]||0:(Q=[D[z]],le=1)}while((z++<V||Q[0]!=null)&&L--);M=Q[0]!=null,ee[0]||ee.splice(0,1)}if(p==et){for(E=1,L=ee[0];L>=10;L/=10,E++);J(W,h+(W.e=E+P*pe-1)+1,C,M)}else W.e=P,W.r=+M;return W}})();function v(a,m,f,g){var _,h,C,p,A;if(f==null?f=l:Re(f,0,8),!a.c)return a.toString();if(_=a.c[0],C=a.e,m==null)A=ze(a.c),A=g==1||g==2&&(C<=d||C>=w)?Sr(A,C):lt(A,C,"0");else if(a=J(new c(a),m,f),h=a.e,A=ze(a.c),p=A.length,g==1||g==2&&(m<=h||h<=d)){for(;p<m;A+="0",p++);A=Sr(A,h)}else if(m-=C+(g===2&&h>C),A=lt(A,h,"0"),h+1>p){if(--m>0)for(A+=".";m--;A+="0");}else if(m+=h-p,m>0)for(h+1==p&&(A+=".");m--;A+="0");return a.s<0&&_?"-"+A:A}function G(a,m){for(var f,g,_=1,h=new c(a[0]);_<a.length;_++)g=new c(a[_]),(!g.s||(f=Rt(h,g))===m||f===0&&h.s===m)&&(h=g);return h}function $(a,m,f){for(var g=1,_=m.length;!m[--_];m.pop());for(_=m[0];_>=10;_/=10,g++);return(f=g+f*pe-1)>O?a.c=a.e=null:f<N?a.c=[a.e=0]:(a.e=f,a.c=m),a}n=(function(){var a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,f=/^\.([^.]+)$/,g=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(h,C,p,A){var P,E=p?C:C.replace(_,"");if(g.test(E))h.s=isNaN(E)?null:E<0?-1:1;else{if(!p&&(E=E.replace(a,function(M,S,j){return P=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!A||A==P?S:M}),A&&(P=A,E=E.replace(m,"$1").replace(f,"0.$1")),C!=E))return new c(E,P);if(c.DEBUG)throw Error(We+"Not a"+(A?" base "+A:"")+" number: "+C);h.s=null}h.c=h.e=null}})();function J(a,m,f,g){var _,h,C,p,A,P,E,M=a.c,S=an;if(M){e:{for(_=1,p=M[0];p>=10;p/=10,_++);if(h=m-_,h<0)h+=pe,C=m,A=M[P=0],E=Ve(A/S[_-C-1]%10);else if(P=on((h+1)/pe),P>=M.length)if(g){for(;M.length<=P;M.push(0));A=E=0,_=1,h%=pe,C=h-pe+1}else break e;else{for(A=p=M[P],_=1;p>=10;p/=10,_++);h%=pe,C=h-pe+_,E=C<0?0:Ve(A/S[_-C-1]%10)}if(g=g||m<0||M[P+1]!=null||(C<0?A:A%S[_-C-1]),g=f<4?(E||g)&&(f==0||f==(a.s<0?3:2)):E>5||E==5&&(f==4||g||f==6&&(h>0?C>0?A/S[_-C]:0:M[P-1])%10&1||f==(a.s<0?8:7)),m<1||!M[0])return M.length=0,g?(m-=a.e+1,M[0]=S[(pe-m%pe)%pe],a.e=-m||0):M[0]=a.e=0,a;if(h==0?(M.length=P,p=1,P--):(M.length=P+1,p=S[pe-h],M[P]=C>0?Ve(A/S[_-C]%S[C])*p:0),g)for(;;)if(P==0){for(h=1,C=M[0];C>=10;C/=10,h++);for(C=M[0]+=p,p=1;C>=10;C/=10,p++);h!=p&&(a.e++,M[0]==et&&(M[0]=1));break}else{if(M[P]+=p,M[P]!=et)break;M[P--]=0,p=1}for(h=M.length;M[--h]===0;M.pop());}a.e>O?a.c=a.e=null:a.e<N&&(a.c=[a.e=0])}return a}function X(a){var m,f=a.e;return f===null?a.toString():(m=ze(a.c),m=f<=d||f>=w?Sr(m,f):lt(m,f,"0"),a.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var a=new c(this);return a.s<0&&(a.s=1),a},i.comparedTo=function(a,m){return Rt(this,new c(a,m))},i.decimalPlaces=i.dp=function(a,m){var f,g,_,h=this;if(a!=null)return Re(a,0,Ce),m==null?m=l:Re(m,0,8),J(new c(h),a+h.e+1,m);if(!(f=h.c))return null;if(g=((_=f.length-1)-Ke(this.e/pe))*pe,_=f[_])for(;_%10==0;_/=10,g--);return g<0&&(g=0),g},i.dividedBy=i.div=function(a,m){return e(this,new c(a,m),o,l)},i.dividedToIntegerBy=i.idiv=function(a,m){return e(this,new c(a,m),0,1)},i.exponentiatedBy=i.pow=function(a,m){var f,g,_,h,C,p,A,P,E,M=this;if(a=new c(a),a.c&&!a.isInteger())throw Error(We+"Exponent not an integer: "+X(a));if(m!=null&&(m=new c(m)),p=a.e>14,!M.c||!M.c[0]||M.c[0]==1&&!M.e&&M.c.length==1||!a.c||!a.c[0])return E=new c(Math.pow(+X(M),p?a.s*(2-Er(a)):+X(a))),m?E.mod(m):E;if(A=a.s<0,m){if(m.c?!m.c[0]:!m.s)return new c(NaN);g=!A&&M.isInteger()&&m.isInteger(),g&&(M=M.mod(m))}else{if(a.e>9&&(M.e>0||M.e<-1||(M.e==0?M.c[0]>1||p&&M.c[1]>=24e7:M.c[0]<8e13||p&&M.c[0]<=9999975e7)))return h=M.s<0&&Er(a)?-0:0,M.e>-1&&(h=1/h),new c(A?1/h:h);B&&(h=on(B/pe+2))}for(p?(f=new c(.5),A&&(a.s=1),P=Er(a)):(_=Math.abs(+X(a)),P=_%2),E=new c(s);;){if(P){if(E=E.times(M),!E.c)break;h?E.c.length>h&&(E.c.length=h):g&&(E=E.mod(m))}if(_){if(_=Ve(_/2),_===0)break;P=_%2}else if(a=a.times(f),J(a,a.e+1,1),a.e>14)P=Er(a);else{if(_=+X(a),_===0)break;P=_%2}M=M.times(M),h?M.c&&M.c.length>h&&(M.c.length=h):g&&(M=M.mod(m))}return g?E:(A&&(E=s.div(E)),m?E.mod(m):h?J(E,B,l,C):E)},i.integerValue=function(a){var m=new c(this);return a==null?a=l:Re(a,0,8),J(m,m.e+1,a)},i.isEqualTo=i.eq=function(a,m){return Rt(this,new c(a,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(a,m){return Rt(this,new c(a,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(a,m){return(m=Rt(this,new c(a,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Ke(this.e/pe)>this.c.length-2},i.isLessThan=i.lt=function(a,m){return Rt(this,new c(a,m))<0},i.isLessThanOrEqualTo=i.lte=function(a,m){return(m=Rt(this,new c(a,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(a,m){var f,g,_,h,C=this,p=C.s;if(a=new c(a,m),m=a.s,!p||!m)return new c(NaN);if(p!=m)return a.s=-m,C.plus(a);var A=C.e/pe,P=a.e/pe,E=C.c,M=a.c;if(!A||!P){if(!E||!M)return E?(a.s=-m,a):new c(M?C:NaN);if(!E[0]||!M[0])return M[0]?(a.s=-m,a):new c(E[0]?C:l==3?-0:0)}if(A=Ke(A),P=Ke(P),E=E.slice(),p=A-P){for((h=p<0)?(p=-p,_=E):(P=A,_=M),_.reverse(),m=p;m--;_.push(0));_.reverse()}else for(g=(h=(p=E.length)<(m=M.length))?p:m,p=m=0;m<g;m++)if(E[m]!=M[m]){h=E[m]<M[m];break}if(h&&(_=E,E=M,M=_,a.s=-a.s),m=(g=M.length)-(f=E.length),m>0)for(;m--;E[f++]=0);for(m=et-1;g>p;){if(E[--g]<M[g]){for(f=g;f&&!E[--f];E[f]=m);--E[f],E[g]+=et}E[g]-=M[g]}for(;E[0]==0;E.splice(0,1),--P);return E[0]?$(a,E,P):(a.s=l==3?-1:1,a.c=[a.e=0],a)},i.modulo=i.mod=function(a,m){var f,g,_=this;return a=new c(a,m),!_.c||!a.s||a.c&&!a.c[0]?new c(NaN):!a.c||_.c&&!_.c[0]?new c(_):(k==9?(g=a.s,a.s=1,f=e(_,a,0,3),a.s=g,f.s*=g):f=e(_,a,0,k),a=_.minus(f.times(a)),!a.c[0]&&k==1&&(a.s=_.s),a)},i.multipliedBy=i.times=function(a,m){var f,g,_,h,C,p,A,P,E,M,S,j,K,W,ee,Q=this,le=Q.c,ue=(a=new c(a,m)).c;if(!le||!ue||!le[0]||!ue[0])return!Q.s||!a.s||le&&!le[0]&&!ue||ue&&!ue[0]&&!le?a.c=a.e=a.s=null:(a.s*=Q.s,!le||!ue?a.c=a.e=null:(a.c=[0],a.e=0)),a;for(g=Ke(Q.e/pe)+Ke(a.e/pe),a.s*=Q.s,A=le.length,M=ue.length,A<M&&(K=le,le=ue,ue=K,_=A,A=M,M=_),_=A+M,K=[];_--;K.push(0));for(W=et,ee=wt,_=M;--_>=0;){for(f=0,S=ue[_]%ee,j=ue[_]/ee|0,C=A,h=_+C;h>_;)P=le[--C]%ee,E=le[C]/ee|0,p=j*P+E*S,P=S*P+p%ee*ee+K[h]+f,f=(P/W|0)+(p/ee|0)+j*E,K[h--]=P%W;K[h]=f}return f?++g:K.splice(0,1),$(a,K,g)},i.negated=function(){var a=new c(this);return a.s=-a.s||null,a},i.plus=function(a,m){var f,g=this,_=g.s;if(a=new c(a,m),m=a.s,!_||!m)return new c(NaN);if(_!=m)return a.s=-m,g.minus(a);var h=g.e/pe,C=a.e/pe,p=g.c,A=a.c;if(!h||!C){if(!p||!A)return new c(_/0);if(!p[0]||!A[0])return A[0]?a:new c(p[0]?g:_*0)}if(h=Ke(h),C=Ke(C),p=p.slice(),_=h-C){for(_>0?(C=h,f=A):(_=-_,f=p),f.reverse();_--;f.push(0));f.reverse()}for(_=p.length,m=A.length,_-m<0&&(f=A,A=p,p=f,m=_),_=0;m;)_=(p[--m]=p[m]+A[m]+_)/et|0,p[m]=et===p[m]?0:p[m]%et;return _&&(p=[_].concat(p),++C),$(a,p,C)},i.precision=i.sd=function(a,m){var f,g,_,h=this;if(a!=null&&a!==!!a)return Re(a,1,Ce),m==null?m=l:Re(m,0,8),J(new c(h),a,m);if(!(f=h.c))return null;if(_=f.length-1,g=_*pe+1,_=f[_]){for(;_%10==0;_/=10,g--);for(_=f[0];_>=10;_/=10,g++);}return a&&h.e+1>g&&(g=h.e+1),g},i.shiftedBy=function(a){return Re(a,-sn,sn),this.times("1e"+a)},i.squareRoot=i.sqrt=function(){var a,m,f,g,_,h=this,C=h.c,p=h.s,A=h.e,P=o+4,E=new c("0.5");if(p!==1||!C||!C[0])return new c(!p||p<0&&(!C||C[0])?NaN:C?h:1/0);if(p=Math.sqrt(+X(h)),p==0||p==1/0?(m=ze(C),(m.length+A)%2==0&&(m+="0"),p=Math.sqrt(+m),A=Ke((A+1)/2)-(A<0||A%2),p==1/0?m="5e"+A:(m=p.toExponential(),m=m.slice(0,m.indexOf("e")+1)+A),f=new c(m)):f=new c(p+""),f.c[0]){for(A=f.e,p=A+P,p<3&&(p=0);;)if(_=f,f=E.times(_.plus(e(h,_,P,1))),ze(_.c).slice(0,p)===(m=ze(f.c)).slice(0,p))if(f.e<A&&--p,m=m.slice(p-3,p+1),m=="9999"||!g&&m=="4999"){if(!g&&(J(_,_.e+o+2,0),_.times(_).eq(h))){f=_;break}P+=4,p+=4,g=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(J(f,f.e+o+2,1),a=!f.times(f).eq(h));break}}return J(f,f.e+o+1,l,a)},i.toExponential=function(a,m){return a!=null&&(Re(a,0,Ce),a++),v(this,a,m,1)},i.toFixed=function(a,m){return a!=null&&(Re(a,0,Ce),a=a+this.e+1),v(this,a,m)},i.toFormat=function(a,m,f){var g,_=this;if(f==null)a!=null&&m&&typeof m=="object"?(f=m,m=null):a&&typeof a=="object"?(f=a,a=m=null):f=y;else if(typeof f!="object")throw Error(We+"Argument not an object: "+f);if(g=_.toFixed(a,m),_.c){var h,C=g.split("."),p=+f.groupSize,A=+f.secondaryGroupSize,P=f.groupSeparator||"",E=C[0],M=C[1],S=_.s<0,j=S?E.slice(1):E,K=j.length;if(A&&(h=p,p=A,A=h,K-=h),p>0&&K>0){for(h=K%p||p,E=j.substr(0,h);h<K;h+=p)E+=P+j.substr(h,p);A>0&&(E+=P+j.slice(h)),S&&(E="-"+E)}g=M?E+(f.decimalSeparator||"")+((A=+f.fractionGroupSize)?M.replace(new RegExp("\\d{"+A+"}\\B","g"),"$&"+(f.fractionGroupSeparator||"")):M):E}return(f.prefix||"")+g+(f.suffix||"")},i.toFraction=function(a){var m,f,g,_,h,C,p,A,P,E,M,S,j=this,K=j.c;if(a!=null&&(p=new c(a),!p.isInteger()&&(p.c||p.s!==1)||p.lt(s)))throw Error(We+"Argument "+(p.isInteger()?"out of range: ":"not an integer: ")+X(p));if(!K)return new c(j);for(m=new c(s),P=f=new c(s),g=A=new c(s),S=ze(K),h=m.e=S.length-j.e-1,m.c[0]=an[(C=h%pe)<0?pe+C:C],a=!a||p.comparedTo(m)>0?h>0?m:P:p,C=O,O=1/0,p=new c(S),A.c[0]=0;E=e(p,m,0,1),_=f.plus(E.times(g)),_.comparedTo(a)!=1;)f=g,g=_,P=A.plus(E.times(_=P)),A=_,m=p.minus(E.times(_=m)),p=_;return _=e(a.minus(f),g,0,1),A=A.plus(_.times(P)),f=f.plus(_.times(g)),A.s=P.s=j.s,h=h*2,M=e(P,g,h,l).minus(j).abs().comparedTo(e(A,f,h,l).minus(j).abs())<1?[P,g]:[A,f],O=C,M},i.toNumber=function(){return+X(this)},i.toPrecision=function(a,m){return a!=null&&Re(a,1,Ce),v(this,a,m,2)},i.toString=function(a){var m,f=this,g=f.s,_=f.e;return _===null?g?(m="Infinity",g<0&&(m="-"+m)):m="NaN":(a==null?m=_<=d||_>=w?Sr(ze(f.c),_):lt(ze(f.c),_,"0"):a===10&&u?(f=J(new c(f),o+_+1,l),m=lt(ze(f.c),f.e,"0")):(Re(a,2,b.length,"Base"),m=t(lt(ze(f.c),_,"0"),10,a,g,!0)),g<0&&f.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return X(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,r!=null&&c.set(r),c}function Ke(r){var e=r|0;return r>0||r===e?e:e-1}function ze(r){for(var e,t,n=1,i=r.length,s=r[0]+"";n<i;){for(e=r[n++]+"",t=pe-e.length;t--;e="0"+e);s+=e}for(i=s.length;s.charCodeAt(--i)===48;);return s.slice(0,i+1||1)}function Rt(r,e){var t,n,i=r.c,s=e.c,o=r.s,l=e.s,d=r.e,w=e.e;if(!o||!l)return null;if(t=i&&!i[0],n=s&&!s[0],t||n)return t?n?0:-l:o;if(o!=l)return o;if(t=o<0,n=d==w,!i||!s)return n?0:!i^t?1:-1;if(!n)return d>w^t?1:-1;for(l=(d=i.length)<(w=s.length)?d:w,o=0;o<l;o++)if(i[o]!=s[o])return i[o]>s[o]^t?1:-1;return d==w?0:d>w^t?1:-1}function Re(r,e,t,n){if(r<e||r>t||r!==Ve(r))throw Error(We+(n||"Argument")+(typeof r=="number"?r<e||r>t?" out of range: ":" not an integer: ":" not a primitive number: ")+String(r))}function Er(r){var e=r.c.length-1;return Ke(r.e/pe)==e&&r.c[e]%2!=0}function Sr(r,e){return(r.length>1?r.charAt(0)+"."+r.slice(1):r)+(e<0?"e":"e+")+e}function lt(r,e,t){var n,i;if(e<0){for(i=t+".";++e;i+=t);r=i+r}else if(n=r.length,++e>n){for(i=t,e-=n;--e;i+=t);r+=i}else e<n&&(r=r.slice(0,e)+"."+r.slice(e));return r}Ho();var ln={},It={},un,Ri;function zo(){if(Ri)return un;Ri=1,un=s,s.default=s,s.stable=w,s.stableStringify=w;var r="[...]",e="[Circular]",t=[],n=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(I,k,B,y){typeof y>"u"&&(y=i()),l(I,"",0,[],void 0,0,y);var b;try{n.length===0?b=JSON.stringify(I,k,B):b=JSON.stringify(I,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var u=t.pop();u.length===4?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return b}function o(I,k,B,y){var b=Object.getOwnPropertyDescriptor(y,B);b.get!==void 0?b.configurable?(Object.defineProperty(y,B,{value:I}),t.push([y,B,k,b])):n.push([k,B,I]):(y[B]=I,t.push([y,B,k]))}function l(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)l(I[v],v,v,y,I,u,c);else{var G=Object.keys(I);for(v=0;v<G.length;v++){var $=G[v];l(I[$],$,v,y,I,u,c)}}y.pop()}}function d(I,k){return I<k?-1:I>k?1:0}function w(I,k,B,y){typeof y>"u"&&(y=i());var b=N(I,"",0,[],void 0,0,y)||I,u;try{n.length===0?u=JSON.stringify(b,k,B):u=JSON.stringify(b,O(k),B)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;t.length!==0;){var c=t.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return u}function N(I,k,B,y,b,u,c){u+=1;var v;if(typeof I=="object"&&I!==null){for(v=0;v<y.length;v++)if(y[v]===I){o(e,I,k,b);return}try{if(typeof I.toJSON=="function")return}catch{return}if(typeof c.depthLimit<"u"&&u>c.depthLimit){o(r,I,k,b);return}if(typeof c.edgesLimit<"u"&&B+1>c.edgesLimit){o(r,I,k,b);return}if(y.push(I),Array.isArray(I))for(v=0;v<I.length;v++)N(I[v],v,v,y,I,u,c);else{var G={},$=Object.keys(I).sort(d);for(v=0;v<$.length;v++){var J=$[v];N(I[J],J,v,y,I,u,c),G[J]=I[J]}if(typeof b<"u")t.push([b,k,I]),b[k]=G;else return G}y.pop()}}function O(I){return I=typeof I<"u"?I:function(k,B){return B},function(k,B){if(n.length>0)for(var y=0;y<n.length;y++){var b=n[y];if(b[1]===k&&b[0]===B){B=b[2],n.splice(y,1);break}}return I.call(this,k,B)}}return un}var Ii;function ti(){if(Ii)return It;Ii=1,Object.defineProperty(It,"__esModule",{value:!0}),It.EthereumProviderError=It.EthereumRpcError=void 0;const r=zo();class e extends Error{constructor(o,l,d){if(!Number.isInteger(o))throw new Error('"code" must be an integer.');if(!l||typeof l!="string")throw new Error('"message" must be a nonempty string.');super(l),this.code=o,d!==void 0&&(this.data=d)}serialize(){const o={code:this.code,message:this.message};return this.data!==void 0&&(o.data=this.data),this.stack&&(o.stack=this.stack),o}toString(){return r.default(this.serialize(),i,2)}}It.EthereumRpcError=e;class t extends e{constructor(o,l,d){if(!n(o))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(o,l,d)}}It.EthereumProviderError=t;function n(s){return Number.isInteger(s)&&s>=1e3&&s<=4999}function i(s,o){if(o!=="[Circular]")return o}return It}var fn={},Tt={},Ti;function ri(){return Ti||(Ti=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.errorValues=Tt.errorCodes=void 0,Tt.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}},Tt.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."}}),Tt}var xi;function Go(){return xi||(xi=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serializeError=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ri(),t=ti(),n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(I,k=i){if(Number.isInteger(I)){const B=I.toString();if(O(e.errorValues,B))return e.errorValues[B].message;if(w(I))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return k}r.getMessageFromCode=o;function l(I){if(!Number.isInteger(I))return!1;const k=I.toString();return!!(e.errorValues[k]||w(I))}r.isValidCode=l;function d(I,{fallbackError:k=s,shouldIncludeStack:B=!1}={}){var y,b;if(!k||!Number.isInteger(k.code)||typeof k.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(I instanceof t.EthereumRpcError)return I.serialize();const u={};if(I&&typeof I=="object"&&!Array.isArray(I)&&O(I,"code")&&l(I.code)){const v=I;u.code=v.code,v.message&&typeof v.message=="string"?(u.message=v.message,O(v,"data")&&(u.data=v.data)):(u.message=o(u.code),u.data={originalError:N(I)})}else{u.code=k.code;const v=(y=I)===null||y===void 0?void 0:y.message;u.message=v&&typeof v=="string"?v:k.message,u.data={originalError:N(I)}}const c=(b=I)===null||b===void 0?void 0:b.stack;return B&&I&&c&&typeof c=="string"&&(u.stack=c),u}r.serializeError=d;function w(I){return I>=-32099&&I<=-32e3}function N(I){return I&&typeof I=="object"&&!Array.isArray(I)?Object.assign({},I):I}function O(I,k){return Object.prototype.hasOwnProperty.call(I,k)}})(fn)),fn}var Kt={},Oi;function na(){if(Oi)return Kt;Oi=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.ethErrors=void 0;const r=ti(),e=Go(),t=ri();Kt.ethErrors={rpc:{parse:o=>n(t.errorCodes.rpc.parse,o),invalidRequest:o=>n(t.errorCodes.rpc.invalidRequest,o),invalidParams:o=>n(t.errorCodes.rpc.invalidParams,o),methodNotFound:o=>n(t.errorCodes.rpc.methodNotFound,o),internal:o=>n(t.errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:l}=o;if(!Number.isInteger(l)||l>-32005||l<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return n(l,o)},invalidInput:o=>n(t.errorCodes.rpc.invalidInput,o),resourceNotFound:o=>n(t.errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>n(t.errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>n(t.errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>n(t.errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>n(t.errorCodes.rpc.limitExceeded,o)},provider:{userRejectedRequest:o=>i(t.errorCodes.provider.userRejectedRequest,o),unauthorized:o=>i(t.errorCodes.provider.unauthorized,o),unsupportedMethod:o=>i(t.errorCodes.provider.unsupportedMethod,o),disconnected:o=>i(t.errorCodes.provider.disconnected,o),chainDisconnected:o=>i(t.errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:l,message:d,data:w}=o;if(!d||typeof d!="string")throw new Error('"message" must be a nonempty string');return new r.EthereumProviderError(l,d,w)}}};function n(o,l){const[d,w]=s(l);return new r.EthereumRpcError(o,d||e.getMessageFromCode(o),w)}function i(o,l){const[d,w]=s(l);return new r.EthereumProviderError(o,d||e.getMessageFromCode(o),w)}function s(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:l,data:d}=o;if(l&&typeof l!="string")throw new Error("Must specify string message.");return[l||void 0,d]}}return[]}return Kt}var Ni;function ia(){return Ni||(Ni=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getMessageFromCode=r.serializeError=r.EthereumProviderError=r.EthereumRpcError=r.ethErrors=r.errorCodes=void 0;const e=ti();Object.defineProperty(r,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(r,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const t=Go();Object.defineProperty(r,"serializeError",{enumerable:!0,get:function(){return t.serializeError}}),Object.defineProperty(r,"getMessageFromCode",{enumerable:!0,get:function(){return t.getMessageFromCode}});const n=na();Object.defineProperty(r,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ri();Object.defineProperty(r,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(ln)),ln}function Qt(r){"@babel/helpers - typeof";return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qt(r)}function oa(r,e){if(Qt(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(Qt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function sa(r){var e=oa(r,"string");return Qt(e)=="symbol"?e:e+""}function ge(r,e,t){return(e=sa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ci(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Je(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ci(Object(t),!0).forEach(function(n){ge(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ci(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}var cn={exports:{}},dn={exports:{}},hn,Pi;function Ie(){if(Pi)return hn;Pi=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let i=0;i<t.length;i++)n+=` ${t[i].stack}
|
|
2
2
|
`;super(n),this.name="AggregateError",this.errors=t}}return hn={AggregateError:r,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},hn}var gn={exports:{}},pn,Li;function Vo(){return Li||(Li=1,pn={format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,n]){const i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}),pn}var wn,Bi;function ke(){if(Bi)return wn;Bi=1;const{format:r,inspect:e}=Vo(),{AggregateError:t}=Ie(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],o=/^([A-Z][a-z0-9]*)+$/,l="__node_internal_",d={};function w(b,u){if(!b)throw new d.ERR_INTERNAL_ASSERTION(u)}function N(b){let u="",c=b.length;const v=b[0]==="-"?1:0;for(;c>=v+4;c-=3)u=`_${b.slice(c-3,c)}${u}`;return`${b.slice(0,c)}${u}`}function O(b,u,c){if(typeof u=="function")return w(u.length<=c.length,`Code: ${b}; The provided arguments length (${c.length}) does not match the required ones (${u.length}).`),u(...c);const v=(u.match(/%[dfijoOs]/g)||[]).length;return w(v===c.length,`Code: ${b}; The provided arguments length (${c.length}) does not match the required ones (${v}).`),c.length===0?u:r(u,...c)}function I(b,u,c){c||(c=Error);class v extends c{constructor(...$){super(O(b,u,$))}toString(){return`${this.name} [${b}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:c.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${b}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=b,v.prototype[i]=!0,d[b]=v}function k(b){const u=l+b.name;return Object.defineProperty(b,"name",{value:u}),b}function B(b,u){if(b&&u&&b!==u){if(Array.isArray(u.errors))return u.errors.push(b),u;const c=new n([u,b],u.message);return c.code=u.code,c}return b||u}class y extends Error{constructor(u="The operation was aborted",c=void 0){if(c!==void 0&&typeof c!="object")throw new d.ERR_INVALID_ARG_TYPE("options","Object",c);super(u,c),this.code="ABORT_ERR",this.name="AbortError"}}return I("ERR_ASSERTION","%s",Error),I("ERR_INVALID_ARG_TYPE",(b,u,c)=>{w(typeof b=="string","'name' must be a string"),Array.isArray(u)||(u=[u]);let v="The ";b.endsWith(" argument")?v+=`${b} `:v+=`"${b}" ${b.includes(".")?"property":"argument"} `,v+="must be ";const G=[],$=[],J=[];for(const a of u)w(typeof a=="string","All expected entries have to be of type string"),s.includes(a)?G.push(a.toLowerCase()):o.test(a)?$.push(a):(w(a!=="object",'The value "object" should be written as "Object"'),J.push(a));if($.length>0){const a=G.indexOf("object");a!==-1&&(G.splice(G,a,1),$.push("Object"))}if(G.length>0){switch(G.length){case 1:v+=`of type ${G[0]}`;break;case 2:v+=`one of type ${G[0]} or ${G[1]}`;break;default:{const a=G.pop();v+=`one of type ${G.join(", ")}, or ${a}`}}($.length>0||J.length>0)&&(v+=" or ")}if($.length>0){switch($.length){case 1:v+=`an instance of ${$[0]}`;break;case 2:v+=`an instance of ${$[0]} or ${$[1]}`;break;default:{const a=$.pop();v+=`an instance of ${$.join(", ")}, or ${a}`}}J.length>0&&(v+=" or ")}switch(J.length){case 0:break;case 1:J[0].toLowerCase()!==J[0]&&(v+="an "),v+=`${J[0]}`;break;case 2:v+=`one of ${J[0]} or ${J[1]}`;break;default:{const a=J.pop();v+=`one of ${J.join(", ")}, or ${a}`}}if(c==null)v+=`. Received ${c}`;else if(typeof c=="function"&&c.name)v+=`. Received function ${c.name}`;else if(typeof c=="object"){var X;if((X=c.constructor)!==null&&X!==void 0&&X.name)v+=`. Received an instance of ${c.constructor.name}`;else{const a=e(c,{depth:-1});v+=`. Received ${a}`}}else{let a=e(c,{colors:!1});a.length>25&&(a=`${a.slice(0,25)}...`),v+=`. Received type ${typeof c} (${a})`}return v},TypeError),I("ERR_INVALID_ARG_VALUE",(b,u,c="is invalid")=>{let v=e(u);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${b.includes(".")?"property":"argument"} '${b}' ${c}. Received ${v}`},TypeError),I("ERR_INVALID_RETURN_VALUE",(b,u,c)=>{var v;const G=c!=null&&(v=c.constructor)!==null&&v!==void 0&&v.name?`instance of ${c.constructor.name}`:`type ${typeof c}`;return`Expected ${b} to be returned from the "${u}" function but got ${G}.`},TypeError),I("ERR_MISSING_ARGS",(...b)=>{w(b.length>0,"At least one arg needs to be specified");let u;const c=b.length;switch(b=(Array.isArray(b)?b:[b]).map(v=>`"${v}"`).join(" or "),c){case 1:u+=`The ${b[0]} argument`;break;case 2:u+=`The ${b[0]} and ${b[1]} arguments`;break;default:{const v=b.pop();u+=`The ${b.join(", ")}, and ${v} arguments`}break}return`${u} must be specified`},TypeError),I("ERR_OUT_OF_RANGE",(b,u,c)=>{w(u,'Missing "range" argument');let v;if(Number.isInteger(c)&&Math.abs(c)>2**32)v=N(String(c));else if(typeof c=="bigint"){v=String(c);const G=BigInt(2)**BigInt(32);(c>G||c<-G)&&(v=N(v)),v+="n"}else v=e(c);return`The value of "${b}" is out of range. It must be ${u}. Received ${v}`},RangeError),I("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),I("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),I("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),I("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),I("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),I("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),I("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),I("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),I("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),I("ERR_STREAM_WRITE_AFTER_END","write after end",Error),I("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),wn={AbortError:y,aggregateTwoErrors:k(B),hideStackFrames:k,codes:d},wn}var Yt={exports:{}},Mi;function er(){if(Mi)return Yt.exports;Mi=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Yt.exports=r,Yt.exports.AbortSignal=e,Yt.exports.default=r,Yt.exports}var Di;function $e(){return Di||(Di=1,(function(r){const e=xe.requireDist(),{format:t,inspect:n}=Vo(),{codes:{ERR_INVALID_ARG_TYPE:i}}=ke(),{kResistStopPropagation:s,AggregateError:o,SymbolDispose:l}=Ie(),d=globalThis.AbortSignal||er().AbortSignal,w=globalThis.AbortController||er().AbortController,N=Object.getPrototypeOf(async function(){}).constructor,O=globalThis.Blob||e.Blob,I=typeof O<"u"?function(b){return b instanceof O}:function(b){return!1},k=(y,b)=>{if(y!==void 0&&(y===null||typeof y!="object"||!("aborted"in y)))throw new i(b,"AbortSignal",y)},B=(y,b)=>{if(typeof y!="function")throw new i(b,"Function",y)};r.exports={AggregateError:o,kEmptyObject:Object.freeze({}),once(y){let b=!1;return function(...u){b||(b=!0,y.apply(this,u))}},createDeferredPromise:function(){let y,b;return{promise:new Promise((c,v)=>{y=c,b=v}),resolve:y,reject:b}},promisify(y){return new Promise((b,u)=>{y((c,...v)=>c?u(c):b(...v))})},debuglog(){return function(){}},format:t,inspect:n,types:{isAsyncFunction(y){return y instanceof N},isArrayBufferView(y){return ArrayBuffer.isView(y)}},isBlob:I,deprecate(y,b){return y},addAbortListener:rr.requireEvents().addAbortListener||function(b,u){if(b===void 0)throw new i("signal","AbortSignal",b);k(b,"signal"),B(u,"listener");let c;return b.aborted?queueMicrotask(()=>u()):(b.addEventListener("abort",u,{__proto__:null,once:!0,[s]:!0}),c=()=>{b.removeEventListener("abort",u)}),{__proto__:null,[l](){var v;(v=c)===null||v===void 0||v()}}},AbortSignalAny:d.any||function(b){if(b.length===1)return b[0];const u=new w,c=()=>u.abort();return b.forEach(v=>{k(v,"signals"),v.addEventListener("abort",c,{once:!0})}),u.signal.addEventListener("abort",()=>{b.forEach(v=>v.removeEventListener("abort",c))},{once:!0}),u.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(gn)),gn.exports}var vr={},bn,qi;function nr(){if(qi)return bn;qi=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:o,NumberMIN_SAFE_INTEGER:l,NumberParseInt:d,ObjectPrototypeHasOwnProperty:w,RegExpPrototypeExec:N,String:O,StringPrototypeToUpperCase:I,StringPrototypeTrim:k}=Ie(),{hideStackFrames:B,codes:{ERR_SOCKET_BAD_PORT:y,ERR_INVALID_ARG_TYPE:b,ERR_INVALID_ARG_VALUE:u,ERR_OUT_OF_RANGE:c,ERR_UNKNOWN_SIGNAL:v}}=ke(),{normalizeEncoding:G}=$e(),{isAsyncFunction:$,isArrayBufferView:J}=$e().types,X={};function a(q){return q===(q|0)}function m(q){return q===q>>>0}const f=/^[0-7]+$/,g="must be a 32-bit unsigned integer or an octal string";function _(q,Z,re){if(typeof q>"u"&&(q=re),typeof q=="string"){if(N(f,q)===null)throw new u(Z,q,g);q=d(q,8)}return p(q,Z),q}const h=B((q,Z,re=l,Y=o)=>{if(typeof q!="number")throw new b(Z,"number",q);if(!i(q))throw new c(Z,"an integer",q);if(q<re||q>Y)throw new c(Z,`>= ${re} && <= ${Y}`,q)}),C=B((q,Z,re=-2147483648,Y=2147483647)=>{if(typeof q!="number")throw new b(Z,"number",q);if(!i(q))throw new c(Z,"an integer",q);if(q<re||q>Y)throw new c(Z,`>= ${re} && <= ${Y}`,q)}),p=B((q,Z,re=!1)=>{if(typeof q!="number")throw new b(Z,"number",q);if(!i(q))throw new c(Z,"an integer",q);const Y=re?1:0,we=4294967295;if(q<Y||q>we)throw new c(Z,`>= ${Y} && <= ${we}`,q)});function A(q,Z){if(typeof q!="string")throw new b(Z,"string",q)}function P(q,Z,re=void 0,Y){if(typeof q!="number")throw new b(Z,"number",q);if(re!=null&&q<re||Y!=null&&q>Y||(re!=null||Y!=null)&&s(q))throw new c(Z,`${re!=null?`>= ${re}`:""}${re!=null&&Y!=null?" && ":""}${Y!=null?`<= ${Y}`:""}`,q)}const E=B((q,Z,re)=>{if(!e(re,q)){const we="must be one of: "+t(n(re,Le=>typeof Le=="string"?`'${Le}'`:O(Le)),", ");throw new u(Z,q,we)}});function M(q,Z){if(typeof q!="boolean")throw new b(Z,"boolean",q)}function S(q,Z,re){return q==null||!w(q,Z)?re:q[Z]}const j=B((q,Z,re=null)=>{const Y=S(re,"allowArray",!1),we=S(re,"allowFunction",!1);if(!S(re,"nullable",!1)&&q===null||!Y&&r(q)||typeof q!="object"&&(!we||typeof q!="function"))throw new b(Z,"Object",q)}),K=B((q,Z)=>{if(q!=null&&typeof q!="object"&&typeof q!="function")throw new b(Z,"a dictionary",q)}),W=B((q,Z,re=0)=>{if(!r(q))throw new b(Z,"Array",q);if(q.length<re){const Y=`must be longer than ${re}`;throw new u(Z,q,Y)}});function ee(q,Z){W(q,Z);for(let re=0;re<q.length;re++)A(q[re],`${Z}[${re}]`)}function Q(q,Z){W(q,Z);for(let re=0;re<q.length;re++)M(q[re],`${Z}[${re}]`)}function le(q,Z){W(q,Z);for(let re=0;re<q.length;re++){const Y=q[re],we=`${Z}[${re}]`;if(Y==null)throw new b(we,"AbortSignal",Y);ce(Y,we)}}function ue(q,Z="signal"){if(A(q,Z),X[q]===void 0)throw X[I(q)]!==void 0?new v(q+" (signals must use all capital letters)"):new v(q)}const z=B((q,Z="buffer")=>{if(!J(q))throw new b(Z,["Buffer","TypedArray","DataView"],q)});function V(q,Z){const re=G(Z),Y=q.length;if(re==="hex"&&Y%2!==0)throw new u("encoding",Z,`is invalid for data of length ${Y}`)}function oe(q,Z="Port",re=!0){if(typeof q!="number"&&typeof q!="string"||typeof q=="string"&&k(q).length===0||+q!==+q>>>0||q>65535||q===0&&!re)throw new y(Z,q,re);return q|0}const ce=B((q,Z)=>{if(q!==void 0&&(q===null||typeof q!="object"||!("aborted"in q)))throw new b(Z,"AbortSignal",q)}),fe=B((q,Z)=>{if(typeof q!="function")throw new b(Z,"Function",q)}),L=B((q,Z)=>{if(typeof q!="function"||$(q))throw new b(Z,"Function",q)}),D=B((q,Z)=>{if(q!==void 0)throw new b(Z,"undefined",q)});function F(q,Z,re){if(!e(re,q))throw new b(Z,`('${t(re,"|")}')`,q)}const ne=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function se(q,Z){if(typeof q>"u"||!N(ne,q))throw new u(Z,q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function ie(q){if(typeof q=="string")return se(q,"hints"),q;if(r(q)){const Z=q.length;let re="";if(Z===0)return re;for(let Y=0;Y<Z;Y++){const we=q[Y];se(we,"hints"),re+=we,Y!==Z-1&&(re+=", ")}return re}throw new u("hints",q,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return bn={isInt32:a,isUint32:m,parseFileMode:_,validateArray:W,validateStringArray:ee,validateBooleanArray:Q,validateAbortSignalArray:le,validateBoolean:M,validateBuffer:z,validateDictionary:K,validateEncoding:V,validateFunction:fe,validateInt32:C,validateInteger:h,validateNumber:P,validateObject:j,validateOneOf:E,validatePlainFunction:L,validatePort:oe,validateSignalName:ue,validateString:A,validateUint32:p,validateUndefined:D,validateUnion:F,validateAbortSignal:ce,validateLinkHeaderValue:ie},bn}var Ar={exports:{}},yn={exports:{}},ki;function Lt(){if(ki)return yn.exports;ki=1;var r=yn.exports={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function s(y){if(e===setTimeout)return setTimeout(y,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(y,0);try{return e(y,0)}catch{try{return e.call(null,y,0)}catch{return e.call(this,y,0)}}}function o(y){if(t===clearTimeout)return clearTimeout(y);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(y);try{return t(y)}catch{try{return t.call(null,y)}catch{return t.call(this,y)}}}var l=[],d=!1,w,N=-1;function O(){!d||!w||(d=!1,w.length?l=w.concat(l):N=-1,l.length&&I())}function I(){if(!d){var y=s(O);d=!0;for(var b=l.length;b;){for(w=l,l=[];++N<b;)w&&w[N].run();N=-1,b=l.length}w=null,d=!1,o(y)}}r.nextTick=function(y){var b=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)b[u-1]=arguments[u];l.push(new k(y,b)),l.length===1&&!d&&s(I)};function k(y,b){this.fun=y,this.array=b}k.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function B(){}return r.on=B,r.addListener=B,r.once=B,r.off=B,r.removeListener=B,r.removeAllListeners=B,r.emit=B,r.prependListener=B,r.prependOnceListener=B,r.listeners=function(y){return[]},r.binding=function(y){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(y){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},yn.exports}var _n,Ui;function gt(){if(Ui)return _n;Ui=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Ie(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),s=t("nodejs.stream.readable"),o=t("nodejs.stream.writable"),l=t("nodejs.stream.disturbed"),d=t("nodejs.webstream.isClosedPromise"),w=t("nodejs.webstream.controllerErrorFunction");function N(S,j=!1){var K;return!!(S&&typeof S.pipe=="function"&&typeof S.on=="function"&&(!j||typeof S.pause=="function"&&typeof S.resume=="function")&&(!S._writableState||((K=S._readableState)===null||K===void 0?void 0:K.readable)!==!1)&&(!S._writableState||S._readableState))}function O(S){var j;return!!(S&&typeof S.write=="function"&&typeof S.on=="function"&&(!S._readableState||((j=S._writableState)===null||j===void 0?void 0:j.writable)!==!1))}function I(S){return!!(S&&typeof S.pipe=="function"&&S._readableState&&typeof S.on=="function"&&typeof S.write=="function")}function k(S){return S&&(S._readableState||S._writableState||typeof S.write=="function"&&typeof S.on=="function"||typeof S.pipe=="function"&&typeof S.on=="function")}function B(S){return!!(S&&!k(S)&&typeof S.pipeThrough=="function"&&typeof S.getReader=="function"&&typeof S.cancel=="function")}function y(S){return!!(S&&!k(S)&&typeof S.getWriter=="function"&&typeof S.abort=="function")}function b(S){return!!(S&&!k(S)&&typeof S.readable=="object"&&typeof S.writable=="object")}function u(S){return B(S)||y(S)||b(S)}function c(S,j){return S==null?!1:j===!0?typeof S[r]=="function":j===!1?typeof S[e]=="function":typeof S[r]=="function"||typeof S[e]=="function"}function v(S){if(!k(S))return null;const j=S._writableState,K=S._readableState,W=j||K;return!!(S.destroyed||S[n]||W!=null&&W.destroyed)}function G(S){if(!O(S))return null;if(S.writableEnded===!0)return!0;const j=S._writableState;return j!=null&&j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function $(S,j){if(!O(S))return null;if(S.writableFinished===!0)return!0;const K=S._writableState;return K!=null&&K.errored?!1:typeof K?.finished!="boolean"?null:!!(K.finished||j===!1&&K.ended===!0&&K.length===0)}function J(S){if(!N(S))return null;if(S.readableEnded===!0)return!0;const j=S._readableState;return!j||j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function X(S,j){if(!N(S))return null;const K=S._readableState;return K!=null&&K.errored?!1:typeof K?.endEmitted!="boolean"?null:!!(K.endEmitted||j===!1&&K.ended===!0&&K.length===0)}function a(S){return S&&S[s]!=null?S[s]:typeof S?.readable!="boolean"?null:v(S)?!1:N(S)&&S.readable&&!X(S)}function m(S){return S&&S[o]!=null?S[o]:typeof S?.writable!="boolean"?null:v(S)?!1:O(S)&&S.writable&&!G(S)}function f(S,j){return k(S)?v(S)?!0:!(j?.readable!==!1&&a(S)||j?.writable!==!1&&m(S)):null}function g(S){var j,K;return k(S)?S.writableErrored?S.writableErrored:(j=(K=S._writableState)===null||K===void 0?void 0:K.errored)!==null&&j!==void 0?j:null:null}function _(S){var j,K;return k(S)?S.readableErrored?S.readableErrored:(j=(K=S._readableState)===null||K===void 0?void 0:K.errored)!==null&&j!==void 0?j:null:null}function h(S){if(!k(S))return null;if(typeof S.closed=="boolean")return S.closed;const j=S._writableState,K=S._readableState;return typeof j?.closed=="boolean"||typeof K?.closed=="boolean"?j?.closed||K?.closed:typeof S._closed=="boolean"&&C(S)?S._closed:null}function C(S){return typeof S._closed=="boolean"&&typeof S._defaultKeepAlive=="boolean"&&typeof S._removedConnection=="boolean"&&typeof S._removedContLen=="boolean"}function p(S){return typeof S._sent100=="boolean"&&C(S)}function A(S){var j;return typeof S._consuming=="boolean"&&typeof S._dumped=="boolean"&&((j=S.req)===null||j===void 0?void 0:j.upgradeOrConnect)===void 0}function P(S){if(!k(S))return null;const j=S._writableState,K=S._readableState,W=j||K;return!W&&p(S)||!!(W&&W.autoDestroy&&W.emitClose&&W.closed===!1)}function E(S){var j;return!!(S&&((j=S[l])!==null&&j!==void 0?j:S.readableDidRead||S.readableAborted))}function M(S){var j,K,W,ee,Q,le,ue,z,V,oe;return!!(S&&((j=(K=(W=(ee=(Q=(le=S[i])!==null&&le!==void 0?le:S.readableErrored)!==null&&Q!==void 0?Q:S.writableErrored)!==null&&ee!==void 0?ee:(ue=S._readableState)===null||ue===void 0?void 0:ue.errorEmitted)!==null&&W!==void 0?W:(z=S._writableState)===null||z===void 0?void 0:z.errorEmitted)!==null&&K!==void 0?K:(V=S._readableState)===null||V===void 0?void 0:V.errored)!==null&&j!==void 0?j:!((oe=S._writableState)===null||oe===void 0)&&oe.errored))}return _n={isDestroyed:v,kIsDestroyed:n,isDisturbed:E,kIsDisturbed:l,isErrored:M,kIsErrored:i,isReadable:a,kIsReadable:s,kIsClosedPromise:d,kControllerErrorFunction:w,kIsWritable:o,isClosed:h,isDuplexNodeStream:I,isFinished:f,isIterable:c,isReadableNodeStream:N,isReadableStream:B,isReadableEnded:J,isReadableFinished:X,isReadableErrored:_,isNodeStream:k,isWebStream:u,isWritable:m,isWritableNodeStream:O,isWritableStream:y,isWritableEnded:G,isWritableFinished:$,isWritableErrored:g,isServerRequest:A,isServerResponse:p,willEmitClose:P,isTransformStream:b},_n}var ji;function Et(){if(ji)return Ar.exports;ji=1;const r=Lt(),{AbortError:e,codes:t}=ke(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:s,once:o}=$e(),{validateAbortSignal:l,validateFunction:d,validateObject:w,validateBoolean:N}=nr(),{Promise:O,PromisePrototypeThen:I,SymbolDispose:k}=Ie(),{isClosed:B,isReadable:y,isReadableNodeStream:b,isReadableStream:u,isReadableFinished:c,isReadableErrored:v,isWritable:G,isWritableNodeStream:$,isWritableStream:J,isWritableFinished:X,isWritableErrored:a,isNodeStream:m,willEmitClose:f,kIsClosedPromise:g}=gt();let _;function h(E){return E.setHeader&&typeof E.abort=="function"}const C=()=>{};function p(E,M,S){var j,K;if(arguments.length===2?(S=M,M=s):M==null?M=s:w(M,"options"),d(S,"callback"),l(M.signal,"options.signal"),S=o(S),u(E)||J(E))return A(E,M,S);if(!m(E))throw new n("stream",["ReadableStream","WritableStream","Stream"],E);const W=(j=M.readable)!==null&&j!==void 0?j:b(E),ee=(K=M.writable)!==null&&K!==void 0?K:$(E),Q=E._writableState,le=E._readableState,ue=()=>{E.writable||oe()};let z=f(E)&&b(E)===W&&$(E)===ee,V=X(E,!1);const oe=()=>{V=!0,E.destroyed&&(z=!1),!(z&&(!E.readable||W))&&(!W||ce)&&S.call(E)};let ce=c(E,!1);const fe=()=>{ce=!0,E.destroyed&&(z=!1),!(z&&(!E.writable||ee))&&(!ee||V)&&S.call(E)},L=q=>{S.call(E,q)};let D=B(E);const F=()=>{D=!0;const q=a(E)||v(E);if(q&&typeof q!="boolean")return S.call(E,q);if(W&&!ce&&b(E,!0)&&!c(E,!1))return S.call(E,new i);if(ee&&!V&&!X(E,!1))return S.call(E,new i);S.call(E)},ne=()=>{D=!0;const q=a(E)||v(E);if(q&&typeof q!="boolean")return S.call(E,q);S.call(E)},se=()=>{E.req.on("finish",oe)};h(E)?(E.on("complete",oe),z||E.on("abort",F),E.req?se():E.on("request",se)):ee&&!Q&&(E.on("end",ue),E.on("close",ue)),!z&&typeof E.aborted=="boolean"&&E.on("aborted",F),E.on("end",fe),E.on("finish",oe),M.error!==!1&&E.on("error",L),E.on("close",F),D?r.nextTick(F):Q!=null&&Q.errorEmitted||le!=null&&le.errorEmitted?z||r.nextTick(ne):(!W&&(!z||y(E))&&(V||G(E)===!1)||!ee&&(!z||G(E))&&(ce||y(E)===!1)||le&&E.req&&E.aborted)&&r.nextTick(ne);const ie=()=>{S=C,E.removeListener("aborted",F),E.removeListener("complete",oe),E.removeListener("abort",F),E.removeListener("request",se),E.req&&E.req.removeListener("finish",oe),E.removeListener("end",ue),E.removeListener("close",ue),E.removeListener("finish",oe),E.removeListener("end",fe),E.removeListener("error",L),E.removeListener("close",F)};if(M.signal&&!D){const q=()=>{const Z=S;ie(),Z.call(E,new e(void 0,{cause:M.signal.reason}))};if(M.signal.aborted)r.nextTick(q);else{_=_||$e().addAbortListener;const Z=_(M.signal,q),re=S;S=o((...Y)=>{Z[k](),re.apply(E,Y)})}}return ie}function A(E,M,S){let j=!1,K=C;if(M.signal)if(K=()=>{j=!0,S.call(E,new e(void 0,{cause:M.signal.reason}))},M.signal.aborted)r.nextTick(K);else{_=_||$e().addAbortListener;const ee=_(M.signal,K),Q=S;S=o((...le)=>{ee[k](),Q.apply(E,le)})}const W=(...ee)=>{j||r.nextTick(()=>S.apply(E,ee))};return I(E[g].promise,W,W),C}function P(E,M){var S;let j=!1;return M===null&&(M=s),(S=M)!==null&&S!==void 0&&S.cleanup&&(N(M.cleanup,"cleanup"),j=M.cleanup),new O((K,W)=>{const ee=p(E,M,Q=>{j&&ee(),Q?W(Q):K()})})}return Ar.exports=p,Ar.exports.finished=P,Ar.exports}var mn,Wi;function jt(){if(Wi)return mn;Wi=1;const r=Lt(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=ke(),{Symbol:i}=Ie(),{kIsDestroyed:s,isDestroyed:o,isFinished:l,isServerRequest:d}=gt(),w=i("kDestroy"),N=i("kConstruct");function O(f,g,_){f&&(f.stack,g&&!g.errored&&(g.errored=f),_&&!_.errored&&(_.errored=f))}function I(f,g){const _=this._readableState,h=this._writableState,C=h||_;return h!=null&&h.destroyed||_!=null&&_.destroyed?(typeof g=="function"&&g(),this):(O(f,h,_),h&&(h.destroyed=!0),_&&(_.destroyed=!0),C.constructed?k(this,f,g):this.once(w,function(p){k(this,e(p,f),g)}),this)}function k(f,g,_){let h=!1;function C(p){if(h)return;h=!0;const A=f._readableState,P=f._writableState;O(p,P,A),P&&(P.closed=!0),A&&(A.closed=!0),typeof _=="function"&&_(p),p?r.nextTick(B,f,p):r.nextTick(y,f)}try{f._destroy(g||null,C)}catch(p){C(p)}}function B(f,g){b(f,g),y(f)}function y(f){const g=f._readableState,_=f._writableState;_&&(_.closeEmitted=!0),g&&(g.closeEmitted=!0),(_!=null&&_.emitClose||g!=null&&g.emitClose)&&f.emit("close")}function b(f,g){const _=f._readableState,h=f._writableState;h!=null&&h.errorEmitted||_!=null&&_.errorEmitted||(h&&(h.errorEmitted=!0),_&&(_.errorEmitted=!0),f.emit("error",g))}function u(){const f=this._readableState,g=this._writableState;f&&(f.constructed=!0,f.closed=!1,f.closeEmitted=!1,f.destroyed=!1,f.errored=null,f.errorEmitted=!1,f.reading=!1,f.ended=f.readable===!1,f.endEmitted=f.readable===!1),g&&(g.constructed=!0,g.destroyed=!1,g.closed=!1,g.closeEmitted=!1,g.errored=null,g.errorEmitted=!1,g.finalCalled=!1,g.prefinished=!1,g.ended=g.writable===!1,g.ending=g.writable===!1,g.finished=g.writable===!1)}function c(f,g,_){const h=f._readableState,C=f._writableState;if(C!=null&&C.destroyed||h!=null&&h.destroyed)return this;h!=null&&h.autoDestroy||C!=null&&C.autoDestroy?f.destroy(g):g&&(g.stack,C&&!C.errored&&(C.errored=g),h&&!h.errored&&(h.errored=g),_?r.nextTick(b,f,g):b(f,g))}function v(f,g){if(typeof f._construct!="function")return;const _=f._readableState,h=f._writableState;_&&(_.constructed=!1),h&&(h.constructed=!1),f.once(N,g),!(f.listenerCount(N)>1)&&r.nextTick(G,f)}function G(f){let g=!1;function _(h){if(g){c(f,h??new t);return}g=!0;const C=f._readableState,p=f._writableState,A=p||C;C&&(C.constructed=!0),p&&(p.constructed=!0),A.destroyed?f.emit(w,h):h?c(f,h,!0):r.nextTick($,f)}try{f._construct(h=>{r.nextTick(_,h)})}catch(h){r.nextTick(_,h)}}function $(f){f.emit(N)}function J(f){return f?.setHeader&&typeof f.abort=="function"}function X(f){f.emit("close")}function a(f,g){f.emit("error",g),r.nextTick(X,f)}function m(f,g){!f||o(f)||(!g&&!l(f)&&(g=new n),d(f)?(f.socket=null,f.destroy(g)):J(f)?f.abort():J(f.req)?f.req.abort():typeof f.destroy=="function"?f.destroy(g):typeof f.close=="function"?f.close():g?r.nextTick(a,f,g):r.nextTick(X,f),f.destroyed||(f[s]=!0))}return mn={construct:v,destroyer:m,destroy:I,undestroy:u,errorOrDestroy:c},mn}var En,Fi;function ni(){if(Fi)return En;Fi=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Ie(),{EventEmitter:t}=rr.requireEvents();function n(s){t.call(this,s)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(s,o){const l=this;function d(y){s.writable&&s.write(y)===!1&&l.pause&&l.pause()}l.on("data",d);function w(){l.readable&&l.resume&&l.resume()}s.on("drain",w),!s._isStdio&&(!o||o.end!==!1)&&(l.on("end",O),l.on("close",I));let N=!1;function O(){N||(N=!0,s.end())}function I(){N||(N=!0,typeof s.destroy=="function"&&s.destroy())}function k(y){B(),t.listenerCount(this,"error")===0&&this.emit("error",y)}i(l,"error",k),i(s,"error",k);function B(){l.removeListener("data",d),s.removeListener("drain",w),l.removeListener("end",O),l.removeListener("close",I),l.removeListener("error",k),s.removeListener("error",k),l.removeListener("end",B),l.removeListener("close",B),s.removeListener("close",B)}return l.on("end",B),l.on("close",B),s.on("close",B),s.emit("pipe",l),s};function i(s,o,l){if(typeof s.prependListener=="function")return s.prependListener(o,l);!s._events||!s._events[o]?s.on(o,l):r(s._events[o])?s._events[o].unshift(l):s._events[o]=[l,s._events[o]]}return En={Stream:n,prependListener:i},En}var Sn={exports:{}},$i;function Mr(){return $i||($i=1,(function(r){const{SymbolDispose:e}=Ie(),{AbortError:t,codes:n}=ke(),{isNodeStream:i,isWebStream:s,kControllerErrorFunction:o}=gt(),l=Et(),{ERR_INVALID_ARG_TYPE:d}=n;let w;const N=(O,I)=>{if(typeof O!="object"||!("aborted"in O))throw new d(I,"AbortSignal",O)};r.exports.addAbortSignal=function(I,k){if(N(I,"signal"),!i(k)&&!s(k))throw new d("stream",["ReadableStream","WritableStream","Stream"],k);return r.exports.addAbortSignalNoValidate(I,k)},r.exports.addAbortSignalNoValidate=function(O,I){if(typeof O!="object"||!("aborted"in O))return I;const k=i(I)?()=>{I.destroy(new t(void 0,{cause:O.reason}))}:()=>{I[o](new t(void 0,{cause:O.reason}))};if(O.aborted)k();else{w=w||$e().addAbortListener;const B=w(O,k);l(I,B[e])}return I}})(Sn)),Sn.exports}var vn,Hi;function aa(){if(Hi)return vn;Hi=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Ie(),{Buffer:i}=xe.requireDist(),{inspect:s}=$e();return vn=class{constructor(){this.head=null,this.tail=null,this.length=0}push(l){const d={data:l,next:null};this.length>0?this.tail.next=d:this.head=d,this.tail=d,++this.length}unshift(l){const d={data:l,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}shift(){if(this.length===0)return;const l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}clear(){this.head=this.tail=null,this.length=0}join(l){if(this.length===0)return"";let d=this.head,w=""+d.data;for(;(d=d.next)!==null;)w+=l+d.data;return w}concat(l){if(this.length===0)return i.alloc(0);const d=i.allocUnsafe(l>>>0);let w=this.head,N=0;for(;w;)t(d,w.data,N),N+=w.data.length,w=w.next;return d}consume(l,d){const w=this.head.data;if(l<w.length){const N=w.slice(0,l);return this.head.data=w.slice(l),N}return l===w.length?this.shift():d?this._getString(l):this._getBuffer(l)}first(){return this.head.data}*[e](){for(let l=this.head;l;l=l.next)yield l.data}_getString(l){let d="",w=this.head,N=0;do{const O=w.data;if(l>O.length)d+=O,l-=O.length;else{l===O.length?(d+=O,++N,w.next?this.head=w.next:this.head=this.tail=null):(d+=r(O,0,l),this.head=w,w.data=r(O,l));break}++N}while((w=w.next)!==null);return this.length-=N,d}_getBuffer(l){const d=i.allocUnsafe(l),w=l;let N=this.head,O=0;do{const I=N.data;if(l>I.length)t(d,I,w-l),l-=I.length;else{l===I.length?(t(d,I,w-l),++O,N.next?this.head=N.next:this.head=this.tail=null):(t(d,new n(I.buffer,I.byteOffset,l),w-l),this.head=N,N.data=I.slice(l));break}++O}while((N=N.next)!==null);return this.length-=O,d}[Symbol.for("nodejs.util.inspect.custom")](l,d){return s(this,{...d,depth:0,customInspect:!1})}},vn}var An,zi;function Dr(){if(zi)return An;zi=1;const{MathFloor:r,NumberIsInteger:e}=Ie(),{validateInteger:t}=nr(),{ERR_INVALID_ARG_VALUE:n}=ke().codes;let i=16*1024,s=16;function o(N,O,I){return N.highWaterMark!=null?N.highWaterMark:O?N[I]:null}function l(N){return N?s:i}function d(N,O){t(O,"value",0),N?s=O:i=O}function w(N,O,I,k){const B=o(O,k,I);if(B!=null){if(!e(B)||B<0){const y=k?`options.${I}`:"options.highWaterMark";throw new n(y,B)}return r(B)}return l(N.objectMode)}return An={getHighWaterMark:w,getDefaultHighWaterMark:l,setDefaultHighWaterMark:d},An}var Rn={},Gi;function la(){if(Gi)return Rn;Gi=1;var r=xe.requireSafeBuffer().Buffer,e=r.isEncoding||function(u){switch(u=""+u,u&&u.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 t(u){if(!u)return"utf8";for(var c;;)switch(u){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 u;default:if(c)return;u=(""+u).toLowerCase(),c=!0}}function n(u){var c=t(u);if(typeof c!="string"&&(r.isEncoding===e||!e(u)))throw new Error("Unknown encoding: "+u);return c||u}Rn.StringDecoder=i;function i(u){this.encoding=n(u);var c;switch(this.encoding){case"utf16le":this.text=O,this.end=I,c=4;break;case"utf8":this.fillLast=d,c=4;break;case"base64":this.text=k,this.end=B,c=3;break;default:this.write=y,this.end=b;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(c)}i.prototype.write=function(u){if(u.length===0)return"";var c,v;if(this.lastNeed){if(c=this.fillLast(u),c===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<u.length?c?c+this.text(u,v):this.text(u,v):c||""},i.prototype.end=N,i.prototype.text=w,i.prototype.fillLast=function(u){if(this.lastNeed<=u.length)return u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,this.lastTotal-this.lastNeed,0,u.length),this.lastNeed-=u.length};function s(u){return u<=127?0:u>>5===6?2:u>>4===14?3:u>>3===30?4:u>>6===2?-1:-2}function o(u,c,v){var G=c.length-1;if(G<v)return 0;var $=s(c[G]);return $>=0?($>0&&(u.lastNeed=$-1),$):--G<v||$===-2?0:($=s(c[G]),$>=0?($>0&&(u.lastNeed=$-2),$):--G<v||$===-2?0:($=s(c[G]),$>=0?($>0&&($===2?$=0:u.lastNeed=$-3),$):0))}function l(u,c,v){if((c[0]&192)!==128)return u.lastNeed=0,"�";if(u.lastNeed>1&&c.length>1){if((c[1]&192)!==128)return u.lastNeed=1,"�";if(u.lastNeed>2&&c.length>2&&(c[2]&192)!==128)return u.lastNeed=2,"�"}}function d(u){var c=this.lastTotal-this.lastNeed,v=l(this,u);if(v!==void 0)return v;if(this.lastNeed<=u.length)return u.copy(this.lastChar,c,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);u.copy(this.lastChar,c,0,u.length),this.lastNeed-=u.length}function w(u,c){var v=o(this,u,c);if(!this.lastNeed)return u.toString("utf8",c);this.lastTotal=v;var G=u.length-(v-this.lastNeed);return u.copy(this.lastChar,0,G),u.toString("utf8",c,G)}function N(u){var c=u&&u.length?this.write(u):"";return this.lastNeed?c+"�":c}function O(u,c){if((u.length-c)%2===0){var v=u.toString("utf16le",c);if(v){var G=v.charCodeAt(v.length-1);if(G>=55296&&G<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=u[u.length-1],u.toString("utf16le",c,u.length-1)}function I(u){var c=u&&u.length?this.write(u):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return c+this.lastChar.toString("utf16le",0,v)}return c}function k(u,c){var v=(u.length-c)%3;return v===0?u.toString("base64",c):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=u[u.length-1]:(this.lastChar[0]=u[u.length-2],this.lastChar[1]=u[u.length-1]),u.toString("base64",c,u.length-v))}function B(u){var c=u&&u.length?this.write(u):"";return this.lastNeed?c+this.lastChar.toString("base64",0,3-this.lastNeed):c}function y(u){return u.toString(this.encoding)}function b(u){return u&&u.length?this.write(u):""}return Rn}var In,Vi;function Ko(){if(Vi)return In;Vi=1;const r=Lt(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Ie(),{Buffer:i}=xe.requireDist(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:o}=ke().codes;function l(d,w,N){let O;if(typeof w=="string"||w instanceof i)return new d({objectMode:!0,...N,read(){this.push(w),this.push(null)}});let I;if(w&&w[t])I=!0,O=w[t]();else if(w&&w[n])I=!1,O=w[n]();else throw new s("iterable",["Iterable"],w);const k=new d({objectMode:!0,highWaterMark:1,...N});let B=!1;k._read=function(){B||(B=!0,b())},k._destroy=function(u,c){e(y(u),()=>r.nextTick(c,u),v=>r.nextTick(c,v||u))};async function y(u){const c=u!=null,v=typeof O.throw=="function";if(c&&v){const{value:G,done:$}=await O.throw(u);if(await G,$)return}if(typeof O.return=="function"){const{value:G}=await O.return();await G}}async function b(){for(;;){try{const{value:u,done:c}=I?await O.next():O.next();if(c)k.push(null);else{const v=u&&typeof u.then=="function"?await u:u;if(v===null)throw B=!1,new o;if(k.push(v))continue;B=!1}}catch(u){k.destroy(u)}break}}return k}return In=l,In}var Tn,Ki;function qr(){if(Ki)return Tn;Ki=1;const r=Lt(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:o,ObjectSetPrototypeOf:l,Promise:d,SafeSet:w,SymbolAsyncDispose:N,SymbolAsyncIterator:O,Symbol:I}=Ie();Tn=Y,Y.ReadableState=re;const{EventEmitter:k}=rr.requireEvents(),{Stream:B,prependListener:y}=ni(),{Buffer:b}=xe.requireDist(),{addAbortSignal:u}=Mr(),c=Et();let v=$e().debuglog("stream",R=>{v=R});const G=aa(),$=jt(),{getHighWaterMark:J,getDefaultHighWaterMark:X}=Dr(),{aggregateTwoErrors:a,codes:{ERR_INVALID_ARG_TYPE:m,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_OUT_OF_RANGE:g,ERR_STREAM_PUSH_AFTER_EOF:_,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:h},AbortError:C}=ke(),{validateObject:p}=nr(),A=I("kPaused"),{StringDecoder:P}=la(),E=Ko();l(Y.prototype,B.prototype),l(Y,B);const M=()=>{},{errorOrDestroy:S}=$,j=1,K=2,W=4,ee=8,Q=16,le=32,ue=64,z=128,V=256,oe=512,ce=1024,fe=2048,L=4096,D=8192,F=16384,ne=32768,se=65536,ie=1<<17,q=1<<18;function Z(R){return{enumerable:!1,get(){return(this.state&R)!==0},set(x){x?this.state|=R:this.state&=~R}}}s(re.prototype,{objectMode:Z(j),ended:Z(K),endEmitted:Z(W),reading:Z(ee),constructed:Z(Q),sync:Z(le),needReadable:Z(ue),emittedReadable:Z(z),readableListening:Z(V),resumeScheduled:Z(oe),errorEmitted:Z(ce),emitClose:Z(fe),autoDestroy:Z(L),destroyed:Z(D),closed:Z(F),closeEmitted:Z(ne),multiAwaitDrain:Z(se),readingMore:Z(ie),dataEmitted:Z(q)});function re(R,x,te){typeof te!="boolean"&&(te=x instanceof ht()),this.state=fe|L|Q|le,R&&R.objectMode&&(this.state|=j),te&&R&&R.readableObjectMode&&(this.state|=j),this.highWaterMark=R?J(this,R,"readableHighWaterMark",te):X(!1),this.buffer=new G,this.length=0,this.pipes=[],this.flowing=null,this[A]=null,R&&R.emitClose===!1&&(this.state&=~fe),R&&R.autoDestroy===!1&&(this.state&=~L),this.errored=null,this.defaultEncoding=R&&R.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,R&&R.encoding&&(this.decoder=new P(R.encoding),this.encoding=R.encoding)}function Y(R){if(!(this instanceof Y))return new Y(R);const x=this instanceof ht();this._readableState=new re(R,this,x),R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.construct=="function"&&(this._construct=R.construct),R.signal&&!x&&u(R.signal,this)),B.call(this,R),$.construct(this,()=>{this._readableState.needReadable&&Me(this,this._readableState)})}Y.prototype.destroy=$.destroy,Y.prototype._undestroy=$.undestroy,Y.prototype._destroy=function(R,x){x(R)},Y.prototype[k.captureRejectionSymbol]=function(R){this.destroy(R)},Y.prototype[N]=function(){let R;return this.destroyed||(R=this.readableEnded?null:new C,this.destroy(R)),new d((x,te)=>c(this,ae=>ae&&ae!==R?te(ae):x(null)))},Y.prototype.push=function(R,x){return we(this,R,x,!1)},Y.prototype.unshift=function(R,x){return we(this,R,x,!0)};function we(R,x,te,ae){v("readableAddChunk",x);const de=R._readableState;let Ne;if((de.state&j)===0&&(typeof x=="string"?(te=te||de.defaultEncoding,de.encoding!==te&&(ae&&de.encoding?x=b.from(x,te).toString(de.encoding):(x=b.from(x,te),te=""))):x instanceof b?te="":B._isUint8Array(x)?(x=B._uint8ArrayToBuffer(x),te=""):x!=null&&(Ne=new m("chunk",["string","Buffer","Uint8Array"],x))),Ne)S(R,Ne);else if(x===null)de.state&=~ee,Be(R,de);else if((de.state&j)!==0||x&&x.length>0)if(ae)if((de.state&W)!==0)S(R,new h);else{if(de.destroyed||de.errored)return!1;Le(R,de,x,!0)}else if(de.ended)S(R,new _);else{if(de.destroyed||de.errored)return!1;de.state&=~ee,de.decoder&&!te?(x=de.decoder.write(x),de.objectMode||x.length!==0?Le(R,de,x,!1):Me(R,de)):Le(R,de,x,!1)}else ae||(de.state&=~ee,Me(R,de));return!de.ended&&(de.length<de.highWaterMark||de.length===0)}function Le(R,x,te,ae){x.flowing&&x.length===0&&!x.sync&&R.listenerCount("data")>0?((x.state&se)!==0?x.awaitDrainWriters.clear():x.awaitDrainWriters=null,x.dataEmitted=!0,R.emit("data",te)):(x.length+=x.objectMode?1:te.length,ae?x.buffer.unshift(te):x.buffer.push(te),(x.state&ue)!==0&&Ze(R)),Me(R,x)}Y.prototype.isPaused=function(){const R=this._readableState;return R[A]===!0||R.flowing===!1},Y.prototype.setEncoding=function(R){const x=new P(R);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;const te=this._readableState.buffer;let ae="";for(const de of te)ae+=x.write(de);return te.clear(),ae!==""&&te.push(ae),this._readableState.length=ae.length,this};const ye=1073741824;function De(R){if(R>ye)throw new g("size","<= 1GiB",R);return R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++,R}function Oe(R,x){return R<=0||x.length===0&&x.ended?0:(x.state&j)!==0?1:n(R)?x.flowing&&x.length?x.buffer.first().length:x.length:R<=x.length?R:x.ended?x.length:0}Y.prototype.read=function(R){v("read",R),R===void 0?R=NaN:t(R)||(R=i(R,10));const x=this._readableState,te=R;if(R>x.highWaterMark&&(x.highWaterMark=De(R)),R!==0&&(x.state&=~z),R===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return v("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Ft(this):Ze(this),null;if(R=Oe(R,x),R===0&&x.ended)return x.length===0&&Ft(this),null;let ae=(x.state&ue)!==0;if(v("need readable",ae),(x.length===0||x.length-R<x.highWaterMark)&&(ae=!0,v("length less than watermark",ae)),x.ended||x.reading||x.destroyed||x.errored||!x.constructed)ae=!1,v("reading, ended or constructing",ae);else if(ae){v("do read"),x.state|=ee|le,x.length===0&&(x.state|=ue);try{this._read(x.highWaterMark)}catch(Ne){S(this,Ne)}x.state&=~le,x.reading||(R=Oe(te,x))}let de;return R>0?de=pt(R,x):de=null,de===null?(x.needReadable=x.length<=x.highWaterMark,R=0):(x.length-=R,x.multiAwaitDrain?x.awaitDrainWriters.clear():x.awaitDrainWriters=null),x.length===0&&(x.ended||(x.needReadable=!0),te!==R&&x.ended&&Ft(this)),de!==null&&!x.errorEmitted&&!x.closeEmitted&&(x.dataEmitted=!0,this.emit("data",de)),de};function Be(R,x){if(v("onEofChunk"),!x.ended){if(x.decoder){const te=x.decoder.end();te&&te.length&&(x.buffer.push(te),x.length+=x.objectMode?1:te.length)}x.ended=!0,x.sync?Ze(R):(x.needReadable=!1,x.emittedReadable=!0,St(R))}}function Ze(R){const x=R._readableState;v("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(v("emitReadable",x.flowing),x.emittedReadable=!0,r.nextTick(St,R))}function St(R){const x=R._readableState;v("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&!x.errored&&(x.length||x.ended)&&(R.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,Wt(R)}function Me(R,x){!x.readingMore&&x.constructed&&(x.readingMore=!0,r.nextTick(lr,R,x))}function lr(R,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){const te=x.length;if(v("maybeReadMore read 0"),R.read(0),te===x.length)break}x.readingMore=!1}Y.prototype._read=function(R){throw new f("_read()")},Y.prototype.pipe=function(R,x){const te=this,ae=this._readableState;ae.pipes.length===1&&(ae.multiAwaitDrain||(ae.multiAwaitDrain=!0,ae.awaitDrainWriters=new w(ae.awaitDrainWriters?[ae.awaitDrainWriters]:[]))),ae.pipes.push(R),v("pipe count=%d opts=%j",ae.pipes.length,x);const Ne=(!x||x.end!==!1)&&R!==r.stdout&&R!==r.stderr?hr:vt;ae.endEmitted?r.nextTick(Ne):te.once("end",Ne),R.on("unpipe",Ue);function Ue(at,Xe){v("onunpipe"),at===te&&Xe&&Xe.hasUnpiped===!1&&(Xe.hasUnpiped=!0,Vr())}function hr(){v("onend"),R.end()}let je,gr=!1;function Vr(){v("cleanup"),R.removeListener("close",rt),R.removeListener("finish",zt),je&&R.removeListener("drain",je),R.removeListener("error",Ht),R.removeListener("unpipe",Ue),te.removeListener("end",hr),te.removeListener("end",vt),te.removeListener("data",wr),gr=!0,je&&ae.awaitDrainWriters&&(!R._writableState||R._writableState.needDrain)&&je()}function pr(){gr||(ae.pipes.length===1&&ae.pipes[0]===R?(v("false write response, pause",0),ae.awaitDrainWriters=R,ae.multiAwaitDrain=!1):ae.pipes.length>1&&ae.pipes.includes(R)&&(v("false write response, pause",ae.awaitDrainWriters.size),ae.awaitDrainWriters.add(R)),te.pause()),je||(je=Hr(te,R),R.on("drain",je))}te.on("data",wr);function wr(at){v("ondata");const Xe=R.write(at);v("dest.write",Xe),Xe===!1&&pr()}function Ht(at){if(v("onerror",at),vt(),R.removeListener("error",Ht),R.listenerCount("error")===0){const Xe=R._writableState||R._readableState;Xe&&!Xe.errorEmitted?S(R,at):R.emit("error",at)}}y(R,"error",Ht);function rt(){R.removeListener("finish",zt),vt()}R.once("close",rt);function zt(){v("onfinish"),R.removeListener("close",rt),vt()}R.once("finish",zt);function vt(){v("unpipe"),te.unpipe(R)}return R.emit("pipe",te),R.writableNeedDrain===!0?pr():ae.flowing||(v("pipe resume"),te.resume()),R};function Hr(R,x){return function(){const ae=R._readableState;ae.awaitDrainWriters===x?(v("pipeOnDrain",1),ae.awaitDrainWriters=null):ae.multiAwaitDrain&&(v("pipeOnDrain",ae.awaitDrainWriters.size),ae.awaitDrainWriters.delete(x)),(!ae.awaitDrainWriters||ae.awaitDrainWriters.size===0)&&R.listenerCount("data")&&R.resume()}}Y.prototype.unpipe=function(R){const x=this._readableState,te={hasUnpiped:!1};if(x.pipes.length===0)return this;if(!R){const de=x.pipes;x.pipes=[],this.pause();for(let Ne=0;Ne<de.length;Ne++)de[Ne].emit("unpipe",this,{hasUnpiped:!1});return this}const ae=e(x.pipes,R);return ae===-1?this:(x.pipes.splice(ae,1),x.pipes.length===0&&this.pause(),R.emit("unpipe",this,te),this)},Y.prototype.on=function(R,x){const te=B.prototype.on.call(this,R,x),ae=this._readableState;return R==="data"?(ae.readableListening=this.listenerCount("readable")>0,ae.flowing!==!1&&this.resume()):R==="readable"&&!ae.endEmitted&&!ae.readableListening&&(ae.readableListening=ae.needReadable=!0,ae.flowing=!1,ae.emittedReadable=!1,v("on readable",ae.length,ae.reading),ae.length?Ze(this):ae.reading||r.nextTick(ot,this)),te},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(R,x){const te=B.prototype.removeListener.call(this,R,x);return R==="readable"&&r.nextTick(ur,this),te},Y.prototype.off=Y.prototype.removeListener,Y.prototype.removeAllListeners=function(R){const x=B.prototype.removeAllListeners.apply(this,arguments);return(R==="readable"||R===void 0)&&r.nextTick(ur,this),x};function ur(R){const x=R._readableState;x.readableListening=R.listenerCount("readable")>0,x.resumeScheduled&&x[A]===!1?x.flowing=!0:R.listenerCount("data")>0?R.resume():x.readableListening||(x.flowing=null)}function ot(R){v("readable nexttick read 0"),R.read(0)}Y.prototype.resume=function(){const R=this._readableState;return R.flowing||(v("resume"),R.flowing=!R.readableListening,Bt(this,R)),R[A]=!1,this};function Bt(R,x){x.resumeScheduled||(x.resumeScheduled=!0,r.nextTick(zr,R,x))}function zr(R,x){v("resume",x.reading),x.reading||R.read(0),x.resumeScheduled=!1,R.emit("resume"),Wt(R),x.flowing&&!x.reading&&R.read(0)}Y.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[A]=!0,this};function Wt(R){const x=R._readableState;for(v("flow",x.flowing);x.flowing&&R.read()!==null;);}Y.prototype.wrap=function(R){let x=!1;R.on("data",ae=>{!this.push(ae)&&R.pause&&(x=!0,R.pause())}),R.on("end",()=>{this.push(null)}),R.on("error",ae=>{S(this,ae)}),R.on("close",()=>{this.destroy()}),R.on("destroy",()=>{this.destroy()}),this._read=()=>{x&&R.resume&&(x=!1,R.resume())};const te=o(R);for(let ae=1;ae<te.length;ae++){const de=te[ae];this[de]===void 0&&typeof R[de]=="function"&&(this[de]=R[de].bind(R))}return this},Y.prototype[O]=function(){return fr(this)},Y.prototype.iterator=function(R){return R!==void 0&&p(R,"options"),fr(this,R)};function fr(R,x){typeof R.read!="function"&&(R=Y.wrap(R,{objectMode:!0}));const te=cr(R,x);return te.stream=R,te}async function*cr(R,x){let te=M;function ae(Ue){this===R?(te(),te=M):te=Ue}R.on("readable",ae);let de;const Ne=c(R,{writable:!1},Ue=>{de=Ue?a(de,Ue):null,te(),te=M});try{for(;;){const Ue=R.destroyed?null:R.read();if(Ue!==null)yield Ue;else{if(de)throw de;if(de===null)return;await new d(ae)}}}catch(Ue){throw de=a(de,Ue),de}finally{(de||x?.destroyOnReturn!==!1)&&(de===void 0||R._readableState.autoDestroy)?$.destroyer(R,null):(R.off("readable",ae),Ne())}}s(Y.prototype,{readable:{__proto__:null,get(){const R=this._readableState;return!!R&&R.readable!==!1&&!R.destroyed&&!R.errorEmitted&&!R.endEmitted},set(R){this._readableState&&(this._readableState.readable=!!R)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(R){this._readableState&&(this._readableState.destroyed=R)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(re.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[A]!==!1},set(R){this[A]=!!R}}}),Y._fromList=pt;function pt(R,x){if(x.length===0)return null;let te;return x.objectMode?te=x.buffer.shift():!R||R>=x.length?(x.decoder?te=x.buffer.join(""):x.buffer.length===1?te=x.buffer.first():te=x.buffer.concat(x.length),x.buffer.clear()):te=x.buffer.consume(R,x.decoder),te}function Ft(R){const x=R._readableState;v("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,r.nextTick(st,x,R))}function st(R,x){if(v("endReadableNT",R.endEmitted,R.length),!R.errored&&!R.closeEmitted&&!R.endEmitted&&R.length===0){if(R.endEmitted=!0,x.emit("end"),x.writable&&x.allowHalfOpen===!1)r.nextTick(Gr,x);else if(R.autoDestroy){const te=x._writableState;(!te||te.autoDestroy&&(te.finished||te.writable===!1))&&x.destroy()}}}function Gr(R){R.writable&&!R.writableEnded&&!R.destroyed&&R.end()}Y.from=function(R,x){return E(Y,R,x)};let $t;function dr(){return $t===void 0&&($t={}),$t}return Y.fromWeb=function(R,x){return dr().newStreamReadableFromReadableStream(R,x)},Y.toWeb=function(R,x){return dr().newReadableStreamFromStreamReadable(R,x)},Y.wrap=function(R,x){var te,ae;return new Y({objectMode:(te=(ae=R.readableObjectMode)!==null&&ae!==void 0?ae:R.objectMode)!==null&&te!==void 0?te:!0,...x,destroy(de,Ne){$.destroyer(R,de),Ne(de)}}).wrap(R)},Tn}var xn,Yi;function ii(){if(Yi)return xn;Yi=1;const r=Lt(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:o,StringPrototypeToLowerCase:l,Symbol:d,SymbolHasInstance:w}=Ie();xn=p,p.WritableState=h;const{EventEmitter:N}=rr.requireEvents(),O=ni().Stream,{Buffer:I}=xe.requireDist(),k=jt(),{addAbortSignal:B}=Mr(),{getHighWaterMark:y,getDefaultHighWaterMark:b}=Dr(),{ERR_INVALID_ARG_TYPE:u,ERR_METHOD_NOT_IMPLEMENTED:c,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:G,ERR_STREAM_DESTROYED:$,ERR_STREAM_ALREADY_FINISHED:J,ERR_STREAM_NULL_VALUES:X,ERR_STREAM_WRITE_AFTER_END:a,ERR_UNKNOWN_ENCODING:m}=ke().codes,{errorOrDestroy:f}=k;o(p.prototype,O.prototype),o(p,O);function g(){}const _=d("kOnFinished");function h(L,D,F){typeof F!="boolean"&&(F=D instanceof ht()),this.objectMode=!!(L&&L.objectMode),F&&(this.objectMode=this.objectMode||!!(L&&L.writableObjectMode)),this.highWaterMark=L?y(this,L,"writableHighWaterMark",F):b(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ne=!!(L&&L.decodeStrings===!1);this.decodeStrings=!ne,this.defaultEncoding=L&&L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=S.bind(void 0,D),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,C(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!L||L.emitClose!==!1,this.autoDestroy=!L||L.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[_]=[]}function C(L){L.buffered=[],L.bufferedIndex=0,L.allBuffers=!0,L.allNoop=!0}h.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(h.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function p(L){const D=this instanceof ht();if(!D&&!n(p,this))return new p(L);this._writableState=new h(L,this,D),L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final),typeof L.construct=="function"&&(this._construct=L.construct),L.signal&&B(L.signal,this)),O.call(this,L),k.construct(this,()=>{const F=this._writableState;F.writing||ee(this,F),z(this,F)})}i(p,w,{__proto__:null,value:function(L){return n(this,L)?!0:this!==p?!1:L&&L._writableState instanceof h}}),p.prototype.pipe=function(){f(this,new G)};function A(L,D,F,ne){const se=L._writableState;if(typeof F=="function")ne=F,F=se.defaultEncoding;else{if(!F)F=se.defaultEncoding;else if(F!=="buffer"&&!I.isEncoding(F))throw new m(F);typeof ne!="function"&&(ne=g)}if(D===null)throw new X;if(!se.objectMode)if(typeof D=="string")se.decodeStrings!==!1&&(D=I.from(D,F),F="buffer");else if(D instanceof I)F="buffer";else if(O._isUint8Array(D))D=O._uint8ArrayToBuffer(D),F="buffer";else throw new u("chunk",["string","Buffer","Uint8Array"],D);let ie;return se.ending?ie=new a:se.destroyed&&(ie=new $("write")),ie?(r.nextTick(ne,ie),f(L,ie,!0),ie):(se.pendingcb++,P(L,se,D,F,ne))}p.prototype.write=function(L,D,F){return A(this,L,D,F)===!0},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){const L=this._writableState;L.corked&&(L.corked--,L.writing||ee(this,L))},p.prototype.setDefaultEncoding=function(D){if(typeof D=="string"&&(D=l(D)),!I.isEncoding(D))throw new m(D);return this._writableState.defaultEncoding=D,this};function P(L,D,F,ne,se){const ie=D.objectMode?1:F.length;D.length+=ie;const q=D.length<D.highWaterMark;return q||(D.needDrain=!0),D.writing||D.corked||D.errored||!D.constructed?(D.buffered.push({chunk:F,encoding:ne,callback:se}),D.allBuffers&&ne!=="buffer"&&(D.allBuffers=!1),D.allNoop&&se!==g&&(D.allNoop=!1)):(D.writelen=ie,D.writecb=se,D.writing=!0,D.sync=!0,L._write(F,ne,D.onwrite),D.sync=!1),q&&!D.errored&&!D.destroyed}function E(L,D,F,ne,se,ie,q){D.writelen=ne,D.writecb=q,D.writing=!0,D.sync=!0,D.destroyed?D.onwrite(new $("write")):F?L._writev(se,D.onwrite):L._write(se,ie,D.onwrite),D.sync=!1}function M(L,D,F,ne){--D.pendingcb,ne(F),W(D),f(L,F)}function S(L,D){const F=L._writableState,ne=F.sync,se=F.writecb;if(typeof se!="function"){f(L,new v);return}F.writing=!1,F.writecb=null,F.length-=F.writelen,F.writelen=0,D?(D.stack,F.errored||(F.errored=D),L._readableState&&!L._readableState.errored&&(L._readableState.errored=D),ne?r.nextTick(M,L,F,D,se):M(L,F,D,se)):(F.buffered.length>F.bufferedIndex&&ee(L,F),ne?F.afterWriteTickInfo!==null&&F.afterWriteTickInfo.cb===se?F.afterWriteTickInfo.count++:(F.afterWriteTickInfo={count:1,cb:se,stream:L,state:F},r.nextTick(j,F.afterWriteTickInfo)):K(L,F,1,se))}function j({stream:L,state:D,count:F,cb:ne}){return D.afterWriteTickInfo=null,K(L,D,F,ne)}function K(L,D,F,ne){for(!D.ending&&!L.destroyed&&D.length===0&&D.needDrain&&(D.needDrain=!1,L.emit("drain"));F-- >0;)D.pendingcb--,ne();D.destroyed&&W(D),z(L,D)}function W(L){if(L.writing)return;for(let se=L.bufferedIndex;se<L.buffered.length;++se){var D;const{chunk:ie,callback:q}=L.buffered[se],Z=L.objectMode?1:ie.length;L.length-=Z,q((D=L.errored)!==null&&D!==void 0?D:new $("write"))}const F=L[_].splice(0);for(let se=0;se<F.length;se++){var ne;F[se]((ne=L.errored)!==null&&ne!==void 0?ne:new $("end"))}C(L)}function ee(L,D){if(D.corked||D.bufferProcessing||D.destroyed||!D.constructed)return;const{buffered:F,bufferedIndex:ne,objectMode:se}=D,ie=F.length-ne;if(!ie)return;let q=ne;if(D.bufferProcessing=!0,ie>1&&L._writev){D.pendingcb-=ie-1;const Z=D.allNoop?g:Y=>{for(let we=q;we<F.length;++we)F[we].callback(Y)},re=D.allNoop&&q===0?F:e(F,q);re.allBuffers=D.allBuffers,E(L,D,!0,D.length,re,"",Z),C(D)}else{do{const{chunk:Z,encoding:re,callback:Y}=F[q];F[q++]=null;const we=se?1:Z.length;E(L,D,!1,we,Z,re,Y)}while(q<F.length&&!D.writing);q===F.length?C(D):q>256?(F.splice(0,q),D.bufferedIndex=0):D.bufferedIndex=q}D.bufferProcessing=!1}p.prototype._write=function(L,D,F){if(this._writev)this._writev([{chunk:L,encoding:D}],F);else throw new c("_write()")},p.prototype._writev=null,p.prototype.end=function(L,D,F){const ne=this._writableState;typeof L=="function"?(F=L,L=null,D=null):typeof D=="function"&&(F=D,D=null);let se;if(L!=null){const ie=A(this,L,D);ie instanceof t&&(se=ie)}return ne.corked&&(ne.corked=1,this.uncork()),se||(!ne.errored&&!ne.ending?(ne.ending=!0,z(this,ne,!0),ne.ended=!0):ne.finished?se=new J("end"):ne.destroyed&&(se=new $("end"))),typeof F=="function"&&(se||ne.finished?r.nextTick(F,se):ne[_].push(F)),this};function Q(L){return L.ending&&!L.destroyed&&L.constructed&&L.length===0&&!L.errored&&L.buffered.length===0&&!L.finished&&!L.writing&&!L.errorEmitted&&!L.closeEmitted}function le(L,D){let F=!1;function ne(se){if(F){f(L,se??v());return}if(F=!0,D.pendingcb--,se){const ie=D[_].splice(0);for(let q=0;q<ie.length;q++)ie[q](se);f(L,se,D.sync)}else Q(D)&&(D.prefinished=!0,L.emit("prefinish"),D.pendingcb++,r.nextTick(V,L,D))}D.sync=!0,D.pendingcb++;try{L._final(ne)}catch(se){ne(se)}D.sync=!1}function ue(L,D){!D.prefinished&&!D.finalCalled&&(typeof L._final=="function"&&!D.destroyed?(D.finalCalled=!0,le(L,D)):(D.prefinished=!0,L.emit("prefinish")))}function z(L,D,F){Q(D)&&(ue(L,D),D.pendingcb===0&&(F?(D.pendingcb++,r.nextTick((ne,se)=>{Q(se)?V(ne,se):se.pendingcb--},L,D)):Q(D)&&(D.pendingcb++,V(L,D))))}function V(L,D){D.pendingcb--,D.finished=!0;const F=D[_].splice(0);for(let ne=0;ne<F.length;ne++)F[ne]();if(L.emit("finish"),D.autoDestroy){const ne=L._readableState;(!ne||ne.autoDestroy&&(ne.endEmitted||ne.readable===!1))&&L.destroy()}}s(p.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(L){this._writableState&&(this._writableState.destroyed=L)}},writable:{__proto__:null,get(){const L=this._writableState;return!!L&&L.writable!==!1&&!L.destroyed&&!L.errored&&!L.ending&&!L.ended},set(L){this._writableState&&(this._writableState.writable=!!L)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const L=this._writableState;return L?!L.destroyed&&!L.ending&&L.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const oe=k.destroy;p.prototype.destroy=function(L,D){const F=this._writableState;return!F.destroyed&&(F.bufferedIndex<F.buffered.length||F[_].length)&&r.nextTick(W,F),oe.call(this,L,D),this},p.prototype._undestroy=k.undestroy,p.prototype._destroy=function(L,D){D(L)},p.prototype[N.captureRejectionSymbol]=function(L){this.destroy(L)};let ce;function fe(){return ce===void 0&&(ce={}),ce}return p.fromWeb=function(L,D){return fe().newStreamWritableFromWritableStream(L,D)},p.toWeb=function(L){return fe().newWritableStreamFromStreamWritable(L)},xn}var On,Ji;function ua(){if(Ji)return On;Ji=1;const r=Lt(),e=xe.requireDist(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:s,isReadableNodeStream:o,isWritableNodeStream:l,isDuplexNodeStream:d,isReadableStream:w,isWritableStream:N}=gt(),O=Et(),{AbortError:I,codes:{ERR_INVALID_ARG_TYPE:k,ERR_INVALID_RETURN_VALUE:B}}=ke(),{destroyer:y}=jt(),b=ht(),u=qr(),c=ii(),{createDeferredPromise:v}=$e(),G=Ko(),$=globalThis.Blob||e.Blob,J=typeof $<"u"?function(h){return h instanceof $}:function(h){return!1},X=globalThis.AbortController||er().AbortController,{FunctionPrototypeCall:a}=Ie();class m extends b{constructor(h){super(h),h?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}On=function _(h,C){if(d(h))return h;if(o(h))return g({readable:h});if(l(h))return g({writable:h});if(s(h))return g({writable:!1,readable:!1});if(w(h))return g({readable:u.fromWeb(h)});if(N(h))return g({writable:c.fromWeb(h)});if(typeof h=="function"){const{value:A,write:P,final:E,destroy:M}=f(h);if(i(A))return G(m,A,{objectMode:!0,write:P,final:E,destroy:M});const S=A?.then;if(typeof S=="function"){let j;const K=a(S,A,W=>{if(W!=null)throw new B("nully","body",W)},W=>{y(j,W)});return j=new m({objectMode:!0,readable:!1,write:P,final(W){E(async()=>{try{await K,r.nextTick(W,null)}catch(ee){r.nextTick(W,ee)}})},destroy:M})}throw new B("Iterable, AsyncIterable or AsyncFunction",C,A)}if(J(h))return _(h.arrayBuffer());if(i(h))return G(m,h,{objectMode:!0,writable:!1});if(w(h?.readable)&&N(h?.writable))return m.fromWeb(h);if(typeof h?.writable=="object"||typeof h?.readable=="object"){const A=h!=null&&h.readable?o(h?.readable)?h?.readable:_(h.readable):void 0,P=h!=null&&h.writable?l(h?.writable)?h?.writable:_(h.writable):void 0;return g({readable:A,writable:P})}const p=h?.then;if(typeof p=="function"){let A;return a(p,h,P=>{P!=null&&A.push(P),A.push(null)},P=>{y(A,P)}),A=new m({objectMode:!0,writable:!1,read(){}})}throw new k(C,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],h)};function f(_){let{promise:h,resolve:C}=v();const p=new X,A=p.signal;return{value:_((async function*(){for(;;){const E=h;h=null;const{chunk:M,done:S,cb:j}=await E;if(r.nextTick(j),S)return;if(A.aborted)throw new I(void 0,{cause:A.reason});({promise:h,resolve:C}=v()),yield M}})(),{signal:A}),write(E,M,S){const j=C;C=null,j({chunk:E,done:!1,cb:S})},final(E){const M=C;C=null,M({done:!0,cb:E})},destroy(E,M){p.abort(),M(E)}}}function g(_){const h=_.readable&&typeof _.readable.read!="function"?u.wrap(_.readable):_.readable,C=_.writable;let p=!!t(h),A=!!n(C),P,E,M,S,j;function K(W){const ee=S;S=null,ee?ee(W):W&&j.destroy(W)}return j=new m({readableObjectMode:!!(h!=null&&h.readableObjectMode),writableObjectMode:!!(C!=null&&C.writableObjectMode),readable:p,writable:A}),A&&(O(C,W=>{A=!1,W&&y(h,W),K(W)}),j._write=function(W,ee,Q){C.write(W,ee)?Q():P=Q},j._final=function(W){C.end(),E=W},C.on("drain",function(){if(P){const W=P;P=null,W()}}),C.on("finish",function(){if(E){const W=E;E=null,W()}})),p&&(O(h,W=>{p=!1,W&&y(h,W),K(W)}),h.on("readable",function(){if(M){const W=M;M=null,W()}}),h.on("end",function(){j.push(null)}),j._read=function(){for(;;){const W=h.read();if(W===null){M=j._read;return}if(!j.push(W))return}}),j._destroy=function(W,ee){!W&&S!==null&&(W=new I),M=null,P=null,E=null,S===null?ee(W):(S=ee,y(C,W),y(h,W))},j}return On}var Nn,Zi;function ht(){if(Zi)return Nn;Zi=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Ie();Nn=o;const i=qr(),s=ii();n(o.prototype,i.prototype),n(o,i);{const N=t(s.prototype);for(let O=0;O<N.length;O++){const I=N[O];o.prototype[I]||(o.prototype[I]=s.prototype[I])}}function o(N){if(!(this instanceof o))return new o(N);i.call(this,N),s.call(this,N),N?(this.allowHalfOpen=N.allowHalfOpen!==!1,N.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),N.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(o.prototype,{writable:{__proto__:null,...e(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(s.prototype,"writableLength")},writableFinished:{__proto__:null,...e(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(N){this._readableState&&this._writableState&&(this._readableState.destroyed=N,this._writableState.destroyed=N)}}});let l;function d(){return l===void 0&&(l={}),l}o.fromWeb=function(N,O){return d().newStreamDuplexFromReadableWritablePair(N,O)},o.toWeb=function(N){return d().newReadableWritablePairFromDuplex(N)};let w;return o.from=function(N){return w||(w=ua()),w(N,"body")},Nn}var Cn,Xi;function Yo(){if(Xi)return Cn;Xi=1;const{ObjectSetPrototypeOf:r,Symbol:e}=Ie();Cn=o;const{ERR_METHOD_NOT_IMPLEMENTED:t}=ke().codes,n=ht(),{getHighWaterMark:i}=Dr();r(o.prototype,n.prototype),r(o,n);const s=e("kCallback");function o(w){if(!(this instanceof o))return new o(w);const N=w?i(this,w,"readableHighWaterMark",!0):null;N===0&&(w={...w,highWaterMark:null,readableHighWaterMark:N,writableHighWaterMark:w.writableHighWaterMark||0}),n.call(this,w),this._readableState.sync=!1,this[s]=null,w&&(typeof w.transform=="function"&&(this._transform=w.transform),typeof w.flush=="function"&&(this._flush=w.flush)),this.on("prefinish",d)}function l(w){typeof this._flush=="function"&&!this.destroyed?this._flush((N,O)=>{if(N){w?w(N):this.destroy(N);return}O!=null&&this.push(O),this.push(null),w&&w()}):(this.push(null),w&&w())}function d(){this._final!==l&&l.call(this)}return o.prototype._final=l,o.prototype._transform=function(w,N,O){throw new t("_transform()")},o.prototype._write=function(w,N,O){const I=this._readableState,k=this._writableState,B=I.length;this._transform(w,N,(y,b)=>{if(y){O(y);return}b!=null&&this.push(b),k.ended||B===I.length||I.length<I.highWaterMark?O():this[s]=O})},o.prototype._read=function(){if(this[s]){const w=this[s];this[s]=null,w()}},Cn}var Pn,Qi;function Jo(){if(Qi)return Pn;Qi=1;const{ObjectSetPrototypeOf:r}=Ie();Pn=t;const e=Yo();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,s){s(null,n)},Pn}var Ln,eo;function oi(){if(eo)return Ln;eo=1;const r=Lt(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=Ie(),s=Et(),{once:o}=$e(),l=jt(),d=ht(),{aggregateTwoErrors:w,codes:{ERR_INVALID_ARG_TYPE:N,ERR_INVALID_RETURN_VALUE:O,ERR_MISSING_ARGS:I,ERR_STREAM_DESTROYED:k,ERR_STREAM_PREMATURE_CLOSE:B},AbortError:y}=ke(),{validateFunction:b,validateAbortSignal:u}=nr(),{isIterable:c,isReadable:v,isReadableNodeStream:G,isNodeStream:$,isTransformStream:J,isWebStream:X,isReadableStream:a,isReadableFinished:m}=gt(),f=globalThis.AbortController||er().AbortController;let g,_,h;function C(W,ee,Q){let le=!1;W.on("close",()=>{le=!0});const ue=s(W,{readable:ee,writable:Q},z=>{le=!z});return{destroy:z=>{le||(le=!0,l.destroyer(W,z||new k("pipe")))},cleanup:ue}}function p(W){return b(W[W.length-1],"streams[stream.length - 1]"),W.pop()}function A(W){if(c(W))return W;if(G(W))return P(W);throw new N("val",["Readable","Iterable","AsyncIterable"],W)}async function*P(W){_||(_=qr()),yield*_.prototype[n].call(W)}async function E(W,ee,Q,{end:le}){let ue,z=null;const V=fe=>{if(fe&&(ue=fe),z){const L=z;z=null,L()}},oe=()=>new t((fe,L)=>{ue?L(ue):z=()=>{ue?L(ue):fe()}});ee.on("drain",V);const ce=s(ee,{readable:!1},V);try{ee.writableNeedDrain&&await oe();for await(const fe of W)ee.write(fe)||await oe();le&&(ee.end(),await oe()),Q()}catch(fe){Q(ue!==fe?w(ue,fe):fe)}finally{ce(),ee.off("drain",V)}}async function M(W,ee,Q,{end:le}){J(ee)&&(ee=ee.writable);const ue=ee.getWriter();try{for await(const z of W)await ue.ready,ue.write(z).catch(()=>{});await ue.ready,le&&await ue.close(),Q()}catch(z){try{await ue.abort(z),Q(z)}catch(V){Q(V)}}}function S(...W){return j(W,o(p(W)))}function j(W,ee,Q){if(W.length===1&&e(W[0])&&(W=W[0]),W.length<2)throw new I("streams");const le=new f,ue=le.signal,z=Q?.signal,V=[];u(z,"options.signal");function oe(){se(new y)}h=h||$e().addAbortListener;let ce;z&&(ce=h(z,oe));let fe,L;const D=[];let F=0;function ne(re){se(re,--F===0)}function se(re,Y){var we;if(re&&(!fe||fe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(fe=re),!(!fe&&!Y)){for(;D.length;)D.shift()(fe);(we=ce)===null||we===void 0||we[i](),le.abort(),Y&&(fe||V.forEach(Le=>Le()),r.nextTick(ee,fe,L))}}let ie;for(let re=0;re<W.length;re++){const Y=W[re],we=re<W.length-1,Le=re>0,ye=we||Q?.end!==!1,De=re===W.length-1;if($(Y)){let Oe=function(Be){Be&&Be.name!=="AbortError"&&Be.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ne(Be)};if(ye){const{destroy:Be,cleanup:Ze}=C(Y,we,Le);D.push(Be),v(Y)&&De&&V.push(Ze)}Y.on("error",Oe),v(Y)&&De&&V.push(()=>{Y.removeListener("error",Oe)})}if(re===0)if(typeof Y=="function"){if(ie=Y({signal:ue}),!c(ie))throw new O("Iterable, AsyncIterable or Stream","source",ie)}else c(Y)||G(Y)||J(Y)?ie=Y:ie=d.from(Y);else if(typeof Y=="function"){if(J(ie)){var q;ie=A((q=ie)===null||q===void 0?void 0:q.readable)}else ie=A(ie);if(ie=Y(ie,{signal:ue}),we){if(!c(ie,!0))throw new O("AsyncIterable",`transform[${re-1}]`,ie)}else{var Z;g||(g=Jo());const Oe=new g({objectMode:!0}),Be=(Z=ie)===null||Z===void 0?void 0:Z.then;if(typeof Be=="function")F++,Be.call(ie,Me=>{L=Me,Me!=null&&Oe.write(Me),ye&&Oe.end(),r.nextTick(ne)},Me=>{Oe.destroy(Me),r.nextTick(ne,Me)});else if(c(ie,!0))F++,E(ie,Oe,ne,{end:ye});else if(a(ie)||J(ie)){const Me=ie.readable||ie;F++,E(Me,Oe,ne,{end:ye})}else throw new O("AsyncIterable or Promise","destination",ie);ie=Oe;const{destroy:Ze,cleanup:St}=C(ie,!1,!0);D.push(Ze),De&&V.push(St)}}else if($(Y)){if(G(ie)){F+=2;const Oe=K(ie,Y,ne,{end:ye});v(Y)&&De&&V.push(Oe)}else if(J(ie)||a(ie)){const Oe=ie.readable||ie;F++,E(Oe,Y,ne,{end:ye})}else if(c(ie))F++,E(ie,Y,ne,{end:ye});else throw new N("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ie);ie=Y}else if(X(Y)){if(G(ie))F++,M(A(ie),Y,ne,{end:ye});else if(a(ie)||c(ie))F++,M(ie,Y,ne,{end:ye});else if(J(ie))F++,M(ie.readable,Y,ne,{end:ye});else throw new N("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ie);ie=Y}else ie=d.from(Y)}return(ue!=null&&ue.aborted||z!=null&&z.aborted)&&r.nextTick(oe),ie}function K(W,ee,Q,{end:le}){let ue=!1;if(ee.on("close",()=>{ue||Q(new B)}),W.pipe(ee,{end:!1}),le){let z=function(){ue=!0,ee.end()};m(W)?r.nextTick(z):W.once("end",z)}else Q();return s(W,{readable:!0,writable:!1},z=>{const V=W._readableState;z&&z.code==="ERR_STREAM_PREMATURE_CLOSE"&&V&&V.ended&&!V.errored&&!V.errorEmitted?W.once("end",Q).once("error",Q):Q(z)}),s(ee,{readable:!1,writable:!0},Q)}return Ln={pipelineImpl:j,pipeline:S},Ln}var Bn,to;function Zo(){if(to)return Bn;to=1;const{pipeline:r}=oi(),e=ht(),{destroyer:t}=jt(),{isNodeStream:n,isReadable:i,isWritable:s,isWebStream:o,isTransformStream:l,isWritableStream:d,isReadableStream:w}=gt(),{AbortError:N,codes:{ERR_INVALID_ARG_VALUE:O,ERR_MISSING_ARGS:I}}=ke(),k=Et();return Bn=function(...y){if(y.length===0)throw new I("streams");if(y.length===1)return e.from(y[0]);const b=[...y];if(typeof y[0]=="function"&&(y[0]=e.from(y[0])),typeof y[y.length-1]=="function"){const g=y.length-1;y[g]=e.from(y[g])}for(let g=0;g<y.length;++g)if(!(!n(y[g])&&!o(y[g]))){if(g<y.length-1&&!(i(y[g])||w(y[g])||l(y[g])))throw new O(`streams[${g}]`,b[g],"must be readable");if(g>0&&!(s(y[g])||d(y[g])||l(y[g])))throw new O(`streams[${g}]`,b[g],"must be writable")}let u,c,v,G,$;function J(g){const _=G;G=null,_?_(g):g?$.destroy(g):!f&&!m&&$.destroy()}const X=y[0],a=r(y,J),m=!!(s(X)||d(X)||l(X)),f=!!(i(a)||w(a)||l(a));if($=new e({writableObjectMode:!!(X!=null&&X.writableObjectMode),readableObjectMode:!!(a!=null&&a.readableObjectMode),writable:m,readable:f}),m){if(n(X))$._write=function(_,h,C){X.write(_,h)?C():u=C},$._final=function(_){X.end(),c=_},X.on("drain",function(){if(u){const _=u;u=null,_()}});else if(o(X)){const h=(l(X)?X.writable:X).getWriter();$._write=async function(C,p,A){try{await h.ready,h.write(C).catch(()=>{}),A()}catch(P){A(P)}},$._final=async function(C){try{await h.ready,h.close().catch(()=>{}),c=C}catch(p){C(p)}}}const g=l(a)?a.readable:a;k(g,()=>{if(c){const _=c;c=null,_()}})}if(f){if(n(a))a.on("readable",function(){if(v){const g=v;v=null,g()}}),a.on("end",function(){$.push(null)}),$._read=function(){for(;;){const g=a.read();if(g===null){v=$._read;return}if(!$.push(g))return}};else if(o(a)){const _=(l(a)?a.readable:a).getReader();$._read=async function(){for(;;)try{const{value:h,done:C}=await _.read();if(!$.push(h))return;if(C){$.push(null);return}}catch{return}}}}return $._destroy=function(g,_){!g&&G!==null&&(g=new N),v=null,u=null,c=null,G===null?_(g):(G=_,n(a)&&t(a,g))},$},Bn}var ro;function fa(){if(ro)return vr;ro=1;const r=globalThis.AbortController||er().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:s}=ke(),{validateAbortSignal:o,validateInteger:l,validateObject:d}=nr(),w=Ie().Symbol("kWeak"),N=Ie().Symbol("kResistStopPropagation"),{finished:O}=Et(),I=Zo(),{addAbortSignalNoValidate:k}=Mr(),{isWritable:B,isNodeStream:y}=gt(),{deprecate:b}=$e(),{ArrayPrototypePush:u,Boolean:c,MathFloor:v,Number:G,NumberIsNaN:$,Promise:J,PromiseReject:X,PromiseResolve:a,PromisePrototypeThen:m,Symbol:f}=Ie(),g=f("kEmpty"),_=f("kEof");function h(z,V){if(V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal"),y(z)&&!B(z))throw new e("stream",z,"must be writable");const oe=I(this,z);return V!=null&&V.signal&&k(V.signal,oe),oe}function C(z,V){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal");let oe=1;V?.concurrency!=null&&(oe=v(V.concurrency));let ce=oe-1;return V?.highWaterMark!=null&&(ce=v(V.highWaterMark)),l(oe,"options.concurrency",1),l(ce,"options.highWaterMark",0),ce+=oe,(async function*(){const L=$e().AbortSignalAny([V?.signal].filter(c)),D=this,F=[],ne={signal:L};let se,ie,q=!1,Z=0;function re(){q=!0,Y()}function Y(){Z-=1,we()}function we(){ie&&!q&&Z<oe&&F.length<ce&&(ie(),ie=null)}async function Le(){try{for await(let ye of D){if(q)return;if(L.aborted)throw new s;try{if(ye=z(ye,ne),ye===g)continue;ye=a(ye)}catch(De){ye=X(De)}Z+=1,m(ye,Y,re),F.push(ye),se&&(se(),se=null),!q&&(F.length>=ce||Z>=oe)&&await new J(De=>{ie=De})}F.push(_)}catch(ye){const De=X(ye);m(De,Y,re),F.push(De)}finally{q=!0,se&&(se(),se=null)}}Le();try{for(;;){for(;F.length>0;){const ye=await F[0];if(ye===_)return;if(L.aborted)throw new s;ye!==g&&(yield ye),F.shift(),we()}await new J(ye=>{se=ye})}}finally{q=!0,ie&&(ie(),ie=null)}}).call(this)}function p(z=void 0){return z!=null&&d(z,"options"),z?.signal!=null&&o(z.signal,"options.signal"),(async function*(){let oe=0;for await(const fe of this){var ce;if(z!=null&&(ce=z.signal)!==null&&ce!==void 0&&ce.aborted)throw new s({cause:z.signal.reason});yield[oe++,fe]}}).call(this)}async function A(z,V=void 0){for await(const oe of S.call(this,z,V))return!0;return!1}async function P(z,V=void 0){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);return!await A.call(this,async(...oe)=>!await z(...oe),V)}async function E(z,V){for await(const oe of S.call(this,z,V))return oe}async function M(z,V){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);async function oe(ce,fe){return await z(ce,fe),g}for await(const ce of C.call(this,oe,V));}function S(z,V){if(typeof z!="function")throw new t("fn",["Function","AsyncFunction"],z);async function oe(ce,fe){return await z(ce,fe)?ce:g}return C.call(this,oe,V)}class j extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function K(z,V,oe){var ce;if(typeof z!="function")throw new t("reducer",["Function","AsyncFunction"],z);oe!=null&&d(oe,"options"),oe?.signal!=null&&o(oe.signal,"options.signal");let fe=arguments.length>1;if(oe!=null&&(ce=oe.signal)!==null&&ce!==void 0&&ce.aborted){const se=new s(void 0,{cause:oe.signal.reason});throw this.once("error",()=>{}),await O(this.destroy(se)),se}const L=new r,D=L.signal;if(oe!=null&&oe.signal){const se={once:!0,[w]:this,[N]:!0};oe.signal.addEventListener("abort",()=>L.abort(),se)}let F=!1;try{for await(const se of this){var ne;if(F=!0,oe!=null&&(ne=oe.signal)!==null&&ne!==void 0&&ne.aborted)throw new s;fe?V=await z(V,se,{signal:D}):(V=se,fe=!0)}if(!F&&!fe)throw new j}finally{L.abort()}return V}async function W(z){z!=null&&d(z,"options"),z?.signal!=null&&o(z.signal,"options.signal");const V=[];for await(const ce of this){var oe;if(z!=null&&(oe=z.signal)!==null&&oe!==void 0&&oe.aborted)throw new s(void 0,{cause:z.signal.reason});u(V,ce)}return V}function ee(z,V){const oe=C.call(this,z,V);return(async function*(){for await(const fe of oe)yield*fe}).call(this)}function Q(z){if(z=G(z),$(z))return 0;if(z<0)throw new i("number",">= 0",z);return z}function le(z,V=void 0){return V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal"),z=Q(z),(async function*(){var ce;if(V!=null&&(ce=V.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const L of this){var fe;if(V!=null&&(fe=V.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;z--<=0&&(yield L)}}).call(this)}function ue(z,V=void 0){return V!=null&&d(V,"options"),V?.signal!=null&&o(V.signal,"options.signal"),z=Q(z),(async function*(){var ce;if(V!=null&&(ce=V.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const L of this){var fe;if(V!=null&&(fe=V.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;if(z-- >0&&(yield L),z<=0)return}}).call(this)}return vr.streamReturningOperators={asIndexedPairs:b(p,"readable.asIndexedPairs will be removed in a future version."),drop:le,filter:S,flatMap:ee,map:C,take:ue,compose:h},vr.promiseReturningOperators={every:P,forEach:M,reduce:K,toArray:W,some:A,find:E},vr}var Mn,no;function Xo(){if(no)return Mn;no=1;const{ArrayPrototypePop:r,Promise:e}=Ie(),{isIterable:t,isNodeStream:n,isWebStream:i}=gt(),{pipelineImpl:s}=oi(),{finished:o}=Et();Qo();function l(...d){return new e((w,N)=>{let O,I;const k=d[d.length-1];if(k&&typeof k=="object"&&!n(k)&&!t(k)&&!i(k)){const B=r(d);O=B.signal,I=B.end}s(d,(B,y)=>{B?N(B):w(y)},{signal:O,end:I})})}return Mn={finished:o,pipeline:l},Mn}var io;function Qo(){if(io)return dn.exports;io=1;const{Buffer:r}=xe.requireDist(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Ie(),{promisify:{custom:i}}=$e(),{streamReturningOperators:s,promiseReturningOperators:o}=fa(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=ke(),d=Zo(),{setDefaultHighWaterMark:w,getDefaultHighWaterMark:N}=Dr(),{pipeline:O}=oi(),{destroyer:I}=jt(),k=Et(),B=Xo(),y=gt(),b=dn.exports=ni().Stream;b.isDestroyed=y.isDestroyed,b.isDisturbed=y.isDisturbed,b.isErrored=y.isErrored,b.isReadable=y.isReadable,b.isWritable=y.isWritable,b.Readable=qr();for(const c of t(s)){let G=function(...$){if(new.target)throw l();return b.Readable.from(n(v,this,$))};const v=s[c];e(G,"name",{__proto__:null,value:v.name}),e(G,"length",{__proto__:null,value:v.length}),e(b.Readable.prototype,c,{__proto__:null,value:G,enumerable:!1,configurable:!0,writable:!0})}for(const c of t(o)){let G=function(...$){if(new.target)throw l();return n(v,this,$)};const v=o[c];e(G,"name",{__proto__:null,value:v.name}),e(G,"length",{__proto__:null,value:v.length}),e(b.Readable.prototype,c,{__proto__:null,value:G,enumerable:!1,configurable:!0,writable:!0})}b.Writable=ii(),b.Duplex=ht(),b.Transform=Yo(),b.PassThrough=Jo(),b.pipeline=O;const{addAbortSignal:u}=Mr();return b.addAbortSignal=u,b.finished=k,b.destroy=I,b.compose=d,b.setDefaultHighWaterMark=w,b.getDefaultHighWaterMark=N,e(b,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return B}}),e(O,i,{__proto__:null,enumerable:!0,get(){return B.pipeline}}),e(k,i,{__proto__:null,enumerable:!0,get(){return B.finished}}),b.Stream=b,b._isUint8Array=function(v){return v instanceof Uint8Array},b._uint8ArrayToBuffer=function(v){return r.from(v.buffer,v.byteOffset,v.byteLength)},dn.exports}var oo;function ca(){return oo||(oo=1,(function(r){const e=Qo(),t=Xo(),n=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=n,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(cn)),cn.exports}var kr=ca(),da=zo();const ha=xe.getDefaultExportFromCjs(da);var Rr={exports:{}},Dn,so;function ga(){if(so)return Dn;so=1,Dn=r;function r(e,t){if(e&&t)return r(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){n[i]=e[i]}),n;function n(){for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];var o=e.apply(this,i),l=i[i.length-1];return typeof o=="function"&&o!==l&&Object.keys(l).forEach(function(d){o[d]=l[d]}),o}}return Dn}var ao;function si(){if(ao)return Rr.exports;ao=1;var r=ga();Rr.exports=r(e),Rr.exports.strict=r(t),e.proto=e(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return e(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return t(this)},configurable:!0})});function e(n){var i=function(){return i.called?i.value:(i.called=!0,i.value=n.apply(this,arguments))};return i.called=!1,i}function t(n){var i=function(){if(i.called)throw new Error(i.onceError);return i.called=!0,i.value=n.apply(this,arguments)},s=n.name||"Function wrapped with `once`";return i.onceError=s+" shouldn't be called more than once",i.called=!1,i}return Rr.exports}var qn,lo;function es(){if(lo)return qn;lo=1;var r=si(),e=function(){},t=xe.commonjsGlobal.Bare?queueMicrotask:qe.process$1.nextTick.bind(qe.process$1),n=function(o){return o.setHeader&&typeof o.abort=="function"},i=function(o){return o.stdio&&Array.isArray(o.stdio)&&o.stdio.length===3},s=function(o,l,d){if(typeof l=="function")return s(o,null,l);l||(l={}),d=r(d||e);var w=o._writableState,N=o._readableState,O=l.readable||l.readable!==!1&&o.readable,I=l.writable||l.writable!==!1&&o.writable,k=!1,B=function(){o.writable||y()},y=function(){I=!1,O||d.call(o)},b=function(){O=!1,I||d.call(o)},u=function(J){d.call(o,J?new Error("exited with error code: "+J):null)},c=function(J){d.call(o,J)},v=function(){t(G)},G=function(){if(!k){if(O&&!(N&&N.ended&&!N.destroyed))return d.call(o,new Error("premature close"));if(I&&!(w&&w.ended&&!w.destroyed))return d.call(o,new Error("premature close"))}},$=function(){o.req.on("finish",y)};return n(o)?(o.on("complete",y),o.on("abort",v),o.req?$():o.on("request",$)):I&&!w&&(o.on("end",B),o.on("close",B)),i(o)&&o.on("exit",u),o.on("end",b),o.on("finish",y),l.error!==!1&&o.on("error",c),o.on("close",v),function(){k=!0,o.removeListener("complete",y),o.removeListener("abort",v),o.removeListener("request",$),o.req&&o.req.removeListener("finish",y),o.removeListener("end",B),o.removeListener("close",B),o.removeListener("finish",y),o.removeListener("exit",u),o.removeListener("end",b),o.removeListener("error",c),o.removeListener("close",v)}};return qn=s,qn}var pa=es();const uo=xe.getDefaultExportFromCjs(pa);var wa=si();const ba=xe.getDefaultExportFromCjs(wa);var kn,fo;function ya(){if(fo)return kn;fo=1;var r=si(),e=es(),t;try{t=rr.require$$2}catch{}var n=function(){},i=typeof qe.process$1>"u"?!1:/^v?\.0/.test(qe.process$1.version),s=function(I){return typeof I=="function"},o=function(I){return!i||!t?!1:(I instanceof(t.ReadStream||n)||I instanceof(t.WriteStream||n))&&s(I.close)},l=function(I){return I.setHeader&&s(I.abort)},d=function(I,k,B,y){y=r(y);var b=!1;I.on("close",function(){b=!0}),e(I,{readable:k,writable:B},function(c){if(c)return y(c);b=!0,y()});var u=!1;return function(c){if(!b&&!u){if(u=!0,o(I))return I.close(n);if(l(I))return I.abort();if(s(I.destroy))return I.destroy();y(c||new Error("stream was destroyed"))}}},w=function(I){I()},N=function(I,k){return I.pipe(k)},O=function(){var I=Array.prototype.slice.call(arguments),k=s(I[I.length-1]||n)&&I.pop()||n;if(Array.isArray(I[0])&&(I=I[0]),I.length<2)throw new Error("pump requires two streams per minimum");var B,y=I.map(function(b,u){var c=u<I.length-1,v=u>0;return d(b,c,v,function(G){B||(B=G),G&&y.forEach(w),!c&&(y.forEach(w),k(B))})});return I.reduce(N)};return kn=O,kn}var _a=ya();const co=xe.getDefaultExportFromCjs(_a);function Ir(){}const ho="SYN",Un="ACK",go="BRK";class po extends kr.Duplex{constructor(e){let{name:t,target:n,targetWindow:i=window,targetOrigin:s="*"}=e;if(super({objectMode:!0}),ge(this,"_init",void 0),ge(this,"_haveSyn",void 0),ge(this,"_name",void 0),ge(this,"_target",void 0),ge(this,"_targetWindow",void 0),ge(this,"_targetOrigin",void 0),ge(this,"_onMessage",void 0),ge(this,"_synIntervalId",void 0),!t||!n)throw new Error("Invalid input.");this._init=!1,this._haveSyn=!1,this._name=t,this._target=n,this._targetWindow=i,this._targetOrigin=s,this._onMessage=this.onMessage.bind(this),this._synIntervalId=null,window.addEventListener("message",this._onMessage,!1),this._handShake()}_break(){this.cork(),this._write(go,null,Ir),this._haveSyn=!1,this._init=!1}_handShake(){this._write(ho,null,Ir),this.cork()}_onData(e){if(!this._init)e===ho?(this._haveSyn=!0,this._write(Un,null,Ir)):e===Un&&(this._init=!0,this._haveSyn||this._write(Un,null,Ir),this.uncork());else if(e===go)this._break();else try{this.push(e)}catch(t){this.emit("error",t)}}_postMessage(e){const t=this._targetOrigin;this._targetWindow.postMessage({target:this._target,data:e},t)}onMessage(e){const t=e.data;this._targetOrigin!=="*"&&e.origin!==this._targetOrigin||e.source!==this._targetWindow||typeof t!="object"||t.target!==this._name||!t.data||this._onData(t.data)}_read(){}_write(e,t,n){this._postMessage(e),n()}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}const ma={rpc:{internal:-32603}},wo={"-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."}},bo=ma.rpc.internal,Ea="Unspecified error message. This is a bug, please report it.";function ts(r){return Number.isInteger(r)}function yo(r){return typeof r=="string"&&r.length>0}function _o(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function rs(r){const e=r;return!(!e||!ts(e.code)||!yo(e.message)||e.stack&&!yo(e.stack))}function Sa(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ea;if(ts(r)){const t=r.toString();if(Object.hasOwn(wo,t))return wo[t].message}return e}const va={code:bo,message:Sa(bo)};function Vn(r){try{JSON.parse(JSON.stringify(r,(e,t)=>{if(e==="__proto__"||e==="constructor")throw new Error("Not valid json");if(typeof t=="function"||typeof t=="symbol")throw new Error("Not valid json");return t}),(e,t)=>{if(!(e==="__proto__"||e==="constructor"))return t})}catch{return!1}return!0}function mo(r){return Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Vn(n)&&(e[t]=n),e},{})}function Aa(r){return Array.isArray(r)?r.map(e=>Vn(e)?e:_o(e)?mo(e):null):_o(r)?mo(r):Vn(r)?r:null}function Ra(r,e){if(r&&typeof r=="object"&&"serialize"in r&&typeof r.serialize=="function")return r.serialize();if(rs(r))return r;const t=Aa(r);return Je(Je({},e),{},{data:{cause:t}})}function Eo(r){let{fallbackError:e=va,shouldIncludeStack:t=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!rs(e))throw new Error("Must provide fallback error with integer number code and string message.");const n=Ra(r,e);return t||delete n.stack,n}function So(r,e,t){try{Reflect.apply(r,e,t)}catch(n){setTimeout(()=>{throw n})}}function Ia(r){const e=r.length,t=new Array(e);for(let n=0;n<e;n+=1)t[n]=r[n];return t}class Ur extends ta.eventsExports.EventEmitter{emit(e){let t=e==="error";const n=this._events;if(n!==void 0)t=t&&n.error===void 0;else if(!t)return!1;for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(t){let d;if(s.length>0&&([d]=s),d instanceof Error)throw d;const w=new Error(`Unhandled error.${d?` (${d.message})`:""}`);throw w.context=d,w}const l=n[e];if(l===void 0)return!1;if(typeof l=="function")So(l,this,s);else{const d=l.length,w=Ia(l);for(let N=0;N<d;N+=1)So(w[N],this,s)}return!0}}class Jt extends Error{constructor(e){let{code:t,message:n,data:i}=e;if(!Number.isInteger(t))throw new Error("code must be an integer");if(!n||typeof n!="string")throw new Error("message must be string");super(n),ge(this,"code",void 0),ge(this,"data",void 0),this.code=t,i!==void 0&&(this.data=i)}toString(){return ha({code:this.code,message:this.message,data:this.data,stack:this.stack})}}const Kn=function(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return(n,i)=>{n||i.error?e(n||i.error):!t||Array.isArray(i)?r(i):r(i.result)}};function Ta(){const r={};function e(){return!1}const t=new Ur;function n(d){const w=r[d.id];if(!w)throw new Error(`StreamMiddleware - Unknown response id "${d.id}"`);delete r[d.id],Object.assign(w.res,d),setTimeout(w.end)}function i(d){t.emit("notification",d)}function s(d,w,N){let O;try{!d.id?i(d):n(d)}catch(I){O=I}N(O)}const o=new kr.Duplex({objectMode:!0,read:e,write:s});return{events:t,middleware:(d,w,N,O)=>{o.push(d),r[d.id]={req:d,res:w,next:N,end:O}},stream:o}}function xa(){return(r,e,t,n)=>{const i=r.id,s=Math.random().toString(36).slice(2);r.id=s,e.id=s,t(o=>{r.id=i,e.id=i,o()})}}class ft extends Ur{constructor(){super(),ge(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(e,t,n){const i=[];let s=null,o=!1;for(const l of n)if([s,o]=await ft._runMiddleware(e,t,l,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,t,n,i){return new Promise(s=>{const o=d=>{const w=d||t.error;w&&(typeof w=="object"&&Object.keys(w).includes("stack")===!1&&(w.stack="Stack trace is not available."),t.error=Eo(w,{shouldIncludeStack:!0,fallbackError:{message:w?.message||w?.toString(),code:w?.code||-32603,stack:w?.stack||"Stack trace is not available.",data:w?.data||w?.message||w?.toString()}})),s([w,!0])},l=d=>{t.error?o(t.error):(d&&(typeof d!="function"&&o(new Jt({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),i.push(d)),s([null,!1]))};try{n(e,t,l,o)}catch(d){o(d)}})}static async _runReturnHandlers(e){for(const t of e)await new Promise((n,i)=>{t(s=>s?i(s):n())})}static _checkForCompletion(e,t,n){if(!("result"in t)&&!("error"in t))throw new Jt({code:-32603,message:"Response has no error or result for request"});if(!n)throw new Jt({code:-32603,message:"Nothing ended request"})}push(e){this._middleware.push(e)}handle(e,t){if(t&&typeof t!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,n,i)=>{try{const[s,o,l]=await ft._runAllMiddleware(e,t,this._middleware);return o?(await ft._runReturnHandlers(l),i(s)):n(async d=>{try{await ft._runReturnHandlers(l)}catch(w){return d(w)}return d()})}catch(s){return i(s)}}}async _handleBatch(e,t){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,n):n}catch(n){if(t)return t(n);throw n}}_promiseHandle(e){return new Promise((t,n)=>{this._handle(e,(i,s)=>{i&&s===void 0?n(i):t(s)}).catch(n)})}async _handle(e,t){if(!e||Array.isArray(e)||typeof e!="object"){const k=new Jt({code:-32603,message:"request must be plain object"});return t(k,{id:void 0,jsonrpc:"2.0",error:k})}if(typeof e.method!="string"){const k=new Jt({code:-32603,message:"method must be string"});return t(k,{id:e.id,jsonrpc:"2.0",error:k})}const n=Je({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(k){s=k}if(s&&(delete i.result,!i.error)){var o,l,d,w,N,O,I;typeof s=="object"&&Object.keys(s).includes("stack")===!1&&(s.stack="Stack trace is not available."),i.error=Eo(s,{shouldIncludeStack:!0,fallbackError:{message:((o=s)===null||o===void 0?void 0:o.message)||((l=s)===null||l===void 0?void 0:l.toString()),code:((d=s)===null||d===void 0?void 0:d.code)||-32603,stack:((w=s)===null||w===void 0?void 0:w.stack)||"Stack trace is not available.",data:((N=s)===null||N===void 0?void 0:N.data)||((O=s)===null||O===void 0?void 0:O.message)||((I=s)===null||I===void 0?void 0:I.toString())}})}return t(s,i)}async _processRequest(e,t){const[n,i,s]=await ft._runAllMiddleware(e,t,this._middleware);if(ft._checkForCompletion(e,t,i),await ft._runReturnHandlers(s),n)throw n}}class Oa extends kr.Duplex{constructor(e){let{parent:t,name:n}=e;super({objectMode:!0}),ge(this,"_parent",void 0),ge(this,"_name",void 0),this._parent=t,this._name=n}_read(){}_write(e,t,n){this._parent.push({name:this._name,data:e}),n()}}const vo=Symbol("IGNORE_SUBSTREAM");class Na extends kr.Duplex{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(Je(Je({},e),{},{objectMode:!0})),ge(this,"_substreams",void 0),ge(this,"getStream",void 0),this._substreams={}}createStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);const t=new Oa({parent:this,name:e});return this._substreams[e]=t,Ca(this,n=>t.destroy(n||void 0)),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error(`ObjectMultiplex - Substream for name "${e}" already exists`);this._substreams[e]=vo}_read(){}_write(e,t,n){const{name:i,data:s}=e;if(!i)return window.console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();const o=this._substreams[i];return o?(o!==vo&&o.push(s),n()):(window.console.warn(`ObjectMultiplex - orphaned data for stream "${i}"`),n())}}function Ca(r,e){const t=ba(e);uo(r,{readable:!1},t),uo(r,{writable:!1},t)}var Zt={exports:{}};Zt.exports;var Ao;function Pa(){return Ao||(Ao=1,(function(r,e){var t=200,n="__lodash_hash_undefined__",i=800,s=16,o=9007199254740991,l="[object Arguments]",d="[object Array]",w="[object AsyncFunction]",N="[object Boolean]",O="[object Date]",I="[object Error]",k="[object Function]",B="[object GeneratorFunction]",y="[object Map]",b="[object Number]",u="[object Null]",c="[object Object]",v="[object Proxy]",G="[object RegExp]",$="[object Set]",J="[object String]",X="[object Undefined]",a="[object WeakMap]",m="[object ArrayBuffer]",f="[object DataView]",g="[object Float32Array]",_="[object Float64Array]",h="[object Int8Array]",C="[object Int16Array]",p="[object Int32Array]",A="[object Uint8Array]",P="[object Uint8ClampedArray]",E="[object Uint16Array]",M="[object Uint32Array]",S=/[\\^$.*+?()[\]{}|]/g,j=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,W={};W[g]=W[_]=W[h]=W[C]=W[p]=W[A]=W[P]=W[E]=W[M]=!0,W[l]=W[d]=W[m]=W[N]=W[f]=W[O]=W[I]=W[k]=W[y]=W[b]=W[c]=W[G]=W[$]=W[J]=W[a]=!1;var ee=typeof xe.commonjsGlobal=="object"&&xe.commonjsGlobal&&xe.commonjsGlobal.Object===Object&&xe.commonjsGlobal,Q=typeof self=="object"&&self&&self.Object===Object&&self,le=ee||Q||Function("return this")(),ue=e&&!e.nodeType&&e,z=ue&&!0&&r&&!r.nodeType&&r,V=z&&z.exports===ue,oe=V&&ee.process,ce=(function(){try{var T=z&&z.require&&z.require("util").types;return T||oe&&oe.binding&&oe.binding("util")}catch{}})(),fe=ce&&ce.isTypedArray;function L(T,U,H){switch(H.length){case 0:return T.call(U);case 1:return T.call(U,H[0]);case 2:return T.call(U,H[0],H[1]);case 3:return T.call(U,H[0],H[1],H[2])}return T.apply(U,H)}function D(T,U){for(var H=-1,he=Array(T);++H<T;)he[H]=U(H);return he}function F(T){return function(U){return T(U)}}function ne(T,U){return T?.[U]}function se(T,U){return function(H){return T(U(H))}}var ie=Array.prototype,q=Function.prototype,Z=Object.prototype,re=le["__core-js_shared__"],Y=q.toString,we=Z.hasOwnProperty,Le=(function(){var T=/[^.]+$/.exec(re&&re.keys&&re.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""})(),ye=Z.toString,De=Y.call(Object),Oe=RegExp("^"+Y.call(we).replace(S,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=V?le.Buffer:void 0,Ze=le.Symbol,St=le.Uint8Array;Be&&Be.allocUnsafe;var Me=se(Object.getPrototypeOf,Object),lr=Object.create,Hr=Z.propertyIsEnumerable,ur=ie.splice,ot=Ze?Ze.toStringTag:void 0,Bt=(function(){try{var T=Jr(Object,"defineProperty");return T({},"",{}),T}catch{}})(),zr=Be?Be.isBuffer:void 0,Wt=Math.max,fr=Date.now,cr=Jr(le,"Map"),pt=Jr(Object,"create"),Ft=(function(){function T(){}return function(U){if(!At(U))return{};if(lr)return lr(U);T.prototype=U;var H=new T;return T.prototype=void 0,H}})();function st(T){var U=-1,H=T==null?0:T.length;for(this.clear();++U<H;){var he=T[U];this.set(he[0],he[1])}}function Gr(){this.__data__=pt?pt(null):{},this.size=0}function $t(T){var U=this.has(T)&&delete this.__data__[T];return this.size-=U?1:0,U}function dr(T){var U=this.__data__;if(pt){var H=U[T];return H===n?void 0:H}return we.call(U,T)?U[T]:void 0}function R(T){var U=this.__data__;return pt?U[T]!==void 0:we.call(U,T)}function x(T,U){var H=this.__data__;return this.size+=this.has(T)?0:1,H[T]=pt&&U===void 0?n:U,this}st.prototype.clear=Gr,st.prototype.delete=$t,st.prototype.get=dr,st.prototype.has=R,st.prototype.set=x;function te(T){var U=-1,H=T==null?0:T.length;for(this.clear();++U<H;){var he=T[U];this.set(he[0],he[1])}}function ae(){this.__data__=[],this.size=0}function de(T){var U=this.__data__,H=br(U,T);if(H<0)return!1;var he=U.length-1;return H==he?U.pop():ur.call(U,H,1),--this.size,!0}function Ne(T){var U=this.__data__,H=br(U,T);return H<0?void 0:U[H][1]}function Ue(T){return br(this.__data__,T)>-1}function hr(T,U){var H=this.__data__,he=br(H,T);return he<0?(++this.size,H.push([T,U])):H[he][1]=U,this}te.prototype.clear=ae,te.prototype.delete=de,te.prototype.get=Ne,te.prototype.has=Ue,te.prototype.set=hr;function je(T){var U=-1,H=T==null?0:T.length;for(this.clear();++U<H;){var he=T[U];this.set(he[0],he[1])}}function gr(){this.size=0,this.__data__={hash:new st,map:new(cr||te),string:new st}}function Vr(T){var U=_r(this,T).delete(T);return this.size-=U?1:0,U}function pr(T){return _r(this,T).get(T)}function wr(T){return _r(this,T).has(T)}function Ht(T,U){var H=_r(this,T),he=H.size;return H.set(T,U),this.size+=H.size==he?0:1,this}je.prototype.clear=gr,je.prototype.delete=Vr,je.prototype.get=pr,je.prototype.has=wr,je.prototype.set=Ht;function rt(T){var U=this.__data__=new te(T);this.size=U.size}function zt(){this.__data__=new te,this.size=0}function vt(T){var U=this.__data__,H=U.delete(T);return this.size=U.size,H}function at(T){return this.__data__.get(T)}function Xe(T){return this.__data__.has(T)}function Es(T,U){var H=this.__data__;if(H instanceof te){var he=H.__data__;if(!cr||he.length<t-1)return he.push([T,U]),this.size=++H.size,this;H=this.__data__=new je(he)}return H.set(T,U),this.size=H.size,this}rt.prototype.clear=zt,rt.prototype.delete=vt,rt.prototype.get=at,rt.prototype.has=Xe,rt.prototype.set=Es;function Ss(T,U){var H=Qr(T),he=!H&&Xr(T),be=!H&&!he&&yi(T),me=!H&&!he&&!be&&mi(T),ve=H||he||be||me,_e=ve?D(T.length,String):[],Ae=_e.length;for(var Qe in T)ve&&(Qe=="length"||be&&(Qe=="offset"||Qe=="parent")||me&&(Qe=="buffer"||Qe=="byteLength"||Qe=="byteOffset")||wi(Qe,Ae))||_e.push(Qe);return _e}function Kr(T,U,H){(H!==void 0&&!mr(T[U],H)||H===void 0&&!(U in T))&&Yr(T,U,H)}function vs(T,U,H){var he=T[U];(!(we.call(T,U)&&mr(he,H))||H===void 0&&!(U in T))&&Yr(T,U,H)}function br(T,U){for(var H=T.length;H--;)if(mr(T[H][0],U))return H;return-1}function Yr(T,U,H){U=="__proto__"&&Bt?Bt(T,U,{configurable:!0,enumerable:!0,value:H,writable:!0}):T[U]=H}var As=qs();function yr(T){return T==null?T===void 0?X:u:ot&&ot in Object(T)?ks(T):Hs(T)}function gi(T){return Gt(T)&&yr(T)==l}function Rs(T){if(!At(T)||Fs(T))return!1;var U=tn(T)?Oe:j;return U.test(Ks(T))}function Is(T){return Gt(T)&&_i(T.length)&&!!W[yr(T)]}function Ts(T){if(!At(T))return $s(T);var U=bi(T),H=[];for(var he in T)he=="constructor"&&(U||!we.call(T,he))||H.push(he);return H}function pi(T,U,H,he,be){T!==U&&As(U,function(me,ve){if(be||(be=new rt),At(me))xs(T,U,ve,H,pi,he,be);else{var _e=he?he(Zr(T,ve),me,ve+"",T,U,be):void 0;_e===void 0&&(_e=me),Kr(T,ve,_e)}},Ei)}function xs(T,U,H,he,be,me,ve){var _e=Zr(T,H),Ae=Zr(U,H),Qe=ve.get(Ae);if(Qe){Kr(T,H,Qe);return}var He=me?me(_e,Ae,H+"",T,U,ve):void 0,Vt=He===void 0;if(Vt){var rn=Qr(Ae),nn=!rn&&yi(Ae),vi=!rn&&!nn&&mi(Ae);He=Ae,rn||nn||vi?Qr(_e)?He=_e:Ys(_e)?He=Bs(_e):nn?(Vt=!1,He=Cs(Ae)):vi?(Vt=!1,He=Ls(Ae)):He=[]:Js(Ae)||Xr(Ae)?(He=_e,Xr(_e)?He=Zs(_e):(!At(_e)||tn(_e))&&(He=Us(Ae))):Vt=!1}Vt&&(ve.set(Ae,He),be(He,Ae,he,me,ve),ve.delete(Ae)),Kr(T,H,He)}function Os(T,U){return Gs(zs(T,U,Si),T+"")}var Ns=Bt?function(T,U){return Bt(T,"toString",{configurable:!0,enumerable:!1,value:Qs(U),writable:!0})}:Si;function Cs(T,U){return T.slice()}function Ps(T){var U=new T.constructor(T.byteLength);return new St(U).set(new St(T)),U}function Ls(T,U){var H=Ps(T.buffer);return new T.constructor(H,T.byteOffset,T.length)}function Bs(T,U){var H=-1,he=T.length;for(U||(U=Array(he));++H<he;)U[H]=T[H];return U}function Ms(T,U,H,he){var be=!H;H||(H={});for(var me=-1,ve=U.length;++me<ve;){var _e=U[me],Ae=void 0;Ae===void 0&&(Ae=T[_e]),be?Yr(H,_e,Ae):vs(H,_e,Ae)}return H}function Ds(T){return Os(function(U,H){var he=-1,be=H.length,me=be>1?H[be-1]:void 0,ve=be>2?H[2]:void 0;for(me=T.length>3&&typeof me=="function"?(be--,me):void 0,ve&&js(H[0],H[1],ve)&&(me=be<3?void 0:me,be=1),U=Object(U);++he<be;){var _e=H[he];_e&&T(U,_e,he,me)}return U})}function qs(T){return function(U,H,he){for(var be=-1,me=Object(U),ve=he(U),_e=ve.length;_e--;){var Ae=ve[++be];if(H(me[Ae],Ae,me)===!1)break}return U}}function _r(T,U){var H=T.__data__;return Ws(U)?H[typeof U=="string"?"string":"hash"]:H.map}function Jr(T,U){var H=ne(T,U);return Rs(H)?H:void 0}function ks(T){var U=we.call(T,ot),H=T[ot];try{T[ot]=void 0;var he=!0}catch{}var be=ye.call(T);return he&&(U?T[ot]=H:delete T[ot]),be}function Us(T){return typeof T.constructor=="function"&&!bi(T)?Ft(Me(T)):{}}function wi(T,U){var H=typeof T;return U=U??o,!!U&&(H=="number"||H!="symbol"&&K.test(T))&&T>-1&&T%1==0&&T<U}function js(T,U,H){if(!At(H))return!1;var he=typeof U;return(he=="number"?en(H)&&wi(U,H.length):he=="string"&&U in H)?mr(H[U],T):!1}function Ws(T){var U=typeof T;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?T!=="__proto__":T===null}function Fs(T){return!!Le&&Le in T}function bi(T){var U=T&&T.constructor,H=typeof U=="function"&&U.prototype||Z;return T===H}function $s(T){var U=[];if(T!=null)for(var H in Object(T))U.push(H);return U}function Hs(T){return ye.call(T)}function zs(T,U,H){return U=Wt(U===void 0?T.length-1:U,0),function(){for(var he=arguments,be=-1,me=Wt(he.length-U,0),ve=Array(me);++be<me;)ve[be]=he[U+be];be=-1;for(var _e=Array(U+1);++be<U;)_e[be]=he[be];return _e[U]=H(ve),L(T,this,_e)}}function Zr(T,U){if(!(U==="constructor"&&typeof T[U]=="function")&&U!="__proto__")return T[U]}var Gs=Vs(Ns);function Vs(T){var U=0,H=0;return function(){var he=fr(),be=s-(he-H);if(H=he,be>0){if(++U>=i)return arguments[0]}else U=0;return T.apply(void 0,arguments)}}function Ks(T){if(T!=null){try{return Y.call(T)}catch{}try{return T+""}catch{}}return""}function mr(T,U){return T===U||T!==T&&U!==U}var Xr=gi((function(){return arguments})())?gi:function(T){return Gt(T)&&we.call(T,"callee")&&!Hr.call(T,"callee")},Qr=Array.isArray;function en(T){return T!=null&&_i(T.length)&&!tn(T)}function Ys(T){return Gt(T)&&en(T)}var yi=zr||ea;function tn(T){if(!At(T))return!1;var U=yr(T);return U==k||U==B||U==w||U==v}function _i(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=o}function At(T){var U=typeof T;return T!=null&&(U=="object"||U=="function")}function Gt(T){return T!=null&&typeof T=="object"}function Js(T){if(!Gt(T)||yr(T)!=c)return!1;var U=Me(T);if(U===null)return!0;var H=we.call(U,"constructor")&&U.constructor;return typeof H=="function"&&H instanceof H&&Y.call(H)==De}var mi=fe?F(fe):Is;function Zs(T){return Ms(T,Ei(T))}function Ei(T){return en(T)?Ss(T):Ts(T)}var Xs=Ds(function(T,U,H){pi(T,U,H)});function Qs(T){return function(){return T}}function Si(T){return T}function ea(){return!1}r.exports=Xs})(Zt,Zt.exports)),Zt.exports}Pa();var Pr={exports:{}},La=Pr.exports,Ro;function Ba(){return Ro||(Ro=1,(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(La,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function l(y,b){var u=y[b];if(typeof u.bind=="function")return u.bind(y);try{return Function.prototype.bind.call(u,y)}catch{return function(){return Function.prototype.apply.apply(u,[y,arguments])}}}function d(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function w(y){return y==="debug"&&(y="log"),typeof console===t?!1:y==="trace"&&n?d:console[y]!==void 0?l(console,y):console.log!==void 0?l(console,"log"):e}function N(){for(var y=this.getLevel(),b=0;b<i.length;b++){var u=i[b];this[u]=b<y?e:this.methodFactory(u,y,this.name)}if(this.log=this.debug,typeof console===t&&y<this.levels.SILENT)return"No console available for logging"}function O(y){return function(){typeof console!==t&&(N.call(this),this[y].apply(this,arguments))}}function I(y,b,u){return w(y)||O.apply(this,arguments)}function k(y,b){var u=this,c,v,G,$="loglevel";typeof y=="string"?$+=":"+y:typeof y=="symbol"&&($=void 0);function J(g){var _=(i[g]||"silent").toUpperCase();if(!(typeof window===t||!$)){try{window.localStorage[$]=_;return}catch{}try{window.document.cookie=encodeURIComponent($)+"="+_+";"}catch{}}}function X(){var g;if(!(typeof window===t||!$)){try{g=window.localStorage[$]}catch{}if(typeof g===t)try{var _=window.document.cookie,h=encodeURIComponent($),C=_.indexOf(h+"=");C!==-1&&(g=/^([^;]+)/.exec(_.slice(C+h.length+1))[1])}catch{}return u.levels[g]===void 0&&(g=void 0),g}}function a(){if(!(typeof window===t||!$)){try{window.localStorage.removeItem($)}catch{}try{window.document.cookie=encodeURIComponent($)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function m(g){var _=g;if(typeof _=="string"&&u.levels[_.toUpperCase()]!==void 0&&(_=u.levels[_.toUpperCase()]),typeof _=="number"&&_>=0&&_<=u.levels.SILENT)return _;throw new TypeError("log.setLevel() called with invalid level: "+g)}u.name=y,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=b||I,u.getLevel=function(){return G??v??c},u.setLevel=function(g,_){return G=m(g),_!==!1&&J(G),N.call(u)},u.setDefaultLevel=function(g){v=m(g),X()||u.setLevel(g,!1)},u.resetLevel=function(){G=null,a(),N.call(u)},u.enableAll=function(g){u.setLevel(u.levels.TRACE,g)},u.disableAll=function(g){u.setLevel(u.levels.SILENT,g)},u.rebuild=function(){if(o!==u&&(c=m(o.getLevel())),N.call(u),o===u)for(var g in s)s[g].rebuild()},c=m(o?o.getLevel():"WARN");var f=X();f!=null&&(G=m(f)),N.call(u)}o=new k,o.getLogger=function(b){if(typeof b!="symbol"&&typeof b!="string"||b==="")throw new TypeError("You must supply a name when creating a logger.");var u=s[b];return u||(u=s[b]=new k(b,o.methodFactory)),u};var B=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=B),o},o.getLoggers=function(){return s},o.default=o,o})})(Pr)),Pr.exports}var ns=Ba();const Lr=xe.getDefaultExportFromCjs(ns),Ma=Lr.getLogger("http-helpers");Ma.setLevel(ns.levels.INFO);function Io(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}function Da(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function jr(r,...e){if(!Da(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}function qa(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Io(r.outputLen),Io(r.blockLen)}function Br(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function ka(r,e){jr(r);const t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}const jn=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Wn=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),nt=(r,e)=>r<<32-e|r>>>e;new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Ua(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function ai(r){return typeof r=="string"&&(r=Ua(r)),jr(r),r}function ja(...r){let e=0;for(let n=0;n<r.length;n++){const i=r[n];jr(i),e+=i.length}const t=new Uint8Array(e);for(let n=0,i=0;n<r.length;n++){const s=r[n];t.set(s,i),i+=s.length}return t}class is{clone(){return this._cloneInto()}}function Wa(r){const e=n=>r().update(ai(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function Fa(r=32){if(jn&&typeof jn.getRandomValues=="function")return jn.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function $a(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(t>>i&s),l=Number(t&s),d=n?4:0,w=n?0:4;r.setUint32(e+d,o,n),r.setUint32(e+w,l,n)}const Ha=(r,e,t)=>r&e^~r&t,za=(r,e,t)=>r&e^r&t^e&t;class Ga extends is{constructor(e,t,n,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Wn(this.buffer)}update(e){Br(this);const{view:t,buffer:n,blockLen:i}=this;e=ai(e);const s=e.length;for(let o=0;o<s;){const l=Math.min(i-this.pos,s-o);if(l===i){const d=Wn(e);for(;i<=s-o;o+=i)this.process(d,o);continue}n.set(e.subarray(o,o+l),this.pos),this.pos+=l,o+=l,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Br(this),ka(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let O=o;O<i;O++)t[O]=0;$a(n,i-8,BigInt(this.length*8),s),this.process(n,0);const l=Wn(e),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const w=d/4,N=this.get();if(w>N.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O<w;O++)l.setUint32(4*O,N[O],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:n,length:i,finished:s,destroyed:o,pos:l}=this;return e.length=i,e.pos=l,e.finished=s,e.destroyed=o,i%t&&e.buffer.set(n),e}}const Va=new Uint32Array([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]),bt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yt=new Uint32Array(64);class Ka extends Ga{constructor(){super(64,32,8,!1),this.A=bt[0]|0,this.B=bt[1]|0,this.C=bt[2]|0,this.D=bt[3]|0,this.E=bt[4]|0,this.F=bt[5]|0,this.G=bt[6]|0,this.H=bt[7]|0}get(){const{A:e,B:t,C:n,D:i,E:s,F:o,G:l,H:d}=this;return[e,t,n,i,s,o,l,d]}set(e,t,n,i,s,o,l,d){this.A=e|0,this.B=t|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=l|0,this.H=d|0}process(e,t){for(let O=0;O<16;O++,t+=4)yt[O]=e.getUint32(t,!1);for(let O=16;O<64;O++){const I=yt[O-15],k=yt[O-2],B=nt(I,7)^nt(I,18)^I>>>3,y=nt(k,17)^nt(k,19)^k>>>10;yt[O]=y+yt[O-7]+B+yt[O-16]|0}let{A:n,B:i,C:s,D:o,E:l,F:d,G:w,H:N}=this;for(let O=0;O<64;O++){const I=nt(l,6)^nt(l,11)^nt(l,25),k=N+I+Ha(l,d,w)+Va[O]+yt[O]|0,y=(nt(n,2)^nt(n,13)^nt(n,22))+za(n,i,s)|0;N=w,w=d,d=l,l=o+k|0,o=s,s=i,i=n,n=k+y|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,l=l+this.E|0,d=d+this.F|0,w=w+this.G|0,N=N+this.H|0,this.set(n,i,s,o,l,d,w,N)}roundClean(){yt.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ya=Wa(()=>new Ka);class os extends is{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,qa(e);const n=ai(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),s.fill(0)}update(e){return Br(this),this.iHash.update(e),this}digestInto(e){Br(this),jr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:l}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=l,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ss=(r,e,t)=>new os(r,e).update(t).digest();ss.create=(r,e)=>new os(r,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const as=BigInt(0),Wr=BigInt(1),Ja=BigInt(2);function Ct(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}function ir(r){if(!Ct(r))throw new Error("Uint8Array expected")}const Za=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function qt(r){ir(r);let e="";for(let t=0;t<r.length;t++)e+=Za[r[t]];return e}function ls(r){const e=r.toString(16);return e.length&1?`0${e}`:e}function li(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}const ut={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function To(r){if(r>=ut._0&&r<=ut._9)return r-ut._0;if(r>=ut._A&&r<=ut._F)return r-(ut._A-10);if(r>=ut._a&&r<=ut._f)return r-(ut._a-10)}function kt(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);const e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(t);for(let i=0,s=0;i<t;i++,s+=2){const o=To(r.charCodeAt(s)),l=To(r.charCodeAt(s+1));if(o===void 0||l===void 0){const d=r[s]+r[s+1];throw new Error('hex string expected, got non-hex character "'+d+'" at index '+s)}n[i]=o*16+l}return n}function Nt(r){return li(qt(r))}function ui(r){return ir(r),li(qt(Uint8Array.from(r).reverse()))}function Ut(r,e){return kt(r.toString(16).padStart(e*2,"0"))}function fi(r,e){return Ut(r,e).reverse()}function Xa(r){return kt(ls(r))}function tt(r,e,t){let n;if(typeof e=="string")try{n=kt(e)}catch(s){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${s}`)}else if(Ct(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);const i=n.length;if(typeof t=="number"&&i!==t)throw new Error(`${r} expected ${t} bytes, got ${i}`);return n}function tr(...r){let e=0;for(let n=0;n<r.length;n++){const i=r[n];ir(i),e+=i.length}const t=new Uint8Array(e);for(let n=0,i=0;n<r.length;n++){const s=r[n];t.set(s,i),i+=s.length}return t}function Qa(r,e){if(r.length!==e.length)return!1;let t=0;for(let n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}function el(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function tl(r){let e;for(e=0;r>as;r>>=Wr,e+=1);return e}function rl(r,e){return r>>BigInt(e)&Wr}function nl(r,e,t){return r|(t?Wr:as)<<BigInt(e)}const ci=r=>(Ja<<BigInt(r-1))-Wr,Fn=r=>new Uint8Array(r),xo=r=>Uint8Array.from(r);function us(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=Fn(r),i=Fn(r),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},l=(...O)=>t(i,n,...O),d=(O=Fn())=>{i=l(xo([0]),O),n=l(),O.length!==0&&(i=l(xo([1]),O),n=l())},w=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let O=0;const I=[];for(;O<e;){n=l();const k=n.slice();I.push(k),O+=n.length}return tr(...I)};return(O,I)=>{o(),d(O);let k;for(;!(k=I(w()));)d();return o(),k}}const il={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||Ct(r),isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function or(r,e,t={}){const n=(i,s,o)=>{const l=il[s];if(typeof l!="function")throw new Error(`Invalid validator "${s}", expected function`);const d=r[i];if(!(o&&d===void 0)&&!l(d,r))throw new Error(`Invalid param ${String(i)}=${d} (${typeof d}), expected ${s}`)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(t))n(i,s,!0);return r}const ol=Object.freeze(Object.defineProperty({__proto__:null,abytes:ir,bitGet:rl,bitLen:tl,bitMask:ci,bitSet:nl,bytesToHex:qt,bytesToNumberBE:Nt,bytesToNumberLE:ui,concatBytes:tr,createHmacDrbg:us,ensureBytes:tt,equalBytes:Qa,hexToBytes:kt,hexToNumber:li,isBytes:Ct,numberToBytesBE:Ut,numberToBytesLE:fi,numberToHexUnpadded:ls,numberToVarBytesBE:Xa,utf8ToBytes:el,validateObject:or},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Pe=BigInt(0),Te=BigInt(1),xt=BigInt(2),sl=BigInt(3),Yn=BigInt(4),Oo=BigInt(5),No=BigInt(8);BigInt(9);BigInt(16);function Fe(r,e){const t=r%e;return t>=Pe?t:e+t}function al(r,e,t){if(t<=Pe||e<Pe)throw new Error("Expected power/modulo > 0");if(t===Te)return Pe;let n=Te;for(;e>Pe;)e&Te&&(n=n*r%t),r=r*r%t,e>>=Te;return n}function Ge(r,e,t){let n=r;for(;e-- >Pe;)n*=n,n%=t;return n}function Jn(r,e){if(r===Pe||e<=Pe)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=Fe(r,e),n=e,i=Pe,s=Te;for(;t!==Pe;){const l=n/t,d=n%t,w=i-s*l;n=t,t=d,i=s,s=w}if(n!==Te)throw new Error("invert: does not exist");return Fe(i,e)}function ll(r){const e=(r-Te)/xt;let t,n,i;for(t=r-Te,n=0;t%xt===Pe;t/=xt,n++);for(i=xt;i<r&&al(i,e,r)!==r-Te;i++);if(n===1){const o=(r+Te)/Yn;return function(d,w){const N=d.pow(w,o);if(!d.eql(d.sqr(N),w))throw new Error("Cannot find square root");return N}}const s=(t+Te)/xt;return function(l,d){if(l.pow(d,e)===l.neg(l.ONE))throw new Error("Cannot find square root");let w=n,N=l.pow(l.mul(l.ONE,i),t),O=l.pow(d,s),I=l.pow(d,t);for(;!l.eql(I,l.ONE);){if(l.eql(I,l.ZERO))return l.ZERO;let k=1;for(let y=l.sqr(I);k<w&&!l.eql(y,l.ONE);k++)y=l.sqr(y);const B=l.pow(N,Te<<BigInt(w-k-1));N=l.sqr(B),O=l.mul(O,B),I=l.mul(I,N),w=k}return O}}function ul(r){if(r%Yn===sl){const e=(r+Te)/Yn;return function(n,i){const s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(r%No===Oo){const e=(r-Oo)/No;return function(n,i){const s=n.mul(i,xt),o=n.pow(s,e),l=n.mul(i,o),d=n.mul(n.mul(l,xt),o),w=n.mul(l,n.sub(d,n.ONE));if(!n.eql(n.sqr(w),i))throw new Error("Cannot find square root");return w}}return ll(r)}const fl=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function cl(r){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=fl.reduce((n,i)=>(n[i]="function",n),e);return or(r,t)}function dl(r,e,t){if(t<Pe)throw new Error("Expected power > 0");if(t===Pe)return r.ONE;if(t===Te)return e;let n=r.ONE,i=e;for(;t>Pe;)t&Te&&(n=r.mul(n,i)),i=r.sqr(i),t>>=Te;return n}function hl(r,e){const t=new Array(e.length),n=e.reduce((s,o,l)=>r.is0(o)?s:(t[l]=s,r.mul(s,o)),r.ONE),i=r.inv(n);return e.reduceRight((s,o,l)=>r.is0(o)?s:(t[l]=r.mul(s,t[l]),r.mul(s,o)),i),t}function fs(r,e){const t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function gl(r,e,t=!1,n={}){if(r<=Pe)throw new Error(`Expected Field ORDER > 0, got ${r}`);const{nBitLength:i,nByteLength:s}=fs(r,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=ul(r),l=Object.freeze({ORDER:r,BITS:i,BYTES:s,MASK:ci(i),ZERO:Pe,ONE:Te,create:d=>Fe(d,r),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return Pe<=d&&d<r},is0:d=>d===Pe,isOdd:d=>(d&Te)===Te,neg:d=>Fe(-d,r),eql:(d,w)=>d===w,sqr:d=>Fe(d*d,r),add:(d,w)=>Fe(d+w,r),sub:(d,w)=>Fe(d-w,r),mul:(d,w)=>Fe(d*w,r),pow:(d,w)=>dl(l,d,w),div:(d,w)=>Fe(d*Jn(w,r),r),sqrN:d=>d*d,addN:(d,w)=>d+w,subN:(d,w)=>d-w,mulN:(d,w)=>d*w,inv:d=>Jn(d,r),sqrt:n.sqrt||(d=>o(l,d)),invertBatch:d=>hl(l,d),cmov:(d,w,N)=>N?w:d,toBytes:d=>t?fi(d,s):Ut(d,s),fromBytes:d=>{if(d.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${d.length}`);return t?ui(d):Nt(d)}});return Object.freeze(l)}function cs(r){if(typeof r!="bigint")throw new Error("field order must be bigint");const e=r.toString(2).length;return Math.ceil(e/8)}function ds(r){const e=cs(r);return e+Math.ceil(e/2)}function pl(r,e,t=!1){const n=r.length,i=cs(e),s=ds(e);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const o=t?Nt(r):ui(r),l=Fe(o,e-Te)+Te;return t?fi(l,i):Ut(l,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wl=BigInt(0),$n=BigInt(1);function bl(r,e){const t=(i,s)=>{const o=s.negate();return i?o:s},n=i=>{const s=Math.ceil(e/i)+1,o=2**(i-1);return{windows:s,windowSize:o}};return{constTimeNegate:t,unsafeLadder(i,s){let o=r.ZERO,l=i;for(;s>wl;)s&$n&&(o=o.add(l)),l=l.double(),s>>=$n;return o},precomputeWindow(i,s){const{windows:o,windowSize:l}=n(s),d=[];let w=i,N=w;for(let O=0;O<o;O++){N=w,d.push(N);for(let I=1;I<l;I++)N=N.add(w),d.push(N);w=N.double()}return d},wNAF(i,s,o){const{windows:l,windowSize:d}=n(i);let w=r.ZERO,N=r.BASE;const O=BigInt(2**i-1),I=2**i,k=BigInt(i);for(let B=0;B<l;B++){const y=B*d;let b=Number(o&O);o>>=k,b>d&&(b-=I,o+=$n);const u=y,c=y+Math.abs(b)-1,v=B%2!==0,G=b<0;b===0?N=N.add(t(v,s[u])):w=w.add(t(G,s[c]))}return{p:w,f:N}},wNAFCached(i,s,o,l){const d=i._WINDOW_SIZE||1;let w=s.get(i);return w||(w=this.precomputeWindow(i,d),d!==1&&s.set(i,l(w))),this.wNAF(d,w,o)}}}function hs(r){return cl(r.Fp),or(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fs(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yl(r){const e=hs(r);or(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:t,Fp:n,a:i}=e;if(t){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:_l,hexToBytes:ml}=ol,Ot={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){const{Err:e}=Ot;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");const t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:_l(n),l:r.subarray(t+2)}},toSig(r){const{Err:e}=Ot,t=typeof r=="string"?ml(r):r;ir(t);let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");const{d:i,l:s}=Ot._parseInt(t.subarray(2)),{d:o,l}=Ot._parseInt(s);if(l.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(r){const e=w=>Number.parseInt(w[0],16)&8?"00"+w:w,t=w=>{const N=w.toString(16);return N.length&1?`0${N}`:N},n=e(t(r.s)),i=e(t(r.r)),s=n.length/2,o=i.length/2,l=t(s),d=t(o);return`30${t(o+s+4)}02${d}${i}02${l}${n}`}},ct=BigInt(0),Ye=BigInt(1);BigInt(2);const Co=BigInt(3);BigInt(4);function El(r){const e=yl(r),{Fp:t}=e,n=e.toBytes||((B,y,b)=>{const u=y.toAffine();return tr(Uint8Array.from([4]),t.toBytes(u.x),t.toBytes(u.y))}),i=e.fromBytes||(B=>{const y=B.subarray(1),b=t.fromBytes(y.subarray(0,t.BYTES)),u=t.fromBytes(y.subarray(t.BYTES,2*t.BYTES));return{x:b,y:u}});function s(B){const{a:y,b}=e,u=t.sqr(B),c=t.mul(u,B);return t.add(t.add(c,t.mul(B,y)),b)}if(!t.eql(t.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(B){return typeof B=="bigint"&&ct<B&&B<e.n}function l(B){if(!o(B))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function d(B){const{allowedPrivateKeyLengths:y,nByteLength:b,wrapPrivateKey:u,n:c}=e;if(y&&typeof B!="bigint"){if(Ct(B)&&(B=qt(B)),typeof B!="string"||!y.includes(B.length))throw new Error("Invalid key");B=B.padStart(b*2,"0")}let v;try{v=typeof B=="bigint"?B:Nt(tt("private key",B,b))}catch{throw new Error(`private key must be ${b} bytes, hex or bigint, not ${typeof B}`)}return u&&(v=Fe(v,c)),l(v),v}const w=new Map;function N(B){if(!(B instanceof O))throw new Error("ProjectivePoint expected")}class O{constructor(y,b,u){if(this.px=y,this.py=b,this.pz=u,y==null||!t.isValid(y))throw new Error("x required");if(b==null||!t.isValid(b))throw new Error("y required");if(u==null||!t.isValid(u))throw new Error("z required")}static fromAffine(y){const{x:b,y:u}=y||{};if(!y||!t.isValid(b)||!t.isValid(u))throw new Error("invalid affine point");if(y instanceof O)throw new Error("projective point not allowed");const c=v=>t.eql(v,t.ZERO);return c(b)&&c(u)?O.ZERO:new O(b,u,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(y){const b=t.invertBatch(y.map(u=>u.pz));return y.map((u,c)=>u.toAffine(b[c])).map(O.fromAffine)}static fromHex(y){const b=O.fromAffine(i(tt("pointHex",y)));return b.assertValidity(),b}static fromPrivateKey(y){return O.BASE.multiply(d(y))}_setWindowSize(y){this._WINDOW_SIZE=y,w.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:y,y:b}=this.toAffine();if(!t.isValid(y)||!t.isValid(b))throw new Error("bad point: x or y not FE");const u=t.sqr(b),c=s(y);if(!t.eql(u,c))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y}=this.toAffine();if(t.isOdd)return!t.isOdd(y);throw new Error("Field doesn't support isOdd")}equals(y){N(y);const{px:b,py:u,pz:c}=this,{px:v,py:G,pz:$}=y,J=t.eql(t.mul(b,$),t.mul(v,c)),X=t.eql(t.mul(u,$),t.mul(G,c));return J&&X}negate(){return new O(this.px,t.neg(this.py),this.pz)}double(){const{a:y,b}=e,u=t.mul(b,Co),{px:c,py:v,pz:G}=this;let $=t.ZERO,J=t.ZERO,X=t.ZERO,a=t.mul(c,c),m=t.mul(v,v),f=t.mul(G,G),g=t.mul(c,v);return g=t.add(g,g),X=t.mul(c,G),X=t.add(X,X),$=t.mul(y,X),J=t.mul(u,f),J=t.add($,J),$=t.sub(m,J),J=t.add(m,J),J=t.mul($,J),$=t.mul(g,$),X=t.mul(u,X),f=t.mul(y,f),g=t.sub(a,f),g=t.mul(y,g),g=t.add(g,X),X=t.add(a,a),a=t.add(X,a),a=t.add(a,f),a=t.mul(a,g),J=t.add(J,a),f=t.mul(v,G),f=t.add(f,f),a=t.mul(f,g),$=t.sub($,a),X=t.mul(f,m),X=t.add(X,X),X=t.add(X,X),new O($,J,X)}add(y){N(y);const{px:b,py:u,pz:c}=this,{px:v,py:G,pz:$}=y;let J=t.ZERO,X=t.ZERO,a=t.ZERO;const m=e.a,f=t.mul(e.b,Co);let g=t.mul(b,v),_=t.mul(u,G),h=t.mul(c,$),C=t.add(b,u),p=t.add(v,G);C=t.mul(C,p),p=t.add(g,_),C=t.sub(C,p),p=t.add(b,c);let A=t.add(v,$);return p=t.mul(p,A),A=t.add(g,h),p=t.sub(p,A),A=t.add(u,c),J=t.add(G,$),A=t.mul(A,J),J=t.add(_,h),A=t.sub(A,J),a=t.mul(m,p),J=t.mul(f,h),a=t.add(J,a),J=t.sub(_,a),a=t.add(_,a),X=t.mul(J,a),_=t.add(g,g),_=t.add(_,g),h=t.mul(m,h),p=t.mul(f,p),_=t.add(_,h),h=t.sub(g,h),h=t.mul(m,h),p=t.add(p,h),g=t.mul(_,p),X=t.add(X,g),g=t.mul(A,p),J=t.mul(C,J),J=t.sub(J,g),g=t.mul(C,_),a=t.mul(A,a),a=t.add(a,g),new O(J,X,a)}subtract(y){return this.add(y.negate())}is0(){return this.equals(O.ZERO)}wNAF(y){return k.wNAFCached(this,w,y,b=>{const u=t.invertBatch(b.map(c=>c.pz));return b.map((c,v)=>c.toAffine(u[v])).map(O.fromAffine)})}multiplyUnsafe(y){const b=O.ZERO;if(y===ct)return b;if(l(y),y===Ye)return this;const{endo:u}=e;if(!u)return k.unsafeLadder(this,y);let{k1neg:c,k1:v,k2neg:G,k2:$}=u.splitScalar(y),J=b,X=b,a=this;for(;v>ct||$>ct;)v&Ye&&(J=J.add(a)),$&Ye&&(X=X.add(a)),a=a.double(),v>>=Ye,$>>=Ye;return c&&(J=J.negate()),G&&(X=X.negate()),X=new O(t.mul(X.px,u.beta),X.py,X.pz),J.add(X)}multiply(y){l(y);let b=y,u,c;const{endo:v}=e;if(v){const{k1neg:G,k1:$,k2neg:J,k2:X}=v.splitScalar(b);let{p:a,f:m}=this.wNAF($),{p:f,f:g}=this.wNAF(X);a=k.constTimeNegate(G,a),f=k.constTimeNegate(J,f),f=new O(t.mul(f.px,v.beta),f.py,f.pz),u=a.add(f),c=m.add(g)}else{const{p:G,f:$}=this.wNAF(b);u=G,c=$}return O.normalizeZ([u,c])[0]}multiplyAndAddUnsafe(y,b,u){const c=O.BASE,v=($,J)=>J===ct||J===Ye||!$.equals(c)?$.multiplyUnsafe(J):$.multiply(J),G=v(this,b).add(v(y,u));return G.is0()?void 0:G}toAffine(y){const{px:b,py:u,pz:c}=this,v=this.is0();y==null&&(y=v?t.ONE:t.inv(c));const G=t.mul(b,y),$=t.mul(u,y),J=t.mul(c,y);if(v)return{x:t.ZERO,y:t.ZERO};if(!t.eql(J,t.ONE))throw new Error("invZ was invalid");return{x:G,y:$}}isTorsionFree(){const{h:y,isTorsionFree:b}=e;if(y===Ye)return!0;if(b)return b(O,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:y,clearCofactor:b}=e;return y===Ye?this:b?b(O,this):this.multiplyUnsafe(e.h)}toRawBytes(y=!0){return this.assertValidity(),n(O,this,y)}toHex(y=!0){return qt(this.toRawBytes(y))}}O.BASE=new O(e.Gx,e.Gy,t.ONE),O.ZERO=new O(t.ZERO,t.ONE,t.ZERO);const I=e.nBitLength,k=bl(O,e.endo?Math.ceil(I/2):I);return{CURVE:e,ProjectivePoint:O,normPrivateKeyToScalar:d,weierstrassEquation:s,isWithinCurveOrder:o}}function Sl(r){const e=hs(r);return or(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function vl(r){const e=Sl(r),{Fp:t,n}=e,i=t.BYTES+1,s=2*t.BYTES+1;function o(p){return ct<p&&p<t.ORDER}function l(p){return Fe(p,n)}function d(p){return Jn(p,n)}const{ProjectivePoint:w,normPrivateKeyToScalar:N,weierstrassEquation:O,isWithinCurveOrder:I}=El({...e,toBytes(p,A,P){const E=A.toAffine(),M=t.toBytes(E.x),S=tr;return P?S(Uint8Array.from([A.hasEvenY()?2:3]),M):S(Uint8Array.from([4]),M,t.toBytes(E.y))},fromBytes(p){const A=p.length,P=p[0],E=p.subarray(1);if(A===i&&(P===2||P===3)){const M=Nt(E);if(!o(M))throw new Error("Point is not on curve");const S=O(M);let j;try{j=t.sqrt(S)}catch(ee){const Q=ee instanceof Error?": "+ee.message:"";throw new Error("Point is not on curve"+Q)}const K=(j&Ye)===Ye;return(P&1)===1!==K&&(j=t.neg(j)),{x:M,y:j}}else if(A===s&&P===4){const M=t.fromBytes(E.subarray(0,t.BYTES)),S=t.fromBytes(E.subarray(t.BYTES,2*t.BYTES));return{x:M,y:S}}else throw new Error(`Point of length ${A} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),k=p=>qt(Ut(p,e.nByteLength));function B(p){const A=n>>Ye;return p>A}function y(p){return B(p)?l(-p):p}const b=(p,A,P)=>Nt(p.slice(A,P));class u{constructor(A,P,E){this.r=A,this.s=P,this.recovery=E,this.assertValidity()}static fromCompact(A){const P=e.nByteLength;return A=tt("compactSignature",A,P*2),new u(b(A,0,P),b(A,P,2*P))}static fromDER(A){const{r:P,s:E}=Ot.toSig(tt("DER",A));return new u(P,E)}assertValidity(){if(!I(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!I(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(A){return new u(this.r,this.s,A)}recoverPublicKey(A){const{r:P,s:E,recovery:M}=this,S=X(tt("msgHash",A));if(M==null||![0,1,2,3].includes(M))throw new Error("recovery id invalid");const j=M===2||M===3?P+e.n:P;if(j>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=(M&1)===0?"02":"03",W=w.fromHex(K+k(j)),ee=d(j),Q=l(-S*ee),le=l(E*ee),ue=w.BASE.multiplyAndAddUnsafe(W,Q,le);if(!ue)throw new Error("point at infinify");return ue.assertValidity(),ue}hasHighS(){return B(this.s)}normalizeS(){return this.hasHighS()?new u(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return kt(this.toDERHex())}toDERHex(){return Ot.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return kt(this.toCompactHex())}toCompactHex(){return k(this.r)+k(this.s)}}const c={isValidPrivateKey(p){try{return N(p),!0}catch{return!1}},normPrivateKeyToScalar:N,randomPrivateKey:()=>{const p=ds(e.n);return pl(e.randomBytes(p),e.n)},precompute(p=8,A=w.BASE){return A._setWindowSize(p),A.multiply(BigInt(3)),A}};function v(p,A=!0){return w.fromPrivateKey(p).toRawBytes(A)}function G(p){const A=Ct(p),P=typeof p=="string",E=(A||P)&&p.length;return A?E===i||E===s:P?E===2*i||E===2*s:p instanceof w}function $(p,A,P=!0){if(G(p))throw new Error("first arg must be private key");if(!G(A))throw new Error("second arg must be public key");return w.fromHex(A).multiply(N(p)).toRawBytes(P)}const J=e.bits2int||function(p){const A=Nt(p),P=p.length*8-e.nBitLength;return P>0?A>>BigInt(P):A},X=e.bits2int_modN||function(p){return l(J(p))},a=ci(e.nBitLength);function m(p){if(typeof p!="bigint")throw new Error("bigint expected");if(!(ct<=p&&p<a))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Ut(p,e.nByteLength)}function f(p,A,P=g){if(["recovered","canonical"].some(V=>V in P))throw new Error("sign() legacy options not supported");const{hash:E,randomBytes:M}=e;let{lowS:S,prehash:j,extraEntropy:K}=P;S==null&&(S=!0),p=tt("msgHash",p),j&&(p=tt("prehashed msgHash",E(p)));const W=X(p),ee=N(A),Q=[m(ee),m(W)];if(K!=null&&K!==!1){const V=K===!0?M(t.BYTES):K;Q.push(tt("extraEntropy",V))}const le=tr(...Q),ue=W;function z(V){const oe=J(V);if(!I(oe))return;const ce=d(oe),fe=w.BASE.multiply(oe).toAffine(),L=l(fe.x);if(L===ct)return;const D=l(ce*l(ue+L*ee));if(D===ct)return;let F=(fe.x===L?0:2)|Number(fe.y&Ye),ne=D;return S&&B(D)&&(ne=y(D),F^=1),new u(L,ne,F)}return{seed:le,k2sig:z}}const g={lowS:e.lowS,prehash:!1},_={lowS:e.lowS,prehash:!1};function h(p,A,P=g){const{seed:E,k2sig:M}=f(p,A,P),S=e;return us(S.hash.outputLen,S.nByteLength,S.hmac)(E,M)}w.BASE._setWindowSize(8);function C(p,A,P,E=_){const M=p;if(A=tt("msgHash",A),P=tt("publicKey",P),"strict"in E)throw new Error("options.strict was renamed to lowS");const{lowS:S,prehash:j}=E;let K,W;try{if(typeof M=="string"||Ct(M))try{K=u.fromDER(M)}catch(fe){if(!(fe instanceof Ot.Err))throw fe;K=u.fromCompact(M)}else if(typeof M=="object"&&typeof M.r=="bigint"&&typeof M.s=="bigint"){const{r:fe,s:L}=M;K=new u(fe,L)}else throw new Error("PARSE");W=w.fromHex(P)}catch(fe){if(fe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(S&&K.hasHighS())return!1;j&&(A=e.hash(A));const{r:ee,s:Q}=K,le=X(A),ue=d(Q),z=l(le*ue),V=l(ee*ue),oe=w.BASE.multiplyAndAddUnsafe(W,z,V)?.toAffine();return oe?l(oe.x)===ee:!1}return{CURVE:e,getPublicKey:v,getSharedSecret:$,sign:h,verify:C,ProjectivePoint:w,Signature:u,utils:c}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Al(r){return{hash:r,hmac:(e,...t)=>ss(r,e,ja(...t)),randomBytes:Fa}}function Rl(r,e){const t=n=>vl({...r,...Al(n)});return Object.freeze({...t(e),create:t})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gs=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Po=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Il=BigInt(1),Zn=BigInt(2),Lo=(r,e)=>(r+e/Zn)/e;function Tl(r){const e=gs,t=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),l=BigInt(44),d=BigInt(88),w=r*r*r%e,N=w*w*r%e,O=Ge(N,t,e)*N%e,I=Ge(O,t,e)*N%e,k=Ge(I,Zn,e)*w%e,B=Ge(k,i,e)*k%e,y=Ge(B,s,e)*B%e,b=Ge(y,l,e)*y%e,u=Ge(b,d,e)*b%e,c=Ge(u,l,e)*y%e,v=Ge(c,t,e)*N%e,G=Ge(v,o,e)*B%e,$=Ge(G,n,e)*w%e,J=Ge($,Zn,e);if(!Xn.eql(Xn.sqr(J),r))throw new Error("Cannot find square root");return J}const Xn=gl(gs,void 0,void 0,{sqrt:Tl}),di=Rl({a:BigInt(0),b:BigInt(7),Fp:Xn,n:Po,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{const e=Po,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Il*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=t,o=BigInt("0x100000000000000000000000000000000"),l=Lo(s*r,e),d=Lo(-n*r,e);let w=Fe(r-l*t-d*i,e),N=Fe(-l*n-d*s,e);const O=w>o,I=N>o;if(O&&(w=e-w),I&&(N=e-N),w>o||N>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:O,k1:w,k2neg:I,k2:N}}}},Ya);BigInt(0);di.ProjectivePoint;function xl(r){let e=r;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}BigInt(0);const Qn={},ei={};for(let r=0;r<16;r++){const e=r,t=r*16,n=r.toString(16).toLowerCase();ei[n]=e,ei[n.toUpperCase()]=e,Qn[n]=t,Qn[n.toUpperCase()]=t}function Ol(r){const e=r.length,t=new Uint8Array(e/2);for(let n=0;n<e;n+=2)t[n/2]=Qn[r[n]]+ei[r[n+1]];return t}Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));for(let r=0;r<=256*256-1;r++)BigInt(r);const Fr=r=>{if(typeof r!="string")throw new Error(`hex argument type ${typeof r} must be of type string`);if(!/^0x[0-9a-fA-F]*$/.test(r))throw new Error(`Input must be a 0x-prefixed hexadecimal string, got ${r}`);const e=r.slice(2);return Ol(e.length%2===0?e:xl(e))},Nl=r=>{if(!Number.isSafeInteger(r)||r<0)throw new Error(`Received an invalid integer type: ${r}`);return`0x${r.toString(16)}`},sr=r=>{const e=Nl(r);return Fr(e)};BigInt("0xffffffffffffffff");BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935");di.CURVE.n;di.CURVE.n/BigInt(2);BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");const Cl="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";Fr(Cl);const Pl="0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";Fr(Pl);const Ll="0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";Fr(Ll);Uint8Array.from([128]);BigInt(-1);BigInt(0);BigInt(1);BigInt(2);BigInt(3);BigInt(7);BigInt(8);BigInt(27);BigInt(28);BigInt(31);BigInt(32);BigInt(64);BigInt(128);BigInt(255);BigInt(256);BigInt(96);BigInt(100);BigInt(160);BigInt(224);BigInt(7922816251426434e13);BigInt(1461501637330903e33);BigInt(2695994666715064e52);BigInt(1e9);Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));var Bo;(function(r){r.String="string",r.Bytes="view",r.Number="number"})(Bo||(Bo={}));var Mo;(function(r){r.String="string",r.Bytes="view",r.JSON="json"})(Mo||(Mo={}));var Do;(function(r){r[r.Number=0]="Number",r[r.BigInt=1]="BigInt",r[r.Uint8Array=2]="Uint8Array",r[r.PrefixedHexString=3]="PrefixedHexString"})(Do||(Do={}));var qo;(function(r){r[r.Deposit=0]="Deposit",r[r.Withdrawal=1]="Withdrawal",r[r.Consolidation=2]="Consolidation"})(qo||(qo={}));var Pt;(function(r){r[r.Version=0]="Version",r[r.Balance=1]="Balance",r[r.Nonce=2]="Nonce",r[r.CodeHash=3]="CodeHash",r[r.CodeSize=4]="CodeSize"})(Pt||(Pt={}));sr(Pt.Version);sr(Pt.Balance);sr(Pt.Nonce);sr(Pt.CodeHash);sr(Pt.CodeSize);BigInt(256)**BigInt(31);var Hn={exports:{}},Tr={},xr={},ko;function Bl(){if(ko)return xr;ko=1,Object.defineProperty(xr,"__esModule",{value:!0});function r(e){var t=4,n=e.length,i=n%t;if(!i)return e;var s=n,o=t-i,l=n+o,d=qe.Buffer.alloc(l);for(d.write(e);o--;)d.write("=",s++);return d.toString()}return xr.default=r,xr}var Uo;function Ml(){if(Uo)return Tr;Uo=1,Object.defineProperty(Tr,"__esModule",{value:!0});var r=Bl();function e(l,d){return d===void 0&&(d="utf8"),qe.Buffer.isBuffer(l)?i(l.toString("base64")):i(qe.Buffer.from(l,d).toString("base64"))}function t(l,d){return d===void 0&&(d="utf8"),qe.Buffer.from(n(l),"base64").toString(d)}function n(l){return l=l.toString(),r.default(l).replace(/\-/g,"+").replace(/_/g,"/")}function i(l){return l.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function s(l){return qe.Buffer.from(n(l),"base64")}var o=e;return o.encode=e,o.decode=t,o.toBase64=n,o.fromBase64=i,o.toBuffer=s,Tr.default=o,Tr}var jo;function Dl(){return jo||(jo=1,(function(r){r.exports=Ml().default,r.exports.default=r.exports})(Hn)),Hn.exports}Dl();const Se={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},_t={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"};Se.MAINNET+"",Se.TESTNET+"",Se.CYAN+"",Se.AQUA+"",Se.CELESTE+"";Se.AQUA+"",_t.SAPPHIRE_MAINNET,Se.CELESTE+"",_t.SAPPHIRE_MAINNET,Se.CYAN+"",_t.SAPPHIRE_MAINNET,Se.MAINNET+"",_t.SAPPHIRE_MAINNET,Se.TESTNET+"",_t.SAPPHIRE_DEVNET;Se.MAINNET+"",Se.TESTNET+"",Se.CYAN+"",Se.AQUA+"",Se.CELESTE+"";_t.SAPPHIRE_MAINNET+"",_t.SAPPHIRE_DEVNET+"",Se.MAINNET+"",Se.TESTNET+"",Se.CYAN+"",Se.AQUA+"",Se.CELESTE+"";Se.MAINNET+"",Se.TESTNET+"",Se.CYAN+"",Se.AQUA+"",Se.CELESTE+"";function Wo(r){let e=!1,t=0,n;try{n=window[r],e=!0,t=n.length;const i="__storage_test__";return n.setItem(i,i),n.removeItem(i),!0}catch(i){const s=i;return s&&(s.code===22||s.code===1014||s.name==="QuotaExceededError"||s.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&t!==0}}class ql{constructor(){ge(this,"store",new Map)}getItem(e){return this.store.get(e)||null}setItem(e,t){this.store.set(e,t)}removeItem(e){this.store.delete(e)}}class kl{constructor(e,t){ge(this,"storage",void 0),ge(this,"_storeKey",void 0),this.storage=t,this._storeKey=e;try{t.getItem(e)||this.resetStore()}catch{}}static getInstance(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"local";if(!this.instanceMap.has(e)){let n;t==="local"&&Wo("localStorage")?n=window.localStorage:t==="session"&&Wo("sessionStorage")?n=window.sessionStorage:n=new ql,this.instanceMap.set(e,new this(e,n))}return this.instanceMap.get(e)}toJSON(){return this.storage.getItem(this._storeKey)}resetStore(){const e=this.getStore();return this.storage.removeItem(this._storeKey),e}getStore(){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")}get(e){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")[e]}set(e,t){const n=JSON.parse(this.storage.getItem(this._storeKey)||"{}");n[e]=t,this.storage.setItem(this._storeKey,JSON.stringify(n))}}ge(kl,"instanceMap",new Map);Je(Je({},_t),Se);const Or={IFRAME_STATUS:"iframe_status",CLOSE_WINDOW:"close_window",USER_LOGGED_IN:"user_logged_in",USER_LOGGED_OUT:"user_logged_out"},dt={LOGOUT:"logout",WALLET_INSTANCE_ID:"wallet_instance_id",USER_INFO:"user_info",SET_PROVIDER:"set_provider",TOPUP:"topup",IFRAME_STATUS:"iframe_status",CLOSED_WINDOW:"closed_window",WINDOW_BLOCKED:"window_blocked",GET_PROVIDER_STATE:"get_provider_state",LOGIN_WITH_PRIVATE_KEY:"login_with_private_key",SHOW_WALLET_CONNECT:"show_wallet_connect",SHOW_CHECKOUT:"show_checkout",SHOW_WALLET_UI:"show_wallet_ui",LOGIN_WITH_SESSION_ID:"login_with_session_id"},Ul={GET_PROVIDER_STATE:"wallet_get_provider_state"},zn={ACCOUNTS_CHANGED:"wallet_accounts_changed",CHAIN_CHANGED:"wallet_chain_changed",UNLOCK_STATE_CHANGED:"wallet_unlock_state_changed"};function jl(r){return function(t,n,i){i(s=>{n.error&&Lr.warn(`Error in RPC response:
|
|
3
3
|
`,n),!t.isTorusInternal&&(Lr.info(`RPC (${r.origin}):`,t,"->",n),s())})}}var mt=ia(),Gn,Fo;function Wl(){return Fo||(Fo=1,Gn=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){var o=s[i];if(!r(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}),Gn}var Fl=Wl();const $l=xe.getDefaultExportFromCjs(Fl);var Hl="2.1.0";function ps(r){return r!==null&&typeof r=="object"&&typeof r.pipe=="function"}function zl(r){return ps(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object"}function Gl(r){return ps(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object"}function Vl(r){return zl(r)&&Gl(r)}var it={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",unsupportedSync:r=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${r} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:r=>`Invalid options. Received: { maxEventListeners: ${r}}`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:r=>`'args.logger' must include required method '${r}'.`},info:{connected:r=>`Torus: Connected to chain with ID "${r}".`}};const ws={PRODUCTION:"production"},Mt={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},Kl={en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies benötigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"継続する",actionRequired:"認証が必要です",pendingAction:"続行をクリックして、ポップアップでリクエストを続行します",cookiesRequired:"必要なクッキー",enableCookies:"Torusにアクセスするには、ブラウザの設定でCookieを有効にしてください。",clickHere:"詳しくは"}},ko:{embed:{continue:"계속하다",actionRequired:"승인 필요",pendingAction:"팝업에서 요청을 진행하려면 계속을 클릭하십시오.",cookiesRequired:"쿠키 필요",enableCookies:"브라우저 환경 설정에서 쿠키를 활성화하여 Torus에 액세스하십시오.",clickHere:"더 많은 정보"}},zh:{embed:{continue:"继续",actionRequired:"需要授权",pendingAction:"单击继续以在弹出窗口中继续您的请求",cookiesRequired:"必填Cookie",enableCookies:"请在您的浏览器首选项中启用cookie以访问Torus。",clickHere:"更多信息"}}};var hi={translations:Kl,localStorageKeyPrefix:"torus-"},Ee=Lr.getLogger("solana-embed");function Yl(){return(r,e,t)=>{(typeof r.method!="string"||!r.method)&&(e.error=mt.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:r})),t(n=>{const{error:i}=e;return i&&Ee.error(`Torus - RPC Error: ${i.message}`,i),n()})}}function Jl(r,e,t){let n=`Torus: Lost connection to "${r}".`;e?.stack&&(n+=`
|
|
4
4
|
${e.stack}`),Ee.warn(n),t&&t.listenerCount("error")>0&&t.emit("error",n)}const Nr=()=>Math.random().toString(36).slice(2),bs=async r=>{let e,t;switch(r){case"testing":e="https://solana-testing.tor.us",t="debug";break;case"development":e="http://localhost:8080",t="debug";break;default:e="https://solana.tor.us",t="error";break}return{torusUrl:e,logLevel:t}},Zl=()=>{let r=window.navigator.language||"en-US";const e=r.split("-");return r=Object.prototype.hasOwnProperty.call(hi.translations,e[0])?e[0]:"en",r},Xl={height:660,width:375},Ql={height:740,width:1315},eu={height:700,width:1200},ys={height:600,width:400};function tu(r){let e;try{e=window[r];const t="__storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(t){const n=t;return n&&(n.code===22||n.code===1014||n.name==="QuotaExceededError"||n.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e&&e.length!==0}}function Xt(r){let{width:e,height:t}=r;const n=window.screenLeft!==void 0?window.screenLeft:window.screenX,i=window.screenTop!==void 0?window.screenTop:window.screenY,s=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,o=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,l=1,d=Math.abs((s-e)/2/l+n),w=Math.abs((o-t)/2/l+i);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${t/l},width=${e/l},top=${w},left=${d}`}class _s extends Ur{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:i="provider"}=t;if(super(),ge(this,"isTorus",void 0),ge(this,"_rpcEngine",void 0),ge(this,"jsonRpcConnectionEvents",void 0),ge(this,"_state",void 0),!Vl(e))throw new Error(it.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(n),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this);const s=new Na;co(e,s,e,this._handleStreamDisconnect.bind(this,"Torus")),s.ignoreStream("phishing");const o=Ta();co(o.stream,s.createStream(i),o.stream,this._handleStreamDisconnect.bind(this,"Torus RpcProvider"));const l=new ft;l.push(xa()),l.push(Yl()),l.push(jl({origin:location.origin})),l.push(o.middleware),this._rpcEngine=l,this.jsonRpcConnectionEvents=o.events}async request(e){if(!e||typeof e!="object"||Array.isArray(e))throw mt.ethErrors.rpc.invalidRequest({message:it.errors.invalidRequestArgs(),data:e});const{method:t,params:n}=e;if(typeof t!="string"||t.length===0)throw mt.ethErrors.rpc.invalidRequest({message:it.errors.invalidRequestMethod(),data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw mt.ethErrors.rpc.invalidRequest({message:it.errors.invalidRequestParams(),data:e});return new Promise((i,s)=>{this._rpcRequest({method:t,params:n},Kn(i,s))})}send(e,t){this._rpcRequest(e,t)}sendAsync(e){return new Promise((t,n)=>{this._rpcRequest(e,Kn(t,n))})}_handleStreamDisconnect(e,t){Jl(e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}}const Dt=r=>{const e=window.document.createElement("template"),t=r.trim();return e.innerHTML=t,e.content.firstChild};function Cr(r){return r.version===void 0}class ms extends Ur{constructor(e){let{url:t,target:n,features:i,timeout:s=3e4}=e;super(),ge(this,"url",void 0),ge(this,"target",void 0),ge(this,"features",void 0),ge(this,"window",void 0),ge(this,"windowTimer",void 0),ge(this,"iClosedWindow",void 0),ge(this,"timeout",void 0),this.url=t,this.target=n||"_blank",this.features=i||Xt(eu),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this.timeout=s,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),setTimeout(()=>{this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0},this.timeout)),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){return this.window=window.open(this.url.href,this.target,this.features),this.window?.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(e){e?window.location.replace(this.url.href):window.location.href=this.url.href}}class $r extends _s{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:i="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:i}),ge(this,"embedTranslations",void 0),ge(this,"torusUrl",void 0),ge(this,"dappStorageKey",void 0),ge(this,"windowRefs",void 0),ge(this,"tryWindowHandle",void 0),ge(this,"torusAlertContainer",void 0),ge(this,"torusIframe",void 0),this._state=Je({},$r._defaultState),this.torusUrl="",this.dappStorageKey="";const s=hi.translations[Zl()];this.embedTranslations=s.embed,this.windowRefs={},this.on("connect",()=>{this._state.isConnected=!0});const o=l=>{const{method:d,params:w}=l;if(d===Or.IFRAME_STATUS){const{isFullScreen:N,rid:O}=w;this._displayIframe({isFull:N,rid:O})}else if(d==="create_window"){const{windowId:N,url:O}=w;this._createPopupBlockAlert(N,O)}else if(d===Or.CLOSE_WINDOW)this._handleCloseWindow(w);else if(d===Or.USER_LOGGED_IN){const{currentLoginProvider:N}=w;this._state.isLoggedIn=!0,this._state.currentLoginProvider=N}else d===Or.USER_LOGGED_OUT&&(this._state.isLoggedIn=!1,this._state.currentLoginProvider=null,this._displayIframe())};this.jsonRpcConnectionEvents.on("notification",o)}get isLoggedIn(){return this._state.isLoggedIn}get isIFrameFullScreen(){return this._state.isIFrameFullScreen}isConnected(){return this._state.isConnected}async _initializeState(e){try{const{torusUrl:t,dappStorageKey:n,torusAlertContainer:i,torusIframe:s}=e;this.torusUrl=t,this.dappStorageKey=n,this.torusAlertContainer=i,this.torusIframe=s,this.torusIframe.addEventListener("load",()=>{this._state.isIFrameFullScreen||this._displayIframe()});const{currentLoginProvider:o,isLoggedIn:l}=await this.request({method:dt.GET_PROVIDER_STATE,params:[]});this._handleConnect(o,l)}catch(t){Ee.error("Torus: Failed to get initial state. Please report this bug.",t)}finally{Ee.info("initialized communication state"),this._state.initialized=!0,this.emit("_initialized")}}_handleWindow(e){let{url:t,target:n,features:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=new URL(t||`${this.torusUrl}/redirect?windowId=${e}`);this.dappStorageKey&&(s.hash?s.hash+=`&dappStorageKey=${this.dappStorageKey}`:s.hash=`#dappStorageKey=${this.dappStorageKey}`);const o=new ms({url:s,target:n,features:i});if(o.open(),!o.window){this._createPopupBlockAlert(e,s.href);return}this.windowRefs[e]=o,this.request({method:"opened_window",params:{windowId:e}}),o.once("close",()=>{delete this.windowRefs[e],this.request({method:dt.CLOSED_WINDOW,params:{windowId:e}})})}_displayIframe(){let{isFull:e=!1,rid:t=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n={};if(e)n.display="block",n.width="100%",n.height="100%",n.top="0px",n.right="0px",n.left="0px",n.bottom="0px";else switch(n.display=this._state.torusWidgetVisibility?"block":"none",n.height="70px",n.width="70px",this._state.buttonPosition){case Mt.TOP_LEFT:n.top="0px",n.left="0px",n.right="auto",n.bottom="auto";break;case Mt.TOP_RIGHT:n.top="0px",n.right="0px",n.left="auto",n.bottom="auto";break;case Mt.BOTTOM_RIGHT:n.bottom="0px",n.right="0px",n.top="auto",n.left="auto";break;case Mt.BOTTOM_LEFT:default:n.bottom="0px",n.left="0px",n.top="auto",n.right="auto";break}Object.assign(this.torusIframe.style,n),this._state.isIFrameFullScreen=e,this.request({method:dt.IFRAME_STATUS,params:{isIFrameFullScreen:e,rid:t}})}hideTorusButton(){this._state.torusWidgetVisibility=!1,this._displayIframe()}showTorusButton(){this._state.torusWidgetVisibility=!0,this._displayIframe()}_rpcRequest(e,t){const n=t,i=e;Array.isArray(i)||i.jsonrpc||(i.jsonrpc="2.0"),this.tryWindowHandle(i,n)}_handleConnect(e,t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{currentLoginProvider:e,isLoggedIn:t}),Ee.debug(it.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){this._state.isConnected=!1;let n;e?(n=new mt.EthereumRpcError(1013,t||it.errors.disconnected()),Ee.debug(n)):(n=new mt.EthereumRpcError(1011,t||it.errors.permanentlyDisconnected()),Ee.error(n),this._state.currentLoginProvider=null,this._state.isLoggedIn=!1,this._state.torusWidgetVisibility=!1,this._state.isIFrameFullScreen=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleCloseWindow(e){const{windowId:t}=e;this.windowRefs[t]&&(this.windowRefs[t].close(),delete this.windowRefs[t])}async _createPopupBlockAlert(e,t){const n=this.getLogoUrl(),i=Dt(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${n}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),s=Dt(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),o=Dt('<div id="torusAlert__btn-container"></div>');o.appendChild(s),i.appendChild(o);const l=()=>{s.addEventListener("click",()=>{this._handleWindow(e,{url:t,target:"_blank",features:Xt(ys)}),i.remove(),this.torusAlertContainer.children.length===0&&(this.torusAlertContainer.style.display="none")})};(()=>{this.torusAlertContainer.appendChild(i)})(),l(),this.torusAlertContainer.style.display="block"}getLogoUrl(){return`${this.torusUrl}/images/torus_icon-blue.svg`}}ge($r,"_defaultState",{buttonPosition:"bottom-left",currentLoginProvider:null,isIFrameFullScreen:!1,hasEmittedConnection:!1,torusWidgetVisibility:!1,initialized:!1,isLoggedIn:!1,isPermanentlyDisconnected:!1,isConnected:!1});class ar extends _s{constructor(e,t){let{maxEventListeners:n=100,jsonRpcStreamName:i="provider"}=t;super(e,{maxEventListeners:n,jsonRpcStreamName:i}),ge(this,"chainId",void 0),ge(this,"selectedAddress",void 0),ge(this,"tryWindowHandle",void 0),this._state=Je({},ar._defaultState),this.selectedAddress=null,this.chainId=null,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this.on("connect",()=>{this._state.isConnected=!0});const s=o=>{const{method:l,params:d}=o;l===zn.ACCOUNTS_CHANGED?this._handleAccountsChanged(d):l===zn.UNLOCK_STATE_CHANGED?this._handleUnlockStateChanged(d):l===zn.CHAIN_CHANGED&&this._handleChainChanged(d)};this.jsonRpcConnectionEvents.on("notification",s)}isConnected(){return this._state.isConnected}async _initializeState(){try{const{accounts:e,chainId:t,isUnlocked:n}=await this.request({method:Ul.GET_PROVIDER_STATE,params:[]});this.emit("connect",{chainId:t}),this._handleChainChanged({chainId:t}),this._handleUnlockStateChanged({accounts:e,isUnlocked:n}),this._handleAccountsChanged(e)}catch(e){Ee.error("Torus: Failed to get initial state. Please report this bug.",e)}finally{Ee.info("initialized provider state"),this._state.initialized=!0,this.emit("_initialized")}}_rpcRequest(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=t;const s=e;if(!Array.isArray(s)){if(s.jsonrpc||(s.jsonrpc="2.0"),s.method==="solana_accounts"||s.method==="solana_requestAccounts")i=(o,l)=>{this._handleAccountsChanged(l.result||[],s.method==="solana_accounts",n),t(o,l)};else if(s.method==="wallet_getProviderState"){this._rpcEngine.handle(e,i);return}}this.tryWindowHandle(s,i)}_handleConnect(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),Ee.debug(it.info.connected(e)))}_handleDisconnect(e,t){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e){this._state.isConnected=!1;let n;e?(n=new mt.EthereumRpcError(1013,t||it.errors.disconnected()),Ee.debug(n)):(n=new mt.EthereumRpcError(1011,t||it.errors.permanentlyDisconnected()),Ee.error(n),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",n)}}_handleAccountsChanged(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e;Array.isArray(i)||(Ee.error("Torus: Received non-array accounts parameter. Please report this bug.",i),i=[]);for(const s of e)if(typeof s!="string"){Ee.error("Torus: Received non-string account. Please report this bug.",e),i=[];break}$l(this._state.accounts,i)||(t&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!n&&Ee.error('Torus: "solana_accounts" unexpectedly updated accounts. Please report this bug.',i),this._state.accounts=i,this.emit("accountsChanged",i)),this.selectedAddress!==i[0]&&(this.selectedAddress=i[0]||null)}_handleChainChanged(){let{chainId:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!e){Ee.error("Torus: Received invalid network parameters. Please report this bug.",{chainId:e});return}e==="loading"?this._handleDisconnect(!0):(this._handleConnect(e),e!==this.chainId&&(this.chainId=e,this._state.initialized&&this.emit("chainChanged",this.chainId)))}_handleUnlockStateChanged(){let{accounts:e,isUnlocked:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof t!="boolean"){Ee.error("Torus: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:t});return}t!==this._state.isUnlocked&&(this._state.isUnlocked=t,this._handleAccountsChanged(e||[]))}}ge(ar,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});function $o(r){return new Promise((e,t)=>{try{const n=document.createElement("img");n.onload=()=>e(!0),n.onerror=()=>e(!1),n.src=r}catch(n){t(n)}})}const ru=r=>{const{document:e}=r,t=e.querySelector('head > meta[property="og:site_name"]');if(t)return t.content;const n=e.querySelector('head > meta[name="title"]');return n?n.content:e.title&&e.title.length>0?e.title:r.location.hostname};async function nu(r){try{const{document:e}=r;let t=e.querySelector('head > link[rel="shortcut icon"]');return t&&await $o(t.href)||(t=Array.from(e.querySelectorAll('head > link[rel="icon"]')).find(n=>!!n.href),t&&await $o(t.href))?t.href:""}catch{return""}}const iu=async()=>({name:ru(window),icon:await nu(window)}),ou=["send_transaction","sign_transaction","sign_all_transactions","sign_message","connect"],su=[dt.SET_PROVIDER],au=tu("localStorage");(async function(){try{if(typeof document>"u")return;const e=document.createElement("link"),{torusUrl:t}=await bs("production");e.href=`${t}/frame`,e.crossOrigin="anonymous",e.type="text/html",e.rel="prefetch",e.relList&&e.relList.supports&&e.relList.supports("prefetch")&&document.head.appendChild(e)}catch(e){Ee.warn(e)}})();class lu{constructor(){let{modalZIndex:e=99999}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ge(this,"isInitialized",void 0),ge(this,"torusAlert",void 0),ge(this,"modalZIndex",void 0),ge(this,"alertZIndex",void 0),ge(this,"requestedLoginProvider",void 0),ge(this,"provider",void 0),ge(this,"communicationProvider",void 0),ge(this,"dappStorageKey",void 0),ge(this,"isTopupHidden",!1),ge(this,"torusAlertContainer",void 0),ge(this,"torusUrl",void 0),ge(this,"torusIframe",void 0),ge(this,"styleLink",void 0),this.torusUrl="",this.isInitialized=!1,this.requestedLoginProvider=null,this.modalZIndex=e,this.alertZIndex=e+1e3,this.dappStorageKey=""}get isLoggedIn(){return this.communicationProvider?this.communicationProvider.isLoggedIn:!1}async init(){let{buildEnv:e=ws.PRODUCTION,enableLogging:t=!1,network:n,showTorusButton:i=!1,useLocalStorage:s=!1,buttonPosition:o=Mt.BOTTOM_LEFT,apiKey:l="torus-default",extraParams:d={},whiteLabel:w}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.isInitialized)throw new Error("Already initialized");const{torusUrl:N,logLevel:O}=await bs(e);Ee.enableAll(),Ee.info(N,"url loaded"),Ee.info(`Solana Embed Version :${Hl}`),this.torusUrl=N,Ee.setDefaultLevel(O),t?Ee.enableAll():Ee.disableAll();const I=this.handleDappStorageKey(s),k=new URL(N);k.pathname.endsWith("/")?k.pathname+="frame":k.pathname+="/frame";const B=new URLSearchParams;return I&&B.append("dappStorageKey",I),B.append("origin",window.location.origin),k.hash=B.toString(),this.torusIframe=Dt(`<iframe
|