hardhat-airsign 0.1.0
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/LICENSE +21 -0
- package/README.md +239 -0
- package/app-dist/assets/Arc-VDBY7LNS-BChRXCXW.js +2 -0
- package/app-dist/assets/Arc-VDBY7LNS-BChRXCXW.js.map +1 -0
- package/app-dist/assets/Brave-BRAKJXDS-mq-Xo37j.js +2 -0
- package/app-dist/assets/Brave-BRAKJXDS-mq-Xo37j.js.map +1 -0
- package/app-dist/assets/Browser-76IHF3Y2-BMhRaC5Z.js +2 -0
- package/app-dist/assets/Browser-76IHF3Y2-BMhRaC5Z.js.map +1 -0
- package/app-dist/assets/Chrome-65Q5P54Y-DR9MQEVr.js +2 -0
- package/app-dist/assets/Chrome-65Q5P54Y-DR9MQEVr.js.map +1 -0
- package/app-dist/assets/Edge-XSPUTORV-DEoZslQE.js +2 -0
- package/app-dist/assets/Edge-XSPUTORV-DEoZslQE.js.map +1 -0
- package/app-dist/assets/Firefox-AAHGJQIP-Bp_Hm04m.js +2 -0
- package/app-dist/assets/Firefox-AAHGJQIP-Bp_Hm04m.js.map +1 -0
- package/app-dist/assets/Linux-OO4TNCLJ-B0aw93n9.js +2 -0
- package/app-dist/assets/Linux-OO4TNCLJ-B0aw93n9.js.map +1 -0
- package/app-dist/assets/Macos-MW4AE7LN-Vvm8Drw3.js +2 -0
- package/app-dist/assets/Macos-MW4AE7LN-Vvm8Drw3.js.map +1 -0
- package/app-dist/assets/Opera-KQZLSACL-Cwv5MDFy.js +2 -0
- package/app-dist/assets/Opera-KQZLSACL-Cwv5MDFy.js.map +1 -0
- package/app-dist/assets/Safari-ZPL37GXR-C4Ggg6rz.js +2 -0
- package/app-dist/assets/Safari-ZPL37GXR-C4Ggg6rz.js.map +1 -0
- package/app-dist/assets/Windows-PPTHQER6-BlyV2p7Y.js +2 -0
- package/app-dist/assets/Windows-PPTHQER6-BlyV2p7Y.js.map +1 -0
- package/app-dist/assets/add--InA7epz.js +16 -0
- package/app-dist/assets/add--InA7epz.js.map +1 -0
- package/app-dist/assets/add-0SGyxYcB.js +16 -0
- package/app-dist/assets/add-0SGyxYcB.js.map +0 -0
- package/app-dist/assets/add-DnWcHPES.js +16 -0
- package/app-dist/assets/add-DnWcHPES.js.map +1 -0
- package/app-dist/assets/all-wallets-DOaftD3q.js +7 -0
- package/app-dist/assets/all-wallets-DOaftD3q.js.map +1 -0
- package/app-dist/assets/all-wallets-I5CHqbVa.js +7 -0
- package/app-dist/assets/all-wallets-I5CHqbVa.js.map +1 -0
- package/app-dist/assets/all-wallets-nk-TNPoK.js +7 -0
- package/app-dist/assets/all-wallets-nk-TNPoK.js.map +0 -0
- package/app-dist/assets/apechain-SX5YFU6N-q5qBv-mp.js +2 -0
- package/app-dist/assets/apechain-SX5YFU6N-q5qBv-mp.js.map +1 -0
- package/app-dist/assets/app-store-BI7dtYVv.js +18 -0
- package/app-dist/assets/app-store-BI7dtYVv.js.map +1 -0
- package/app-dist/assets/app-store-D-r9UZaj.js +18 -0
- package/app-dist/assets/app-store-D-r9UZaj.js.map +1 -0
- package/app-dist/assets/app-store-DEIpbdyI.js +18 -0
- package/app-dist/assets/app-store-DEIpbdyI.js.map +0 -0
- package/app-dist/assets/apple-C8TKxHY0.js +19 -0
- package/app-dist/assets/apple-C8TKxHY0.js.map +1 -0
- package/app-dist/assets/apple-CNmISHhG.js +19 -0
- package/app-dist/assets/apple-CNmISHhG.js.map +1 -0
- package/app-dist/assets/apple-tsKJeNpP.js +19 -0
- package/app-dist/assets/apple-tsKJeNpP.js.map +0 -0
- package/app-dist/assets/ar_AR-44JUQ6EW-BMX-am0v.js +1488 -0
- package/app-dist/assets/ar_AR-44JUQ6EW-BMX-am0v.js.map +1 -0
- package/app-dist/assets/arbitrum-WURIBY6W-CqVkHBr5.js +2 -0
- package/app-dist/assets/arbitrum-WURIBY6W-CqVkHBr5.js.map +1 -0
- package/app-dist/assets/arrow-bottom-DigzIzmG.js +9 -0
- package/app-dist/assets/arrow-bottom-DigzIzmG.js.map +1 -0
- package/app-dist/assets/arrow-bottom-Y229K4sk.js +9 -0
- package/app-dist/assets/arrow-bottom-Y229K4sk.js.map +1 -0
- package/app-dist/assets/arrow-bottom-circle-4IW6POXa.js +12 -0
- package/app-dist/assets/arrow-bottom-circle-4IW6POXa.js.map +0 -0
- package/app-dist/assets/arrow-bottom-circle-CbMasYEI.js +12 -0
- package/app-dist/assets/arrow-bottom-circle-CbMasYEI.js.map +1 -0
- package/app-dist/assets/arrow-bottom-circle-Ds_LJfyU.js +12 -0
- package/app-dist/assets/arrow-bottom-circle-Ds_LJfyU.js.map +1 -0
- package/app-dist/assets/arrow-bottom-oNe1x2mS.js +9 -0
- package/app-dist/assets/arrow-bottom-oNe1x2mS.js.map +0 -0
- package/app-dist/assets/arrow-left-BODjw1GB.js +9 -0
- package/app-dist/assets/arrow-left-BODjw1GB.js.map +1 -0
- package/app-dist/assets/arrow-left-CW9JCHZ3.js +9 -0
- package/app-dist/assets/arrow-left-CW9JCHZ3.js.map +0 -0
- package/app-dist/assets/arrow-left-Dg1BVZAC.js +9 -0
- package/app-dist/assets/arrow-left-Dg1BVZAC.js.map +1 -0
- package/app-dist/assets/arrow-right-5W6Bl9Bj.js +9 -0
- package/app-dist/assets/arrow-right-5W6Bl9Bj.js.map +1 -0
- package/app-dist/assets/arrow-right-C82ug51v.js +9 -0
- package/app-dist/assets/arrow-right-C82ug51v.js.map +0 -0
- package/app-dist/assets/arrow-right-dmJyFJTB.js +9 -0
- package/app-dist/assets/arrow-right-dmJyFJTB.js.map +1 -0
- package/app-dist/assets/arrow-top-BC20uJLe.js +9 -0
- package/app-dist/assets/arrow-top-BC20uJLe.js.map +1 -0
- package/app-dist/assets/arrow-top-DanTkraS.js +9 -0
- package/app-dist/assets/arrow-top-DanTkraS.js.map +1 -0
- package/app-dist/assets/arrow-top-Imr-OtMk.js +9 -0
- package/app-dist/assets/arrow-top-Imr-OtMk.js.map +0 -0
- package/app-dist/assets/assets-Q6ZU7ZJ5-P8HioiAD.js +2 -0
- package/app-dist/assets/assets-Q6ZU7ZJ5-P8HioiAD.js.map +1 -0
- package/app-dist/assets/avalanche-KOMJD3XY-Dsn_JPR4.js +2 -0
- package/app-dist/assets/avalanche-KOMJD3XY-Dsn_JPR4.js.map +1 -0
- package/app-dist/assets/bank-ButTTnRs.js +15 -0
- package/app-dist/assets/bank-ButTTnRs.js.map +0 -0
- package/app-dist/assets/bank-Co9iaTPZ.js +15 -0
- package/app-dist/assets/bank-Co9iaTPZ.js.map +1 -0
- package/app-dist/assets/bank-DrHFkCz9.js +15 -0
- package/app-dist/assets/bank-DrHFkCz9.js.map +1 -0
- package/app-dist/assets/base-OAXLRA4F-CoYTVIiL.js +2 -0
- package/app-dist/assets/base-OAXLRA4F-CoYTVIiL.js.map +1 -0
- package/app-dist/assets/baseAccount-44UITRK7-CsjdbWCf.js +2 -0
- package/app-dist/assets/baseAccount-44UITRK7-CsjdbWCf.js.map +1 -0
- package/app-dist/assets/basic-BOJWVLk7.js +2129 -0
- package/app-dist/assets/basic-BOJWVLk7.js.map +1 -0
- package/app-dist/assets/basic-D3kLhhPb.js +2129 -0
- package/app-dist/assets/basic-D3kLhhPb.js.map +0 -0
- package/app-dist/assets/basic-DayfWMvc.js +2129 -0
- package/app-dist/assets/basic-DayfWMvc.js.map +1 -0
- package/app-dist/assets/berachain-NJECWIVC-DumxnFvf.js +2 -0
- package/app-dist/assets/berachain-NJECWIVC-DumxnFvf.js.map +1 -0
- package/app-dist/assets/blast-V555OVXZ-BbhJh1tj.js +2 -0
- package/app-dist/assets/blast-V555OVXZ-BbhJh1tj.js.map +1 -0
- package/app-dist/assets/browser-BIa8JuXN.js +15 -0
- package/app-dist/assets/browser-BIa8JuXN.js.map +1 -0
- package/app-dist/assets/browser-D3UhxMVn.js +15 -0
- package/app-dist/assets/browser-D3UhxMVn.js.map +0 -0
- package/app-dist/assets/browser-D3u19hzr.js +15 -0
- package/app-dist/assets/browser-D3u19hzr.js.map +1 -0
- package/app-dist/assets/bsc-N647EYR2-B2nLKXWV.js +2 -0
- package/app-dist/assets/bsc-N647EYR2-B2nLKXWV.js.map +1 -0
- package/app-dist/assets/card-CTTiKL-L.js +15 -0
- package/app-dist/assets/card-CTTiKL-L.js.map +1 -0
- package/app-dist/assets/card-DOjxiga1.js +15 -0
- package/app-dist/assets/card-DOjxiga1.js.map +1 -0
- package/app-dist/assets/card-DaF-cVjH.js +15 -0
- package/app-dist/assets/card-DaF-cVjH.js.map +0 -0
- package/app-dist/assets/ccip-BuEOOHoL.js +2 -0
- package/app-dist/assets/ccip-BuEOOHoL.js.map +1 -0
- package/app-dist/assets/ccip-CJMOhB7g.js +0 -0
- package/app-dist/assets/ccip-CJMOhB7g.js.map +0 -0
- package/app-dist/assets/ccip-WYMNLYQt.js +2 -0
- package/app-dist/assets/ccip-WYMNLYQt.js.map +1 -0
- package/app-dist/assets/celo-GEP4TUHG-CenIBYLU.js +2 -0
- package/app-dist/assets/celo-GEP4TUHG-CenIBYLU.js.map +1 -0
- package/app-dist/assets/checkmark-B6P7irtS.js +12 -0
- package/app-dist/assets/checkmark-B6P7irtS.js.map +1 -0
- package/app-dist/assets/checkmark-OSwxF5tq.js +12 -0
- package/app-dist/assets/checkmark-OSwxF5tq.js.map +1 -0
- package/app-dist/assets/checkmark-bold-CRUf3cWH.js +9 -0
- package/app-dist/assets/checkmark-bold-CRUf3cWH.js.map +1 -0
- package/app-dist/assets/checkmark-bold-D9gp5-An.js +9 -0
- package/app-dist/assets/checkmark-bold-D9gp5-An.js.map +1 -0
- package/app-dist/assets/checkmark-bold-DU3gdt2a.js +9 -0
- package/app-dist/assets/checkmark-bold-DU3gdt2a.js.map +0 -0
- package/app-dist/assets/checkmark-rdFIfftt.js +12 -0
- package/app-dist/assets/checkmark-rdFIfftt.js.map +0 -0
- package/app-dist/assets/chevron-bottom-BTlNRA6K.js +9 -0
- package/app-dist/assets/chevron-bottom-BTlNRA6K.js.map +0 -0
- package/app-dist/assets/chevron-bottom-CFeQ71Pr.js +9 -0
- package/app-dist/assets/chevron-bottom-CFeQ71Pr.js.map +1 -0
- package/app-dist/assets/chevron-bottom-CON_Yq4L.js +9 -0
- package/app-dist/assets/chevron-bottom-CON_Yq4L.js.map +1 -0
- package/app-dist/assets/chevron-left-B6NbMRK7.js +9 -0
- package/app-dist/assets/chevron-left-B6NbMRK7.js.map +1 -0
- package/app-dist/assets/chevron-left-BbGh1GnY.js +9 -0
- package/app-dist/assets/chevron-left-BbGh1GnY.js.map +0 -0
- package/app-dist/assets/chevron-left-P4zxdUtN.js +9 -0
- package/app-dist/assets/chevron-left-P4zxdUtN.js.map +1 -0
- package/app-dist/assets/chevron-right-BPMsRgVg.js +9 -0
- package/app-dist/assets/chevron-right-BPMsRgVg.js.map +0 -0
- package/app-dist/assets/chevron-right-Cus2a-0w.js +9 -0
- package/app-dist/assets/chevron-right-Cus2a-0w.js.map +1 -0
- package/app-dist/assets/chevron-right-i3QUb2xq.js +9 -0
- package/app-dist/assets/chevron-right-i3QUb2xq.js.map +1 -0
- package/app-dist/assets/chevron-top-Be8bXxJF.js +9 -0
- package/app-dist/assets/chevron-top-Be8bXxJF.js.map +1 -0
- package/app-dist/assets/chevron-top-GbLiblg7.js +9 -0
- package/app-dist/assets/chevron-top-GbLiblg7.js.map +1 -0
- package/app-dist/assets/chevron-top-ja4eZLum.js +9 -0
- package/app-dist/assets/chevron-top-ja4eZLum.js.map +0 -0
- package/app-dist/assets/chrome-store-BAP-tG78.js +62 -0
- package/app-dist/assets/chrome-store-BAP-tG78.js.map +0 -0
- package/app-dist/assets/chrome-store-Dcbk9Hyg.js +62 -0
- package/app-dist/assets/chrome-store-Dcbk9Hyg.js.map +1 -0
- package/app-dist/assets/chrome-store-Df1HyrXG.js +62 -0
- package/app-dist/assets/chrome-store-Df1HyrXG.js.map +1 -0
- package/app-dist/assets/clock-1ETgyOC2.js +9 -0
- package/app-dist/assets/clock-1ETgyOC2.js.map +0 -0
- package/app-dist/assets/clock-BmiJckGp.js +9 -0
- package/app-dist/assets/clock-BmiJckGp.js.map +1 -0
- package/app-dist/assets/clock-K1b_guWl.js +9 -0
- package/app-dist/assets/clock-K1b_guWl.js.map +1 -0
- package/app-dist/assets/close-BIxvox0S.js +9 -0
- package/app-dist/assets/close-BIxvox0S.js.map +0 -0
- package/app-dist/assets/close-BeoJC3Uv.js +9 -0
- package/app-dist/assets/close-BeoJC3Uv.js.map +1 -0
- package/app-dist/assets/close-DpAyMC6Y.js +9 -0
- package/app-dist/assets/close-DpAyMC6Y.js.map +1 -0
- package/app-dist/assets/coinPlaceholder-7j0sMili.js +9 -0
- package/app-dist/assets/coinPlaceholder-7j0sMili.js.map +1 -0
- package/app-dist/assets/coinPlaceholder-DgRNfUoS.js +9 -0
- package/app-dist/assets/coinPlaceholder-DgRNfUoS.js.map +0 -0
- package/app-dist/assets/coinPlaceholder-okFRLG_E.js +9 -0
- package/app-dist/assets/coinPlaceholder-okFRLG_E.js.map +1 -0
- package/app-dist/assets/compass-CswIWfIU.js +9 -0
- package/app-dist/assets/compass-CswIWfIU.js.map +1 -0
- package/app-dist/assets/compass-D2UP2WYp.js +9 -0
- package/app-dist/assets/compass-D2UP2WYp.js.map +1 -0
- package/app-dist/assets/compass-DegPL0E7.js +9 -0
- package/app-dist/assets/compass-DegPL0E7.js.map +0 -0
- package/app-dist/assets/connect-UA7M4XW6-IY3X6Bmr.js +2 -0
- package/app-dist/assets/connect-UA7M4XW6-IY3X6Bmr.js.map +1 -0
- package/app-dist/assets/copy-BUQNBQKO.js +16 -0
- package/app-dist/assets/copy-BUQNBQKO.js.map +1 -0
- package/app-dist/assets/copy-CH08PmRP.js +16 -0
- package/app-dist/assets/copy-CH08PmRP.js.map +1 -0
- package/app-dist/assets/copy-DDSY1US-.js +16 -0
- package/app-dist/assets/copy-DDSY1US-.js.map +0 -0
- package/app-dist/assets/core-934haPKz.js +909 -0
- package/app-dist/assets/core-934haPKz.js.map +1 -0
- package/app-dist/assets/core-CnB1gfzN.js +909 -0
- package/app-dist/assets/core-CnB1gfzN.js.map +0 -0
- package/app-dist/assets/core-D0TC3Irc.js +909 -0
- package/app-dist/assets/core-D0TC3Irc.js.map +1 -0
- package/app-dist/assets/create-FASO7PVG-D_rvSpre.js +2 -0
- package/app-dist/assets/create-FASO7PVG-D_rvSpre.js.map +1 -0
- package/app-dist/assets/cronos-HJPAQTAE-BEOvlOC4.js +2 -0
- package/app-dist/assets/cronos-HJPAQTAE-BEOvlOC4.js.map +1 -0
- package/app-dist/assets/cursor-BC4aSsg6.js +4 -0
- package/app-dist/assets/cursor-BC4aSsg6.js.map +0 -0
- package/app-dist/assets/cursor-BbkSQ8O8.js +4 -0
- package/app-dist/assets/cursor-BbkSQ8O8.js.map +1 -0
- package/app-dist/assets/cursor-EZA60-dh.js +4 -0
- package/app-dist/assets/cursor-EZA60-dh.js.map +1 -0
- package/app-dist/assets/cursor-transparent-BYLTaIJ6.js +13 -0
- package/app-dist/assets/cursor-transparent-BYLTaIJ6.js.map +1 -0
- package/app-dist/assets/cursor-transparent-DfXiz1dJ.js +13 -0
- package/app-dist/assets/cursor-transparent-DfXiz1dJ.js.map +1 -0
- package/app-dist/assets/cursor-transparent-DgQzgZ6k.js +13 -0
- package/app-dist/assets/cursor-transparent-DgQzgZ6k.js.map +0 -0
- package/app-dist/assets/de_DE-PYAO5YD6-BWlqPWgO.js +1488 -0
- package/app-dist/assets/de_DE-PYAO5YD6-BWlqPWgO.js.map +1 -0
- package/app-dist/assets/degen-FQQ4XGHB-CeHTs88l.js +2 -0
- package/app-dist/assets/degen-FQQ4XGHB-CeHTs88l.js.map +1 -0
- package/app-dist/assets/desktop-B0oUxvE2.js +10 -0
- package/app-dist/assets/desktop-B0oUxvE2.js.map +0 -0
- package/app-dist/assets/desktop-BXTprGjq.js +10 -0
- package/app-dist/assets/desktop-BXTprGjq.js.map +1 -0
- package/app-dist/assets/desktop-CfOv1C53.js +10 -0
- package/app-dist/assets/desktop-CfOv1C53.js.map +1 -0
- package/app-dist/assets/disconnect-28QqKBLG.js +9 -0
- package/app-dist/assets/disconnect-28QqKBLG.js.map +1 -0
- package/app-dist/assets/disconnect-CLpknshm.js +9 -0
- package/app-dist/assets/disconnect-CLpknshm.js.map +1 -0
- package/app-dist/assets/disconnect-_WlV_ypl.js +9 -0
- package/app-dist/assets/disconnect-_WlV_ypl.js.map +0 -0
- package/app-dist/assets/discord-CM01WZ7v.js +18 -0
- package/app-dist/assets/discord-CM01WZ7v.js.map +1 -0
- package/app-dist/assets/discord-DA_9T3af.js +18 -0
- package/app-dist/assets/discord-DA_9T3af.js.map +1 -0
- package/app-dist/assets/discord-DLSaUvT5.js +18 -0
- package/app-dist/assets/discord-DLSaUvT5.js.map +0 -0
- package/app-dist/assets/es_419-HRGOJ6VT-D-qzxUM-.js +1488 -0
- package/app-dist/assets/es_419-HRGOJ6VT-D-qzxUM-.js.map +1 -0
- package/app-dist/assets/ethereum-RGGVA4PY-SWGOlkuk.js +2 -0
- package/app-dist/assets/ethereum-RGGVA4PY-SWGOlkuk.js.map +1 -0
- package/app-dist/assets/etherscan-CJQ-3naZ.js +7 -0
- package/app-dist/assets/etherscan-CJQ-3naZ.js.map +1 -0
- package/app-dist/assets/etherscan-DKAtH0_w.js +7 -0
- package/app-dist/assets/etherscan-DKAtH0_w.js.map +1 -0
- package/app-dist/assets/etherscan-DdyO6DfW.js +7 -0
- package/app-dist/assets/etherscan-DdyO6DfW.js.map +0 -0
- package/app-dist/assets/events-C-nGMAUz.js +2 -0
- package/app-dist/assets/events-C-nGMAUz.js.map +1 -0
- package/app-dist/assets/events-DGXtGlqW.js +2 -0
- package/app-dist/assets/events-DGXtGlqW.js.map +0 -0
- package/app-dist/assets/events-V5iwB1aA.js +2 -0
- package/app-dist/assets/events-V5iwB1aA.js.map +1 -0
- package/app-dist/assets/exclamation-triangle-BpkRYFbz.js +5 -0
- package/app-dist/assets/exclamation-triangle-BpkRYFbz.js.map +1 -0
- package/app-dist/assets/exclamation-triangle-CUEbLIXX.js +5 -0
- package/app-dist/assets/exclamation-triangle-CUEbLIXX.js.map +0 -0
- package/app-dist/assets/exclamation-triangle-W3jsBnbs.js +5 -0
- package/app-dist/assets/exclamation-triangle-W3jsBnbs.js.map +1 -0
- package/app-dist/assets/extension-Bw6aI6CD.js +9 -0
- package/app-dist/assets/extension-Bw6aI6CD.js.map +1 -0
- package/app-dist/assets/extension-CBEZDBRi.js +9 -0
- package/app-dist/assets/extension-CBEZDBRi.js.map +0 -0
- package/app-dist/assets/extension-CrdF9uQv.js +9 -0
- package/app-dist/assets/extension-CrdF9uQv.js.map +1 -0
- package/app-dist/assets/external-link-3xiNxHuX.js +9 -0
- package/app-dist/assets/external-link-3xiNxHuX.js.map +1 -0
- package/app-dist/assets/external-link-BHInMwbS.js +9 -0
- package/app-dist/assets/external-link-BHInMwbS.js.map +1 -0
- package/app-dist/assets/external-link-NI08Iugo.js +9 -0
- package/app-dist/assets/external-link-NI08Iugo.js.map +0 -0
- package/app-dist/assets/facebook-B-BDj4Mx.js +27 -0
- package/app-dist/assets/facebook-B-BDj4Mx.js.map +1 -0
- package/app-dist/assets/facebook-D4To_IcG.js +27 -0
- package/app-dist/assets/facebook-D4To_IcG.js.map +0 -0
- package/app-dist/assets/facebook-DJ4p_RSy.js +27 -0
- package/app-dist/assets/facebook-DJ4p_RSy.js.map +1 -0
- package/app-dist/assets/farcaster-BKjN0wJM.js +13 -0
- package/app-dist/assets/farcaster-BKjN0wJM.js.map +1 -0
- package/app-dist/assets/farcaster-BTHbqyy5.js +13 -0
- package/app-dist/assets/farcaster-BTHbqyy5.js.map +1 -0
- package/app-dist/assets/farcaster-BU0IdcaC.js +13 -0
- package/app-dist/assets/farcaster-BU0IdcaC.js.map +0 -0
- package/app-dist/assets/filters-BjdDmCeO.js +9 -0
- package/app-dist/assets/filters-BjdDmCeO.js.map +0 -0
- package/app-dist/assets/filters-CeIbsl7p.js +9 -0
- package/app-dist/assets/filters-CeIbsl7p.js.map +1 -0
- package/app-dist/assets/filters-CeqsW5y_.js +9 -0
- package/app-dist/assets/filters-CeqsW5y_.js.map +1 -0
- package/app-dist/assets/flow-5FQJFCTK-CUie2reO.js +2 -0
- package/app-dist/assets/flow-5FQJFCTK-CUie2reO.js.map +1 -0
- package/app-dist/assets/fr_FR-IGGVC6RM-D8LpUM75.js +1488 -0
- package/app-dist/assets/fr_FR-IGGVC6RM-D8LpUM75.js.map +1 -0
- package/app-dist/assets/github-COBzxMpo.js +19 -0
- package/app-dist/assets/github-COBzxMpo.js.map +1 -0
- package/app-dist/assets/github-UoB8TY06.js +19 -0
- package/app-dist/assets/github-UoB8TY06.js.map +1 -0
- package/app-dist/assets/github-tfIdZEgg.js +19 -0
- package/app-dist/assets/github-tfIdZEgg.js.map +0 -0
- package/app-dist/assets/gnosis-37ZC4RBL-B137OtHZ.js +2 -0
- package/app-dist/assets/gnosis-37ZC4RBL-B137OtHZ.js.map +1 -0
- package/app-dist/assets/google-BMBqSrtr.js +19 -0
- package/app-dist/assets/google-BMBqSrtr.js.map +1 -0
- package/app-dist/assets/google-C33fwdPQ.js +19 -0
- package/app-dist/assets/google-C33fwdPQ.js.map +0 -0
- package/app-dist/assets/google-DWOXMwCZ.js +19 -0
- package/app-dist/assets/google-DWOXMwCZ.js.map +1 -0
- package/app-dist/assets/gravity-J5YQHTYH-Bj6B0uod.js +2 -0
- package/app-dist/assets/gravity-J5YQHTYH-Bj6B0uod.js.map +1 -0
- package/app-dist/assets/hardhat-TX56IT5N-CV1FY-wE.js +2 -0
- package/app-dist/assets/hardhat-TX56IT5N-CV1FY-wE.js.map +1 -0
- package/app-dist/assets/help-circle-CfNkpcpo.js +13 -0
- package/app-dist/assets/help-circle-CfNkpcpo.js.map +1 -0
- package/app-dist/assets/help-circle-DnnfIW69.js +13 -0
- package/app-dist/assets/help-circle-DnnfIW69.js.map +0 -0
- package/app-dist/assets/help-circle-nnSYZQHe.js +13 -0
- package/app-dist/assets/help-circle-nnSYZQHe.js.map +1 -0
- package/app-dist/assets/hi_IN-XSKAA3MF-C3QUpWyP.js +1488 -0
- package/app-dist/assets/hi_IN-XSKAA3MF-C3QUpWyP.js.map +1 -0
- package/app-dist/assets/hyperevm-VKPAA4SA-CHwraEsx.js +2 -0
- package/app-dist/assets/hyperevm-VKPAA4SA-CHwraEsx.js.map +1 -0
- package/app-dist/assets/id-BA1gQKAW.js +13 -0
- package/app-dist/assets/id-BA1gQKAW.js.map +1 -0
- package/app-dist/assets/id-ConjL7B0.js +13 -0
- package/app-dist/assets/id-ConjL7B0.js.map +1 -0
- package/app-dist/assets/id-LTSS8c5a.js +13 -0
- package/app-dist/assets/id-LTSS8c5a.js.map +0 -0
- package/app-dist/assets/id_ID-KUOB4UAL-K9y-nRWm.js +1488 -0
- package/app-dist/assets/id_ID-KUOB4UAL-K9y-nRWm.js.map +1 -0
- package/app-dist/assets/image-1X1N9pEo.js +5 -0
- package/app-dist/assets/image-1X1N9pEo.js.map +0 -0
- package/app-dist/assets/image-CnzWE8sT.js +5 -0
- package/app-dist/assets/image-CnzWE8sT.js.map +1 -0
- package/app-dist/assets/image-D8EBgbEy.js +5 -0
- package/app-dist/assets/image-D8EBgbEy.js.map +1 -0
- package/app-dist/assets/index-Acaa9INf.css +1 -0
- package/app-dist/assets/index-B36ryxz7.css +1 -0
- package/app-dist/assets/index-BD8n2rGx.js +2 -0
- package/app-dist/assets/index-BD8n2rGx.js.map +1 -0
- package/app-dist/assets/index-BG2lKNFT.js +396 -0
- package/app-dist/assets/index-BG2lKNFT.js.map +1 -0
- package/app-dist/assets/index-BJqyj4ib.js +2 -0
- package/app-dist/assets/index-BJqyj4ib.js.map +1 -0
- package/app-dist/assets/index-BNkizogK.js +2 -0
- package/app-dist/assets/index-BNkizogK.js.map +1 -0
- package/app-dist/assets/index-BV7ZaCR1.js +2 -0
- package/app-dist/assets/index-BV7ZaCR1.js.map +0 -0
- package/app-dist/assets/index-BfMkm3WT.js +396 -0
- package/app-dist/assets/index-BfMkm3WT.js.map +1 -0
- package/app-dist/assets/index-Bu_XtD5E.css +1 -0
- package/app-dist/assets/index-Bw0DyTKl.js +1753 -0
- package/app-dist/assets/index-Bw0DyTKl.js.map +1 -0
- package/app-dist/assets/index-Bx9SdYRI.js +396 -0
- package/app-dist/assets/index-Bx9SdYRI.js.map +0 -0
- package/app-dist/assets/index-Cf9eUEVe.js +2 -0
- package/app-dist/assets/index-Cf9eUEVe.js.map +1 -0
- package/app-dist/assets/index-Cu9oSBA4.js +2 -0
- package/app-dist/assets/index-Cu9oSBA4.js.map +0 -0
- package/app-dist/assets/index-DMFcetuY.js +17 -0
- package/app-dist/assets/index-DMFcetuY.js.map +0 -0
- package/app-dist/assets/index-bl8KCnX7.js +1610 -0
- package/app-dist/assets/index-bl8KCnX7.js.map +0 -0
- package/app-dist/assets/index-gh3LLqN4.js +17 -0
- package/app-dist/assets/index-gh3LLqN4.js.map +1 -0
- package/app-dist/assets/index-m8qSBWEb.js +1753 -0
- package/app-dist/assets/index-m8qSBWEb.js.map +1 -0
- package/app-dist/assets/index-nibyPLVP.js +2 -0
- package/app-dist/assets/index-nibyPLVP.js.map +1 -0
- package/app-dist/assets/index-zDP7hiYr.js +17 -0
- package/app-dist/assets/index-zDP7hiYr.js.map +1 -0
- package/app-dist/assets/index.es-BcffXcp9.js +27 -0
- package/app-dist/assets/index.es-BcffXcp9.js.map +0 -0
- package/app-dist/assets/index.es-Ch6fFmdq.js +27 -0
- package/app-dist/assets/index.es-Ch6fFmdq.js.map +1 -0
- package/app-dist/assets/index.es-DE_zEOto.js +27 -0
- package/app-dist/assets/index.es-DE_zEOto.js.map +1 -0
- package/app-dist/assets/info-BY-gCRMd.js +4 -0
- package/app-dist/assets/info-BY-gCRMd.js.map +1 -0
- package/app-dist/assets/info-D7gXoZPi.js +4 -0
- package/app-dist/assets/info-D7gXoZPi.js.map +0 -0
- package/app-dist/assets/info-DfhESGyw.js +4 -0
- package/app-dist/assets/info-DfhESGyw.js.map +1 -0
- package/app-dist/assets/info-circle--klNFwmq.js +13 -0
- package/app-dist/assets/info-circle--klNFwmq.js.map +1 -0
- package/app-dist/assets/info-circle-C59FTc51.js +13 -0
- package/app-dist/assets/info-circle-C59FTc51.js.map +0 -0
- package/app-dist/assets/info-circle-DrnnGW73.js +13 -0
- package/app-dist/assets/info-circle-DrnnGW73.js.map +1 -0
- package/app-dist/assets/ink-FZMYZWHG-62p-5IK5.js +2 -0
- package/app-dist/assets/ink-FZMYZWHG-62p-5IK5.js.map +1 -0
- package/app-dist/assets/ja_JP-4WRQ63RX-Ct5pF4ug.js +1488 -0
- package/app-dist/assets/ja_JP-4WRQ63RX-Ct5pF4ug.js.map +1 -0
- package/app-dist/assets/kaia-65D2U3PU-JmuLQ4gC.js +2 -0
- package/app-dist/assets/kaia-65D2U3PU-JmuLQ4gC.js.map +1 -0
- package/app-dist/assets/ko_KR-I2K7AIEP-B5gw8Mwb.js +1488 -0
- package/app-dist/assets/ko_KR-I2K7AIEP-B5gw8Mwb.js.map +1 -0
- package/app-dist/assets/lightbulb-BTEvb2k7.js +4 -0
- package/app-dist/assets/lightbulb-BTEvb2k7.js.map +0 -0
- package/app-dist/assets/lightbulb-Bi58NOv6.js +4 -0
- package/app-dist/assets/lightbulb-Bi58NOv6.js.map +1 -0
- package/app-dist/assets/lightbulb-BnYQt3eU.js +4 -0
- package/app-dist/assets/lightbulb-BnYQt3eU.js.map +1 -0
- package/app-dist/assets/linea-QRMVQ5DY-DuI3vv0d.js +2 -0
- package/app-dist/assets/linea-QRMVQ5DY-DuI3vv0d.js.map +1 -0
- package/app-dist/assets/login-UP3DZBGS-Db_wM5oQ.js +2 -0
- package/app-dist/assets/login-UP3DZBGS-Db_wM5oQ.js.map +1 -0
- package/app-dist/assets/mail-BCS3Hmz0.js +9 -0
- package/app-dist/assets/mail-BCS3Hmz0.js.map +0 -0
- package/app-dist/assets/mail-NVYe_3V7.js +9 -0
- package/app-dist/assets/mail-NVYe_3V7.js.map +1 -0
- package/app-dist/assets/mail-Xf-Dw9Jy.js +9 -0
- package/app-dist/assets/mail-Xf-Dw9Jy.js.map +1 -0
- package/app-dist/assets/manta-SI27YFEJ-CpVOKa06.js +2 -0
- package/app-dist/assets/manta-SI27YFEJ-CpVOKa06.js.map +1 -0
- package/app-dist/assets/mantle-CKIUT334-DR2WgqzU.js +2 -0
- package/app-dist/assets/mantle-CKIUT334-DR2WgqzU.js.map +1 -0
- package/app-dist/assets/metaMaskWallet-SITXT2FV-BlemcphV.js +2 -0
- package/app-dist/assets/metaMaskWallet-SITXT2FV-BlemcphV.js.map +1 -0
- package/app-dist/assets/metamask-sdk-Bswiy7kc.js +543 -0
- package/app-dist/assets/metamask-sdk-Bswiy7kc.js.map +0 -0
- package/app-dist/assets/metamask-sdk-Dd2lmGg5.js +543 -0
- package/app-dist/assets/metamask-sdk-Dd2lmGg5.js.map +1 -0
- package/app-dist/assets/metamask-sdk-Dk18cS5U.js +543 -0
- package/app-dist/assets/metamask-sdk-Dk18cS5U.js.map +1 -0
- package/app-dist/assets/mobile-BhvN5ELh.js +10 -0
- package/app-dist/assets/mobile-BhvN5ELh.js.map +1 -0
- package/app-dist/assets/mobile-Dnnfz06O.js +10 -0
- package/app-dist/assets/mobile-Dnnfz06O.js.map +1 -0
- package/app-dist/assets/mobile-bk-rEeQm.js +10 -0
- package/app-dist/assets/mobile-bk-rEeQm.js.map +0 -0
- package/app-dist/assets/monad-4KWC6TSS-DVXSkpiz.js +2 -0
- package/app-dist/assets/monad-4KWC6TSS-DVXSkpiz.js.map +1 -0
- package/app-dist/assets/more-BZC9ufLh.js +12 -0
- package/app-dist/assets/more-BZC9ufLh.js.map +0 -0
- package/app-dist/assets/more-DAN1-99P.js +12 -0
- package/app-dist/assets/more-DAN1-99P.js.map +1 -0
- package/app-dist/assets/more-DPY5dZh3.js +12 -0
- package/app-dist/assets/more-DPY5dZh3.js.map +1 -0
- package/app-dist/assets/ms_MY-6VZW6Q3Z-BtFD07hR.js +1488 -0
- package/app-dist/assets/ms_MY-6VZW6Q3Z-BtFD07hR.js.map +1 -0
- package/app-dist/assets/network-placeholder-BZBthQUA.js +15 -0
- package/app-dist/assets/network-placeholder-BZBthQUA.js.map +1 -0
- package/app-dist/assets/network-placeholder-DBaBbSPm.js +15 -0
- package/app-dist/assets/network-placeholder-DBaBbSPm.js.map +1 -0
- package/app-dist/assets/network-placeholder-fSD0Hnoz.js +15 -0
- package/app-dist/assets/network-placeholder-fSD0Hnoz.js.map +0 -0
- package/app-dist/assets/nftPlaceholder-Cn-ju_m0.js +9 -0
- package/app-dist/assets/nftPlaceholder-Cn-ju_m0.js.map +1 -0
- package/app-dist/assets/nftPlaceholder-Cuf1LJxh.js +9 -0
- package/app-dist/assets/nftPlaceholder-Cuf1LJxh.js.map +1 -0
- package/app-dist/assets/nftPlaceholder-Df0vgj0s.js +9 -0
- package/app-dist/assets/nftPlaceholder-Df0vgj0s.js.map +0 -0
- package/app-dist/assets/off-BA0GdN0u.js +9 -0
- package/app-dist/assets/off-BA0GdN0u.js.map +1 -0
- package/app-dist/assets/off-BmvDze4S.js +9 -0
- package/app-dist/assets/off-BmvDze4S.js.map +0 -0
- package/app-dist/assets/off-CWKjhP29.js +9 -0
- package/app-dist/assets/off-CWKjhP29.js.map +1 -0
- package/app-dist/assets/optimism-HAF2GUT7-ec6Nqxs9.js +2 -0
- package/app-dist/assets/optimism-HAF2GUT7-ec6Nqxs9.js.map +1 -0
- package/app-dist/assets/play-store-1KSI-YkA.js +0 -0
- package/app-dist/assets/play-store-1KSI-YkA.js.map +0 -0
- package/app-dist/assets/play-store-7Uft13-I.js +33 -0
- package/app-dist/assets/play-store-7Uft13-I.js.map +1 -0
- package/app-dist/assets/play-store-CMt_52bt.js +33 -0
- package/app-dist/assets/play-store-CMt_52bt.js.map +1 -0
- package/app-dist/assets/plus-DA9slqh_.js +14 -0
- package/app-dist/assets/plus-DA9slqh_.js.map +1 -0
- package/app-dist/assets/plus-DeArAyIN.js +14 -0
- package/app-dist/assets/plus-DeArAyIN.js.map +1 -0
- package/app-dist/assets/plus-ttkAaJbX.js +14 -0
- package/app-dist/assets/plus-ttkAaJbX.js.map +0 -0
- package/app-dist/assets/polygon-WW6ZI7PM-DXlmm4L1.js +2 -0
- package/app-dist/assets/polygon-WW6ZI7PM-DXlmm4L1.js.map +1 -0
- package/app-dist/assets/pt_BR-N3XOZ4SV-CvVpfsHb.js +1488 -0
- package/app-dist/assets/pt_BR-N3XOZ4SV-CvVpfsHb.js.map +1 -0
- package/app-dist/assets/qr-code-B6Nxd7r0.js +7 -0
- package/app-dist/assets/qr-code-B6Nxd7r0.js.map +1 -0
- package/app-dist/assets/qr-code-Bq5zVwzG.js +7 -0
- package/app-dist/assets/qr-code-Bq5zVwzG.js.map +0 -0
- package/app-dist/assets/qr-code-ChHwFaPr.js +7 -0
- package/app-dist/assets/qr-code-ChHwFaPr.js.map +1 -0
- package/app-dist/assets/rainbowWallet-O26YNBMX-DUhYus-9.js +2 -0
- package/app-dist/assets/rainbowWallet-O26YNBMX-DUhYus-9.js.map +1 -0
- package/app-dist/assets/recycle-horizontal-BBt9gto7.js +10 -0
- package/app-dist/assets/recycle-horizontal-BBt9gto7.js.map +1 -0
- package/app-dist/assets/recycle-horizontal-BaNxuTZz.js +10 -0
- package/app-dist/assets/recycle-horizontal-BaNxuTZz.js.map +0 -0
- package/app-dist/assets/recycle-horizontal-BeOWfmaR.js +10 -0
- package/app-dist/assets/recycle-horizontal-BeOWfmaR.js.map +1 -0
- package/app-dist/assets/refresh-CeUMiLYY.js +9 -0
- package/app-dist/assets/refresh-CeUMiLYY.js.map +0 -0
- package/app-dist/assets/refresh-DXqLx3hf.js +9 -0
- package/app-dist/assets/refresh-DXqLx3hf.js.map +1 -0
- package/app-dist/assets/refresh-S4T5V5GX-CwqIaaxK.js +2 -0
- package/app-dist/assets/refresh-S4T5V5GX-CwqIaaxK.js.map +1 -0
- package/app-dist/assets/refresh-r_CwnI6n.js +9 -0
- package/app-dist/assets/refresh-r_CwnI6n.js.map +1 -0
- package/app-dist/assets/reown-logo-Cl87QtVl.js +13 -0
- package/app-dist/assets/reown-logo-Cl87QtVl.js.map +1 -0
- package/app-dist/assets/reown-logo-CtELU8EI.js +0 -0
- package/app-dist/assets/reown-logo-CtELU8EI.js.map +0 -0
- package/app-dist/assets/reown-logo-EAOTbnwj.js +13 -0
- package/app-dist/assets/reown-logo-EAOTbnwj.js.map +1 -0
- package/app-dist/assets/ronin-EMCPYXZT-N-QBHZdV.js +2 -0
- package/app-dist/assets/ronin-EMCPYXZT-N-QBHZdV.js.map +1 -0
- package/app-dist/assets/ru_RU-IITAPRET-DOj6Jzj7.js +1488 -0
- package/app-dist/assets/ru_RU-IITAPRET-DOj6Jzj7.js.map +1 -0
- package/app-dist/assets/safeWallet-5MNKTR5Z-D-5imDLD.js +2 -0
- package/app-dist/assets/safeWallet-5MNKTR5Z-D-5imDLD.js.map +1 -0
- package/app-dist/assets/sanko-RHQYXGM5-OX010CbN.js +2 -0
- package/app-dist/assets/sanko-RHQYXGM5-OX010CbN.js.map +1 -0
- package/app-dist/assets/scan-4UYSQ56Q-CjMz6-XC.js +2 -0
- package/app-dist/assets/scan-4UYSQ56Q-CjMz6-XC.js.map +1 -0
- package/app-dist/assets/scroll-5OBGQVOV-DJFECiai.js +2 -0
- package/app-dist/assets/scroll-5OBGQVOV-DJFECiai.js.map +1 -0
- package/app-dist/assets/search-BIpf7E5h.js +9 -0
- package/app-dist/assets/search-BIpf7E5h.js.map +1 -0
- package/app-dist/assets/search-C0MSODDG.js +9 -0
- package/app-dist/assets/search-C0MSODDG.js.map +1 -0
- package/app-dist/assets/search-CZEQdX_m.js +9 -0
- package/app-dist/assets/search-CZEQdX_m.js.map +0 -0
- package/app-dist/assets/secp256k1-6vcaH-hZ.js +2 -0
- package/app-dist/assets/secp256k1-6vcaH-hZ.js.map +0 -0
- package/app-dist/assets/secp256k1-BTIn5g_i.js +2 -0
- package/app-dist/assets/secp256k1-BTIn5g_i.js.map +1 -0
- package/app-dist/assets/secp256k1-Dw2ShtHs.js +2 -0
- package/app-dist/assets/secp256k1-Dw2ShtHs.js.map +0 -0
- package/app-dist/assets/secp256k1-UGVTesID.js +2 -0
- package/app-dist/assets/secp256k1-UGVTesID.js.map +1 -0
- package/app-dist/assets/secp256k1-WgYt5tWe.js +2 -0
- package/app-dist/assets/secp256k1-WgYt5tWe.js.map +1 -0
- package/app-dist/assets/secp256k1-ZdcG5_q9.js +2 -0
- package/app-dist/assets/secp256k1-ZdcG5_q9.js.map +1 -0
- package/app-dist/assets/send-B1YPNG_e.js +16 -0
- package/app-dist/assets/send-B1YPNG_e.js.map +1 -0
- package/app-dist/assets/send-DIxJoab7.js +16 -0
- package/app-dist/assets/send-DIxJoab7.js.map +0 -0
- package/app-dist/assets/send-DwEqE_Iw.js +16 -0
- package/app-dist/assets/send-DwEqE_Iw.js.map +1 -0
- package/app-dist/assets/sign-A7IJEUT5-CGsRnPrd.js +2 -0
- package/app-dist/assets/sign-A7IJEUT5-CGsRnPrd.js.map +1 -0
- package/app-dist/assets/superposition-HG6MMR2Y-bRkgatRO.js +2 -0
- package/app-dist/assets/superposition-HG6MMR2Y-bRkgatRO.js.map +1 -0
- package/app-dist/assets/swapHorizontal-BF8vSwPR.js +9 -0
- package/app-dist/assets/swapHorizontal-BF8vSwPR.js.map +0 -0
- package/app-dist/assets/swapHorizontal-BVZ3G47g.js +9 -0
- package/app-dist/assets/swapHorizontal-BVZ3G47g.js.map +1 -0
- package/app-dist/assets/swapHorizontal-D3IG_uQT.js +9 -0
- package/app-dist/assets/swapHorizontal-D3IG_uQT.js.map +1 -0
- package/app-dist/assets/swapHorizontalBold-Bs2d-WYn.js +9 -0
- package/app-dist/assets/swapHorizontalBold-Bs2d-WYn.js.map +1 -0
- package/app-dist/assets/swapHorizontalBold-CF13elKE.js +9 -0
- package/app-dist/assets/swapHorizontalBold-CF13elKE.js.map +0 -0
- package/app-dist/assets/swapHorizontalBold-CV00HZay.js +9 -0
- package/app-dist/assets/swapHorizontalBold-CV00HZay.js.map +1 -0
- package/app-dist/assets/swapHorizontalMedium-DmC2VRKQ.js +17 -0
- package/app-dist/assets/swapHorizontalMedium-DmC2VRKQ.js.map +1 -0
- package/app-dist/assets/swapHorizontalMedium-DmsZRV8w.js +17 -0
- package/app-dist/assets/swapHorizontalMedium-DmsZRV8w.js.map +1 -0
- package/app-dist/assets/swapHorizontalMedium-siVNmc-5.js +17 -0
- package/app-dist/assets/swapHorizontalMedium-siVNmc-5.js.map +0 -0
- package/app-dist/assets/swapHorizontalRoundedBold-BSycj5mH.js +9 -0
- package/app-dist/assets/swapHorizontalRoundedBold-BSycj5mH.js.map +1 -0
- package/app-dist/assets/swapHorizontalRoundedBold-DCruWIeG.js +9 -0
- package/app-dist/assets/swapHorizontalRoundedBold-DCruWIeG.js.map +1 -0
- package/app-dist/assets/swapHorizontalRoundedBold-FPj1enHe.js +9 -0
- package/app-dist/assets/swapHorizontalRoundedBold-FPj1enHe.js.map +0 -0
- package/app-dist/assets/swapVertical-BBlDJ0wU.js +9 -0
- package/app-dist/assets/swapVertical-BBlDJ0wU.js.map +1 -0
- package/app-dist/assets/swapVertical-BdixiATC.js +9 -0
- package/app-dist/assets/swapVertical-BdixiATC.js.map +1 -0
- package/app-dist/assets/swapVertical-CsNeXIDf.js +9 -0
- package/app-dist/assets/swapVertical-CsNeXIDf.js.map +0 -0
- package/app-dist/assets/telegram-CZTfaW5R.js +17 -0
- package/app-dist/assets/telegram-CZTfaW5R.js.map +0 -0
- package/app-dist/assets/telegram-CfQNs_qk.js +17 -0
- package/app-dist/assets/telegram-CfQNs_qk.js.map +1 -0
- package/app-dist/assets/telegram-DyKP2tSP.js +17 -0
- package/app-dist/assets/telegram-DyKP2tSP.js.map +1 -0
- package/app-dist/assets/th_TH-3ZQCKCQE-BcHUN2Q4.js +1488 -0
- package/app-dist/assets/th_TH-3ZQCKCQE-BcHUN2Q4.js.map +1 -0
- package/app-dist/assets/three-dots-D7hZJWqD.js +6 -0
- package/app-dist/assets/three-dots-D7hZJWqD.js.map +0 -0
- package/app-dist/assets/three-dots-DKxr-fZm.js +6 -0
- package/app-dist/assets/three-dots-DKxr-fZm.js.map +1 -0
- package/app-dist/assets/three-dots-ZNXQKqRA.js +6 -0
- package/app-dist/assets/three-dots-ZNXQKqRA.js.map +1 -0
- package/app-dist/assets/tr_TR-QUPUGMUF-CwpF6ZFn.js +1488 -0
- package/app-dist/assets/tr_TR-QUPUGMUF-CwpF6ZFn.js.map +1 -0
- package/app-dist/assets/twitch-BkfjQBCS.js +19 -0
- package/app-dist/assets/twitch-BkfjQBCS.js.map +1 -0
- package/app-dist/assets/twitch-Bt6sNQO2.js +19 -0
- package/app-dist/assets/twitch-Bt6sNQO2.js.map +0 -0
- package/app-dist/assets/twitch-BvUrl1UX.js +19 -0
- package/app-dist/assets/twitch-BvUrl1UX.js.map +1 -0
- package/app-dist/assets/twitterIcon-BJgZokLW.js +7 -0
- package/app-dist/assets/twitterIcon-BJgZokLW.js.map +1 -0
- package/app-dist/assets/twitterIcon-BY7OY2GX.js +7 -0
- package/app-dist/assets/twitterIcon-BY7OY2GX.js.map +1 -0
- package/app-dist/assets/twitterIcon-Dvu-dDEg.js +7 -0
- package/app-dist/assets/twitterIcon-Dvu-dDEg.js.map +0 -0
- package/app-dist/assets/uk_UA-SSN6SV5E-IlYYyRC6.js +1488 -0
- package/app-dist/assets/uk_UA-SSN6SV5E-IlYYyRC6.js.map +1 -0
- package/app-dist/assets/unichain-C5BWO2ZY-BfguYsnu.js +2 -0
- package/app-dist/assets/unichain-C5BWO2ZY-BfguYsnu.js.map +1 -0
- package/app-dist/assets/verify-6ofWwX2p.js +9 -0
- package/app-dist/assets/verify-6ofWwX2p.js.map +1 -0
- package/app-dist/assets/verify-BmdjVjoU.js +9 -0
- package/app-dist/assets/verify-BmdjVjoU.js.map +1 -0
- package/app-dist/assets/verify-Dqd-Oj6j.js +9 -0
- package/app-dist/assets/verify-Dqd-Oj6j.js.map +0 -0
- package/app-dist/assets/verify-filled-Bd7cBcl6.js +9 -0
- package/app-dist/assets/verify-filled-Bd7cBcl6.js.map +1 -0
- package/app-dist/assets/verify-filled-CGEF4WVN.js +9 -0
- package/app-dist/assets/verify-filled-CGEF4WVN.js.map +0 -0
- package/app-dist/assets/verify-filled-Cf-TeM4T.js +9 -0
- package/app-dist/assets/verify-filled-Cf-TeM4T.js.map +1 -0
- package/app-dist/assets/vi_VN-7BUVRNYY-CZ9S75qZ.js +1488 -0
- package/app-dist/assets/vi_VN-7BUVRNYY-CZ9S75qZ.js.map +1 -0
- package/app-dist/assets/w3m-modal-CWyXHUW5.js +643 -0
- package/app-dist/assets/w3m-modal-CWyXHUW5.js.map +1 -0
- package/app-dist/assets/w3m-modal-CnoO8YJf.js +0 -0
- package/app-dist/assets/w3m-modal-CnoO8YJf.js.map +0 -0
- package/app-dist/assets/w3m-modal-xrIPs4AE.js +643 -0
- package/app-dist/assets/w3m-modal-xrIPs4AE.js.map +1 -0
- package/app-dist/assets/wallet-B9tNiUsz.js +9 -0
- package/app-dist/assets/wallet-B9tNiUsz.js.map +0 -0
- package/app-dist/assets/wallet-BZ4F_yJB.js +9 -0
- package/app-dist/assets/wallet-BZ4F_yJB.js.map +1 -0
- package/app-dist/assets/wallet-Dwi1CFfY.js +9 -0
- package/app-dist/assets/wallet-Dwi1CFfY.js.map +1 -0
- package/app-dist/assets/wallet-placeholder-9FExN6iz.js +15 -0
- package/app-dist/assets/wallet-placeholder-9FExN6iz.js.map +1 -0
- package/app-dist/assets/wallet-placeholder-DTYChZmr.js +15 -0
- package/app-dist/assets/wallet-placeholder-DTYChZmr.js.map +0 -0
- package/app-dist/assets/wallet-placeholder-DpYL6Gkg.js +15 -0
- package/app-dist/assets/wallet-placeholder-DpYL6Gkg.js.map +1 -0
- package/app-dist/assets/walletConnectWallet-YHWKVTDY-D3lyiczV.js +2 -0
- package/app-dist/assets/walletConnectWallet-YHWKVTDY-D3lyiczV.js.map +1 -0
- package/app-dist/assets/walletconnect-D7I3rksa.js +31 -0
- package/app-dist/assets/walletconnect-D7I3rksa.js.map +0 -0
- package/app-dist/assets/walletconnect-DAi4FVBA.js +31 -0
- package/app-dist/assets/walletconnect-DAi4FVBA.js.map +1 -0
- package/app-dist/assets/walletconnect-DJRTAE4R.js +31 -0
- package/app-dist/assets/walletconnect-DJRTAE4R.js.map +1 -0
- package/app-dist/assets/warning-circle-hyMAaK3d.js +13 -0
- package/app-dist/assets/warning-circle-hyMAaK3d.js.map +1 -0
- package/app-dist/assets/warning-circle-ygtzYLqr.js +13 -0
- package/app-dist/assets/warning-circle-ygtzYLqr.js.map +0 -0
- package/app-dist/assets/warning-circle-z9wNayCA.js +13 -0
- package/app-dist/assets/warning-circle-z9wNayCA.js.map +1 -0
- package/app-dist/assets/x-DsvNj0kT.js +13 -0
- package/app-dist/assets/x-DsvNj0kT.js.map +1 -0
- package/app-dist/assets/x-H7B0_YQh.js +13 -0
- package/app-dist/assets/x-H7B0_YQh.js.map +1 -0
- package/app-dist/assets/x-jMygn2bJ.js +13 -0
- package/app-dist/assets/x-jMygn2bJ.js.map +0 -0
- package/app-dist/assets/xdc-KJ3TDBYO-DNV6zchh.js +2 -0
- package/app-dist/assets/xdc-KJ3TDBYO-DNV6zchh.js.map +1 -0
- package/app-dist/assets/zetachain-TLDS5IPW-Udhyw16T.js +2 -0
- package/app-dist/assets/zetachain-TLDS5IPW-Udhyw16T.js.map +1 -0
- package/app-dist/assets/zh_CN-HJBN674C-Baf0GEeT.js +1488 -0
- package/app-dist/assets/zh_CN-HJBN674C-Baf0GEeT.js.map +1 -0
- package/app-dist/assets/zh_HK-JW3WLRKE-VztJKXL5.js +1488 -0
- package/app-dist/assets/zh_HK-JW3WLRKE-VztJKXL5.js.map +1 -0
- package/app-dist/assets/zh_TW-VNNRNXY7-aWfg7Qp4.js +1488 -0
- package/app-dist/assets/zh_TW-VNNRNXY7-aWfg7Qp4.js.map +1 -0
- package/app-dist/assets/zksync-DH7HK5U4-Dt4usFw6.js +2 -0
- package/app-dist/assets/zksync-DH7HK5U4-Dt4usFw6.js.map +1 -0
- package/app-dist/assets/zora-FYL5H3IO-iB4wygST.js +2 -0
- package/app-dist/assets/zora-FYL5H3IO-iB4wygST.js.map +1 -0
- package/app-dist/index.html +14 -0
- package/dist/RemoteSigner.d.ts +27 -0
- package/dist/RemoteSigner.d.ts.map +1 -0
- package/dist/RemoteSigner.js +108 -0
- package/dist/RemoteSigner.js.map +1 -0
- package/dist/SigningClient.d.ts +36 -0
- package/dist/SigningClient.d.ts.map +1 -0
- package/dist/SigningClient.js +132 -0
- package/dist/SigningClient.js.map +1 -0
- package/dist/SigningServer.d.ts +70 -0
- package/dist/SigningServer.d.ts.map +1 -0
- package/dist/SigningServer.js +584 -0
- package/dist/SigningServer.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -0
- package/dist/index.js.map +1 -0
- package/dist/tasks/start.d.ts +2 -0
- package/dist/tasks/start.d.ts.map +1 -0
- package/dist/tasks/start.js +378 -0
- package/dist/tasks/start.js.map +1 -0
- package/dist/tasks/status.d.ts +2 -0
- package/dist/tasks/status.d.ts.map +1 -0
- package/dist/tasks/status.js +108 -0
- package/dist/tasks/status.js.map +1 -0
- package/dist/tasks/stop.d.ts +2 -0
- package/dist/tasks/stop.d.ts.map +1 -0
- package/dist/tasks/stop.js +92 -0
- package/dist/tasks/stop.js.map +1 -0
- package/dist/types.d.ts +154 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,543 @@
|
|
|
1
|
+
var ch=Object.defineProperty;var lh=(e,t,n)=>t in e?ch(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Dt=(e,t,n)=>lh(e,typeof t!="symbol"?t+"":t,n);import{k as qr,g as qs,m as uh,_ as dh}from"./index-m8qSBWEb.js";var as={exports:{}};(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof qr<"u"&&qr,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(c){var s=typeof o<"u"&&o||typeof self<"u"&&self||typeof qr<"u"&&qr||{},a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function l(C){return C&&DataView.prototype.isPrototypeOf(C)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(C){return C&&u.indexOf(Object.prototype.toString.call(C))>-1};function f(C){if(typeof C!="string"&&(C=String(C)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(C)||C==="")throw new TypeError('Invalid character in header field name: "'+C+'"');return C.toLowerCase()}function h(C){return typeof C!="string"&&(C=String(C)),C}function g(C){var R={next:function(){var D=C.shift();return{done:D===void 0,value:D}}};return a.iterable&&(R[Symbol.iterator]=function(){return R}),R}function m(C){this.map={},C instanceof m?C.forEach(function(R,D){this.append(D,R)},this):Array.isArray(C)?C.forEach(function(R){if(R.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+R.length);this.append(R[0],R[1])},this):C&&Object.getOwnPropertyNames(C).forEach(function(R){this.append(R,C[R])},this)}m.prototype.append=function(C,R){C=f(C),R=h(R);var D=this.map[C];this.map[C]=D?D+", "+R:R},m.prototype.delete=function(C){delete this.map[f(C)]},m.prototype.get=function(C){return C=f(C),this.has(C)?this.map[C]:null},m.prototype.has=function(C){return this.map.hasOwnProperty(f(C))},m.prototype.set=function(C,R){this.map[f(C)]=h(R)},m.prototype.forEach=function(C,R){for(var D in this.map)this.map.hasOwnProperty(D)&&C.call(R,this.map[D],D,this)},m.prototype.keys=function(){var C=[];return this.forEach(function(R,D){C.push(D)}),g(C)},m.prototype.values=function(){var C=[];return this.forEach(function(R){C.push(R)}),g(C)},m.prototype.entries=function(){var C=[];return this.forEach(function(R,D){C.push([D,R])}),g(C)},a.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function w(C){if(!C._noBody){if(C.bodyUsed)return Promise.reject(new TypeError("Already read"));C.bodyUsed=!0}}function p(C){return new Promise(function(R,D){C.onload=function(){R(C.result)},C.onerror=function(){D(C.error)}})}function S(C){var R=new FileReader,D=p(R);return R.readAsArrayBuffer(C),D}function _(C){var R=new FileReader,D=p(R),y=/charset=([A-Za-z0-9_-]+)/.exec(C.type),E=y?y[1]:"utf-8";return R.readAsText(C,E),D}function P(C){for(var R=new Uint8Array(C),D=new Array(R.length),y=0;y<R.length;y++)D[y]=String.fromCharCode(R[y]);return D.join("")}function O(C){if(C.slice)return C.slice(0);var R=new Uint8Array(C.byteLength);return R.set(new Uint8Array(C)),R.buffer}function K(){return this.bodyUsed=!1,this._initBody=function(C){this.bodyUsed=this.bodyUsed,this._bodyInit=C,C?typeof C=="string"?this._bodyText=C:a.blob&&Blob.prototype.isPrototypeOf(C)?this._bodyBlob=C:a.formData&&FormData.prototype.isPrototypeOf(C)?this._bodyFormData=C:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)?this._bodyText=C.toString():a.arrayBuffer&&a.blob&&l(C)?(this._bodyArrayBuffer=O(C.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(C)||d(C))?this._bodyArrayBuffer=O(C):this._bodyText=C=Object.prototype.toString.call(C):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof C=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(C)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var C=w(this);if(C)return C;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var C=w(this);return C||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(S);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var C=w(this);if(C)return C;if(this._bodyBlob)return _(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(j)}),this.json=function(){return this.text().then(JSON.parse)},this}var q=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function F(C){var R=C.toUpperCase();return q.indexOf(R)>-1?R:C}function U(C,R){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');R=R||{};var D=R.body;if(C instanceof U){if(C.bodyUsed)throw new TypeError("Already read");this.url=C.url,this.credentials=C.credentials,R.headers||(this.headers=new m(C.headers)),this.method=C.method,this.mode=C.mode,this.signal=C.signal,!D&&C._bodyInit!=null&&(D=C._bodyInit,C.bodyUsed=!0)}else this.url=String(C);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new m(R.headers)),this.method=F(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal||function(){if("AbortController"in s){var k=new AbortController;return k.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(D),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var y=/([?&])_=[^&]*/;if(y.test(this.url))this.url=this.url.replace(y,"$1_="+new Date().getTime());else{var E=/\?/;this.url+=(E.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function j(C){var R=new FormData;return C.trim().split("&").forEach(function(D){if(D){var y=D.split("="),E=y.shift().replace(/\+/g," "),k=y.join("=").replace(/\+/g," ");R.append(decodeURIComponent(E),decodeURIComponent(k))}}),R}function G(C){var R=new m,D=C.replace(/\r?\n[\t ]+/g," ");return D.split("\r").map(function(y){return y.indexOf(`
|
|
2
|
+
`)===0?y.substr(1,y.length):y}).forEach(function(y){var E=y.split(":"),k=E.shift().trim();if(k){var M=E.join(":").trim();try{R.append(k,M)}catch(b){console.warn("Response "+b.message)}}}),R}K.call(U.prototype);function B(C,R){if(!(this instanceof B))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new m(R.headers),this.url=R.url||"",this._initBody(C)}K.call(B.prototype),B.prototype.clone=function(){return new B(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},B.error=function(){var C=new B(null,{status:200,statusText:""});return C.ok=!1,C.status=0,C.type="error",C};var N=[301,302,303,307,308];B.redirect=function(C,R){if(N.indexOf(R)===-1)throw new RangeError("Invalid status code");return new B(null,{status:R,headers:{location:C}})},c.DOMException=s.DOMException;try{new c.DOMException}catch{c.DOMException=function(R,D){this.message=R,this.name=D;var y=Error(R);this.stack=y.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function I(C,R){return new Promise(function(D,y){var E=new U(C,R);if(E.signal&&E.signal.aborted)return y(new c.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function M(){k.abort()}k.onload=function(){var A={statusText:k.statusText,headers:G(k.getAllResponseHeaders()||"")};E.url.indexOf("file://")===0&&(k.status<200||k.status>599)?A.status=200:A.status=k.status,A.url="responseURL"in k?k.responseURL:A.headers.get("X-Request-URL");var x="response"in k?k.response:k.responseText;setTimeout(function(){D(new B(x,A))},0)},k.onerror=function(){setTimeout(function(){y(new TypeError("Network request failed"))},0)},k.ontimeout=function(){setTimeout(function(){y(new TypeError("Network request timed out"))},0)},k.onabort=function(){setTimeout(function(){y(new c.DOMException("Aborted","AbortError"))},0)};function b(A){try{return A===""&&s.location.href?s.location.href:A}catch{return A}}if(k.open(E.method,b(E.url),!0),E.credentials==="include"?k.withCredentials=!0:E.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&(a.blob?k.responseType="blob":a.arrayBuffer&&(k.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof m||s.Headers&&R.headers instanceof s.Headers)){var v=[];Object.getOwnPropertyNames(R.headers).forEach(function(A){v.push(f(A)),k.setRequestHeader(A,h(R.headers[A]))}),E.headers.forEach(function(A,x){v.indexOf(x)===-1&&k.setRequestHeader(x,A)})}else E.headers.forEach(function(A,x){k.setRequestHeader(x,A)});E.signal&&(E.signal.addEventListener("abort",M),k.onreadystatechange=function(){k.readyState===4&&E.signal.removeEventListener("abort",M)}),k.send(typeof E._bodyInit>"u"?null:E._bodyInit)})}return I.polyfill=!0,s.fetch||(s.fetch=I,s.Headers=m,s.Request=U,s.Response=B),c.Headers=m,c.Request=U,c.Response=B,c.fetch=I,c})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(as,as.exports);var fh=as.exports;const Zl=qs(fh);var cs={exports:{}},bo,Na;function hh(){if(Na)return bo;Na=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,o=r*365.25;bo=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return c(u);if(f==="number"&&isFinite(u))return d.long?a(u):s(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function c(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),h=(d[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function s(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function a(u){var d=Math.abs(u);return d>=r?l(u,d,r,"day"):d>=n?l(u,d,n,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,f,h){var g=d>=f*1.5;return Math.round(u/f)+" "+h+(g?"s":"")}return bo}function ph(e){n.debug=n,n.default=n,n.coerce=a,n.disable=o,n.enable=i,n.enabled=c,n.humanize=hh(),n.destroy=l,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,f=null,h,g;function m(...w){if(!m.enabled)return;const p=m,S=Number(new Date),_=S-(d||S);p.diff=_,p.prev=d,p.curr=S,d=S,w[0]=n.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let P=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(K,q)=>{if(K==="%%")return"%";P++;const F=n.formatters[q];if(typeof F=="function"){const U=w[P];K=F.call(p,U),w.splice(P,1),P--}return K}),n.formatArgs.call(p,w),(p.log||n.log).apply(p,w)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(h!==n.namespaces&&(h=n.namespaces,g=n.enabled(u)),g),set:w=>{f=w}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const f=n(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const f=(typeof u=="string"?u:"").split(/[\s,]+/),h=f.length;for(d=0;d<h;d++)f[d]&&(u=f[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function o(){const u=[...n.names.map(s),...n.skips.map(s).map(d=>"-"+d)].join(",");return n.enable(""),u}function c(u){if(u[u.length-1]==="*")return!0;let d,f;for(d=0,f=n.skips.length;d<f;d++)if(n.skips[d].test(u))return!1;for(d=0,f=n.names.length;d<f;d++)if(n.names[d].test(u))return!0;return!1}function s(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function a(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var mh=ph;(function(e,t){var n={};t.formatArgs=i,t.save=o,t.load=c,t.useColors=r,t.storage=s(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let d=0,f=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(d++,h==="%c"&&(f=d))}),l.splice(f,0,u)}t.log=console.debug||console.log||(()=>{});function o(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function c(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=n.DEBUG),l}function s(){try{return localStorage}catch{}}e.exports=mh(t);const{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(cs,cs.exports);var gh=cs.exports;const Ge=qs(gh);var Ws=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,vh=Object.getOwnPropertyNames,bh=Object.prototype.hasOwnProperty,wh=(e,t)=>{for(var n in t)Ws(e,n,{get:t[n],enumerable:!0})},Eh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of vh(t))!bh.call(e,i)&&i!==n&&Ws(e,i,{get:()=>t[i],enumerable:!(r=yh(t,i))||r.enumerable});return e},_h=e=>Eh(Ws({},"__esModule",{value:!0}),e),Jl={};wh(Jl,{createFinalURL:()=>ru,createPathBasedClient:()=>Mh,createQuerySerializer:()=>ls,default:()=>Ql,defaultBodySerializer:()=>nu,defaultPathSerializer:()=>tu,mergeHeaders:()=>us,randomID:()=>Xl,removeTrailingSlash:()=>ds,serializeArrayParam:()=>Gs,serializeObjectParam:()=>Vs,serializePrimitiveParam:()=>Kr,wrapAsPathBasedClient:()=>eu});var Sh=_h(Jl),Ch=/\{[^{}]+\}/g,Ah=()=>{var e,t;return typeof process=="object"&&Number.parseInt((t=(e=process==null?void 0:process.versions)==null?void 0:e.node)==null?void 0:t.substring(0,2))>=18&&process.versions.undici};function Xl(){return Math.random().toString(36).slice(2,11)}function Ql(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:o,headers:c,requestInitExt:s=void 0,...a}={...e};s=Ah()?s:void 0,t=ds(t);const l=[];async function u(d,f){const{baseUrl:h,fetch:g=r,Request:m=n,headers:w,params:p={},parseAs:S="json",querySerializer:_,bodySerializer:P=o??nu,body:O,...K}=f||{};let q=t;h&&(q=ds(h)??t);let F=typeof i=="function"?i:ls(i);_&&(F=typeof _=="function"?_:ls({...typeof i=="object"?i:{},..._}));const U=O===void 0?void 0:P(O,us(c,w,p.header)),j=us(U===void 0||U instanceof FormData?{}:{"Content-Type":"application/json"},c,w,p.header),G={redirect:"follow",...a,...K,body:U,headers:j};let B,N,I=new n(ru(d,{baseUrl:q,params:p,querySerializer:F}),G),C;for(const D in K)D in I||(I[D]=K[D]);if(l.length){B=Xl(),N=Object.freeze({baseUrl:q,fetch:g,parseAs:S,querySerializer:F,bodySerializer:P});for(const D of l)if(D&&typeof D=="object"&&typeof D.onRequest=="function"){const y=await D.onRequest({request:I,schemaPath:d,params:p,options:N,id:B});if(y)if(y instanceof n)I=y;else if(y instanceof Response){C=y;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!C){try{C=await g(I,s)}catch(D){let y=D;if(l.length)for(let E=l.length-1;E>=0;E--){const k=l[E];if(k&&typeof k=="object"&&typeof k.onError=="function"){const M=await k.onError({request:I,error:y,schemaPath:d,params:p,options:N,id:B});if(M){if(M instanceof Response){y=void 0,C=M;break}if(M instanceof Error){y=M;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(y)throw y}if(l.length)for(let D=l.length-1;D>=0;D--){const y=l[D];if(y&&typeof y=="object"&&typeof y.onResponse=="function"){const E=await y.onResponse({request:I,response:C,schemaPath:d,params:p,options:N,id:B});if(E){if(!(E instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");C=E}}}}if(C.status===204||I.method==="HEAD"||C.headers.get("Content-Length")==="0")return C.ok?{data:void 0,response:C}:{error:void 0,response:C};if(C.ok)return S==="stream"?{data:C.body,response:C}:{data:await C[S](),response:C};let R=await C.text();try{R=JSON.parse(R)}catch{}return{error:R,response:C}}return{request(d,f,h){return u(f,{...h,method:d.toUpperCase()})},GET(d,f){return u(d,{...f,method:"GET"})},PUT(d,f){return u(d,{...f,method:"PUT"})},POST(d,f){return u(d,{...f,method:"POST"})},DELETE(d,f){return u(d,{...f,method:"DELETE"})},OPTIONS(d,f){return u(d,{...f,method:"OPTIONS"})},HEAD(d,f){return u(d,{...f,method:"HEAD"})},PATCH(d,f){return u(d,{...f,method:"PATCH"})},TRACE(d,f){return u(d,{...f,method:"TRACE"})},use(...d){for(const f of d)if(f){if(typeof f!="object"||!("onRequest"in f||"onResponse"in f||"onError"in f))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");l.push(f)}},eject(...d){for(const f of d){const h=l.indexOf(f);h!==-1&&l.splice(h,1)}}}}var kh=class{constructor(e,t){Dt(this,"GET",e=>this.client.GET(this.url,e));Dt(this,"PUT",e=>this.client.PUT(this.url,e));Dt(this,"POST",e=>this.client.POST(this.url,e));Dt(this,"DELETE",e=>this.client.DELETE(this.url,e));Dt(this,"OPTIONS",e=>this.client.OPTIONS(this.url,e));Dt(this,"HEAD",e=>this.client.HEAD(this.url,e));Dt(this,"PATCH",e=>this.client.PATCH(this.url,e));Dt(this,"TRACE",e=>this.client.TRACE(this.url,e));this.client=e,this.url=t}},xh=class{constructor(){this.client=null}get(e,t){const n=new kh(e,t);return this.client[t]=n,n}};function eu(e){const t=new xh,n=new Proxy(e,t);function r(){}r.prototype=n;const i=new r;return t.client=i,i}function Mh(e){return eu(Ql(e))}function Kr(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${(n==null?void 0:n.allowReserved)===!0?t:encodeURIComponent(t)}`}function Vs(e,t,n){if(!t||typeof t!="object")return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const s in t)r.push(s,n.allowReserved===!0?t[s]:encodeURIComponent(t[s]));const c=r.join(",");switch(n.style){case"form":return`${e}=${c}`;case"label":return`.${c}`;case"matrix":return`;${e}=${c}`;default:return c}}for(const c in t){const s=n.style==="deepObject"?`${e}[${c}]`:c;r.push(Kr(s,t[c],n))}const o=r.join(i);return n.style==="label"||n.style==="matrix"?`${i}${o}`:o}function Gs(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",c=(n.allowReserved===!0?t:t.map(s=>encodeURIComponent(s))).join(o);switch(n.style){case"simple":return c;case"label":return`.${c}`;case"matrix":return`;${e}=${c}`;default:return`${e}=${c}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const o of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?o:encodeURIComponent(o)):i.push(Kr(e,o,n));return n.style==="label"||n.style==="matrix"?`${r}${i.join(r)}`:i.join(r)}function ls(e){return function(n){const r=[];if(n&&typeof n=="object")for(const i in n){const o=n[i];if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;r.push(Gs(i,o,{style:"form",explode:!0,...e==null?void 0:e.array,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}if(typeof o=="object"){r.push(Vs(i,o,{style:"deepObject",explode:!0,...e==null?void 0:e.object,allowReserved:(e==null?void 0:e.allowReserved)||!1}));continue}r.push(Kr(i,o,e))}}return r.join("&")}}function tu(e,t){let n=e;for(const r of e.match(Ch)??[]){let i=r.substring(1,r.length-1),o=!1,c="simple";if(i.endsWith("*")&&(o=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(c="label",i=i.substring(1)):i.startsWith(";")&&(c="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const s=t[i];if(Array.isArray(s)){n=n.replace(r,Gs(i,s,{style:c,explode:o}));continue}if(typeof s=="object"){n=n.replace(r,Vs(i,s,{style:c,explode:o}));continue}if(c==="matrix"){n=n.replace(r,`;${Kr(i,s)}`);continue}n=n.replace(r,c==="label"?`.${encodeURIComponent(s)}`:encodeURIComponent(s))}return n}function nu(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function ru(e,t){var i;let n=`${t.baseUrl}${e}`;(i=t.params)!=null&&i.path&&(n=tu(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function us(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(const c of o)t.append(i,c);else o!==void 0&&t.set(i,o)}return t}function ds(e){return e.endsWith("/")?e.substring(0,e.length-1):e}var wo={},Th=Object.create,io=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,Ph=Object.getOwnPropertyNames,Rh=Object.getPrototypeOf,Oh=Object.prototype.hasOwnProperty,Lh=(e,t)=>{for(var n in t)io(e,n,{get:t[n],enumerable:!0})},iu=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ph(t))!Oh.call(e,i)&&i!==n&&io(e,i,{get:()=>t[i],enumerable:!(r=Ih(t,i))||r.enumerable});return e},Nh=(e,t,n)=>(n=e!=null?Th(Rh(e)):{},iu(!e||!e.__esModule?io(n,"default",{value:e,enumerable:!0}):n,e)),Dh=e=>iu(io({},"__esModule",{value:!0}),e),ou={};Lh(ou,{analytics:()=>zh});var Me=Dh(ou),$h=Nh(Sh),Bh=class{constructor(e){this.batch=[],this.maxTimeoutMs=3e4,this.timeoutId=null,this.isSending=!1,this.batchSize=e.batchSize,this.baseTimeoutMs=e.baseTimeoutMs,this.currentTimeoutMs=e.baseTimeoutMs,this.sendFn=e.sendFn}enqueue(e){this.batch.push(e),this.schedule()}schedule(){this.batch.length>0&&!this.timeoutId&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.flush()},this.currentTimeoutMs))}async flush(){if(this.isSending||this.batch.length===0)return;this.isSending=!0;const e=[...this.batch.slice(0,this.batchSize)];this.batch=this.batch.slice(this.batchSize);try{await this.sendFn(e),this.currentTimeoutMs=this.baseTimeoutMs}catch(t){console.error("Sender: Failed to send batch",t),this.batch=[...e,...this.batch],this.currentTimeoutMs=Math.min(this.currentTimeoutMs*2,this.maxTimeoutMs)}finally{this.isSending=!1,this.schedule()}}},Kh=Bh,jh=class{constructor(e){this.enabled=!1,this.properties={};const t=(0,$h.default)({baseUrl:e}),n=async r=>{const i=await t.POST("/v1/events",{body:r});if(i.response.status!==200)throw new Error(i.error)};this.sender=new Kh({batchSize:100,baseTimeoutMs:200,sendFn:n})}enable(){this.enabled=!0}setGlobalProperty(e,t){this.properties[e]=t}track(e,t){if(!this.enabled)return;const n={name:e,...this.properties,...t};this.sender.enqueue(n)}},Uh=jh,fs,Da;typeof process<"u"&&wo&&(fs=(Da=wo.METAMASK_ANALYTICS_ENDPOINT)!=null?Da:wo.NEXT_PUBLIC_METAMASK_ANALYTICS_ENDPOINT);var Hh=fs??"https://mm-sdk-analytics.api.cx.metamask.io/",Fh=new Uh(Hh),zh=Fh,su={exports:{}};/*!
|
|
3
|
+
* EventEmitter2
|
|
4
|
+
* https://github.com/hij1nx/EventEmitter2
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2013 hij1nx
|
|
7
|
+
* Licensed under the MIT license.
|
|
8
|
+
*/(function(e,t){(function(n){var r=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(E){return Object.prototype.toString.call(E)==="[object Array]"},o=10,c=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",l=typeof setImmediate=="function",u=l?setImmediate:setTimeout,d=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(y){var E=Object.getOwnPropertyNames(y);return E.push.apply(E,Object.getOwnPropertySymbols(y)),E}:Object.keys;function f(){this._events={},this._conf&&h.call(this,this._conf)}function h(y){y&&(this._conf=y,y.delimiter&&(this.delimiter=y.delimiter),y.maxListeners!==n&&(this._maxListeners=y.maxListeners),y.wildcard&&(this.wildcard=y.wildcard),y.newListener&&(this._newListener=y.newListener),y.removeListener&&(this._removeListener=y.removeListener),y.verboseMemoryLeak&&(this.verboseMemoryLeak=y.verboseMemoryLeak),y.ignoreErrors&&(this.ignoreErrors=y.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function g(y,E){var k="(node) warning: possible EventEmitter memory leak detected. "+y+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(k+=" Event name: "+E+"."),typeof process<"u"&&process.emitWarning){var M=new Error(k);M.name="MaxListenersExceededWarning",M.emitter=this,M.count=y,process.emitWarning(M)}else console.error(k),console.trace&&console.trace()}var m=function(y,E,k){var M=arguments.length;switch(M){case 0:return[];case 1:return[y];case 2:return[y,E];case 3:return[y,E,k];default:for(var b=new Array(M);M--;)b[M]=arguments[M];return b}};function w(y,E){for(var k={},M,b=y.length,v=0,A=0;A<b;A++)M=y[A],k[M]=A<v?E[A]:n;return k}function p(y,E,k){this._emitter=y,this._target=E,this._listeners={},this._listenersCount=0;var M,b;if((k.on||k.off)&&(M=k.on,b=k.off),E.addEventListener?(M=E.addEventListener,b=E.removeEventListener):E.addListener?(M=E.addListener,b=E.removeListener):E.on&&(M=E.on,b=E.off),!M&&!b)throw Error("target does not implement any known event API");if(typeof M!="function")throw TypeError("on method must be a function");if(typeof b!="function")throw TypeError("off method must be a function");this._on=M,this._off=b;var v=y._observers;v?v.push(this):y._observers=[this]}Object.assign(p.prototype,{subscribe:function(y,E,k){var M=this,b=this._target,v=this._emitter,A=this._listeners,x=function(){var T=m.apply(null,arguments),L={data:T,name:E,original:y};if(k){var $=k.call(b,L);$!==!1&&v.emit.apply(v,[L.name].concat(T));return}v.emit.apply(v,[E].concat(T))};if(A[y])throw Error("Event '"+y+"' is already listening");this._listenersCount++,v._newListener&&v._removeListener&&!M._onNewListener?(this._onNewListener=function(T){T===E&&A[y]===null&&(A[y]=x,M._on.call(b,y,x))},v.on("newListener",this._onNewListener),this._onRemoveListener=function(T){T===E&&!v.hasListeners(T)&&A[y]&&(A[y]=null,M._off.call(b,y,x))},A[y]=null,v.on("removeListener",this._onRemoveListener)):(A[y]=x,M._on.call(b,y,x))},unsubscribe:function(y){var E=this,k=this._listeners,M=this._emitter,b,v,A=this._off,x=this._target,T;if(y&&typeof y!="string")throw TypeError("event must be a string");function L(){E._onNewListener&&(M.off("newListener",E._onNewListener),M.off("removeListener",E._onRemoveListener),E._onNewListener=null,E._onRemoveListener=null);var $=F.call(M,E);M._observers.splice($,1)}if(y){if(b=k[y],!b)return;A.call(x,y,b),delete k[y],--this._listenersCount||L()}else{for(v=d(k),T=v.length;T-- >0;)y=v[T],A.call(x,y,k[y]);this._listeners={},this._listenersCount=0,L()}}});function S(y,E,k,M){var b=Object.assign({},E);if(!y)return b;if(typeof y!="object")throw TypeError("options must be an object");var v=Object.keys(y),A=v.length,x,T,L;function $(z){throw Error('Invalid "'+x+'" option value'+(z?". Reason: "+z:""))}for(var H=0;H<A;H++){if(x=v[H],!r.call(E,x))throw Error('Unknown "'+x+'" option');T=y[x],T!==n&&(L=k[x],b[x]=L?L(T,$):T)}return b}function _(y,E){return(typeof y!="function"||!y.hasOwnProperty("prototype"))&&E("value must be a constructor"),y}function P(y){var E="value must be type of "+y.join("|"),k=y.length,M=y[0],b=y[1];return k===1?function(v,A){if(typeof v===M)return v;A(E)}:k===2?function(v,A){var x=typeof v;if(x===M||x===b)return v;A(E)}:function(v,A){for(var x=typeof v,T=k;T-- >0;)if(x===y[T])return v;A(E)}}var O=P(["function"]),K=P(["object","function"]);function q(y,E,k){var M,b,v=0,A,x=new y(function(T,L,$){k=S(k,{timeout:0,overload:!1},{timeout:function(Q,ne){return Q*=1,(typeof Q!="number"||Q<0||!Number.isFinite(Q))&&ne("timeout must be a positive number"),Q}}),M=!k.overload&&typeof y.prototype.cancel=="function"&&typeof $=="function";function H(){b&&(b=null),v&&(clearTimeout(v),v=0)}var z=function(Q){H(),T(Q)},J=function(Q){H(),L(Q)};M?E(z,J,$):(b=[function(Q){J(Q||Error("canceled"))}],E(z,J,function(Q){if(A)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Q!="function")throw TypeError("onCancel callback must be a function");b.push(Q)}),A=!0),k.timeout>0&&(v=setTimeout(function(){var Q=Error("timeout");Q.code="ETIMEDOUT",v=0,x.cancel(Q),L(Q)},k.timeout))});return M||(x.cancel=function(T){if(b){for(var L=b.length,$=1;$<L;$++)b[$](T);b[0](T),b=null}}),x}function F(y){var E=this._observers;if(!E)return-1;for(var k=E.length,M=0;M<k;M++)if(E[M]._target===y)return M;return-1}function U(y,E,k,M,b){if(!k)return null;if(M===0){var v=typeof E;if(v==="string"){var A,x,T=0,L=0,$=this.delimiter,H=$.length;if((x=E.indexOf($))!==-1){A=new Array(5);do A[T++]=E.slice(L,x),L=x+H;while((x=E.indexOf($,L))!==-1);A[T++]=E.slice(L),E=A,b=T}else E=[E],b=1}else v==="object"?b=E.length:(E=[E],b=1)}var z=null,J,Q,ne,se,le,re=E[M],ie=E[M+1],ce,ae;if(M===b)k._listeners&&(typeof k._listeners=="function"?(y&&y.push(k._listeners),z=[k]):(y&&y.push.apply(y,k._listeners),z=[k]));else if(re==="*"){for(ce=d(k),x=ce.length;x-- >0;)J=ce[x],J!=="_listeners"&&(ae=U(y,E,k[J],M+1,b),ae&&(z?z.push.apply(z,ae):z=ae));return z}else if(re==="**"){for(le=M+1===b||M+2===b&&ie==="*",le&&k._listeners&&(z=U(y,E,k,b,b)),ce=d(k),x=ce.length;x-- >0;)J=ce[x],J!=="_listeners"&&(J==="*"||J==="**"?(k[J]._listeners&&!le&&(ae=U(y,E,k[J],b,b),ae&&(z?z.push.apply(z,ae):z=ae)),ae=U(y,E,k[J],M,b)):J===ie?ae=U(y,E,k[J],M+2,b):ae=U(y,E,k[J],M,b),ae&&(z?z.push.apply(z,ae):z=ae));return z}else k[re]&&(z=U(y,E,k[re],M+1,b));if(Q=k["*"],Q&&U(y,E,Q,M+1,b),ne=k["**"],ne)if(M<b)for(ne._listeners&&U(y,E,ne,b,b),ce=d(ne),x=ce.length;x-- >0;)J=ce[x],J!=="_listeners"&&(J===ie?U(y,E,ne[J],M+2,b):J===re?U(y,E,ne[J],M+1,b):(se={},se[J]=ne[J],U(y,E,{"**":se},M+1,b)));else ne._listeners?U(y,E,ne,b,b):ne["*"]&&ne["*"]._listeners&&U(y,E,ne["*"],b,b);return z}function j(y,E,k){var M=0,b=0,v,A=this.delimiter,x=A.length,T;if(typeof y=="string")if((v=y.indexOf(A))!==-1){T=new Array(5);do T[M++]=y.slice(b,v),b=v+x;while((v=y.indexOf(A,b))!==-1);T[M++]=y.slice(b)}else T=[y],M=1;else T=y,M=y.length;if(M>1){for(v=0;v+1<M;v++)if(T[v]==="**"&&T[v+1]==="**")return}var L=this.listenerTree,$;for(v=0;v<M;v++)if($=T[v],L=L[$]||(L[$]={}),v===M-1)return L._listeners?(typeof L._listeners=="function"&&(L._listeners=[L._listeners]),k?L._listeners.unshift(E):L._listeners.push(E),!L._listeners.warned&&this._maxListeners>0&&L._listeners.length>this._maxListeners&&(L._listeners.warned=!0,g.call(this,L._listeners.length,$))):L._listeners=E,!0;return!0}function G(y,E,k,M){for(var b=d(y),v=b.length,A,x,T,L=y._listeners,$;v-- >0;)x=b[v],A=y[x],x==="_listeners"?T=k:T=k?k.concat(x):[x],$=M||typeof x=="symbol",L&&E.push($?T:T.join(this.delimiter)),typeof A=="object"&&G.call(this,A,E,T,$);return E}function B(y){for(var E=d(y),k=E.length,M,b,v;k-- >0;)b=E[k],M=y[b],M&&(v=!0,b!=="_listeners"&&!B(M)&&delete y[b]);return v}function N(y,E,k){this.emitter=y,this.event=E,this.listener=k}N.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function I(y,E,k){if(k===!0)b=!0;else if(k===!1)M=!0;else{if(!k||typeof k!="object")throw TypeError("options should be an object or true");var M=k.async,b=k.promisify,v=k.nextTick,A=k.objectify}if(M||v||b){var x=E,T=E._origin||E;if(v&&!c)throw Error("process.nextTick is not supported");b===n&&(b=E.constructor.name==="AsyncFunction"),E=function(){var L=arguments,$=this,H=this.event;return b?v?Promise.resolve():new Promise(function(z){u(z)}).then(function(){return $.event=H,x.apply($,L)}):(v?process.nextTick:u)(function(){$.event=H,x.apply($,L)})},E._async=!0,E._origin=T}return[E,A?new N(this,y,E):this]}function C(y){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,h.call(this,y)}C.EventEmitter2=C,C.prototype.listenTo=function(y,E,k){if(typeof y!="object")throw TypeError("target musts be an object");var M=this;k=S(k,{on:n,off:n,reducers:n},{on:O,off:O,reducers:K});function b(v){if(typeof v!="object")throw TypeError("events must be an object");var A=k.reducers,x=F.call(M,y),T;x===-1?T=new p(M,y,k):T=M._observers[x];for(var L=d(v),$=L.length,H,z=typeof A=="function",J=0;J<$;J++)H=L[J],T.subscribe(H,v[H]||H,z?A:A&&A[H])}return i(E)?b(w(E)):b(typeof E=="string"?w(E.split(/\s+/)):E),this},C.prototype.stopListeningTo=function(y,E){var k=this._observers;if(!k)return!1;var M=k.length,b,v=!1;if(y&&typeof y!="object")throw TypeError("target should be an object");for(;M-- >0;)b=k[M],(!y||b._target===y)&&(b.unsubscribe(E),v=!0);return v},C.prototype.delimiter=".",C.prototype.setMaxListeners=function(y){y!==n&&(this._maxListeners=y,this._conf||(this._conf={}),this._conf.maxListeners=y)},C.prototype.getMaxListeners=function(){return this._maxListeners},C.prototype.event="",C.prototype.once=function(y,E,k){return this._once(y,E,!1,k)},C.prototype.prependOnceListener=function(y,E,k){return this._once(y,E,!0,k)},C.prototype._once=function(y,E,k,M){return this._many(y,1,E,k,M)},C.prototype.many=function(y,E,k,M){return this._many(y,E,k,!1,M)},C.prototype.prependMany=function(y,E,k,M){return this._many(y,E,k,!0,M)},C.prototype._many=function(y,E,k,M,b){var v=this;if(typeof k!="function")throw new Error("many only accepts instances of Function");function A(){return--E===0&&v.off(y,A),k.apply(this,arguments)}return A._origin=k,this._on(y,A,M,b)},C.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||f.call(this);var y=arguments[0],E,k=this.wildcard,M,b,v,A,x;if(y==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(k&&(E=y,y!=="newListener"&&y!=="removeListener"&&typeof y=="object")){if(b=y.length,s){for(v=0;v<b;v++)if(typeof y[v]=="symbol"){x=!0;break}}x||(y=y.join(this.delimiter))}var T=arguments.length,L;if(this._all&&this._all.length)for(L=this._all.slice(),v=0,b=L.length;v<b;v++)switch(this.event=y,T){case 1:L[v].call(this,y);break;case 2:L[v].call(this,y,arguments[1]);break;case 3:L[v].call(this,y,arguments[1],arguments[2]);break;default:L[v].apply(this,arguments)}if(k)L=[],U.call(this,L,E,this.listenerTree,0,b);else if(L=this._events[y],typeof L=="function"){switch(this.event=y,T){case 1:L.call(this);break;case 2:L.call(this,arguments[1]);break;case 3:L.call(this,arguments[1],arguments[2]);break;default:for(M=new Array(T-1),A=1;A<T;A++)M[A-1]=arguments[A];L.apply(this,M)}return!0}else L&&(L=L.slice());if(L&&L.length){if(T>3)for(M=new Array(T-1),A=1;A<T;A++)M[A-1]=arguments[A];for(v=0,b=L.length;v<b;v++)switch(this.event=y,T){case 1:L[v].call(this);break;case 2:L[v].call(this,arguments[1]);break;case 3:L[v].call(this,arguments[1],arguments[2]);break;default:L[v].apply(this,M)}return!0}else if(!this.ignoreErrors&&!this._all&&y==="error")throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},C.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||f.call(this);var y=arguments[0],E=this.wildcard,k,M,b,v,A,x;if(y==="newListener"&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(E&&(k=y,y!=="newListener"&&y!=="removeListener"&&typeof y=="object")){if(v=y.length,s){for(A=0;A<v;A++)if(typeof y[A]=="symbol"){M=!0;break}}M||(y=y.join(this.delimiter))}var T=[],L=arguments.length,$;if(this._all)for(A=0,v=this._all.length;A<v;A++)switch(this.event=y,L){case 1:T.push(this._all[A].call(this,y));break;case 2:T.push(this._all[A].call(this,y,arguments[1]));break;case 3:T.push(this._all[A].call(this,y,arguments[1],arguments[2]));break;default:T.push(this._all[A].apply(this,arguments))}if(E?($=[],U.call(this,$,k,this.listenerTree,0)):$=this._events[y],typeof $=="function")switch(this.event=y,L){case 1:T.push($.call(this));break;case 2:T.push($.call(this,arguments[1]));break;case 3:T.push($.call(this,arguments[1],arguments[2]));break;default:for(b=new Array(L-1),x=1;x<L;x++)b[x-1]=arguments[x];T.push($.apply(this,b))}else if($&&$.length){if($=$.slice(),L>3)for(b=new Array(L-1),x=1;x<L;x++)b[x-1]=arguments[x];for(A=0,v=$.length;A<v;A++)switch(this.event=y,L){case 1:T.push($[A].call(this));break;case 2:T.push($[A].call(this,arguments[1]));break;case 3:T.push($[A].call(this,arguments[1],arguments[2]));break;default:T.push($[A].apply(this,b))}}else if(!this.ignoreErrors&&!this._all&&y==="error")return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(T)},C.prototype.on=function(y,E,k){return this._on(y,E,!1,k)},C.prototype.prependListener=function(y,E,k){return this._on(y,E,!0,k)},C.prototype.onAny=function(y){return this._onAny(y,!1)},C.prototype.prependAny=function(y){return this._onAny(y,!0)},C.prototype.addListener=C.prototype.on,C.prototype._onAny=function(y,E){if(typeof y!="function")throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),E?this._all.unshift(y):this._all.push(y),this},C.prototype._on=function(y,E,k,M){if(typeof y=="function")return this._onAny(y,E),this;if(typeof E!="function")throw new Error("on only accepts instances of Function");this._events||f.call(this);var b=this,v;return M!==n&&(v=I.call(this,y,E,M),E=v[0],b=v[1]),this._newListener&&this.emit("newListener",y,E),this.wildcard?(j.call(this,y,E,k),b):(this._events[y]?(typeof this._events[y]=="function"&&(this._events[y]=[this._events[y]]),k?this._events[y].unshift(E):this._events[y].push(E),!this._events[y].warned&&this._maxListeners>0&&this._events[y].length>this._maxListeners&&(this._events[y].warned=!0,g.call(this,this._events[y].length,y))):this._events[y]=E,b)},C.prototype.off=function(y,E){if(typeof E!="function")throw new Error("removeListener only takes instances of Function");var k,M=[];if(this.wildcard){var b=typeof y=="string"?y.split(this.delimiter):y.slice();if(M=U.call(this,null,b,this.listenerTree,0),!M)return this}else{if(!this._events[y])return this;k=this._events[y],M.push({_listeners:k})}for(var v=0;v<M.length;v++){var A=M[v];if(k=A._listeners,i(k)){for(var x=-1,T=0,L=k.length;T<L;T++)if(k[T]===E||k[T].listener&&k[T].listener===E||k[T]._origin&&k[T]._origin===E){x=T;break}if(x<0)continue;return this.wildcard?A._listeners.splice(x,1):this._events[y].splice(x,1),k.length===0&&(this.wildcard?delete A._listeners:delete this._events[y]),this._removeListener&&this.emit("removeListener",y,E),this}else(k===E||k.listener&&k.listener===E||k._origin&&k._origin===E)&&(this.wildcard?delete A._listeners:delete this._events[y],this._removeListener&&this.emit("removeListener",y,E))}return this.listenerTree&&B(this.listenerTree),this},C.prototype.offAny=function(y){var E=0,k=0,M;if(y&&this._all&&this._all.length>0){for(M=this._all,E=0,k=M.length;E<k;E++)if(y===M[E])return M.splice(E,1),this._removeListener&&this.emit("removeListenerAny",y),this}else{if(M=this._all,this._removeListener)for(E=0,k=M.length;E<k;E++)this.emit("removeListenerAny",M[E]);this._all=[]}return this},C.prototype.removeListener=C.prototype.off,C.prototype.removeAllListeners=function(y){if(y===n)return!this._events||f.call(this),this;if(this.wildcard){var E=U.call(this,null,y,this.listenerTree,0),k,M;if(!E)return this;for(M=0;M<E.length;M++)k=E[M],k._listeners=null;this.listenerTree&&B(this.listenerTree)}else this._events&&(this._events[y]=null);return this},C.prototype.listeners=function(y){var E=this._events,k,M,b,v,A;if(y===n){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!E)return[];for(k=d(E),v=k.length,b=[];v-- >0;)M=E[k[v]],typeof M=="function"?b.push(M):b.push.apply(b,M);return b}else{if(this.wildcard){if(A=this.listenerTree,!A)return[];var x=[],T=typeof y=="string"?y.split(this.delimiter):y.slice();return U.call(this,x,T,A,0),x}return E?(M=E[y],M?typeof M=="function"?[M]:M:[]):[]}},C.prototype.eventNames=function(y){var E=this._events;return this.wildcard?G.call(this,this.listenerTree,[],null,y):E?d(E):[]},C.prototype.listenerCount=function(y){return this.listeners(y).length},C.prototype.hasListeners=function(y){if(this.wildcard){var E=[],k=typeof y=="string"?y.split(this.delimiter):y.slice();return U.call(this,E,k,this.listenerTree,0),E.length>0}var M=this._events,b=this._all;return!!(b&&b.length||M&&(y===n?d(M).length:M[y]))},C.prototype.listenersAny=function(){return this._all?this._all:[]},C.prototype.waitFor=function(y,E){var k=this,M=typeof E;return M==="number"?E={timeout:E}:M==="function"&&(E={filter:E}),E=S(E,{timeout:0,filter:n,handleError:!1,Promise,overload:!1},{filter:O,Promise:_}),q(E.Promise,function(b,v,A){function x(){var T=E.filter;if(!(T&&!T.apply(k,arguments)))if(k.off(y,x),E.handleError){var L=arguments[0];L?v(L):b(m.apply(null,arguments).slice(1))}else b(m.apply(null,arguments))}A(function(){k.off(y,x)}),k._on(y,x,!1)},{timeout:E.timeout,overload:E.overload})};function R(y,E,k){k=S(k,{Promise,timeout:0,overload:!1},{Promise:_});var M=k.Promise;return q(M,function(b,v,A){var x;if(typeof y.addEventListener=="function"){x=function(){b(m.apply(null,arguments))},A(function(){y.removeEventListener(E,x)}),y.addEventListener(E,x,{once:!0});return}var T=function(){L&&y.removeListener("error",L),b(m.apply(null,arguments))},L;E!=="error"&&(L=function($){y.removeListener(E,T),v($)},y.once("error",L)),A(function(){L&&y.removeListener("error",L),y.removeListener(E,T)}),y.once(E,T)},{timeout:k.timeout,overload:k.overload})}var D=C.prototype;Object.defineProperties(C,{defaultMaxListeners:{get:function(){return D._maxListeners},set:function(y){if(typeof y!="number"||y<0||Number.isNaN(y))throw TypeError("n must be a non-negative number");D._maxListeners=y},enumerable:!0},once:{value:R,writable:!0,configurable:!0}}),Object.defineProperties(D,{_maxListeners:{value:o,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),e.exports=C})()})(su);var oo=su.exports;const qh=qs(oo);var Wr,Wh=new Uint8Array(16);function Vh(){if(!Wr&&(Wr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Wr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wr(Wh)}const Gh=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function hs(e){return typeof e=="string"&&Gh.test(e)}var De=[];for(var Eo=0;Eo<256;++Eo)De.push((Eo+256).toString(16).substr(1));function Yh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(De[e[t+0]]+De[e[t+1]]+De[e[t+2]]+De[e[t+3]]+"-"+De[e[t+4]]+De[e[t+5]]+"-"+De[e[t+6]]+De[e[t+7]]+"-"+De[e[t+8]]+De[e[t+9]]+"-"+De[e[t+10]]+De[e[t+11]]+De[e[t+12]]+De[e[t+13]]+De[e[t+14]]+De[e[t+15]]).toLowerCase();if(!hs(n))throw TypeError("Stringified UUID is invalid");return n}function dn(e,t,n){e=e||{};var r=e.random||(e.rng||Vh)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Yh(r)}function Z(e,t,n,r){return new(n||(n=Promise))(function(i,o){function c(l){try{a(r.next(l))}catch(u){o(u)}}function s(l){try{a(r.throw(l))}catch(u){o(u)}}function a(l){var u;l.done?i(l.value):(u=l.value,u instanceof n?u:new n(function(d){d(u)})).then(c,s)}a((r=r.apply(e,t||[])).next())})}var Ye=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},kt=[],ht=[],Zh=typeof Uint8Array<"u"?Uint8Array:Array,Ys=!1;function au(){Ys=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)kt[t]=e[t],ht[e.charCodeAt(t)]=t;ht[45]=62,ht[95]=63}function Jh(e,t,n){for(var r,i,o=[],c=t;c<n;c+=3)r=(e[c]<<16)+(e[c+1]<<8)+e[c+2],o.push(kt[(i=r)>>18&63]+kt[i>>12&63]+kt[i>>6&63]+kt[63&i]);return o.join("")}function $a(e){var t;Ys||au();for(var n=e.length,r=n%3,i="",o=[],c=16383,s=0,a=n-r;s<a;s+=c)o.push(Jh(e,s,s+c>a?a:s+c));return r===1?(t=e[n-1],i+=kt[t>>2],i+=kt[t<<4&63],i+="=="):r===2&&(t=(e[n-2]<<8)+e[n-1],i+=kt[t>>10],i+=kt[t>>4&63],i+=kt[t<<2&63],i+="="),o.push(i),o.join("")}function Vr(e,t,n,r,i){var o,c,s=8*i-r-1,a=(1<<s)-1,l=a>>1,u=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=f,u-=8);for(c=o&(1<<-u)-1,o>>=-u,u+=r;u>0;c=256*c+e[t+d],d+=f,u-=8);if(o===0)o=1-l;else{if(o===a)return c?NaN:1/0*(h?-1:1);c+=Math.pow(2,r),o-=l}return(h?-1:1)*c*Math.pow(2,o-r)}function cu(e,t,n,r,i,o){var c,s,a,l=8*o-i-1,u=(1<<l)-1,d=u>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,g=r?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,c=u):(c=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-c))<1&&(c--,a*=2),(t+=c+d>=1?f/a:f*Math.pow(2,1-d))*a>=2&&(c++,a/=2),c+d>=u?(s=0,c=u):c+d>=1?(s=(t*a-1)*Math.pow(2,i),c+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),c=0));i>=8;e[n+h]=255&s,h+=g,s/=256,i-=8);for(c=c<<i|s,l+=i;l>0;e[n+h]=255&c,h+=g,c/=256,l-=8);e[n+h-g]|=128*m}var Xh={}.toString,lu=Array.isArray||function(e){return Xh.call(e)=="[object Array]"};X.TYPED_ARRAY_SUPPORT=Ye.TYPED_ARRAY_SUPPORT===void 0||Ye.TYPED_ARRAY_SUPPORT;var Qh=Ri();function Ri(){return X.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ft(e,t){if(Ri()<t)throw new RangeError("Invalid typed array length");return X.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=X.prototype:(e===null&&(e=new X(t)),e.length=t),e}function X(e,t,n){if(!(X.TYPED_ARRAY_SUPPORT||this instanceof X))return new X(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return ps(this,e)}return uu(this,e,t,n)}function uu(e,t,n,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?function(i,o,c,s){if(o.byteLength,c<0||o.byteLength<c)throw new RangeError("'offset' is out of bounds");if(o.byteLength<c+(s||0))throw new RangeError("'length' is out of bounds");return o=c===void 0&&s===void 0?new Uint8Array(o):s===void 0?new Uint8Array(o,c):new Uint8Array(o,c,s),X.TYPED_ARRAY_SUPPORT?(i=o).__proto__=X.prototype:i=_o(i,o),i}(e,t,n,r):typeof t=="string"?function(i,o,c){if(typeof c=="string"&&c!==""||(c="utf8"),!X.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding');var s=0|fu(o,c);i=Ft(i,s);var a=i.write(o,c);return a!==s&&(i=i.slice(0,a)),i}(e,t,n):function(i,o){if(xt(o)){var c=0|Zs(o.length);return(i=Ft(i,c)).length===0||o.copy(i,0,0,c),i}if(o){if(typeof ArrayBuffer<"u"&&o.buffer instanceof ArrayBuffer||"length"in o)return typeof o.length!="number"||(s=o.length)!=s?Ft(i,0):_o(i,o);if(o.type==="Buffer"&&lu(o.data))return _o(i,o.data)}var s;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function du(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function ps(e,t){if(du(t),e=Ft(e,t<0?0:0|Zs(t)),!X.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function _o(e,t){var n=t.length<0?0:0|Zs(t.length);e=Ft(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function Zs(e){if(e>=Ri())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Ri().toString(16)+" bytes");return 0|e}function xt(e){return!(e==null||!e._isBuffer)}function fu(e,t){if(xt(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Oi(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return gu(e).length;default:if(r)return Oi(e).length;t=(""+t).toLowerCase(),r=!0}}function e0(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return l0(this,t,n);case"utf8":case"utf-8":return pu(this,t,n);case"ascii":return a0(this,t,n);case"latin1":case"binary":return c0(this,t,n);case"base64":return s0(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u0(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function En(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Ba(e,t,n,r,i){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if(typeof t=="string"&&(t=X.from(t,r)),xt(t))return t.length===0?-1:Ka(e,t,n,r,i);if(typeof t=="number")return t&=255,X.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Ka(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Ka(e,t,n,r,i){var o,c=1,s=e.length,a=t.length;if(r!==void 0&&((r=String(r).toLowerCase())==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;c=2,s/=2,a/=2,n/=2}function l(h,g){return c===1?h[g]:h.readUInt16BE(g*c)}if(i){var u=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,u===-1?0:o-u)){if(u===-1&&(u=o),o-u+1===a)return u*c}else u!==-1&&(o-=o-u),u=-1}else for(n+a>s&&(n=s-a),o=n;o>=0;o--){for(var d=!0,f=0;f<a;f++)if(l(e,o+f)!==l(t,f)){d=!1;break}if(d)return o}return-1}function t0(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var c=0;c<r;++c){var s=parseInt(t.substr(2*c,2),16);if(isNaN(s))return c;e[n+c]=s}return c}function n0(e,t,n,r){return so(Oi(t,e.length-n),e,n,r)}function hu(e,t,n,r){return so(function(i){for(var o=[],c=0;c<i.length;++c)o.push(255&i.charCodeAt(c));return o}(t),e,n,r)}function r0(e,t,n,r){return hu(e,t,n,r)}function i0(e,t,n,r){return so(gu(t),e,n,r)}function o0(e,t,n,r){return so(function(i,o){for(var c,s,a,l=[],u=0;u<i.length&&!((o-=2)<0);++u)s=(c=i.charCodeAt(u))>>8,a=c%256,l.push(a),l.push(s);return l}(t,e.length-n),e,n,r)}function s0(e,t,n){return t===0&&n===e.length?$a(e):$a(e.slice(t,n))}function pu(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,c,s,a,l=e[i],u=null,d=l>239?4:l>223?3:l>191?2:1;if(i+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:(192&(o=e[i+1]))==128&&(a=(31&l)<<6|63&o)>127&&(u=a);break;case 3:o=e[i+1],c=e[i+2],(192&o)==128&&(192&c)==128&&(a=(15&l)<<12|(63&o)<<6|63&c)>2047&&(a<55296||a>57343)&&(u=a);break;case 4:o=e[i+1],c=e[i+2],s=e[i+3],(192&o)==128&&(192&c)==128&&(192&s)==128&&(a=(15&l)<<18|(63&o)<<12|(63&c)<<6|63&s)>65535&&a<1114112&&(u=a)}u===null?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=d}return function(f){var h=f.length;if(h<=ja)return String.fromCharCode.apply(String,f);for(var g="",m=0;m<h;)g+=String.fromCharCode.apply(String,f.slice(m,m+=ja));return g}(r)}X.poolSize=8192,X._augment=function(e){return e.__proto__=X.prototype,e},X.from=function(e,t,n){return uu(null,e,t,n)},X.TYPED_ARRAY_SUPPORT&&(X.prototype.__proto__=Uint8Array.prototype,X.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&X[Symbol.species]),X.alloc=function(e,t,n){return function(r,i,o,c){return du(i),i<=0?Ft(r,i):o!==void 0?typeof c=="string"?Ft(r,i).fill(o,c):Ft(r,i).fill(o):Ft(r,i)}(null,e,t,n)},X.allocUnsafe=function(e){return ps(null,e)},X.allocUnsafeSlow=function(e){return ps(null,e)},X.isBuffer=yu,X.compare=function(e,t){if(!xt(e)||!xt(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},X.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},X.concat=function(e,t){if(!lu(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return X.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=X.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!xt(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},X.byteLength=fu,X.prototype._isBuffer=!0,X.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)En(this,t,t+1);return this},X.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)En(this,t,t+3),En(this,t+1,t+2);return this},X.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)En(this,t,t+7),En(this,t+1,t+6),En(this,t+2,t+5),En(this,t+3,t+4);return this},X.prototype.toString=function(){var e=0|this.length;return e===0?"":arguments.length===0?pu(this,0,e):e0.apply(this,arguments)},X.prototype.equals=function(e){if(!xt(e))throw new TypeError("Argument must be a Buffer");return this===e||X.compare(this,e)===0},X.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},X.prototype.compare=function(e,t,n,r,i){if(!xt(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),c=(n>>>=0)-(t>>>=0),s=Math.min(o,c),a=this.slice(r,i),l=e.slice(t,n),u=0;u<s;++u)if(a[u]!==l[u]){o=a[u],c=l[u];break}return o<c?-1:c<o?1:0},X.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},X.prototype.indexOf=function(e,t,n){return Ba(this,e,t,n,!0)},X.prototype.lastIndexOf=function(e,t,n){return Ba(this,e,t,n,!1)},X.prototype.write=function(e,t,n,r){if(t===void 0)r="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,r===void 0&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return t0(this,e,t,n);case"utf8":case"utf-8":return n0(this,e,t,n);case"ascii":return hu(this,e,t,n);case"latin1":case"binary":return r0(this,e,t,n);case"base64":return i0(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o0(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},X.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ja=4096;function a0(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function c0(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function l0(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=f0(e[o]);return i}function u0(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Pe(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Ze(e,t,n,r,i,o){if(!xt(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Gr(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Yr(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function mu(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ua(e,t,n,r,i){return i||mu(e,0,n,4),cu(e,t,n,r,23,4),n+4}function Ha(e,t,n,r,i){return i||mu(e,0,n,8),cu(e,t,n,r,52,8),n+8}X.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=t===void 0?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),X.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=X.prototype;else{var i=t-e;n=new X(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},X.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||Pe(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},X.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||Pe(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},X.prototype.readUInt8=function(e,t){return t||Pe(e,1,this.length),this[e]},X.prototype.readUInt16LE=function(e,t){return t||Pe(e,2,this.length),this[e]|this[e+1]<<8},X.prototype.readUInt16BE=function(e,t){return t||Pe(e,2,this.length),this[e]<<8|this[e+1]},X.prototype.readUInt32LE=function(e,t){return t||Pe(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},X.prototype.readUInt32BE=function(e,t){return t||Pe(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},X.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||Pe(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},X.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||Pe(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},X.prototype.readInt8=function(e,t){return t||Pe(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},X.prototype.readInt16LE=function(e,t){t||Pe(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},X.prototype.readInt16BE=function(e,t){t||Pe(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},X.prototype.readInt32LE=function(e,t){return t||Pe(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},X.prototype.readInt32BE=function(e,t){return t||Pe(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},X.prototype.readFloatLE=function(e,t){return t||Pe(e,4,this.length),Vr(this,e,!0,23,4)},X.prototype.readFloatBE=function(e,t){return t||Pe(e,4,this.length),Vr(this,e,!1,23,4)},X.prototype.readDoubleLE=function(e,t){return t||Pe(e,8,this.length),Vr(this,e,!0,52,8)},X.prototype.readDoubleBE=function(e,t){return t||Pe(e,8,this.length),Vr(this,e,!1,52,8)},X.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||Ze(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},X.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||Ze(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},X.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,1,255,0),X.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},X.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,2,65535,0),X.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Gr(this,e,t,!0),t+2},X.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,2,65535,0),X.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Gr(this,e,t,!1),t+2},X.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,4,4294967295,0),X.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Yr(this,e,t,!0),t+4},X.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,4,4294967295,0),X.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Yr(this,e,t,!1),t+4},X.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Ze(this,e,t,n,i-1,-i)}var o=0,c=1,s=0;for(this[t]=255&e;++o<n&&(c*=256);)e<0&&s===0&&this[t+o-1]!==0&&(s=1),this[t+o]=(e/c>>0)-s&255;return t+n},X.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);Ze(this,e,t,n,i-1,-i)}var o=n-1,c=1,s=0;for(this[t+o]=255&e;--o>=0&&(c*=256);)e<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(e/c>>0)-s&255;return t+n},X.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,1,127,-128),X.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},X.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,2,32767,-32768),X.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Gr(this,e,t,!0),t+2},X.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,2,32767,-32768),X.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Gr(this,e,t,!1),t+2},X.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,4,2147483647,-2147483648),X.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Yr(this,e,t,!0),t+4},X.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Ze(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),X.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Yr(this,e,t,!1),t+4},X.prototype.writeFloatLE=function(e,t,n){return Ua(this,e,t,!0,n)},X.prototype.writeFloatBE=function(e,t,n){return Ua(this,e,t,!1,n)},X.prototype.writeDoubleLE=function(e,t,n){return Ha(this,e,t,!0,n)},X.prototype.writeDoubleBE=function(e,t,n){return Ha(this,e,t,!1,n)},X.prototype.copy=function(e,t,n,r){if(n||(n=0),r||r===0||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!X.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},X.prototype.fill=function(e,t,n,r){if(typeof e=="string"){if(typeof t=="string"?(r=t,t=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),e.length===1){var i=e.charCodeAt(0);i<256&&(e=i)}if(r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!X.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else typeof e=="number"&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=n===void 0?this.length:n>>>0,e||(e=0),typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var c=xt(e)?e:Oi(new X(e,r).toString()),s=c.length;for(o=0;o<n-t;++o)this[o+t]=c[o%s]}return this};var d0=/[^+\/0-9A-Za-z-_]/g;function f0(e){return e<16?"0"+e.toString(16):e.toString(16)}function Oi(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],c=0;c<r;++c){if((n=e.charCodeAt(c))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function gu(e){return function(t){var n,r,i,o,c,s;Ys||au();var a=t.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");c=t[a-2]==="="?2:t[a-1]==="="?1:0,s=new Zh(3*a/4-c),i=c>0?a-4:a;var l=0;for(n=0,r=0;n<i;n+=4,r+=3)o=ht[t.charCodeAt(n)]<<18|ht[t.charCodeAt(n+1)]<<12|ht[t.charCodeAt(n+2)]<<6|ht[t.charCodeAt(n+3)],s[l++]=o>>16&255,s[l++]=o>>8&255,s[l++]=255&o;return c===2?(o=ht[t.charCodeAt(n)]<<2|ht[t.charCodeAt(n+1)]>>4,s[l++]=255&o):c===1&&(o=ht[t.charCodeAt(n)]<<10|ht[t.charCodeAt(n+1)]<<4|ht[t.charCodeAt(n+2)]>>2,s[l++]=o>>8&255,s[l++]=255&o),s}(function(t){if((t=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}(t).replace(d0,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(e))}function so(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function yu(e){return e!=null&&(!!e._isBuffer||Fa(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Fa(t.slice(0,0))}(e))}function Fa(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var h0=Object.freeze({__proto__:null,Buffer:X,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),X.alloc(+e)},isBuffer:yu,kMaxLength:Qh}),gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ao(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function jr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var jn={},at={},He={};function Li(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function vu(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function bu(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Js(e,...t){if(!bu(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function wu(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("hash must be wrapped by utils.wrapConstructor");Li(e.outputLen),Li(e.blockLen)}function Eu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _u(e,t){Js(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}Object.defineProperty(He,"__esModule",{value:!0}),He.isBytes=bu,He.number=Li,He.bool=vu,He.bytes=Js,He.hash=wu,He.exists=Eu,He.output=_u;const p0={number:Li,bool:vu,bytes:Js,hash:wu,exists:Eu,output:_u};He.default=p0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapCipher=e.Hash=e.nextTick=e.isLE=e.createView=e.u32=e.u16=e.u8=void 0,e.bytesToHex=r,e.hexToBytes=c,e.hexToNumber=s,e.bytesToNumberBE=function(d){return s(r(d))},e.numberToBytesBE=function(d,f){return c(d.toString(16).padStart(2*f,"0"))},e.asyncLoop=async function(d,f,h){let g=Date.now();for(let m=0;m<d;m++){h(m);const w=Date.now()-g;w>=0&&w<f||(await(0,e.nextTick)(),g+=w)}},e.utf8ToBytes=a,e.bytesToUtf8=function(d){return new TextDecoder().decode(d)},e.toBytes=function(d){if(typeof d=="string")d=a(d);else{if(!(0,t.isBytes)(d))throw new Error("Uint8Array expected, got "+typeof d);d=u(d)}return d},e.concatBytes=function(...d){let f=0;for(let g=0;g<d.length;g++){const m=d[g];(0,t.bytes)(m),f+=m.length}const h=new Uint8Array(f);for(let g=0,m=0;g<d.length;g++){const w=d[g];h.set(w,m),m+=w.length}return h},e.checkOpts=function(d,f){if(f==null||typeof f!="object")throw new Error("options must be defined");return Object.assign(d,f)},e.equalBytes=function(d,f){if(d.length!==f.length)return!1;let h=0;for(let g=0;g<d.length;g++)h|=d[g]^f[g];return h===0},e.setBigUint64=l,e.u64Lengths=function(d,f){const h=new Uint8Array(16),g=(0,e.createView)(h);return l(g,0,BigInt(f?f.length:0),!0),l(g,8,BigInt(d.length),!0),h},e.isAligned32=function(d){return d.byteOffset%4==0},e.copyBytes=u,e.clean=function(...d){for(let f=0;f<d.length;f++)d[f].fill(0)};const t=He;if(e.u8=d=>new Uint8Array(d.buffer,d.byteOffset,d.byteLength),e.u16=d=>new Uint16Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/2)),e.u32=d=>new Uint32Array(d.buffer,d.byteOffset,Math.floor(d.byteLength/4)),e.createView=d=>new DataView(d.buffer,d.byteOffset,d.byteLength),e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");const n=Array.from({length:256},(d,f)=>f.toString(16).padStart(2,"0"));function r(d){(0,t.bytes)(d);let f="";for(let h=0;h<d.length;h++)f+=n[d[h]];return f}const i={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function o(d){return d>=i._0&&d<=i._9?d-i._0:d>=i._A&&d<=i._F?d-(i._A-10):d>=i._a&&d<=i._f?d-(i._a-10):void 0}function c(d){if(typeof d!="string")throw new Error("hex string expected, got "+typeof d);const f=d.length,h=f/2;if(f%2)throw new Error("padded hex string expected, got unpadded hex of length "+f);const g=new Uint8Array(h);for(let m=0,w=0;m<h;m++,w+=2){const p=o(d.charCodeAt(w)),S=o(d.charCodeAt(w+1));if(p===void 0||S===void 0){const _=d[w]+d[w+1];throw new Error('hex string expected, got non-hex character "'+_+'" at index '+w)}g[m]=16*p+S}return g}function s(d){if(typeof d!="string")throw new Error("hex string expected, got "+typeof d);return BigInt(d===""?"0":`0x${d}`)}function a(d){if(typeof d!="string")throw new Error("string expected, got "+typeof d);return new Uint8Array(new TextEncoder().encode(d))}e.nextTick=async()=>{},e.Hash=class{};function l(d,f,h,g){if(typeof d.setBigUint64=="function")return d.setBigUint64(f,h,g);const m=BigInt(32),w=BigInt(4294967295),p=Number(h>>m&w),S=Number(h&w),_=g?4:0,P=g?0:4;d.setUint32(f+_,p,g),d.setUint32(f+P,S,g)}function u(d){return Uint8Array.from(d)}e.wrapCipher=(d,f)=>(Object.assign(f,d),f)}(at);var Cr={},Re={};Object.defineProperty(Re,"__esModule",{value:!0}),Re.AEAD_TAG_LENGTH=Re.XCHACHA20_NONCE_LENGTH=Re.CURVE25519_PUBLIC_KEY_SIZE=Re.ETH_PUBLIC_KEY_SIZE=Re.UNCOMPRESSED_PUBLIC_KEY_SIZE=Re.COMPRESSED_PUBLIC_KEY_SIZE=Re.SECRET_KEY_LENGTH=void 0,Re.SECRET_KEY_LENGTH=32,Re.COMPRESSED_PUBLIC_KEY_SIZE=33,Re.UNCOMPRESSED_PUBLIC_KEY_SIZE=65,Re.ETH_PUBLIC_KEY_SIZE=64,Re.CURVE25519_PUBLIC_KEY_SIZE=32,Re.XCHACHA20_NONCE_LENGTH=24,Re.AEAD_TAG_LENGTH=16,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ephemeralKeySize=e.symmetricNonceLength=e.symmetricAlgorithm=e.isHkdfKeyCompressed=e.isEphemeralKeyCompressed=e.ellipticCurve=e.ECIES_CONFIG=void 0;var t=Re,n=function(){this.ellipticCurve="secp256k1",this.isEphemeralKeyCompressed=!1,this.isHkdfKeyCompressed=!1,this.symmetricAlgorithm="aes-256-gcm",this.symmetricNonceLength=16};e.ECIES_CONFIG=new n,e.ellipticCurve=function(){return e.ECIES_CONFIG.ellipticCurve},e.isEphemeralKeyCompressed=function(){return e.ECIES_CONFIG.isEphemeralKeyCompressed},e.isHkdfKeyCompressed=function(){return e.ECIES_CONFIG.isHkdfKeyCompressed},e.symmetricAlgorithm=function(){return e.ECIES_CONFIG.symmetricAlgorithm},e.symmetricNonceLength=function(){return e.ECIES_CONFIG.symmetricNonceLength},e.ephemeralKeySize=function(){var r={secp256k1:e.ECIES_CONFIG.isEphemeralKeyCompressed?t.COMPRESSED_PUBLIC_KEY_SIZE:t.UNCOMPRESSED_PUBLIC_KEY_SIZE,x25519:t.CURVE25519_PUBLIC_KEY_SIZE,ed25519:t.CURVE25519_PUBLIC_KEY_SIZE};if(e.ECIES_CONFIG.ellipticCurve in r)return r[e.ECIES_CONFIG.ellipticCurve];throw new Error("Not implemented")}}(Cr);var So={},Ni={},co={},Su={},Xs={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.crypto=void 0,Zr.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.gcm=e.ctr=e.cbc=e.utils=void 0,e.randomBytes=i,e.getWebcryptoSubtle=o,e.managedNonce=function(a){return(0,n.number)(a.nonceLength),(l,...u)=>({encrypt(d,...f){const{nonceLength:h}=a,g=i(h),m=a(l,g,...u).encrypt(d,...f),w=(0,r.concatBytes)(g,m);return m.fill(0),w},decrypt(d,...f){const{nonceLength:h}=a,g=d.subarray(0,h),m=d.subarray(h);return a(l,g,...u).decrypt(m,...f)}})};const t=Zr,n=He,r=at;function i(a=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(a));if(t.crypto&&typeof t.crypto.randomBytes=="function")return t.crypto.randomBytes(a);throw new Error("crypto.getRandomValues must be defined")}function o(){if(t.crypto&&typeof t.crypto.subtle=="object"&&t.crypto.subtle!=null)return t.crypto.subtle;throw new Error("crypto.subtle must be defined")}e.utils={async encrypt(a,l,u,d){const f=o(),h=await f.importKey("raw",a,l,!0,["encrypt"]),g=await f.encrypt(u,h,d);return new Uint8Array(g)},async decrypt(a,l,u,d){const f=o(),h=await f.importKey("raw",a,l,!0,["decrypt"]),g=await f.decrypt(u,h,d);return new Uint8Array(g)}};const c={CBC:"AES-CBC",CTR:"AES-CTR",GCM:"AES-GCM"};function s(a){return(l,u,d)=>{(0,n.bytes)(l),(0,n.bytes)(u);const f={name:a,length:8*l.length},h=function(g,m,w){if(g===c.CBC)return{name:c.CBC,iv:m};if(g===c.CTR)return{name:c.CTR,counter:m,length:64};if(g===c.GCM)return w?{name:c.GCM,iv:m,additionalData:w}:{name:c.GCM,iv:m};throw new Error("unknown aes block mode")}(a,u,d);return{encrypt:g=>((0,n.bytes)(g),e.utils.encrypt(l,f,h,g)),decrypt:g=>((0,n.bytes)(g),e.utils.decrypt(l,f,h,g))}}}e.cbc=s(c.CBC),e.ctr=s(c.CTR),e.gcm=s(c.GCM)}(Xs);var Cu={},Oe={},zt={},ot={};function Di(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function Au(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function ku(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Qs(e,...t){if(!ku(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function xu(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Di(e.outputLen),Di(e.blockLen)}function Mu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Tu(e,t){Qs(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}Object.defineProperty(ot,"__esModule",{value:!0}),ot.isBytes=ku,ot.number=Di,ot.bool=Au,ot.bytes=Qs,ot.hash=xu,ot.exists=Mu,ot.output=Tu;const m0={number:Di,bool:Au,bytes:Qs,hash:xu,exists:Mu,output:Tu};ot.default=m0;var Yt={},Jr={};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.crypto=void 0,Jr.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.nextTick=e.byteSwapIfBE=e.byteSwap=e.isLE=e.rotl=e.rotr=e.createView=e.u32=e.u8=void 0,e.isBytes=function(l){return l instanceof Uint8Array||l!=null&&typeof l=="object"&&l.constructor.name==="Uint8Array"},e.byteSwap32=function(l){for(let u=0;u<l.length;u++)l[u]=(0,e.byteSwap)(l[u])},e.bytesToHex=function(l){(0,n.bytes)(l);let u="";for(let d=0;d<l.length;d++)u+=r[l[d]];return u},e.hexToBytes=function(l){if(typeof l!="string")throw new Error("hex string expected, got "+typeof l);const u=l.length,d=u/2;if(u%2)throw new Error("padded hex string expected, got unpadded hex of length "+u);const f=new Uint8Array(d);for(let h=0,g=0;h<d;h++,g+=2){const m=o(l.charCodeAt(g)),w=o(l.charCodeAt(g+1));if(m===void 0||w===void 0){const p=l[g]+l[g+1];throw new Error('hex string expected, got non-hex character "'+p+'" at index '+g)}f[h]=16*m+w}return f},e.asyncLoop=async function(l,u,d){let f=Date.now();for(let h=0;h<l;h++){d(h);const g=Date.now()-f;g>=0&&g<u||(await(0,e.nextTick)(),f+=g)}},e.utf8ToBytes=c,e.toBytes=s,e.concatBytes=function(...l){let u=0;for(let f=0;f<l.length;f++){const h=l[f];(0,n.bytes)(h),u+=h.length}const d=new Uint8Array(u);for(let f=0,h=0;f<l.length;f++){const g=l[f];d.set(g,h),h+=g.length}return d},e.checkOpts=function(l,u){if(u!==void 0&&a.call(u)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(l,u)},e.wrapConstructor=function(l){const u=f=>l().update(s(f)).digest(),d=l();return u.outputLen=d.outputLen,u.blockLen=d.blockLen,u.create=()=>l(),u},e.wrapConstructorWithOpts=function(l){const u=(f,h)=>l(h).update(s(f)).digest(),d=l({});return u.outputLen=d.outputLen,u.blockLen=d.blockLen,u.create=f=>l(f),u},e.wrapXOFConstructorWithOpts=function(l){const u=(f,h)=>l(h).update(s(f)).digest(),d=l({});return u.outputLen=d.outputLen,u.blockLen=d.blockLen,u.create=f=>l(f),u},e.randomBytes=function(l=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(l));if(t.crypto&&typeof t.crypto.randomBytes=="function")return t.crypto.randomBytes(l);throw new Error("crypto.getRandomValues must be defined")};const t=Jr,n=ot;e.u8=l=>new Uint8Array(l.buffer,l.byteOffset,l.byteLength),e.u32=l=>new Uint32Array(l.buffer,l.byteOffset,Math.floor(l.byteLength/4)),e.createView=l=>new DataView(l.buffer,l.byteOffset,l.byteLength),e.rotr=(l,u)=>l<<32-u|l>>>u,e.rotl=(l,u)=>l<<u|l>>>32-u>>>0,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,e.byteSwap=l=>l<<24&4278190080|l<<8&16711680|l>>>8&65280|l>>>24&255,e.byteSwapIfBE=e.isLE?l=>l:l=>(0,e.byteSwap)(l);const r=Array.from({length:256},(l,u)=>u.toString(16).padStart(2,"0")),i={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function o(l){return l>=i._0&&l<=i._9?l-i._0:l>=i._A&&l<=i._F?l-(i._A-10):l>=i._a&&l<=i._f?l-(i._a-10):void 0}function c(l){if(typeof l!="string")throw new Error("utf8ToBytes expected string, got "+typeof l);return new Uint8Array(new TextEncoder().encode(l))}function s(l){return typeof l=="string"&&(l=c(l)),(0,n.bytes)(l),l}e.nextTick=async()=>{},e.Hash=class{clone(){return this._cloneInto()}};const a={}.toString}(Yt),Object.defineProperty(zt,"__esModule",{value:!0}),zt.HashMD=zt.Maj=zt.Chi=void 0;const Co=ot,ar=Yt;zt.Chi=(e,t,n)=>e&t^~e&n;zt.Maj=(e,t,n)=>e&t^e&n^t&n;zt.HashMD=class extends ar.Hash{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,ar.createView)(this.buffer)}update(e){(0,Co.exists)(this);const{view:t,buffer:n,blockLen:r}=this,i=(e=(0,ar.toBytes)(e)).length;for(let o=0;o<i;){const c=Math.min(r-this.pos,i-o);if(c!==r)n.set(e.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(t,0),this.pos=0);else{const s=(0,ar.createView)(e);for(;r<=i-o;o+=r)this.process(s,o)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,Co.exists)(this),(0,Co.output)(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:r,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>r-o&&(this.process(n,0),o=0);for(let u=o;u<r;u++)t[u]=0;(function(u,d,f,h){if(typeof u.setBigUint64=="function")return u.setBigUint64(d,f,h);const g=BigInt(32),m=BigInt(4294967295),w=Number(f>>g&m),p=Number(f&m),S=h?4:0,_=h?0:4;u.setUint32(d+S,w,h),u.setUint32(d+_,p,h)})(n,r-8,BigInt(8*this.length),i),this.process(n,0);const c=(0,ar.createView)(e),s=this.outputLen;if(s%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=s/4,l=this.get();if(a>l.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;u<a;u++)c.setUint32(4*u,l[u],i)}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:r,finished:i,destroyed:o,pos:c}=this;return e.length=r,e.pos=c,e.finished=i,e.destroyed=o,r%t&&e.buffer.set(n),e}};var fe={};Object.defineProperty(fe,"__esModule",{value:!0}),fe.add5L=fe.add5H=fe.add4H=fe.add4L=fe.add3H=fe.add3L=fe.rotlBL=fe.rotlBH=fe.rotlSL=fe.rotlSH=fe.rotr32L=fe.rotr32H=fe.rotrBL=fe.rotrBH=fe.rotrSL=fe.rotrSH=fe.shrSL=fe.shrSH=fe.toBig=void 0,fe.fromBig=ea,fe.split=Iu,fe.add=zu;const Xr=BigInt(2**32-1),ms=BigInt(32);function ea(e,t=!1){return t?{h:Number(e&Xr),l:Number(e>>ms&Xr)}:{h:0|Number(e>>ms&Xr),l:0|Number(e&Xr)}}function Iu(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:c}=ea(e[i],t);[n[i],r[i]]=[o,c]}return[n,r]}const Pu=(e,t)=>BigInt(e>>>0)<<ms|BigInt(t>>>0);fe.toBig=Pu;const Ru=(e,t,n)=>e>>>n;fe.shrSH=Ru;const Ou=(e,t,n)=>e<<32-n|t>>>n;fe.shrSL=Ou;const Lu=(e,t,n)=>e>>>n|t<<32-n;fe.rotrSH=Lu;const Nu=(e,t,n)=>e<<32-n|t>>>n;fe.rotrSL=Nu;const Du=(e,t,n)=>e<<64-n|t>>>n-32;fe.rotrBH=Du;const $u=(e,t,n)=>e>>>n-32|t<<64-n;fe.rotrBL=$u;const Bu=(e,t)=>t;fe.rotr32H=Bu;const Ku=(e,t)=>e;fe.rotr32L=Ku;const ju=(e,t,n)=>e<<n|t>>>32-n;fe.rotlSH=ju;const Uu=(e,t,n)=>t<<n|e>>>32-n;fe.rotlSL=Uu;const Hu=(e,t,n)=>t<<n-32|e>>>64-n;fe.rotlBH=Hu;const Fu=(e,t,n)=>e<<n-32|t>>>64-n;function zu(e,t,n,r){const i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:0|i}}fe.rotlBL=Fu;const qu=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);fe.add3L=qu;const Wu=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;fe.add3H=Wu;const Vu=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);fe.add4L=Vu;const Gu=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0;fe.add4H=Gu;const Yu=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0);fe.add5L=Yu;const Zu=(e,t,n,r,i,o)=>t+n+r+i+o+(e/2**32|0)|0;fe.add5H=Zu;const g0={fromBig:ea,split:Iu,toBig:Pu,shrSH:Ru,shrSL:Ou,rotrSH:Lu,rotrSL:Nu,rotrBH:Du,rotrBL:$u,rotr32H:Bu,rotr32L:Ku,rotlSH:ju,rotlSL:Uu,rotlBH:Hu,rotlBL:Fu,add:zu,add3L:qu,add3H:Wu,add4L:Vu,add4H:Gu,add5H:Zu,add5L:Yu};fe.default=g0,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.sha384=Oe.sha512_256=Oe.sha512_224=Oe.sha512=Oe.SHA384=Oe.SHA512_256=Oe.SHA512_224=Oe.SHA512=void 0;const y0=zt,he=fe,Qr=Yt,[v0,b0]=he.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Zt=new Uint32Array(80),Jt=new Uint32Array(80);class Ur extends y0.HashMD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:r,Bl:i,Ch:o,Cl:c,Dh:s,Dl:a,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:g,Hh:m,Hl:w}=this;return[t,n,r,i,o,c,s,a,l,u,d,f,h,g,m,w]}set(t,n,r,i,o,c,s,a,l,u,d,f,h,g,m,w){this.Ah=0|t,this.Al=0|n,this.Bh=0|r,this.Bl=0|i,this.Ch=0|o,this.Cl=0|c,this.Dh=0|s,this.Dl=0|a,this.Eh=0|l,this.El=0|u,this.Fh=0|d,this.Fl=0|f,this.Gh=0|h,this.Gl=0|g,this.Hh=0|m,this.Hl=0|w}process(t,n){for(let _=0;_<16;_++,n+=4)Zt[_]=t.getUint32(n),Jt[_]=t.getUint32(n+=4);for(let _=16;_<80;_++){const P=0|Zt[_-15],O=0|Jt[_-15],K=he.default.rotrSH(P,O,1)^he.default.rotrSH(P,O,8)^he.default.shrSH(P,O,7),q=he.default.rotrSL(P,O,1)^he.default.rotrSL(P,O,8)^he.default.shrSL(P,O,7),F=0|Zt[_-2],U=0|Jt[_-2],j=he.default.rotrSH(F,U,19)^he.default.rotrBH(F,U,61)^he.default.shrSH(F,U,6),G=he.default.rotrSL(F,U,19)^he.default.rotrBL(F,U,61)^he.default.shrSL(F,U,6),B=he.default.add4L(q,G,Jt[_-7],Jt[_-16]),N=he.default.add4H(B,K,j,Zt[_-7],Zt[_-16]);Zt[_]=0|N,Jt[_]=0|B}let{Ah:r,Al:i,Bh:o,Bl:c,Ch:s,Cl:a,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:g,Gh:m,Gl:w,Hh:p,Hl:S}=this;for(let _=0;_<80;_++){const P=he.default.rotrSH(d,f,14)^he.default.rotrSH(d,f,18)^he.default.rotrBH(d,f,41),O=he.default.rotrSL(d,f,14)^he.default.rotrSL(d,f,18)^he.default.rotrBL(d,f,41),K=d&h^~d&m,q=f&g^~f&w,F=he.default.add5L(S,O,q,b0[_],Jt[_]),U=he.default.add5H(F,p,P,K,v0[_],Zt[_]),j=0|F,G=he.default.rotrSH(r,i,28)^he.default.rotrBH(r,i,34)^he.default.rotrBH(r,i,39),B=he.default.rotrSL(r,i,28)^he.default.rotrBL(r,i,34)^he.default.rotrBL(r,i,39),N=r&o^r&s^o&s,I=i&c^i&a^c&a;p=0|m,S=0|w,m=0|h,w=0|g,h=0|d,g=0|f,{h:d,l:f}=he.default.add(0|l,0|u,0|U,0|j),l=0|s,u=0|a,s=0|o,a=0|c,o=0|r,c=0|i;const C=he.default.add3L(j,B,I);r=he.default.add3H(C,U,G,N),i=0|C}({h:r,l:i}=he.default.add(0|this.Ah,0|this.Al,0|r,0|i)),{h:o,l:c}=he.default.add(0|this.Bh,0|this.Bl,0|o,0|c),{h:s,l:a}=he.default.add(0|this.Ch,0|this.Cl,0|s,0|a),{h:l,l:u}=he.default.add(0|this.Dh,0|this.Dl,0|l,0|u),{h:d,l:f}=he.default.add(0|this.Eh,0|this.El,0|d,0|f),{h,l:g}=he.default.add(0|this.Fh,0|this.Fl,0|h,0|g),{h:m,l:w}=he.default.add(0|this.Gh,0|this.Gl,0|m,0|w),{h:p,l:S}=he.default.add(0|this.Hh,0|this.Hl,0|p,0|S),this.set(r,i,o,c,s,a,l,u,d,f,h,g,m,w,p,S)}roundClean(){Zt.fill(0),Jt.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Oe.SHA512=Ur;class Ju extends Ur{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}Oe.SHA512_224=Ju;class Xu extends Ur{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}Oe.SHA512_256=Xu;class za extends Ur{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}Oe.SHA384=za,Oe.sha512=(0,Qr.wrapConstructor)(()=>new Ur),Oe.sha512_224=(0,Qr.wrapConstructor)(()=>new Ju),Oe.sha512_256=(0,Qr.wrapConstructor)(()=>new Xu),Oe.sha384=(0,Qr.wrapConstructor)(()=>new za);var gs={},Hn={},Se={},pe={};Object.defineProperty(pe,"__esModule",{value:!0}),pe.notImplemented=pe.bitMask=void 0,pe.isBytes=$i,pe.abytes=Bi,pe.abool=function(e,t){if(typeof t!="boolean")throw new Error(`${e} must be valid boolean, got "${t}".`)},pe.bytesToHex=Ao,pe.numberToHexUnpadded=qa,pe.hexToNumber=ko,pe.hexToBytes=gi,pe.bytesToNumberBE=function(e){return ko(Ao(e))},pe.bytesToNumberLE=function(e){return Bi(e),ko(Ao(Uint8Array.from(e).reverse()))},pe.numberToBytesBE=Va,pe.numberToBytesLE=function(e,t){return Va(e,t).reverse()},pe.numberToVarBytesBE=function(e){return gi(qa(e))},pe.ensureBytes=function(e,t,n){let r;if(typeof t=="string")try{r=gi(t)}catch(o){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${o}`)}else{if(!$i(t))throw new Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(t)}const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${e} expected ${n} bytes, got ${i}`);return r},pe.concatBytes=Ga,pe.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0},pe.utf8ToBytes=function(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))},pe.inRange=Ya,pe.aInRange=function(e,t,n,r){if(!Ya(t,n,r))throw new Error(`expected valid ${e}: ${n} <= n < ${r}, got ${typeof t} ${t}`)},pe.bitLen=function(e){let t;for(t=0;e>ys;e>>=mi,t+=1);return t},pe.bitGet=function(e,t){return e>>BigInt(t)&mi},pe.bitSet=function(e,t,n){return e|(n?mi:ys)<<BigInt(t)},pe.createHmacDrbg=function(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Mo(e),i=Mo(e),o=0;const c=()=>{r.fill(1),i.fill(0),o=0},s=(...u)=>n(i,r,...u),a=(u=Mo())=>{i=s(Za([0]),u),r=s(),u.length!==0&&(i=s(Za([1]),u),r=s())},l=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let u=0;const d=[];for(;u<t;){r=s();const f=r.slice();d.push(f),u+=r.length}return Ga(...d)};return(u,d)=>{let f;for(c(),a(u);!(f=d(l()));)a();return c(),f}},pe.validateObject=function(e,t,n={}){const r=(i,o,c)=>{const s=_0[o];if(typeof s!="function")throw new Error(`Invalid validator "${o}", expected function`);const a=e[i];if(!(c&&a===void 0||s(a,e)))throw new Error(`Invalid param ${String(i)}=${a} (${typeof a}), expected ${o}`)};for(const[i,o]of Object.entries(t))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return e},pe.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(i!==void 0)return i;const o=e(n,...r);return t.set(n,o),o}};const ys=BigInt(0),mi=BigInt(1),w0=BigInt(2);function $i(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function Bi(e){if(!$i(e))throw new Error("Uint8Array expected")}const E0=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ao(e){Bi(e);let t="";for(let n=0;n<e.length;n++)t+=E0[e[n]];return t}function qa(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function ko(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}const $t={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Wa(e){return e>=$t._0&&e<=$t._9?e-$t._0:e>=$t._A&&e<=$t._F?e-($t._A-10):e>=$t._a&&e<=$t._f?e-($t._a-10):void 0}function gi(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let i=0,o=0;i<n;i++,o+=2){const c=Wa(e.charCodeAt(o)),s=Wa(e.charCodeAt(o+1));if(c===void 0||s===void 0){const a=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+o)}r[i]=16*c+s}return r}function Va(e,t){return gi(e.toString(16).padStart(2*t,"0"))}function Ga(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];Bi(i),t+=i.length}const n=new Uint8Array(t);for(let r=0,i=0;r<e.length;r++){const o=e[r];n.set(o,i),i+=o.length}return n}const xo=e=>typeof e=="bigint"&&ys<=e;function Ya(e,t,n){return xo(e)&&xo(t)&&xo(n)&&t<=e&&e<n}pe.bitMask=e=>(w0<<BigInt(e-1))-mi;const Mo=e=>new Uint8Array(e),Za=e=>Uint8Array.from(e),_0={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||$i(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};pe.notImplemented=()=>{throw new Error("not implemented")},Object.defineProperty(Se,"__esModule",{value:!0}),Se.isNegativeLE=void 0,Se.mod=rt,Se.pow=Qu,Se.pow2=function(e,t,n){let r=e;for(;t-- >Le;)r*=r,r%=n;return r},Se.invert=ei,Se.tonelliShanks=ed,Se.FpSqrt=Qa,Se.validateField=function(e){const t=C0.reduce((n,r)=>(n[r]="function",n),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,tt.validateObject)(e,t)},Se.FpPow=ec,Se.FpInvertBatch=tc,Se.FpDiv=function(e,t,n){return e.mul(t,typeof n=="bigint"?ei(n,e.ORDER):e.inv(n))},Se.FpLegendre=nc,Se.FpIsSquare=function(e){const t=nc(e.ORDER);return n=>{const r=t(e,n);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},Se.nLength=To,Se.Field=function(e,t,n=!1,r={}){if(e<=Le)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=To(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const c=Qa(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,tt.bitMask)(i),ZERO:Le,ONE:Ce,create:a=>rt(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("Invalid field element: expected bigint, got "+typeof a);return Le<=a&&a<e},is0:a=>a===Le,isOdd:a=>(a&Ce)===Ce,neg:a=>rt(-a,e),eql:(a,l)=>a===l,sqr:a=>rt(a*a,e),add:(a,l)=>rt(a+l,e),sub:(a,l)=>rt(a-l,e),mul:(a,l)=>rt(a*l,e),pow:(a,l)=>ec(s,a,l),div:(a,l)=>rt(a*ei(l,e),e),sqrN:a=>a*a,addN:(a,l)=>a+l,subN:(a,l)=>a-l,mulN:(a,l)=>a*l,inv:a=>ei(a,e),sqrt:r.sqrt||(a=>c(s,a)),invertBatch:a=>tc(s,a),cmov:(a,l,u)=>u?l:a,toBytes:a=>n?(0,tt.numberToBytesLE)(a,o):(0,tt.numberToBytesBE)(a,o),fromBytes:a=>{if(a.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${a.length}`);return n?(0,tt.bytesToNumberLE)(a):(0,tt.bytesToNumberBE)(a)}});return Object.freeze(s)},Se.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?n:e.neg(n)},Se.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const n=e.sqrt(t);return e.isOdd(n)?e.neg(n):n},Se.hashToPrivateScalar=function(e,t,n=!1){e=(0,tt.ensureBytes)("privateHash",e);const r=e.length,i=To(t).nByteLength+8;if(i<24||r<i||r>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${r}`);const o=n?(0,tt.bytesToNumberLE)(e):(0,tt.bytesToNumberBE)(e);return rt(o,t-Ce)+Ce},Se.getFieldBytesLength=bs,Se.getMinHashLength=rc,Se.mapHashToField=function(e,t,n=!1){const r=e.length,i=bs(t),o=rc(t);if(r<16||r<o||r>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const c=rt(n?(0,tt.bytesToNumberBE)(e):(0,tt.bytesToNumberLE)(e),t-Ce)+Ce;return n?(0,tt.numberToBytesLE)(c,i):(0,tt.numberToBytesBE)(c,i)};const tt=pe,Le=BigInt(0),Ce=BigInt(1),fn=BigInt(2),S0=BigInt(3),vs=BigInt(4),Ja=BigInt(5),Xa=BigInt(8);function rt(e,t){const n=e%t;return n>=Le?n:t+n}function Qu(e,t,n){if(n<=Le||t<Le)throw new Error("Expected power/modulo > 0");if(n===Ce)return Le;let r=Ce;for(;t>Le;)t&Ce&&(r=r*e%n),e=e*e%n,t>>=Ce;return r}function ei(e,t){if(e===Le||t<=Le)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=rt(e,t),r=t,i=Le,o=Ce;for(;n!==Le;){const c=r%n,s=i-o*(r/n);r=n,n=c,i=o,o=s}if(r!==Ce)throw new Error("invert: does not exist");return rt(i,t)}function ed(e){const t=(e-Ce)/fn;let n,r,i;for(n=e-Ce,r=0;n%fn===Le;n/=fn,r++);for(i=fn;i<e&&Qu(i,t,e)!==e-Ce;i++);if(r===1){const c=(e+Ce)/vs;return function(s,a){const l=s.pow(a,c);if(!s.eql(s.sqr(l),a))throw new Error("Cannot find square root");return l}}const o=(n+Ce)/fn;return function(c,s){if(c.pow(s,t)===c.neg(c.ONE))throw new Error("Cannot find square root");let a=r,l=c.pow(c.mul(c.ONE,i),n),u=c.pow(s,o),d=c.pow(s,n);for(;!c.eql(d,c.ONE);){if(c.eql(d,c.ZERO))return c.ZERO;let f=1;for(let g=c.sqr(d);f<a&&!c.eql(g,c.ONE);f++)g=c.sqr(g);const h=c.pow(l,Ce<<BigInt(a-f-1));l=c.sqr(h),u=c.mul(u,h),d=c.mul(d,l),a=f}return u}}function Qa(e){if(e%vs===S0){const t=(e+Ce)/vs;return function(n,r){const i=n.pow(r,t);if(!n.eql(n.sqr(i),r))throw new Error("Cannot find square root");return i}}if(e%Xa===Ja){const t=(e-Ja)/Xa;return function(n,r){const i=n.mul(r,fn),o=n.pow(i,t),c=n.mul(r,o),s=n.mul(n.mul(c,fn),o),a=n.mul(c,n.sub(s,n.ONE));if(!n.eql(n.sqr(a),r))throw new Error("Cannot find square root");return a}}return ed(e)}BigInt(9),BigInt(16);Se.isNegativeLE=(e,t)=>(rt(e,t)&Ce)===Ce;const C0=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ec(e,t,n){if(n<Le)throw new Error("Expected power > 0");if(n===Le)return e.ONE;if(n===Ce)return t;let r=e.ONE,i=t;for(;n>Le;)n&Ce&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Ce;return r}function tc(e,t){const n=new Array(t.length),r=t.reduce((o,c,s)=>e.is0(c)?o:(n[s]=o,e.mul(o,c)),e.ONE),i=e.inv(r);return t.reduceRight((o,c,s)=>e.is0(c)?o:(n[s]=e.mul(o,n[s]),e.mul(o,c)),i),n}function nc(e){const t=(e-Ce)/fn;return(n,r)=>n.pow(r,t)}function To(e,t){const n=t!==void 0?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function bs(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function rc(e){const t=bs(e);return t+Math.ceil(t/2)}Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.wNAF=function(e,t){const n=(o,c)=>{const s=c.negate();return o?s:c},r=o=>{if(!Number.isSafeInteger(o)||o<=0||o>t)throw new Error(`Wrong window size=${o}, should be [1..${t}]`)},i=o=>(r(o),{windows:Math.ceil(t/o)+1,windowSize:2**(o-1)});return{constTimeNegate:n,unsafeLadder(o,c){let s=e.ZERO,a=o;for(;c>A0;)c&Io&&(s=s.add(a)),a=a.double(),c>>=Io;return s},precomputeWindow(o,c){const{windows:s,windowSize:a}=i(c),l=[];let u=o,d=u;for(let f=0;f<s;f++){d=u,l.push(d);for(let h=1;h<a;h++)d=d.add(u),l.push(d);u=d.double()}return l},wNAF(o,c,s){const{windows:a,windowSize:l}=i(o);let u=e.ZERO,d=e.BASE;const f=BigInt(2**o-1),h=2**o,g=BigInt(o);for(let m=0;m<a;m++){const w=m*l;let p=Number(s&f);s>>=g,p>l&&(p-=h,s+=Io);const S=w,_=w+Math.abs(p)-1,P=m%2!=0,O=p<0;p===0?d=d.add(n(P,c[S])):u=u.add(n(O,c[_]))}return{p:u,f:d}},wNAFCached(o,c,s){const a=sc.get(o)||1;let l=Po.get(o);return l||(l=this.precomputeWindow(o,a),a!==1&&Po.set(o,s(l))),this.wNAF(a,l,c)},setWindowSize(o,c){r(c),sc.set(o,c),Po.delete(o)}}},Hn.pippenger=function(e,t,n,r){if(!Array.isArray(n)||!Array.isArray(r)||r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");r.forEach((u,d)=>{if(!t.isValid(u))throw new Error(`wrong scalar at index ${d}`)}),n.forEach((u,d)=>{if(!(u instanceof e))throw new Error(`wrong point at index ${d}`)});const i=(0,oc.bitLen)(BigInt(n.length)),o=i>12?i-3:i>4?i-2:i?2:1,c=(1<<o)-1,s=new Array(c+1).fill(e.ZERO),a=Math.floor((t.BITS-1)/o)*o;let l=e.ZERO;for(let u=a;u>=0;u-=o){s.fill(e.ZERO);for(let f=0;f<r.length;f++){const h=r[f],g=Number(h>>BigInt(u)&BigInt(c));s[g]=s[g].add(n[f])}let d=e.ZERO;for(let f=s.length-1,h=e.ZERO;f>0;f--)h=h.add(s[f]),d=d.add(h);if(l=l.add(d),u!==0)for(let f=0;f<o;f++)l=l.double()}return l},Hn.validateBasic=function(e){return(0,ic.validateField)(e.Fp),(0,oc.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,ic.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};const ic=Se,oc=pe,A0=BigInt(0),Io=BigInt(1),Po=new WeakMap,sc=new WeakMap;Object.defineProperty(gs,"__esModule",{value:!0}),gs.twistedEdwards=function(e){const t=function(N){const I=(0,Ro.validateBasic)(N);return Je.validateObject(N,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...I})}(e),{Fp:n,n:r,prehash:i,hash:o,randomBytes:c,nByteLength:s,h:a}=t,l=ti<<BigInt(8*s)-Xe,u=n.create,d=(0,ac.Field)(t.n,t.nBitLength),f=t.uvRatio||((N,I)=>{try{return{isValid:!0,value:n.sqrt(N*n.inv(I))}}catch{return{isValid:!1,value:yt}}}),h=t.adjustScalarBytes||(N=>N),g=t.domain||((N,I,C)=>{if((0,nt.abool)("phflag",C),I.length||C)throw new Error("Contexts/pre-hash are not supported");return N});function m(N,I){Je.aInRange("coordinate "+N,I,yt,l)}function w(N){if(!(N instanceof _))throw new Error("ExtendedPoint expected")}const p=(0,nt.memoized)((N,I)=>{const{ex:C,ey:R,ez:D}=N,y=N.is0();I==null&&(I=y?k0:n.inv(D));const E=u(C*I),k=u(R*I),M=u(D*I);if(y)return{x:yt,y:Xe};if(M!==Xe)throw new Error("invZ was invalid");return{x:E,y:k}}),S=(0,nt.memoized)(N=>{const{a:I,d:C}=t;if(N.is0())throw new Error("bad point: ZERO");const{ex:R,ey:D,ez:y,et:E}=N,k=u(R*R),M=u(D*D),b=u(y*y),v=u(b*b),A=u(k*I);if(u(b*u(A+M))!==u(v+u(C*u(k*M))))throw new Error("bad point: equation left != right (1)");if(u(R*D)!==u(y*E))throw new Error("bad point: equation left != right (2)");return!0});class _{constructor(I,C,R,D){this.ex=I,this.ey=C,this.ez=R,this.et=D,m("x",I),m("y",C),m("z",R),m("t",D),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(I){if(I instanceof _)throw new Error("extended point not allowed");const{x:C,y:R}=I||{};return m("x",C),m("y",R),new _(C,R,Xe,u(C*R))}static normalizeZ(I){const C=n.invertBatch(I.map(R=>R.ez));return I.map((R,D)=>R.toAffine(C[D])).map(_.fromAffine)}static msm(I,C){return(0,Ro.pippenger)(_,d,I,C)}_setWindowSize(I){K.setWindowSize(this,I)}assertValidity(){S(this)}equals(I){w(I);const{ex:C,ey:R,ez:D}=this,{ex:y,ey:E,ez:k}=I,M=u(C*k),b=u(y*D),v=u(R*k),A=u(E*D);return M===b&&v===A}is0(){return this.equals(_.ZERO)}negate(){return new _(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:I}=t,{ex:C,ey:R,ez:D}=this,y=u(C*C),E=u(R*R),k=u(ti*u(D*D)),M=u(I*y),b=C+R,v=u(u(b*b)-y-E),A=M+E,x=A-k,T=M-E,L=u(v*x),$=u(A*T),H=u(v*T),z=u(x*A);return new _(L,$,z,H)}add(I){w(I);const{a:C,d:R}=t,{ex:D,ey:y,ez:E,et:k}=this,{ex:M,ey:b,ez:v,et:A}=I;if(C===BigInt(-1)){const ie=u((y-D)*(b+M)),ce=u((y+D)*(b-M)),ae=u(ce-ie);if(ae===yt)return this.double();const ge=u(E*ti*A),we=u(k*ti*v),de=we+ge,me=ce+ie,ye=we-ge,Ie=u(de*ae),ct=u(me*ye),go=u(de*ye),yo=u(ae*me);return new _(Ie,ct,yo,go)}const x=u(D*M),T=u(y*b),L=u(k*R*A),$=u(E*v),H=u((D+y)*(M+b)-x-T),z=$-L,J=$+L,Q=u(T-C*x),ne=u(H*z),se=u(J*Q),le=u(H*Q),re=u(z*J);return new _(ne,se,re,le)}subtract(I){return this.add(I.negate())}wNAF(I){return K.wNAFCached(this,I,_.normalizeZ)}multiply(I){const C=I;Je.aInRange("scalar",C,Xe,r);const{p:R,f:D}=this.wNAF(C);return _.normalizeZ([R,D])[0]}multiplyUnsafe(I){const C=I;return Je.aInRange("scalar",C,yt,r),C===yt?O:this.equals(O)||C===Xe?this:this.equals(P)?this.wNAF(C).p:K.unsafeLadder(this,C)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}isTorsionFree(){return K.unsafeLadder(this,r).is0()}toAffine(I){return p(this,I)}clearCofactor(){const{h:I}=t;return I===Xe?this:this.multiplyUnsafe(I)}static fromHex(I,C=!1){const{d:R,a:D}=t,y=n.BYTES;I=(0,nt.ensureBytes)("pointHex",I,y),(0,nt.abool)("zip215",C);const E=I.slice(),k=I[y-1];E[y-1]=-129&k;const M=Je.bytesToNumberLE(E),b=C?l:n.ORDER;Je.aInRange("pointHex.y",M,yt,b);const v=u(M*M),A=u(v-Xe),x=u(R*v-D);let{isValid:T,value:L}=f(A,x);if(!T)throw new Error("Point.fromHex: invalid y coordinate");const $=(L&Xe)===Xe,H=(128&k)!=0;if(!C&&L===yt&&H)throw new Error("Point.fromHex: x=0 and x_0=1");return H!==$&&(L=u(-L)),_.fromAffine({x:L,y:M})}static fromPrivateKey(I){return U(I).point}toRawBytes(){const{x:I,y:C}=this.toAffine(),R=Je.numberToBytesLE(C,n.BYTES);return R[R.length-1]|=I&Xe?128:0,R}toHex(){return Je.bytesToHex(this.toRawBytes())}}_.BASE=new _(t.Gx,t.Gy,Xe,u(t.Gx*t.Gy)),_.ZERO=new _(yt,Xe,Xe,yt);const{BASE:P,ZERO:O}=_,K=(0,Ro.wNAF)(_,8*s);function q(N){return(0,ac.mod)(N,r)}function F(N){return q(Je.bytesToNumberLE(N))}function U(N){const I=s;N=(0,nt.ensureBytes)("private key",N,I);const C=(0,nt.ensureBytes)("hashed private key",o(N),2*I),R=h(C.slice(0,I)),D=C.slice(I,2*I),y=F(R),E=P.multiply(y),k=E.toRawBytes();return{head:R,prefix:D,scalar:y,point:E,pointBytes:k}}function j(N=new Uint8Array,...I){const C=Je.concatBytes(...I);return F(o(g(C,(0,nt.ensureBytes)("context",N),!!i)))}const G=x0;return P._setWindowSize(8),{CURVE:t,getPublicKey:function(N){return U(N).pointBytes},sign:function(N,I,C={}){N=(0,nt.ensureBytes)("message",N),i&&(N=i(N));const{prefix:R,scalar:D,pointBytes:y}=U(I),E=j(C.context,R,N),k=P.multiply(E).toRawBytes(),M=q(E+j(C.context,k,y,N)*D);Je.aInRange("signature.s",M,yt,r);const b=Je.concatBytes(k,Je.numberToBytesLE(M,n.BYTES));return(0,nt.ensureBytes)("result",b,2*s)},verify:function(N,I,C,R=G){const{context:D,zip215:y}=R,E=n.BYTES;N=(0,nt.ensureBytes)("signature",N,2*E),I=(0,nt.ensureBytes)("message",I),y!==void 0&&(0,nt.abool)("zip215",y),i&&(I=i(I));const k=Je.bytesToNumberLE(N.slice(E,2*E));let M,b,v;try{M=_.fromHex(C,y),b=_.fromHex(N.slice(0,E),y),v=P.multiplyUnsafe(k)}catch{return!1}if(!y&&M.isSmallOrder())return!1;const A=j(D,b.toRawBytes(),M.toRawBytes(),I);return b.add(M.multiplyUnsafe(A)).subtract(v).clearCofactor().equals(_.ZERO)},ExtendedPoint:_,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>c(n.BYTES),precompute:(N=8,I=_.BASE)=>(I._setWindowSize(N),I.multiply(BigInt(3)),I)}}};const Ro=Hn,ac=Se,Je=pe,nt=pe,yt=BigInt(0),Xe=BigInt(1),ti=BigInt(2),k0=BigInt(8),x0={zip215:!0};var sn={};Object.defineProperty(sn,"__esModule",{value:!0}),sn.expand_message_xmd=td,sn.expand_message_xof=nd,sn.hash_to_field=Oo,sn.isogenyMap=function(e,t){const n=t.map(r=>Array.from(r).reverse());return(r,i)=>{const[o,c,s,a]=n.map(l=>l.reduce((u,d)=>e.add(e.mul(u,r),d)));return r=e.div(o,c),i=e.mul(i,e.div(s,a)),{x:r,y:i}}},sn.createHasher=function(e,t,n){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(r,i){const o=Oo(r,2,{...n,DST:n.DST,...i}),c=e.fromAffine(t(o[0])),s=e.fromAffine(t(o[1])),a=c.add(s).clearCofactor();return a.assertValidity(),a},encodeToCurve(r,i){const o=Oo(r,1,{...n,DST:n.encodeDST,...i}),c=e.fromAffine(t(o[0])).clearCofactor();return c.assertValidity(),c},mapToCurve(r){if(!Array.isArray(r))throw new Error("mapToCurve: expected array of bigints");for(const o of r)if(typeof o!="bigint")throw new Error(`mapToCurve: expected array of bigints, got ${o} in array`);const i=e.fromAffine(t(r)).clearCofactor();return i.assertValidity(),i}}};const M0=Se,Ue=pe,T0=Ue.bytesToNumberBE;function an(e,t){if(Ar(e),Ar(t),e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function I0(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function Ar(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function td(e,t,n,r){(0,Ue.abytes)(e),(0,Ue.abytes)(t),Ar(n),t.length>255&&(t=r((0,Ue.concatBytes)((0,Ue.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:i,blockLen:o}=r,c=Math.ceil(n/i);if(n>65535||c>255)throw new Error("expand_message_xmd: invalid lenInBytes");const s=(0,Ue.concatBytes)(t,an(t.length,1)),a=an(0,o),l=an(n,2),u=new Array(c),d=r((0,Ue.concatBytes)(a,e,l,an(0,1),s));u[0]=r((0,Ue.concatBytes)(d,an(1,1),s));for(let f=1;f<=c;f++){const h=[I0(d,u[f-1]),an(f+1,1),s];u[f]=r((0,Ue.concatBytes)(...h))}return(0,Ue.concatBytes)(...u).slice(0,n)}function nd(e,t,n,r,i){if((0,Ue.abytes)(e),(0,Ue.abytes)(t),Ar(n),t.length>255){const o=Math.ceil(2*r/8);t=i.create({dkLen:o}).update((0,Ue.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:n}).update(e).update(an(n,2)).update(t).update(an(t.length,1)).digest()}function Oo(e,t,n){(0,Ue.validateObject)(n,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:r,k:i,m:o,hash:c,expand:s,DST:a}=n;(0,Ue.abytes)(e),Ar(t);const l=typeof a=="string"?(0,Ue.utf8ToBytes)(a):a,u=r.toString(2).length,d=Math.ceil((u+i)/8),f=t*o*d;let h;if(s==="xmd")h=td(e,l,f,c);else if(s==="xof")h=nd(e,l,f,i,c);else{if(s!=="_internal_pass")throw new Error('expand must be "xmd" or "xof"');h=e}const g=new Array(t);for(let m=0;m<t;m++){const w=new Array(o);for(let p=0;p<o;p++){const S=d*(p+m*o),_=h.subarray(S,S+d);w[p]=(0,M0.mod)(T0(_),r)}g[m]=w}return g}var ws={};Object.defineProperty(ws,"__esModule",{value:!0}),ws.montgomery=function(e){const t=function(m){return(0,Xt.validateObject)(m,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...m})}(e),{P:n}=t,r=m=>(0,cc.mod)(m,n),i=t.montgomeryBits,o=Math.ceil(i/8),c=t.nByteLength,s=t.adjustScalarBytes||(m=>m),a=t.powPminus2||(m=>(0,cc.pow)(m,n-BigInt(2),n));function l(m,w,p){const S=r(m*(w-p));return[w=r(w-S),p=r(p+S)]}const u=(t.a-BigInt(2))/BigInt(4);function d(m){return(0,Xt.numberToBytesLE)(r(m),o)}function f(m,w){const p=function(P){const O=(0,Xt.ensureBytes)("u coordinate",P,o);return c===32&&(O[31]&=127),(0,Xt.bytesToNumberLE)(O)}(w),S=function(P){const O=(0,Xt.ensureBytes)("scalar",P),K=O.length;if(K!==o&&K!==c)throw new Error(`Expected ${o} or ${c} bytes, got ${K}`);return(0,Xt.bytesToNumberLE)(s(O))}(m),_=function(P,O){(0,Xt.aInRange)("u",P,Dn,n),(0,Xt.aInRange)("scalar",O,Dn,n);const K=O,q=P;let F,U=Lo,j=Dn,G=P,B=Lo,N=Dn;for(let C=BigInt(i-1);C>=Dn;C--){const R=K>>C&Lo;N^=R,F=l(N,U,G),U=F[0],G=F[1],F=l(N,j,B),j=F[0],B=F[1],N=R;const D=U+j,y=r(D*D),E=U-j,k=r(E*E),M=y-k,b=G+B,v=r((G-B)*D),A=r(b*E),x=v+A,T=v-A;G=r(x*x),B=r(q*r(T*T)),U=r(y*k),j=r(M*(y+r(u*M)))}F=l(N,U,G),U=F[0],G=F[1],F=l(N,j,B),j=F[0],B=F[1];const I=a(j);return r(U*I)}(p,S);if(_===Dn)throw new Error("Invalid private or public key received");return d(_)}const h=d(t.Gu);function g(m){return f(m,h)}return{scalarMult:f,scalarMultBase:g,getSharedSecret:(m,w)=>f(m,w),getPublicKey:m=>g(m),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:h}};const cc=Se,Xt=pe,Dn=BigInt(0),Lo=BigInt(1);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hash_to_ristretto255=e.hashToRistretto255=e.RistrettoPoint=e.encodeToCurve=e.hashToCurve=e.edwardsToMontgomery=e.x25519=e.ed25519ph=e.ed25519ctx=e.ed25519=e.ED25519_TORSION_SUBGROUP=void 0,e.edwardsToMontgomeryPub=K,e.edwardsToMontgomeryPriv=function(A){const x=P.hash(A.subarray(0,32));return P.adjustScalarBytes(x).subarray(0,32)};const t=Oe,n=Yt,r=gs,i=sn,o=Se,c=ws,s=pe,a=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),u=BigInt(0),d=BigInt(1),f=BigInt(2),h=BigInt(3),g=BigInt(5),m=BigInt(8);function w(A){const x=BigInt(10),T=BigInt(20),L=BigInt(40),$=BigInt(80),H=a,z=A*A%H*A%H,J=(0,o.pow2)(z,f,H)*z%H,Q=(0,o.pow2)(J,d,H)*A%H,ne=(0,o.pow2)(Q,g,H)*Q%H,se=(0,o.pow2)(ne,x,H)*ne%H,le=(0,o.pow2)(se,T,H)*se%H,re=(0,o.pow2)(le,L,H)*le%H,ie=(0,o.pow2)(re,$,H)*re%H,ce=(0,o.pow2)(ie,$,H)*re%H,ae=(0,o.pow2)(ce,x,H)*ne%H;return{pow_p_5_8:(0,o.pow2)(ae,f,H)*A%H,b2:z}}function p(A){return A[0]&=248,A[31]&=127,A[31]|=64,A}function S(A,x){const T=a,L=(0,o.mod)(x*x*x,T),$=w(A*(0,o.mod)(L*L*x,T)).pow_p_5_8;let H=(0,o.mod)(A*L*$,T);const z=(0,o.mod)(x*H*H,T),J=H,Q=(0,o.mod)(H*l,T),ne=z===A,se=z===(0,o.mod)(-A,T),le=z===(0,o.mod)(-A*l,T);return ne&&(H=J),(se||le)&&(H=Q),(0,o.isNegativeLE)(H,T)&&(H=(0,o.mod)(-H,T)),{isValid:ne||se,value:H}}e.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const _=(0,o.Field)(a,void 0,!0),P={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:_,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:m,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:t.sha512,randomBytes:n.randomBytes,adjustScalarBytes:p,uvRatio:S};function O(A,x,T){if(x.length>255)throw new Error("Context is too big");return(0,n.concatBytes)((0,n.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([T?1:0,x.length]),x,A)}function K(A){const{y:x}=e.ed25519.ExtendedPoint.fromHex(A),T=BigInt(1);return _.toBytes(_.create((T+x)*_.inv(T-x)))}e.ed25519=(0,r.twistedEdwards)(P),e.ed25519ctx=(0,r.twistedEdwards)({...P,domain:O}),e.ed25519ph=(0,r.twistedEdwards)(Object.assign({},P,{domain:O,prehash:t.sha512})),e.x25519=(0,c.montgomery)({P:a,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:A=>{const x=a,{pow_p_5_8:T,b2:L}=w(A);return(0,o.mod)((0,o.pow2)(T,h,x)*L,x)},adjustScalarBytes:p,randomBytes:n.randomBytes}),e.edwardsToMontgomery=K;const q=(_.ORDER+h)/m,F=_.pow(f,q),U=_.sqrt(_.neg(_.ONE)),j=(0,o.FpSqrtEven)(_,_.neg(BigInt(486664)));function G(A){const{xMn:x,xMd:T,yMn:L,yMd:$}=function(re){const ie=(_.ORDER-g)/m,ce=BigInt(486662);let ae=_.sqr(re);ae=_.mul(ae,f);let ge=_.add(ae,_.ONE),we=_.neg(ce),de=_.sqr(ge),me=_.mul(de,ge),ye=_.mul(ae,ce);ye=_.mul(ye,we),ye=_.add(ye,de),ye=_.mul(ye,we);let Ie=_.sqr(me);de=_.sqr(Ie),Ie=_.mul(Ie,me),Ie=_.mul(Ie,ye),de=_.mul(de,Ie);let ct=_.pow(de,ie);ct=_.mul(ct,Ie);let go=_.mul(ct,U);de=_.sqr(ct),de=_.mul(de,me);let yo=_.eql(de,ye),La=_.cmov(go,ct,yo),th=_.mul(we,ae),or=_.mul(ct,re);or=_.mul(or,F);let nh=_.mul(or,U),rh=_.mul(ye,ae);de=_.sqr(or),de=_.mul(de,me);let ih=_.eql(de,rh),oh=_.cmov(nh,or,ih);de=_.sqr(La),de=_.mul(de,me);let vo=_.eql(de,ye),sh=_.cmov(th,we,vo),sr=_.cmov(oh,La,vo),ah=_.isOdd(sr);return sr=_.cmov(sr,_.neg(sr),vo!==ah),{xMn:sh,xMd:ge,yMn:sr,yMd:d}}(A);let H=_.mul(x,$);H=_.mul(H,j);let z=_.mul(T,L),J=_.sub(x,T),Q=_.add(x,T),ne=_.mul(z,Q),se=_.eql(ne,_.ZERO);H=_.cmov(H,_.ZERO,se),z=_.cmov(z,_.ONE,se),J=_.cmov(J,_.ONE,se),Q=_.cmov(Q,_.ONE,se);const le=_.invertBatch([z,Q]);return{x:_.mul(H,le[0]),y:_.mul(J,le[1])}}const B=(0,i.createHasher)(e.ed25519.ExtendedPoint,A=>G(A[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:_.ORDER,m:1,k:128,expand:"xmd",hash:t.sha512});function N(A){if(!(A instanceof v))throw new Error("RistrettoPoint expected")}e.hashToCurve=B.hashToCurve,e.encodeToCurve=B.encodeToCurve;const I=l,C=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),R=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),D=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),y=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),E=A=>S(d,A),k=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),M=A=>e.ed25519.CURVE.Fp.create((0,s.bytesToNumberLE)(A)&k);function b(A){const{d:x}=e.ed25519.CURVE,T=e.ed25519.CURVE.Fp.ORDER,L=e.ed25519.CURVE.Fp.create,$=L(I*A*A),H=L(($+d)*D);let z=BigInt(-1);const J=L((z-x*$)*L($+x));let{isValid:Q,value:ne}=S(H,J),se=L(ne*A);(0,o.isNegativeLE)(se,T)||(se=L(-se)),Q||(ne=se),Q||(z=$);const le=L(z*($-d)*y-J),re=ne*ne,ie=L((ne+ne)*J),ce=L(le*C),ae=L(d-re),ge=L(d+re);return new e.ed25519.ExtendedPoint(L(ie*ge),L(ae*ce),L(ce*ge),L(ie*ae))}class v{constructor(x){this.ep=x}static fromAffine(x){return new v(e.ed25519.ExtendedPoint.fromAffine(x))}static hashToCurve(x){x=(0,s.ensureBytes)("ristrettoHash",x,64);const T=b(M(x.slice(0,32))),L=b(M(x.slice(32,64)));return new v(T.add(L))}static fromHex(x){x=(0,s.ensureBytes)("ristrettoHex",x,32);const{a:T,d:L}=e.ed25519.CURVE,$=e.ed25519.CURVE.Fp.ORDER,H=e.ed25519.CURVE.Fp.create,z="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",J=M(x);if(!(0,s.equalBytes)((0,s.numberToBytesLE)(J,32),x)||(0,o.isNegativeLE)(J,$))throw new Error(z);const Q=H(J*J),ne=H(d+T*Q),se=H(d-T*Q),le=H(ne*ne),re=H(se*se),ie=H(T*L*le-re),{isValid:ce,value:ae}=E(H(ie*re)),ge=H(ae*se),we=H(ae*ge*ie);let de=H((J+J)*ge);(0,o.isNegativeLE)(de,$)&&(de=H(-de));const me=H(ne*we),ye=H(de*me);if(!ce||(0,o.isNegativeLE)(ye,$)||me===u)throw new Error(z);return new v(new e.ed25519.ExtendedPoint(de,me,d,ye))}toRawBytes(){let{ex:x,ey:T,ez:L,et:$}=this.ep;const H=e.ed25519.CURVE.Fp.ORDER,z=e.ed25519.CURVE.Fp.create,J=z(z(L+T)*z(L-T)),Q=z(x*T),ne=z(Q*Q),{value:se}=E(z(J*ne)),le=z(se*J),re=z(se*Q),ie=z(le*re*$);let ce;if((0,o.isNegativeLE)($*ie,H)){let ge=z(T*I),we=z(x*I);x=ge,T=we,ce=z(le*R)}else ce=re;(0,o.isNegativeLE)(x*ie,H)&&(T=z(-T));let ae=z((L-T)*ce);return(0,o.isNegativeLE)(ae,H)&&(ae=z(-ae)),(0,s.numberToBytesLE)(ae,32)}toHex(){return(0,s.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(x){N(x);const{ex:T,ey:L}=this.ep,{ex:$,ey:H}=x.ep,z=e.ed25519.CURVE.Fp.create,J=z(T*H)===z(L*$),Q=z(L*H)===z(T*$);return J||Q}add(x){return N(x),new v(this.ep.add(x.ep))}subtract(x){return N(x),new v(this.ep.subtract(x.ep))}multiply(x){return new v(this.ep.multiply(x))}multiplyUnsafe(x){return new v(this.ep.multiplyUnsafe(x))}double(){return new v(this.ep.double())}negate(){return new v(this.ep.negate())}}e.RistrettoPoint=(v.BASE||(v.BASE=new v(e.ed25519.ExtendedPoint.BASE)),v.ZERO||(v.ZERO=new v(e.ed25519.ExtendedPoint.ZERO)),v),e.hashToRistretto255=(A,x)=>{const T=x.DST,L=typeof T=="string"?(0,n.utf8ToBytes)(T):T,$=(0,i.expand_message_xmd)(A,L,64,t.sha512);return v.hashToCurve($)},e.hash_to_ristretto255=e.hashToRistretto255})(Cu);var rd={},qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.sha224=qt.sha256=qt.SHA256=void 0;const No=zt,dt=Yt,P0=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]),Qt=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),en=new Uint32Array(64);class ta extends No.HashMD{constructor(){super(64,32,8,!1),this.A=0|Qt[0],this.B=0|Qt[1],this.C=0|Qt[2],this.D=0|Qt[3],this.E=0|Qt[4],this.F=0|Qt[5],this.G=0|Qt[6],this.H=0|Qt[7]}get(){const{A:t,B:n,C:r,D:i,E:o,F:c,G:s,H:a}=this;return[t,n,r,i,o,c,s,a]}set(t,n,r,i,o,c,s,a){this.A=0|t,this.B=0|n,this.C=0|r,this.D=0|i,this.E=0|o,this.F=0|c,this.G=0|s,this.H=0|a}process(t,n){for(let d=0;d<16;d++,n+=4)en[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const f=en[d-15],h=en[d-2],g=(0,dt.rotr)(f,7)^(0,dt.rotr)(f,18)^f>>>3,m=(0,dt.rotr)(h,17)^(0,dt.rotr)(h,19)^h>>>10;en[d]=m+en[d-7]+g+en[d-16]|0}let{A:r,B:i,C:o,D:c,E:s,F:a,G:l,H:u}=this;for(let d=0;d<64;d++){const f=u+((0,dt.rotr)(s,6)^(0,dt.rotr)(s,11)^(0,dt.rotr)(s,25))+(0,No.Chi)(s,a,l)+P0[d]+en[d]|0,h=((0,dt.rotr)(r,2)^(0,dt.rotr)(r,13)^(0,dt.rotr)(r,22))+(0,No.Maj)(r,i,o)|0;u=l,l=a,a=s,s=c+f|0,c=o,o=i,i=r,r=f+h|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,c=c+this.D|0,s=s+this.E|0,a=a+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(r,i,o,c,s,a,l,u)}roundClean(){en.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}qt.SHA256=ta;class R0 extends ta{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}qt.sha256=(0,dt.wrapConstructor)(()=>new ta),qt.sha224=(0,dt.wrapConstructor)(()=>new R0);var yi={},na={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const t=ot,n=Yt;class r extends n.Hash{constructor(o,c){super(),this.finished=!1,this.destroyed=!1,(0,t.hash)(o);const s=(0,n.toBytes)(c);if(this.iHash=o.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 a=this.blockLen,l=new Uint8Array(a);l.set(s.length>a?o.create().update(s).digest():s);for(let u=0;u<l.length;u++)l[u]^=54;this.iHash.update(l),this.oHash=o.create();for(let u=0;u<l.length;u++)l[u]^=106;this.oHash.update(l),l.fill(0)}update(o){return(0,t.exists)(this),this.iHash.update(o),this}digestInto(o){(0,t.exists)(this),(0,t.bytes)(o,this.outputLen),this.finished=!0,this.iHash.digestInto(o),this.oHash.update(o),this.oHash.digestInto(o),this.destroy()}digest(){const o=new Uint8Array(this.oHash.outputLen);return this.digestInto(o),o}_cloneInto(o){o||(o=Object.create(Object.getPrototypeOf(this),{}));const{oHash:c,iHash:s,finished:a,destroyed:l,blockLen:u,outputLen:d}=this;return o.finished=a,o.destroyed=l,o.blockLen=u,o.outputLen=d,o.oHash=c._cloneInto(o.oHash),o.iHash=s._cloneInto(o.iHash),o}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=r,e.hmac=(i,o,c)=>new r(i,o).update(c).digest(),e.hmac.create=(i,o)=>new r(i,o)})(na);var ra={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=void 0,e.weierstrassPoints=h,e.weierstrass=function(m){const w=function(A){const x=(0,t.validateBasic)(A);return r.validateObject(x,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...x})}(m),{Fp:p,n:S}=w,_=p.BYTES+1,P=2*p.BYTES+1;function O(A){return n.mod(A,S)}function K(A){return n.invert(A,S)}const{ProjectivePoint:q,normPrivateKeyToScalar:F,weierstrassEquation:U,isWithinCurveOrder:j}=h({...w,toBytes(A,x,T){const L=x.toAffine(),$=p.toBytes(L.x),H=r.concatBytes;return(0,i.abool)("isCompressed",T),T?H(Uint8Array.from([x.hasEvenY()?2:3]),$):H(Uint8Array.from([4]),$,p.toBytes(L.y))},fromBytes(A){const x=A.length,T=A[0],L=A.subarray(1);if(x!==_||T!==2&&T!==3){if(x===P&&T===4)return{x:p.fromBytes(L.subarray(0,p.BYTES)),y:p.fromBytes(L.subarray(p.BYTES,2*p.BYTES))};throw new Error(`Point of length ${x} was invalid. Expected ${_} compressed bytes or ${P} uncompressed bytes`)}{const $=r.bytesToNumberBE(L);if(!r.inRange($,l,p.ORDER))throw new Error("Point is not on curve");const H=U($);let z;try{z=p.sqrt(H)}catch(J){const Q=J instanceof Error?": "+J.message:"";throw new Error("Point is not on curve"+Q)}return(1&T)==1!=((z&l)===l)&&(z=p.neg(z)),{x:$,y:z}}}}),G=A=>r.bytesToHex(r.numberToBytesBE(A,w.nByteLength));function B(A){return A>S>>l}const N=(A,x,T)=>r.bytesToNumberBE(A.slice(x,T));class I{constructor(x,T,L){this.r=x,this.s=T,this.recovery=L,this.assertValidity()}static fromCompact(x){const T=w.nByteLength;return x=(0,i.ensureBytes)("compactSignature",x,2*T),new I(N(x,0,T),N(x,T,2*T))}static fromDER(x){const{r:T,s:L}=e.DER.toSig((0,i.ensureBytes)("DER",x));return new I(T,L)}assertValidity(){r.aInRange("r",this.r,l,S),r.aInRange("s",this.s,l,S)}addRecoveryBit(x){return new I(this.r,this.s,x)}recoverPublicKey(x){const{r:T,s:L,recovery:$}=this,H=y((0,i.ensureBytes)("msgHash",x));if($==null||![0,1,2,3].includes($))throw new Error("recovery id invalid");const z=$===2||$===3?T+w.n:T;if(z>=p.ORDER)throw new Error("recovery id 2 or 3 invalid");const J=1&$?"03":"02",Q=q.fromHex(J+G(z)),ne=K(z),se=O(-H*ne),le=O(L*ne),re=q.BASE.multiplyAndAddUnsafe(Q,se,le);if(!re)throw new Error("point at infinify");return re.assertValidity(),re}hasHighS(){return B(this.s)}normalizeS(){return this.hasHighS()?new I(this.r,O(-this.s),this.recovery):this}toDERRawBytes(){return r.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return r.hexToBytes(this.toCompactHex())}toCompactHex(){return G(this.r)+G(this.s)}}const C={isValidPrivateKey(A){try{return F(A),!0}catch{return!1}},normPrivateKeyToScalar:F,randomPrivateKey:()=>{const A=n.getMinHashLength(w.n);return n.mapHashToField(w.randomBytes(A),w.n)},precompute:(A=8,x=q.BASE)=>(x._setWindowSize(A),x.multiply(BigInt(3)),x)};function R(A){const x=r.isBytes(A),T=typeof A=="string",L=(x||T)&&A.length;return x?L===_||L===P:T?L===2*_||L===2*P:A instanceof q}const D=w.bits2int||function(A){const x=r.bytesToNumberBE(A),T=8*A.length-w.nBitLength;return T>0?x>>BigInt(T):x},y=w.bits2int_modN||function(A){return O(D(A))},E=r.bitMask(w.nBitLength);function k(A){return r.aInRange(`num < 2^${w.nBitLength}`,A,a,E),r.numberToBytesBE(A,w.nByteLength)}function M(A,x,T=b){if(["recovered","canonical"].some(ie=>ie in T))throw new Error("sign() legacy options not supported");const{hash:L,randomBytes:$}=w;let{lowS:H,prehash:z,extraEntropy:J}=T;H==null&&(H=!0),A=(0,i.ensureBytes)("msgHash",A),o(T),z&&(A=(0,i.ensureBytes)("prehashed msgHash",L(A)));const Q=y(A),ne=F(x),se=[k(ne),k(Q)];if(J!=null&&J!==!1){const ie=J===!0?$(p.BYTES):J;se.push((0,i.ensureBytes)("extraEntropy",ie))}const le=r.concatBytes(...se),re=Q;return{seed:le,k2sig:function(ie){const ce=D(ie);if(!j(ce))return;const ae=K(ce),ge=q.BASE.multiply(ce).toAffine(),we=O(ge.x);if(we===a)return;const de=O(ae*O(re+we*ne));if(de===a)return;let me=(ge.x===we?0:2)|Number(ge.y&l),ye=de;return H&&B(de)&&(ye=function(Ie){return B(Ie)?O(-Ie):Ie}(de),me^=1),new I(we,ye,me)}}}const b={lowS:w.lowS,prehash:!1},v={lowS:w.lowS,prehash:!1};return q.BASE._setWindowSize(8),{CURVE:w,getPublicKey:function(A,x=!0){return q.fromPrivateKey(A).toRawBytes(x)},getSharedSecret:function(A,x,T=!0){if(R(A))throw new Error("first arg must be private key");if(!R(x))throw new Error("second arg must be public key");return q.fromHex(x).multiply(F(A)).toRawBytes(T)},sign:function(A,x,T=b){const{seed:L,k2sig:$}=M(A,x,T),H=w;return r.createHmacDrbg(H.hash.outputLen,H.nByteLength,H.hmac)(L,$)},verify:function(A,x,T,L=v){var we;const $=A;if(x=(0,i.ensureBytes)("msgHash",x),T=(0,i.ensureBytes)("publicKey",T),"strict"in L)throw new Error("options.strict was renamed to lowS");o(L);const{lowS:H,prehash:z}=L;let J,Q;try{if(typeof $=="string"||r.isBytes($))try{J=I.fromDER($)}catch(de){if(!(de instanceof e.DER.Err))throw de;J=I.fromCompact($)}else{if(typeof $!="object"||typeof $.r!="bigint"||typeof $.s!="bigint")throw new Error("PARSE");{const{r:de,s:me}=$;J=new I(de,me)}}Q=q.fromHex(T)}catch(de){if(de.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(H&&J.hasHighS())return!1;z&&(x=w.hash(x));const{r:ne,s:se}=J,le=y(x),re=K(se),ie=O(le*re),ce=O(ne*re),ae=(we=q.BASE.multiplyAndAddUnsafe(Q,ie,ce))==null?void 0:we.toAffine();return ae?O(ae.x)===ne:!1},ProjectivePoint:q,Signature:I,utils:C}},e.SWUFpSqrtRatio=g,e.mapToCurveSimpleSWU=function(m,w){if(n.validateField(m),!m.isValid(w.A)||!m.isValid(w.B)||!m.isValid(w.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const p=g(m,w.Z);if(!m.isOdd)throw new Error("Fp.isOdd is not implemented!");return S=>{let _,P,O,K,q,F,U,j;_=m.sqr(S),_=m.mul(_,w.Z),P=m.sqr(_),P=m.add(P,_),O=m.add(P,m.ONE),O=m.mul(O,w.B),K=m.cmov(w.Z,m.neg(P),!m.eql(P,m.ZERO)),K=m.mul(K,w.A),P=m.sqr(O),F=m.sqr(K),q=m.mul(F,w.A),P=m.add(P,q),P=m.mul(P,O),F=m.mul(F,K),q=m.mul(F,w.B),P=m.add(P,q),U=m.mul(_,O);const{isValid:G,value:B}=p(P,F);j=m.mul(_,S),j=m.mul(j,B),U=m.cmov(U,O,G),j=m.cmov(j,B,G);const N=m.isOdd(S)===m.isOdd(j);return j=m.cmov(m.neg(j),j,N),U=m.div(U,K),{x:U,y:j}}};const t=Hn,n=Se,r=pe,i=pe;function o(m){m.lowS!==void 0&&(0,i.abool)("lowS",m.lowS),m.prehash!==void 0&&(0,i.abool)("prehash",m.prehash)}const{bytesToNumberBE:c,hexToBytes:s}=r;e.DER={Err:class extends Error{constructor(m=""){super(m)}},_tlv:{encode:(m,w)=>{const{Err:p}=e.DER;if(m<0||m>256)throw new p("tlv.encode: wrong tag");if(1&w.length)throw new p("tlv.encode: unpadded data");const S=w.length/2,_=r.numberToHexUnpadded(S);if(_.length/2&128)throw new p("tlv.encode: long form length too big");const P=S>127?r.numberToHexUnpadded(_.length/2|128):"";return`${r.numberToHexUnpadded(m)}${P}${_}${w}`},decode(m,w){const{Err:p}=e.DER;let S=0;if(m<0||m>256)throw new p("tlv.encode: wrong tag");if(w.length<2||w[S++]!==m)throw new p("tlv.decode: wrong tlv");const _=w[S++];let P=0;if(128&_){const K=127&_;if(!K)throw new p("tlv.decode(long): indefinite length not supported");if(K>4)throw new p("tlv.decode(long): byte length is too big");const q=w.subarray(S,S+K);if(q.length!==K)throw new p("tlv.decode: length bytes not complete");if(q[0]===0)throw new p("tlv.decode(long): zero leftmost byte");for(const F of q)P=P<<8|F;if(S+=K,P<128)throw new p("tlv.decode(long): not minimal encoding")}else P=_;const O=w.subarray(S,S+P);if(O.length!==P)throw new p("tlv.decode: wrong value length");return{v:O,l:w.subarray(S+P)}}},_int:{encode(m){const{Err:w}=e.DER;if(m<a)throw new w("integer: negative integers are not allowed");let p=r.numberToHexUnpadded(m);if(8&Number.parseInt(p[0],16)&&(p="00"+p),1&p.length)throw new w("unexpected assertion");return p},decode(m){const{Err:w}=e.DER;if(128&m[0])throw new w("Invalid signature integer: negative");if(m[0]===0&&!(128&m[1]))throw new w("Invalid signature integer: unnecessary leading zero");return c(m)}},toSig(m){const{Err:w,_int:p,_tlv:S}=e.DER,_=typeof m=="string"?s(m):m;r.abytes(_);const{v:P,l:O}=S.decode(48,_);if(O.length)throw new w("Invalid signature: left bytes after parsing");const{v:K,l:q}=S.decode(2,P),{v:F,l:U}=S.decode(2,q);if(U.length)throw new w("Invalid signature: left bytes after parsing");return{r:p.decode(K),s:p.decode(F)}},hexFromSig(m){const{_tlv:w,_int:p}=e.DER,S=`${w.encode(2,p.encode(m.r))}${w.encode(2,p.encode(m.s))}`;return w.encode(48,S)}};const a=BigInt(0),l=BigInt(1),u=BigInt(2),d=BigInt(3),f=BigInt(4);function h(m){const w=function(N){const I=(0,t.validateBasic)(N);r.validateObject(I,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:C,Fp:R,a:D}=I;if(C){if(!R.eql(D,R.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof C!="object"||typeof C.beta!="bigint"||typeof C.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...I})}(m),{Fp:p}=w,S=n.Field(w.n,w.nBitLength),_=w.toBytes||((N,I,C)=>{const R=I.toAffine();return r.concatBytes(Uint8Array.from([4]),p.toBytes(R.x),p.toBytes(R.y))}),P=w.fromBytes||(N=>{const I=N.subarray(1);return{x:p.fromBytes(I.subarray(0,p.BYTES)),y:p.fromBytes(I.subarray(p.BYTES,2*p.BYTES))}});function O(N){const{a:I,b:C}=w,R=p.sqr(N),D=p.mul(R,N);return p.add(p.add(D,p.mul(N,I)),C)}if(!p.eql(p.sqr(w.Gy),O(w.Gx)))throw new Error("bad generator point: equation left != right");function K(N){const{allowedPrivateKeyLengths:I,nByteLength:C,wrapPrivateKey:R,n:D}=w;if(I&&typeof N!="bigint"){if(r.isBytes(N)&&(N=r.bytesToHex(N)),typeof N!="string"||!I.includes(N.length))throw new Error("Invalid key");N=N.padStart(2*C,"0")}let y;try{y=typeof N=="bigint"?N:r.bytesToNumberBE((0,i.ensureBytes)("private key",N,C))}catch{throw new Error(`private key must be ${C} bytes, hex or bigint, not ${typeof N}`)}return R&&(y=n.mod(y,D)),r.aInRange("private key",y,l,D),y}function q(N){if(!(N instanceof j))throw new Error("ProjectivePoint expected")}const F=(0,i.memoized)((N,I)=>{const{px:C,py:R,pz:D}=N;if(p.eql(D,p.ONE))return{x:C,y:R};const y=N.is0();I==null&&(I=y?p.ONE:p.inv(D));const E=p.mul(C,I),k=p.mul(R,I),M=p.mul(D,I);if(y)return{x:p.ZERO,y:p.ZERO};if(!p.eql(M,p.ONE))throw new Error("invZ was invalid");return{x:E,y:k}}),U=(0,i.memoized)(N=>{if(N.is0()){if(w.allowInfinityPoint&&!p.is0(N.py))return;throw new Error("bad point: ZERO")}const{x:I,y:C}=N.toAffine();if(!p.isValid(I)||!p.isValid(C))throw new Error("bad point: x or y not FE");const R=p.sqr(C),D=O(I);if(!p.eql(R,D))throw new Error("bad point: equation left != right");if(!N.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class j{constructor(I,C,R){if(this.px=I,this.py=C,this.pz=R,I==null||!p.isValid(I))throw new Error("x required");if(C==null||!p.isValid(C))throw new Error("y required");if(R==null||!p.isValid(R))throw new Error("z required");Object.freeze(this)}static fromAffine(I){const{x:C,y:R}=I||{};if(!I||!p.isValid(C)||!p.isValid(R))throw new Error("invalid affine point");if(I instanceof j)throw new Error("projective point not allowed");const D=y=>p.eql(y,p.ZERO);return D(C)&&D(R)?j.ZERO:new j(C,R,p.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(I){const C=p.invertBatch(I.map(R=>R.pz));return I.map((R,D)=>R.toAffine(C[D])).map(j.fromAffine)}static fromHex(I){const C=j.fromAffine(P((0,i.ensureBytes)("pointHex",I)));return C.assertValidity(),C}static fromPrivateKey(I){return j.BASE.multiply(K(I))}static msm(I,C){return(0,t.pippenger)(j,S,I,C)}_setWindowSize(I){B.setWindowSize(this,I)}assertValidity(){U(this)}hasEvenY(){const{y:I}=this.toAffine();if(p.isOdd)return!p.isOdd(I);throw new Error("Field doesn't support isOdd")}equals(I){q(I);const{px:C,py:R,pz:D}=this,{px:y,py:E,pz:k}=I,M=p.eql(p.mul(C,k),p.mul(y,D)),b=p.eql(p.mul(R,k),p.mul(E,D));return M&&b}negate(){return new j(this.px,p.neg(this.py),this.pz)}double(){const{a:I,b:C}=w,R=p.mul(C,d),{px:D,py:y,pz:E}=this;let k=p.ZERO,M=p.ZERO,b=p.ZERO,v=p.mul(D,D),A=p.mul(y,y),x=p.mul(E,E),T=p.mul(D,y);return T=p.add(T,T),b=p.mul(D,E),b=p.add(b,b),k=p.mul(I,b),M=p.mul(R,x),M=p.add(k,M),k=p.sub(A,M),M=p.add(A,M),M=p.mul(k,M),k=p.mul(T,k),b=p.mul(R,b),x=p.mul(I,x),T=p.sub(v,x),T=p.mul(I,T),T=p.add(T,b),b=p.add(v,v),v=p.add(b,v),v=p.add(v,x),v=p.mul(v,T),M=p.add(M,v),x=p.mul(y,E),x=p.add(x,x),v=p.mul(x,T),k=p.sub(k,v),b=p.mul(x,A),b=p.add(b,b),b=p.add(b,b),new j(k,M,b)}add(I){q(I);const{px:C,py:R,pz:D}=this,{px:y,py:E,pz:k}=I;let M=p.ZERO,b=p.ZERO,v=p.ZERO;const A=w.a,x=p.mul(w.b,d);let T=p.mul(C,y),L=p.mul(R,E),$=p.mul(D,k),H=p.add(C,R),z=p.add(y,E);H=p.mul(H,z),z=p.add(T,L),H=p.sub(H,z),z=p.add(C,D);let J=p.add(y,k);return z=p.mul(z,J),J=p.add(T,$),z=p.sub(z,J),J=p.add(R,D),M=p.add(E,k),J=p.mul(J,M),M=p.add(L,$),J=p.sub(J,M),v=p.mul(A,z),M=p.mul(x,$),v=p.add(M,v),M=p.sub(L,v),v=p.add(L,v),b=p.mul(M,v),L=p.add(T,T),L=p.add(L,T),$=p.mul(A,$),z=p.mul(x,z),L=p.add(L,$),$=p.sub(T,$),$=p.mul(A,$),z=p.add(z,$),T=p.mul(L,z),b=p.add(b,T),T=p.mul(J,z),M=p.mul(H,M),M=p.sub(M,T),T=p.mul(H,L),v=p.mul(J,v),v=p.add(v,T),new j(M,b,v)}subtract(I){return this.add(I.negate())}is0(){return this.equals(j.ZERO)}wNAF(I){return B.wNAFCached(this,I,j.normalizeZ)}multiplyUnsafe(I){r.aInRange("scalar",I,a,w.n);const C=j.ZERO;if(I===a)return C;if(I===l)return this;const{endo:R}=w;if(!R)return B.unsafeLadder(this,I);let{k1neg:D,k1:y,k2neg:E,k2:k}=R.splitScalar(I),M=C,b=C,v=this;for(;y>a||k>a;)y&l&&(M=M.add(v)),k&l&&(b=b.add(v)),v=v.double(),y>>=l,k>>=l;return D&&(M=M.negate()),E&&(b=b.negate()),b=new j(p.mul(b.px,R.beta),b.py,b.pz),M.add(b)}multiply(I){const{endo:C,n:R}=w;let D,y;if(r.aInRange("scalar",I,l,R),C){const{k1neg:E,k1:k,k2neg:M,k2:b}=C.splitScalar(I);let{p:v,f:A}=this.wNAF(k),{p:x,f:T}=this.wNAF(b);v=B.constTimeNegate(E,v),x=B.constTimeNegate(M,x),x=new j(p.mul(x.px,C.beta),x.py,x.pz),D=v.add(x),y=A.add(T)}else{const{p:E,f:k}=this.wNAF(I);D=E,y=k}return j.normalizeZ([D,y])[0]}multiplyAndAddUnsafe(I,C,R){const D=j.BASE,y=(k,M)=>M!==a&&M!==l&&k.equals(D)?k.multiply(M):k.multiplyUnsafe(M),E=y(this,C).add(y(I,R));return E.is0()?void 0:E}toAffine(I){return F(this,I)}isTorsionFree(){const{h:I,isTorsionFree:C}=w;if(I===l)return!0;if(C)return C(j,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:I,clearCofactor:C}=w;return I===l?this:C?C(j,this):this.multiplyUnsafe(w.h)}toRawBytes(I=!0){return(0,i.abool)("isCompressed",I),this.assertValidity(),_(j,this,I)}toHex(I=!0){return(0,i.abool)("isCompressed",I),r.bytesToHex(this.toRawBytes(I))}}j.BASE=new j(w.Gx,w.Gy,p.ONE),j.ZERO=new j(p.ZERO,p.ONE,p.ZERO);const G=w.nBitLength,B=(0,t.wNAF)(j,w.endo?Math.ceil(G/2):G);return{CURVE:w,ProjectivePoint:j,normPrivateKeyToScalar:K,weierstrassEquation:O,isWithinCurveOrder:function(N){return r.inRange(N,l,w.n)}}}function g(m,w){const p=m.ORDER;let S=a;for(let N=p-l;N%u===a;N/=u)S+=l;const _=S,P=u<<_-l-l,O=P*u,K=(p-l)/O,q=(K-l)/u,F=O-l,U=P,j=m.pow(w,K),G=m.pow(w,(K+l)/u);let B=(N,I)=>{let C=j,R=m.pow(I,F),D=m.sqr(R);D=m.mul(D,I);let y=m.mul(N,D);y=m.pow(y,q),y=m.mul(y,R),R=m.mul(y,I),D=m.mul(y,N);let E=m.mul(D,R);y=m.pow(E,U);let k=m.eql(y,m.ONE);R=m.mul(D,G),y=m.mul(E,C),D=m.cmov(R,D,k),E=m.cmov(y,E,k);for(let M=_;M>l;M--){let b=M-u;b=u<<b-l;let v=m.pow(E,b);const A=m.eql(v,m.ONE);R=m.mul(D,C),C=m.mul(C,C),v=m.mul(E,C),D=m.cmov(R,D,A),E=m.cmov(v,E,A)}return{isValid:k,value:D}};if(m.ORDER%f===d){const N=(m.ORDER-d)/f,I=m.sqrt(m.neg(w));B=(C,R)=>{let D=m.sqr(R);const y=m.mul(C,R);D=m.mul(D,y);let E=m.pow(D,N);E=m.mul(E,y);const k=m.mul(E,I),M=m.mul(m.sqr(E),R),b=m.eql(M,C);return{isValid:b,value:m.cmov(k,E,b)}}}return B}})(ra),Object.defineProperty(yi,"__esModule",{value:!0}),yi.getHash=uc,yi.createCurve=function(e,t){const n=r=>(0,L0.weierstrass)({...e,...uc(r)});return Object.freeze({...n(t),create:n})};const O0=na,lc=Yt,L0=ra;function uc(e){return{hash:e,hmac:(t,...n)=>(0,O0.hmac)(e,t,(0,lc.concatBytes)(...n)),randomBytes:lc.randomBytes}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;const t=qt,n=Yt,r=yi,i=sn,o=Se,c=pe,s=ra,a=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),l=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),u=BigInt(1),d=BigInt(2),f=(y,E)=>(y+E/d)/E;function h(y){const E=a,k=BigInt(3),M=BigInt(6),b=BigInt(11),v=BigInt(22),A=BigInt(23),x=BigInt(44),T=BigInt(88),L=y*y*y%E,$=L*L*y%E,H=(0,o.pow2)($,k,E)*$%E,z=(0,o.pow2)(H,k,E)*$%E,J=(0,o.pow2)(z,d,E)*L%E,Q=(0,o.pow2)(J,b,E)*J%E,ne=(0,o.pow2)(Q,v,E)*Q%E,se=(0,o.pow2)(ne,x,E)*ne%E,le=(0,o.pow2)(se,T,E)*se%E,re=(0,o.pow2)(le,x,E)*ne%E,ie=(0,o.pow2)(re,k,E)*$%E,ce=(0,o.pow2)(ie,A,E)*Q%E,ae=(0,o.pow2)(ce,M,E)*L%E,ge=(0,o.pow2)(ae,d,E);if(!g.eql(g.sqr(ge),y))throw new Error("Cannot find square root");return ge}const g=(0,o.Field)(a,void 0,void 0,{sqrt:h});e.secp256k1=(0,r.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:l,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:y=>{const E=l,k=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),M=-u*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),b=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),v=k,A=BigInt("0x100000000000000000000000000000000"),x=f(v*y,E),T=f(-M*y,E);let L=(0,o.mod)(y-x*k-T*b,E),$=(0,o.mod)(-x*M-T*v,E);const H=L>A,z=$>A;if(H&&(L=E-L),z&&($=E-$),L>A||$>A)throw new Error("splitScalar: Endomorphism failed, k="+y);return{k1neg:H,k1:L,k2neg:z,k2:$}}}},t.sha256);const m=BigInt(0),w={};function p(y,...E){let k=w[y];if(k===void 0){const M=(0,t.sha256)(Uint8Array.from(y,b=>b.charCodeAt(0)));k=(0,c.concatBytes)(M,M),w[y]=k}return(0,t.sha256)((0,c.concatBytes)(k,...E))}const S=y=>y.toRawBytes(!0).slice(1),_=y=>(0,c.numberToBytesBE)(y,32),P=y=>(0,o.mod)(y,a),O=y=>(0,o.mod)(y,l),K=e.secp256k1.ProjectivePoint,q=(y,E,k)=>K.BASE.multiplyAndAddUnsafe(y,E,k);function F(y){let E=e.secp256k1.utils.normPrivateKeyToScalar(y),k=K.fromPrivateKey(E);return{scalar:k.hasEvenY()?E:O(-E),bytes:S(k)}}function U(y){(0,c.aInRange)("x",y,u,a);const E=P(y*y);let k=h(P(E*y+BigInt(7)));k%d!==m&&(k=P(-k));const M=new K(y,k,u);return M.assertValidity(),M}const j=c.bytesToNumberBE;function G(...y){return O(j(p("BIP0340/challenge",...y)))}function B(y){return F(y).bytes}function N(y,E,k=(0,n.randomBytes)(32)){const M=(0,c.ensureBytes)("message",y),{bytes:b,scalar:v}=F(E),A=(0,c.ensureBytes)("auxRand",k,32),x=_(v^j(p("BIP0340/aux",A))),T=p("BIP0340/nonce",x,b,M),L=O(j(T));if(L===m)throw new Error("sign failed: k is zero");const{bytes:$,scalar:H}=F(L),z=G($,b,M),J=new Uint8Array(64);if(J.set($,0),J.set(_(O(H+z*v)),32),!I(J,M,b))throw new Error("sign: Invalid signature produced");return J}function I(y,E,k){const M=(0,c.ensureBytes)("signature",y,64),b=(0,c.ensureBytes)("message",E),v=(0,c.ensureBytes)("publicKey",k,32);try{const A=U(j(v)),x=j(M.subarray(0,32));if(!(0,c.inRange)(x,u,a))return!1;const T=j(M.subarray(32,64));if(!(0,c.inRange)(T,u,l))return!1;const L=G(_(x),S(A),b),$=q(A,T,O(-L));return!(!$||!$.hasEvenY()||$.toAffine().x!==x)}catch{return!1}}e.schnorr={getPublicKey:B,sign:N,verify:I,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:U,pointToBytes:S,numberToBytesBE:c.numberToBytesBE,bytesToNumberBE:c.bytesToNumberBE,taggedHash:p,mod:o.mod}};const C=(0,i.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(y=>y.map(E=>BigInt(E)))),R=(0,s.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}),D=(0,i.createHasher)(e.secp256k1.ProjectivePoint,y=>{const{x:E,y:k}=R(g.create(y[0]));return C(E,k)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256});e.hashToCurve=D.hashToCurve,e.encodeToCurve=D.encodeToCurve})(rd);var Es={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHex=e.remove0x=void 0;var t=at;e.remove0x=function(n){return n.startsWith("0x")||n.startsWith("0X")?n.slice(2):n},e.decodeHex=function(n){return(0,t.hexToBytes)((0,e.remove0x)(n))}})(Es),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hexToPublicKey=e.convertPublicKeyFormat=e.getSharedPoint=e.getPublicKey=e.isValidPrivateKey=e.getValidSecret=void 0;var t=Xs,n=Cu,r=rd,i=Cr,o=Re,c=Es;e.getValidSecret=function(){var u;do u=(0,t.randomBytes)(o.SECRET_KEY_LENGTH);while(!(0,e.isValidPrivateKey)(u));return u},e.isValidPrivateKey=function(u){return s((0,i.ellipticCurve)(),function(d){return d.utils.isValidPrivateKey(u)},function(){return!0},function(){return!0})},e.getPublicKey=function(u){return s((0,i.ellipticCurve)(),function(d){return d.getPublicKey(u)},function(d){return d.getPublicKey(u)},function(d){return d.getPublicKey(u)})},e.getSharedPoint=function(u,d,f){return s((0,i.ellipticCurve)(),function(h){return h.getSharedSecret(u,d,f)},function(h){return h.getSharedSecret(u,d)},function(h){return l(h,u,d)})},e.convertPublicKeyFormat=function(u,d){return s((0,i.ellipticCurve)(),function(f){return f.getSharedSecret(BigInt(1),u,d)},function(){return u},function(){return u})};function s(u,d,f,h){if(u==="secp256k1")return d(r.secp256k1);if(u==="x25519")return f(n.x25519);if(u==="ed25519")return h(n.ed25519);throw new Error("Not implemented")}e.hexToPublicKey=function(u){var d=(0,c.decodeHex)(u);return s((0,i.ellipticCurve)(),function(){return a(d)},function(){return d},function(){return d})};var a=function(u){if(u.length===o.ETH_PUBLIC_KEY_SIZE){var d=new Uint8Array(1+u.length);return d.set([4]),d.set(u,1),d}return u},l=function(u,d,f){var h=u.utils.getExtendedPublicKey(d).scalar;return u.ExtendedPoint.fromHex(f).multiply(h).toRawBytes()}}(Su);var id={},Fn={};Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.hkdf=void 0,Fn.extract=sd,Fn.expand=ad;const _s=ot,dc=Yt,od=na;function sd(e,t,n){return(0,_s.hash)(e),n===void 0&&(n=new Uint8Array(e.outputLen)),(0,od.hmac)(e,(0,dc.toBytes)(n),(0,dc.toBytes)(t))}const Do=new Uint8Array([0]),fc=new Uint8Array;function ad(e,t,n,r=32){if((0,_s.hash)(e),(0,_s.number)(r),r>255*e.outputLen)throw new Error("Length should be <= 255*HashLen");const i=Math.ceil(r/e.outputLen);n===void 0&&(n=fc);const o=new Uint8Array(i*e.outputLen),c=od.hmac.create(e,t),s=c._cloneInto(),a=new Uint8Array(c.outputLen);for(let l=0;l<i;l++)Do[0]=l+1,s.update(l===0?fc:a).update(n).update(Do).digestInto(a),o.set(a,e.outputLen*l),c._cloneInto(s);return c.destroy(),s.destroy(),a.fill(0),Do.fill(0),o.slice(0,r)}Fn.hkdf=(e,t,n,r,i)=>ad(e,sd(e,t,n),r,i),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSharedKey=e.deriveKey=void 0;var t=at,n=Fn,r=qt;e.deriveKey=function(i,o,c){return(0,n.hkdf)(r.sha256,i,o,c,32)},e.getSharedKey=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return(0,e.deriveKey)(t.concatBytes.apply(void 0,i))}}(id);var hc={},Yn={},ke={},An={};Object.defineProperty(An,"__esModule",{value:!0}),An.polyval=An.ghash=void 0,An._toGHASHKey=cd;const kn=He,We=at,Kt=16,ia=new Uint8Array(16),Mt=(0,We.u32)(ia),pt=e=>(e>>>0&255)<<24|(e>>>8&255)<<16|(e>>>16&255)<<8|e>>>24&255|0;function cd(e){e.reverse();const t=1&e[15];let n=0;for(let r=0;r<e.length;r++){const i=e[r];e[r]=i>>>1|n,n=(1&i)<<7}return e[0]^=225&-t,e}class ld{constructor(t,n){this.blockLen=Kt,this.outputLen=Kt,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,t=(0,We.toBytes)(t),(0,kn.bytes)(t,16);const r=(0,We.createView)(t);let i=r.getUint32(0,!1),o=r.getUint32(4,!1),c=r.getUint32(8,!1),s=r.getUint32(12,!1);const a=[];for(let p=0;p<128;p++)a.push({s0:pt(i),s1:pt(o),s2:pt(c),s3:pt(s)}),{s0:i,s1:o,s2:c,s3:s}={s3:(d=c)<<31|(f=s)>>>1,s2:(u=o)<<31|d>>>1,s1:(l=i)<<31|u>>>1,s0:l>>>1^225<<24&-(1&f)};var l,u,d,f;const h=(p=>p>65536?8:p>1024?4:2)(n||1024);if(![1,2,4,8].includes(h))throw new Error(`ghash: wrong window size=${h}, should be 2, 4 or 8`);this.W=h;const g=128/h,m=this.windowSize=2**h,w=[];for(let p=0;p<g;p++)for(let S=0;S<m;S++){let _=0,P=0,O=0,K=0;for(let q=0;q<h;q++){if(!(S>>>h-q-1&1))continue;const{s0:F,s1:U,s2:j,s3:G}=a[h*p+q];_^=F,P^=U,O^=j,K^=G}w.push({s0:_,s1:P,s2:O,s3:K})}this.t=w}_updateBlock(t,n,r,i){t^=this.s0,n^=this.s1,r^=this.s2,i^=this.s3;const{W:o,t:c,windowSize:s}=this;let a=0,l=0,u=0,d=0;const f=(1<<o)-1;let h=0;for(const g of[t,n,r,i])for(let m=0;m<4;m++){const w=g>>>8*m&255;for(let p=8/o-1;p>=0;p--){const S=w>>>o*p&f,{s0:_,s1:P,s2:O,s3:K}=c[h*s+S];a^=_,l^=P,u^=O,d^=K,h+=1}}this.s0=a,this.s1=l,this.s2=u,this.s3=d}update(t){t=(0,We.toBytes)(t),(0,kn.exists)(this);const n=(0,We.u32)(t),r=Math.floor(t.length/Kt),i=t.length%Kt;for(let o=0;o<r;o++)this._updateBlock(n[4*o+0],n[4*o+1],n[4*o+2],n[4*o+3]);return i&&(ia.set(t.subarray(r*Kt)),this._updateBlock(Mt[0],Mt[1],Mt[2],Mt[3]),(0,We.clean)(Mt)),this}destroy(){const{t}=this;for(const n of t)n.s0=0,n.s1=0,n.s2=0,n.s3=0}digestInto(t){(0,kn.exists)(this),(0,kn.output)(t,this),this.finished=!0;const{s0:n,s1:r,s2:i,s3:o}=this,c=(0,We.u32)(t);return c[0]=n,c[1]=r,c[2]=i,c[3]=o,t}digest(){const t=new Uint8Array(Kt);return this.digestInto(t),this.destroy(),t}}class N0 extends ld{constructor(t,n){t=(0,We.toBytes)(t);const r=cd((0,We.copyBytes)(t));super(r,n),(0,We.clean)(r)}update(t){t=(0,We.toBytes)(t),(0,kn.exists)(this);const n=(0,We.u32)(t),r=t.length%Kt,i=Math.floor(t.length/Kt);for(let o=0;o<i;o++)this._updateBlock(pt(n[4*o+3]),pt(n[4*o+2]),pt(n[4*o+1]),pt(n[4*o+0]));return r&&(ia.set(t.subarray(i*Kt)),this._updateBlock(pt(Mt[3]),pt(Mt[2]),pt(Mt[1]),pt(Mt[0])),(0,We.clean)(Mt)),this}digestInto(t){(0,kn.exists)(this),(0,kn.output)(t,this),this.finished=!0;const{s0:n,s1:r,s2:i,s3:o}=this,c=(0,We.u32)(t);return c[0]=n,c[1]=r,c[2]=i,c[3]=o,t.reverse()}}function pc(e){const t=(r,i)=>e(i,r.length).update((0,We.toBytes)(r)).digest(),n=e(new Uint8Array(16),0);return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=(r,i)=>e(r,i),t}An.ghash=pc((e,t)=>new ld(e,t)),An.polyval=pc((e,t)=>new N0(e,t)),Object.defineProperty(ke,"__esModule",{value:!0}),ke.unsafe=ke.aeskwp=ke.aeskw=ke.siv=ke.gcm=ke.cfb=ke.cbc=ke.ecb=ke.ctr=void 0,ke.expandKeyLE=wt,ke.expandKeyDecLE=kr;const ve=He,Ss=An,ee=at,et=16,ni=new Uint8Array(et),D0=283;function oa(e){return e<<1^D0&-(e>>7)}function zn(e,t){let n=0;for(;t>0;t>>=1)n^=e&-(1&t),e=oa(e);return n}const Cs=(()=>{const e=new Uint8Array(256);for(let n=0,r=1;n<256;n++,r^=oa(r))e[n]=r;const t=new Uint8Array(256);t[0]=99;for(let n=0;n<255;n++){let r=e[255-n];r|=r<<8,t[e[n]]=255&(r^r>>4^r>>5^r>>6^r>>7^99)}return(0,ee.clean)(e),t})(),$0=Cs.map((e,t)=>Cs.indexOf(t)),B0=e=>e<<24|e>>>8,$o=e=>e<<8|e>>>24,Ki=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function ud(e,t){if(e.length!==256)throw new Error("Wrong sbox length");const n=new Uint32Array(256).map((l,u)=>t(e[u])),r=n.map($o),i=r.map($o),o=i.map($o),c=new Uint32Array(65536),s=new Uint32Array(65536),a=new Uint16Array(65536);for(let l=0;l<256;l++)for(let u=0;u<256;u++){const d=256*l+u;c[d]=n[l]^r[u],s[d]=i[l]^o[u],a[d]=e[l]<<8|e[u]}return{sbox:e,sbox2:a,T0:n,T1:r,T2:i,T3:o,T01:c,T23:s}}const sa=ud(Cs,e=>zn(e,3)<<24|e<<16|e<<8|zn(e,2)),dd=ud($0,e=>zn(e,11)<<24|zn(e,13)<<16|zn(e,9)<<8|zn(e,14)),K0=(()=>{const e=new Uint8Array(16);for(let t=0,n=1;t<16;t++,n=oa(n))e[t]=n;return e})();function wt(e){(0,ve.bytes)(e);const t=e.length;if(![16,24,32].includes(t))throw new Error(`aes: wrong key size: should be 16, 24 or 32, got: ${t}`);const{sbox2:n}=sa,r=[];(0,ee.isAligned32)(e)||r.push(e=(0,ee.copyBytes)(e));const i=(0,ee.u32)(e),o=i.length,c=a=>It(n,a,a,a,a),s=new Uint32Array(t+28);s.set(i);for(let a=o;a<s.length;a++){let l=s[a-1];a%o==0?l=c(B0(l))^K0[a/o-1]:o>6&&a%o==4&&(l=c(l)),s[a]=s[a-o]^l}return(0,ee.clean)(...r),s}function kr(e){const t=wt(e),n=t.slice(),r=t.length,{sbox2:i}=sa,{T0:o,T1:c,T2:s,T3:a}=dd;for(let l=0;l<r;l+=4)for(let u=0;u<4;u++)n[l+u]=t[r-l-4+u];(0,ee.clean)(t);for(let l=4;l<r-4;l++){const u=n[l],d=It(i,u,u,u,u);n[l]=o[255&d]^c[d>>>8&255]^s[d>>>16&255]^a[d>>>24]}return n}function pn(e,t,n,r,i,o){return e[n<<8&65280|r>>>8&255]^t[i>>>8&65280|o>>>24&255]}function It(e,t,n,r,i){return e[255&t|65280&n]|e[r>>>16&255|i>>>16&65280]<<16}function Ve(e,t,n,r,i){const{sbox2:o,T01:c,T23:s}=sa;let a=0;t^=e[a++],n^=e[a++],r^=e[a++],i^=e[a++];const l=e.length/4-2;for(let u=0;u<l;u++){const d=e[a++]^pn(c,s,t,n,r,i),f=e[a++]^pn(c,s,n,r,i,t),h=e[a++]^pn(c,s,r,i,t,n),g=e[a++]^pn(c,s,i,t,n,r);t=d,n=f,r=h,i=g}return{s0:e[a++]^It(o,t,n,r,i),s1:e[a++]^It(o,n,r,i,t),s2:e[a++]^It(o,r,i,t,n),s3:e[a++]^It(o,i,t,n,r)}}function xr(e,t,n,r,i){const{sbox2:o,T01:c,T23:s}=dd;let a=0;t^=e[a++],n^=e[a++],r^=e[a++],i^=e[a++];const l=e.length/4-2;for(let u=0;u<l;u++){const d=e[a++]^pn(c,s,t,i,r,n),f=e[a++]^pn(c,s,n,t,i,r),h=e[a++]^pn(c,s,r,n,t,i),g=e[a++]^pn(c,s,i,r,n,t);t=d,n=f,r=h,i=g}return{s0:e[a++]^It(o,t,i,r,n),s1:e[a++]^It(o,n,t,i,r),s2:e[a++]^It(o,r,n,t,i),s3:e[a++]^It(o,i,r,n,t)}}function Zn(e,t){if(t===void 0)return new Uint8Array(e);if((0,ve.bytes)(t),t.length<e)throw new Error(`aes: wrong destination length, expected at least ${e}, got: ${t.length}`);if(!(0,ee.isAligned32)(t))throw new Error("unaligned dst");return t}function fd(e,t,n,r){(0,ve.bytes)(t,et),(0,ve.bytes)(n);const i=n.length;r=Zn(i,r);const o=t,c=(0,ee.u32)(o);let{s0:s,s1:a,s2:l,s3:u}=Ve(e,c[0],c[1],c[2],c[3]);const d=(0,ee.u32)(n),f=(0,ee.u32)(r);for(let g=0;g+4<=d.length;g+=4){f[g+0]=d[g+0]^s,f[g+1]=d[g+1]^a,f[g+2]=d[g+2]^l,f[g+3]=d[g+3]^u;let m=1;for(let w=o.length-1;w>=0;w--)m=m+(255&o[w])|0,o[w]=255&m,m>>>=8;({s0:s,s1:a,s2:l,s3:u}=Ve(e,c[0],c[1],c[2],c[3]))}const h=et*Math.floor(d.length/4);if(h<i){const g=new Uint32Array([s,a,l,u]),m=(0,ee.u8)(g);for(let w=h,p=0;w<i;w++,p++)r[w]=n[w]^m[p];(0,ee.clean)(g)}return r}function qn(e,t,n,r,i){(0,ve.bytes)(n,et),(0,ve.bytes)(r),i=Zn(r.length,i);const o=n,c=(0,ee.u32)(o),s=(0,ee.createView)(o),a=(0,ee.u32)(r),l=(0,ee.u32)(i),u=t?0:12,d=r.length;let f=s.getUint32(u,t),{s0:h,s1:g,s2:m,s3:w}=Ve(e,c[0],c[1],c[2],c[3]);for(let S=0;S+4<=a.length;S+=4)l[S+0]=a[S+0]^h,l[S+1]=a[S+1]^g,l[S+2]=a[S+2]^m,l[S+3]=a[S+3]^w,f=f+1>>>0,s.setUint32(u,f,t),{s0:h,s1:g,s2:m,s3:w}=Ve(e,c[0],c[1],c[2],c[3]);const p=et*Math.floor(a.length/4);if(p<d){const S=new Uint32Array([h,g,m,w]),_=(0,ee.u8)(S);for(let P=p,O=0;P<d;P++,O++)i[P]=r[P]^_[O];(0,ee.clean)(S)}return i}function mc(e){if((0,ve.bytes)(e),e.length%et!=0)throw new Error("aes/(cbc-ecb).decrypt ciphertext should consist of blocks with size 16")}function gc(e,t,n){(0,ve.bytes)(e);let r=e.length;const i=r%et;if(!t&&i!==0)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");(0,ee.isAligned32)(e)||(e=(0,ee.copyBytes)(e));const o=(0,ee.u32)(e);if(t){let s=et-i;s||(s=et),r+=s}const c=Zn(r,n);return{b:o,o:(0,ee.u32)(c),out:c}}function yc(e,t){if(!t)return e;const n=e.length;if(!n)throw new Error("aes/pcks5: empty ciphertext not allowed");const r=e[n-1];if(r<=0||r>16)throw new Error("aes/pcks5: wrong padding");const i=e.subarray(0,-r);for(let o=0;o<r;o++)if(e[n-o-1]!==r)throw new Error("aes/pcks5: wrong padding");return i}function vc(e){const t=new Uint8Array(16),n=(0,ee.u32)(t);t.set(e);const r=et-e.length;for(let i=et-r;i<et;i++)t[i]=r;return n}function hd(e,t,n,r,i){const o=i==null?0:i.length,c=e.create(n,r.length+o);i&&c.update(i),c.update(r);const s=new Uint8Array(16),a=(0,ee.createView)(s);i&&(0,ee.setBigUint64)(a,0,BigInt(8*o),t),(0,ee.setBigUint64)(a,8,BigInt(8*r.length),t),c.update(s);const l=c.digest();return(0,ee.clean)(s),l}ke.ctr=(0,ee.wrapCipher)({blockSize:16,nonceLength:16},function(e,t){function n(r,i){if((0,ve.bytes)(r),i!==void 0&&((0,ve.bytes)(i),!(0,ee.isAligned32)(i)))throw new Error("unaligned destination");const o=wt(e),c=(0,ee.copyBytes)(t),s=[o,c];(0,ee.isAligned32)(r)||s.push(r=(0,ee.copyBytes)(r));const a=fd(o,c,r,i);return(0,ee.clean)(...s),a}return(0,ve.bytes)(e),(0,ve.bytes)(t,et),{encrypt:(r,i)=>n(r,i),decrypt:(r,i)=>n(r,i)}}),ke.ecb=(0,ee.wrapCipher)({blockSize:16},function(e,t={}){(0,ve.bytes)(e);const n=!t.disablePadding;return{encrypt(r,i){const{b:o,o:c,out:s}=gc(r,n,i),a=wt(e);let l=0;for(;l+4<=o.length;){const{s0:u,s1:d,s2:f,s3:h}=Ve(a,o[l+0],o[l+1],o[l+2],o[l+3]);c[l++]=u,c[l++]=d,c[l++]=f,c[l++]=h}if(n){const u=vc(r.subarray(4*l)),{s0:d,s1:f,s2:h,s3:g}=Ve(a,u[0],u[1],u[2],u[3]);c[l++]=d,c[l++]=f,c[l++]=h,c[l++]=g}return(0,ee.clean)(a),s},decrypt(r,i){mc(r);const o=kr(e),c=Zn(r.length,i),s=[o];(0,ee.isAligned32)(r)||s.push(r=(0,ee.copyBytes)(r));const a=(0,ee.u32)(r),l=(0,ee.u32)(c);for(let u=0;u+4<=a.length;){const{s0:d,s1:f,s2:h,s3:g}=xr(o,a[u+0],a[u+1],a[u+2],a[u+3]);l[u++]=d,l[u++]=f,l[u++]=h,l[u++]=g}return(0,ee.clean)(...s),yc(c,n)}}}),ke.cbc=(0,ee.wrapCipher)({blockSize:16,nonceLength:16},function(e,t,n={}){(0,ve.bytes)(e),(0,ve.bytes)(t,16);const r=!n.disablePadding;return{encrypt(i,o){const c=wt(e),{b:s,o:a,out:l}=gc(i,r,o);let u=t;const d=[c];(0,ee.isAligned32)(u)||d.push(u=(0,ee.copyBytes)(u));const f=(0,ee.u32)(u);let h=f[0],g=f[1],m=f[2],w=f[3],p=0;for(;p+4<=s.length;)h^=s[p+0],g^=s[p+1],m^=s[p+2],w^=s[p+3],{s0:h,s1:g,s2:m,s3:w}=Ve(c,h,g,m,w),a[p++]=h,a[p++]=g,a[p++]=m,a[p++]=w;if(r){const S=vc(i.subarray(4*p));h^=S[0],g^=S[1],m^=S[2],w^=S[3],{s0:h,s1:g,s2:m,s3:w}=Ve(c,h,g,m,w),a[p++]=h,a[p++]=g,a[p++]=m,a[p++]=w}return(0,ee.clean)(...d),l},decrypt(i,o){mc(i);const c=kr(e);let s=t;const a=[c];(0,ee.isAligned32)(s)||a.push(s=(0,ee.copyBytes)(s));const l=(0,ee.u32)(s),u=Zn(i.length,o);(0,ee.isAligned32)(i)||a.push(i=(0,ee.copyBytes)(i));const d=(0,ee.u32)(i),f=(0,ee.u32)(u);let h=l[0],g=l[1],m=l[2],w=l[3];for(let p=0;p+4<=d.length;){const S=h,_=g,P=m,O=w;h=d[p+0],g=d[p+1],m=d[p+2],w=d[p+3];const{s0:K,s1:q,s2:F,s3:U}=xr(c,h,g,m,w);f[p++]=K^S,f[p++]=q^_,f[p++]=F^P,f[p++]=U^O}return(0,ee.clean)(...a),yc(u,r)}}}),ke.cfb=(0,ee.wrapCipher)({blockSize:16,nonceLength:16},function(e,t){function n(r,i,o){(0,ve.bytes)(r);const c=r.length;o=Zn(c,o);const s=wt(e);let a=t;const l=[s];(0,ee.isAligned32)(a)||l.push(a=(0,ee.copyBytes)(a)),(0,ee.isAligned32)(r)||l.push(r=(0,ee.copyBytes)(r));const u=(0,ee.u32)(r),d=(0,ee.u32)(o),f=i?d:u,h=(0,ee.u32)(a);let g=h[0],m=h[1],w=h[2],p=h[3];for(let _=0;_+4<=u.length;){const{s0:P,s1:O,s2:K,s3:q}=Ve(s,g,m,w,p);d[_+0]=u[_+0]^P,d[_+1]=u[_+1]^O,d[_+2]=u[_+2]^K,d[_+3]=u[_+3]^q,g=f[_++],m=f[_++],w=f[_++],p=f[_++]}const S=et*Math.floor(u.length/4);if(S<c){({s0:g,s1:m,s2:w,s3:p}=Ve(s,g,m,w,p));const _=(0,ee.u8)(new Uint32Array([g,m,w,p]));for(let P=S,O=0;P<c;P++,O++)o[P]=r[P]^_[O];(0,ee.clean)(_)}return(0,ee.clean)(...l),o}return(0,ve.bytes)(e),(0,ve.bytes)(t,16),{encrypt:(r,i)=>n(r,!0,i),decrypt:(r,i)=>n(r,!1,i)}}),ke.gcm=(0,ee.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16},function(e,t,n){if((0,ve.bytes)(e),(0,ve.bytes)(t),n!==void 0&&(0,ve.bytes)(n),t.length<8)throw new Error("aes/gcm: invalid nonce length");const r=16;function i(c,s,a){const l=hd(Ss.ghash,!1,c,a,n);for(let u=0;u<s.length;u++)l[u]^=s[u];return l}function o(){const c=wt(e),s=ni.slice(),a=ni.slice();if(qn(c,!1,a,a,s),t.length===12)a.set(t);else{const l=ni.slice(),u=(0,ee.createView)(l);(0,ee.setBigUint64)(u,8,BigInt(8*t.length),!1);const d=Ss.ghash.create(s).update(t).update(l);d.digestInto(a),d.destroy()}return{xk:c,authKey:s,counter:a,tagMask:qn(c,!1,a,ni)}}return{encrypt(c){(0,ve.bytes)(c);const{xk:s,authKey:a,counter:l,tagMask:u}=o(),d=new Uint8Array(c.length+r),f=[s,a,l,u];(0,ee.isAligned32)(c)||f.push(c=(0,ee.copyBytes)(c)),qn(s,!1,l,c,d);const h=i(a,u,d.subarray(0,d.length-r));return f.push(h),d.set(h,c.length),(0,ee.clean)(...f),d},decrypt(c){if((0,ve.bytes)(c),c.length<r)throw new Error("aes/gcm: ciphertext less than tagLen (16)");const{xk:s,authKey:a,counter:l,tagMask:u}=o(),d=[s,a,u,l];(0,ee.isAligned32)(c)||d.push(c=(0,ee.copyBytes)(c));const f=c.subarray(0,-16),h=c.subarray(-16),g=i(a,u,f);if(d.push(g),!(0,ee.equalBytes)(g,h))throw new Error("aes/gcm: invalid ghash tag");const m=qn(s,!1,l,f);return(0,ee.clean)(...d),m}}});const ri=(e,t,n)=>r=>{if(!Number.isSafeInteger(r)||t>r||r>n)throw new Error(`${e}: invalid value=${r}, must be [${t}..${n}]`)};function pd(e){return e!=null&&typeof e=="object"&&(e instanceof Uint32Array||e.constructor.name==="Uint32Array")}function md(e,t){if((0,ve.bytes)(t,16),!pd(e))throw new Error("_encryptBlock accepts result of expandKeyLE");const n=(0,ee.u32)(t);let{s0:r,s1:i,s2:o,s3:c}=Ve(e,n[0],n[1],n[2],n[3]);return n[0]=r,n[1]=i,n[2]=o,n[3]=c,t}function gd(e,t){if((0,ve.bytes)(t,16),!pd(e))throw new Error("_decryptBlock accepts result of expandKeyLE");const n=(0,ee.u32)(t);let{s0:r,s1:i,s2:o,s3:c}=xr(e,n[0],n[1],n[2],n[3]);return n[0]=r,n[1]=i,n[2]=o,n[3]=c,t}ke.siv=(0,ee.wrapCipher)({blockSize:16,nonceLength:12,tagLength:16},function(e,t,n){const r=ri("AAD",0,68719476736),i=ri("plaintext",0,2**36),o=ri("nonce",12,12),c=ri("ciphertext",16,2**36+16);function s(){const u=wt(e),d=new Uint8Array(e.length),f=new Uint8Array(16),h=[u,d];let g=t;(0,ee.isAligned32)(g)||h.push(g=(0,ee.copyBytes)(g));const m=(0,ee.u32)(g);let w=0,p=m[0],S=m[1],_=m[2],P=0;for(const K of[f,d].map(ee.u32)){const q=(0,ee.u32)(K);for(let F=0;F<q.length;F+=2){const{s0:U,s1:j}=Ve(u,w,p,S,_);q[F+0]=U,q[F+1]=j,w=++P}}const O={authKey:f,encKey:wt(d)};return(0,ee.clean)(...h),O}function a(u,d,f){const h=hd(Ss.polyval,!0,d,f,n);for(let _=0;_<12;_++)h[_]^=t[_];h[15]&=127;const g=(0,ee.u32)(h);let m=g[0],w=g[1],p=g[2],S=g[3];return{s0:m,s1:w,s2:p,s3:S}=Ve(u,m,w,p,S),g[0]=m,g[1]=w,g[2]=p,g[3]=S,h}function l(u,d,f){let h=(0,ee.copyBytes)(d);h[15]|=128;const g=qn(u,!0,h,f);return(0,ee.clean)(h),g}return(0,ve.bytes)(e,16,24,32),(0,ve.bytes)(t),o(t.length),n!==void 0&&((0,ve.bytes)(n),r(n.length)),{encrypt(u){(0,ve.bytes)(u),i(u.length);const{encKey:d,authKey:f}=s(),h=a(d,f,u),g=[d,f,h];(0,ee.isAligned32)(u)||g.push(u=(0,ee.copyBytes)(u));const m=new Uint8Array(u.length+16);return m.set(h,u.length),m.set(l(d,h,u)),(0,ee.clean)(...g),m},decrypt(u){(0,ve.bytes)(u),c(u.length);const d=u.subarray(-16),{encKey:f,authKey:h}=s(),g=[f,h];(0,ee.isAligned32)(u)||g.push(u=(0,ee.copyBytes)(u));const m=l(f,d,u.subarray(0,-16)),w=a(f,h,m);if(g.push(w),!(0,ee.equalBytes)(d,w))throw(0,ee.clean)(...g),new Error("invalid polyval tag");return(0,ee.clean)(...g),m}}});const ji={encrypt(e,t){if(t.length>=2**32)throw new Error("plaintext should be less than 4gb");const n=wt(e);if(t.length===16)md(n,t);else{const r=(0,ee.u32)(t);let i=r[0],o=r[1];for(let c=0,s=1;c<6;c++)for(let a=2;a<r.length;a+=2,s++){const{s0:l,s1:u,s2:d,s3:f}=Ve(n,i,o,r[a],r[a+1]);i=l,o=u^Ki(s),r[a]=d,r[a+1]=f}r[0]=i,r[1]=o}n.fill(0)},decrypt(e,t){if(t.length-8>=2**32)throw new Error("ciphertext should be less than 4gb");const n=kr(e),r=t.length/8-1;if(r===1)gd(n,t);else{const i=(0,ee.u32)(t);let o=i[0],c=i[1];for(let s=0,a=6*r;s<6;s++)for(let l=2*r;l>=1;l-=2,a--){c^=Ki(a);const{s0:u,s1:d,s2:f,s3:h}=xr(n,o,c,i[l],i[l+1]);o=u,c=d,i[l]=f,i[l+1]=h}i[0]=o,i[1]=c}n.fill(0)}},bc=new Uint8Array(8).fill(166);ke.aeskw=(0,ee.wrapCipher)({blockSize:8},e=>({encrypt(t){if((0,ve.bytes)(t),!t.length||t.length%8!=0)throw new Error("invalid plaintext length");if(t.length===8)throw new Error("8-byte keys not allowed in AESKW, use AESKWP instead");const n=(0,ee.concatBytes)(bc,t);return ji.encrypt(e,n),n},decrypt(t){if((0,ve.bytes)(t),t.length%8!=0||t.length<24)throw new Error("invalid ciphertext length");const n=(0,ee.copyBytes)(t);if(ji.decrypt(e,n),!(0,ee.equalBytes)(n.subarray(0,8),bc))throw new Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8)}}));const wc=2790873510;ke.aeskwp=(0,ee.wrapCipher)({blockSize:8},e=>({encrypt(t){if((0,ve.bytes)(t),!t.length)throw new Error("invalid plaintext length");const n=8*Math.ceil(t.length/8),r=new Uint8Array(8+n);r.set(t,8);const i=(0,ee.u32)(r);return i[0]=wc,i[1]=Ki(t.length),ji.encrypt(e,r),r},decrypt(t){if((0,ve.bytes)(t),t.length<16)throw new Error("invalid ciphertext length");const n=(0,ee.copyBytes)(t),r=(0,ee.u32)(n);ji.decrypt(e,n);const i=Ki(r[1])>>>0,o=8*Math.ceil(i/8);if(r[0]!==wc||n.length-8!==o)throw new Error("integrity check failed");for(let c=i;c<o;c++)if(n[8+c]!==0)throw new Error("integrity check failed");return n.subarray(0,8).fill(0),n.subarray(8,8+i)}})),ke.unsafe={expandKeyLE:wt,expandKeyDecLE:kr,encrypt:Ve,decrypt:xr,encryptBlock:md,decryptBlock:gd,ctrCounter:fd,ctr32:qn},Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.aes256cbc=Yn.aes256gcm=void 0;var yd=ke;Yn.aes256gcm=function(e,t,n){return(0,yd.gcm)(e,t,n)};Yn.aes256cbc=function(e,t,n){return(0,yd.cbc)(e,t)};var Ui={},vd={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.sigma=void 0,Wn.rotl=function(e,t){return e<<t|e>>>32-t},Wn.createCipher=function(e,t){const{allowShortKeys:n,extendNonceFn:r,counterLength:i,counterRight:o,rounds:c}=(0,ft.checkOpts)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return(0,Bt.number)(i),(0,Bt.number)(c),(0,Bt.bool)(o),(0,Bt.bool)(n),(s,a,l,u,d=0)=>{(0,Bt.bytes)(s),(0,Bt.bytes)(a),(0,Bt.bytes)(l);const f=l.length;if(u===void 0&&(u=new Uint8Array(f)),(0,Bt.bytes)(u),(0,Bt.number)(d),d<0||d>=Ec)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const h=[];let g,m,w=s.length;if(w===32)h.push(g=(0,ft.copyBytes)(s)),m=wd;else{if(w!==16||!n)throw new Error(`arx: invalid 32-byte key, got length=${w}`);g=new Uint8Array(32),g.set(s),g.set(s,16),m=H0,h.push(g)}Bo(a)||h.push(a=(0,ft.copyBytes)(a));const p=(0,ft.u32)(g);if(r){if(a.length!==24)throw new Error("arx: extended nonce must be 24 bytes");r(m,p,(0,ft.u32)(a.subarray(0,16)),p),a=a.subarray(16)}const S=16-i;if(S!==a.length)throw new Error(`arx: nonce must be ${S} or 16 bytes`);if(S!==12){const P=new Uint8Array(12);P.set(a,o?0:12-a.length),a=P,h.push(a)}const _=(0,ft.u32)(a);return function(P,O,K,q,F,U,j,G){const B=F.length,N=new Uint8Array(ii),I=(0,ft.u32)(N),C=Bo(F)&&Bo(U),R=C?(0,ft.u32)(F):_c,D=C?(0,ft.u32)(U):_c;for(let y=0;y<B;j++){if(P(O,K,q,I,j,G),j>=Ec)throw new Error("arx: counter overflow");const E=Math.min(ii,B-y);if(C&&E===ii){const k=y/4;if(y%4!=0)throw new Error("arx: invalid block position");for(let M,b=0;b<F0;b++)M=k+b,D[M]=R[M]^I[b];y+=ii}else{for(let k,M=0;M<E;M++)k=y+M,U[k]=F[k]^N[M];y+=E}}}(e,m,p,_,l,u,d,c),(0,ft.clean)(...h),u}};const Bt=He,ft=at,bd=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),j0=bd("expand 16-byte k"),U0=bd("expand 32-byte k"),H0=(0,ft.u32)(j0),wd=(0,ft.u32)(U0);function Bo(e){return e.byteOffset%4==0}Wn.sigma=wd.slice();const ii=64,F0=16,Ec=2**32-1,_c=new Uint32Array;var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.poly1305=void 0,gr.wrapConstructorWithKey=Ed;const oi=He,fr=at,Ne=(e,t)=>255&e[t++]|(255&e[t++])<<8;class z0{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=(0,fr.toBytes)(t),(0,oi.bytes)(t,32);const n=Ne(t,0),r=Ne(t,2),i=Ne(t,4),o=Ne(t,6),c=Ne(t,8),s=Ne(t,10),a=Ne(t,12),l=Ne(t,14);this.r[0]=8191&n,this.r[1]=8191&(n>>>13|r<<3),this.r[2]=7939&(r>>>10|i<<6),this.r[3]=8191&(i>>>7|o<<9),this.r[4]=255&(o>>>4|c<<12),this.r[5]=c>>>1&8190,this.r[6]=8191&(c>>>14|s<<2),this.r[7]=8065&(s>>>11|a<<5),this.r[8]=8191&(a>>>8|l<<8),this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ne(t,16+2*u)}process(t,n,r=!1){const i=r?0:2048,{h:o,r:c}=this,s=c[0],a=c[1],l=c[2],u=c[3],d=c[4],f=c[5],h=c[6],g=c[7],m=c[8],w=c[9],p=Ne(t,n+0),S=Ne(t,n+2),_=Ne(t,n+4),P=Ne(t,n+6),O=Ne(t,n+8),K=Ne(t,n+10),q=Ne(t,n+12),F=Ne(t,n+14);let U=o[0]+(8191&p),j=o[1]+(8191&(p>>>13|S<<3)),G=o[2]+(8191&(S>>>10|_<<6)),B=o[3]+(8191&(_>>>7|P<<9)),N=o[4]+(8191&(P>>>4|O<<12)),I=o[5]+(O>>>1&8191),C=o[6]+(8191&(O>>>14|K<<2)),R=o[7]+(8191&(K>>>11|q<<5)),D=o[8]+(8191&(q>>>8|F<<8)),y=o[9]+(F>>>5|i),E=0,k=E+U*s+j*(5*w)+G*(5*m)+B*(5*g)+N*(5*h);E=k>>>13,k&=8191,k+=I*(5*f)+C*(5*d)+R*(5*u)+D*(5*l)+y*(5*a),E+=k>>>13,k&=8191;let M=E+U*a+j*s+G*(5*w)+B*(5*m)+N*(5*g);E=M>>>13,M&=8191,M+=I*(5*h)+C*(5*f)+R*(5*d)+D*(5*u)+y*(5*l),E+=M>>>13,M&=8191;let b=E+U*l+j*a+G*s+B*(5*w)+N*(5*m);E=b>>>13,b&=8191,b+=I*(5*g)+C*(5*h)+R*(5*f)+D*(5*d)+y*(5*u),E+=b>>>13,b&=8191;let v=E+U*u+j*l+G*a+B*s+N*(5*w);E=v>>>13,v&=8191,v+=I*(5*m)+C*(5*g)+R*(5*h)+D*(5*f)+y*(5*d),E+=v>>>13,v&=8191;let A=E+U*d+j*u+G*l+B*a+N*s;E=A>>>13,A&=8191,A+=I*(5*w)+C*(5*m)+R*(5*g)+D*(5*h)+y*(5*f),E+=A>>>13,A&=8191;let x=E+U*f+j*d+G*u+B*l+N*a;E=x>>>13,x&=8191,x+=I*s+C*(5*w)+R*(5*m)+D*(5*g)+y*(5*h),E+=x>>>13,x&=8191;let T=E+U*h+j*f+G*d+B*u+N*l;E=T>>>13,T&=8191,T+=I*a+C*s+R*(5*w)+D*(5*m)+y*(5*g),E+=T>>>13,T&=8191;let L=E+U*g+j*h+G*f+B*d+N*u;E=L>>>13,L&=8191,L+=I*l+C*a+R*s+D*(5*w)+y*(5*m),E+=L>>>13,L&=8191;let $=E+U*m+j*g+G*h+B*f+N*d;E=$>>>13,$&=8191,$+=I*u+C*l+R*a+D*s+y*(5*w),E+=$>>>13,$&=8191;let H=E+U*w+j*m+G*g+B*h+N*f;E=H>>>13,H&=8191,H+=I*d+C*u+R*l+D*a+y*s,E+=H>>>13,H&=8191,E=(E<<2)+E|0,E=E+k|0,k=8191&E,E>>>=13,M+=E,o[0]=k,o[1]=M,o[2]=b,o[3]=v,o[4]=A,o[5]=x,o[6]=T,o[7]=L,o[8]=$,o[9]=H}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let i=t[1]>>>13;t[1]&=8191;for(let s=2;s<10;s++)t[s]+=i,i=t[s]>>>13,t[s]&=8191;t[0]+=5*i,i=t[0]>>>13,t[0]&=8191,t[1]+=i,i=t[1]>>>13,t[1]&=8191,t[2]+=i,r[0]=t[0]+5,i=r[0]>>>13,r[0]&=8191;for(let s=1;s<10;s++)r[s]=t[s]+i,i=r[s]>>>13,r[s]&=8191;r[9]-=8192;let o=(1^i)-1;for(let s=0;s<10;s++)r[s]&=o;o=~o;for(let s=0;s<10;s++)t[s]=t[s]&o|r[s];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let c=t[0]+n[0];t[0]=65535&c;for(let s=1;s<8;s++)c=(t[s]+n[s]|0)+(c>>>16)|0,t[s]=65535&c;(0,fr.clean)(r)}update(t){(0,oi.exists)(this);const{buffer:n,blockLen:r}=this,i=(t=(0,fr.toBytes)(t)).length;for(let o=0;o<i;){const c=Math.min(r-this.pos,i-o);if(c!==r)n.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(n,0,!1),this.pos=0);else for(;r<=i-o;o+=r)this.process(t,o)}return this}destroy(){(0,fr.clean)(this.h,this.r,this.buffer,this.pad)}digestInto(t){(0,oi.exists)(this),(0,oi.output)(t,this),this.finished=!0;const{buffer:n,h:r}=this;let{pos:i}=this;if(i){for(n[i++]=1;i<16;i++)n[i]=0;this.process(n,0,!0)}this.finalize();let o=0;for(let c=0;c<8;c++)t[o++]=r[c]>>>0,t[o++]=r[c]>>>8;return t}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}function Ed(e){const t=(r,i)=>e(i).update((0,fr.toBytes)(r)).digest(),n=e(new Uint8Array(32));return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=r=>e(r),t}gr.poly1305=Ed(e=>new z0(e)),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.xchacha20poly1305=e.chacha20poly1305=e._poly1305_aead=e.chacha12=e.chacha8=e.xchacha20=e.chacha20=e.chacha20orig=void 0,e.hchacha=c;const t=Wn,n=He,r=gr,i=at;function o(d,f,h,g,m,w=20){let p=d[0],S=d[1],_=d[2],P=d[3],O=f[0],K=f[1],q=f[2],F=f[3],U=f[4],j=f[5],G=f[6],B=f[7],N=m,I=h[0],C=h[1],R=h[2],D=p,y=S,E=_,k=P,M=O,b=K,v=q,A=F,x=U,T=j,L=G,$=B,H=N,z=I,J=C,Q=R;for(let se=0;se<w;se+=2)D=D+M|0,H=(0,t.rotl)(H^D,16),x=x+H|0,M=(0,t.rotl)(M^x,12),D=D+M|0,H=(0,t.rotl)(H^D,8),x=x+H|0,M=(0,t.rotl)(M^x,7),y=y+b|0,z=(0,t.rotl)(z^y,16),T=T+z|0,b=(0,t.rotl)(b^T,12),y=y+b|0,z=(0,t.rotl)(z^y,8),T=T+z|0,b=(0,t.rotl)(b^T,7),E=E+v|0,J=(0,t.rotl)(J^E,16),L=L+J|0,v=(0,t.rotl)(v^L,12),E=E+v|0,J=(0,t.rotl)(J^E,8),L=L+J|0,v=(0,t.rotl)(v^L,7),k=k+A|0,Q=(0,t.rotl)(Q^k,16),$=$+Q|0,A=(0,t.rotl)(A^$,12),k=k+A|0,Q=(0,t.rotl)(Q^k,8),$=$+Q|0,A=(0,t.rotl)(A^$,7),D=D+b|0,Q=(0,t.rotl)(Q^D,16),L=L+Q|0,b=(0,t.rotl)(b^L,12),D=D+b|0,Q=(0,t.rotl)(Q^D,8),L=L+Q|0,b=(0,t.rotl)(b^L,7),y=y+v|0,H=(0,t.rotl)(H^y,16),$=$+H|0,v=(0,t.rotl)(v^$,12),y=y+v|0,H=(0,t.rotl)(H^y,8),$=$+H|0,v=(0,t.rotl)(v^$,7),E=E+A|0,z=(0,t.rotl)(z^E,16),x=x+z|0,A=(0,t.rotl)(A^x,12),E=E+A|0,z=(0,t.rotl)(z^E,8),x=x+z|0,A=(0,t.rotl)(A^x,7),k=k+M|0,J=(0,t.rotl)(J^k,16),T=T+J|0,M=(0,t.rotl)(M^T,12),k=k+M|0,J=(0,t.rotl)(J^k,8),T=T+J|0,M=(0,t.rotl)(M^T,7);let ne=0;g[ne++]=p+D|0,g[ne++]=S+y|0,g[ne++]=_+E|0,g[ne++]=P+k|0,g[ne++]=O+M|0,g[ne++]=K+b|0,g[ne++]=q+v|0,g[ne++]=F+A|0,g[ne++]=U+x|0,g[ne++]=j+T|0,g[ne++]=G+L|0,g[ne++]=B+$|0,g[ne++]=N+H|0,g[ne++]=I+z|0,g[ne++]=C+J|0,g[ne++]=R+Q|0}function c(d,f,h,g){let m=d[0],w=d[1],p=d[2],S=d[3],_=f[0],P=f[1],O=f[2],K=f[3],q=f[4],F=f[5],U=f[6],j=f[7],G=h[0],B=h[1],N=h[2],I=h[3];for(let R=0;R<20;R+=2)m=m+_|0,G=(0,t.rotl)(G^m,16),q=q+G|0,_=(0,t.rotl)(_^q,12),m=m+_|0,G=(0,t.rotl)(G^m,8),q=q+G|0,_=(0,t.rotl)(_^q,7),w=w+P|0,B=(0,t.rotl)(B^w,16),F=F+B|0,P=(0,t.rotl)(P^F,12),w=w+P|0,B=(0,t.rotl)(B^w,8),F=F+B|0,P=(0,t.rotl)(P^F,7),p=p+O|0,N=(0,t.rotl)(N^p,16),U=U+N|0,O=(0,t.rotl)(O^U,12),p=p+O|0,N=(0,t.rotl)(N^p,8),U=U+N|0,O=(0,t.rotl)(O^U,7),S=S+K|0,I=(0,t.rotl)(I^S,16),j=j+I|0,K=(0,t.rotl)(K^j,12),S=S+K|0,I=(0,t.rotl)(I^S,8),j=j+I|0,K=(0,t.rotl)(K^j,7),m=m+P|0,I=(0,t.rotl)(I^m,16),U=U+I|0,P=(0,t.rotl)(P^U,12),m=m+P|0,I=(0,t.rotl)(I^m,8),U=U+I|0,P=(0,t.rotl)(P^U,7),w=w+O|0,G=(0,t.rotl)(G^w,16),j=j+G|0,O=(0,t.rotl)(O^j,12),w=w+O|0,G=(0,t.rotl)(G^w,8),j=j+G|0,O=(0,t.rotl)(O^j,7),p=p+K|0,B=(0,t.rotl)(B^p,16),q=q+B|0,K=(0,t.rotl)(K^q,12),p=p+K|0,B=(0,t.rotl)(B^p,8),q=q+B|0,K=(0,t.rotl)(K^q,7),S=S+_|0,N=(0,t.rotl)(N^S,16),F=F+N|0,_=(0,t.rotl)(_^F,12),S=S+_|0,N=(0,t.rotl)(N^S,8),F=F+N|0,_=(0,t.rotl)(_^F,7);let C=0;g[C++]=m,g[C++]=w,g[C++]=p,g[C++]=S,g[C++]=G,g[C++]=B,g[C++]=N,g[C++]=I}e.chacha20orig=(0,t.createCipher)(o,{counterRight:!1,counterLength:8,allowShortKeys:!0}),e.chacha20=(0,t.createCipher)(o,{counterRight:!1,counterLength:4,allowShortKeys:!1}),e.xchacha20=(0,t.createCipher)(o,{counterRight:!1,counterLength:8,extendNonceFn:c,allowShortKeys:!1}),e.chacha8=(0,t.createCipher)(o,{counterRight:!1,counterLength:4,rounds:8}),e.chacha12=(0,t.createCipher)(o,{counterRight:!1,counterLength:4,rounds:12});const s=new Uint8Array(16),a=(d,f)=>{d.update(f);const h=f.length%16;h&&d.update(s.subarray(h))},l=new Uint8Array(32);function u(d,f,h,g,m){const w=d(f,h,l),p=r.poly1305.create(w);m&&a(p,m),a(p,g);const S=new Uint8Array(16),_=(0,i.createView)(S);(0,i.setBigUint64)(_,0,BigInt(m?m.length:0),!0),(0,i.setBigUint64)(_,8,BigInt(g.length),!0),p.update(S);const P=p.digest();return(0,i.clean)(w,S),P}e._poly1305_aead=d=>(f,h,g)=>((0,n.bytes)(f,32),(0,n.bytes)(h),{encrypt(w,p){const S=w.length,_=S+16;p?(0,n.bytes)(p,_):p=new Uint8Array(_),d(f,h,w,p,1);const P=u(d,f,h,p.subarray(0,-16),g);return p.set(P,S),(0,i.clean)(P),p},decrypt(w,p){const S=w.length,_=S-16;if(S<16)throw new Error("encrypted data must be at least 16 bytes");p?(0,n.bytes)(p,_):p=new Uint8Array(_);const P=w.subarray(0,-16),O=w.subarray(-16),K=u(d,f,h,P,g);if(!(0,i.equalBytes)(O,K))throw new Error("invalid tag");return d(f,h,P,p,1),(0,i.clean)(K),p}}),e.chacha20poly1305=(0,i.wrapCipher)({blockSize:64,nonceLength:12,tagLength:16},(0,e._poly1305_aead)(e.chacha20)),e.xchacha20poly1305=(0,i.wrapCipher)({blockSize:64,nonceLength:24,tagLength:16},(0,e._poly1305_aead)(e.xchacha20))}(vd),Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.xchacha20=void 0;var $n,Sc,cr,q0=vd;Ui.xchacha20=function(e,t,n){return(0,q0.xchacha20poly1305)(e,t,n)},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.aesDecrypt=e.aesEncrypt=e.symDecrypt=e.symEncrypt=void 0;var t=at,n=Xs,r=Yn,i=Ui,o=Cr,c=Re;e.symEncrypt=function(u,d,f){return s(a,u,d,f)};function s(u,d,f,h){var g=(0,o.symmetricAlgorithm)();if(g==="aes-256-gcm")return u(r.aes256gcm,d,f,(0,o.symmetricNonceLength)(),c.AEAD_TAG_LENGTH,h);if(g==="xchacha20")return u(i.xchacha20,d,f,c.XCHACHA20_NONCE_LENGTH,c.AEAD_TAG_LENGTH,h);if(g==="aes-256-cbc")return u(r.aes256cbc,d,f,16,0);throw new Error("Not implemented")}function a(u,d,f,h,g,m){var w=(0,n.randomBytes)(h),p=u(d,w,m).encrypt(f);if(g===0)return(0,t.concatBytes)(w,p);var S=p.length-g,_=p.subarray(0,S),P=p.subarray(S);return(0,t.concatBytes)(w,P,_)}function l(u,d,f,h,g,m){var w=f.subarray(0,h),p=u(d,Uint8Array.from(w),m),S=f.subarray(h);if(g===0)return p.decrypt(S);var _=S.subarray(0,g),P=S.subarray(g);return p.decrypt((0,t.concatBytes)(P,_))}e.symDecrypt=function(u,d,f){return s(l,u,d,f)},e.aesEncrypt=e.symEncrypt,e.aesDecrypt=e.symDecrypt}(hc),$n=co,Sc=gt&>.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),cr=gt&>.__exportStar||function(e,t){for(var n in e)n==="default"||Object.prototype.hasOwnProperty.call(t,n)||Sc(t,e,n)},Object.defineProperty($n,"__esModule",{value:!0}),cr(Su,$n),cr(id,$n),cr(Es,$n),cr(hc,$n);var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.PublicKey=void 0;var Cc=at,si=co,W0=function(){function e(t){this.data=(0,si.convertPublicKeyFormat)(t,!0)}return e.fromHex=function(t){return new e((0,si.hexToPublicKey)(t))},Object.defineProperty(e.prototype,"uncompressed",{get:function(){return X.from((0,si.convertPublicKeyFormat)(this.data,!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"compressed",{get:function(){return X.from(this.data)},enumerable:!1,configurable:!0}),e.prototype.toHex=function(t){return t===void 0&&(t=!0),(0,Cc.bytesToHex)(t?this.data:this.uncompressed)},e.prototype.decapsulate=function(t,n){n===void 0&&(n=!1);var r=n?this.data:this.uncompressed,i=t.multiply(this,n);return(0,si.getSharedKey)(r,i)},e.prototype.equals=function(t){return(0,Cc.equalBytes)(this.data,t.data)},e}();Mr.PublicKey=W0,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.PrivateKey=void 0;var Ac=at,Bn=co,V0=Mr,G0=function(){function e(t){if(t===void 0)this.data=(0,Bn.getValidSecret)();else{if(!(0,Bn.isValidPrivateKey)(t))throw new Error("Invalid private key");this.data=t}this.publicKey=new V0.PublicKey((0,Bn.getPublicKey)(this.data))}return e.fromHex=function(t){return new e((0,Bn.decodeHex)(t))},Object.defineProperty(e.prototype,"secret",{get:function(){return X.from(this.data)},enumerable:!1,configurable:!0}),e.prototype.toHex=function(){return(0,Ac.bytesToHex)(this.data)},e.prototype.encapsulate=function(t,n){n===void 0&&(n=!1);var r=n?this.publicKey.compressed:this.publicKey.uncompressed,i=this.multiply(t,n);return(0,Bn.getSharedKey)(r,i)},e.prototype.multiply=function(t,n){return n===void 0&&(n=!1),(0,Bn.getSharedPoint)(this.data,t.compressed,n)},e.prototype.equals=function(t){return(0,Ac.equalBytes)(this.data,t.data)},e}();Ni.PrivateKey=G0,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PublicKey=e.PrivateKey=void 0;var t=Ni;Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return t.PrivateKey}});var n=Mr;Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return n.PublicKey}})}(So),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.PublicKey=e.PrivateKey=e.ECIES_CONFIG=void 0,e.encrypt=function(s,a){var l=new r.PrivateKey,u=s instanceof Uint8Array?new r.PublicKey(s):r.PublicKey.fromHex(s),d=l.encapsulate(u,(0,n.isHkdfKeyCompressed)()),f=(0,n.isEphemeralKeyCompressed)()?l.publicKey.compressed:l.publicKey.uncompressed,h=(0,i.symEncrypt)(d,a);return X.from((0,t.concatBytes)(f,h))},e.decrypt=function(s,a){var l=s instanceof Uint8Array?new r.PrivateKey(s):r.PrivateKey.fromHex(s),u=(0,n.ephemeralKeySize)(),d=new r.PublicKey(a.subarray(0,u)),f=a.subarray(u),h=d.decapsulate(l,(0,n.isHkdfKeyCompressed)());return X.from((0,i.symDecrypt)(h,f))};var t=at,n=Cr,r=So,i=co,o=Cr;Object.defineProperty(e,"ECIES_CONFIG",{enumerable:!0,get:function(){return o.ECIES_CONFIG}});var c=So;Object.defineProperty(e,"PrivateKey",{enumerable:!0,get:function(){return c.PrivateKey}}),Object.defineProperty(e,"PublicKey",{enumerable:!0,get:function(){return c.PublicKey}}),e.utils={aesEncrypt:i.aesEncrypt,aesDecrypt:i.aesDecrypt,symEncrypt:i.symEncrypt,symDecrypt:i.symDecrypt,decodeHex:i.decodeHex,getValidSecret:i.getValidSecret,remove0x:i.remove0x}}(jn);const _d=Ge("KeyExchange:Layer"),Sd=Ge("SocketService:Layer"),Cd=Ge("Ecies:Layer"),Ad=Ge("RemoteCommunication:Layer");_d.color="##95c44e",Sd.color="#f638d7",Cd.color="#465b9c",Ad.color="#47a2be";const W={KeyExchange:_d,SocketService:Sd,Ecies:Cd,RemoteCommunication:Ad};let lr,ai=[],Ko=[];const Gt=(e,t)=>Z(void 0,void 0,void 0,function*(){lr=t,Ko.push(e),function(n){return Z(this,void 0,void 0,function*(){if(!lr||!n)return;(function(){const c=Ko;Ko=ai,ai=c})();const r=lr.endsWith("/")?`${lr}evt`:`${lr}/evt`,i=Object.assign({},n);if(delete i.params,n.params)for(const[c,s]of Object.entries(n.params))i[c]=s;const o=JSON.stringify(i);W.RemoteCommunication(`[sendBufferedEvents] Sending ${ai.length} analytics events to ${r}`);try{const c=yield Zl(r,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:o}),s=yield c.text();W.RemoteCommunication(`[sendBufferedEvents] Response: ${s}`),ai.length=0}catch{}})}(e).catch(()=>{})});class jo{constructor(t){this.enabled=!0,t!=null&&t.debug&&Ge.enable("Ecies:Layer"),this.ecies=t!=null&&t.privateKey?jn.PrivateKey.fromHex(t.privateKey):new jn.PrivateKey,W.Ecies("[ECIES constructor()] initialized secret: ",this.ecies.toHex()),W.Ecies("[ECIES constructor()] initialized public: ",this.ecies.publicKey.toHex()),W.Ecies("[ECIES constructor()] init with",this)}generateECIES(){this.ecies=new jn.PrivateKey}getPublicKey(){return this.ecies.publicKey.toHex()}encrypt(t,n){let r=t;if(this.enabled)try{W.Ecies("[ECIES: encrypt()] using otherPublicKey",n);const i=X.from(t),o=jn.encrypt(n,i);r=X.from(o).toString("base64")}catch(i){throw W.Ecies("[ECIES: encrypt()] error encrypt:",i),W.Ecies("[ECIES: encrypt()] private: ",this.ecies.toHex()),W.Ecies("[ECIES: encrypt()] data: ",t),W.Ecies("[ECIES: encrypt()] otherkey: ",n),i}return r}decrypt(t){let n=t;if(this.enabled)try{W.Ecies("[ECIES: decrypt()] using privateKey",this.ecies.toHex());const r=X.from(t.toString(),"base64");n=jn.decrypt(this.ecies.toHex(),r).toString()}catch(r){throw W.Ecies("[ECIES: decrypt()] error decrypt",r),W.Ecies("[ECIES: decrypt()] private: ",this.ecies.toHex()),W.Ecies("[ECIES: decrypt()] encryptedData: ",t),r}return n}getKeyInfo(){return{private:this.ecies.toHex(),public:this.ecies.publicKey.toHex()}}toString(){W.Ecies("[ECIES: toString()]",this.getKeyInfo())}}var vn={version:"0.33.1"};const er="https://metamask-sdk.api.cx.metamask.io/",Y0=["websocket"],tr=6048e5,Z0=3e3,je={METAMASK_CONNECTSIGN:"metamask_connectSign",METAMASK_CONNECTWITH:"metamask_connectWith",METAMASK_OPEN:"metamask_open",METAMASK_BATCH:"metamask_batch",PERSONAL_SIGN:"personal_sign",WALLET_REQUESTPERMISSIONS:"wallet_requestPermissions",WALLET_REVOKEPERMISSIONS:"wallet_revokePermissions",WALLET_WATCHASSET:"wallet_watchAsset",ETH_REQUESTACCOUNTS:"eth_requestAccounts",ETH_SENDTRANSACTION:"eth_sendTransaction",ETH_SIGNTYPEDDATA:"eth_signTypedData",ETH_SIGNTYPEDDATA_V3:"eth_signTypedData_v3",ETH_SIGNTYPEDDATA_V4:"eth_signTypedData_v4",ETH_SIGNTRANSACTION:"eth_signTransaction",ETH_SIGN:"eth_sign",PERSONAL_EC_RECOVER:"personal_ecRecover"},J0=[je.METAMASK_CONNECTSIGN,je.METAMASK_CONNECTWITH,je.METAMASK_OPEN,je.METAMASK_BATCH,je.PERSONAL_SIGN,je.WALLET_REQUESTPERMISSIONS,je.WALLET_REVOKEPERMISSIONS,je.WALLET_WATCHASSET,je.ETH_SENDTRANSACTION,je.ETH_SIGNTYPEDDATA,je.ETH_SIGNTYPEDDATA_V3,je.ETH_SIGNTYPEDDATA_V4,je.ETH_SIGNTRANSACTION,je.ETH_SIGN,je.PERSONAL_EC_RECOVER];function Hr(e){return J0.includes(e)}function kd(e){const{context:t}=e;W.RemoteCommunication(`[RemoteCommunication: clean()] context=${t}`),e.channelConfig=void 0,e.ready=!1,e.originatorConnectStarted=!1}var Be,te,Hi,_e,Ae,Te,Kn;(Kn=Be||(Be={})).DISCONNECTED="disconnected",Kn.WAITING="waiting",Kn.TIMEOUT="timeout",Kn.LINKED="linked",Kn.PAUSED="paused",Kn.TERMINATED="terminated",function(e){e.KEY_INFO="key_info",e.SERVICE_STATUS="service_status",e.PROVIDER_UPDATE="provider_update",e.RPC_UPDATE="rpc_update",e.KEYS_EXCHANGED="keys_exchanged",e.JOIN_CHANNEL="join_channel",e.PUBLIC_KEY="public_key",e.CHANNEL_CREATED="channel_created",e.CLIENTS_CONNECTED="clients_connected",e.CLIENTS_DISCONNECTED="clients_disconnected",e.CLIENTS_WAITING="clients_waiting",e.CLIENTS_READY="clients_ready",e.REJECTED="rejected",e.WALLET_INIT="wallet_init",e.CHANNEL_PERSISTENCE="channel_persistence",e.CONFIG="config",e.MESSAGE_ACK="ack",e.SOCKET_DISCONNECTED="socket_disconnected",e.SOCKET_RECONNECT="socket_reconnect",e.OTP="otp",e.SDK_RPC_CALL="sdk_rpc_call",e.AUTHORIZED="authorized",e.CONNECTION_STATUS="connection_status",e.MESSAGE="message",e.TERMINATE="terminate"}(te||(te={})),(Hi||(Hi={})).KEY_EXCHANGE="key_exchange",function(e){e.KEY_HANDSHAKE_START="key_handshake_start",e.KEY_HANDSHAKE_CHECK="key_handshake_check",e.KEY_HANDSHAKE_SYN="key_handshake_SYN",e.KEY_HANDSHAKE_SYNACK="key_handshake_SYNACK",e.KEY_HANDSHAKE_ACK="key_handshake_ACK",e.KEY_HANDSHAKE_WALLET="key_handshake_wallet",e.KEY_HANDSHAKE_NONE="none"}(_e||(_e={}));class X0 extends oo.EventEmitter2{constructor({communicationLayer:t,otherPublicKey:n,context:r,ecies:i,logging:o}){super(),this.keysExchanged=!1,this.step=_e.KEY_HANDSHAKE_NONE,this.debug=!1,this.context=r,this.communicationLayer=t,i!=null&&i.privateKey&&n&&(W.KeyExchange(`[KeyExchange: constructor()] otherPubKey=${n} set keysExchanged to true!`,i),this.keysExchanged=!0),this.myECIES=new jo(Object.assign(Object.assign({},i),{debug:o==null?void 0:o.eciesLayer})),this.communicationLayer.state.eciesInstance=this.myECIES,this.myPublicKey=this.myECIES.getPublicKey(),this.debug=(o==null?void 0:o.keyExchangeLayer)===!0,n&&this.setOtherPublicKey(n),this.communicationLayer.on(Hi.KEY_EXCHANGE,this.onKeyExchangeMessage.bind(this))}onKeyExchangeMessage(t){const{relayPersistence:n}=this.communicationLayer.remote.state;if(W.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} keysExchanged=${this.keysExchanged} relayPersistence=${n}`,t),n)return void W.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Ignoring key exchange message because relay persistence is activated");const{message:r}=t;this.keysExchanged&&W.KeyExchange(`[KeyExchange: onKeyExchangeMessage()] context=${this.context} received handshake while already exchanged. step=${this.step} otherPubKey=${this.otherPublicKey}`),this.emit(te.KEY_INFO,r.type),r.type===_e.KEY_HANDSHAKE_SYN?(this.checkStep([_e.KEY_HANDSHAKE_NONE,_e.KEY_HANDSHAKE_ACK]),W.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYN",r),r.pubkey&&this.setOtherPublicKey(r.pubkey),this.communicationLayer.sendMessage({type:_e.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey}).catch(i=>{W.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_SYNACK",i)}),this.setStep(_e.KEY_HANDSHAKE_ACK)):r.type===_e.KEY_HANDSHAKE_SYNACK?(this.checkStep([_e.KEY_HANDSHAKE_SYNACK,_e.KEY_HANDSHAKE_ACK,_e.KEY_HANDSHAKE_NONE]),W.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_SYNACK"),r.pubkey&&this.setOtherPublicKey(r.pubkey),this.communicationLayer.sendMessage({type:_e.KEY_HANDSHAKE_ACK}).catch(i=>{W.KeyExchange("[KeyExchange: onKeyExchangeMessage()] Error sending KEY_HANDSHAKE_ACK",i)}),this.keysExchanged=!0,this.setStep(_e.KEY_HANDSHAKE_ACK),this.emit(te.KEYS_EXCHANGED)):r.type===_e.KEY_HANDSHAKE_ACK&&(W.KeyExchange("[KeyExchange: onKeyExchangeMessage()] KEY_HANDSHAKE_ACK set keysExchanged to true!"),this.checkStep([_e.KEY_HANDSHAKE_ACK,_e.KEY_HANDSHAKE_NONE]),this.keysExchanged=!0,this.setStep(_e.KEY_HANDSHAKE_ACK),this.emit(te.KEYS_EXCHANGED))}resetKeys(t){this.clean(),this.myECIES=new jo(t)}clean(){W.KeyExchange(`[KeyExchange: clean()] context=${this.context} reset handshake state`),this.setStep(_e.KEY_HANDSHAKE_NONE),this.emit(te.KEY_INFO,this.step),this.keysExchanged=!1}start({isOriginator:t,force:n}){const{relayPersistence:r,protocolVersion:i}=this.communicationLayer.remote.state,o=i>=2;r?W.KeyExchange("[KeyExchange: start()] Ignoring key exchange message because relay persistence is activated"):(W.KeyExchange(`[KeyExchange: start()] context=${this.context} protocolVersion=${i} isOriginator=${t} step=${this.step} force=${n} relayPersistence=${r} keysExchanged=${this.keysExchanged}`),t?!(this.keysExchanged||this.step!==_e.KEY_HANDSHAKE_NONE&&this.step!==_e.KEY_HANDSHAKE_SYNACK)||n?(W.KeyExchange(`[KeyExchange: start()] context=${this.context} -- start key exchange (force=${n}) -- step=${this.step}`,this.step),this.clean(),this.setStep(_e.KEY_HANDSHAKE_SYNACK),this.communicationLayer.sendMessage({type:_e.KEY_HANDSHAKE_SYN,pubkey:this.myPublicKey,v:2}).catch(c=>{W.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYN",c)})):W.KeyExchange(`[KeyExchange: start()] context=${this.context} -- key exchange already ${this.keysExchanged?"done":"in progress"} -- aborted.`,this.step):this.keysExchanged&&n!==!0?W.KeyExchange("[KeyExchange: start()] don't send KEY_HANDSHAKE_START -- exchange already done."):o?this.communicationLayer.sendMessage({type:_e.KEY_HANDSHAKE_SYNACK,pubkey:this.myPublicKey,v:2}).catch(c=>{W.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_SYNACK",c)}):(this.communicationLayer.sendMessage({type:_e.KEY_HANDSHAKE_START}).catch(c=>{W.KeyExchange("[KeyExchange: start()] Error sending KEY_HANDSHAKE_START",c)}),this.clean()))}setStep(t){this.step=t,this.emit(te.KEY_INFO,t)}checkStep(t){t.length>0&&t.indexOf(this.step.toString())}setRelayPersistence({localKey:t,otherKey:n}){this.otherPublicKey=n,this.myECIES=new jo({privateKey:t,debug:this.debug}),this.keysExchanged=!0}setKeysExchanged(t){this.keysExchanged=t}areKeysExchanged(){return this.keysExchanged}getMyPublicKey(){return this.myPublicKey}getOtherPublicKey(){return this.otherPublicKey}setOtherPublicKey(t){W.KeyExchange("[KeyExchange: setOtherPubKey()]",t),this.otherPublicKey=t}encryptMessage(t){if(!this.otherPublicKey)throw new Error("encryptMessage: Keys not exchanged - missing otherPubKey");return this.myECIES.encrypt(t,this.otherPublicKey)}decryptMessage(t){if(!this.otherPublicKey)throw new Error("decryptMessage: Keys not exchanged - missing otherPubKey");return this.myECIES.decrypt(t)}getKeyInfo(){return{ecies:Object.assign(Object.assign({},this.myECIES.getKeyInfo()),{otherPubKey:this.otherPublicKey}),step:this.step,keysExchanged:this.areKeysExchanged()}}toString(){const t={keyInfo:this.getKeyInfo(),keysExchanged:this.keysExchanged,step:this.step};return JSON.stringify(t)}}(function(e){e.TERMINATE="terminate",e.ANSWER="answer",e.OFFER="offer",e.CANDIDATE="candidate",e.JSONRPC="jsonrpc",e.WALLET_INFO="wallet_info",e.WALLET_INIT="wallet_init",e.ORIGINATOR_INFO="originator_info",e.PAUSE="pause",e.OTP="otp",e.AUTHORIZED="authorized",e.PING="ping",e.READY="ready"})(Ae||(Ae={})),function(e){e.REQUEST="sdk_connect_request_started",e.REQUEST_MOBILE="sdk_connect_request_started_mobile",e.RECONNECT="sdk_reconnect_request_started",e.CONNECTED="sdk_connection_established",e.CONNECTED_MOBILE="sdk_connection_established_mobile",e.AUTHORIZED="sdk_connection_authorized",e.REJECTED="sdk_connection_rejected",e.TERMINATED="sdk_connection_terminated",e.DISCONNECTED="sdk_disconnected",e.SDK_USE_EXTENSION="sdk_use_extension",e.SDK_RPC_REQUEST="sdk_rpc_request",e.SDK_RPC_REQUEST_RECEIVED="sdk_rpc_request_received",e.SDK_RPC_REQUEST_DONE="sdk_rpc_request_done",e.SDK_EXTENSION_UTILIZED="sdk_extension_utilized",e.SDK_USE_INAPP_BROWSER="sdk_use_inapp_browser"}(Te||(Te={}));const vi=(e,t,n)=>Z(void 0,void 0,void 0,function*(){var r,i,o,c,s,a;const{remote:l,state:u}=e,{channelId:d,isOriginator:f}=u;if(t==="error_terminated")return W.SocketService(`handleJoinChannelResults: Channel ${d} terminated`),void e.emit(te.TERMINATE);if(!n)return void W.SocketService(`handleJoinChannelResults: No result for channel ${d}`);const{persistence:h,walletKey:g,rejected:m}=n;if(W.SocketService(`handleJoinChannelResults: Channel ${d} persistence=${h} walletKey=${g} rejected=${m}`),m)return W.SocketService(`handleJoinChannelResults: Channel ${d} rejected`),yield e.remote.disconnect({terminate:!0}),e.remote.emit(te.REJECTED,{channelId:d}),void e.remote.emitServiceStatusEvent();if(g&&!(!((r=l.state.channelConfig)===null||r===void 0)&&r.otherKey)){e.getKeyExchange().setOtherPublicKey(g),(i=e.state.keyExchange)===null||i===void 0||i.setKeysExchanged(!0),l.state.ready=!0,l.state.authorized=!0,l.emit(te.AUTHORIZED);const{communicationLayer:w,storageManager:p}=l.state,S=Object.assign(Object.assign({},l.state.channelConfig),{channelId:(o=l.state.channelId)!==null&&o!==void 0?o:"",validUntil:Date.now()+tr,localKey:w==null?void 0:w.getKeyInfo().ecies.private,otherKey:g});e.sendMessage({type:_e.KEY_HANDSHAKE_ACK}).catch(_=>{}),(c=e.state.socket)===null||c===void 0||c.emit(Ae.PING,{id:d,clientType:f?"dapp":"wallet",context:"on_channel_reconnect",message:""}),yield p==null?void 0:p.persistChannelConfig(S),l.emitServiceStatusEvent(),l.setConnectionStatus(Be.LINKED)}h&&(e.emit(te.CHANNEL_PERSISTENCE),(s=e.state.keyExchange)===null||s===void 0||s.setKeysExchanged(!0),l.state.ready=!0,l.state.authorized=!0,l.emit(te.AUTHORIZED),Gt(Object.assign(Object.assign({id:d??"",event:f?Te.CONNECTED:Te.CONNECTED_MOBILE},e.remote.state.originatorInfo),{sdkVersion:e.remote.state.sdkVersion,commLayer:e.state.communicationLayerPreference,commLayerVersion:vn.version,walletVersion:(a=e.remote.state.walletInfo)===null||a===void 0?void 0:a.version}),u.communicationServerUrl).catch(w=>{}))}),Jn=e=>new Promise(t=>{setTimeout(t,e)}),kc=(e,t,...n)=>Z(void 0,[e,t,...n],void 0,function*(r,i,o=200){let c;const s=Date.now();let a=!1;for(;!a;){if(a=Date.now()-s>3e5,c=i[r],c.elapsedTime!==void 0)return c;yield Jn(o)}throw new Error(`RPC ${r} timed out`)}),As=e=>Z(void 0,void 0,void 0,function*(){const{state:t}=e,{socket:n,channelId:r,context:i,isOriginator:o,isReconnecting:c}=t;if(c)return W.SocketService("[SocketService: reconnectSocket()] Reconnection already in progress, skipping",e),!1;if(!n)return W.SocketService("[SocketService: reconnectSocket()] socket is not defined",e),!1;if(!r)return!1;const{connected:s}=n;t.isReconnecting=!0,t.reconnectionAttempts=0,W.SocketService(`[SocketService: reconnectSocket()] connected=${s} trying to reconnect after socketio disconnection`,e);try{for(;3>t.reconnectionAttempts;){if(W.SocketService(`[SocketService: reconnectSocket()] Attempt ${t.reconnectionAttempts+1} of 3`,e),yield Jn(200),n.connected)return W.SocketService("Socket already connected --- ping to retrieve messages"),n.emit(Ae.PING,{id:r,clientType:o?"dapp":"wallet",context:"on_channel_config",message:""}),!0;t.resumed=!0,n.connect(),e.emit(te.SOCKET_RECONNECT);try{if(yield new Promise((a,l)=>{n.emit(te.JOIN_CHANNEL,{channelId:r,context:`${i}connect_again`,clientType:o?"dapp":"wallet"},(u,d)=>Z(void 0,void 0,void 0,function*(){try{yield vi(e,u,d),a()}catch(f){l(f)}}))}),yield Jn(100),n.connected)return W.SocketService(`Reconnection successful on attempt ${t.reconnectionAttempts+1}`),!0}catch(a){W.SocketService(`Error during reconnection attempt ${t.reconnectionAttempts+1}:`,a)}t.reconnectionAttempts+=1,3>t.reconnectionAttempts&&(yield Jn(200))}return W.SocketService("Failed to reconnect after 3 attempts"),!1}finally{t.isReconnecting=!1,t.reconnectionAttempts=0}});function xd(e,t){return Z(this,void 0,void 0,function*(){var n;const r=(n=e.state.keyExchange)===null||n===void 0?void 0:n.encryptMessage(JSON.stringify(t)),i={id:e.state.channelId,context:e.state.context,clientType:e.state.isOriginator?"dapp":"wallet",message:r,plaintext:e.state.hasPlaintext?JSON.stringify(t):void 0};return W.SocketService(`[SocketService: encryptAndSendMessage()] context=${e.state.context}`,i),t.type===Ae.TERMINATE&&(e.state.manualDisconnect=!0),new Promise((o,c)=>{var s;(s=e.state.socket)===null||s===void 0||s.emit(te.MESSAGE,i,(a,l)=>{var u;a&&(W.SocketService(`[SocketService: encryptAndSendMessage()] error=${a}`),c(a)),W.SocketService("[encryptAndSendMessage] response",l),o((u=l==null?void 0:l.success)!==null&&u!==void 0&&u)})})})}var Vn;(function(e){e.RPC_CHECK="rpcCheck",e.SKIPPED_RPC="skippedRpc"})(Vn||(Vn={}));const Md=["eth_sendTransaction","eth_signTypedData","eth_signTransaction","personal_sign","wallet_requestPermissions","wallet_switchEthereumChain","eth_signTypedData_v3","eth_signTypedData_v4","metamask_connectSign","metamask_connectWith","metamask_batch"].map(e=>e.toLowerCase()),Q0=[{event:te.CLIENTS_CONNECTED,handler:function(e,t){return n=>Z(this,void 0,void 0,function*(){var r,i,o,c,s,a,l,u,d,f,h;const g=(i=(r=e.remote.state.channelConfig)===null||r===void 0?void 0:r.relayPersistence)!==null&&i!==void 0&&i;if(W.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected-${t}' relayPersistence=${g} resumed=${e.state.resumed} clientsPaused=${e.state.clientsPaused} keysExchanged=${(o=e.state.keyExchange)===null||o===void 0?void 0:o.areKeysExchanged()} isOriginator=${e.state.isOriginator}`),e.emit(te.CLIENTS_CONNECTED,{isOriginator:e.state.isOriginator,keysExchanged:(c=e.state.keyExchange)===null||c===void 0?void 0:c.areKeysExchanged(),context:e.state.context}),e.state.resumed)e.state.isOriginator||(W.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} 'clients_connected' / keysExchanged=${(s=e.state.keyExchange)===null||s===void 0?void 0:s.areKeysExchanged()} -- backward compatibility`),(a=e.state.keyExchange)===null||a===void 0||a.start({isOriginator:(l=e.state.isOriginator)!==null&&l!==void 0&&l})),e.state.resumed=!1;else if(e.state.clientsPaused)W.SocketService("[SocketService: handleClientsConnected()] 'clients_connected' skip sending originatorInfo on pause");else if(!e.state.isOriginator){const m=!g;W.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected' / keysExchanged=${(u=e.state.keyExchange)===null||u===void 0?void 0:u.areKeysExchanged()} -- force=${m} -- backward compatibility`),W.SocketService(`[SocketService: handleClientsConnected()] context=${e.state.context} on 'clients_connected' / keysExchanged=${(d=e.state.keyExchange)===null||d===void 0?void 0:d.areKeysExchanged()} -- force=${m} -- backward compatibility`),(f=e.state.keyExchange)===null||f===void 0||f.start({isOriginator:(h=e.state.isOriginator)!==null&&h!==void 0&&h,force:m})}e.state.clientsConnected=!0,e.state.clientsPaused=!1})}},{event:te.CHANNEL_CREATED,handler:function(e,t){return n=>{W.SocketService(`[SocketService: handleChannelCreated()] context=${e.state.context} on 'channel_created-${t}'`,n),e.emit(te.CHANNEL_CREATED,n)}}},{event:te.CLIENTS_DISCONNECTED,handler:function(e,t){return()=>{var n;e.state.clientsConnected=!1,W.SocketService(`[SocketService: handlesClientsDisconnected()] context=${e.state.context} on 'clients_disconnected-${t}'`),e.remote.state.relayPersistence?W.SocketService(`[SocketService: handlesClientsDisconnected()] context=${e.state.context} on 'clients_disconnected-${t}' - relayPersistence enabled, skipping key exchange cleanup.`):(e.state.isOriginator&&!e.state.clientsPaused&&((n=e.state.keyExchange)===null||n===void 0||n.clean()),e.emit(te.CLIENTS_DISCONNECTED,t))}}},{event:te.CONFIG,handler:function(e,t){return n=>Z(this,void 0,void 0,function*(){var r,i,o;W.SocketService(`[SocketService: handleChannelConfig()] update relayPersistence on 'config-${t}'`,n);const{persistence:c,walletKey:s}=n;e.state.isOriginator&&e.remote.state.channelConfig?(n.walletKey&&!e.remote.state.channelConfig.otherKey&&(W.SocketService(`Setting wallet key ${s}`),e.remote.state.channelConfig.otherKey=s,e.getKeyExchange().setOtherPublicKey(n.walletKey),(r=e.state.keyExchange)===null||r===void 0||r.setKeysExchanged(!0),yield e.remote.sendMessage({type:_e.KEY_HANDSHAKE_ACK}),yield e.remote.sendMessage({type:Ae.PING}),yield(i=e.remote.state.storageManager)===null||i===void 0?void 0:i.persistChannelConfig(e.remote.state.channelConfig)),c!==!0||e.remote.state.channelConfig.relayPersistence||(W.SocketService(`Setting relay persistence ${c}`),e.remote.state.channelConfig.relayPersistence=c,e.remote.state.relayPersistence=!0,e.remote.emit(te.CHANNEL_PERSISTENCE),e.remote.state.authorized=!0,e.remote.state.ready=!0,e.remote.emit(te.AUTHORIZED),yield(o=e.remote.state.storageManager)===null||o===void 0?void 0:o.persistChannelConfig(e.remote.state.channelConfig))):e.state.isOriginator||n.persistence&&(e.remote.state.relayPersistence=!0,e.remote.emit(te.CHANNEL_PERSISTENCE))})}},{event:te.MESSAGE,handler:function(e,t){return n=>{var r,i,o,c,s,a,l,u,d,f,h,g,m,w,p,S,_,P;const{ackId:O,message:K,error:q}=n,F=(r=e.remote.state.relayPersistence)!==null&&r!==void 0&&r;if(W.SocketService(`[SocketService handleMessage()] relayPersistence=${F} context=${e.state.context} on 'message' ${t} keysExchanged=${(i=e.state.keyExchange)===null||i===void 0?void 0:i.areKeysExchanged()}`,n),q)throw W.SocketService(`
|
|
9
|
+
[SocketService handleMessage()] context=${e.state.context}::on 'message' error=${q}`),new Error(q);const U=typeof K=="string";if(!U&&(K==null?void 0:K.type)===_e.KEY_HANDSHAKE_START)return F?void 0:(W.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' received HANDSHAKE_START isOriginator=${e.state.isOriginator}`,K),void((o=e.state.keyExchange)===null||o===void 0||o.start({isOriginator:(c=e.state.isOriginator)!==null&&c!==void 0&&c,force:!0})));if(!U&&(!((s=K==null?void 0:K.type)===null||s===void 0)&&s.startsWith("key_handshake")))return F?void 0:(W.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' emit KEY_EXCHANGE`,K),void e.emit(Hi.KEY_EXCHANGE,{message:K,context:e.state.context}));if(U&&!(!((a=e.state.keyExchange)===null||a===void 0)&&a.areKeysExchanged())){let B=!1;try{W.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' trying to decrypt message`),(l=e.state.keyExchange)===null||l===void 0||l.decryptMessage(K),B=!0}catch(N){W.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' error`,N)}if(!B)return e.state.isOriginator?(d=e.state.keyExchange)===null||d===void 0||d.start({isOriginator:(f=e.state.isOriginator)!==null&&f!==void 0&&f}):e.sendMessage({type:_e.KEY_HANDSHAKE_START}).catch(N=>{}),void W.SocketService(`Message ignored because invalid key exchange status. step=${(h=e.state.keyExchange)===null||h===void 0?void 0:h.getKeyInfo().step}`,(g=e.state.keyExchange)===null||g===void 0?void 0:g.getKeyInfo(),K);W.SocketService("Invalid key exchange status detected --- updating it."),(u=e.state.keyExchange)===null||u===void 0||u.setKeysExchanged(!0)}else if(!U&&(K!=null&&K.type))return void e.emit(te.MESSAGE,K);if(!U)return void e.emit(te.MESSAGE,K);const j=(m=e.state.keyExchange)===null||m===void 0?void 0:m.decryptMessage(K),G=JSON.parse(j??"{}");if(O&&(O==null?void 0:O.length)>0&&(W.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' ackid=${O} channelId=${t}`),(w=e.state.socket)===null||w===void 0||w.emit(te.MESSAGE_ACK,{ackId:O,channelId:t,clientType:e.state.isOriginator?"dapp":"wallet"})),e.state.clientsPaused=(G==null?void 0:G.type)===Ae.PAUSE,e.state.isOriginator&&G.data){const B=G.data,N=e.state.rpcMethodTracker[B.id];if(N){const I=Date.now()-N.timestamp;W.SocketService(`[SocketService handleMessage()] context=${e.state.context}::on 'message' received answer for id=${B.id} method=${N.method} responseTime=${I}`,G),e.remote.state.analytics&&Md.includes(N.method.toLowerCase())&&Gt(Object.assign(Object.assign({id:(p=e.remote.state.channelId)!==null&&p!==void 0?p:"",event:Te.SDK_RPC_REQUEST_DONE,sdkVersion:e.remote.state.sdkVersion,commLayerVersion:vn.version},e.remote.state.originatorInfo),{walletVersion:(S=e.remote.state.walletInfo)===null||S===void 0?void 0:S.version,params:{method:N.method,from:"mobile"}}),e.remote.state.communicationServerUrl).catch(R=>{}),Hr(N.method)&&Me.analytics.track(B.error?B.error.code===4001?"sdk_action_rejected":"sdk_action_failed":"sdk_action_succeeded",{action:N.method});const C=Object.assign(Object.assign({},N),{result:B.result,error:B.error?{code:(_=B.error)===null||_===void 0?void 0:_.code,message:(P=B.error)===null||P===void 0?void 0:P.message}:void 0,elapsedTime:I});e.state.rpcMethodTracker[B.id]=C,e.emit(te.RPC_UPDATE,C)}}e.emit(te.MESSAGE,{message:G})}}},{event:te.REJECTED,handler:function(e,t){return n=>Z(this,void 0,void 0,function*(){var r;e.state.isOriginator&&!e.remote.state.ready?(W.SocketService(`[SocketService: handleChannelRejected()] context=${e.state.context} channelId=${t} isOriginator=${e.state.isOriginator} ready=${e.remote.state.ready}`,e.remote.state.originatorInfo),Gt(Object.assign(Object.assign({id:t,event:Te.REJECTED},e.remote.state.originatorInfo),{sdkVersion:e.remote.state.sdkVersion,commLayer:e.state.communicationLayerPreference,commLayerVersion:vn.version,walletVersion:(r=e.remote.state.walletInfo)===null||r===void 0?void 0:r.version}),e.remote.state.communicationServerUrl).catch(i=>{}),Me.analytics.track("sdk_connection_rejected",{transport_type:"websocket"}),yield e.remote.disconnect({terminate:!0}),e.remote.emit(te.REJECTED,{channelId:t}),e.remote.setConnectionStatus(Be.DISCONNECTED)):W.SocketService(`[SocketService: handleChannelRejected()] SKIP -- channelId=${t} isOriginator=${e.state.isOriginator} ready=${e.remote.state.ready}`)})}},{event:"clients_waiting_to_join",handler:function(e,t){return n=>{W.SocketService(`[SocketService: handleClientsWaitingToJoin()] context=${e.state.context} on 'clients_waiting_to_join-${t}'`,n),e.emit(te.CLIENTS_WAITING,n)}}}],ep=[{event:te.KEY_INFO,handler:function(e){return t=>{W.SocketService("[SocketService: handleKeyInfo()] on 'KEY_INFO'",t),e.emit(te.KEY_INFO,t)}}},{event:te.KEYS_EXCHANGED,handler:function(e){return()=>{var t,n,r;W.SocketService(`[SocketService: handleKeysExchanged()] on 'keys_exchanged' keyschanged=${(t=e.state.keyExchange)===null||t===void 0?void 0:t.areKeysExchanged()}`);const{channelConfig:i}=e.remote.state;if(i){const c=e.getKeyExchange().getKeyInfo().ecies;i.localKey=c.private,i.otherKey=c.otherPubKey,e.remote.state.channelConfig=i,(n=e.remote.state.storageManager)===null||n===void 0||n.persistChannelConfig(i).catch(s=>{})}e.emit(te.KEYS_EXCHANGED,{keysExchanged:(r=e.state.keyExchange)===null||r===void 0?void 0:r.areKeysExchanged(),isOriginator:e.state.isOriginator});const o={keyInfo:e.getKeyInfo()};e.emit(te.SERVICE_STATUS,o)}}}];function xc(e,t){W.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} setting socket listeners for channel ${t}...`);const{socket:n}=e.state,{keyExchange:r}=e.state;n&&e.state.isOriginator&&(e.state.debug&&(n==null||n.io.on("error",i=>{W.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=error`,i)}),n==null||n.io.on("reconnect",i=>{W.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect`,i),As(e).catch(o=>{})}),n==null||n.io.on("reconnect_error",i=>{W.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect_error`,i)}),n==null||n.io.on("reconnect_failed",()=>{W.SocketService(`[SocketService: setupChannelListener()] context=${e.state.context} socket event=reconnect_failed`)})),n==null||n.on("disconnect",i=>(W.SocketService(`[SocketService: setupChannelListener()] on 'disconnect' -- MetaMaskSDK socket disconnected '${i}' begin recovery...`),function(o){return c=>{W.SocketService(`[SocketService: handleDisconnect()] on 'disconnect' manualDisconnect=${o.state.manualDisconnect}`,c),o.state.manualDisconnect||(o.emit(te.SOCKET_DISCONNECTED),As(o).catch(s=>{}))}}(e)(i)))),Q0.forEach(({event:i,handler:o})=>{n==null||n.on(`${i}-${t}`,o(e,t))}),ep.forEach(({event:i,handler:o})=>{r==null||r.on(i,o(e))}),e.state.setupChannelListeners=!0}class tp extends oo.EventEmitter2{constructor(t){super(),this.state={clientsConnected:!1,clientsPaused:!1,manualDisconnect:!1,lastRpcId:void 0,rpcMethodTracker:{},hasPlaintext:!1,communicationServerUrl:"",focusListenerAdded:!1,removeFocusListener:void 0,isReconnecting:!1,reconnectionAttempts:0},this.options=t;const{reconnect:n,communicationLayerPreference:r,communicationServerUrl:i,context:o,remote:c,logging:s}=t;this.state.resumed=n,this.state.context=o,this.state.isOriginator=c.state.isOriginator,this.state.communicationLayerPreference=r,this.state.debug=(s==null?void 0:s.serviceLayer)===!0,this.remote=c,(s==null?void 0:s.serviceLayer)===!0&&Ge.enable("SocketService:Layer"),this.state.communicationServerUrl=i,this.state.hasPlaintext=this.state.communicationServerUrl!==er&&(s==null?void 0:s.plaintext)===!0,W.SocketService(`[SocketService: constructor()] Socket IO url: ${this.state.communicationServerUrl}`),this.initSocket()}initSocket(){var t;const{otherPublicKey:n,ecies:r,logging:i}=this.options,o={autoConnect:!1,transports:Y0,withCredentials:!0},c=this.state.communicationServerUrl;W.SocketService(`[SocketService: initSocket()] Socket IO url: ${c}`),this.state.socket=uh(c,o),function(a){if(typeof window<"u"&&typeof document<"u"&&(W.SocketService(`[SocketService: setupSocketFocusListener()] hasFocus=${document.hasFocus()}`,a),!a.state.focusListenerAdded)){const l=()=>{W.SocketService("Document has focus --- reconnecting socket"),As(a).catch(u=>{})};window.addEventListener("focus",l),a.state.focusListenerAdded=!0,a.state.removeFocusListener=()=>{window.removeEventListener("focus",l),a.state.focusListenerAdded=!1}}}(this);const s={communicationLayer:this,otherPublicKey:n,sendPublicKey:!1,context:(t=this.state.context)!==null&&t!==void 0?t:"",ecies:r,logging:i};this.state.keyExchange=new X0(s)}resetKeys(){return W.SocketService("[SocketService: resetKeys()] Resetting keys."),void((t=this.state.keyExchange)===null||t===void 0||t.resetKeys());var t}createChannel(){return Z(this,void 0,void 0,function*(){return function(t){return Z(this,void 0,void 0,function*(){var n,r,i;if(W.SocketService(`[SocketService: createChannel()] context=${t.state.context}`),t.state.socket||t.initSocket(),(n=t.state.socket)===null||n===void 0?void 0:n.connected)throw new Error("socket already connected");(r=t.state.socket)===null||r===void 0||r.connect(),t.state.manualDisconnect=!1,t.state.isOriginator=!0;const o=dn();t.state.channelId=o,xc(t,o),yield new Promise((s,a)=>{var l;(l=t.state.socket)===null||l===void 0||l.emit(te.JOIN_CHANNEL,{channelId:o,context:`${t.state.context}createChannel`,clientType:"dapp"},(u,d)=>Z(this,void 0,void 0,function*(){try{yield vi(t,u,d),s()}catch(f){a(f)}}))});const c=(i=t.state.keyExchange)===null||i===void 0?void 0:i.getKeyInfo();return{channelId:o,pubKey:(c==null?void 0:c.ecies.public)||"",privKey:(c==null?void 0:c.ecies.private)||""}})}(this)})}connectToChannel({channelId:t,withKeyExchange:n=!1,authorized:r}){return function(i){return Z(this,arguments,void 0,function*({options:o,instance:c}){const{channelId:s,authorized:a,withKeyExchange:l}=o,{state:u,remote:d}=c,{isOriginator:f=!1,socket:h,keyExchange:g}=u,{channelConfig:m}=d.state;if(h!=null&&h.connected)throw new Error("socket already connected");if(f&&(m!=null&&m.relayPersistence)){const{localKey:w,otherKey:p}=m;w&&p&&(g==null||g.setRelayPersistence({localKey:w,otherKey:p}))}return Object.assign(u,{manualDisconnect:!1,withKeyExchange:l,isOriginator:f,channelId:s}),h==null||h.connect(),xc(c,s),!f&&a&&(g==null||g.setKeysExchanged(!0),Object.assign(d.state,{ready:!0,authorized:!0})),new Promise(w=>{var p;const S=(p=g==null?void 0:g.getKeyInfo())===null||p===void 0?void 0:p.ecies.public;h==null||h.emit(te.JOIN_CHANNEL,{channelId:s,context:`${u.context}_connectToChannel`,clientType:f?"dapp":"wallet",publicKey:a&&!f?S:void 0},(_,P)=>Z(this,void 0,void 0,function*(){yield vi(c,_,P),w()}))})})}({options:{channelId:t,withKeyExchange:n,authorized:r},instance:this})}getKeyInfo(){return this.state.keyExchange.getKeyInfo()}keyCheck(){var t,n;(n=(t=this).state.socket)===null||n===void 0||n.emit(te.MESSAGE,{id:t.state.channelId,context:t.state.context,message:{type:_e.KEY_HANDSHAKE_CHECK,pubkey:t.getKeyInfo().ecies.otherPubKey}})}getKeyExchange(){return this.state.keyExchange}sendMessage(t){return Z(this,void 0,void 0,function*(){return function(n,r){return Z(this,void 0,void 0,function*(){var i,o,c;if(!n.state.channelId)throw W.SocketService("handleSendMessage: no channelId - Create a channel first"),new Error("Create a channel first");if(W.SocketService(`[SocketService: handleSendMessage()] context=${n.state.context} areKeysExchanged=${(i=n.state.keyExchange)===null||i===void 0?void 0:i.areKeysExchanged()}`,r),(o=r==null?void 0:r.type)===null||o===void 0?void 0:o.startsWith("key_handshake"))return function(a,l){var u;W.SocketService(`[SocketService: handleKeyHandshake()] context=${a.state.context}`,l),(u=a.state.socket)===null||u===void 0||u.emit(te.MESSAGE,{id:a.state.channelId,context:a.state.context,clientType:a.state.isOriginator?"dapp":"wallet",message:l})}(n,r),!0;(function(a,l){var u;if(!(!((u=a.state.keyExchange)===null||u===void 0)&&u.areKeysExchanged())&&!a.remote.state.relayPersistence)throw W.SocketService(`[SocketService: validateKeyExchange()] context=${a.state.context} ERROR keys not exchanged`,l),new Error("Keys not exchanged BBB")})(n,r),function(a,l){var u;const d=(u=l==null?void 0:l.method)!==null&&u!==void 0?u:"",f=l==null?void 0:l.id;a.state.isOriginator&&f&&(a.state.rpcMethodTracker[f]={id:f,timestamp:Date.now(),method:d},a.emit(te.RPC_UPDATE,a.state.rpcMethodTracker[f]))}(n,r);const s=yield xd(n,r);return n.remote.state.analytics&&n.remote.state.isOriginator&&r.method&&Md.includes(r.method.toLowerCase())&&Gt({id:(c=n.remote.state.channelId)!==null&&c!==void 0?c:"",event:Te.SDK_RPC_REQUEST,params:{method:r.method,from:"mobile"}},n.remote.state.communicationServerUrl).catch(a=>{}),n.remote.state.isOriginator&&r.method&&Hr(r.method)&&Me.analytics.track("sdk_action_requested",{action:r.method}),function(a,l){return Z(this,void 0,void 0,function*(){var u;const d=l==null?void 0:l.id,f=(u=l==null?void 0:l.method)!==null&&u!==void 0?u:"";if(a.state.isOriginator&&d)try{const h=kc(d,a.state.rpcMethodTracker,200).then(w=>({type:Vn.RPC_CHECK,result:w})),g=Z(this,void 0,void 0,function*(){const w=yield(S=>Z(void 0,[S],void 0,function*({rpcId:_,instance:P}){for(;P.state.lastRpcId===_||P.state.lastRpcId===void 0;)yield Jn(200);return P.state.lastRpcId}))({instance:a,rpcId:d}),p=yield kc(w,a.state.rpcMethodTracker,200);return{type:Vn.SKIPPED_RPC,result:p}}),m=yield Promise.race([h,g]);if(m.type===Vn.RPC_CHECK){const w=m.result;W.SocketService(`[SocketService:handleRpcReplies()] id=${l.id} ${f} ( ${w.elapsedTime} ms)`,w.result)}else{if(m.type!==Vn.SKIPPED_RPC)throw new Error(`Error handling RPC replies for ${d}`);{const w=Object.assign(Object.assign({},a.state.rpcMethodTracker[d]),{error:new Error("SDK_CONNECTION_ISSUE")});a.emit(te.RPC_UPDATE,w);const p={data:Object.assign(Object.assign({},w),{jsonrpc:"2.0"}),name:"metamask-provider"};a.emit(te.MESSAGE,{message:p})}}}catch(h){throw h}})}(n,r).catch(a=>{}),s})}(this,t)})}ping(){return function(t){return Z(this,void 0,void 0,function*(){var n,r;W.SocketService(`[SocketService: ping()] context=${t.state.context} originator=${t.state.isOriginator} keysExchanged=${(n=t.state.keyExchange)===null||n===void 0?void 0:n.areKeysExchanged()}`),(r=t.state.socket)===null||r===void 0||r.emit(Ae.PING,{id:t.state.channelId,context:"ping",clientType:t.remote.state.isOriginator?"dapp":"wallet",message:""})})}(this)}pause(){return function(t){return Z(this,void 0,void 0,function*(){var n,r;W.SocketService(`[SocketService: pause()] context=${t.state.context}`),t.state.manualDisconnect=!0,!((n=t.state.keyExchange)===null||n===void 0)&&n.areKeysExchanged()&&(yield t.sendMessage({type:Ae.PAUSE})),(r=t.state.socket)===null||r===void 0||r.disconnect()})}(this)}isConnected(){var t;return(t=this.state.socket)===null||t===void 0?void 0:t.connected}resume(){return function(t){return Z(this,void 0,void 0,function*(){const{state:n,remote:r}=t,{socket:i,channelId:o,context:c,keyExchange:s,isOriginator:a}=n,{isOriginator:l}=r.state;if(W.SocketService(`[SocketService: resume()] channelId=${o} context=${c} connected=${i==null?void 0:i.connected} manualDisconnect=${n.manualDisconnect} resumed=${n.resumed} keysExchanged=${s==null?void 0:s.areKeysExchanged()}`),!o)throw W.SocketService("[SocketService: resume()] channelId is not defined"),new Error("ChannelId is not defined");i!=null&&i.connected?(W.SocketService("[SocketService: resume()] already connected."),i.emit(Ae.PING,{id:o,clientType:l?"dapp":"wallet",context:"on_channel_config",message:""}),r.hasRelayPersistence()||s!=null&&s.areKeysExchanged()||(a?yield t.sendMessage({type:Ae.READY}):s==null||s.start({isOriginator:!1}))):(i==null||i.connect(),W.SocketService(`[SocketService: resume()] after connecting socket --> connected=${i==null?void 0:i.connected}`),i==null||i.emit(te.JOIN_CHANNEL,{channelId:o,context:`${c}_resume`,clientType:l?"dapp":"wallet"},(u,d)=>Z(this,void 0,void 0,function*(){try{yield vi(t,u,d)}catch{}}))),n.manualDisconnect=!1,n.resumed=!0})}(this)}getRPCMethodTracker(){return this.state.rpcMethodTracker}disconnect(t){return function(n,r){var i,o,c,s,a;W.SocketService(`[SocketService: disconnect()] context=${n.state.context}`,r),r!=null&&r.terminate&&((o=(i=n.state).removeFocusListener)===null||o===void 0||o.call(i),n.state.channelId=r.channelId,(c=n.state.socket)===null||c===void 0||c.removeAllListeners(),(s=n.state.keyExchange)===null||s===void 0||s.clean(),n.remote.state.ready=!1,n.state.socket=void 0,n.state.rpcMethodTracker={}),n.state.manualDisconnect=!0,(a=n.state.socket)===null||a===void 0||a.disconnect()}(this,t)}}var In,Fe,Mc;function np(e){return()=>Z(this,void 0,void 0,function*(){var t,n,r;const{state:i}=e;if(i.authorized)return;yield Z(this,void 0,void 0,function*(){for(;!i.walletInfo;)yield Jn(500)});const o="7.3".localeCompare(((t=i.walletInfo)===null||t===void 0?void 0:t.version)||"");if(W.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' version=${(n=i.walletInfo)===null||n===void 0?void 0:n.version} compareValue=${o}`),o!==1)return;const c=i.platformType===Fe.MobileWeb||i.platformType===Fe.ReactNative||i.platformType===Fe.MetaMaskMobileWebview;W.RemoteCommunication(`[RemoteCommunication: handleAuthorizedEvent()] HACK 'authorized' platform=${i.platformType} secure=${c} channel=${i.channelId} walletVersion=${(r=i.walletInfo)===null||r===void 0?void 0:r.version}`),c&&(i.authorized=!0,e.emit(te.AUTHORIZED))})}function rp(e){return t=>{const{state:n}=e;W.RemoteCommunication(`[RemoteCommunication: handleChannelCreatedEvent()] context=${n.context} on 'channel_created' channelId=${t}`),e.emit(te.CHANNEL_CREATED,t)}}function ip(e,t){return()=>{var n,r,i,o;const{state:c}=e;W.RemoteCommunication(`[RemoteCommunication: handleClientsConnectedEvent()] on 'clients_connected' channel=${c.channelId} keysExchanged=${(r=(n=c.communicationLayer)===null||n===void 0?void 0:n.getKeyInfo())===null||r===void 0?void 0:r.keysExchanged}`),c.analytics&&Gt(Object.assign(Object.assign({id:(i=c.channelId)!==null&&i!==void 0?i:"",event:c.reconnection?Te.RECONNECT:c.isOriginator?Te.REQUEST:Te.REQUEST_MOBILE},c.originatorInfo),{commLayer:t,sdkVersion:c.sdkVersion,walletVersion:(o=c.walletInfo)===null||o===void 0?void 0:o.version,commLayerVersion:vn.version}),c.communicationServerUrl).catch(s=>{}),c.isOriginator&&!c.reconnection&&Me.analytics.track("sdk_connection_established",{transport_type:"websocket"}),c.clientsConnected=!0,c.originatorInfoSent=!1,e.emit(te.CLIENTS_CONNECTED)}}function op(e){return t=>{const{state:n}=e;W.RemoteCommunication(`[RemoteCommunication: handleClientsDisconnectedEvent()] context=${n.context} on 'clients_disconnected' channelId=${t}`),n.relayPersistence||(n.clientsConnected=!1,n.ready=!1,n.authorized=!1),e.emit(te.CLIENTS_DISCONNECTED,n.channelId),e.setConnectionStatus(Be.DISCONNECTED)}}function sp(e){return t=>{var n;const{state:r}=e;if(W.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] context=${r.context} on 'clients_waiting' numberUsers=${t} ready=${r.ready} autoStarted=${r.originatorConnectStarted}`),e.setConnectionStatus(Be.WAITING),e.emit(te.CLIENTS_WAITING,t),r.originatorConnectStarted){W.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] on 'clients_waiting' watch autoStarted=${r.originatorConnectStarted} timeout`,r.autoConnectOptions);const i=((n=r.autoConnectOptions)===null||n===void 0?void 0:n.timeout)||3e3,o=setTimeout(()=>{W.RemoteCommunication(`[RemoteCommunication: handleClientsWaitingEvent()] setTimeout(${i}) terminate channelConfig`,r.autoConnectOptions),r.originatorConnectStarted=!1,r.ready||e.setConnectionStatus(Be.TIMEOUT),clearTimeout(o)},i)}}}function ap(e,t){return n=>{var r,i,o,c,s,a,l,u;const{state:d}=e;if(W.RemoteCommunication(`[RemoteCommunication: handleKeysExchangedEvent()] context=${d.context} on commLayer.'keys_exchanged' channel=${d.channelId}`,n),(i=(r=d.communicationLayer)===null||r===void 0?void 0:r.getKeyInfo())===null||i===void 0?void 0:i.keysExchanged){const f=Object.assign(Object.assign({},d.channelConfig),{channelId:(o=d.channelId)!==null&&o!==void 0?o:"",validUntil:((c=d.channelConfig)===null||c===void 0?void 0:c.validUntil)||tr,localKey:d.communicationLayer.getKeyInfo().ecies.private,otherKey:d.communicationLayer.getKeyInfo().ecies.otherPubKey});(s=d.storageManager)===null||s===void 0||s.persistChannelConfig(f).catch(h=>{}),e.setConnectionStatus(Be.LINKED)}(function(f,h){var g,m,w,p,S,_,P,O;const{state:K}=f;W.RemoteCommunication(`[RemoteCommunication: setLastActiveDate()] channel=${K.channelId}`,h);const q=Object.assign(Object.assign({},K.channelConfig),{channelId:(g=K.channelId)!==null&&g!==void 0?g:"",validUntil:(w=(m=K.channelConfig)===null||m===void 0?void 0:m.validUntil)!==null&&w!==void 0?w:0,relayPersistence:K.relayPersistence,localKey:(S=(p=K.communicationLayer)===null||p===void 0?void 0:p.state.keyExchange)===null||S===void 0?void 0:S.getKeyInfo().ecies.private,otherKey:(P=(_=K.communicationLayer)===null||_===void 0?void 0:_.state.keyExchange)===null||P===void 0?void 0:P.getKeyInfo().ecies.otherPubKey,lastActive:h.getTime()});(O=K.storageManager)===null||O===void 0||O.persistChannelConfig(q)})(e,new Date),d.analytics&&d.channelId&&Gt(Object.assign(Object.assign({id:d.channelId,event:n.isOriginator?Te.CONNECTED:Te.CONNECTED_MOBILE},d.originatorInfo),{sdkVersion:d.sdkVersion,commLayer:t,commLayerVersion:vn.version,walletVersion:(a=d.walletInfo)===null||a===void 0?void 0:a.version}),d.communicationServerUrl).catch(f=>{}),d.isOriginator=n.isOriginator,n.isOriginator||((l=d.communicationLayer)===null||l===void 0||l.sendMessage({type:Ae.READY}),d.ready=!0,d.paused=!1),n.isOriginator&&!d.originatorInfoSent&&((u=d.communicationLayer)===null||u===void 0||u.sendMessage({type:Ae.ORIGINATOR_INFO,originatorInfo:d.originatorInfo,originator:d.originatorInfo}),d.originatorInfoSent=!0)}}function cp(e){return t=>{let n=t;t.message&&(n=n.message),function(r,i){const{state:o}=i;if(W.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] context=${o.context} on 'message' typeof=${typeof r}`,r),i.state.ready=!0,o.isOriginator||r.type!==Ae.ORIGINATOR_INFO)if(o.isOriginator&&r.type===Ae.WALLET_INFO)(function(c,s){const{state:a}=c;a.walletInfo=s.walletInfo,a.paused=!1})(i,r);else{if(o.isOriginator&&r.type===Ae.WALLET_INIT)(function(c,s){return Z(this,void 0,void 0,function*(){var a,l,u;const{state:d}=c;if(d.isOriginator){const f=s.data||{};if(typeof f=="object"&&"accounts"in f&&"chainId"in f&&"walletKey"in f)try{const{channelConfig:h}=c.state;if(W.RemoteCommunication("WALLET_INIT: channelConfig",JSON.stringify(h,null,2)),h){const g=f.accounts,m=f.chainId,w=f.walletKey;let p,S=!1;"deeplinkProtocol"in f&&(S=!!f.deeplinkProtocol,c.state.deeplinkProtocolAvailable=S),"walletVersion"in f&&(p=f.walletVersion),yield(a=c.state.storageManager)===null||a===void 0?void 0:a.persistChannelConfig(Object.assign(Object.assign({},h),{otherKey:w,walletVersion:p,deeplinkProtocolAvailable:S,relayPersistence:!0})),yield(l=c.state.storageManager)===null||l===void 0?void 0:l.persistAccounts(g),yield(u=c.state.storageManager)===null||u===void 0?void 0:u.persistChainId(m)}c.emit(te.WALLET_INIT,{accounts:f.accounts,chainId:f.chainId})}catch{}}})})(i,r).catch(c=>{W.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${c}`)});else if(r.type===Ae.TERMINATE)(function(c){return Z(this,void 0,void 0,function*(){const{state:s}=c;s.isOriginator&&(yield Td({options:{terminate:!0,sendMessage:!1},instance:c}),c.emit(te.TERMINATE))})})(i).catch(c=>{W.RemoteCommunication(`[RemoteCommunication: onCommunicationLayerMessage()] error=${c}`)});else if(r.type===Ae.PAUSE)(function(c){const{state:s}=c;s.paused=!0,c.setConnectionStatus(Be.PAUSED)})(i);else if(r.type===Ae.READY&&o.isOriginator)(function(c){const{state:s}=c;c.setConnectionStatus(Be.LINKED);const a=s.paused;s.paused=!1,c.emit(te.CLIENTS_READY,{isOriginator:s.isOriginator,walletInfo:s.walletInfo}),a&&(s.authorized=!0,c.emit(te.AUTHORIZED))})(i);else{if(r.type===Ae.OTP&&o.isOriginator)return void function(c,s){var a;const{state:l}=c;c.emit(te.OTP,s.otpAnswer),"6.6".localeCompare(((a=l.walletInfo)===null||a===void 0?void 0:a.version)||"")===1&&c.emit(te.SDK_RPC_CALL,{method:je.ETH_REQUESTACCOUNTS,params:[]})}(i,r);r.type===Ae.AUTHORIZED&&o.isOriginator&&function(c){const{state:s}=c;s.authorized=!0,c.emit(te.AUTHORIZED)}(i)}i.emit(te.MESSAGE,r)}else(function(c,s){var a;const{state:l}=c;(a=l.communicationLayer)===null||a===void 0||a.sendMessage({type:Ae.WALLET_INFO,walletInfo:l.walletInfo}),l.originatorInfo=s.originatorInfo||s.originator,c.emit(te.CLIENTS_READY,{isOriginator:l.isOriginator,originatorInfo:l.originatorInfo}),l.paused=!1})(i,r)}(n,e)}}function lp(e){return()=>{const{state:t}=e;W.RemoteCommunication("[RemoteCommunication: handleSocketReconnectEvent()] on 'socket_reconnect' -- reset key exchange status / set ready to false"),t.ready=!1,t.authorized=!1,kd(t),e.emitServiceStatusEvent({context:"socket_reconnect"})}}function up(e){return()=>{const{state:t}=e;W.RemoteCommunication("[RemoteCommunication: handleSocketDisconnectedEvent()] on 'socket_Disconnected' set ready to false"),t.ready=!1}}function dp(e){return()=>Z(this,void 0,void 0,function*(){var t,n,r,i,o,c,s;const{state:a}=e;W.RemoteCommunication(`[RemoteCommunication: handleFullPersistenceEvent()] context=${a.context}`),e.state.ready=!0,e.state.clientsConnected=!0,e.state.authorized=!0,e.state.relayPersistence=!0,(t=e.state.communicationLayer)===null||t===void 0||t.getKeyExchange().setKeysExchanged(!0),e.emit(te.KEYS_EXCHANGED,{keysExchanged:!0,isOriginator:!0}),e.emit(te.AUTHORIZED),e.emit(te.CLIENTS_READY),e.emit(te.CHANNEL_PERSISTENCE);try{a.channelConfig=Object.assign(Object.assign({},a.channelConfig),{localKey:(n=a.communicationLayer)===null||n===void 0?void 0:n.getKeyExchange().getKeyInfo().ecies.private,otherKey:(r=a.communicationLayer)===null||r===void 0?void 0:r.getKeyExchange().getOtherPublicKey(),channelId:(i=a.channelId)!==null&&i!==void 0?i:"",validUntil:(c=(o=a.channelConfig)===null||o===void 0?void 0:o.validUntil)!==null&&c!==void 0?c:tr,relayPersistence:!0}),yield(s=a.storageManager)===null||s===void 0?void 0:s.persistChannelConfig(a.channelConfig)}catch{}})}function Tc({communicationLayerPreference:e,otherPublicKey:t,reconnect:n,ecies:r,communicationServerUrl:i=er,instance:o}){var c,s,a,l,u,d,f,h,g,m,w;const{state:p}=o;if(W.RemoteCommunication("[initCommunicationLayer()] ",JSON.stringify(p,null,2)),e!==In.SOCKET)throw new Error("Invalid communication protocol");p.communicationLayer=new tp({communicationLayerPreference:e,otherPublicKey:t,reconnect:n,transports:p.transports,communicationServerUrl:i,context:p.context,ecies:r,logging:p.logging,remote:o});let S=typeof document<"u"&&document.URL||"",_=typeof document<"u"&&document.title||"";!((c=p.dappMetadata)===null||c===void 0)&&c.url&&(S=p.dappMetadata.url),!((s=p.dappMetadata)===null||s===void 0)&&s.name&&(_=p.dappMetadata.name);const P=(d=(l=(a=p.dappMetadata)===null||a===void 0?void 0:a.name)!==null&&l!==void 0?l:(u=p.dappMetadata)===null||u===void 0?void 0:u.url)!==null&&d!==void 0?d:"N/A",O=typeof window<"u"&&window.location!==void 0&&(f=window.location.hostname)!==null&&f!==void 0?f:P,K={url:S,title:_,source:(h=p.dappMetadata)===null||h===void 0?void 0:h.source,dappId:O,anonId:p.anonId,icon:((g=p.dappMetadata)===null||g===void 0?void 0:g.iconUrl)||((m=p.dappMetadata)===null||m===void 0?void 0:m.base64Icon),platform:p.platformType,apiVersion:vn.version,connector:(w=p.dappMetadata)===null||w===void 0?void 0:w.connector};p.originatorInfo=K;const q={[te.AUTHORIZED]:np(o),[te.MESSAGE]:cp(o),[te.CHANNEL_PERSISTENCE]:dp(o),[te.CLIENTS_CONNECTED]:ip(o,e),[te.KEYS_EXCHANGED]:ap(o,e),[te.SOCKET_DISCONNECTED]:up(o),[te.SOCKET_RECONNECT]:lp(o),[te.CLIENTS_DISCONNECTED]:op(o),[te.KEY_INFO]:()=>{},[te.CHANNEL_CREATED]:rp(o),[te.CLIENTS_WAITING]:sp(o),[te.RPC_UPDATE]:F=>{o.emit(te.RPC_UPDATE,F)}};for(const[F,U]of Object.entries(q))try{p.communicationLayer.on(F,U)}catch{}}function Td(e){return Z(this,arguments,void 0,function*({options:t,instance:n}){const{state:r}=n;return W.RemoteCommunication(`[RemoteCommunication: disconnect()] channel=${r.channelId}`,t),new Promise((i,o)=>{var c,s,a,l,u,d;t!=null&&t.terminate?(n.state.ready&&Gt({id:(c=n.state.channelId)!==null&&c!==void 0?c:"",event:Te.TERMINATED},n.state.communicationServerUrl).catch(f=>{}),r.ready=!1,r.paused=!1,(s=r.storageManager)===null||s===void 0||s.terminate((a=r.channelId)!==null&&a!==void 0?a:""),n.state.terminated=!0,t.sendMessage?!((l=r.communicationLayer)===null||l===void 0)&&l.getKeyInfo().keysExchanged&&n.state.communicationLayer&&xd(n.state.communicationLayer,{type:Ae.TERMINATE}).then(()=>{i(!0)}).catch(f=>{o(f)}):i(!0),r.authorized=!1,r.relayPersistence=!1,r.channelId=dn(),t.channelId=r.channelId,r.channelConfig=void 0,r.originatorConnectStarted=!1,(u=r.communicationLayer)===null||u===void 0||u.disconnect(t),n.setConnectionStatus(Be.TERMINATED)):((d=r.communicationLayer)===null||d===void 0||d.disconnect(t),n.setConnectionStatus(Be.DISCONNECTED),i(!0))})})}(In||(In={})).SOCKET="socket",function(e){e.NonBrowser="nodejs",e.MetaMaskMobileWebview="in-app-browser",e.DesktopWeb="web-desktop",e.MobileWeb="web-mobile",e.ReactNative="react-native"}(Fe||(Fe={}));class fp extends oo.EventEmitter2{constructor(t){super(),this.state={ready:!1,anonId:"",authorized:!1,isOriginator:!1,terminated:!1,protocolVersion:1,paused:!1,deeplinkProtocolAvailable:!1,platformType:"metamask-mobile",analytics:!1,reconnection:!1,originatorInfoSent:!1,communicationServerUrl:er,context:"",persist:!1,clientsConnected:!1,sessionDuration:tr,originatorConnectStarted:!1,debug:!1,_connectionStatus:Be.DISCONNECTED},this._options=t;const{anonId:n,platformType:r,communicationLayerPreference:i,otherPublicKey:o,reconnect:c,walletInfo:s,dappMetadata:a,protocolVersion:l,transports:u,context:d,relayPersistence:f,ecies:h,analytics:g=!1,storage:m,sdkVersion:w,communicationServerUrl:p=er,logging:S,autoConnect:_={timeout:Z0}}=t;this.state.anonId=n,this.state.otherPublicKey=o,this.state.dappMetadata=a,this.state.walletInfo=s,this.state.transports=u,this.state.platformType=r,this.state.analytics=g,this.state.protocolVersion=l??1,this.state.isOriginator=!o,this.state.relayPersistence=f,this.state.communicationServerUrl=p,this.state.context=d,this.state.terminated=!1,this.state.sdkVersion=w,this.setMaxListeners(50),this.setConnectionStatus(Be.DISCONNECTED),m!=null&&m.duration&&(this.state.sessionDuration=tr),this.state.storageOptions=m,this.state.autoConnectOptions=_,this.state.debug=(S==null?void 0:S.remoteLayer)===!0,(S==null?void 0:S.remoteLayer)===!0&&Ge.enable("RemoteCommunication:Layer"),(S==null?void 0:S.serviceLayer)===!0&&Ge.enable("SocketService:Layer"),(S==null?void 0:S.eciesLayer)===!0&&Ge.enable("ECIES:Layer"),(S==null?void 0:S.keyExchangeLayer)===!0&&Ge.enable("KeyExchange:Layer"),this.state.logging=S,m!=null&&m.storageManager&&(this.state.storageManager=m.storageManager),W.RemoteCommunication(`[RemoteCommunication: constructor()] protocolVersion=${l} relayPersistence=${f} isOriginator=${this.state.isOriginator} communicationLayerPreference=${i} otherPublicKey=${o} reconnect=${c}`),this.state.isOriginator||Tc({communicationLayerPreference:i,otherPublicKey:o,reconnect:c,ecies:h,communicationServerUrl:p,instance:this}),this.emitServiceStatusEvent({context:"constructor"})}initFromDappStorage(){return Z(this,void 0,void 0,function*(){var t;if(this.state.storageManager){const n=yield this.state.storageManager.getPersistedChannelConfig({});n&&(this.state.channelConfig=n,this.state.channelId=n.channelId,this.state.deeplinkProtocolAvailable=(t=n.deeplinkProtocolAvailable)!==null&&t!==void 0&&t,n.relayPersistence&&(this.state.authorized=!0,this.state.ready=!0,this.setConnectionStatus(Be.LINKED),yield this.connectToChannel({channelId:n.channelId})))}Tc({communicationLayerPreference:In.SOCKET,otherPublicKey:this.state.otherPublicKey,reconnect:this._options.reconnect,ecies:this._options.ecies,communicationServerUrl:this.state.communicationServerUrl,instance:this})})}originatorSessionConnect(){return Z(this,void 0,void 0,function*(){return yield function(t){return Z(this,void 0,void 0,function*(){var n;const{state:r}=t;if(!r.storageManager)return void W.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] no storage manager defined - skip");const i=yield r.storageManager.getPersistedChannelConfig({});if(W.RemoteCommunication(`[RemoteCommunication: originatorSessionConnect()] autoStarted=${r.originatorConnectStarted} channelConfig`,i),(n=r.communicationLayer)===null||n===void 0?void 0:n.isConnected())return W.RemoteCommunication("[RemoteCommunication: originatorSessionConnect()] socket already connected - skip"),i;if(i){if(i.validUntil>Date.now())return r.channelConfig=i,r.originatorConnectStarted=!0,r.channelId=i==null?void 0:i.channelId,r.reconnection=!0,i;W.RemoteCommunication("[RemoteCommunication: autoConnect()] Session has expired")}r.originatorConnectStarted=!1})}(this)})}generateChannelIdConnect(){return Z(this,void 0,void 0,function*(){return function(t){return Z(this,void 0,void 0,function*(){var n,r,i,o,c,s;if(!t.communicationLayer)throw new Error("communication layer not initialized");if(t.ready)throw new Error("Channel already connected");if(t.channelId&&(!((n=t.communicationLayer)===null||n===void 0)&&n.isConnected()))return t.channelConfig=Object.assign(Object.assign({},t.channelConfig),{channelId:t.channelId,validUntil:Date.now()+t.sessionDuration}),(r=t.storageManager)===null||r===void 0||r.persistChannelConfig(t.channelConfig),{channelId:t.channelId,privKey:(o=(i=t.communicationLayer)===null||i===void 0?void 0:i.getKeyInfo())===null||o===void 0?void 0:o.ecies.private,pubKey:(s=(c=t.communicationLayer)===null||c===void 0?void 0:c.getKeyInfo())===null||s===void 0?void 0:s.ecies.public};W.RemoteCommunication("[RemoteCommunication: generateChannelId()]");const a=yield t.communicationLayer.createChannel();W.RemoteCommunication("[RemoteCommunication: generateChannelId()] channel created",a);const l=Object.assign(Object.assign({},t.channelConfig),{channelId:a.channelId,localKey:a.privKey,validUntil:Date.now()+t.sessionDuration});return t.channelId=a.channelId,t.channelConfig=l,{channelId:t.channelId,pubKey:a.pubKey,privKey:a.privKey}})}(this.state)})}clean(){return kd(this.state)}connectToChannel({channelId:t,withKeyExchange:n,authorized:r}){return function(i){return Z(this,arguments,void 0,function*({channelId:o,withKeyExchange:c,authorized:s,state:a}){var l,u,d;if(!hs(o))throw W.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${a.context} invalid channel channelId=${o}`),new Error(`Invalid channel ${o}`);if(W.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${a.context} channelId=${o} withKeyExchange=${c}`),(l=a.communicationLayer)===null||l===void 0?void 0:l.isConnected())return void W.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${a.context} already connected - interrupt connection.`);a.channelId=o,yield(u=a.communicationLayer)===null||u===void 0?void 0:u.connectToChannel({channelId:o,authorized:s,withKeyExchange:c});const f=Object.assign(Object.assign({},a.channelConfig),{channelId:o,validUntil:Date.now()+a.sessionDuration});a.channelConfig=f,(d=a.storageManager)===null||d===void 0||d.persistChannelConfig(f)})}({channelId:t,authorized:r,withKeyExchange:n,state:this.state})}sendMessage(t){return Z(this,void 0,void 0,function*(){const n=this.state.isOriginator&&t.method&&Hr(t.method);n&&Me.analytics.track("sdk_action_requested",{action:t.method});try{return yield function(r,i){return Z(this,void 0,void 0,function*(){var o,c;const{state:s}=r;W.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${s.context} paused=${s.paused} ready=${s.ready} relayPersistence=${s.relayPersistence} authorized=${s.authorized} socket=${(o=s.communicationLayer)===null||o===void 0?void 0:o.isConnected()} clientsConnected=${s.clientsConnected} status=${s._connectionStatus}`,i),s.relayPersistence||s.ready&&(!((c=s.communicationLayer)===null||c===void 0)&&c.isConnected())&&s.clientsConnected||(W.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${s.context} SKIP message waiting for MM mobile readiness.`),yield new Promise(a=>{r.once(te.CLIENTS_READY,a)}),W.RemoteCommunication(`[RemoteCommunication: sendMessage()] context=${s.context} AFTER SKIP / READY -- sending pending message`));try{return yield function(l,u){return Z(this,void 0,void 0,function*(){return new Promise(d=>{var f;const{state:h}=l;W.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${h.context} ready=${h.ready} authorized=${h.authorized} method=${u.method}`),!h.isOriginator||h.authorized||h.relayPersistence?(f=h.communicationLayer)===null||f===void 0||f.sendMessage(u).then(g=>{d(g)}).catch(g=>{d(!1)}):l.once(te.AUTHORIZED,()=>{var g;W.RemoteCommunication(`[RemoteCommunication: handleAuthorization()] context=${h.context} AFTER SKIP / AUTHORIZED -- sending pending message`),(g=h.communicationLayer)===null||g===void 0||g.sendMessage(u).then(m=>{d(m)}).catch(m=>{d(!1)})})})})}(r,i)}catch(a){throw a}})}(this,t)}catch(r){throw n&&Me.analytics.track("sdk_action_failed",{action:t.method}),r}})}testStorage(){return Z(this,void 0,void 0,function*(){return function(t){return Z(this,void 0,void 0,function*(){var n;const r=yield(n=t.storageManager)===null||n===void 0?void 0:n.getPersistedChannelConfig();W.RemoteCommunication("[RemoteCommunication: testStorage()] res",r)})}(this.state)})}hasDeeplinkProtocol(){return this.state.deeplinkProtocolAvailable}getChannelConfig(){return this.state.channelConfig}isReady(){return this.state.ready}isConnected(){var t;return(t=this.state.communicationLayer)===null||t===void 0?void 0:t.isConnected()}isAuthorized(){return this.state.authorized}isPaused(){return this.state.paused}getCommunicationLayer(){return this.state.communicationLayer}ping(){return Z(this,void 0,void 0,function*(){var t;W.RemoteCommunication(`[RemoteCommunication: ping()] channel=${this.state.channelId}`),yield(t=this.state.communicationLayer)===null||t===void 0?void 0:t.ping()})}testLogger(){W.RemoteCommunication(`testLogger() channel=${this.state.channelId}`),W.SocketService(`testLogger() channel=${this.state.channelId}`),W.Ecies(`testLogger() channel=${this.state.channelId}`),W.KeyExchange(`testLogger() channel=${this.state.channelId}`)}keyCheck(){var t;W.RemoteCommunication(`[RemoteCommunication: keyCheck()] channel=${this.state.channelId}`),(t=this.state.communicationLayer)===null||t===void 0||t.keyCheck()}setConnectionStatus(t){this.state._connectionStatus!==t&&(this.state._connectionStatus=t,this.emit(te.CONNECTION_STATUS,t),this.emitServiceStatusEvent({context:"setConnectionStatus"}))}emitServiceStatusEvent(t={}){this.emit(te.SERVICE_STATUS,this.getServiceStatus())}getConnectionStatus(){return this.state._connectionStatus}getServiceStatus(){return{originatorInfo:this.state.originatorInfo,keyInfo:this.getKeyInfo(),connectionStatus:this.state._connectionStatus,channelConfig:this.state.channelConfig,channelId:this.state.channelId}}getKeyInfo(){var t;return(t=this.state.communicationLayer)===null||t===void 0?void 0:t.getKeyInfo()}resetKeys(){var t;(t=this.state.communicationLayer)===null||t===void 0||t.resetKeys()}setOtherPublicKey(t){var n;const r=(n=this.state.communicationLayer)===null||n===void 0?void 0:n.getKeyExchange();if(!r)throw new Error("KeyExchange is not initialized.");r.getOtherPublicKey()!==t&&r.setOtherPublicKey(t)}pause(){return Z(this,void 0,void 0,function*(){var t;W.RemoteCommunication(`[RemoteCommunication: pause()] channel=${this.state.channelId}`),yield(t=this.state.communicationLayer)===null||t===void 0?void 0:t.pause(),this.setConnectionStatus(Be.PAUSED)})}getVersion(){return vn.version}hasRelayPersistence(){var t;return(t=this.state.relayPersistence)!==null&&t!==void 0&&t}resume(){return Z(this,void 0,void 0,function*(){return function(t){return Z(this,void 0,void 0,function*(){var n;const{state:r}=t;W.RemoteCommunication(`[RemoteCommunication: resume()] channel=${r.channelId}`),yield(n=r.communicationLayer)===null||n===void 0?void 0:n.resume(),t.setConnectionStatus(Be.LINKED)})}(this)})}encrypt(t){var n,r,i;const o=(n=this.state.communicationLayer)===null||n===void 0?void 0:n.getKeyExchange(),c=o==null?void 0:o.getOtherPublicKey();if(!c)throw new Error("KeyExchange not completed");return(i=(r=this.state.communicationLayer)===null||r===void 0?void 0:r.state.eciesInstance)===null||i===void 0?void 0:i.encrypt(t,c)}decrypt(t){var n,r,i;if(!(!((n=this.state.communicationLayer)===null||n===void 0)&&n.state.eciesInstance))throw new Error("ECIES instance is not initialized");return(i=(r=this.state.communicationLayer)===null||r===void 0?void 0:r.state.eciesInstance)===null||i===void 0?void 0:i.decrypt(t)}getChannelId(){return this.state.channelId}getRPCMethodTracker(){var t;return(t=this.state.communicationLayer)===null||t===void 0?void 0:t.getRPCMethodTracker()}reject({channelId:t}){return function(n){return Z(this,arguments,void 0,function*({channelId:r,state:i}){var o,c,s;if(!hs(r))throw W.RemoteCommunication(`[RemoteCommunication: connectToChannel()] context=${i.context} invalid channel channelId=${r}`),new Error(`Invalid channel ${r}`);if(i.isOriginator)return void W.RemoteCommunication(`[RemoteCommunication: reject()] context=${i.context} isOriginator=${i.isOriginator} channelId=${r}`);const{socket:a}=(c=(o=i.communicationLayer)===null||o===void 0?void 0:o.state)!==null&&c!==void 0?c:{};a!=null&&a.connected||(W.RemoteCommunication(`[RemoteCommunication: reject()] context=${i.context} socket already connected`),a==null||a.connect()),Gt(Object.assign(Object.assign({id:r,event:Te.REJECTED},i.originatorInfo),{sdkVersion:i.sdkVersion,commLayerVersion:vn.version,walletVersion:(s=i.walletInfo)===null||s===void 0?void 0:s.version}),i.communicationServerUrl).catch(l=>{}),yield new Promise((l,u)=>{a==null||a.emit(te.REJECTED,{channelId:r},(d,f)=>{W.RemoteCommunication(`[RemoteCommunication: reject()] context=${i.context} socket=${a==null?void 0:a.id}`,{error:d,response:f}),d?u(d):l(f)})})})}({channelId:t,state:this.state})}disconnect(t){return Z(this,void 0,void 0,function*(){return Td({options:t,instance:this})})}}(function(e){e.RENEW="renew",e.LINK="link"})(Mc||(Mc={}));var hp="ERC721",pp="ERC1155",xe={errors:{disconnected:()=>"MetaMask: Disconnected from chain. Attempting to connect.",permanentlyDisconnected:()=>"MetaMask: Disconnected from MetaMask background. Page reload required.",sendSiteMetadata:()=>"MetaMask: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:e=>`MetaMask: The MetaMask Ethereum provider does not support synchronous methods like ${e} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidNetworkParams:()=>"MetaMask: Received invalid network parameters. Please report this bug.",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:e=>`'args.logger' must include required method '${e}'.`},info:{connected:e=>`MetaMask: Connected to chain with ID "${e}".`},warnings:{chainIdDeprecation:`MetaMask: 'ethereum.chainId' is deprecated and may be removed in the future. Please use the 'eth_chainId' RPC method instead.
|
|
10
|
+
For more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23`,networkVersionDeprecation:`MetaMask: 'ethereum.networkVersion' is deprecated and may be removed in the future. Please use the 'net_version' RPC method instead.
|
|
11
|
+
For more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23`,selectedAddressDeprecation:`MetaMask: 'ethereum.selectedAddress' is deprecated and may be removed in the future. Please use the 'eth_accounts' RPC method instead.
|
|
12
|
+
For more information, see: https://github.com/MetaMask/metamask-improvement-proposals/discussions/23`,enableDeprecation:`MetaMask: 'ethereum.enable()' is deprecated and may be removed in the future. Please use the 'eth_requestAccounts' RPC method instead.
|
|
13
|
+
For more information, see: https://eips.ethereum.org/EIPS/eip-1102`,sendDeprecation:`MetaMask: 'ethereum.send(...)' is deprecated and may be removed in the future. Please use 'ethereum.sendAsync(...)' or 'ethereum.request(...)' instead.
|
|
14
|
+
For more information, see: https://eips.ethereum.org/EIPS/eip-1193`,events:{close:`MetaMask: The event 'close' is deprecated and may be removed in the future. Please use 'disconnect' instead.
|
|
15
|
+
For more information, see: https://eips.ethereum.org/EIPS/eip-1193#disconnect`,data:`MetaMask: The event 'data' is deprecated and will be removed in the future. Use 'message' instead.
|
|
16
|
+
For more information, see: https://eips.ethereum.org/EIPS/eip-1193#message`,networkChanged:`MetaMask: The event 'networkChanged' is deprecated and may be removed in the future. Use 'chainChanged' instead.
|
|
17
|
+
For more information, see: https://eips.ethereum.org/EIPS/eip-1193#chainchanged`,notification:`MetaMask: The event 'notification' is deprecated and may be removed in the future. Use 'message' instead.
|
|
18
|
+
For more information, see: https://eips.ethereum.org/EIPS/eip-1193#message`},rpc:{ethDecryptDeprecation:`MetaMask: The RPC method 'eth_decrypt' is deprecated and may be removed in the future.
|
|
19
|
+
For more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686`,ethGetEncryptionPublicKeyDeprecation:`MetaMask: The RPC method 'eth_getEncryptionPublicKey' is deprecated and may be removed in the future.
|
|
20
|
+
For more information, see: https://medium.com/metamask/metamask-api-method-deprecation-2b0564a84686`,walletWatchAssetNFTExperimental:`MetaMask: The RPC method 'wallet_watchAsset' is experimental for ERC721/ERC1155 assets and may change in the future.
|
|
21
|
+
For more information, see: https://github.com/MetaMask/metamask-improvement-proposals/blob/main/MIPs/mip-1.md and https://github.com/MetaMask/metamask-improvement-proposals/blob/main/PROCESS-GUIDE.md#proposal-lifecycle`},experimentalMethods:"MetaMask: 'ethereum._metamask' exposes non-standard, experimental methods. They may be removed or changed without warning."}};function mp(e){const t={ethDecryptDeprecation:!1,ethGetEncryptionPublicKeyDeprecation:!1,walletWatchAssetNFTExperimental:!1};return(n,r,i)=>{var o;t.ethDecryptDeprecation||n.method!=="eth_decrypt"?t.ethGetEncryptionPublicKeyDeprecation||n.method!=="eth_getEncryptionPublicKey"?!t.walletWatchAssetNFTExperimental&&n.method==="wallet_watchAsset"&&[hp,pp].includes(((o=n.params)==null?void 0:o.type)||"")&&(e.warn(xe.warnings.rpc.walletWatchAssetNFTExperimental),t.walletWatchAssetNFTExperimental=!0):(e.warn(xe.warnings.rpc.ethGetEncryptionPublicKeyDeprecation),t.ethGetEncryptionPublicKeyDeprecation=!0):(e.warn(xe.warnings.rpc.ethDecryptDeprecation),t.ethDecryptDeprecation=!0),i()}}var Id=4294967295,Ic=Math.floor(Math.random()*Id);function gp(){return(e,t,n,r)=>{const i=e.id,o=Ic=(Ic+1)%Id;e.id=o,t.id=o,n(c=>{e.id=i,t.id=i,c()})}}var aa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},hn=(e,t,n)=>(aa(e,t,"read from private field"),n?n.call(e):t.get(e)),bt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ci=(e,t,n,r)=>(aa(e,t,"write to private field"),t.set(e,n),n),qe=(e,t,n)=>(aa(e,t,"access private method"),n),cn={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},Pc={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};function Rc(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}var Fi=(e,t)=>Object.hasOwnProperty.call(e,t);class yp extends TypeError{constructor(t,n){let r;const{message:i,explanation:o,...c}=t,{path:s}=t,a=s.length===0?i:`At path: ${s.join(".")} -- ${i}`;super(o??a),o!=null&&(this.cause=a),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...n()])}}function Vt(e){return typeof e=="object"&&e!=null}function Nt(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function vp(e,t,n,r){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:o}=t,{type:c}=n,{refinement:s,message:a=`Expected a value of type \`${c}\`${s?` with refinement \`${s}\``:""}, but received: \`${Nt(r)}\``}=e;return{value:r,type:c,refinement:s,key:i[i.length-1],path:i,branch:o,...e,message:a}}function*Oc(e,t,n,r){(function(i){return Vt(i)&&typeof i[Symbol.iterator]=="function"})(e)||(e=[e]);for(const i of e){const o=vp(i,t,n,r);o&&(yield o)}}function*ca(e,t,n={}){const{path:r=[],branch:i=[e],coerce:o=!1,mask:c=!1}=n,s={path:r,branch:i};if(o&&(e=t.coercer(e,s),c&&t.type!=="type"&&Vt(t.schema)&&Vt(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let a="valid";for(const l of t.validator(e,s))l.explanation=n.message,a="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,s)){const f=ca(u,d,{path:l===void 0?r:[...r,l],branch:l===void 0?i:[...i,u],coerce:o,mask:c,message:n.message});for(const h of f)h[0]?(a=h[0].refinement!=null?"not_refined":"not_valid",yield[h[0],void 0]):o&&(u=h[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):Vt(e)&&(u!==void 0||l in e)&&(e[l]=u))}if(a!=="not_valid")for(const l of t.refiner(e,s))l.explanation=n.message,a="not_refined",yield[l,void 0];a==="valid"&&(yield[void 0,e])}class _t{constructor(t){const{type:n,schema:r,validator:i,refiner:o,coercer:c=a=>a,entries:s=function*(){}}=t;this.type=n,this.schema=r,this.entries=s,this.coercer=c,this.validator=i?(a,l)=>Oc(i(a,l),l,this,a):()=>[],this.refiner=o?(a,l)=>Oc(o(a,l),l,this,a):()=>[]}assert(t,n){return Pd(t,this,n)}create(t,n){return Rd(t,this,n)}is(t){return ir(t,this)}mask(t,n){return function(r,i,o){const c=Tr(r,i,{coerce:!0,mask:!0,message:o});if(c[0])throw c[0];return c[1]}(t,this,n)}validate(t,n={}){return Tr(t,this,n)}}function Pd(e,t,n){const r=Tr(e,t,{message:n});if(r[0])throw r[0]}function Rd(e,t,n){const r=Tr(e,t,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function ir(e,t){return!Tr(e,t)[0]}function Tr(e,t,n={}){const r=ca(e,t,n),i=function(o){const{done:c,value:s}=o.next();return c?void 0:s}(r);return i[0]?[new yp(i[0],function*(){for(const c of r)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function bn(e,t){return new _t({type:e,schema:null,validator:t})}function Lc(e){let t;return new _t({type:"lazy",schema:null,*entries(n,r){t??(t=e()),yield*t.entries(n,r)},validator:(n,r)=>(t??(t=e()),t.validator(n,r)),coercer:(n,r)=>(t??(t=e()),t.coercer(n,r)),refiner:(n,r)=>(t??(t=e()),t.refiner(n,r))})}function Od(e){return new _t({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,e]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${Nt(t)}`})}function Ld(e){const t=Nt(e),n=typeof e;return new _t({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${Nt(r)}`})}function Nd(){return bn("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Nt(e)}`)}function Dd(e){const t=e?Object.keys(e):[],n=bn("never",()=>!1);return new _t({type:"object",schema:e||null,*entries(r){if(e&&Vt(r)){const i=new Set(Object.keys(r));for(const o of t)i.delete(o),yield[o,r[o],e[o]];for(const o of i)yield[o,r[o],n]}},validator:r=>Vt(r)||`Expected an object, but received: ${Nt(r)}`,coercer:r=>Vt(r)?{...r}:r})}function Nc(e){return new _t({...e,validator:(t,n)=>t===void 0||e.validator(t,n),refiner:(t,n)=>t===void 0||e.refiner(t,n)})}function $d(e,t){return new _t({type:"record",schema:null,*entries(n){if(Vt(n))for(const r in n){const i=n[r];yield[r,r,e],yield[r,i,t]}},validator:n=>Vt(n)||`Expected an object, but received: ${Nt(n)}`})}function wn(){return bn("string",e=>typeof e=="string"||`Expected a string, but received: ${Nt(e)}`)}function lo(e){const t=e.map(n=>n.type).join(" | ");return new _t({type:"union",schema:null,coercer(n){for(const r of e){const[i,o]=r.validate(n,{coerce:!0});if(!i)return o}return n},validator(n,r){const i=[];for(const o of e){const[...c]=ca(n,o,r),[s]=c;if(!s[0])return[];for(const[a]of c)a&&i.push(a)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Nt(n)}`,...i]}})}function bp(e){return function(t){return function(n){return typeof n=="object"&&n!==null&&"message"in n}(t)&&typeof t.message=="string"?t.message:t==null?"":String(t)}(e).replace(/\.$/u,"")}function wp(e,t){var r,i;return n=e,typeof((i=(r=n==null?void 0:n.prototype)==null?void 0:r.constructor)==null?void 0:i.name)=="string"?new e({message:t}):e({message:t});var n}var Ep=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};function Bd(){throw new Error("setTimeout has not been defined")}function Kd(){throw new Error("clearTimeout has not been defined")}var tn=Bd,nn=Kd;function jd(e){if(tn===setTimeout)return setTimeout(e,0);if((tn===Bd||!tn)&&setTimeout)return tn=setTimeout,setTimeout(e,0);try{return tn(e,0)}catch{try{return tn.call(null,e,0)}catch{return tn.call(this,e,0)}}}typeof Ye.setTimeout=="function"&&(tn=setTimeout),typeof Ye.clearTimeout=="function"&&(nn=clearTimeout);var xn,Wt=[],Xn=!1,bi=-1;function _p(){Xn&&xn&&(Xn=!1,xn.length?Wt=xn.concat(Wt):bi=-1,Wt.length&&Ud())}function Ud(){if(!Xn){var e=jd(_p);Xn=!0;for(var t=Wt.length;t;){for(xn=Wt,Wt=[];++bi<t;)xn&&xn[bi].run();bi=-1,t=Wt.length}xn=null,Xn=!1,function(n){if(nn===clearTimeout)return clearTimeout(n);if((nn===Kd||!nn)&&clearTimeout)return nn=clearTimeout,clearTimeout(n);try{return nn(n)}catch{try{return nn.call(null,n)}catch{return nn.call(this,n)}}}(e)}}function Hd(e,t){this.fun=e,this.array=t}Hd.prototype.run=function(){this.fun.apply(null,this.array)};function Rn(){}var Sp=Rn,Cp=Rn,Ap=Rn,kp=Rn,xp=Rn,Mp=Rn,Tp=Rn,Un=Ye.performance||{},Ip=Un.now||Un.mozNow||Un.msNow||Un.oNow||Un.webkitNow||function(){return new Date().getTime()},Pp=new Date,be={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Wt.push(new Hd(e,t)),Wt.length!==1||Xn||jd(Ud)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Sp,addListener:Cp,once:Ap,off:kp,removeListener:xp,removeAllListeners:Mp,emit:Tp,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*Ip.call(Un),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Pp)/1e3}},Ir=e=>Dd(e);function Dc({path:e,branch:t}){const n=e[e.length-1];return Fi(t[t.length-2],n)}function zi(e){return new _t({...e,type:`optional ${e.type}`,validator:(t,n)=>!Dc(n)||e.validator(t,n),refiner:(t,n)=>!Dc(n)||e.refiner(t,n)})}var li,$c,Bc,qi=lo([Ld(null),bn("boolean",e=>typeof e=="boolean"),bn("finite number",e=>ir(e,Nd())&&Number.isFinite(e)),wn(),Od(Lc(()=>qi)),$d(wn(),Lc(()=>qi))]),Pr=(li=qi,$c=bn("any",()=>!0),Bc=e=>(function(t,n,r="Assertion failed",i=Ep){try{Pd(t,n)}catch(o){throw wp(i,`${r}: ${bp(o)}.`)}}(e,qi),JSON.parse(JSON.stringify(e,(t,n)=>{if(t!=="__proto__"&&t!=="constructor")return n}))),new _t({...li,coercer:(e,t)=>ir(e,$c)?li.coercer(Bc(e,t),t):li.coercer(e,t)}));function ks(e){try{return function(t){Rd(t,Pr)}(e),!0}catch{return!1}}var yr=Ld("2.0"),wi=function(e){return new _t({...e,validator:(t,n)=>t===null||e.validator(t,n),refiner:(t,n)=>t===null||e.refiner(t,n)})}(lo([Nd(),wn()])),xs=Ir({code:bn("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Nt(e)}`),message:wn(),data:zi(Pr),stack:zi(wn())}),Fd=lo([$d(wn(),Pr),Od(Pr)]),Rp=Ir({id:wi,jsonrpc:yr,method:wn(),params:zi(Fd)}),Op=Ir({jsonrpc:yr,method:wn(),params:zi(Fd)});function Kc(e){return ir(e,Rp)}function jc(e){return ir(e,xs)}Dd({id:wi,jsonrpc:yr,result:Nc(bn("unknown",()=>!0)),error:Nc(xs)}),lo([Ir({id:wi,jsonrpc:yr,result:Pr}),Ir({id:wi,jsonrpc:yr,error:xs})]);var Uc=cn.internal,Lp="Unspecified error message. This is a bug, please report it.",Np={code:Uc,message:zd(Uc)},Dp="Unspecified server error.";function zd(e,t=Lp){if(function(n){return Number.isInteger(n)}(e)){const n=e.toString();if(Fi(Pc,n))return Pc[n].message;if(function(r){return r>=-32099&&r<=-32e3}(e))return Dp}return t}function Hc(e,{fallbackError:t=Np,shouldIncludeStack:n=!0}={}){if(!jc(t))throw new Error("Must provide fallback error with integer number code and string message.");const r=function(i,o){if(i&&typeof i=="object"&&"serialize"in i&&typeof i.serialize=="function")return i.serialize();if(jc(i))return i;const c=qd(i);return{...o,data:{cause:c}}}(e,t);return n||delete r.stack,r}function qd(e){return Array.isArray(e)?e.map(t=>ks(t)?t:Rc(t)?Fc(t):null):Rc(e)?Fc(e):ks(e)?e:null}function Fc(e){return Object.getOwnPropertyNames(e).reduce((t,n)=>{const r=e[n];return ks(r)&&(t[n]=r),t},{})}var Wd=hr;hr.default=hr,hr.stable=zc,hr.stableStringify=zc;var Wi="[...]",Vd="[Circular]",Pn=[],Mn=[];function Gd(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function hr(e,t,n,r){var i;r===void 0&&(r=Gd()),Ms(e,"",0,[],void 0,0,r);try{i=Mn.length===0?JSON.stringify(e,t,n):JSON.stringify(e,Yd(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pn.length!==0;){var o=Pn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Qn(e,t,n,r){var i=Object.getOwnPropertyDescriptor(r,n);i.get!==void 0?i.configurable?(Object.defineProperty(r,n,{value:e}),Pn.push([r,n,t,i])):Mn.push([t,n,e]):(r[n]=e,Pn.push([r,n,t]))}function Ms(e,t,n,r,i,o,c){var s;if(o+=1,typeof e=="object"&&e!==null){for(s=0;s<r.length;s++)if(r[s]===e)return void Qn(Vd,e,t,i);if(c.depthLimit!==void 0&&o>c.depthLimit||c.edgesLimit!==void 0&&n+1>c.edgesLimit)return void Qn(Wi,e,t,i);if(r.push(e),Array.isArray(e))for(s=0;s<e.length;s++)Ms(e[s],s,s,r,e,o,c);else{var a=Object.keys(e);for(s=0;s<a.length;s++){var l=a[s];Ms(e[l],l,s,r,e,o,c)}}r.pop()}}function $p(e,t){return e<t?-1:e>t?1:0}function zc(e,t,n,r){r===void 0&&(r=Gd());var i,o=Ts(e,"",0,[],void 0,0,r)||e;try{i=Mn.length===0?JSON.stringify(o,t,n):JSON.stringify(o,Yd(t),n)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pn.length!==0;){var c=Pn.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return i}function Ts(e,t,n,r,i,o,c){var s;if(o+=1,typeof e=="object"&&e!==null){for(s=0;s<r.length;s++)if(r[s]===e)return void Qn(Vd,e,t,i);try{if(typeof e.toJSON=="function")return}catch{return}if(c.depthLimit!==void 0&&o>c.depthLimit||c.edgesLimit!==void 0&&n+1>c.edgesLimit)return void Qn(Wi,e,t,i);if(r.push(e),Array.isArray(e))for(s=0;s<e.length;s++)Ts(e[s],s,s,r,e,o,c);else{var a={},l=Object.keys(e).sort($p);for(s=0;s<l.length;s++){var u=l[s];Ts(e[u],u,s,r,e,o,c),a[u]=e[u]}if(i===void 0)return a;Pn.push([i,t,e]),i[t]=a}r.pop()}}function Yd(e){return e=e!==void 0?e:function(t,n){return n},function(t,n){if(Mn.length>0)for(var r=0;r<Mn.length;r++){var i=Mn[r];if(i[1]===t&&i[0]===n){n=i[2],Mn.splice(r,1);break}}return e.call(this,t,n)}}var Bp=ao(Wd),jt=class extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||typeof t!="string")throw new Error('"message" must be a non-empty string.');super(t),this.code=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data,function(t){if(typeof t!="object"||t===null)return!1;try{let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}catch{return!1}}(this.data)&&(e.data.cause=qd(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return Bp(this.serialize(),Kp,2)}};function Kp(e,t){if(t!=="[Circular]")return t}var vr=e=>jp(cn.invalidRequest,e);function jp(e,t){const[n,r]=function(i){if(i){if(typeof i=="string")return[i];if(typeof i=="object"&&!Array.isArray(i)){const{message:o,data:c}=i;if(o&&typeof o!="string")throw new Error("Must specify string message.");return[o??void 0,c]}}return[]}(t);return new jt(e,n??zd(e),r)}var Zd={};function rn(){}function Ee(){Ee.init.call(this)}function Jd(e){return e._maxListeners===void 0?Ee.defaultMaxListeners:e._maxListeners}function qc(e,t,n,r){var i,o,c;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),c=o[t]):(o=e._events=new rn,e._eventsCount=0),c){if(typeof c=="function"?c=o[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),!c.warned&&(i=Jd(e))&&i>0&&c.length>i){c.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=c.length,function(a){typeof console.warn=="function"?console.warn(a):console.log(a)}(s)}}else c=o[t]=n,++e._eventsCount;return e}function Wc(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function Vc(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}function ur(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}rn.prototype=Object.create(null),Ee.EventEmitter=Ee,Ee.usingDomains=!1,Ee.prototype.domain=void 0,Ee.prototype._events=void 0,Ee.prototype._maxListeners=void 0,Ee.defaultMaxListeners=10,Ee.init=function(){this.domain=null,Ee.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new rn,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ee.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Ee.prototype.getMaxListeners=function(){return Jd(this)},Ee.prototype.emit=function(e){var t,n,r,i,o,c,s,a=e==="error";if(c=this._events)a=a&&c.error==null;else if(!a)return!1;if(s=this.domain,a){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=c[e]))return!1;var u=typeof n=="function";switch(r=arguments.length){case 1:(function(d,f,h){if(f)d.call(h);else for(var g=d.length,m=ur(d,g),w=0;w<g;++w)m[w].call(h)})(n,u,this);break;case 2:(function(d,f,h,g){if(f)d.call(h,g);else for(var m=d.length,w=ur(d,m),p=0;p<m;++p)w[p].call(h,g)})(n,u,this,arguments[1]);break;case 3:(function(d,f,h,g,m){if(f)d.call(h,g,m);else for(var w=d.length,p=ur(d,w),S=0;S<w;++S)p[S].call(h,g,m)})(n,u,this,arguments[1],arguments[2]);break;case 4:(function(d,f,h,g,m,w){if(f)d.call(h,g,m,w);else for(var p=d.length,S=ur(d,p),_=0;_<p;++_)S[_].call(h,g,m,w)})(n,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];(function(d,f,h,g){if(f)d.apply(h,g);else for(var m=d.length,w=ur(d,m),p=0;p<m;++p)w[p].apply(h,g)})(n,u,this,i)}return!0},Ee.prototype.addListener=function(e,t){return qc(this,e,t,!1)},Ee.prototype.on=Ee.prototype.addListener,Ee.prototype.prependListener=function(e,t){return qc(this,e,t,!0)},Ee.prototype.once=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,Wc(this,e,t)),this},Ee.prototype.prependOnceListener=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,Wc(this,e,t)),this},Ee.prototype.removeListener=function(e,t){var n,r,i,o,c;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)--this._eventsCount==0?this._events=new rn:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(i=-1,o=n.length;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){c=n[o].listener,i=o;break}if(i<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount==0)return this._events=new rn,this;delete r[e]}else(function(s,a){for(var l=a,u=l+1,d=s.length;u<d;l+=1,u+=1)s[l]=s[u];s.pop()})(n,i);r.removeListener&&this.emit("removeListener",e,c||t)}return this},Ee.prototype.off=function(e,t){return this.removeListener(e,t)},Ee.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return arguments.length===0?(this._events=new rn,this._eventsCount=0):n[e]&&(--this._eventsCount==0?this._events=new rn:delete n[e]),this;if(arguments.length===0){for(var r,i=Object.keys(n),o=0;o<i.length;++o)(r=i[o])!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new rn,this._eventsCount=0,this}if(typeof(t=n[e])=="function")this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this},Ee.prototype.listeners=function(e){var t,n,r=this._events;return n=r&&(t=r[e])?typeof t=="function"?[t.listener||t]:function(i){for(var o=new Array(i.length),c=0;c<o.length;++c)o[c]=i[c].listener||i[c];return o}(t):[],n},Ee.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Vc.call(e,t)},Ee.prototype.listenerCount=Vc,Ee.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var la=jr(Object.freeze({__proto__:null,EventEmitter:Ee,default:Ee}));Object.defineProperty(Zd,"__esModule",{value:!0});const Up=la;function Gc(e,t,n){try{Reflect.apply(e,t,n)}catch(r){setTimeout(()=>{throw r})}}let Hp=class extends Up.EventEmitter{emit(e,...t){let n=e==="error";const r=this._events;if(r!==void 0)n=n&&r.error===void 0;else if(!n)return!1;if(n){let o;if(t.length>0&&([o]=t),o instanceof Error)throw o;const c=new Error("Unhandled error."+(o?` (${o.message})`:""));throw c.context=o,c}const i=r[e];if(i===void 0)return!1;if(typeof i=="function")Gc(i,this,t);else{const o=i.length,c=function(s){const a=s.length,l=new Array(a);for(let u=0;u<a;u+=1)l[u]=s[u];return l}(i);for(let s=0;s<o;s+=1)Gc(c[s],this,t)}return!0}};var Vi,ln,Gn,pr,Ei,_i,Is,Si,Ps,Uo,Yc,Ci,Rs,Ho,Zc,br,Gi,Fo,Jc,Xd=Zd.default=Hp,vt=class Ai extends Xd{constructor({notificationHandler:t}={}){super(),bt(this,pr),bt(this,_i),bt(this,Si),bt(this,Vi,!1),bt(this,ln,void 0),bt(this,Gn,void 0),ci(this,ln,[]),ci(this,Gn,t)}destroy(){hn(this,ln).forEach(t=>{"destroy"in t&&typeof t.destroy=="function"&&t.destroy()}),ci(this,ln,[]),ci(this,Vi,!0)}push(t){qe(this,pr,Ei).call(this),hn(this,ln).push(t)}handle(t,n){if(qe(this,pr,Ei).call(this),n&&typeof n!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?n?qe(this,_i,Is).call(this,t,n):qe(this,_i,Is).call(this,t):n?qe(this,Si,Ps).call(this,t,n):this._promiseHandle(t)}asMiddleware(){return qe(this,pr,Ei).call(this),async(t,n,r,i)=>{var o,c;try{const[s,a,l]=await qe(o=Ai,Ci,Rs).call(o,t,n,hn(this,ln));return a?(await qe(c=Ai,br,Gi).call(c,l),i(s)):r(async u=>{var d;try{await qe(d=Ai,br,Gi).call(d,l)}catch(f){return u(f)}return u()})}catch(s){return i(s)}}}async _promiseHandle(t){return new Promise((n,r)=>{qe(this,Si,Ps).call(this,t,(i,o)=>{i&&o===void 0?r(i):n(o)}).catch(r)})}};Vi=new WeakMap,ln=new WeakMap,Gn=new WeakMap,pr=new WeakSet,Ei=function(){if(hn(this,Vi))throw new Error("This engine is destroyed and can no longer be used.")},_i=new WeakSet,Is=async function(e,t){try{if(e.length===0){const r=[{id:null,jsonrpc:"2.0",error:new jt(cn.invalidRequest,"Request batch must contain plain objects. Received an empty array")}];return t?t(null,r):r}const n=(await Promise.all(e.map(this._promiseHandle.bind(this)))).filter(r=>r!==void 0);return t?t(null,n):n}catch(n){if(t)return t(n);throw n}},Si=new WeakSet,Ps=async function(e,t){var n;if(!e||Array.isArray(e)||typeof e!="object"){const c=new jt(cn.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(c,{id:null,jsonrpc:"2.0",error:c})}if(typeof e.method!="string"){const c=new jt(cn.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return hn(this,Gn)&&!Kc(e)?t(null):t(c,{id:e.id??null,jsonrpc:"2.0",error:c})}if(hn(this,Gn)&&ir(e,Op)&&!Kc(e)){try{await hn(this,Gn).call(this,e)}catch(c){return t(c)}return t(null)}let r=null;const i={...e},o={id:i.id,jsonrpc:i.jsonrpc};try{await qe(n=vt,Uo,Yc).call(n,i,o,hn(this,ln))}catch(c){r=c}return r&&(delete o.result,o.error||(o.error=Hc(r))),t(r,o)},Uo=new WeakSet,Yc=async function(e,t,n){var r,i,o;const[c,s,a]=await qe(r=vt,Ci,Rs).call(r,e,t,n);if(qe(i=vt,Fo,Jc).call(i,e,t,s),await qe(o=vt,br,Gi).call(o,a),c)throw c},Ci=new WeakSet,Rs=async function(e,t,n){var r;const i=[];let o=null,c=!1;for(const s of n)if([o,c]=await qe(r=vt,Ho,Zc).call(r,e,t,s,i),c)break;return[o,c,i.reverse()]},Ho=new WeakSet,Zc=async function(e,t,n,r){return new Promise(i=>{const o=s=>{const a=s||t.error;a&&(t.error=Hc(a)),i([a,!0])},c=s=>{t.error?o(t.error):(s&&(typeof s!="function"&&o(new jt(cn.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof s}" for request:
|
|
22
|
+
${zo(e)}`,{request:e})),r.push(s)),i([null,!1]))};try{n(e,t,c,o)}catch(s){o(s)}})},br=new WeakSet,Gi=async function(e){for(const t of e)await new Promise((n,r)=>{t(i=>i?r(i):n())})},Fo=new WeakSet,Jc=function(e,t,n){if(!Fi(t,"result")&&!Fi(t,"error"))throw new jt(cn.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
23
|
+
${zo(e)}`,{request:e});if(!n)throw new jt(cn.internal,`JsonRpcEngine: Nothing ended request:
|
|
24
|
+
${zo(e)}`,{request:e})},bt(vt,Uo),bt(vt,Ci),bt(vt,Ho),bt(vt,br),bt(vt,Fo);var Fp=vt;function zo(e){return JSON.stringify(e,null,2)}var Qd=Object.freeze(["eth_subscription"]),zp=(e=console)=>[gp(),qp(e),mp(e)];function qp(e){return(t,n,r)=>{typeof t.method=="string"&&t.method||(n.error=vr({message:"The request 'method' must be a non-empty string.",data:t})),r(i=>{const{error:o}=n;return o&&e.error(`MetaMask - RPC Error: ${o.message}`,o),i()})}}var ki=(e,t,n=!0)=>(r,i)=>{r||i.error?t(r||i.error):!n||Array.isArray(i)?e(i):e(i.result)},ef=e=>!!e&&typeof e=="string"&&e.startsWith("0x"),tf=()=>{};async function Xc(e,t){try{const n=await async function(){return{name:Wp(window),icon:await Vp(window)}}();e.handle({jsonrpc:"2.0",id:1,method:"metamask_sendDomainMetadata",params:n},tf)}catch(n){t.error({message:xe.errors.sendSiteMetadata(),originalError:n})}}function Wp(e){const{document:t}=e,n=t.querySelector('head > meta[property="og:site_name"]');if(n)return n.content;const r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:window.location.hostname}async function Vp(e){const{document:t}=e,n=t.querySelectorAll('head > link[rel~="icon"]');for(const r of Array.from(n))if(r&&await Gp(r.href))return r.href;return null}async function Gp(e){return new Promise((t,n)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=e}catch(r){n(r)}})}var nf=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Tt=(e,t,n)=>(nf(e,t,"read from private field"),n?n.call(e):t.get(e)),Os=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ut=(e,t,n,r)=>(nf(e,t,"write to private field"),t.set(e,n),n);function Qc(e,t,n){try{Reflect.apply(e,t,n)}catch(r){setTimeout(()=>{throw r})}}class Yp extends Ee{emit(t,...n){let r=t==="error";const i=this._events;if(i!==void 0)r=r&&i.error===void 0;else if(!r)return!1;if(r){let c;if(n.length>0&&([c]=n),c instanceof Error)throw c;const s=new Error("Unhandled error."+(c?` (${c.message})`:""));throw s.context=c,s}const o=i[t];if(o===void 0)return!1;if(typeof o=="function")Qc(o,this,n);else{const c=o.length,s=function(a){const l=a.length,u=new Array(l);for(let d=0;d<l;d+=1)u[d]=a[d];return u}(o);for(let a=0;a<c;a+=1)Qc(s[a],this,n)}return!0}}var on,Sn,Zp=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;i--!=0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;i--!=0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!=0;){var c=o[i];if(!e(t[c],n[c]))return!1}return!0}return t!=t&&n!=n},Jp=ao(Zp),rf=class of extends Yp{constructor({logger:t=console,maxEventListeners:n=100,rpcMiddleware:r=[]}={}){super(),Os(this,on,void 0),Os(this,Sn,void 0),this._log=t,this.setMaxListeners(n),this._state={...of._defaultState},Ut(this,Sn,null),Ut(this,on,null),this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this.request=this.request.bind(this);const i=new Fp;r.forEach(o=>i.push(o)),this._rpcEngine=i}get chainId(){return Tt(this,on)}get selectedAddress(){return Tt(this,Sn)}isConnected(){return this._state.isConnected}async request(t){if(!t||typeof t!="object"||Array.isArray(t))throw vr({message:xe.errors.invalidRequestArgs(),data:t});const{method:n,params:r}=t;if(typeof n!="string"||n.length===0)throw vr({message:xe.errors.invalidRequestMethod(),data:t});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))throw vr({message:xe.errors.invalidRequestParams(),data:t});const i=r==null?{method:n}:{method:n,params:r};return new Promise((o,c)=>{this._rpcRequest(i,ki(o,c))})}_initializeState(t){if(this._state.initialized)throw new Error("Provider already initialized.");if(t){const{accounts:n,chainId:r,isUnlocked:i,networkVersion:o}=t;this._handleConnect(r),this._handleChainChanged({chainId:r,networkVersion:o}),this._handleUnlockStateChanged({accounts:n,isUnlocked:i}),this._handleAccountsChanged(n)}this._state.initialized=!0,this.emit("_initialized")}_rpcRequest(t,n){let r=n;return Array.isArray(t)||(t.jsonrpc||(t.jsonrpc="2.0"),t.method!=="eth_accounts"&&t.method!=="eth_requestAccounts"||(r=(i,o)=>{this._handleAccountsChanged(o.result??[],t.method==="eth_accounts"),n(i,o)})),this._rpcEngine.handle(t,r)}_handleConnect(t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:t}),this._log.debug(xe.info.connected(t)))}_handleDisconnect(t,n){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){let r;this._state.isConnected=!1,t?(r=new jt(1013,n??xe.errors.disconnected()),this._log.debug(r)):(r=new jt(1011,n??xe.errors.permanentlyDisconnected()),this._log.error(r),Ut(this,on,null),this._state.accounts=null,Ut(this,Sn,null),this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleChainChanged({chainId:t}={}){ef(t)?(this._handleConnect(t),t!==Tt(this,on)&&(Ut(this,on,t),this._state.initialized&&this.emit("chainChanged",Tt(this,on)))):this._log.error(xe.errors.invalidNetworkParams(),{chainId:t})}_handleAccountsChanged(t,n=!1){let r=t;Array.isArray(t)||(this._log.error("MetaMask: Received invalid accounts parameter. Please report this bug.",t),r=[]);for(const i of t)if(typeof i!="string"){this._log.error("MetaMask: Received non-string account. Please report this bug.",t),r=[];break}if(!Jp(this._state.accounts,r)&&(n&&this._state.accounts!==null&&this._log.error("MetaMask: 'eth_accounts' unexpectedly updated accounts. Please report this bug.",r),this._state.accounts=r,Tt(this,Sn)!==r[0]&&Ut(this,Sn,r[0]||null),this._state.initialized)){const i=[...r];this.emit("accountsChanged",i)}}_handleUnlockStateChanged({accounts:t,isUnlocked:n}={}){typeof n=="boolean"?n!==this._state.isUnlocked&&(this._state.isUnlocked=n,this._handleAccountsChanged(t??[])):this._log.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.")}};on=new WeakMap,Sn=new WeakMap,rf._defaultState={accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1};var ua,Xp=rf,Ls={exports:{}},sf=la.EventEmitter,da=jr(h0);ua=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var af=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},Qp=/%[sdj%]/g;function uo(e){if(!Rr(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(Ot(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(Qp,function(s){if(s==="%%")return"%";if(n>=i)return s;switch(s){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return s}}),c=r[n];n<i;c=r[++n])Fr(c)||!On(c)?o+=" "+c:o+=" "+Ot(c);return o}function fa(e,t){if(Pt(Ye.process))return function(){return fa(e,t).apply(this,arguments)};if(be.noDeprecation===!0)return e;var n=!1;return function(){if(!n){if(be.throwDeprecation)throw new Error(t);be.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var qo,ui={};function cf(e){return Pt(qo)&&(qo=be.env.NODE_DEBUG||""),e=e.toUpperCase(),!ui[e]&&(new RegExp("\\b"+e+"\\b","i").test(qo)?ui[e]=function(){var t=uo.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:ui[e]=function(){}),ui[e]}function Ot(e,t){var n={seen:[],stylize:tm};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),fo(t)?n.showHidden=t:t&&ga(n,t),Pt(n.showHidden)&&(n.showHidden=!1),Pt(n.depth)&&(n.depth=2),Pt(n.colors)&&(n.colors=!1),Pt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=em),Yi(n,e,n.depth)}function em(e,t){var n=Ot.styles[t];return n?"\x1B["+Ot.colors[n][0]+"m"+e+"\x1B["+Ot.colors[n][1]+"m":e}function tm(e,t){return e}function Yi(e,t,n){if(e.customInspect&&t&&_r(t.inspect)&&t.inspect!==Ot&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return Rr(r)||(r=Yi(e,r,n)),r}var i=function(f,h){if(Pt(h))return f.stylize("undefined","undefined");if(Rr(h)){var g="'"+JSON.stringify(h).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return f.stylize(g,"string")}if(pa(h))return f.stylize(""+h,"number");if(fo(h))return f.stylize(""+h,"boolean");if(Fr(h))return f.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),c=function(f){var h={};return f.forEach(function(g,m){h[g]=!0}),h}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Er(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Wo(t);if(o.length===0){if(_r(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(wr(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Zi(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Er(t))return Wo(t)}var a,l="",u=!1,d=["{","}"];return ha(t)&&(u=!0,d=["[","]"]),_r(t)&&(l=" [Function"+(t.name?": "+t.name:"")+"]"),wr(t)&&(l=" "+RegExp.prototype.toString.call(t)),Zi(t)&&(l=" "+Date.prototype.toUTCString.call(t)),Er(t)&&(l=" "+Wo(t)),o.length!==0||u&&t.length!=0?n<0?wr(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),a=u?function(f,h,g,m,w){for(var p=[],S=0,_=h.length;S<_;++S)pf(h,String(S))?p.push(Vo(f,h,g,m,String(S),!0)):p.push("");return w.forEach(function(P){P.match(/^\d+$/)||p.push(Vo(f,h,g,m,P,!0))}),p}(e,t,n,c,o):o.map(function(f){return Vo(e,t,n,c,f,u)}),e.seen.pop(),function(f,h,g){var m=f.reduce(function(w,p){return p.indexOf(`
|
|
25
|
+
`),w+p.replace(/\u001b\[\d\d?m/g,"").length+1},0);return m>60?g[0]+(h===""?"":h+`
|
|
26
|
+
`)+" "+f.join(`,
|
|
27
|
+
`)+" "+g[1]:g[0]+h+" "+f.join(", ")+" "+g[1]}(a,l,d)):d[0]+l+d[1]}function Wo(e){return"["+Error.prototype.toString.call(e)+"]"}function Vo(e,t,n,r,i,o){var c,s,a;if((a=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(s=e.stylize("[Setter]","special")),pf(r,i)||(c="["+i+"]"),s||(e.seen.indexOf(a.value)<0?(s=Fr(n)?Yi(e,a.value,null):Yi(e,a.value,n-1)).indexOf(`
|
|
28
|
+
`)>-1&&(s=o?s.split(`
|
|
29
|
+
`).map(function(l){return" "+l}).join(`
|
|
30
|
+
`).substr(2):`
|
|
31
|
+
`+s.split(`
|
|
32
|
+
`).map(function(l){return" "+l}).join(`
|
|
33
|
+
`)):s=e.stylize("[Circular]","special")),Pt(c)){if(o&&i.match(/^\d+$/))return s;(c=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+s}function ha(e){return Array.isArray(e)}function fo(e){return typeof e=="boolean"}function Fr(e){return e===null}function lf(e){return e==null}function pa(e){return typeof e=="number"}function Rr(e){return typeof e=="string"}function uf(e){return typeof e=="symbol"}function Pt(e){return e===void 0}function wr(e){return On(e)&&ma(e)==="[object RegExp]"}function On(e){return typeof e=="object"&&e!==null}function Zi(e){return On(e)&&ma(e)==="[object Date]"}function Er(e){return On(e)&&(ma(e)==="[object Error]"||e instanceof Error)}function _r(e){return typeof e=="function"}function df(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||e===void 0}function ff(e){return X.isBuffer(e)}function ma(e){return Object.prototype.toString.call(e)}function Go(e){return e<10?"0"+e.toString(10):e.toString(10)}Ot.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Ot.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var nm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function hf(){var e,t;console.log("%s - %s",(e=new Date,t=[Go(e.getHours()),Go(e.getMinutes()),Go(e.getSeconds())].join(":"),[e.getDate(),nm[e.getMonth()],t].join(" ")),uo.apply(null,arguments))}function ga(e,t){if(!t||!On(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function pf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Cn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function ya(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Cn&&e[Cn]){var t;if(typeof(t=e[Cn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,Cn,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var n,r,i=new Promise(function(s,a){n=s,r=a}),o=[],c=0;c<arguments.length;c++)o.push(arguments[c]);o.push(function(s,a){s?r(s):n(a)});try{e.apply(this,o)}catch(s){r(s)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Cn&&Object.defineProperty(t,Cn,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,af(e))}function rm(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}function mf(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var o=this,c=function(){return i.apply(o,arguments)};e.apply(this,n).then(function(s){be.nextTick(c.bind(null,null,s))},function(s){be.nextTick(rm.bind(null,s,c))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,af(e)),t}ya.custom=Cn;var Yo,el,im={inherits:ua,_extend:ga,log:hf,isBuffer:ff,isPrimitive:df,isFunction:_r,isError:Er,isDate:Zi,isObject:On,isRegExp:wr,isUndefined:Pt,isSymbol:uf,isString:Rr,isNumber:pa,isNullOrUndefined:lf,isNull:Fr,isBoolean:fo,isArray:ha,inspect:Ot,deprecate:fa,format:uo,debuglog:cf,promisify:ya,callbackify:mf},gf=jr(Object.freeze({__proto__:null,_extend:ga,callbackify:mf,debuglog:cf,default:im,deprecate:fa,format:uo,inherits:ua,inspect:Ot,isArray:ha,isBoolean:fo,isBuffer:ff,isDate:Zi,isError:Er,isFunction:_r,isNull:Fr,isNullOrUndefined:lf,isNumber:pa,isObject:On,isPrimitive:df,isRegExp:wr,isString:Rr,isSymbol:uf,isUndefined:Pt,log:hf,promisify:ya}));function om(){if(el)return Yo;function e(a,l){var u=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);l&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable})),u.push.apply(u,d)}return u}function t(a){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?e(Object(u),!0).forEach(function(d){n(a,d,u[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(u)):e(Object(u)).forEach(function(d){Object.defineProperty(a,d,Object.getOwnPropertyDescriptor(u,d))})}return a}function n(a,l,u){return(l=i(l))in a?Object.defineProperty(a,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):a[l]=u,a}function r(a,l,u){return l&&function(d,f){for(var h=0;h<f.length;h++){var g=f[h];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,i(g.key),g)}}(a.prototype,l),Object.defineProperty(a,"prototype",{writable:!1}),a}function i(a){var l=function(u,d){if(typeof u!="object"||u===null)return u;var f=u[Symbol.toPrimitive];if(f!==void 0){var h=f.call(u,d);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(u)}(a,"string");return typeof l=="symbol"?l:String(l)}el=1;var o=da.Buffer,c=gf.inspect,s=c&&c.custom||"inspect";return Yo=function(){function a(){(function(l,u){if(!(l instanceof u))throw new TypeError("Cannot call a class as a function")})(this,a),this.head=null,this.tail=null,this.length=0}return r(a,[{key:"push",value:function(l){var u={data:l,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}},{key:"unshift",value:function(l){var u={data:l,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}},{key:"shift",value:function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(l){if(this.length===0)return"";for(var u=this.head,d=""+u.data;u=u.next;)d+=l+u.data;return d}},{key:"concat",value:function(l){if(this.length===0)return o.alloc(0);for(var u,d,f,h=o.allocUnsafe(l>>>0),g=this.head,m=0;g;)u=g.data,d=h,f=m,o.prototype.copy.call(u,d,f),m+=g.data.length,g=g.next;return h}},{key:"consume",value:function(l,u){var d;return l<this.head.data.length?(d=this.head.data.slice(0,l),this.head.data=this.head.data.slice(l)):d=l===this.head.data.length?this.shift():u?this._getString(l):this._getBuffer(l),d}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(l){var u=this.head,d=1,f=u.data;for(l-=f.length;u=u.next;){var h=u.data,g=l>h.length?h.length:l;if(g===h.length?f+=h:f+=h.slice(0,l),(l-=g)===0){g===h.length?(++d,u.next?this.head=u.next:this.head=this.tail=null):(this.head=u,u.data=h.slice(g));break}++d}return this.length-=d,f}},{key:"_getBuffer",value:function(l){var u=o.allocUnsafe(l),d=this.head,f=1;for(d.data.copy(u),l-=d.data.length;d=d.next;){var h=d.data,g=l>h.length?h.length:l;if(h.copy(u,u.length-l,0,g),(l-=g)===0){g===h.length?(++f,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=h.slice(g));break}++f}return this.length-=f,u}},{key:s,value:function(l,u){return c(this,t(t({},u),{},{depth:0,customInspect:!1}))}}]),a}(),Yo}function tl(e,t){Ns(e,t),xi(e)}function xi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Ns(e,t){e.emit("error",t)}var yf={destroy:function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,be.nextTick(Ns,this,e)):be.nextTick(Ns,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?n._writableState?n._writableState.errorEmitted?be.nextTick(xi,n):(n._writableState.errorEmitted=!0,be.nextTick(tl,n,o)):be.nextTick(tl,n,o):t?(be.nextTick(xi,n),t(o)):be.nextTick(xi,n)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit("error",t)}},Ln={},vf={};function lt(e,t,n){n||(n=Error);var r=function(i){var o,c;function s(a,l,u){return i.call(this,function(d,f,h){return typeof t=="string"?t:t(d,f,h)}(a,l,u))||this}return c=i,(o=s).prototype=Object.create(c.prototype),o.prototype.constructor=o,o.__proto__=c,s}(n);r.prototype.name=n.name,r.prototype.code=e,vf[e]=r}function nl(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map(function(r){return String(r)}),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:n===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}lt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),lt("ERR_INVALID_ARG_TYPE",function(e,t,n){var r,i,o;if(typeof t=="string"&&(i="not ",t.substr(0,i.length)===i)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(s,a,l){return(l===void 0||l>s.length)&&(l=s.length),s.substring(l-a.length,l)===a}(e," argument"))o="The ".concat(e," ").concat(r," ").concat(nl(t,"type"));else{var c=function(s,a,l){return typeof l!="number"&&(l=0),!(l+a.length>s.length)&&s.indexOf(a,l)!==-1}(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(c," ").concat(r," ").concat(nl(t,"type"))}return o+=". Received type ".concat(typeof n)},TypeError),lt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),lt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),lt("ERR_STREAM_PREMATURE_CLOSE","Premature close"),lt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),lt("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),lt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),lt("ERR_STREAM_WRITE_AFTER_END","write after end"),lt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),lt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),lt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Ln.codes=vf;var sm=Ln.codes.ERR_INVALID_OPT_VALUE,Zo,rl,Jo,il,bf={getHighWaterMark:function(e,t,n,r){var i=function(o,c,s){return o.highWaterMark!=null?o.highWaterMark:c?o[s]:null}(t,r,n);if(i!=null){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new sm(r?n:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384}},am=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},zr=jr(Object.freeze({__proto__:null,default:am})),cm=function(e,t){if(Xo("noDeprecation"))return e;var n=!1;return function(){if(!n){if(Xo("throwDeprecation"))throw new Error(t);Xo("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}};function Xo(e){try{if(!gt.localStorage)return!1}catch{return!1}var t=gt.localStorage[e];return t!=null&&String(t).toLowerCase()==="true"}function wf(){if(rl)return Zo;function e(B){var N=this;this.next=null,this.entry=null,this.finish=function(){(function(I,C,R){var D=I.entry;for(I.entry=null;D;){var y=D.callback;C.pendingcb--,y(R),D=D.next}C.corkedRequestsFree.next=I})(N,B)}}var t;rl=1,Zo=O,O.WritableState=P;var n={deprecate:cm},r=sf,i=da.Buffer,o=(gt!==void 0?gt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},c,s=yf,a=bf.getHighWaterMark,l=Ln.codes,u=l.ERR_INVALID_ARG_TYPE,d=l.ERR_METHOD_NOT_IMPLEMENTED,f=l.ERR_MULTIPLE_CALLBACK,h=l.ERR_STREAM_CANNOT_PIPE,g=l.ERR_STREAM_DESTROYED,m=l.ERR_STREAM_NULL_VALUES,w=l.ERR_STREAM_WRITE_AFTER_END,p=l.ERR_UNKNOWN_ENCODING,S=s.errorOrDestroy;function _(){}function P(B,N,I){t=t||nr(),B=B||{},typeof I!="boolean"&&(I=N instanceof t),this.objectMode=!!B.objectMode,I&&(this.objectMode=this.objectMode||!!B.writableObjectMode),this.highWaterMark=a(this,B,"writableHighWaterMark",I),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var C=B.decodeStrings===!1;this.decodeStrings=!C,this.defaultEncoding=B.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(R){(function(D,y){var E=D._writableState,k=E.sync,M=E.writecb;if(typeof M!="function")throw new f;if(function(v){v.writing=!1,v.writecb=null,v.length-=v.writelen,v.writelen=0}(E),y)(function(v,A,x,T,L){--A.pendingcb,x?(be.nextTick(L,T),be.nextTick(G,v,A),v._writableState.errorEmitted=!0,S(v,T)):(L(T),v._writableState.errorEmitted=!0,S(v,T),G(v,A))})(D,E,k,y,M);else{var b=U(E)||D.destroyed;b||E.corked||E.bufferProcessing||!E.bufferedRequest||F(D,E),k?be.nextTick(q,D,E,b,M):q(D,E,b,M)}})(N,R)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=B.emitClose!==!1,this.autoDestroy=!!B.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function O(B){var N=this instanceof(t=t||nr());if(!N&&!c.call(O,this))return new O(B);this._writableState=new P(B,this,N),this.writable=!0,B&&(typeof B.write=="function"&&(this._write=B.write),typeof B.writev=="function"&&(this._writev=B.writev),typeof B.destroy=="function"&&(this._destroy=B.destroy),typeof B.final=="function"&&(this._final=B.final)),r.call(this)}function K(B,N,I,C,R,D,y){N.writelen=C,N.writecb=y,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new g("write")):I?B._writev(R,N.onwrite):B._write(R,D,N.onwrite),N.sync=!1}function q(B,N,I,C){I||function(R,D){D.length===0&&D.needDrain&&(D.needDrain=!1,R.emit("drain"))}(B,N),N.pendingcb--,C(),G(B,N)}function F(B,N){N.bufferProcessing=!0;var I=N.bufferedRequest;if(B._writev&&I&&I.next){var C=N.bufferedRequestCount,R=new Array(C),D=N.corkedRequestsFree;D.entry=I;for(var y=0,E=!0;I;)R[y]=I,I.isBuf||(E=!1),I=I.next,y+=1;R.allBuffers=E,K(B,N,!0,N.length,R,"",D.finish),N.pendingcb++,N.lastBufferedRequest=null,D.next?(N.corkedRequestsFree=D.next,D.next=null):N.corkedRequestsFree=new e(N),N.bufferedRequestCount=0}else{for(;I;){var k=I.chunk,M=I.encoding,b=I.callback;if(K(B,N,!1,N.objectMode?1:k.length,k,M,b),I=I.next,N.bufferedRequestCount--,N.writing)break}I===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=I,N.bufferProcessing=!1}function U(B){return B.ending&&B.length===0&&B.bufferedRequest===null&&!B.finished&&!B.writing}function j(B,N){B._final(function(I){N.pendingcb--,I&&S(B,I),N.prefinished=!0,B.emit("prefinish"),G(B,N)})}function G(B,N){var I=U(N);if(I&&(function(R,D){D.prefinished||D.finalCalled||(typeof R._final!="function"||D.destroyed?(D.prefinished=!0,R.emit("prefinish")):(D.pendingcb++,D.finalCalled=!0,be.nextTick(j,R,D)))}(B,N),N.pendingcb===0&&(N.finished=!0,B.emit("finish"),N.autoDestroy))){var C=B._readableState;(!C||C.autoDestroy&&C.endEmitted)&&B.destroy()}return I}return zr(O,r),P.prototype.getBuffer=function(){for(var B=this.bufferedRequest,N=[];B;)N.push(B),B=B.next;return N},function(){try{Object.defineProperty(P.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(B){return!!c.call(this,B)||this===O&&B&&B._writableState instanceof P}})):c=function(B){return B instanceof this},O.prototype.pipe=function(){S(this,new h)},O.prototype.write=function(B,N,I){var C,R=this._writableState,D=!1,y=!R.objectMode&&(C=B,i.isBuffer(C)||C instanceof o);return y&&!i.isBuffer(B)&&(B=function(E){return i.from(E)}(B)),typeof N=="function"&&(I=N,N=null),y?N="buffer":N||(N=R.defaultEncoding),typeof I!="function"&&(I=_),R.ending?function(E,k){var M=new w;S(E,M),be.nextTick(k,M)}(this,I):(y||function(E,k,M,b){var v;return M===null?v=new m:typeof M=="string"||k.objectMode||(v=new u("chunk",["string","Buffer"],M)),!v||(S(E,v),be.nextTick(b,v),!1)}(this,R,B,I))&&(R.pendingcb++,D=function(E,k,M,b,v,A){if(!M){var x=function(H,z,J){return H.objectMode||H.decodeStrings===!1||typeof z!="string"||(z=i.from(z,J)),z}(k,b,v);b!==x&&(M=!0,v="buffer",b=x)}var T=k.objectMode?1:b.length;k.length+=T;var L=k.length<k.highWaterMark;if(L||(k.needDrain=!0),k.writing||k.corked){var $=k.lastBufferedRequest;k.lastBufferedRequest={chunk:b,encoding:v,isBuf:M,callback:A,next:null},$?$.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else K(E,k,!1,T,b,v,A);return L}(this,R,y,B,N,I)),D},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var B=this._writableState;B.corked&&(B.corked--,B.writing||B.corked||B.bufferProcessing||!B.bufferedRequest||F(this,B))},O.prototype.setDefaultEncoding=function(B){if(typeof B=="string"&&(B=B.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((B+"").toLowerCase())>-1))throw new p(B);return this._writableState.defaultEncoding=B,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(B,N,I){I(new d("_write()"))},O.prototype._writev=null,O.prototype.end=function(B,N,I){var C=this._writableState;return typeof B=="function"?(I=B,B=null,N=null):typeof N=="function"&&(I=N,N=null),B!=null&&this.write(B,N),C.corked&&(C.corked=1,this.uncork()),C.ending||function(R,D,y){D.ending=!0,G(R,D),y&&(D.finished?be.nextTick(y):R.once("finish",y)),D.ended=!0,R.writable=!1}(this,C,I),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(B){this._writableState&&(this._writableState.destroyed=B)}}),O.prototype.destroy=s.destroy,O.prototype._undestroy=s.undestroy,O.prototype._destroy=function(B,N){N(B)},Zo}function nr(){if(il)return Jo;il=1;var e=Object.keys||function(l){var u=[];for(var d in l)u.push(d);return u};Jo=c;var t=Ef(),n=wf();zr(c,t);for(var r=e(n.prototype),i=0;i<r.length;i++){var o=r[i];c.prototype[o]||(c.prototype[o]=n.prototype[o])}function c(l){if(!(this instanceof c))return new c(l);t.call(this,l),n.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",s)))}function s(){this._writableState.ended||be.nextTick(a,this)}function a(l){l.end()}return Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(l){this._readableState!==void 0&&this._writableState!==void 0&&(this._readableState.destroyed=l,this._writableState.destroyed=l)}}),Jo}var lm=X.isEncoding||function(e){switch(e&&e.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 Mi(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(t){if(t&&!lm(t))throw new Error("Unknown encoding: "+t)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=dm;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=fm;break;default:return void(this.write=um)}this.charBuffer=new X(6),this.charReceived=0,this.charLength=0}function um(e){return e.toString(this.encoding)}function dm(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function fm(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Mi.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";if(e=e.slice(n,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,e.length===0)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;if(r=(t+=e.toString(this.encoding,0,r)).length-1,(i=t.charCodeAt(r))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,r)}return t},Mi.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},Mi.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t};var ol=jr(Object.freeze({__proto__:null,StringDecoder:Mi})),sl=Ln.codes.ERR_STREAM_PREMATURE_CLOSE;function hm(){}var Qo,al,cl,ll,es,ul,va=function e(t,n,r){if(typeof n=="function")return e(t,null,n);n||(n={}),r=function(g){var m=!1;return function(){if(!m){m=!0;for(var w=arguments.length,p=new Array(w),S=0;S<w;S++)p[S]=arguments[S];g.apply(this,p)}}}(r||hm);var i=n.readable||n.readable!==!1&&t.readable,o=n.writable||n.writable!==!1&&t.writable,c=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){o=!1,s=!0,i||r.call(t)},l=t._readableState&&t._readableState.endEmitted,u=function(){i=!1,l=!0,o||r.call(t)},d=function(g){r.call(t,g)},f=function(){var g;return i&&!l?(t._readableState&&t._readableState.ended||(g=new sl),r.call(t,g)):o&&!s?(t._writableState&&t._writableState.ended||(g=new sl),r.call(t,g)):void 0},h=function(){t.req.on("finish",a)};return function(g){return g.setHeader&&typeof g.abort=="function"}(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):o&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",u),t.on("finish",a),n.error!==!1&&t.on("error",d),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",a),t.removeListener("end",u),t.removeListener("error",d),t.removeListener("close",f)}};function pm(){if(al)return Qo;var e;function t(m,w,p){return(w=function(S){var _=function(P,O){if(typeof P!="object"||P===null)return P;var K=P[Symbol.toPrimitive];if(K!==void 0){var q=K.call(P,O);if(typeof q!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(P)}(S,"string");return typeof _=="symbol"?_:String(_)}(w))in m?Object.defineProperty(m,w,{value:p,enumerable:!0,configurable:!0,writable:!0}):m[w]=p,m}al=1;var n=va,r=Symbol("lastResolve"),i=Symbol("lastReject"),o=Symbol("error"),c=Symbol("ended"),s=Symbol("lastPromise"),a=Symbol("handlePromise"),l=Symbol("stream");function u(m,w){return{value:m,done:w}}function d(m){var w=m[r];if(w!==null){var p=m[l].read();p!==null&&(m[s]=null,m[r]=null,m[i]=null,w(u(p,!1)))}}function f(m){be.nextTick(d,m)}var h=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((t(e={get stream(){return this[l]},next:function(){var m=this,w=this[o];if(w!==null)return Promise.reject(w);if(this[c])return Promise.resolve(u(void 0,!0));if(this[l].destroyed)return new Promise(function(P,O){be.nextTick(function(){m[o]?O(m[o]):P(u(void 0,!0))})});var p,S=this[s];if(S)p=new Promise(function(P,O){return function(K,q){P.then(function(){O[c]?K(u(void 0,!0)):O[a](K,q)},q)}}(S,this));else{var _=this[l].read();if(_!==null)return Promise.resolve(u(_,!1));p=new Promise(this[a])}return this[s]=p,p}},Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var m=this;return new Promise(function(w,p){m[l].destroy(null,function(S){S?p(S):w(u(void 0,!0))})})}),e),h);return Qo=function(m){var w,p=Object.create(g,(t(w={},l,{value:m,writable:!0}),t(w,r,{value:null,writable:!0}),t(w,i,{value:null,writable:!0}),t(w,o,{value:null,writable:!0}),t(w,c,{value:m._readableState.endEmitted,writable:!0}),t(w,a,{value:function(S,_){var P=p[l].read();P?(p[s]=null,p[r]=null,p[i]=null,S(u(P,!1))):(p[r]=S,p[i]=_)},writable:!0}),w));return p[s]=null,n(m,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var _=p[i];return _!==null&&(p[s]=null,p[r]=null,p[i]=null,_(S)),void(p[o]=S)}var P=p[r];P!==null&&(p[s]=null,p[r]=null,p[i]=null,P(u(void 0,!0))),p[c]=!0}),m.on("readable",f.bind(null,p)),p},Qo}function Ef(){if(ul)return es;var e;ul=1,es=O,O.ReadableState=P,la.EventEmitter;var t=function(b,v){return b.listeners(v).length},n=sf,r=da.Buffer,i=(gt!==void 0?gt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){},o,c=gf;o=c&&c.debuglog?c.debuglog("stream"):function(){};var s,a,l,u=om(),d=yf,f=bf.getHighWaterMark,h=Ln.codes,g=h.ERR_INVALID_ARG_TYPE,m=h.ERR_STREAM_PUSH_AFTER_EOF,w=h.ERR_METHOD_NOT_IMPLEMENTED,p=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;zr(O,n);var S=d.errorOrDestroy,_=["error","close","destroy","pause","resume"];function P(b,v,A){e=e||nr(),b=b||{},typeof A!="boolean"&&(A=v instanceof e),this.objectMode=!!b.objectMode,A&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=f(this,b,"readableHighWaterMark",A),this.buffer=new u,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(s||(s=ol.StringDecoder),this.decoder=new s(b.encoding),this.encoding=b.encoding)}function O(b){if(e=e||nr(),!(this instanceof O))return new O(b);var v=this instanceof e;this._readableState=new P(b,this,v),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),n.call(this)}function K(b,v,A,x,T){o("readableAddChunk",v);var L,$=b._readableState;if(v===null)$.reading=!1,function(H,z){if(o("onEofChunk"),!z.ended){if(z.decoder){var J=z.decoder.end();J&&J.length&&(z.buffer.push(J),z.length+=z.objectMode?1:J.length)}z.ended=!0,z.sync?j(H):(z.needReadable=!1,z.emittedReadable||(z.emittedReadable=!0,G(H)))}}(b,$);else if(T||(L=function(H,z){var J;Q=z,r.isBuffer(Q)||Q instanceof i||typeof z=="string"||z===void 0||H.objectMode||(J=new g("chunk",["string","Buffer","Uint8Array"],z));var Q;return J}($,v)),L)S(b,L);else if($.objectMode||v&&v.length>0)if(typeof v=="string"||$.objectMode||Object.getPrototypeOf(v)===r.prototype||(v=function(H){return r.from(H)}(v)),x)$.endEmitted?S(b,new p):q(b,$,v,!0);else if($.ended)S(b,new m);else{if($.destroyed)return!1;$.reading=!1,$.decoder&&!A?(v=$.decoder.write(v),$.objectMode||v.length!==0?q(b,$,v,!1):B(b,$)):q(b,$,v,!1)}else x||($.reading=!1,B(b,$));return!$.ended&&($.length<$.highWaterMark||$.length===0)}function q(b,v,A,x){v.flowing&&v.length===0&&!v.sync?(v.awaitDrain=0,b.emit("data",A)):(v.length+=v.objectMode?1:A.length,x?v.buffer.unshift(A):v.buffer.push(A),v.needReadable&&j(b)),B(b,v)}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(b){this._readableState&&(this._readableState.destroyed=b)}}),O.prototype.destroy=d.destroy,O.prototype._undestroy=d.undestroy,O.prototype._destroy=function(b,v){v(b)},O.prototype.push=function(b,v){var A,x=this._readableState;return x.objectMode?A=!0:typeof b=="string"&&((v=v||x.defaultEncoding)!==x.encoding&&(b=r.from(b,v),v=""),A=!0),K(this,b,v,!1,A)},O.prototype.unshift=function(b){return K(this,b,null,!0,!1)},O.prototype.isPaused=function(){return this._readableState.flowing===!1},O.prototype.setEncoding=function(b){s||(s=ol.StringDecoder);var v=new s(b);this._readableState.decoder=v,this._readableState.encoding=this._readableState.decoder.encoding;for(var A=this._readableState.buffer.head,x="";A!==null;)x+=v.write(A.data),A=A.next;return this._readableState.buffer.clear(),x!==""&&this._readableState.buffer.push(x),this._readableState.length=x.length,this};var F=1073741824;function U(b,v){return b<=0||v.length===0&&v.ended?0:v.objectMode?1:b!=b?v.flowing&&v.length?v.buffer.head.data.length:v.length:(b>v.highWaterMark&&(v.highWaterMark=function(A){return A>=F?A=F:(A--,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A++),A}(b)),b<=v.length?b:v.ended?v.length:(v.needReadable=!0,0))}function j(b){var v=b._readableState;o("emitReadable",v.needReadable,v.emittedReadable),v.needReadable=!1,v.emittedReadable||(o("emitReadable",v.flowing),v.emittedReadable=!0,be.nextTick(G,b))}function G(b){var v=b._readableState;o("emitReadable_",v.destroyed,v.length,v.ended),v.destroyed||!v.length&&!v.ended||(b.emit("readable"),v.emittedReadable=!1),v.needReadable=!v.flowing&&!v.ended&&v.length<=v.highWaterMark,D(b)}function B(b,v){v.readingMore||(v.readingMore=!0,be.nextTick(N,b,v))}function N(b,v){for(;!v.reading&&!v.ended&&(v.length<v.highWaterMark||v.flowing&&v.length===0);){var A=v.length;if(o("maybeReadMore read 0"),b.read(0),A===v.length)break}v.readingMore=!1}function I(b){var v=b._readableState;v.readableListening=b.listenerCount("readable")>0,v.resumeScheduled&&!v.paused?v.flowing=!0:b.listenerCount("data")>0&&b.resume()}function C(b){o("readable nexttick read 0"),b.read(0)}function R(b,v){o("resume",v.reading),v.reading||b.read(0),v.resumeScheduled=!1,b.emit("resume"),D(b),v.flowing&&!v.reading&&b.read(0)}function D(b){var v=b._readableState;for(o("flow",v.flowing);v.flowing&&b.read()!==null;);}function y(b,v){return v.length===0?null:(v.objectMode?A=v.buffer.shift():!b||b>=v.length?(A=v.decoder?v.buffer.join(""):v.buffer.length===1?v.buffer.first():v.buffer.concat(v.length),v.buffer.clear()):A=v.buffer.consume(b,v.decoder),A);var A}function E(b){var v=b._readableState;o("endReadable",v.endEmitted),v.endEmitted||(v.ended=!0,be.nextTick(k,v,b))}function k(b,v){if(o("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,v.readable=!1,v.emit("end"),b.autoDestroy)){var A=v._writableState;(!A||A.autoDestroy&&A.finished)&&v.destroy()}}function M(b,v){for(var A=0,x=b.length;A<x;A++)if(b[A]===v)return A;return-1}return O.prototype.read=function(b){o("read",b),b=parseInt(b,10);var v=this._readableState,A=b;if(b!==0&&(v.emittedReadable=!1),b===0&&v.needReadable&&((v.highWaterMark!==0?v.length>=v.highWaterMark:v.length>0)||v.ended))return o("read: emitReadable",v.length,v.ended),v.length===0&&v.ended?E(this):j(this),null;if((b=U(b,v))===0&&v.ended)return v.length===0&&E(this),null;var x,T=v.needReadable;return o("need readable",T),(v.length===0||v.length-b<v.highWaterMark)&&o("length less than watermark",T=!0),v.ended||v.reading?o("reading or ended",T=!1):T&&(o("do read"),v.reading=!0,v.sync=!0,v.length===0&&(v.needReadable=!0),this._read(v.highWaterMark),v.sync=!1,v.reading||(b=U(A,v))),(x=b>0?y(b,v):null)===null?(v.needReadable=v.length<=v.highWaterMark,b=0):(v.length-=b,v.awaitDrain=0),v.length===0&&(v.ended||(v.needReadable=!0),A!==b&&v.ended&&E(this)),x!==null&&this.emit("data",x),x},O.prototype._read=function(b){S(this,new w("_read()"))},O.prototype.pipe=function(b,v){var A=this,x=this._readableState;switch(x.pipesCount){case 0:x.pipes=b;break;case 1:x.pipes=[x.pipes,b];break;default:x.pipes.push(b)}x.pipesCount+=1,o("pipe count=%d opts=%j",x.pipesCount,v);var T=(!v||v.end!==!1)&&b!==be.stdout&&b!==be.stderr?$:le;function L(re,ie){o("onunpipe"),re===A&&ie&&ie.hasUnpiped===!1&&(ie.hasUnpiped=!0,o("cleanup"),b.removeListener("close",ne),b.removeListener("finish",se),b.removeListener("drain",H),b.removeListener("error",Q),b.removeListener("unpipe",L),A.removeListener("end",$),A.removeListener("end",le),A.removeListener("data",J),z=!0,!x.awaitDrain||b._writableState&&!b._writableState.needDrain||H())}function $(){o("onend"),b.end()}x.endEmitted?be.nextTick(T):A.once("end",T),b.on("unpipe",L);var H=function(re){return function(){var ie=re._readableState;o("pipeOnDrain",ie.awaitDrain),ie.awaitDrain&&ie.awaitDrain--,ie.awaitDrain===0&&t(re,"data")&&(ie.flowing=!0,D(re))}}(A);b.on("drain",H);var z=!1;function J(re){o("ondata");var ie=b.write(re);o("dest.write",ie),ie===!1&&((x.pipesCount===1&&x.pipes===b||x.pipesCount>1&&M(x.pipes,b)!==-1)&&!z&&(o("false write response, pause",x.awaitDrain),x.awaitDrain++),A.pause())}function Q(re){o("onerror",re),le(),b.removeListener("error",Q),t(b,"error")===0&&S(b,re)}function ne(){b.removeListener("finish",se),le()}function se(){o("onfinish"),b.removeListener("close",ne),le()}function le(){o("unpipe"),A.unpipe(b)}return A.on("data",J),function(re,ie,ce){if(typeof re.prependListener=="function")return re.prependListener(ie,ce);re._events&&re._events[ie]?Array.isArray(re._events[ie])?re._events[ie].unshift(ce):re._events[ie]=[ce,re._events[ie]]:re.on(ie,ce)}(b,"error",Q),b.once("close",ne),b.once("finish",se),b.emit("pipe",A),x.flowing||(o("pipe resume"),A.resume()),b},O.prototype.unpipe=function(b){var v=this._readableState,A={hasUnpiped:!1};if(v.pipesCount===0)return this;if(v.pipesCount===1)return b&&b!==v.pipes||(b||(b=v.pipes),v.pipes=null,v.pipesCount=0,v.flowing=!1,b&&b.emit("unpipe",this,A)),this;if(!b){var x=v.pipes,T=v.pipesCount;v.pipes=null,v.pipesCount=0,v.flowing=!1;for(var L=0;L<T;L++)x[L].emit("unpipe",this,{hasUnpiped:!1});return this}var $=M(v.pipes,b);return $===-1||(v.pipes.splice($,1),v.pipesCount-=1,v.pipesCount===1&&(v.pipes=v.pipes[0]),b.emit("unpipe",this,A)),this},O.prototype.on=function(b,v){var A=n.prototype.on.call(this,b,v),x=this._readableState;return b==="data"?(x.readableListening=this.listenerCount("readable")>0,x.flowing!==!1&&this.resume()):b==="readable"&&(x.endEmitted||x.readableListening||(x.readableListening=x.needReadable=!0,x.flowing=!1,x.emittedReadable=!1,o("on readable",x.length,x.reading),x.length?j(this):x.reading||be.nextTick(C,this))),A},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(b,v){var A=n.prototype.removeListener.call(this,b,v);return b==="readable"&&be.nextTick(I,this),A},O.prototype.removeAllListeners=function(b){var v=n.prototype.removeAllListeners.apply(this,arguments);return b!=="readable"&&b!==void 0||be.nextTick(I,this),v},O.prototype.resume=function(){var b=this._readableState;return b.flowing||(o("resume"),b.flowing=!b.readableListening,function(v,A){A.resumeScheduled||(A.resumeScheduled=!0,be.nextTick(R,v,A))}(this,b)),b.paused=!1,this},O.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(b){var v=this,A=this._readableState,x=!1;for(var T in b.on("end",function(){if(o("wrapped end"),A.decoder&&!A.ended){var $=A.decoder.end();$&&$.length&&v.push($)}v.push(null)}),b.on("data",function($){o("wrapped data"),A.decoder&&($=A.decoder.write($)),A.objectMode&&$==null||(A.objectMode||$&&$.length)&&(v.push($)||(x=!0,b.pause()))}),b)this[T]===void 0&&typeof b[T]=="function"&&(this[T]=function($){return function(){return b[$].apply(b,arguments)}}(T));for(var L=0;L<_.length;L++)b.on(_[L],this.emit.bind(this,_[L]));return this._read=function($){o("wrapped _read",$),x&&(x=!1,b.resume())},this},typeof Symbol=="function"&&(O.prototype[Symbol.asyncIterator]=function(){return a===void 0&&(a=pm()),a(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(b){this._readableState&&(this._readableState.flowing=b)}}),O._fromList=y,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(O.from=function(b,v){return l===void 0&&(l=ll?cl:(ll=1,cl=function(){throw new Error("Readable.from is not available in the browser")})),l(O,b,v)}),es}var _f=Ht,ho=Ln.codes,mm=ho.ERR_METHOD_NOT_IMPLEMENTED,gm=ho.ERR_MULTIPLE_CALLBACK,ym=ho.ERR_TRANSFORM_ALREADY_TRANSFORMING,vm=ho.ERR_TRANSFORM_WITH_LENGTH_0,Ti=nr();function bm(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(r===null)return this.emit("error",new gm);n.writechunk=null,n.writecb=null,t!=null&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ht(e){if(!(this instanceof Ht))return new Ht(e);Ti.call(this,e),this._transformState={afterTransform:bm.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",wm)}function wm(){var e=this;typeof this._flush!="function"||this._readableState.destroyed?dl(this,null,null):this._flush(function(t,n){dl(e,t,n)})}function dl(e,t,n){if(t)return e.emit("error",t);if(n!=null&&e.push(n),e._writableState.length)throw new vm;if(e._transformState.transforming)throw new ym;return e.push(null)}zr(Ht,Ti),Ht.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ti.prototype.push.call(this,e,t)},Ht.prototype._transform=function(e,t,n){n(new mm("_transform()"))},Ht.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Ht.prototype._read=function(e){var t=this._transformState;t.writechunk===null||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},Ht.prototype._destroy=function(e,t){Ti.prototype._destroy.call(this,e,function(n){t(n)})};var ts,Em=Or,Sf=_f;function Or(e){if(!(this instanceof Or))return new Or(e);Sf.call(this,e)}zr(Or,Sf),Or.prototype._transform=function(e,t,n){n(null,e)};var Cf=Ln.codes,_m=Cf.ERR_MISSING_ARGS,Sm=Cf.ERR_STREAM_DESTROYED;function fl(e){if(e)throw e}function hl(e){e()}function Cm(e,t){return e.pipe(t)}var Am=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=function(c){return c.length?typeof c[c.length-1]!="function"?fl:c.pop():fl}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new _m("streams");var o=t.map(function(c,s){var a=s<t.length-1;return function(l,u,d,f){f=function(m){var w=!1;return function(){w||(w=!0,m.apply(void 0,arguments))}}(f);var h=!1;l.on("close",function(){h=!0}),ts===void 0&&(ts=va),ts(l,{readable:u,writable:d},function(m){if(m)return f(m);h=!0,f()});var g=!1;return function(m){if(!h&&!g)return g=!0,function(w){return w.setHeader&&typeof w.abort=="function"}(l)?l.abort():typeof l.destroy=="function"?l.destroy():void f(m||new Sm("pipe"))}}(c,a,s>0,function(l){r||(r=l),l&&o.forEach(hl),a||(o.forEach(hl),i(r))})});return t.reduce(Cm)};(function(e,t){(t=Ls.exports=Ef()).Stream=t,t.Readable=t,t.Writable=wf(),t.Duplex=nr(),t.Transform=_f,t.PassThrough=Em,t.finished=va,t.pipeline=Am})(0,Ls.exports);var rr=Ls.exports;function km(e={}){const t={},n=new rr.Duplex({objectMode:!0,read:()=>{},write:function(o,c,s){let a=null;try{o.id?function(l){const{id:u}=l;if(u===null)return;const d=t[u];if(!d)return void console.warn(`StreamMiddleware - Unknown response id "${u}"`);delete t[u],Object.assign(d.res,l),setTimeout(d.end)}(o):function(l){e!=null&&e.retryOnMessage&&l.method===e.retryOnMessage&&Object.values(t).forEach(({req:u,retryCount:d=0})=>{if(!u.id)return;if(d>=3)throw new Error(`StreamMiddleware - Retry limit exceeded for request id "${u.id}"`);const f=t[u.id];f&&(f.retryCount=d+1),i(u)}),r.emit("notification",l)}(o)}catch(l){a=l}s(a)}}),r=new Xd;return{events:r,middleware:(o,c,s,a)=>{t[o.id]={req:o,res:c,next:s,end:a},i(o)},stream:n};function i(o){n.push(o)}}var Ji={},Ds={exports:{}},xm=function e(t,n){if(t&&n)return e(t)(n);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];var c=t.apply(this,i),s=i[i.length-1];return typeof c=="function"&&c!==s&&Object.keys(s).forEach(function(a){c[a]=s[a]}),c}},pl=xm;function di(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function ml(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}Ds.exports=pl(di),Ds.exports.strict=pl(ml),di.proto=di(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return di(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return ml(this)},configurable:!0})});var Mm=Ds.exports,Xi={};Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.Substream=void 0;const Tm=rr;class Im extends Tm.Duplex{constructor({parent:t,name:n}){super({objectMode:!0}),this._parent=t,this._name=n}_read(){}_write(t,n,r){this._parent.push({name:this._name,data:t}),r()}}Xi.Substream=Im;var Pm=gt&>.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.ObjectMultiplex=void 0;const ns=rr,Rm=Pm(Mm),Om=Xi,gl=Symbol("IGNORE_SUBSTREAM");let Lm=class extends ns.Duplex{constructor(e={}){super(Object.assign(Object.assign({},e),{objectMode:!0})),this._substreams={}}createStream(e){if(this.destroyed)throw new Error(`ObjectMultiplex - parent stream for name "${e}" already destroyed`);if(this._readableState.ended||this._writableState.ended)throw new Error(`ObjectMultiplex - parent stream for name "${e}" already ended`);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 Om.Substream({parent:this,name:e});return this._substreams[e]=t,function(n,r){const i=(0,Rm.default)(r);(0,ns.finished)(n,{readable:!1},i),(0,ns.finished)(n,{writable:!1},i)}(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]=gl}_read(){}_write(e,t,n){const{name:r,data:i}=e;if(!r)return console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),n();const o=this._substreams[r];return o?(o!==gl&&o.push(i),n()):(console.warn(`ObjectMultiplex - orphaned data for stream "${r}"`),n())}};Ji.ObjectMultiplex=Lm;var Nm=ao(Ji.ObjectMultiplex);const Ct=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";Ct.writable=e=>Ct(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object",Ct.readable=e=>Ct(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object",Ct.duplex=e=>Ct.writable(e)&&Ct.readable(e),Ct.transform=e=>Ct.duplex(e)&&typeof e._transform=="function";var At,Dm=Ct,$m=class extends Xp{constructor(e,{jsonRpcStreamName:t,logger:n=console,maxEventListeners:r=100,rpcMiddleware:i=[]}){if(super({logger:n,maxEventListeners:r,rpcMiddleware:i}),!Dm.duplex(e))throw new Error(xe.errors.invalidDuplexStream());this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this);const o=new Nm;rr.pipeline(e,o,e,this._handleStreamDisconnect.bind(this,"MetaMask")),this._jsonRpcConnection=km({retryOnMessage:"METAMASK_EXTENSION_CONNECT_CAN_RETRY"}),rr.pipeline(this._jsonRpcConnection.stream,o.createStream(t),this._jsonRpcConnection.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider")),this._rpcEngine.push(this._jsonRpcConnection.middleware),this._jsonRpcConnection.events.on("notification",c=>{const{method:s,params:a}=c;s==="metamask_accountsChanged"?this._handleAccountsChanged(a):s==="metamask_unlockStateChanged"?this._handleUnlockStateChanged(a):s==="metamask_chainChanged"?this._handleChainChanged(a):Qd.includes(s)?this.emit("message",{type:s,data:a}):s==="METAMASK_STREAM_FAILURE"&&e.destroy(new Error(xe.errors.permanentlyDisconnected()))})}async _initializeStateAsync(){let e;try{e=await this.request({method:"metamask_getProviderState"})}catch(t){this._log.error("MetaMask: Failed to get initial state. Please report this bug.",t)}this._initializeState(e)}_handleStreamDisconnect(e,t){let n=`MetaMask: Lost connection to "${e}".`;t!=null&&t.stack&&(n+=`
|
|
34
|
+
${t.stack}`),this._log.warn(n),this.listenerCount("error")>0&&this.emit("error",n),this._handleDisconnect(!1,t?t.message:void 0)}_handleChainChanged({chainId:e,networkVersion:t}={}){ef(e)&&(n=>!!n&&typeof n=="string")(t)?t==="loading"?this._handleDisconnect(!0):super._handleChainChanged({chainId:e}):this._log.error(xe.errors.invalidNetworkParams(),{chainId:e,networkVersion:t})}},Bm=class extends $m{constructor(e,{jsonRpcStreamName:t="metamask-provider",logger:n=console,maxEventListeners:r=100,shouldSendMetadata:i}={}){if(super(e,{jsonRpcStreamName:t,logger:n,maxEventListeners:r,rpcMiddleware:zp(n)}),this._sentWarnings={chainId:!1,networkVersion:!1,selectedAddress:!1,enable:!1,experimentalMethods:!1,send:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}},Os(this,At,void 0),this._initializeStateAsync(),Ut(this,At,null),this.isMetaMask=!0,this._sendSync=this._sendSync.bind(this),this.enable=this.enable.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._metamask=this._getExperimentalApi(),this._jsonRpcConnection.events.on("notification",o=>{const{method:c}=o;Qd.includes(c)&&(this.emit("data",o),this.emit("notification",o.params.result))}),i)if(document.readyState==="complete")Xc(this._rpcEngine,this._log);else{const o=()=>{Xc(this._rpcEngine,this._log),window.removeEventListener("DOMContentLoaded",o)};window.addEventListener("DOMContentLoaded",o)}}get chainId(){return this._sentWarnings.chainId||(this._log.warn(xe.warnings.chainIdDeprecation),this._sentWarnings.chainId=!0),super.chainId}get networkVersion(){return this._sentWarnings.networkVersion||(this._log.warn(xe.warnings.networkVersionDeprecation),this._sentWarnings.networkVersion=!0),Tt(this,At)}get selectedAddress(){return this._sentWarnings.selectedAddress||(this._log.warn(xe.warnings.selectedAddressDeprecation),this._sentWarnings.selectedAddress=!0),super.selectedAddress}sendAsync(e,t){this._rpcRequest(e,t)}addListener(e,t){return this._warnOfDeprecation(e),super.addListener(e,t)}on(e,t){return this._warnOfDeprecation(e),super.on(e,t)}once(e,t){return this._warnOfDeprecation(e),super.once(e,t)}prependListener(e,t){return this._warnOfDeprecation(e),super.prependListener(e,t)}prependOnceListener(e,t){return this._warnOfDeprecation(e),super.prependOnceListener(e,t)}_handleDisconnect(e,t){super._handleDisconnect(e,t),Tt(this,At)&&!e&&Ut(this,At,null)}_warnOfDeprecation(e){var t;((t=this._sentWarnings)==null?void 0:t.events[e])===!1&&(this._log.warn(xe.warnings.events[e]),this._sentWarnings.events[e]=!0)}async enable(){return this._sentWarnings.enable||(this._log.warn(xe.warnings.enableDeprecation),this._sentWarnings.enable=!0),new Promise((e,t)=>{try{this._rpcRequest({method:"eth_requestAccounts",params:[]},ki(e,t))}catch(n){t(n)}})}send(e,t){return this._sentWarnings.send||(this._log.warn(xe.warnings.sendDeprecation),this._sentWarnings.send=!0),typeof e!="string"||t&&!Array.isArray(t)?e&&typeof e=="object"&&typeof t=="function"?this._rpcRequest(e,t):this._sendSync(e):new Promise((n,r)=>{try{this._rpcRequest({method:e,params:t},ki(n,r,!1))}catch(i){r(i)}})}_sendSync(e){let t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress??null;break;case"eth_uninstallFilter":this._rpcRequest(e,tf),t=!0;break;case"net_version":t=Tt(this,At)??null;break;default:throw new Error(xe.errors.unsupportedSync(e.method))}return{id:e.id,jsonrpc:e.jsonrpc,result:t}}_getExperimentalApi(){return new Proxy({isUnlocked:async()=>(this._state.initialized||await new Promise(e=>{this.on("_initialized",()=>e())}),this._state.isUnlocked),requestBatch:async e=>{if(!Array.isArray(e))throw vr({message:"Batch requests must be made with an array of request objects.",data:e});return new Promise((t,n)=>{this._rpcRequest(e,ki(t,n))})}},{get:(e,t,...n)=>(this._sentWarnings.experimentalMethods||(this._log.warn(xe.warnings.experimentalMethods),this._sentWarnings.experimentalMethods=!0),Reflect.get(e,t,...n))})}_handleChainChanged({chainId:e,networkVersion:t}={}){super._handleChainChanged({chainId:e,networkVersion:t}),this._state.isConnected&&t!==Tt(this,At)&&(Ut(this,At,t),this._state.initialized&&this.emit("networkChanged",Tt(this,At)))}};At=new WeakMap;const V=Ge("MM_SDK");let yl;V.color="#FFAC1C";var Af={},gn={};Object.defineProperty(gn,"__esModule",{value:!0}),gn.EthereumProviderError=gn.EthereumRpcError=void 0;const Km=Wd;class kf extends Error{constructor(t,n,r){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string.');super(n),this.code=t,r!==void 0&&(this.data=r)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Km.default(this.serialize(),jm,2)}}gn.EthereumRpcError=kf;function jm(e,t){if(t!=="[Circular]")return t}gn.EthereumProviderError=class extends kf{constructor(e,t,n){if(!function(r){return Number.isInteger(r)&&r>=1e3&&r<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}};var ba={},un={};Object.defineProperty(un,"__esModule",{value:!0}),un.errorValues=un.errorCodes=void 0,un.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}},un.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=un,n=gn,r=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",o={code:r,message:c(r)};function c(d,f=i){if(Number.isInteger(d)){const h=d.toString();if(u(t.errorValues,h))return t.errorValues[h].message;if(a(d))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return f}function s(d){if(!Number.isInteger(d))return!1;const f=d.toString();return!!t.errorValues[f]||!!a(d)}function a(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function u(d,f){return Object.prototype.hasOwnProperty.call(d,f)}e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",e.getMessageFromCode=c,e.isValidCode=s,e.serializeError=function(d,{fallbackError:f=o,shouldIncludeStack:h=!1}={}){var g,m;if(!f||!Number.isInteger(f.code)||typeof f.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(d instanceof n.EthereumRpcError)return d.serialize();const w={};if(d&&typeof d=="object"&&!Array.isArray(d)&&u(d,"code")&&s(d.code)){const S=d;w.code=S.code,S.message&&typeof S.message=="string"?(w.message=S.message,u(S,"data")&&(w.data=S.data)):(w.message=c(w.code),w.data={originalError:l(d)})}else{w.code=f.code;const S=(g=d)===null||g===void 0?void 0:g.message;w.message=S&&typeof S=="string"?S:f.message,w.data={originalError:l(d)}}const p=(m=d)===null||m===void 0?void 0:m.stack;return h&&d&&p&&typeof p=="string"&&(w.stack=p),w}}(ba);var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.ethErrors=void 0;const wa=gn,xf=ba,Ke=un;function ut(e,t){const[n,r]=Mf(t);return new wa.EthereumRpcError(e,n||xf.getMessageFromCode(e),r)}function dr(e,t){const[n,r]=Mf(t);return new wa.EthereumProviderError(e,n||xf.getMessageFromCode(e),r)}function Mf(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:n}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,n]}}return[]}Qi.ethErrors={rpc:{parse:e=>ut(Ke.errorCodes.rpc.parse,e),invalidRequest:e=>ut(Ke.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ut(Ke.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ut(Ke.errorCodes.rpc.methodNotFound,e),internal:e=>ut(Ke.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ut(t,e)},invalidInput:e=>ut(Ke.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ut(Ke.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ut(Ke.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ut(Ke.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ut(Ke.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ut(Ke.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>dr(Ke.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>dr(Ke.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>dr(Ke.errorCodes.provider.unsupportedMethod,e),disconnected:e=>dr(Ke.errorCodes.provider.disconnected,e),chainDisconnected:e=>dr(Ke.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:n,data:r}=e;if(!n||typeof n!="string")throw new Error('"message" must be a nonempty string');return new wa.EthereumProviderError(t,n,r)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=gn;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const n=ba;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return n.getMessageFromCode}});const r=Qi;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return r.ethErrors}});const i=un;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})}(Af);var Tf={exports:{}};Tf.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(r,i,o){n.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:o})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,i){if(1&i&&(r=n(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var c in r)n.d(o,c,(function(s){return r[s]}).bind(null,c));return o},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=90)}({17:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function o(){}return o.getFirstMatch=function(c,s){var a=s.match(c);return a&&a.length>0&&a[1]||""},o.getSecondMatch=function(c,s){var a=s.match(c);return a&&a.length>1&&a[2]||""},o.matchAndReturnConst=function(c,s,a){if(c.test(s))return a},o.getWindowsVersionName=function(c){switch(c){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},o.getMacOSVersionName=function(c){var s=c.split(".").splice(0,2).map(function(a){return parseInt(a,10)||0});if(s.push(0),s[0]===10)switch(s[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},o.getAndroidVersionName=function(c){var s=c.split(".").splice(0,2).map(function(a){return parseInt(a,10)||0});if(s.push(0),!(s[0]===1&&s[1]<5))return s[0]===1&&s[1]<6?"Cupcake":s[0]===1&&s[1]>=6?"Donut":s[0]===2&&s[1]<2?"Eclair":s[0]===2&&s[1]===2?"Froyo":s[0]===2&&s[1]>2?"Gingerbread":s[0]===3?"Honeycomb":s[0]===4&&s[1]<1?"Ice Cream Sandwich":s[0]===4&&s[1]<4?"Jelly Bean":s[0]===4&&s[1]>=4?"KitKat":s[0]===5?"Lollipop":s[0]===6?"Marshmallow":s[0]===7?"Nougat":s[0]===8?"Oreo":s[0]===9?"Pie":void 0},o.getVersionPrecision=function(c){return c.split(".").length},o.compareVersions=function(c,s,a){a===void 0&&(a=!1);var l=o.getVersionPrecision(c),u=o.getVersionPrecision(s),d=Math.max(l,u),f=0,h=o.map([c,s],function(g){var m=d-o.getVersionPrecision(g),w=g+new Array(m+1).join(".0");return o.map(w.split("."),function(p){return new Array(20-p.length).join("0")+p}).reverse()});for(a&&(f=d-Math.min(l,u)),d-=1;d>=f;){if(h[0][d]>h[1][d])return 1;if(h[0][d]===h[1][d]){if(d===f)return 0;d-=1}else if(h[0][d]<h[1][d])return-1}},o.map=function(c,s){var a,l=[];if(Array.prototype.map)return Array.prototype.map.call(c,s);for(a=0;a<c.length;a+=1)l.push(s(c[a]));return l},o.find=function(c,s){var a,l;if(Array.prototype.find)return Array.prototype.find.call(c,s);for(a=0,l=c.length;a<l;a+=1){var u=c[a];if(s(u,a))return u}},o.assign=function(c){for(var s,a,l=c,u=arguments.length,d=new Array(u>1?u-1:0),f=1;f<u;f++)d[f-1]=arguments[f];if(Object.assign)return Object.assign.apply(Object,[c].concat(d));var h=function(){var g=d[s];typeof g=="object"&&g!==null&&Object.keys(g).forEach(function(m){l[m]=g[m]})};for(s=0,a=d.length;s<a;s+=1)h();return c},o.getBrowserAlias=function(c){return r.BROWSER_ALIASES_MAP[c]},o.getBrowserTypeByAlias=function(c){return r.BROWSER_MAP[c]||""},o}();t.default=i,e.exports=t.default},18:function(e,t,n){t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function c(a,l){for(var u=0;u<l.length;u++){var d=l[u];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}var s=function(){function a(){}var l,u,d;return a.getParser=function(f,h){if(h===void 0&&(h=!1),typeof f!="string")throw new Error("UserAgent should be a string");return new i.default(f,h)},a.parse=function(f){return new i.default(f).getResult()},l=a,d=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}],(u=null)&&c(l.prototype,u),d&&c(l,d),a}();t.default=s,e.exports=t.default},91:function(e,t,n){t.__esModule=!0,t.default=void 0;var r=a(n(92)),i=a(n(93)),o=a(n(94)),c=a(n(95)),s=a(n(17));function a(u){return u&&u.__esModule?u:{default:u}}var l=function(){function u(f,h){if(h===void 0&&(h=!1),f==null||f==="")throw new Error("UserAgent parameter can't be empty");this._ua=f,this.parsedResult={},h!==!0&&this.parse()}var d=u.prototype;return d.getUA=function(){return this._ua},d.test=function(f){return f.test(this._ua)},d.parseBrowser=function(){var f=this;this.parsedResult.browser={};var h=s.default.find(r.default,function(g){if(typeof g.test=="function")return g.test(f);if(g.test instanceof Array)return g.test.some(function(m){return f.test(m)});throw new Error("Browser's test function is not valid")});return h&&(this.parsedResult.browser=h.describe(this.getUA())),this.parsedResult.browser},d.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},d.getBrowserName=function(f){return f?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},d.getBrowserVersion=function(){return this.getBrowser().version},d.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},d.parseOS=function(){var f=this;this.parsedResult.os={};var h=s.default.find(i.default,function(g){if(typeof g.test=="function")return g.test(f);if(g.test instanceof Array)return g.test.some(function(m){return f.test(m)});throw new Error("Browser's test function is not valid")});return h&&(this.parsedResult.os=h.describe(this.getUA())),this.parsedResult.os},d.getOSName=function(f){var h=this.getOS().name;return f?String(h).toLowerCase()||"":h||""},d.getOSVersion=function(){return this.getOS().version},d.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},d.getPlatformType=function(f){f===void 0&&(f=!1);var h=this.getPlatform().type;return f?String(h).toLowerCase()||"":h||""},d.parsePlatform=function(){var f=this;this.parsedResult.platform={};var h=s.default.find(o.default,function(g){if(typeof g.test=="function")return g.test(f);if(g.test instanceof Array)return g.test.some(function(m){return f.test(m)});throw new Error("Browser's test function is not valid")});return h&&(this.parsedResult.platform=h.describe(this.getUA())),this.parsedResult.platform},d.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},d.getEngineName=function(f){return f?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},d.parseEngine=function(){var f=this;this.parsedResult.engine={};var h=s.default.find(c.default,function(g){if(typeof g.test=="function")return g.test(f);if(g.test instanceof Array)return g.test.some(function(m){return f.test(m)});throw new Error("Browser's test function is not valid")});return h&&(this.parsedResult.engine=h.describe(this.getUA())),this.parsedResult.engine},d.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},d.getResult=function(){return s.default.assign({},this.parsedResult)},d.satisfies=function(f){var h=this,g={},m=0,w={},p=0;if(Object.keys(f).forEach(function(U){var j=f[U];typeof j=="string"?(w[U]=j,p+=1):typeof j=="object"&&(g[U]=j,m+=1)}),m>0){var S=Object.keys(g),_=s.default.find(S,function(U){return h.isOS(U)});if(_){var P=this.satisfies(g[_]);if(P!==void 0)return P}var O=s.default.find(S,function(U){return h.isPlatform(U)});if(O){var K=this.satisfies(g[O]);if(K!==void 0)return K}}if(p>0){var q=Object.keys(w),F=s.default.find(q,function(U){return h.isBrowser(U,!0)});if(F!==void 0)return this.compareVersion(w[F])}},d.isBrowser=function(f,h){h===void 0&&(h=!1);var g=this.getBrowserName().toLowerCase(),m=f.toLowerCase(),w=s.default.getBrowserTypeByAlias(m);return h&&w&&(m=w.toLowerCase()),m===g},d.compareVersion=function(f){var h=[0],g=f,m=!1,w=this.getBrowserVersion();if(typeof w=="string")return f[0]===">"||f[0]==="<"?(g=f.substr(1),f[1]==="="?(m=!0,g=f.substr(2)):h=[],f[0]===">"?h.push(1):h.push(-1)):f[0]==="="?g=f.substr(1):f[0]==="~"&&(m=!0,g=f.substr(1)),h.indexOf(s.default.compareVersions(w,g,m))>-1},d.isOS=function(f){return this.getOSName(!0)===String(f).toLowerCase()},d.isPlatform=function(f){return this.getPlatformType(!0)===String(f).toLowerCase()},d.isEngine=function(f){return this.getEngineName(!0)===String(f).toLowerCase()},d.is=function(f,h){return h===void 0&&(h=!1),this.isBrowser(f,h)||this.isOS(f)||this.isPlatform(f)},d.some=function(f){var h=this;return f===void 0&&(f=[]),f.some(function(g){return h.is(g)})},u}();t.default=l,e.exports=t.default},92:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,c=[{test:[/googlebot/i],describe:function(s){var a={name:"Googlebot"},l=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/opera/i],describe:function(s){var a={name:"Opera"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/opr\/|opios/i],describe:function(s){var a={name:"Opera"},l=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/SamsungBrowser/i],describe:function(s){var a={name:"Samsung Internet for Android"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/Whale/i],describe:function(s){var a={name:"NAVER Whale Browser"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/MZBrowser/i],describe:function(s){var a={name:"MZ Browser"},l=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/focus/i],describe:function(s){var a={name:"Focus"},l=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/swing/i],describe:function(s){var a={name:"Swing"},l=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/coast/i],describe:function(s){var a={name:"Opera Coast"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(s){var a={name:"Opera Touch"},l=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/yabrowser/i],describe:function(s){var a={name:"Yandex Browser"},l=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/ucbrowser/i],describe:function(s){var a={name:"UC Browser"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/Maxthon|mxios/i],describe:function(s){var a={name:"Maxthon"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/epiphany/i],describe:function(s){var a={name:"Epiphany"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/puffin/i],describe:function(s){var a={name:"Puffin"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/sleipnir/i],describe:function(s){var a={name:"Sleipnir"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/k-meleon/i],describe:function(s){var a={name:"K-Meleon"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/micromessenger/i],describe:function(s){var a={name:"WeChat"},l=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/qqbrowser/i],describe:function(s){var a={name:/qqbrowserlite/i.test(s)?"QQ Browser Lite":"QQ Browser"},l=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/msie|trident/i],describe:function(s){var a={name:"Internet Explorer"},l=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/\sedg\//i],describe:function(s){var a={name:"Microsoft Edge"},l=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/edg([ea]|ios)/i],describe:function(s){var a={name:"Microsoft Edge"},l=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/vivaldi/i],describe:function(s){var a={name:"Vivaldi"},l=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/seamonkey/i],describe:function(s){var a={name:"SeaMonkey"},l=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/sailfish/i],describe:function(s){var a={name:"Sailfish"},l=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,s);return l&&(a.version=l),a}},{test:[/silk/i],describe:function(s){var a={name:"Amazon Silk"},l=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/phantom/i],describe:function(s){var a={name:"PhantomJS"},l=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/slimerjs/i],describe:function(s){var a={name:"SlimerJS"},l=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(s){var a={name:"BlackBerry"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/(web|hpw)[o0]s/i],describe:function(s){var a={name:"WebOS Browser"},l=i.default.getFirstMatch(o,s)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/bada/i],describe:function(s){var a={name:"Bada"},l=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/tizen/i],describe:function(s){var a={name:"Tizen"},l=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/qupzilla/i],describe:function(s){var a={name:"QupZilla"},l=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/firefox|iceweasel|fxios/i],describe:function(s){var a={name:"Firefox"},l=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/electron/i],describe:function(s){var a={name:"Electron"},l=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/MiuiBrowser/i],describe:function(s){var a={name:"Miui"},l=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/chromium/i],describe:function(s){var a={name:"Chromium"},l=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,s)||i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/chrome|crios|crmo/i],describe:function(s){var a={name:"Chrome"},l=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/GSA/i],describe:function(s){var a={name:"Google Search"},l=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:function(s){var a=!s.test(/like android/i),l=s.test(/android/i);return a&&l},describe:function(s){var a={name:"Android Browser"},l=i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/playstation 4/i],describe:function(s){var a={name:"PlayStation 4"},l=i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/safari|applewebkit/i],describe:function(s){var a={name:"Safari"},l=i.default.getFirstMatch(o,s);return l&&(a.version=l),a}},{test:[/.*/i],describe:function(s){var a=s.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(a,s),version:i.default.getSecondMatch(a,s)}}}];t.default=c,e.exports=t.default},93:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),c=[{test:[/Roku\/DVP/],describe:function(s){var a=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,s);return{name:o.OS_MAP.Roku,version:a}}},{test:[/windows phone/i],describe:function(s){var a=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,s);return{name:o.OS_MAP.WindowsPhone,version:a}}},{test:[/windows /i],describe:function(s){var a=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,s),l=i.default.getWindowsVersionName(a);return{name:o.OS_MAP.Windows,version:a,versionName:l}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(s){var a={name:o.OS_MAP.iOS},l=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,s);return l&&(a.version=l),a}},{test:[/macintosh/i],describe:function(s){var a=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,s).replace(/[_\s]/g,"."),l=i.default.getMacOSVersionName(a),u={name:o.OS_MAP.MacOS,version:a};return l&&(u.versionName=l),u}},{test:[/(ipod|iphone|ipad)/i],describe:function(s){var a=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,s).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:a}}},{test:function(s){var a=!s.test(/like android/i),l=s.test(/android/i);return a&&l},describe:function(s){var a=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,s),l=i.default.getAndroidVersionName(a),u={name:o.OS_MAP.Android,version:a};return l&&(u.versionName=l),u}},{test:[/(web|hpw)[o0]s/i],describe:function(s){var a=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,s),l={name:o.OS_MAP.WebOS};return a&&a.length&&(l.version=a),l}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(s){var a=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,s)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,s)||i.default.getFirstMatch(/\bbb(\d+)/i,s);return{name:o.OS_MAP.BlackBerry,version:a}}},{test:[/bada/i],describe:function(s){var a=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,s);return{name:o.OS_MAP.Bada,version:a}}},{test:[/tizen/i],describe:function(s){var a=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,s);return{name:o.OS_MAP.Tizen,version:a}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(s){var a=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,s);return{name:o.OS_MAP.PlayStation4,version:a}}}];t.default=c,e.exports=t.default},94:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),c=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(s){var a=i.default.getFirstMatch(/(can-l01)/i,s)&&"Nova",l={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return a&&(l.model=a),l}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(s){var a=s.test(/ipod|iphone/i),l=s.test(/like (ipod|iphone)/i);return a&&!l},describe:function(s){var a=i.default.getFirstMatch(/(ipod|iphone)/i,s);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:a}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(s){return s.getBrowserName(!0)==="blackberry"},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(s){return s.getBrowserName(!0)==="bada"},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(s){return s.getBrowserName()==="windows phone"},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(s){var a=Number(String(s.getOSVersion()).split(".")[0]);return s.getOSName(!0)==="android"&&a>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(s){return s.getOSName(!0)==="android"},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(s){return s.getOSName(!0)==="macos"},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(s){return s.getOSName(!0)==="windows"},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(s){return s.getOSName(!0)==="linux"},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(s){return s.getOSName(!0)==="playstation 4"},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(s){return s.getOSName(!0)==="roku"},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=c,e.exports=t.default},95:function(e,t,n){t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),c=[{test:function(s){return s.getBrowserName(!0)==="microsoft edge"},describe:function(s){if(/\sedg\//i.test(s))return{name:o.ENGINE_MAP.Blink};var a=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,s);return{name:o.ENGINE_MAP.EdgeHTML,version:a}}},{test:[/trident/i],describe:function(s){var a={name:o.ENGINE_MAP.Trident},l=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:function(s){return s.test(/presto/i)},describe:function(s){var a={name:o.ENGINE_MAP.Presto},l=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:function(s){var a=s.test(/gecko/i),l=s.test(/like gecko/i);return a&&!l},describe:function(s){var a={name:o.ENGINE_MAP.Gecko},l=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(s){var a={name:o.ENGINE_MAP.WebKit},l=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,s);return l&&(a.version=l),a}}];t.default=c,e.exports=t.default}});var If=ao(Tf.exports);const Qe={Initialized:"initialized",DisplayURI:"display_uri",ProviderUpdate:"provider_update",ConnectWithResponse:"connectWithResponse",ConnectionStatus:"connection_status",ServiceStatus:"service_status"};class Et{constructor({shouldSetOnWindow:t,connectionStream:n,shouldSendMetadata:r=!1,shouldShimWeb3:i,sdkInstance:o}){const c=new Um({connectionStream:n,shouldSendMetadata:r,shouldSetOnWindow:t,shouldShimWeb3:i,autoRequestAccounts:!1}),s=new Proxy(c,{deleteProperty:()=>!0});if(this.provider=s,this.sdkInstance=o,t&&typeof window<"u")try{a=c,window.ethereum=a,window.dispatchEvent(new Event("ethereum#initialized"))}catch(l){V("[Ethereum] Unable to set global provider - window.ethereum may be read-only",l)}var a;if(i&&typeof window<"u")try{(function(l,u=console){let d=!1,f=!1;if(!window.web3){const h="__isMetaMaskShim__";let g={currentProvider:l};Object.defineProperty(g,h,{value:!0,enumerable:!0,configurable:!1,writable:!1}),g=new Proxy(g,{get:(m,w,...p)=>(w!=="currentProvider"||d?w==="currentProvider"||w===h||f||(f=!0,u.error("MetaMask no longer injects web3. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),l.request({method:"metamask_logWeb3ShimUsage"}).catch(S=>{u.debug("MetaMask: Failed to log web3 shim usage.",S)})):(d=!0,u.warn("You are accessing the MetaMask window.web3.currentProvider shim. This property is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3")),Reflect.get(m,w,...p)),set:(...m)=>(u.warn("You are accessing the MetaMask window.web3 shim. This object is deprecated; use window.ethereum instead. For details, see: https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3"),Reflect.set(...m))}),Object.defineProperty(window,"web3",{value:g,enumerable:!1,configurable:!0,writable:!0})}})(this.provider)}catch(l){V("[Ethereum] Unable to shim web3 - window.web3 may be read-only",l)}this.provider.on("display_uri",l=>{this.sdkInstance.emit(Qe.DisplayURI,l)}),this.provider.on("_initialized",()=>{const l={chainId:this.provider.getChainId(),isConnected:this.provider.isConnected(),isMetaMask:this.provider.isMetaMask,selectedAddress:this.provider.getSelectedAddress(),networkVersion:this.provider.getNetworkVersion()};this.sdkInstance.emit(Qe.Initialized,l),V("[Ethereum: constructor()] provider initialized",l)})}static init(t){var n;return V("[Ethereum: init()] Initializing Ethereum service"),this.instance=new Et(t),(n=this.instance)===null||n===void 0?void 0:n.provider}static destroy(){}static getInstance(){var t;if(!(!((t=this.instance)===null||t===void 0)&&t.provider))throw new Error("Ethereum instance not intiialized - call Ethereum.factory first.");return this.instance}static getProvider(){var t;if(!(!((t=this.instance)===null||t===void 0)&&t.provider))throw new Error("Ethereum instance not intiialized - call Ethereum.factory first.");return this.instance.provider}}class Lr{constructor({useDeepLink:t,preferredOpenLink:n,debug:r=!1}){this.state={platformType:void 0,useDeeplink:!1,preferredOpenLink:void 0,debug:!1},this.state.platformType=this.getPlatformType(),this.state.useDeeplink=t,this.state.preferredOpenLink=n,this.state.debug=r}openDeeplink(t,n,r){return function(i,o,c,s){const{state:a}=i;V(`[PlatfformManager: openDeeplink()] universalLink --> ${o}`),V(`[PlatfformManager: openDeeplink()] deepLink --> ${c}`);try{if(a.preferredOpenLink)return void a.preferredOpenLink(a.useDeeplink?c:o,s);if(V(`[PlatfformManager: openDeeplink()] open link now useDeepLink=${a.useDeeplink} link=${a.useDeeplink?c:o}`),a.useDeeplink)typeof window<"u"&&(window.location.href=c);else if(typeof document<"u"){const l=document.createElement("a");l.href=o,l.target="_self",l.rel="noreferrer noopener",l.click()}}catch(l){console.log("[PlatfformManager: openDeeplink()] can't open link",l)}}(this,t,n,r)}isReactNative(){var t;return this.isNotBrowser()&&typeof window<"u"&&(window==null?void 0:window.navigator)&&((t=window.navigator)===null||t===void 0?void 0:t.product)==="ReactNative"}isMetaMaskInstalled(){return function(){const t=Et.getProvider()||(window==null?void 0:window.ethereum);return V(`[PlatfformManager: isMetaMaskInstalled()] isMetaMask=${t==null?void 0:t.isMetaMask} isConnected=${t==null?void 0:t.isConnected()}`),(t==null?void 0:t.isMetaMask)&&(t==null?void 0:t.isConnected())}()}isDesktopWeb(){return this.isBrowser()&&!this.isMobileWeb()}isMobile(){var t,n;const r=If.parse(window.navigator.userAgent);return((t=r==null?void 0:r.platform)===null||t===void 0?void 0:t.type)==="mobile"||((n=r==null?void 0:r.platform)===null||n===void 0?void 0:n.type)==="tablet"}isSecure(){return this.isReactNative()||this.isMobileWeb()}isMetaMaskMobileWebView(){return typeof window<"u"&&!!window.ReactNativeWebView&&!!navigator.userAgent.endsWith("MetaMaskMobile")}isMobileWeb(){return this.state.platformType===Fe.MobileWeb}static isNotBrowser(){var t;return typeof window>"u"||!(window!=null&&window.navigator)||Ye!==void 0&&((t=Ye==null?void 0:Ye.navigator)===null||t===void 0?void 0:t.product)==="ReactNative"||(navigator==null?void 0:navigator.product)==="ReactNative"}isNotBrowser(){return Lr.isNotBrowser()}static isBrowser(){return!this.isNotBrowser()}isBrowser(){return Lr.isBrowser()}isNodeJS(){return this.isNotBrowser()&&!this.isReactNative()}isUseDeepLink(){return this.state.useDeeplink}getPlatformType(){return function(t){const{state:n}=t;return n.platformType?n.platformType:t.isReactNative()?Fe.ReactNative:t.isNotBrowser()?Fe.NonBrowser:t.isMetaMaskMobileWebView()?Fe.MetaMaskMobileWebview:t.isMobile()?Fe.MobileWeb:Fe.DesktopWeb}(this)}}const Pf=e=>Z(void 0,void 0,void 0,function*(){if(Lr.isBrowser()){const{StorageManagerWeb:n}=yield Promise.resolve().then(function(){return mg});return new n(e)}const t={persistChannelConfig:()=>Z(void 0,void 0,void 0,function*(){}),getPersistedChannelConfig:()=>Z(void 0,void 0,void 0,function*(){}),persistAccounts:()=>Z(void 0,void 0,void 0,function*(){}),getCachedAccounts:()=>Z(void 0,void 0,void 0,function*(){return[]}),persistChainId:()=>Z(void 0,void 0,void 0,function*(){}),getCachedChainId:()=>Z(void 0,void 0,void 0,function*(){}),terminate:()=>Z(void 0,void 0,void 0,function*(){})};return Promise.resolve(t)});class Um extends Bm{constructor({connectionStream:t,shouldSendMetadata:n,autoRequestAccounts:r=!1}){super(t,{logger:console,maxEventListeners:100,shouldSendMetadata:n}),this.state={accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:"",networkVersion:""},V(`[SDKProvider: constructor()] autoRequestAccounts=${r}`),this.state.autoRequestAccounts=r}forceInitializeState(){return Z(this,void 0,void 0,function*(){return V(`[SDKProvider: forceInitializeState()] autoRequestAccounts=${this.state.autoRequestAccounts}`),this._initializeStateAsync()})}_setConnected(){V("[SDKProvider: _setConnected()] Setting connected state"),this._state.isConnected=!0}getState(){return this._state}getSDKProviderState(){return this.state}getSelectedAddress(){var t;const{accounts:n}=this._state;return n&&n.length!==0?((t=n[0])===null||t===void 0?void 0:t.toLowerCase())||"":(V("[SDKProvider: getSelectedAddress] No accounts found"),null)}getChainId(){return this.state.chainId}getNetworkVersion(){return this.state.networkVersion}setSDKProviderState(t){this.state=Object.assign(Object.assign({},this.state),t)}handleAccountsChanged(t,n){return this._handleAccountsChanged(t,n)}handleDisconnect({terminate:t=!1}){(function({terminate:n=!1,instance:r}){const{state:i}=r;V(`[SDKProvider: handleDisconnect()] cleaning up provider state terminate=${n}`,r),n&&(r._state.accounts=null,r._state.isUnlocked=!1,r._state.isPermanentlyDisconnected=!0,r._state.initialized=!1),r._handleAccountsChanged([]),r._state.isConnected=!1,r.emit("disconnect",Af.ethErrors.provider.disconnected()),i.providerStateRequested=!1})({terminate:t,instance:this})}_initializeStateAsync(){return Z(this,void 0,void 0,function*(){return function(t){var n,r;return Z(this,void 0,void 0,function*(){t.state===void 0&&(t.state={accounts:null,autoRequestAccounts:!1,providerStateRequested:!1,chainId:""});const{state:i}=t;let o;if(i.providerStateRequested)V("[SDKProvider: initializeStateAsync()] initialization already in progress");else{let c;i.providerStateRequested=!0;let s=null,a=!1,l=!1;const u=yield Pf({enabled:!0});if(u){const d=yield u.getPersistedChannelConfig({});a=(n=d==null?void 0:d.relayPersistence)!==null&&n!==void 0&&n,c=yield u.getCachedChainId();const f=yield u.getCachedAccounts();f.length>0&&(s=f[0])}if(V(`[SDKProvider: initializeStateAsync()] relayPersistence=${a}`,{relayPersistence:a,cachedChainId:c,cachedSelectedAddress:s}),a)if(c&&s)o={accounts:[s],chainId:c,isUnlocked:!1},l=!0;else try{o=yield t.request({method:"metamask_getProviderState"})}catch(d){return t._log.error("MetaMask: Failed to get initial state. Please report this bug.",d),void(i.providerStateRequested=!1)}if(((r=o==null?void 0:o.accounts)===null||r===void 0?void 0:r.length)===0)if(t.getSelectedAddress())o.accounts=[t.getSelectedAddress()];else{V("[SDKProvider: initializeStateAsync()] Fetch accounts remotely.");const d=yield t.request({method:"eth_requestAccounts",params:[]});o.accounts=d}t._initializeState(o),i.providerStateRequested=!1,l&&(t._state.isConnected=!0,t.emit("connect",{chainId:o==null?void 0:o.chainId}))}})}(this)})}_initializeState(t){return V("[SDKProvider: _initializeState()]",t),function(n,r,i){return V("[SDKProvider: initializeState()] set state._initialized to false"),n._state.initialized=!1,r(i)}(this,super._initializeState.bind(this),t)}_handleChainChanged({chainId:t,networkVersion:n}={}){this.state.chainId=t,this.state.networkVersion=n,function({instance:r,chainId:i,networkVersion:o,superHandleChainChanged:c}){V(`[SDKProvider: handleChainChanged()] chainId=${i} networkVersion=${o}`);let s=o;o||(V("[SDKProvider: handleChainChanged()] forced network version to prevent provider error"),s="1"),i!==yl&&(Me.analytics.track("sdk_used_chain",{caip_chain_id:`eip155:${parseInt(i??"0x1",16)}`}),yl=i),r._state.isConnected=!0,r.emit("connect",{chainId:i}),c({chainId:i,networkVersion:s})}({instance:this,chainId:t,networkVersion:n,superHandleChainChanged:super._handleChainChanged.bind(this)})}}var Nr,Nn={name:"@metamask/sdk",version:"0.33.1",description:"",homepage:"https://github.com/MetaMask/metamask-sdk#readme",bugs:{url:"https://github.com/MetaMask/metamask-sdk/issues"},repository:{type:"git",url:"https://github.com/MetaMask/metamask-sdk",directory:"packages/sdk"},main:"dist/node/cjs/metamask-sdk.js",module:"dist/browser/es/metamask-sdk.js",browser:"dist/browser/es/metamask-sdk.js",unpkg:"dist/browser/umd/metamask-sdk.js","react-native":"dist/react-native/es/metamask-sdk.js",types:"dist/types/src/index.d.ts",sideEffects:!1,files:["/dist"],scripts:{"build:types":"tsc --project tsconfig.build.json --emitDeclarationOnly --outDir dist/types",build:"yarn build:types && rollup -c --bundleConfigAsCjs","build:clean":"yarn clean && yarn build","build:post-tsc":"echo 'N/A'","build:pre-tsc":"echo 'N/A'",typecheck:"tsc --noEmit",clean:"rimraf ./dist",size:"node bundle-size && size-limit",lint:"yarn lint:eslint && yarn lint:misc --check","lint:changelog":"../../scripts/validate-changelog.sh @metamask/sdk","lint:eslint":"eslint . --cache --ext js,ts","lint:fix":"yarn lint:eslint --fix && yarn lint:misc --write","lint:misc":"prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path ../../.gitignore",prepack:"../../scripts/prepack.sh","publish:preview":"yarn npm publish --tag preview",reset:"yarn clean && rimraf ./node_modules/",test:'jest --testPathIgnorePatterns "/e2e/"',"test:coverage":'jest --coverage --testPathIgnorePatterns "/e2e/"',"test:e2e":'jest --testPathPattern "/e2e/"',"test:ci":'jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js --testPathIgnorePatterns "/e2e/"',"test:dev":'jest -c ./jest.config.ts --detectOpenHandles --testPathIgnorePatterns "/e2e/"',watch:"rollup -c -w",dev:'concurrently "tsc --watch" "rollup -c -w --bundleConfigAsCjs"',"build:dev":"yarn build:types && NODE_ENV=dev rollup -c --bundleConfigAsCjs"},dependencies:{"@babel/runtime":"^7.26.0","@metamask/onboarding":"^1.0.1","@metamask/providers":"16.1.0","@metamask/sdk-analytics":"workspace:*","@metamask/sdk-communication-layer":"workspace:*","@metamask/sdk-install-modal-web":"workspace:*","@paulmillr/qr":"^0.2.1",bowser:"^2.9.0","cross-fetch":"^4.0.0",debug:"4.3.4",eciesjs:"^0.4.11","eth-rpc-errors":"^4.0.3",eventemitter2:"^6.4.9","obj-multiplex":"^1.0.0",pump:"^3.0.0","readable-stream":"^3.6.2","socket.io-client":"^4.5.1",tslib:"^2.6.0",util:"^0.12.4",uuid:"^8.3.2"},devDependencies:{"@jest/globals":"^29.3.1","@lavamoat/allow-scripts":"^2.3.1","@metamask/auto-changelog":"3.1.0","@metamask/eslint-config":"^6.0.0","@metamask/eslint-config-nodejs":"^6.0.0","@metamask/eslint-config-typescript":"^6.0.0","@react-native-async-storage/async-storage":"^1.19.6","@rollup/plugin-alias":"^5.1.1","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.2","@rollup/plugin-replace":"^6.0.1","@rollup/plugin-terser":"^0.4.1","@size-limit/preset-big-lib":"^11.0.2","@types/dom-screen-wake-lock":"^1.0.2","@types/node":"^20.1.3","@types/pump":"^1.1.1","@types/qrcode-terminal":"^0.12.0","@types/uuid":"^10.0.0","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","browserify-zlib":"^0.2.0",buffer:"^6.0.3",concurrently:"^9.1.2","crypto-browserify":"^3.12.0",eslint:"^7.30.0","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.23.4","eslint-plugin-jest":"^24.4.0","eslint-plugin-jsdoc":"^36.1.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.4.0","https-browserify":"^1.0.0",jest:"^29.3.1","jest-environment-jsdom":"^29.3.1",prettier:"^2.3.0",process:"^0.11.10",rimraf:"^4.4.0",rollup:"^4.26.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-jscc":"^2.0.0","rollup-plugin-natives":"^0.7.5","rollup-plugin-node-builtins":"^2.1.2","rollup-plugin-polyfill-node":"^0.13.0","rollup-plugin-sizes":"^1.0.6","rollup-plugin-typescript2":"^0.31.2","rollup-plugin-visualizer":"^5.12.0","size-limit":"^11.0.2","stream-browserify":"^3.0.0","stream-http":"^3.2.0","ts-jest":"^29.0.3","ts-node":"^10.9.1",typescript:"^4.3.2",url:"^0.11.0",webpack:"^5.0.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},lavamoat:{allowScripts:{"eciesjs>secp256k1":!1,"socket.io-client>engine.io-client>ws>bufferutil":!1,"socket.io-client>engine.io-client>ws>utf-8-validate":!1,"@metamask/sdk-communication-layer>bufferutil":!1,"@metamask/sdk-communication-layer>eciesjs>secp256k1":!1,"@metamask/sdk-communication-layer>utf-8-validate":!1}}};(function(e){e.INPAGE="metamask-inpage",e.CONTENT_SCRIPT="metamask-contentscript",e.PROVIDER="metamask-provider"})(Nr||(Nr={}));const vl="direct",Dr="https://metamask.app.link/connect",$r="metamask://connect",bl={NAME:"MetaMask",RDNS:["io.metamask","io.metamask.flask"]},Hm=/(?:^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}$)|(?:^0{8}-0{4}-0{4}-0{4}-0{12}$)/u,ue={METAMASK_GETPROVIDERSTATE:"metamask_getProviderState",METAMASK_CONNECTSIGN:"metamask_connectSign",METAMASK_CONNECTWITH:"metamask_connectWith",METAMASK_OPEN:"metamask_open",METAMASK_BATCH:"metamask_batch",PERSONAL_SIGN:"personal_sign",WALLET_REQUESTPERMISSIONS:"wallet_requestPermissions",WALLET_REVOKEPERMISSIONS:"wallet_revokePermissions",WALLET_GETPERMISSIONS:"wallet_getPermissions",WALLET_WATCHASSET:"wallet_watchAsset",WALLET_ADDETHEREUMCHAIN:"wallet_addEthereumChain",WALLET_SWITCHETHETHEREUMCHAIN:"wallet_switchEthereumChain",ETH_REQUESTACCOUNTS:"eth_requestAccounts",ETH_ACCOUNTS:"eth_accounts",ETH_CHAINID:"eth_chainId",ETH_SENDTRANSACTION:"eth_sendTransaction",ETH_SIGNTYPEDDATA:"eth_signTypedData",ETH_SIGNTYPEDDATA_V3:"eth_signTypedData_v3",ETH_SIGNTYPEDDATA_V4:"eth_signTypedData_v4",ETH_SIGNTRANSACTION:"eth_signTransaction",ETH_SIGN:"eth_sign",PERSONAL_EC_RECOVER:"personal_ecRecover"},Br={[ue.ETH_REQUESTACCOUNTS]:!0,[ue.ETH_SENDTRANSACTION]:!0,[ue.ETH_SIGNTRANSACTION]:!0,[ue.ETH_SIGN]:!0,[ue.PERSONAL_SIGN]:!0,[ue.ETH_ACCOUNTS]:!1,[ue.ETH_CHAINID]:!1,[ue.PERSONAL_SIGN]:!0,[ue.ETH_SIGNTYPEDDATA]:!0,[ue.ETH_SIGNTYPEDDATA_V3]:!0,[ue.ETH_SIGNTYPEDDATA_V4]:!0,[ue.WALLET_REQUESTPERMISSIONS]:!0,[ue.WALLET_GETPERMISSIONS]:!0,[ue.WALLET_WATCHASSET]:!0,[ue.WALLET_ADDETHEREUMCHAIN]:!0,[ue.WALLET_SWITCHETHETHEREUMCHAIN]:!0,[ue.METAMASK_CONNECTSIGN]:!0,[ue.METAMASK_CONNECTWITH]:!0,[ue.PERSONAL_EC_RECOVER]:!0,[ue.METAMASK_BATCH]:!0,[ue.METAMASK_OPEN]:!0},Fm=Object.keys(Br).filter(e=>Br[e]===!0).map(e=>e.toLowerCase()),Rf=["eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sign"].map(e=>e.toLowerCase()),rs=".sdk-comm",eo="providerType",$s=".MMSDK_cached_address",Bs=".MMSDK_cached_chainId",St={CHAIN_CHANGED:"chainChanged",ACCOUNTS_CHANGED:"accountsChanged",DISCONNECT:"disconnect",CONNECT:"connect",CONNECTED:"connected"},zm=1e6;var Lt;(function(e){e.TERMINATE="terminate",e.EXTENSION="extension",e.INITIALIZED="initialized"})(Lt||(Lt={}));const qm=typeof window<"u"&&window.localStorage;function Wm({instance:e,msg:t}){return Z(this,void 0,void 0,function*(){if(e._initialized||(V("[MetaMaskSDK: connectAndSign()] provider not ready -- wait for init()"),yield e.init()),V(`[MetaMaskSDK: connectAndSign()] activeProvider=${e.activeProvider}`),!e.activeProvider)throw new Error("SDK state invalid -- undefined provider");const n=/^0x([0-9A-Fa-f]{2})*$/u.test(t)?t:function(r){let i;if(X!==void 0)i=X.from(r,"utf8").toString("hex");else if(typeof TextEncoder<"u"){const o=new TextEncoder().encode(r);i=Array.from(o).map(c=>c.toString(16).padStart(2,"0")).join("")}else{if(typeof Ye!="object"||!("Buffer"in Ye))throw new Error("Unable to convert string to hex: No available method.");i=Ye.Buffer.from(r,"utf8").toString("hex")}return`0x${i}`}(t);return e.activeProvider.request({method:ue.METAMASK_CONNECTWITH,params:[{method:ue.PERSONAL_SIGN,params:[n]}]})})}function wl(e){var t,n;return Z(this,void 0,void 0,function*(){V("[MetaMaskSDK: connectWithExtensionProvider()] ",e),e.sdkProvider=e.activeProvider,e.activeProvider=window.extension,window.ethereum=window.extension;try{const r=yield(t=window.extension)===null||t===void 0?void 0:t.request({method:"eth_requestAccounts"});V(`[MetaMaskSDK: connectWithExtensionProvider()] accounts=${r}`)}catch(r){return void console.warn("[MetaMaskSDK: connectWithExtensionProvider()] can't request accounts error",r)}localStorage.setItem(eo,"extension"),e.extensionActive=!0,e.emit(Qe.ProviderUpdate,Lt.EXTENSION),e.options.enableAnalytics&&((n=e.analytics)===null||n===void 0||n.send({event:Te.SDK_USE_EXTENSION}))})}function to(e){let t;if(X!==void 0)t=X.from(e,"utf8").toString("base64");else if(typeof btoa=="function")t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/gu,(n,r)=>String.fromCharCode(parseInt(r,16))));else{if(typeof Ye!="object"||!("Buffer"in Ye))throw new Error("Unable to base64 encode: No available method.");t=Ye.Buffer.from(e,"utf8").toString("base64")}return t}function Vm(e,t,n,r){var i,o,c,s,a,l,u,d,f,h,g,m,w,p,S,_,P,O,K,q;return Z(this,void 0,void 0,function*(){const F=(i=e.state.remote)===null||i===void 0?void 0:i.isReady(),U=(o=e.state.remote)===null||o===void 0?void 0:o.isConnected(),j=(c=e.state.remote)===null||c===void 0?void 0:c.isPaused(),G=Et.getProvider(),B=(s=e.state.remote)===null||s===void 0?void 0:s.getChannelId(),N=(a=e.state.remote)===null||a===void 0?void 0:a.isAuthorized(),{deeplinkProtocol:I}=e.state,{method:C,data:R,triggeredInstaller:D}=(M=>{var b,v,A,x;let T;X.isBuffer(M)?(T=M.toJSON(),T._isBuffer=!0):T=M;const L=(b=T==null?void 0:T.data)===null||b===void 0?void 0:b.method;let $=!1;return typeof((v=T==null?void 0:T.data)===null||v===void 0?void 0:v.params)=="object"&&((x=(A=T==null?void 0:T.data)===null||A===void 0?void 0:A.params)===null||x===void 0?void 0:x.__triggeredInstaller)===!0&&($=!0,T.data.params=T.data.params.wrappedParams),{method:L,data:T,triggeredInstaller:$}})(t);if(V(`[RCPMS: write()] method='${C}' isRemoteReady=${F} channelId=${B} isSocketConnected=${U} isRemotePaused=${j} providerConnected=${G.isConnected()}`,t),!B)return C!==ue.METAMASK_GETPROVIDERSTATE&&V(`[RCPMS: write()] ${C} --> channelId is undefined`),r(new Error("disconnected"));V(`[RCPMS: write()] remote.isPaused()=${(l=e.state.remote)===null||l===void 0?void 0:l.isPaused()} authorized=${N} ready=${F} socketConnected=${U}`,t);const y=(u=e.state.platformManager)===null||u===void 0?void 0:u.isSecure(),E=(f=(d=e.state.platformManager)===null||d===void 0?void 0:d.isMobileWeb())!==null&&f!==void 0&&f,k=(g=(h=e.state.remote)===null||h===void 0?void 0:h.hasDeeplinkProtocol())!==null&&g!==void 0&&g&&E&&N;try{if(!D){const v=JSON.stringify(R==null?void 0:R.data);if(v.length>zm)return r(new Error(`Message size ${v.length} exceeds maximum allowed size of 1000000 bytes`));(m=e.state.remote)===null||m===void 0||m.sendMessage(R==null?void 0:R.data).then(()=>{V(`[RCPMS: _write()] ${C} sent successfully`)}).catch(A=>{V("[RCPMS: _write()] error sending message",A)})}if(!y)return V(`[RCPMS: _write()] unsecure platform for method ${C} -- return callback`),r();if(D)return V("[RCPMS: _write()] prevent deeplink -- installation completed separately."),r();const M=(S=(p=(w=e.state.remote)===null||w===void 0?void 0:w.getKeyInfo())===null||p===void 0?void 0:p.ecies.public)!==null&&S!==void 0?S:"";let b=encodeURI(`channelId=${B}&pubkey=${M}&comm=socket&t=d&v=2`);if(k){const v=JSON.stringify(R==null?void 0:R.data),A=(_=e.state.remote)===null||_===void 0?void 0:_.encrypt(v);if(!A)return V("[RCPMS: _write()] error encrypting message"),r(new Error("RemoteCommunicationPostMessageStream - disconnected"));b+=`&scheme=${I}&rpc=${to(A)}`}if(!(!((P=e.state.platformManager)===null||P===void 0)&&P.isMetaMaskInstalled()))return V("[RCPMS: _write()] prevent deeplink until installation is completed."),r();Br[C]?(V(`[RCPMS: _write()] redirect link for '${C}' socketConnected=${U} connect?${b}`),(O=e.state.platformManager)===null||O===void 0||O.openDeeplink(`${Dr}?${b}`,`${$r}?${b}`,"_self")):!((K=e.state.remote)===null||K===void 0)&&K.isPaused()?(V(`[RCPMS: _write()] MM is PAUSED! deeplink with connect! targetMethod=${C}`),(q=e.state.platformManager)===null||q===void 0||q.openDeeplink(`${Dr}?redirect=true&${b}`,`${$r}?redirect=true&${b}`,"_self")):V(`[RCPMS: _write()] method ${C} doesn't need redirect.`)}catch(M){return V("[RCPMS: _write()] error sending message",M),r(new Error("RemoteCommunicationPostMessageStream - disconnected"))}return r()})}class Gm extends rr.Duplex{constructor({name:t,remote:n,deeplinkProtocol:r,platformManager:i}){super({objectMode:!0}),this.state={_name:null,remote:null,deeplinkProtocol:!1,platformManager:null},this.state._name=t,this.state.remote=n,this.state.deeplinkProtocol=r,this.state.platformManager=i,this._onMessage=this._onMessage.bind(this),this.state.remote.on(te.MESSAGE,this._onMessage)}_write(t,n,r){return Z(this,void 0,void 0,function*(){return Vm(this,t,0,r)})}_read(){}_onMessage(t){return function(n,r){try{if(V("[RCPMS: onMessage()] message",r),!r||typeof r!="object"||typeof(r==null?void 0:r.data)!="object")return;if(!(r!=null&&r.name))return void V("[RCPMS: onMessage()] ignore message without name",r);if((r==null?void 0:r.name)!==Nr.PROVIDER)return void V(`[RCPMS: onMessage()] ignore message with wrong name message=${r}`);if(X.isBuffer(r)){const i=X.from(r);n.push(i)}else n.push(r)}catch(i){V(`[RCPMS: onMessage()] ignore message error err=${i}`)}}(this,t)}start(){}}let El=1;const Of=e=>new Promise(t=>{setTimeout(()=>{t(!0)},e)}),Ym=({checkInstallationOnAllCalls:e=!1,communicationLayerPreference:t,injectProvider:n,shouldShimWeb3:r,platformManager:i,installer:o,sdk:c,remoteConnection:s,debug:a})=>Z(void 0,void 0,void 0,function*(){var l,u;const d=(({name:j,remoteConnection:G})=>{if(!G||!(G!=null&&G.getConnector()))throw new Error("Missing remote connection parameter");return new Gm({name:j,remote:G==null?void 0:G.getConnector(),deeplinkProtocol:G==null?void 0:G.state.deeplinkProtocol,platformManager:G==null?void 0:G.getPlatformManager()})})({name:Nr.INPAGE,target:Nr.CONTENT_SCRIPT,remoteConnection:s}),f=i.getPlatformType(),h=c.options.dappMetadata,g=`Sdk/Javascript SdkVersion/${Nn.version} Platform/${f} dApp/${(l=h.url)!==null&&l!==void 0?l:h.name} dAppTitle/${h.name}`;let m=null,w=null;const p=(u=c.options.storage)===null||u===void 0?void 0:u.storageManager;if(p){try{const j=yield p.getCachedAccounts();j.length>0&&(m=j[0])}catch(j){console.error(`[initializeMobileProvider] failed to get cached addresses: ${j}`)}try{const j=yield p.getCachedChainId();j&&(w=j)}catch(j){console.error(`[initializeMobileProvider] failed to parse cached chainId: ${j}`)}}V(`[initializeMobileProvider] cachedAccountAddress: ${m}, cachedChainId: ${w}`);const S=!(!n||f===Fe.NonBrowser||f===Fe.ReactNative),_=Et.init({shouldSetOnWindow:S,connectionStream:d,shouldShimWeb3:r,sdkInstance:c});let P=!1;const O=j=>{P=j},K=()=>P,q=(j,G,B,N)=>Z(void 0,void 0,void 0,function*(){var I,C,R,D,y,E,k,M,b;const v=Et.getProvider();if(P){v.emit("display_uri",(s==null?void 0:s.state.qrcodeLink)||""),s==null||s.showActiveModal();let Q=K();for(;Q;){const ne=K(),se=s==null?void 0:s.isAuthorized();Q=ne&&!se,V(`[initializeMobileProvider: sendRequest()] waiting for initialization to complete - initializing: ${ne} authorized: ${se}`),yield Of(1e3)}return V("[initializeMobileProvider: sendRequest()] initial method completed -- prevent installation and call provider"),B(...G)}const A=i.isMetaMaskInstalled(),x=s==null?void 0:s.isConnected();let T=null,L=null,$=null;if(T=(I=v.getSelectedAddress())!==null&&I!==void 0?I:m,$=v.getChainId()||w,T&&p&&T!==m&&p.persistAccounts([T]).catch(Q=>{console.error(`[initializeMobileProvider] failed to persist account: ${Q}`)}),$&&(w=$,p&&p.persistChainId($).catch(Q=>{console.error(`[initializeMobileProvider] failed to persist chainId: ${Q}`)})),V("[initializeMobileProvider: sendRequest()]",{selectedAddress:T,chainId:$}),N&&V(`[initializeMobileProvider: sendRequest()] method=${j} ongoing=${P} selectedAddress=${T} isInstalled=${A} checkInstallationOnAllCalls=${e} socketConnected=${x}`),T&&j.toLowerCase()===ue.ETH_ACCOUNTS.toLowerCase())return[T];if($&&j.toLowerCase()===ue.ETH_CHAINID.toLowerCase())return $;const H=[ue.ETH_REQUESTACCOUNTS,ue.WALLET_REQUESTPERMISSIONS,ue.METAMASK_CONNECTSIGN,ue.METAMASK_CONNECTWITH],z=!Br[j],J=(C=c.options.readonlyRPCMap)===null||C===void 0?void 0:C[$];if(J&&z)try{const Q=(R=G==null?void 0:G[0])===null||R===void 0?void 0:R.params,ne=yield(({rpcEndpoint:se,method:le,sdkInfo:re,params:ie})=>Z(void 0,void 0,void 0,function*(){const ce=JSON.stringify({jsonrpc:"2.0",method:le,params:ie,id:(El+=1,El)}),ae={Accept:"application/json","Content-Type":"application/json"};let ge;se.includes("infura")&&(ae["Metamask-Sdk-Info"]=re);try{ge=yield Zl(se,{method:"POST",headers:ae,body:ce})}catch(we){throw we instanceof Error?new Error(`Failed to fetch from RPC: ${we.message}`):new Error(`Failed to fetch from RPC: ${we}`)}if(!ge.ok)throw new Error(`Server responded with a status of ${ge.status}`);return(yield ge.json()).result}))({rpcEndpoint:J,sdkInfo:g,method:j,params:Q||[]});return N&&V(`initializeProvider::ReadOnlyRPCResponse ${ne}`),ne}catch(Q){console.warn(`[initializeMobileProvider: sendRequest()] method=${j} readOnlyRPCRequest failed:`,Q)}if((!A||A&&!x)&&j!==ue.METAMASK_GETPROVIDERSTATE){const Q=((D=G==null?void 0:G[0])===null||D===void 0?void 0:D.params)||[];if(H.indexOf(j)!==-1||e){O(!0);const ne=j===ue.METAMASK_CONNECTWITH,se=`${Date.now()}`;try{yield o.start({wait:!1,connectWith:ne?{method:j,id:se,params:Q}:void 0}),yield new Promise((le,re)=>{s!=null&&s.isAuthorized()&&(V("[initializeMobileProvider: sendRequest()] already authorized"),le(!0)),s==null||s.getConnector().once(te.AUTHORIZED,()=>{le(!0)}),c.once(te.PROVIDER_UPDATE,ie=>{V(`[initializeMobileProvider: sendRequest()] PROVIDER_UPDATE --- remote provider request interupted type=${ie}`),ie===Lt.EXTENSION?re(te.PROVIDER_UPDATE):re(new Error("Connection Terminated"))})})}catch(le){if(Lt.EXTENSION===le){if(V(`[initializeMobileProvider: sendRequest()] extension provider detect: re-create ${j} on the active provider`),j.toLowerCase()===ue.METAMASK_CONNECTSIGN.toLowerCase()){const re=yield(y=c.getProvider())===null||y===void 0?void 0:y.request({method:ue.ETH_REQUESTACCOUNTS,params:[]});if(!re.length)throw new Error("SDK state invalid -- undefined accounts");const ie=yield(E=c.getProvider())===null||E===void 0?void 0:E.request({method:ue.PERSONAL_SIGN,params:[Q[0],re[0]]});return c.emit(Qe.ConnectWithResponse,ie),ie}if(j.toLowerCase()===ue.METAMASK_CONNECTWITH.toLowerCase()){const[re]=Q,ie=yield(({method:ce,sdk:ae,params:ge})=>Z(void 0,void 0,void 0,function*(){var we,de,me,ye;if(!ae.isExtensionActive())throw new Error("SDK state invalid -- extension is not active");V("[MetaMaskProvider: extensionConnectWithOverwrite()] Overwriting request method",ce,ge);const Ie=yield(we=ae.getProvider())===null||we===void 0?void 0:we.request({method:ue.ETH_REQUESTACCOUNTS,params:[]});if(!Ie.length)throw new Error("SDK state invalid -- undefined accounts");if((ce==null?void 0:ce.toLowerCase())===ue.PERSONAL_SIGN.toLowerCase()){const ct={method:ce,params:[ge[0],Ie[0]]};return yield(de=ae.getProvider())===null||de===void 0?void 0:de.request(ct)}if((ce==null?void 0:ce.toLowerCase())===ue.ETH_SENDTRANSACTION.toLowerCase()){const ct={method:ce,params:[Object.assign(Object.assign({},ge[0]),{from:Ie[0]})]};return yield(me=ae.getProvider())===null||me===void 0?void 0:me.request(ct)}return Rf.includes(ce.toLowerCase())?(console.warn(`MetaMaskSDK connectWith method=${ce} -- not handled by the extension -- call separately`),Ie):yield(ye=ae.getProvider())===null||ye===void 0?void 0:ye.request({method:ce,params:ge})}))({method:re.method,sdk:c,params:re.params});return c.emit(Qe.ConnectWithResponse,ie),ie}return V(`[initializeMobileProvider: sendRequest()] sending '${j}' on active provider`,Q),yield(k=c.getProvider())===null||k===void 0?void 0:k.request({method:j,params:Q})}throw le===te.REJECTED?(s==null||s.closeModal(),(M=c.getProvider())===null||M===void 0||M.handleDisconnect({terminate:!1}),Object.assign(new Error("User rejected connection"),{code:4001})):(V(`[initializeMobileProvider: sendRequest()] failed to start installer: ${le}`),le)}finally{O(!1)}if(j===ue.ETH_REQUESTACCOUNTS)return L=yield new Promise(le=>{const re=setInterval(()=>{const{accounts:ie}=v.getState();ie&&(clearInterval(re),le(ie))},100)}),V(`[initializeMobileProvider: sendRequest()] selectedAddress: ${T} --- SKIP rpc call`),L;if(j===ue.METAMASK_CONNECTWITH)try{let le=0;const re=5,ie=({resolve:we,reject:de})=>{le+=1;const me=s==null?void 0:s.getConnector().getRPCMethodTracker(),ye=me==null?void 0:me[se];return V(`TRACKER: update method ${se}`,ye),ye!=null&&ye.result?(V("[initializeMobileProvider: sendRequest()] found result",ye.result),c.emit(Qe.ConnectWithResponse,ye.result),void we(ye.result)):ye!=null&&ye.error?(V("[initializeMobileProvider: sendRequest()] found error",ye.error),void de(ye.error)):le>=re?(V("[initializeMobileProvider: sendRequest()] max message count reached without result"),void de(new Error("Max message count reached without result"))):void V("[initializeMobileProvider: sendRequest()] not found yet, need to wait for next update")};let ce,ae;const ge=yield new Promise((we,de)=>{const me=s==null?void 0:s.getConnector().getRPCMethodTracker();V(`TRACKER: method ${se}`,me),me!=null&&me[se].result?(V("[initializeMobileProvider: sendRequest()] found result",me==null?void 0:me[se].result),we(me==null?void 0:me[se].result)):me!=null&&me[se].error&&(V("[initializeMobileProvider: sendRequest()] found error",me==null?void 0:me[se].error),de(me==null?void 0:me[se].error)),ae=()=>ie({resolve:we,reject:de}),ce=s==null?void 0:s.getConnector().on(te.RPC_UPDATE,ae)});return ae&&(ce==null||ce.off(te.RPC_UPDATE,ae)),V("TRACKER: result",ge),ge}catch(le){throw V("[initializeMobileProvider: sendRequest()] error:",le),le}return G[0]&&typeof G[0]=="object"&&(G[0].params={__triggeredInstaller:!0,wrappedParams:G[0].params}),B(...G)}if(i.isSecure()&&Br[j])return B(...G);if(c.isExtensionActive())return V(`[initializeMobileProvider: sendRequest()] EXTENSION active - redirect request '${j}' to it`,G,Q),yield(b=c.getProvider())===null||b===void 0?void 0:b.request({method:j,params:Q});throw V(`[initializeMobileProvider: sendRequest()] method=${j} --- skip --- not connected/installed`),new Error("MetaMask is not connected/installed, please call eth_requestAccounts to connect first.")}try{const Q=yield B(...G);if(V(`[initializeMobileProvider: sendRequest()] method=${j} rpcResponse`,Q),j===ue.WALLET_REQUESTPERMISSIONS){const ne=Q.reduce((se,le)=>{var re;if(le.parentCapability==="eth_accounts"){const ie=(re=le.caveats.find(ce=>ce.type==="restrictReturnedAccounts"))===null||re===void 0?void 0:re.value;ie&&se.push(...ie)}return se},[]);V("[initializeMobileProvider: sendRequest()] accountsToPersist:",ne),ne.length>0&&(v.handleAccountsChanged(ne,!1),p==null||p.persistAccounts(ne))}return Q}catch(Q){throw console.error("[initializeMobileProvider: sendRequest()] error:",Q),Q}}),{request:F}=_;_.request=(...j)=>Z(void 0,void 0,void 0,function*(){return q(j==null?void 0:j[0].method,j,F,a)});const{send:U}=_;return _.send=(...j)=>Z(void 0,void 0,void 0,function*(){return q(j==null?void 0:j[0],j,U,a)}),V("[initializeMobileProvider: sendRequest()] metamaskStream.start()"),d.start(),_});function Zm(e){var t,n,r,i;return Z(this,void 0,void 0,function*(){const{options:o}=e,c={communicationLayerPreference:(t=o.communicationLayerPreference)!==null&&t!==void 0?t:In.SOCKET,platformManager:e.platformManager,sdk:e,checkInstallationOnAllCalls:o.checkInstallationOnAllCalls,injectProvider:(n=o.injectProvider)===null||n===void 0||n,shouldShimWeb3:(r=o.shouldShimWeb3)===null||r===void 0||r,extensionOnly:(i=o.extensionOnly)===null||i===void 0||i,installer:e.installer,remoteConnection:e.remoteConnection,debug:e.debug},s=yield Ym(c);e.activeProvider=s,function(a){var l,u,d,f;(u=(l=a.remoteConnection)===null||l===void 0?void 0:l.getConnector())===null||u===void 0||u.on(Qe.ConnectionStatus,h=>{a.emit(Qe.ConnectionStatus,h)}),(f=(d=a.remoteConnection)===null||d===void 0?void 0:d.getConnector())===null||f===void 0||f.on(Qe.ServiceStatus,h=>{a.emit(Qe.ServiceStatus,h)})}(e)})}const Jm="sdk";class Xm{constructor({serverUrl:t,enabled:n,originatorInfo:r}){this.serverURL=er,this.serverURL=t,this.originatorInfo=r,this.enabled=n==null||n}send({event:t,params:n}){if(!this.enabled)return;const r=Object.assign(Object.assign({id:Jm,event:t,sdkVersion:Nn.version},this.originatorInfo),{params:n});V(`[Analytics: send()] event: ${t}`,r),Gt(r,this.serverURL).catch(i=>{V(`[Analytics: send()] error: ${i}`)})}}const Qm=()=>{if(typeof document>"u")return;let e;const t=document.getElementsByTagName("link");for(let n=0;n<t.length;n++)t[n].getAttribute("rel")!=="icon"&&t[n].getAttribute("rel")!=="shortcut icon"||(e=t[n].getAttribute("href"));return e},eg=163400;function _l(e){var t,n,r;const{dappMetadata:i}=e,o=function({url:u,name:d}){var f;const h=u+d,g=to(h);if(!localStorage)return"";let m=(f=localStorage.getItem(g))!==null&&f!==void 0?f:"";if(!m){m=dn();try{localStorage.setItem(g,m)}catch{return""}}return m}({url:(t=i==null?void 0:i.url)!==null&&t!==void 0?t:"no_url",name:(n=i==null?void 0:i.name)!==null&&n!==void 0?n:"no_name"}),c=(r=e.platformManager)===null||r===void 0?void 0:r.getPlatformType(),s=c===Fe.DesktopWeb,a=c===Fe.MetaMaskMobileWebview;let l="N/A";return s?l="extension":a&&(l="mobile"),{id:o,from:l}}const fi=(e,t,n)=>{if(Hr(e))if(n||t&&typeof t=="object"&&t!==null&&"error"in t){const r=n||(t==null?void 0:t.error);r&&r.code===4001?Me.analytics.track("sdk_action_rejected",{action:e}):Me.analytics.track("sdk_action_failed",{action:e})}else Me.analytics.track("sdk_action_succeeded",{action:e})},Lf=({provider:e,sdkInstance:t})=>{if("state"in e)throw new Error("INVALID EXTENSION PROVIDER");return new Proxy(e,{get:(n,r)=>r==="request"?function(i){var o,c;return Z(this,void 0,void 0,function*(){V("[wrapExtensionProvider()] Overwriting request method",i);const{method:s,params:a}=i,l=Fm.includes(s.toLowerCase()),{id:u,from:d}=_l(t);if(l&&((o=t.analytics)===null||o===void 0||o.send({event:Te.SDK_RPC_REQUEST,params:{method:s,from:d,id:u}})),Hr(s)&&Me.analytics.track("sdk_action_requested",{action:s}),s===ue.METAMASK_BATCH&&Array.isArray(a))return(({target:g,args:m,trackEvent:w,sdkInstance:p})=>Z(void 0,void 0,void 0,function*(){var S,_;if(m.method!=="metamask_batch")throw new Error("Invalid usage");const P=[],O=(S=m==null?void 0:m.params)!==null&&S!==void 0?S:[];for(const F of O){const U=yield g==null?void 0:g.request({method:F.method,params:F.params});P.push(U)}const{id:K,from:q}=_l(p);w&&((_=p.analytics)===null||_===void 0||_.send({event:Te.SDK_RPC_REQUEST_DONE,params:{method:m.method,from:q,id:K}}));for(const F of P)fi(m.method,F,null);return P}))({target:n,args:i,trackEvent:l,sdkInstance:t});if(s.toLowerCase()===ue.METAMASK_CONNECTSIGN.toLowerCase()&&Array.isArray(a))return(({target:g,params:m})=>Z(void 0,void 0,void 0,function*(){let w,p=null;try{const S=yield g.request({method:ue.ETH_REQUESTACCOUNTS,params:[]});if(!S.length)throw new Error("SDK state invalid -- undefined accounts");return w=yield g.request({method:ue.PERSONAL_SIGN,params:[m[0],S[0]]}),w}catch(S){throw p=S,S}finally{fi(ue.PERSONAL_SIGN,w,p)}}))({target:n,params:a});if(s.toLowerCase()===ue.METAMASK_CONNECTWITH.toLowerCase()&&Array.isArray(a))return(({target:g,params:m})=>Z(void 0,void 0,void 0,function*(){const[w]=m,p=w.method,S=w.params;let _,P=null;try{const O=yield g.request({method:ue.ETH_REQUESTACCOUNTS,params:[]});if(!Array.isArray(O)||!O.length)throw new Error("SDK state invalid -- undefined accounts");return(p==null?void 0:p.toLowerCase())===ue.PERSONAL_SIGN.toLowerCase()?(_=yield g.request({method:p,params:[S[0],O[0]]}),_):(p==null?void 0:p.toLowerCase())===ue.ETH_SENDTRANSACTION.toLowerCase()?(_=yield g.request({method:p,params:[Object.assign(Object.assign({},S[0]),{from:O[0]})]}),_):Rf.includes(p.toLowerCase())?(console.warn(`MetaMaskSDK connectWith method=${p} -- not handled by the extension -- call separately`),_=O,_):(_=yield g.request({method:p,params:S}),_)}catch(O){throw P=O,O}finally{fi(p,_,P)}}))({target:n,params:a});let f,h=null;try{return f=yield n.request(i),f}catch(g){throw h=g,g}finally{l&&((c=t.analytics)===null||c===void 0||c.send({event:Te.SDK_RPC_REQUEST_DONE,params:{method:s,from:d,id:u}})),fi(s,f,h)}})}:r==="getChainId"?function(){return e.chainId}:r==="getNetworkVersion"?function(){return e.networkVersion}:r==="getSelectedAddress"?function(){return e.selectedAddress}:r==="isConnected"?function(){return e._state.isConnected}:n[r]})};var no;function tg({mustBeMetaMask:e,sdkInstance:t}){return Z(this,void 0,void 0,function*(){if(typeof window>"u")throw new Error("window not available");try{const n=yield new Promise((r,i)=>{const o=setTimeout(()=>{i(new Error("eip6963RequestProvider timed out"))},500);window.addEventListener(no.Announce,c=>{const s=c,{detail:{info:a,provider:l}={}}=s,{name:u,rdns:d,uuid:f}=a??{};Hm.test(f)&&u.startsWith(bl.NAME)&&bl.RDNS.includes(d)&&(clearTimeout(o),r(l))}),window.dispatchEvent(new Event(no.Request))});return Lf({provider:n,sdkInstance:t})}catch{throw new Error("Provider not found")}})}(function(e){e.Announce="eip6963:announceProvider",e.Request="eip6963:requestProvider"})(no||(no={}));const ng=e=>Z(void 0,void 0,void 0,function*(){const{options:t}=e,{infuraAPIKey:n}=t;if(!n)return;const r={"0x1":`https://mainnet.infura.io/v3/${n}`,"0x5":`https://goerli.infura.io/v3/${n}`,"0xaa36a7":`https://sepolia.infura.io/v3/${n}`,"0xe708":`https://linea-mainnet.infura.io/v3/${n}`,"0xe704":`https://linea-goerli.infura.io/v3/${n}`,"0x89":`https://polygon-mainnet.infura.io/v3/${n}`,"0x13881":`https://polygon-mumbai.infura.io/v3/${n}`,"0x45":`https://optimism-mainnet.infura.io/v3/${n}`,"0x1a4":`https://optimism-goerli.infura.io/v3/${n}`,"0xa4b1":`https://arbitrum-mainnet.infura.io/v3/${n}`,"0x66eed":`https://arbitrum-goerli.infura.io/v3/${n}`,"0x2a15c308d":`https://palm-mainnet.infura.io/v3/${n}`,"0x2a15c3083":`https://palm-testnet.infura.io/v3/${n}`,"0xa86a":`https://avalanche-mainnet.infura.io/v3/${n}`,"0xa869":`https://avalanche-fuji.infura.io/v3/${n}`,"0x4e454152":`https://aurora-mainnet.infura.io/v3/${n}`,"0x4e454153":`https://aurora-testnet.infura.io/v3/${n}`,"0x534e5f4d41494e":`https://starknet-mainnet.infura.io/v3/${n}`,"0x534e5f474f45524c49":`https://starknet-goerli.infura.io/v3/${n}`,"0x534e5f474f45524c4932":`https://starknet-goerli2.infura.io/v3/${n}`,"0xa4ec":`https://celo-mainnet.infura.io/v3/${n}`,"0xaef3":`https://celo-alfajores.infura.io/v3/${n}`};e.options.readonlyRPCMap?e.options.readonlyRPCMap=Object.assign(Object.assign({},e.options.readonlyRPCMap),r):e.options.readonlyRPCMap=r}),rg=e=>Z(void 0,void 0,void 0,function*(){const{options:t}=e,{readonlyRPCMap:n}=t;if(n)try{V("[MetaMaskSDK: setupReadOnlyRPCProviders()] Setting up Readonly RPC Providers",n),e.setReadOnlyRPCCalls(!0)}catch{throw new Error("Invalid Infura Settings")}});function ig(e,t,n,r){return new(n||(n=Promise))(function(i,o){function c(l){try{a(r.next(l))}catch(u){o(u)}}function s(l){try{a(r.throw(l))}catch(u){o(u)}}function a(l){var u;l.done?i(l.value):(u=l.value,u instanceof n?u:new n(function(d){d(u)})).then(c,s)}a((r=r.apply(e,[])).next())})}function og(e,t){var n,r,i,o,c={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(a){return function(l){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return c.label++,{value:u[1],done:!1};case 5:c.label++,r=u[1],u=[0];continue;case 7:u=c.ops.pop(),c.trys.pop();continue;default:if(i=c.trys,!((i=i.length>0&&i[i.length-1])||u[0]!==6&&u[0]!==2)){c=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){c.label=u[1];break}if(u[0]===6&&c.label<i[1]){c.label=i[1],i=u;break}if(i&&c.label<i[2]){c.label=i[2],c.ops.push(u);break}i[2]&&c.ops.pop(),c.trys.pop();continue}u=t.call(e,c)}catch(d){u=[6,d],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([a,l])}}}var Sl="INSTALLED",Cl="NOT_INSTALLED",Al="REGISTERED",kl="REGISTERING",xl="RELOADING",Ml={CHROME:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",FIREFOX:"https://addons.mozilla.org/firefox/addon/ether-metamask/",DEFAULT:"https://metamask.io"},hi="REGISTRATION_IN_PROGRESS",Tl="FORWARDER_ID",sg=function(){function e(t){var n=t===void 0?{}:t,r=n.forwarderOrigin,i=r===void 0?"https://fwd.metamask.io":r,o=n.forwarderMode,c=o===void 0?e.FORWARDER_MODE.INJECT:o;this.forwarderOrigin=i,this.forwarderMode=c,this.state=e.isMetaMaskInstalled()?Sl:Cl;var s=e._detectBrowser();this.downloadUrl=s?Ml[s]:Ml.DEFAULT,this._onMessage=this._onMessage.bind(this),this._onMessageFromForwarder=this._onMessageFromForwarder.bind(this),this._openForwarder=this._openForwarder.bind(this),this._openDownloadPage=this._openDownloadPage.bind(this),this.startOnboarding=this.startOnboarding.bind(this),this.stopOnboarding=this.stopOnboarding.bind(this),window.addEventListener("message",this._onMessage),c===e.FORWARDER_MODE.INJECT&&sessionStorage.getItem(hi)==="true"&&e._injectForwarder(this.forwarderOrigin)}return e.prototype._onMessage=function(t){if(t.origin===this.forwarderOrigin)return t.data.type==="metamask:reload"?this._onMessageFromForwarder(t):void console.debug("Unknown message from '"+t.origin+"' with data "+JSON.stringify(t.data))},e.prototype._onMessageUnknownStateError=function(t){throw new Error("Unknown state: '"+t+"'")},e.prototype._onMessageFromForwarder=function(t){return ig(this,0,void 0,function(){return og(this,function(n){switch(n.label){case 0:switch(this.state){case xl:return[3,1];case Cl:return[3,2];case Sl:return[3,3];case kl:return[3,5];case Al:return[3,6]}return[3,7];case 1:return console.debug("Ignoring message while reloading"),[3,8];case 2:return console.debug("Reloading now to register with MetaMask"),this.state=xl,location.reload(),[3,8];case 3:return console.debug("Registering with MetaMask"),this.state=kl,[4,e._register()];case 4:return n.sent(),this.state=Al,t.source.postMessage({type:"metamask:registrationCompleted"},t.origin),this.stopOnboarding(),[3,8];case 5:return console.debug("Already registering - ignoring reload message"),[3,8];case 6:return console.debug("Already registered - ignoring reload message"),[3,8];case 7:this._onMessageUnknownStateError(this.state),n.label=8;case 8:return[2]}})})},e.prototype.startOnboarding=function(){sessionStorage.setItem(hi,"true"),this._openDownloadPage(),this._openForwarder()},e.prototype.stopOnboarding=function(){sessionStorage.getItem(hi)==="true"&&(this.forwarderMode===e.FORWARDER_MODE.INJECT&&(console.debug("Removing forwarder"),e._removeForwarder()),sessionStorage.setItem(hi,"false"))},e.prototype._openForwarder=function(){this.forwarderMode===e.FORWARDER_MODE.OPEN_TAB?window.open(this.forwarderOrigin,"_blank"):e._injectForwarder(this.forwarderOrigin)},e.prototype._openDownloadPage=function(){window.open(this.downloadUrl,"_blank")},e.isMetaMaskInstalled=function(){return!!(window.ethereum&&window.ethereum.isMetaMask)},e._register=function(){return window.ethereum.request({method:"wallet_registerOnboarding"})},e._injectForwarder=function(t){var n=document.body,r=document.createElement("iframe");r.setAttribute("height","0"),r.setAttribute("width","0"),r.setAttribute("style","display: none;"),r.setAttribute("src",t),r.setAttribute("id",Tl),n.insertBefore(r,n.children[0])},e._removeForwarder=function(){var t;(t=document.getElementById(Tl))===null||t===void 0||t.remove()},e._detectBrowser=function(){var t=If.parse(window.navigator.userAgent);return t.browser.name==="Firefox"?"FIREFOX":["Chrome","Chromium"].includes(t.browser.name||"")?"CHROME":null},e.FORWARDER_MODE={INJECT:"INJECT",OPEN_TAB:"OPEN_TAB"},e}();function ag(e,{wait:t=!1}){return Z(this,void 0,void 0,function*(){return V(`[MetamaskInstaller: startInstaller()] wait=${t}`),t&&(yield Of(1e3)),yield e.checkInstallation()})}class cg{constructor({remote:t,preferDesktop:n,platformManager:r,debug:i=!1}){this.state={isInstalling:!1,hasInstalled:!1,resendRequest:null,preferDesktop:!1,platformManager:null,remote:null,debug:!1,connectWith:void 0},this.state.remote=t,this.state.preferDesktop=n,this.state.platformManager=r,this.state.debug=i}startDesktopOnboarding(){return function(){return Z(this,void 0,void 0,function*(){V("[MetamaskInstaller: startDesktopOnboarding() starting desktop onboarding"),window.ethereum&&(window.ethereum=void 0),new sg().startOnboarding()})}()}redirectToProperInstall(){return Z(this,void 0,void 0,function*(){return function(t){var n,r;return Z(this,void 0,void 0,function*(){const{state:i}=t,o=(n=i.platformManager)===null||n===void 0?void 0:n.getPlatformType();if(V(`[MetamaskInstaller: redirectToProperInstall()] platform=${o}`),o===Fe.MetaMaskMobileWebview)return!1;i.isInstalling=!0;try{yield(r=i.remote)===null||r===void 0?void 0:r.startConnection({connectWith:i.connectWith}),i.isInstalling=!1,i.hasInstalled=!0}catch(c){throw i.isInstalling=!1,c}return!0})}(this)})}checkInstallation(){return Z(this,void 0,void 0,function*(){return function(t){var n;return Z(this,void 0,void 0,function*(){const{state:r}=t,i=(n=r.platformManager)===null||n===void 0?void 0:n.isMetaMaskInstalled();return V(`[MetamaskInstaller: checkInstallation()] isInstalled=${i}`),!!i||(yield t.redirectToProperInstall())})}(this)})}start({wait:t=!1,connectWith:n}){return Z(this,void 0,void 0,function*(){this.state.connectWith=n,V(`[MetaMaskInstaller: start()] wait=${t}`,n),yield ag(this,{wait:t})})}}class Nf{constructor({debug:t,sdkVersion:n}){this.containers={install:void 0,pending:void 0,select:void 0},this.defined={install:!1,pending:!1,select:!1},this.debug=t!=null&&t,this.sdkVersion=n}loadComponent(t){return Z(this,void 0,void 0,function*(){if(!this.defined[t]){this.defined[t]=!0;try{const n=yield Promise.resolve().then(function(){return Ug});console.log("loader",n),n.defineCustomElements()}catch(n){console.error(`Failed to load ${t} modal:`,n)}}})}renderInstallModal(t){var n;return Z(this,void 0,void 0,function*(){this.debug&&console.debug("ModalLoader: renderInstallModal",t),this.containers.install=t.parentElement,yield this.loadComponent("install");const r=document.createElement("mm-install-modal");r.link=t.link,r.preferDesktop=t.preferDesktop,r.sdkVersion=(n=t.sdkVersion)!==null&&n!==void 0?n:this.sdkVersion,r.addEventListener("close",({detail:{shouldTerminate:i}})=>t.onClose(i)),r.addEventListener("startDesktopOnboarding",t.metaMaskInstaller.startDesktopOnboarding),r.addEventListener("trackAnalytics",i=>{var o;return(o=t.onAnalyticsEvent)===null||o===void 0?void 0:o.call(t,i.detail)}),t.parentElement.appendChild(r)})}renderSelectModal(t){var n;return Z(this,void 0,void 0,function*(){this.containers.select=t.parentElement,yield this.loadComponent("select");const r=document.createElement("mm-select-modal");r.link=t.link,r.sdkVersion=(n=t.sdkVersion)!==null&&n!==void 0?n:this.sdkVersion,r.preferDesktop=t.preferDesktop,r.addEventListener("close",({detail:{shouldTerminate:i}})=>t.onClose(i)),r.addEventListener("connectWithExtension",t.connectWithExtension),t.parentElement.appendChild(r),setTimeout(()=>this.updateQRCode(t.link),100)})}renderPendingModal(t){var n;return Z(this,void 0,void 0,function*(){this.containers.pending=t.parentElement,yield this.loadComponent("pending");const r=document.createElement("mm-pending-modal");r.sdkVersion=(n=t.sdkVersion)!==null&&n!==void 0?n:this.sdkVersion,r.displayOTP=t.displayOTP,r.addEventListener("close",t.onClose),r.addEventListener("updateOTPValue",({detail:{otpValue:i}})=>t.updateOTPValue(i)),t.onDisconnect&&r.addEventListener("disconnect",t.onDisconnect),t.parentElement.appendChild(r)})}updateOTPValue(t){const n=()=>{var r;const i=(r=this.containers.pending)===null||r===void 0?void 0:r.querySelector("mm-pending-modal");return!!i&&(i.otpCode=t,!0)};setTimeout(()=>{n()},800)}updateQRCode(t){var n,r;const i=(n=this.containers.install)===null||n===void 0?void 0:n.querySelector("mm-install-modal");if(i)i.link=t;else{const o=(r=this.containers.select)===null||r===void 0?void 0:r.querySelector("mm-select-modal");o&&(o.link=t)}}unmount(){Object.entries(this.containers).forEach(([t,n])=>{var r;(r=n==null?void 0:n.parentNode)===null||r===void 0||r.removeChild(n),this.containers[t]=void 0})}}const lg=({link:e,debug:t,installer:n,terminate:r,connectWithExtension:i,preferDesktop:o,onAnalyticsEvent:c})=>{let s=null,a=null;V("[UI: InstallModal-web: sdkWebInstallModal()] ################## Installing Modal #################"),V(`[UI: InstallModal-web: sdkWebInstallModal()] link=${e}`),V(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${e}" --ios`),V(`[UI: InstallModal-web: sdkWebInstallModal()] npx uri-scheme open "${e}" --android`),V(`[UI: InstallModal-web: sdkWebInstallModal()] adb shell am start -a android.intent.action.VIEW -d "${e}"`);const l=u=>{var d;V("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web unmounting install modal -- shouldTerminate:",u,a),a!=null&&a.parentNode&&((d=a.parentNode)===null||d===void 0||d.removeChild(a)),a=null,s=null,u===!0&&(r==null||r())};return{mount:u=>{if(V("[UI: InstallModal-web: sdkWebInstallModal()] installModal-web mounting install modal",a),a)return a.style.display="block",void(s==null||s.updateQRCode(u));s=new Nf({debug:t,sdkVersion:Nn.version}),a=document.createElement("div"),document.body.appendChild(a),window.extension?s.renderSelectModal({parentElement:a,connectWithExtension:()=>{l(),i==null||i()},onClose:l,link:e,preferDesktop:o!=null&&o}).catch(d=>{console.error(d)}):s.renderInstallModal({parentElement:a,preferDesktop:o!=null&&o,link:e,metaMaskInstaller:n,onClose:l,onAnalyticsEvent:c}).catch(d=>{console.error("[UI: InstallModal-web: sdkWebInstallModal()]",d)})},unmount:l}},ug=({onDisconnect:e,debug:t})=>{let n=null,r=null;const i=()=>{V("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web unmount",n),n!=null&&n.parentNode&&n.parentNode.removeChild(n),n=null,r=null},o=s=>{V("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web updateOTPValue",s),r&&r.updateOTPValue(s)},c=({displayOTP:s}={displayOTP:!0})=>{V("[UI: pendingModal-web: sdkWebPendingModal()] pendingModal-web mount",n),n?n.style.display="block":(r=new Nf({debug:t,sdkVersion:Nn.version}),n=document.createElement("div"),document.body.appendChild(n),r.renderPendingModal({parentElement:n,onClose:i,onDisconnect:e,updateOTPValue:o,displayOTP:s}).catch(a=>{console.error("[UI: pendingModal-web: sdkWebPendingModal()]",a)}))};return c(),{mount:c,unmount:i,updateOTPValue:o}};function Df(e,t){var n,r,i,o;e.connector||(V("[RemoteConnection: initializeConnector()] initialize connector"),e.connector=new fp({anonId:t.anonId,platformType:t.platformManager.getPlatformType(),communicationLayerPreference:t.communicationLayerPreference,transports:t.transports,dappMetadata:Object.assign(Object.assign({},t.dappMetadata),{source:t._source}),analytics:t.enableAnalytics,communicationServerUrl:t.communicationServerUrl,sdkVersion:Nn.version,context:"dapp",ecies:t.ecies,storage:t.storage,logging:t.logging}),t.timer&&(V("[RemoteConnection: initializeConnector()] reset background timer",t.timer),(r=(n=t.timer)===null||n===void 0?void 0:n.stopBackgroundTimer)===null||r===void 0||r.call(n),(o=(i=t.timer)===null||i===void 0?void 0:i.runBackgroundTimer)===null||o===void 0||o.call(i,()=>!1,1e4)))}function Ks(e){e.listeners.forEach(({event:t,handler:n})=>{var r;(r=e.connector)===null||r===void 0||r.off(t,n)}),e.listeners=[]}function dg(e,t,n){return Z(this,void 0,void 0,function*(){const r=setTimeout(()=>{Me.analytics.track("sdk_connection_failed",{transport_type:"websocket"})},6e4);return new Promise((i,o)=>{if(!e.connector)return void o(new Error("No connector available"));V("[RemoteConnection: connectWithModalInstaller()]",{state:e,options:t,linkParams:n});const c=`${e.useDeeplink?$r:Dr}?${n}`;(function(s,a,l){var u,d,f,h;s.installModal=(d=(u=a.modals).install)===null||d===void 0?void 0:d.call(u,{link:l,preferDesktop:s.preferDesktop,installer:a.getMetaMaskInstaller(),terminate:()=>{V("[RemoteConnection: showInstallModal() => terminate()] terminate connection"),a.sdk.terminate().catch(g=>{console.warn("[MMSDK] failed to terminate connection",g)})},debug:s.developerMode,connectWithExtension:()=>{var g;return(g=a.connectWithExtensionProvider)===null||g===void 0||g.call(a),!1},onAnalyticsEvent:({event:g,params:m})=>{var w,p,S;const _=Object.assign(Object.assign({},m),{sdkVersion:a.sdk.getVersion(),dappId:(w=a.dappMetadata)===null||w===void 0?void 0:w.name,source:a._source,url:(p=a.dappMetadata)===null||p===void 0?void 0:p.url});(S=s.analytics)===null||S===void 0||S.send({event:g,params:_})}}),(h=(f=s.installModal)===null||f===void 0?void 0:f.mount)===null||h===void 0||h.call(f,l)})(e,t,c),t.sdk.once(te.PROVIDER_UPDATE,s=>Z(this,void 0,void 0,function*(){if(V("[RemoteConnection: connectWithModalInstaller()] once provider_update -- resolving startConnection promise"),s===Lt.TERMINATE){const a={code:4001,message:"User rejected the request."};return clearTimeout(r),void o(a)}o(s)})),e.connector.once(te.AUTHORIZED,()=>{clearTimeout(r),i()}),e.connector.once(te.REJECTED,()=>{clearTimeout(r),o(te.REJECTED)}),e.connector.once(te.CLIENTS_READY,()=>Z(this,void 0,void 0,function*(){V("[RemoteConnection: connectWithModalInstaller()] once clients_ready -- resolving startConnection promise"),clearTimeout(r),i()}))})})}function $f(e,t){function n(r,i){var o;(o=e.connector)===null||o===void 0||o.on(r,i),e.listeners.push({event:r,handler:i})}e.connector&&(Ks(e),n(te.WALLET_INIT,({accounts:r,chainId:i})=>Z(this,void 0,void 0,function*(){V(`[RemoteConnection: setupListeners() => EventType.WALLET_INIT] 'wallet_init' accounts=${r} chainId=${i}`);const o=Et.getProvider();o._setConnected();const c={accounts:r,chainId:i,isUnlocked:!1};o._initializeState(c),o.emit("chainChanged",i),o.emit("accountsChanged",r)})),n(te.AUTHORIZED,()=>Z(this,void 0,void 0,function*(){var r,i,o,c;try{V("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' closing modals",e.pendingModal,e.installModal);const s=Et.getProvider();s._setConnected(),(i=(r=e.pendingModal)===null||r===void 0?void 0:r.unmount)===null||i===void 0||i.call(r),(c=(o=e.installModal)===null||o===void 0?void 0:o.unmount)===null||c===void 0||c.call(o,!1),e.otpAnswer=void 0,e.authorized=!0,V("[RemoteConnection: setupListeners() => EventType.AUTHORIZED] 'authorized' provider.state",s.getState()),yield s.forceInitializeState()}catch{}})),n(te.TERMINATE,()=>{var r,i,o,c,s;(i=(r=e.pendingModal)===null||r===void 0?void 0:r.unmount)===null||i===void 0||i.call(r),(c=(o=e.installModal)===null||o===void 0?void 0:o.unmount)===null||c===void 0||c.call(o,!0),e.pendingModal=void 0,e.installModal=void 0,e.otpAnswer=void 0,(s=e.connector)===null||s===void 0||s.disconnect({terminate:!0}),e.authorized=!1,Et.getProvider().handleDisconnect({terminate:!0}),Ks(e),V("[RemoteConnection: setupListeners()] All listeners cleaned up")}))}function fg(e,t,{initialCheck:n,connectWith:r}={}){var i,o,c,s,a,l,u,d,f,h,g,m,w,p,S,_,P,O,K;return Z(this,void 0,void 0,function*(){try{if(Df(e,t),!e.connector)throw new Error("no connector defined");$f(e);const q=Et.getProvider();e.authorized=!1,q.emit("connecting");const F=yield(i=e.connector)===null||i===void 0?void 0:i.originatorSessionConnect();V(`[RemoteConnection: startConnection()] after originatorSessionConnect initialCheck=${n}`,F);let U=(o=F==null?void 0:F.channelId)!==null&&o!==void 0?o:"",j=(s=(c=e.connector.getKeyInfo())===null||c===void 0?void 0:c.ecies.public)!==null&&s!==void 0?s:"",G=(l=(a=e.connector.getKeyInfo())===null||a===void 0?void 0:a.ecies.private)!==null&&l!==void 0?l:"";if(n&&!F)return Promise.resolve();if(!F&&!n){const x=yield e.connector.generateChannelIdConnect();U=(u=x.channelId)!==null&&u!==void 0?u:"",j=(d=x.pubKey)!==null&&d!==void 0?d:"",G=(f=x.privKey)!==null&&f!==void 0?f:"";const T=Date.now();(h=e.connector.state.storageManager)===null||h===void 0||h.persistChannelConfig({channelId:U,localKey:G,lastActive:T,validUntil:T+tr})}if(n&&(F!=null&&F.channelId))return!((g=e.connector)===null||g===void 0)&&g.isConnected()||(V(`[RemoteConnection: startConnection()] reconnecting to channel initialCheck=${n}`,F),yield(m=e.connector)===null||m===void 0?void 0:m.connectToChannel({channelId:U})),Promise.resolve();F&&!(!((w=e.connector)===null||w===void 0)&&w.isConnected())&&(V("[RemoteConnection: startConnection()] reconnecting to channel",F),yield(p=e.connector)===null||p===void 0?void 0:p.connectToChannel({channelId:U}));const B=!((S=e.platformManager)===null||S===void 0)&&S.isSecure()?"":"&t=q",N=Nn.version,{iconUrl:I,name:C,url:R,scheme:D}=t.dappMetadata||{},y=(_=e.platformManager)===null||_===void 0?void 0:_.getPlatformType();let E="N/A";typeof window<"u"&&window.location&&window.location.hostname?E=window.location.hostname:C!==void 0?E=C:R!==void 0&&(E=R);const k={url:R??"",title:C??"",icon:I,scheme:D??"",apiVersion:N,dappId:E||R||"N/A",anonId:t.anonId,platform:y??"",source:(P=t._source)!==null&&P!==void 0?P:""},M=to(JSON.stringify(k));let b=`channelId=${U}&v=2&comm=${(O=e.communicationLayerPreference)!==null&&O!==void 0?O:""}&pubkey=${j}${B}&originatorInfo=${M}`;if(r){b+=`&rpc=${to(JSON.stringify(r))}`;const x=e.connector.getRPCMethodTracker();x&&(x[`${r.id}`]=Object.assign(Object.assign({},r),{id:`${r.id}`,timestamp:Date.now()}))}const v=encodeURI(b),A=`${e.useDeeplink?$r:Dr}?${b}`;if(e.qrcodeLink=A,e.developerMode&&V(`[RemoteConnection: startConnection()] qrcodeLink=${v}`),q.emit("display_uri",A),Me.analytics.track("sdk_connection_initiated",{transport_type:"websocket"}),(K=e.platformManager)===null||K===void 0?void 0:K.isSecure()){const x=setTimeout(()=>{Me.analytics.track("sdk_connection_failed",{transport_type:"websocket"})},6e4);return yield function(T,L){var $,H;return Z(this,void 0,void 0,function*(){const z=`${Dr}?${L}`,J=`${$r}?${L}`;(H=($=T.platformManager)===null||$===void 0?void 0:$.openDeeplink)===null||H===void 0||H.call($,z,J,"_self")})}(e,v),new Promise((T,L)=>{var $,H,z;if(!(($=e.connector)===null||$===void 0)&&$.isAuthorized())return clearTimeout(x),void T();(H=e.connector)===null||H===void 0||H.once(te.AUTHORIZED,()=>{clearTimeout(x),T()}),(z=e.connector)===null||z===void 0||z.once(te.REJECTED,()=>{clearTimeout(x),L(te.REJECTED)})})}return dg(e,t,v)}catch(q){throw console.error("[startConnection] error",q),q}})}class hg{constructor(t){var n,r,i;this.state={connector:void 0,qrcodeLink:void 0,analytics:void 0,developerMode:!1,authorized:!1,reconnection:!1,preferDesktop:!1,deeplinkProtocol:!1,listeners:[],communicationLayerPreference:void 0,platformManager:void 0,pendingModal:void 0,installModal:void 0,otpAnswer:void 0},this.options=t;const o=((n=t.logging)===null||n===void 0?void 0:n.developerMode)===!0||((r=t.logging)===null||r===void 0?void 0:r.sdk)===!0;this.state.developerMode=o,this.state.analytics=t.analytics,this.state.preferDesktop=(i=t.preferDesktop)!==null&&i!==void 0&&i,this.state.useDeeplink=t.sdk.options.useDeeplink,this.state.communicationLayerPreference=t.communicationLayerPreference,this.state.platformManager=t.platformManager,t.modals.install||(t.modals.install=lg),t.modals.otp||(t.modals.otp=ug)}startConnection(t){return Z(this,void 0,void 0,function*(){return fg(this.state,this.options,t)})}initRemoteCommunication({sdkInstance:t}){var n,r,i;return Z(this,void 0,void 0,function*(){const o=yield(r=(n=t.options.storage)===null||n===void 0?void 0:n.storageManager)===null||r===void 0?void 0:r.getPersistedChannelConfig();if(!this.options.ecies){const c={privateKey:o==null?void 0:o.localKey};this.options.ecies=c}Df(this.state,this.options),yield(i=this.getConnector())===null||i===void 0?void 0:i.initFromDappStorage(),$f(this.state,this.options)})}showActiveModal(){return function(t){var n,r,i,o;t.authorized?V("[RemoteConnection: showActiveModal()] already authorized"):t.pendingModal?(r=(n=t.pendingModal).mount)===null||r===void 0||r.call(n):t.installModal&&((o=(i=t.installModal).mount)===null||o===void 0||o.call(i,t.qrcodeLink||""))}(this.state)}closeModal(){var t,n,r,i;(n=(t=this.state.pendingModal)===null||t===void 0?void 0:t.unmount)===null||n===void 0||n.call(t),(i=(r=this.state.installModal)===null||r===void 0?void 0:r.unmount)===null||i===void 0||i.call(r,!1)}getUniversalLink(){if(!this.state.qrcodeLink)throw new Error("connection not started. run startConnection() first.");return this.state.qrcodeLink}getChannelConfig(){var t;return(t=this.state.connector)===null||t===void 0?void 0:t.getChannelConfig()}getKeyInfo(){var t;return(t=this.state.connector)===null||t===void 0?void 0:t.getKeyInfo()}getConnector(){if(!this.state.connector)throw new Error("invalid remote connector");return this.state.connector}getPlatformManager(){if(!this.state.platformManager)throw new Error("PlatformManager not available");return this.state.platformManager}isConnected(){var t;return((t=this.state.connector)===null||t===void 0?void 0:t.isReady())||!1}isAuthorized(){var t;return((t=this.state.connector)===null||t===void 0?void 0:t.isAuthorized())||!1}isPaused(){var t;return(t=this.state.connector)===null||t===void 0?void 0:t.isPaused()}disconnect(t){var n,r,i;V("[RemoteConnection: disconnect()]",t),t!=null&&t.terminate&&(Et.getProvider().handleDisconnect({terminate:!0}),(r=(n=this.state.pendingModal)===null||n===void 0?void 0:n.unmount)===null||r===void 0||r.call(n),this.state.otpAnswer=void 0),(i=this.state.connector)===null||i===void 0||i.disconnect(t),function(o){V("[RemoteConnection: cleanupConnector()] cleaning up connector"),o.connector&&(Ks(o),o.connector.disconnect({terminate:!0}).catch(c=>{V("[RemoteConnection: cleanupConnector()] error disconnecting connector",c)}))}(this.state)}}function pg(e){var t,n,r,i,o,c,s,a,l,u,d;return Z(this,void 0,void 0,function*(){const{options:f}=e;if(f.logging=(t=f.logging)!==null&&t!==void 0?t:{},f.communicationLayerPreference=(n=f.communicationLayerPreference)!==null&&n!==void 0?n:In.SOCKET,f.enableDebug!==void 0&&(Ge.enable("MM_SDK"),console.warn("enableDebug is removed. Please use enableAnalytics instead.")),f.enableAnalytics=(r=f.enableAnalytics)===null||r===void 0||r,f.injectProvider=(i=f.injectProvider)===null||i===void 0||i,f.shouldShimWeb3=(o=f.shouldShimWeb3)===null||o===void 0||o,f.extensionOnly=(c=f.extensionOnly)===null||c===void 0||c,f.useDeeplink=(s=f.useDeeplink)===null||s===void 0||s,f.storage=(a=f.storage)!==null&&a!==void 0?a:{enabled:!0},f.headless){Ge("[MetaMaskSDK: performSDKInitialization()] headless mode enabled");const S=()=>{},_={install:()=>({mount:S,unmount:S})},P={installer:S};f.modals=_,f.ui=P}const h=((l=f.logging)===null||l===void 0?void 0:l.developerMode)===!0;e.debug=((u=f.logging)===null||u===void 0?void 0:u.sdk)||h,V("[MetaMaskSDK: performSDKInitialization()] options",e.options);const g=Object.assign({},f.logging);h&&(g.sdk=!0,g.eciesLayer=!0,g.keyExchangeLayer=!0,g.remoteLayer=!0,g.serviceLayer=!0,g.plaintext=!0),yield function(S){var _;return Z(this,void 0,void 0,function*(){const{options:P}=S;S.platformManager=new Lr({useDeepLink:(_=P.useDeeplink)!==null&&_!==void 0&&_,preferredOpenLink:P.openDeeplink,debug:S.debug})})}(e),yield function(S){var _,P,O,K,q;return Z(this,void 0,void 0,function*(){const{options:F}=S,U=(_=S.platformManager)===null||_===void 0?void 0:_.getPlatformType();S.analytics=new Xm({serverUrl:(P=F.communicationServerUrl)!==null&&P!==void 0?P:er,enabled:F.enableAnalytics,originatorInfo:{url:(O=F.dappMetadata.url)!==null&&O!==void 0?O:"",title:(K=F.dappMetadata.name)!==null&&K!==void 0?K:"",dappId:S.getDappId(),platform:U??"",source:(q=F._source)!==null&&q!==void 0?q:"",anonId:""}})})}(e),yield function(S){var _,P,O;return Z(this,void 0,void 0,function*(){if(!S.options.enableAnalytics||!(!((_=S.platformManager)===null||_===void 0)&&_.isBrowser())&&!(!((P=S.platformManager)===null||P===void 0)&&P.isReactNative()))return;const K=S.getVersion(),q=S.getDappId(),F=yield S.getAnonId(),U=(O=S.platformManager)===null||O===void 0?void 0:O.getPlatformType(),j=S.options._source;Me.analytics.setGlobalProperty("sdk_version",K),Me.analytics.setGlobalProperty("dapp_id",q),Me.analytics.setGlobalProperty("anon_id",F),Me.analytics.setGlobalProperty("platform",U),Me.analytics.setGlobalProperty("integration_type",j),Me.analytics.enable(),Me.analytics.track("sdk_initialized",{})})}(e),yield function(S){var _;return Z(this,void 0,void 0,function*(){const{options:P}=S;((_=P.storage)===null||_===void 0?void 0:_.enabled)!==!0||P.storage.storageManager||(P.storage.storageManager=yield Pf(P.storage))})}(e),yield function(S){return Z(this,void 0,void 0,function*(){const{options:_}=S,P=/^(http|https):\/\/[^\s]*$/;if(_.dappMetadata){_.dappMetadata.iconUrl&&!P.test(_.dappMetadata.iconUrl)&&(console.warn("Invalid dappMetadata.iconUrl: URL must start with http:// or https://"),_.dappMetadata.iconUrl=void 0),_.dappMetadata.base64Icon&&_.dappMetadata.base64Icon.length>eg&&(console.warn("Invalid dappMetadata.base64Icon: Base64-encoded icon string length must be less than 163400 characters"),_.dappMetadata.base64Icon=void 0),_.dappMetadata.url&&!P.test(_.dappMetadata.url)&&console.warn("Invalid dappMetadata.url: URL must start with http:// or https://");const O=Qm();if(O&&!_.dappMetadata.iconUrl&&!_.dappMetadata.base64Icon){const K=`${window.location.protocol}//${window.location.host}${O}`;_.dappMetadata.iconUrl=K}}S.dappMetadata=_.dappMetadata})}(e),yield ng(e),yield rg(e);const{metamaskBrowserExtension:m,preferExtension:w,shouldReturn:p}=yield function(S){var _,P,O,K;return Z(this,void 0,void 0,function*(){const{options:q}=S;let F,U=!1,j=!1;if(typeof window<"u"&&window.ethereum&&!(!((_=S.platformManager)===null||_===void 0)&&_.isMetaMaskMobileWebView())){U=localStorage.getItem(eo)==="extension";try{F=yield tg({mustBeMetaMask:!0,sdkInstance:S}),window.extension=F,F.on(St.CHAIN_CHANGED,G=>{V(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE chainChanged chainId=${G}`),S.sdkProvider&&S.getMobileProvider().emit(St.CHAIN_CHANGED,G)}),F.on(St.ACCOUNTS_CHANGED,G=>Z(this,void 0,void 0,function*(){var B;V(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE accountsChanged accounts=${G}`);const N=!!S.sdkProvider,I=!!S.extensionActive;if(N&&S.getMobileProvider().emit(St.ACCOUNTS_CHANGED,G),I&&(G==null?void 0:G.length)===0&&(yield(B=S.getProvider())===null||B===void 0?void 0:B.request({method:ue.WALLET_GETPERMISSIONS,params:[]})).length===0)try{yield S.terminate()}catch(C){V("[MetaMaskSDK: setupExtensionPreferences()] error terminating on permissions revoked",C)}})),F.on(St.DISCONNECT,G=>{V(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE disconnect error=${G}`),S.sdkProvider&&S.getMobileProvider().emit(St.DISCONNECT,G)}),F.on(St.CONNECT,G=>{V(`[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connect args=${G}`),S.sdkProvider&&S.getMobileProvider().emit(St.CONNECT,G)}),F.on(St.CONNECTED,G=>{V("[MetaMaskSDK: setupExtensionPreferences()] PROPAGATE connected",G),S.sdkProvider&&S.getMobileProvider().emit(St.CONNECTED,G)})}catch{window.extension=void 0}}else!((P=S.platformManager)===null||P===void 0)&&P.isMetaMaskMobileWebView()&&((O=S.analytics)===null||O===void 0||O.send({event:Te.SDK_USE_INAPP_BROWSER}),S.activeProvider=Lf({provider:window.ethereum,sdkInstance:S}),S._initialized=!0,j=!0);return F&&q.extensionOnly&&(V("[MetaMaskSDK: setupExtensionPreferences()] EXTENSION ONLY --- prevent sdk initialization"),(K=S.analytics)===null||K===void 0||K.send({event:Te.SDK_USE_EXTENSION}),S.activeProvider=F,S.extensionActive=!0,S.extension=F,S._initialized=!0,j=!0),{preferExtension:U,shouldReturn:j,metamaskBrowserExtension:F}})}(e);if(p)V("[MetaMaskSDK: performSDKInitialization()] shouldReturn=true --- prevent sdk initialization");else{yield function(S,_){var P,O,K,q,F;return Z(this,void 0,void 0,function*(){const{options:U}=S,j=Object.assign({},U.logging);S.remoteConnection=new hg({anonId:yield S.getAnonId(),preferDesktop:(P=U.preferDesktop)!==null&&P!==void 0&&P,communicationLayerPreference:(O=U.communicationLayerPreference)!==null&&O!==void 0?O:In.SOCKET,analytics:S.analytics,dappMetadata:U.dappMetadata,_source:U._source,enableAnalytics:(K=U.enableAnalytics)===null||K===void 0||K,timer:U.timer,sdk:S,platformManager:S.platformManager,transports:U.transports,communicationServerUrl:U.communicationServerUrl,storage:(q=U.storage)!==null&&q!==void 0?q:{enabled:!0},getMetaMaskInstaller:()=>{if(!S.installer)throw new Error("Invalid SDK status -- installer not initialized");return S.installer},logging:j,connectWithExtensionProvider:_===void 0?void 0:()=>wl(S),modals:Object.assign(Object.assign({},U.modals),{onPendingModalDisconnect:S.terminate.bind(S)})}),yield S.remoteConnection.initRemoteCommunication({sdkInstance:S}),S.installer=new cg({remote:S.remoteConnection,preferDesktop:(F=U.preferDesktop)!==null&&F!==void 0&&F,platformManager:S.platformManager,debug:S.debug})})}(e,m),yield Zm(e),yield function(S,_){var P,O;return Z(this,void 0,void 0,function*(){const{options:K}=S;_?(V("[MetaMaskSDK: handleAutoAndExtensionConnections()] preferExtension is detected -- connect with it."),(P=S.analytics)===null||P===void 0||P.send({event:Te.SDK_EXTENSION_UTILIZED}),wl(S).catch(q=>{console.warn("Can't connect with MetaMask extension...",q),localStorage.removeItem(eo)})):K.checkInstallationImmediately&&(!((O=S.platformManager)===null||O===void 0)&&O.isDesktopWeb()?(V("[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately"),S.connect().catch(q=>{V(`[MetaMaskSDK: handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- error on autoconnect _err=${q}`)})):console.warn("[handleAutoAndExtensionConnections()] checkInstallationImmediately --- IGNORED --- only for web desktop")),S._initialized=!0})}(e,w);try{yield(d=e.remoteConnection)===null||d===void 0?void 0:d.startConnection({initialCheck:!0})}catch(S){console.error("[MetaMaskSDK: setupRemoteConnectionAndInstaller()] Error while checking installation",S)}e.emit(Qe.ProviderUpdate,Lt.INITIALIZED)}})}class ry extends qh{constructor(t={storage:{enabled:!0},injectProvider:!0,forceInjectProvider:!1,enableAnalytics:!0,shouldShimWeb3:!0,useDeeplink:!0,extensionOnly:!0,headless:!1,dappMetadata:{name:"",url:"",iconUrl:""},_source:vl,i18nOptions:{enabled:!1}}){var n,r,i;super(),this.extensionActive=!1,this._initialized=!1,this.sdkInitPromise=void 0,this.debug=!1,this.readonlyRPCCalls=!1,this.availableLanguages=["en"],this.ANON_ID_STORAGE_KEY="mm-sdk-anon-id",Ge.disable();const o=((n=t.logging)===null||n===void 0?void 0:n.developerMode)===!0;if((!((r=t.logging)===null||r===void 0)&&r.sdk||o)&&Ge.enable("MM_SDK"),V("[MetaMaskSDK: constructor()]: begin."),this.setMaxListeners(50),!(!((i=t.dappMetadata)===null||i===void 0)&&i.url)){if(typeof window>"u"||typeof document>"u")throw new Error("You must provide dAppMetadata url");t.dappMetadata=Object.assign(Object.assign({},t.dappMetadata),{url:`${window.location.protocol}//${window.location.host}`})}this.options=t,this.options._source||(t._source=vl),this.init().then(()=>{V("[MetaMaskSDK: constructor()]: initialized successfully."),typeof window<"u"&&(window.mmsdk=this)}).catch(c=>{console.error("[MetaMaskSDK: constructor()] error during initialization",c)})}init(){return Z(this,void 0,void 0,function*(){return function(t){var n;return Z(this,void 0,void 0,function*(){if(typeof window<"u"&&(!((n=window.mmsdk)===null||n===void 0)&&n.isInitialized()))return V("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),Promise.resolve(window.mmsdk);if(t._initialized)return V("[MetaMaskSDK: initializeMetaMaskSDK()] already initialized"),t.sdkInitPromise;if(t.sdkInitPromise)return V("[MetaMaskSDK: initializeMetaMaskSDK()] already initializing"),t.sdkInitPromise;try{t.sdkInitPromise=pg(t),yield t.sdkInitPromise}catch(r){throw console.error(r),r}return t.sdkInitPromise})}(this)})}isExtensionActive(){return this.extensionActive}checkExtensionAvailability(){var t;return typeof window<"u"&&!!(!((t=window.ethereum)===null||t===void 0)&&t.isMetaMask)}connect(){return Z(this,void 0,void 0,function*(){return function(t){return Z(this,void 0,void 0,function*(){if(t._initialized||(V("[MetaMaskSDK: connect()] provider not ready -- wait for init()"),yield t.init()),V(`[MetaMaskSDK: connect()] isExtensionActive=${t.isExtensionActive()} activeProvider`,t.activeProvider),!t.activeProvider)throw new Error("SDK state invalid -- undefined provider");const n=t.activeProvider.getSelectedAddress();return n?[n]:t.activeProvider.request({method:ue.ETH_REQUESTACCOUNTS,params:[]})})}(this)})}connectAndSign({msg:t}){return Z(this,void 0,void 0,function*(){return Wm({instance:this,msg:t})})}connectWith(t){return Z(this,void 0,void 0,function*(){return function({instance:n,rpc:r}){return Z(this,void 0,void 0,function*(){if(n._initialized||(V("[MetaMaskSDK: connectWith()] provider not ready -- wait for init()"),yield n.init()),V(`[MetaMaskSDK: connectWith()] method: ${r.method} rpc=${r}`),!n.activeProvider)throw new Error("SDK state invalid -- undefined provider");return n.activeProvider.request({method:ue.METAMASK_CONNECTWITH,params:[r]})})}({instance:this,rpc:t})})}resume(){return function(t){var n,r,i;return Z(this,void 0,void 0,function*(){if(!(!((r=(n=t.remoteConnection)===null||n===void 0?void 0:n.getConnector())===null||r===void 0)&&r.isReady()))return V("[MetaMaskSDK: resume()] channel is not ready -- starting connection"),void((i=t.remoteConnection)===null||i===void 0||i.startConnection());V("[MetaMaskSDK: resume()] channel is ready")})}(this)}disconnect(){return console.warn("MetaMaskSDK.disconnect() is deprecated, use terminate()"),this.terminate()}isAuthorized(){var t;(t=this.remoteConnection)===null||t===void 0||t.isAuthorized()}terminate(){return function(t){var n,r,i;return Z(this,void 0,void 0,function*(){if(!(!((n=t.platformManager)===null||n===void 0)&&n.isMetaMaskMobileWebView())){if(qm&&(window.localStorage.removeItem(eo),window.localStorage.removeItem(Bs),window.localStorage.removeItem($s)),t.extensionActive){try{yield(r=t.activeProvider)===null||r===void 0?void 0:r.request({method:ue.WALLET_REVOKEPERMISSIONS,params:[{eth_accounts:{}}]})}catch(o){V("[MetaMaskSDK: terminate()] error revoking permissions",o)}return t.options.extensionOnly?(t.emit(Qe.ProviderUpdate,Lt.TERMINATE),void V("[MetaMaskSDK: terminate()] extensionOnly --- prevent switching providers")):(t.activeProvider=t.sdkProvider,window.ethereum=t.activeProvider,t.extensionActive=!1,void t.emit(Qe.ProviderUpdate,Lt.TERMINATE))}t.emit(Qe.ProviderUpdate,Lt.TERMINATE),V(`[MetaMaskSDK: terminate()] remoteConnection=${t.remoteConnection}`),(i=t.remoteConnection)===null||i===void 0||i.disconnect({terminate:!0,sendMessage:!0})}})}(this)}isInitialized(){return this._initialized}setReadOnlyRPCCalls(t){this.readonlyRPCCalls=t}hasReadOnlyRPCCalls(){return this.readonlyRPCCalls}getProvider(){if(this.activeProvider)return this.activeProvider;console.warn("MetaMaskSDK: No active provider found")}getMobileProvider(){if(!this.sdkProvider)throw new Error("SDK state invalid -- undefined mobile provider");return this.sdkProvider}getUniversalLink(){var t;const n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getUniversalLink();if(!n)throw new Error("No Universal Link available, please call eth_requestAccounts first.");return n}getChannelId(){var t,n;return(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getChannelConfig())===null||n===void 0?void 0:n.channelId}getRPCHistory(){var t,n;return(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getConnector())===null||n===void 0?void 0:n.getRPCMethodTracker()}getVersion(){return Nn.version}getDappId(){var t,n,r,i;return typeof window>"u"||window.location===void 0?(i=(n=(t=this.options.dappMetadata)===null||t===void 0?void 0:t.name)!==null&&n!==void 0?n:(r=this.options.dappMetadata)===null||r===void 0?void 0:r.url)!==null&&i!==void 0?i:"N/A":window.location.hostname}getAnonId(){var t,n;return Z(this,void 0,void 0,function*(){if(this._anonId)return this._anonId;let r;return r=!((t=this.platformManager)===null||t===void 0)&&t.isBrowser()?this.getBrowserAnonId():!((n=this.platformManager)===null||n===void 0)&&n.isReactNative()?yield this.getReactNativeAnonId():dn(),this._anonId=r,r})}getBrowserAnonId(){const t=this.ANON_ID_STORAGE_KEY;try{const n=localStorage.getItem(t);if(n)return n;const r=dn();return localStorage.setItem(t,r),r}catch(n){return console.error("[MetaMaskSDK: getBrowserAnonId()] LocalStorage access error:",n),dn()}}getReactNativeAnonId(){return Z(this,void 0,void 0,function*(){const t=this.ANON_ID_STORAGE_KEY;try{const n=require("@react-native-async-storage/async-storage").default,r=yield n.getItem(t);if(r)return r;const i=dn();return yield n.setItem(t,i),i}catch(n){return console.error("[MetaMaskSDK: getReactNativeAnonId()] Error accessing AsyncStorage:",n),dn()}})}getWalletStatus(){var t,n;return(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getConnector())===null||n===void 0?void 0:n.getConnectionStatus()}_getChannelConfig(){var t;return(t=this.remoteConnection)===null||t===void 0?void 0:t.getChannelConfig()}_ping(){var t,n;(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getConnector())===null||n===void 0||n.ping()}_keyCheck(){var t,n;(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getConnector())===null||n===void 0||n.keyCheck()}_getServiceStatus(){var t,n;return(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getConnector())===null||n===void 0?void 0:n.getServiceStatus()}_getRemoteConnection(){return this.remoteConnection}_getDappMetadata(){return this.dappMetadata}_getKeyInfo(){var t;return(t=this.remoteConnection)===null||t===void 0?void 0:t.getKeyInfo()}_resetKeys(){var t,n;(n=(t=this.remoteConnection)===null||t===void 0?void 0:t.getConnector())===null||n===void 0||n.resetKeys()}_getConnection(){return this.remoteConnection}emit(t,n){return super.emit(t,n)}on(t,n){return super.on(t,n)}}var mg=Object.freeze({__proto__:null,StorageManagerWeb:class{constructor({enabled:e}={enabled:!1}){this.enabled=!1,this.enabled=e}persistChannelConfig(e){return Z(this,void 0,void 0,function*(){const t=JSON.stringify(e);V(`[StorageManagerWeb: persistChannelConfig()] enabled=${this.enabled}`,e),localStorage.setItem(rs,t)})}getPersistedChannelConfig(){return Z(this,void 0,void 0,function*(){let e;try{if(V(`[StorageManagerWeb: getPersistedChannelConfig()] enabled=${this.enabled}`),e=localStorage.getItem(rs),V("[StorageManagerWeb: getPersistedChannelConfig()]",e),!e)return;const t=JSON.parse(e);return V("[StorageManagerWeb: getPersistedChannelConfig()] channelConfig",t),t}catch(t){return void console.error("[StorageManagerWeb: getPersistedChannelConfig()] Can't find existing channel config",t)}})}persistAccounts(e){return Z(this,void 0,void 0,function*(){V(`[StorageManagerWeb: persistAccounts()] enabled=${this.enabled}`,e);const t=JSON.stringify(e);localStorage.setItem($s,t)})}getCachedAccounts(){return Z(this,void 0,void 0,function*(){try{const e=localStorage.getItem($s);return e?JSON.parse(e):[]}catch(e){throw console.error("[StorageManagerWeb: getCachedAccounts()] Error reading cached accounts",e),e}})}persistChainId(e){return Z(this,void 0,void 0,function*(){V(`[StorageManagerWeb: persistChainId()] enabled=${this.enabled}`,e),localStorage.setItem(Bs,e)})}getCachedChainId(){return Z(this,void 0,void 0,function*(){try{const e=localStorage.getItem(Bs);return e??void 0}catch(e){throw console.error("[StorageManagerWeb: getCachedChainId()] Error reading cached chainId",e),e}})}terminate(){return Z(this,void 0,void 0,function*(){V(`[StorageManagerWeb: terminate()] enabled=${this.enabled}`),localStorage.removeItem(rs)})}}});const gg="hydrated",yg=!1,vg=!0;var bg=Object.defineProperty,Ea=new WeakMap,mn=e=>Ea.get(e),_a=(e,t)=>Ea.set(t.$lazyInstance$=e,t),Il=(e,t)=>t in e,Tn=(e,t)=>(0,console.error)(e,t),is=new Map,Ii=new Map,Bf="slot-fb{display:contents}slot-fb[hidden]{display:none}",po=typeof window<"u"?window:{},Rt=po.document||{head:{}},$e={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,r)=>e.addEventListener(t,n,r),rel:(e,t,n,r)=>e.removeEventListener(t,n,r),ce:(e,t)=>new CustomEvent(e,t)},Kf=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),js=!1,Pl=[],jf=[],wg=(e,t)=>n=>{e.push(n),js||(js=!0,4&$e.$flags$?Sa(Us):$e.raf(Us))},Rl=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(n){Tn(n)}e.length=0},Us=()=>{Rl(Pl),Rl(jf),(js=Pl.length>0)&&$e.raf(Us)},Sa=e=>(t=>Promise.resolve(t))().then(e),Eg=wg(jf),Ol={},Ca=e=>(e=typeof e)=="object"||e==="function";function Uf(e){var t,n,r;return(r=(n=(t=e.head)==null?void 0:t.querySelector('meta[name="csp-nonce"]'))==null?void 0:n.getAttribute("content"))!=null?r:void 0}((e,t)=>{for(var n in t)bg(e,n,{get:t[n],enumerable:!0})})({},{err:()=>Hf,map:()=>_g,ok:()=>Hs,unwrap:()=>Sg,unwrapErr:()=>Cg});var Hs=e=>({isOk:!0,isErr:!1,value:e}),Hf=e=>({isOk:!1,isErr:!0,value:e});function _g(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then(r=>Hs(r)):Hs(n)}if(e.isErr){const n=e.value;return Hf(n)}throw"should never get here"}var Aa,Sg=e=>{if(e.isOk)return e.value;throw e.value},Cg=e=>{if(e.isErr)return e.value;throw e.value},Y=(e,t,...n)=>{let r=null,i=!1,o=!1;const c=[],s=l=>{for(let u=0;u<l.length;u++)r=l[u],Array.isArray(r)?s(r):r!=null&&typeof r!="boolean"&&((i=typeof e!="function"&&!Ca(r))&&(r=String(r)),i&&o?c[c.length-1].$text$+=r:c.push(i?ro(null,r):r),o=i)};if(s(n),t){const l=t.className||t.class;l&&(t.class=typeof l!="object"?l:Object.keys(l).filter(u=>l[u]).join(" "))}if(typeof e=="function")return e(t===null?{}:t,c,kg);const a=ro(e,null);return a.$attrs$=t,c.length>0&&(a.$children$=c),a},ro=(e,t)=>({$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null}),Ag={},kg={forEach:(e,t)=>e.map(Ll).forEach(t),map:(e,t)=>e.map(Ll).map(t).map(xg)},Ll=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),xg=e=>{if(typeof e.vtag=="function"){const n={...e.vattrs};return e.vkey&&(n.key=e.vkey),e.vname&&(n.name=e.vname),Y(e.vtag,n,...e.vchildren||[])}const t=ro(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},mo=e=>mn(e).$hostElement$,yn=(e,t,n)=>{const r=mo(e);return{emit:i=>Ff(r,t,{bubbles:!0,composed:!0,cancelable:!0,detail:i})}},Ff=(e,t,n)=>{const r=$e.ce(t,n);return e.dispatchEvent(r),r},Nl=new WeakMap,Mg=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,r=t.$flags$;t.$tagName$;const i=((o,c,s)=>{var a;const l=zf(c),u=Ii.get(l);if(o=o.nodeType===11?o:Rt,u)if(typeof u=="string"){o=o.head||o;let d,f=Nl.get(o);if(f||Nl.set(o,f=new Set),!f.has(l)){{d=Rt.createElement("style"),d.innerHTML=u;const h=(a=$e.$nonce$)!=null?a:Uf(Rt);if(h!=null&&d.setAttribute("nonce",h),!(1&c.$flags$))if(o.nodeName==="HEAD"){const g=o.querySelectorAll("link[rel=preconnect]"),m=g.length>0?g[g.length-1].nextSibling:o.querySelector("style");o.insertBefore(d,m)}else if("host"in o)if(Kf){const g=new CSSStyleSheet;g.replaceSync(u),o.adoptedStyleSheets=[g,...o.adoptedStyleSheets]}else{const g=o.querySelector("style");g?g.innerHTML=u+g.innerHTML:o.prepend(d)}else o.append(d);1&c.$flags$&&o.nodeName!=="HEAD"&&o.insertBefore(d,null)}4&c.$flags$&&(d.innerHTML+=Bf),f&&f.add(l)}}else o.adoptedStyleSheets.includes(u)||(o.adoptedStyleSheets=[...o.adoptedStyleSheets,u]);return l})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&r&&2&r&&(n["s-sc"]=i,n.classList.add(i+"-h"))},zf=(e,t)=>"sc-"+e.$tagName$,Dl=(e,t,n,r,i,o)=>{if(n!==r){let c=Il(e,t),s=t.toLowerCase();if(t==="class"){const a=e.classList,l=$l(n),u=$l(r);a.remove(...l.filter(d=>d&&!u.includes(d))),a.add(...u.filter(d=>d&&!l.includes(d)))}else if(t==="style"){for(const a in n)r&&r[a]!=null||(a.includes("-")?e.style.removeProperty(a):e.style[a]="");for(const a in r)n&&r[a]===n[a]||(a.includes("-")?e.style.setProperty(a,r[a]):e.style[a]=r[a])}else if(c||t[0]!=="o"||t[1]!=="n"){const a=Ca(r);if((c||a&&r!==null)&&!i)try{if(e.tagName.includes("-"))e[t]=r;else{const l=r??"";t==="list"?c=!1:n!=null&&e[t]==l||(typeof e.__lookupSetter__(t)=="function"?e[t]=l:e.setAttribute(t,l))}}catch{}r==null||r===!1?r===!1&&e.getAttribute(t)!==""||e.removeAttribute(t):(!c||4&o||i)&&!a&&(r=r===!0?"":r,e.setAttribute(t,r))}else if(t=t[2]==="-"?t.slice(3):Il(po,s)?s.slice(2):s[2]+t.slice(3),n||r){const a=t.endsWith(qf);t=t.replace(Ig,""),n&&$e.rel(e,t,n,a),r&&$e.ael(e,t,r,a)}}},Tg=/\s/,$l=e=>e?e.split(Tg):[],qf="Capture",Ig=new RegExp(qf+"$"),Wf=(e,t,n)=>{const r=t.$elm$.nodeType===11&&t.$elm$.host?t.$elm$.host:t.$elm$,i=e&&e.$attrs$||Ol,o=t.$attrs$||Ol;for(const c of Bl(Object.keys(i)))c in o||Dl(r,c,i[c],void 0,n,t.$flags$);for(const c of Bl(Object.keys(o)))Dl(r,c,i[c],o[c],n,t.$flags$)};function Bl(e){return e.includes("ref")?[...e.filter(t=>t!=="ref"),"ref"]:e}var mt=!1,ka=(e,t,n,r)=>{const i=t.$children$[n];let o,c,s=0;if(i.$text$!==null)o=i.$elm$=Rt.createTextNode(i.$text$);else{if(mt||(mt=i.$tag$==="svg"),o=i.$elm$=Rt.createElementNS(mt?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i.$tag$),mt&&i.$tag$==="foreignObject"&&(mt=!1),Wf(null,i,mt),o.getRootNode().querySelector("body"),i.$children$)for(s=0;s<i.$children$.length;++s)c=ka(e,i,s),c&&o.appendChild(c);i.$tag$==="svg"?mt=!1:o.tagName==="foreignObject"&&(mt=!0)}return o["s-hn"]=Aa,o},Kl=(e,t,n,r,i,o)=>{let c,s=e;for(s.shadowRoot&&s.tagName===Aa&&(s=s.shadowRoot);i<=o;++i)r[i]&&(c=ka(null,n,i),c&&(r[i].$elm$=c,Pi(s,c,t)))},jl=(e,t,n)=>{for(let r=t;r<=n;++r){const i=e[r];if(i){const o=i.$elm$;o&&o.remove()}}},pi=(e,t,n=!1)=>e.$tag$===t.$tag$,mr=(e,t,n=!1)=>{const r=t.$elm$=e.$elm$,i=e.$children$,o=t.$children$,c=t.$tag$,s=t.$text$;s===null?(Wf(e,t,mt=c==="svg"||c!=="foreignObject"&&mt),i!==null&&o!==null?((a,l,u,d,f=!1)=>{let h,g=0,m=0,w=l.length-1,p=l[0],S=l[w],_=d.length-1,P=d[0],O=d[_];for(;g<=w&&m<=_;)p==null?p=l[++g]:S==null?S=l[--w]:P==null?P=d[++m]:O==null?O=d[--_]:pi(p,P,f)?(mr(p,P,f),p=l[++g],P=d[++m]):pi(S,O,f)?(mr(S,O,f),S=l[--w],O=d[--_]):pi(p,O,f)?(mr(p,O,f),Pi(a,p.$elm$,S.$elm$.nextSibling),p=l[++g],O=d[--_]):pi(S,P,f)?(mr(S,P,f),Pi(a,S.$elm$,p.$elm$),S=l[--w],P=d[++m]):(h=ka(l&&l[m],u,m),P=d[++m],h&&Pi(p.$elm$.parentNode,h,p.$elm$));g>w?Kl(a,d[_+1]==null?null:d[_+1].$elm$,u,d,m,_):m>_&&jl(l,g,w)})(r,i,t,o,n):o!==null?(e.$text$!==null&&(r.textContent=""),Kl(r,null,t,o,0,o.length-1)):!n&&vg&&i!==null&&jl(i,0,i.length-1),mt&&c==="svg"&&(mt=!1)):e.$text$!==s&&(r.data=s)},Pi=(e,t,n)=>e==null?void 0:e.insertBefore(t,n),Pg=(e,t,n=!1)=>{const r=e.$hostElement$,i=e.$cmpMeta$,o=e.$vnode$||ro(null,null),c=(s=t)&&s.$tag$===Ag?t:Y(null,null,t);var s;if(Aa=r.tagName,n&&c.$attrs$)for(const a of Object.keys(c.$attrs$))r.hasAttribute(a)&&!["key","ref","style","class"].includes(a)&&(c.$attrs$[a]=r[a]);c.$tag$=null,c.$flags$|=4,e.$vnode$=c,c.$elm$=o.$elm$=r.shadowRoot||r,r["s-sc"],1&i.$flags$,mr(o,c,n)},Vf=(e,t)=>{t&&!e.$onRenderResolve$&&t["s-p"]&&t["s-p"].push(new Promise(n=>e.$onRenderResolve$=n))},xa=(e,t)=>(e.$flags$|=16,4&e.$flags$?void(e.$flags$|=512):(Vf(e,e.$ancestorComponent$),Eg(()=>Rg(e,t)))),Rg=(e,t)=>{const n=e.$hostElement$;e.$cmpMeta$.$tagName$;const r=e.$lazyInstance$;if(!r)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);return Og(void 0,()=>Ng(e,r,t))},Og=(e,t)=>Lg(e)?e.then(t).catch(n=>{console.error(n),t()}):t(),Lg=e=>e instanceof Promise||e&&e.then&&typeof e.then=="function",Ng=async(e,t,n)=>{var r;const i=e.$hostElement$;e.$cmpMeta$.$tagName$;const o=i["s-rc"];n&&Mg(e),e.$cmpMeta$.$tagName$,Dg(e,t,i,n),o&&(o.map(c=>c()),i["s-rc"]=void 0);{const c=(r=i["s-p"])!=null?r:[],s=()=>$g(e);c.length===0?s():(Promise.all(c).then(s),e.$flags$|=4,c.length=0)}},Dg=(e,t,n,r)=>{try{t=t.render(),e.$flags$&=-17,e.$flags$|=2,Pg(e,t,r)}catch(i){Tn(i,e.$hostElement$)}return null},$g=e=>{e.$cmpMeta$.$tagName$;const t=e.$hostElement$,n=()=>{},r=e.$lazyInstance$,i=e.$ancestorComponent$;64&e.$flags$?n():(e.$flags$|=64,Yf(t),Ma(r,"componentDidLoad"),e.$onReadyResolve$(t),i||Gf()),e.$onRenderResolve$&&(e.$onRenderResolve$(),e.$onRenderResolve$=void 0),512&e.$flags$&&Sa(()=>xa(e,!1)),e.$flags$&=-517},Gf=e=>{Yf(Rt.documentElement),Sa(()=>Ff(po,"appload",{detail:{namespace:"sdk-install-modal-web"}}))},Ma=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(r){Tn(r)}},Yf=e=>{var t;return e.classList.add((t=gg)!=null?t:"hydrated")},Bg=(e,t,n,r)=>{const i=mn(e);if(!i)throw new Error(`Couldn't find host element for "${r.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const o=i.$hostElement$,c=i.$instanceValues$.get(t),s=i.$flags$,a=i.$lazyInstance$;var l,u;l=n,u=r.$members$[t][0],n=l==null||Ca(l)?l:4&u?l!=="false"&&(l===""||!!l):1&u?String(l):l;const d=Number.isNaN(c)&&Number.isNaN(n);if((!(8&s)||c===void 0)&&n!==c&&!d&&(i.$instanceValues$.set(t,n),a)){if(r.$watchers$&&128&s){const f=r.$watchers$[t];f&&f.map(h=>{try{a[h](n,c,t)}catch(g){Tn(g,o)}})}(18&s)==2&&xa(i,!1)}},Zf=(e,t,n)=>{var r,i;const o=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);const c=Object.entries((r=t.$members$)!=null?r:{});if(c.map(([s,[a]])=>{(31&a||2&n&&32&a)&&Object.defineProperty(o,s,{get(){return l=s,mn(this).$instanceValues$.get(l);var l},set(l){Bg(this,s,l,t)},configurable:!0,enumerable:!0})}),1&n){const s=new Map;o.attributeChangedCallback=function(a,l,u){$e.jmp(()=>{var d;const f=s.get(a);if(this.hasOwnProperty(f))u=this[f],delete this[f];else{if(o.hasOwnProperty(f)&&typeof this[f]=="number"&&this[f]==u)return;if(f==null){const h=mn(this),g=h==null?void 0:h.$flags$;if(g&&!(8&g)&&128&g&&u!==l){const m=h.$lazyInstance$,w=(d=t.$watchers$)==null?void 0:d[a];w==null||w.forEach(p=>{m[p]!=null&&m[p].call(m,u,l,a)})}return}}this[f]=(u!==null||typeof this[f]!="boolean")&&u})},e.observedAttributes=Array.from(new Set([...Object.keys((i=t.$watchers$)!=null?i:{}),...c.filter(([a,l])=>15&l[0]).map(([a,l])=>{const u=l[1]||a;return s.set(u,a),u})]))}}return e},Kg=async(e,t,n,r)=>{let i;if(!(32&t.$flags$)){if(t.$flags$|=32,n.$lazyBundleId$){const s=((a,l,u)=>{const d=a.$tagName$.replace(/-/g,"_"),f=a.$lazyBundleId$;if(!f)return;const h=is.get(f);if(h)return h[d];{const g=m=>(is.set(f,m),m[d]);if(f==="mm-install-modal_3")return Promise.resolve().then(function(){return ey}).then(g,Tn)}return dh(()=>import(`./${f}.entry.js`),[]).then(g=>(is.set(f,g),g[d]),Tn)})(n);if(s&&"then"in s?i=await s:i=s,!i)throw new Error(`Constructor for "${n.$tagName$}#${t.$modeName$}" was not found`);i.isProxied||(n.$watchers$=i.watchers,Zf(i,n,2),i.isProxied=!0),n.$tagName$,t.$flags$|=8;try{new i(t)}catch(a){Tn(a)}t.$flags$&=-9,t.$flags$|=128,Fs(t.$lazyInstance$)}else{i=e.constructor;const s=e.localName;customElements.whenDefined(s).then(()=>t.$flags$|=128)}if(i&&i.style){let s;typeof i.style=="string"&&(s=i.style);const a=zf(n);Ii.has(a)||(n.$tagName$,((l,u,d)=>{let f=Ii.get(l);Kf&&d?(f=f||new CSSStyleSheet,typeof f=="string"?f=u:f.replaceSync(u)):f=u,Ii.set(l,f)})(a,s,!!(1&n.$flags$)))}}const o=t.$ancestorComponent$,c=()=>xa(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()},Fs=e=>{Ma(e,"connectedCallback")},Ul=e=>{Ma(e,"disconnectedCallback")},jg=(e,t={})=>{var n;const r=[],i=t.exclude||[],o=po.customElements,c=Rt.head,s=c.querySelector("meta[charset]"),a=Rt.createElement("style"),l=[];let u,d=!0;Object.assign($e,t),$e.$resourcesUrl$=new URL(t.resourcesUrl||"./",Rt.baseURI).href;let f=!1;if(e.map(h=>{h[1].map(g=>{var m;const w={$flags$:g[0],$tagName$:g[1],$members$:g[2],$listeners$:g[3]};4&w.$flags$&&(f=!0),w.$members$=g[2],w.$watchers$=(m=g[4])!=null?m:{};const p=w.$tagName$,S=class extends HTMLElement{constructor(_){if(super(_),this.hasRegisteredEventListeners=!1,((P,O)=>{const K={$flags$:0,$hostElement$:P,$cmpMeta$:O,$instanceValues$:new Map};K.$onReadyPromise$=new Promise(q=>K.$onReadyResolve$=q),P["s-p"]=[],P["s-rc"]=[],Ea.set(P,K)})(_=this,w),1&w.$flags$)if(_.shadowRoot){if(_.shadowRoot.mode!=="open")throw new Error(`Unable to re-use existing shadow root for ${w.$tagName$}! Mode is set to ${_.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else _.attachShadow({mode:"open"})}connectedCallback(){mn(this),this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),u&&(clearTimeout(u),u=null),d?l.push(this):$e.jmp(()=>(_=>{if(!(1&$e.$flags$)){const P=mn(_),O=P.$cmpMeta$;if(O.$tagName$,1&P.$flags$)P!=null&&P.$lazyInstance$?Fs(P.$lazyInstance$):P!=null&&P.$onReadyPromise$&&P.$onReadyPromise$.then(()=>Fs(P.$lazyInstance$));else{P.$flags$|=1;{let K=_;for(;K=K.parentNode||K.host;)if(K["s-p"]){Vf(P,P.$ancestorComponent$=K);break}}O.$members$&&Object.entries(O.$members$).map(([K,[q]])=>{if(31&q&&_.hasOwnProperty(K)){const F=_[K];delete _[K],_[K]=F}}),Kg(_,P,O)}}})(this))}disconnectedCallback(){$e.jmp(()=>(async _=>{if(!(1&$e.$flags$)){const P=mn(_);P!=null&&P.$lazyInstance$?Ul(P.$lazyInstance$):P!=null&&P.$onReadyPromise$&&P.$onReadyPromise$.then(()=>Ul(P.$lazyInstance$))}})(this))}componentOnReady(){return mn(this).$onReadyPromise$}};w.$lazyBundleId$=h[0],i.includes(p)||o.get(p)||(r.push(p),o.define(p,Zf(S,w,1)))})}),r.length>0&&(f&&(a.textContent+=Bf),a.textContent+=r.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",a.innerHTML.length)){a.setAttribute("data-styles","");const h=(n=$e.$nonce$)!=null?n:Uf(Rt);h!=null&&a.setAttribute("nonce",h),c.insertBefore(a,s?s.nextSibling:c.firstChild)}d=!1,l.length?l.map(h=>h.connectedCallback()):$e.jmp(()=>u=setTimeout(Gf,30))};(function(){if(typeof window<"u"&&window.Reflect!==void 0&&window.customElements!==void 0){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}})();var Ug=Object.freeze({__proto__:null,defineCustomElements:async(e,t)=>{if(typeof window<"u")return await void 0,jg([["mm-install-modal_3",[[1,"mm-install-modal",{link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]},null,{preferDesktop:["updatePreferDesktop"]}],[1,"mm-pending-modal",{displayOTP:[4,"display-o-t-p"],sdkVersion:[1,"sdk-version"],otpCode:[1,"otp-code"],translationsLoaded:[32]}],[1,"mm-select-modal",{link:[1],sdkVersion:[1,"sdk-version"],preferDesktop:[4,"prefer-desktop"],tab:[32],isDefaultTab:[32],translationsLoaded:[32]},null,{preferDesktop:["updatePreferDesktop"]}]]]],t)},setNonce:e=>$e.$nonce$=e});const Hg={fontFamily:"Roboto, sans-serif"},Ta=({className:e},t)=>Y("div",{style:Hg,class:e},t),os=({Icon:e,text:t})=>Y("div",{class:"flexContainer",style:{padding:"6",flexDirection:"row"}},Y("div",{class:"flexItem1"},Y(e,null)),Y("div",{class:"flexItem11"},Y("span",{style:{lineHeight:"2",color:"black"}},t))),Fg=()=>Y("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("path",{d:"M20.0002 7.9702V10.0302C20.0002 10.5802 19.5602 11.0302 19.0002 11.0502H17.0402C15.9602 11.0502 14.9702 10.2602 14.8802 9.1802C14.8202 8.5502 15.0602 7.9602 15.4802 7.5502C15.8502 7.1702 16.3602 6.9502 16.9202 6.9502H19.0002C19.5602 6.9702 20.0002 7.4202 20.0002 7.9702Z",fill:"#037DD6"}),Y("path",{d:"M18.47 12.55H17.04C15.14 12.55 13.54 11.12 13.38 9.3C13.29 8.26 13.67 7.22 14.43 6.48C15.07 5.82 15.96 5.45 16.92 5.45H18.47C18.76 5.45 19 5.21 18.97 4.92C18.75 2.49 17.14 0.83 14.75 0.55C14.51 0.51 14.26 0.5 14 0.5H5C4.72 0.5 4.45 0.52 4.19 0.56C1.64 0.88 0 2.78 0 5.5V12.5C0 15.26 2.24 17.5 5 17.5H14C16.8 17.5 18.73 15.75 18.97 13.08C19 12.79 18.76 12.55 18.47 12.55ZM11 6.75H5C4.59 6.75 4.25 6.41 4.25 6C4.25 5.59 4.59 5.25 5 5.25H11C11.41 5.25 11.75 5.59 11.75 6C11.75 6.41 11.41 6.75 11 6.75Z",fill:"#037DD6"})),zg=()=>Y("svg",{width:"20",height:"18",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("path",{d:"M14.44 0.0999756C12.63 0.0999756 11.01 0.979976 10 2.32998C8.99 0.979976 7.37 0.0999756 5.56 0.0999756C2.49 0.0999756 0 2.59998 0 5.68998C0 6.87998 0.19 7.97998 0.52 8.99998C2.1 14 6.97 16.99 9.38 17.81C9.72 17.93 10.28 17.93 10.62 17.81C13.03 16.99 17.9 14 19.48 8.99998C19.81 7.97998 20 6.87998 20 5.68998C20 2.59998 17.51 0.0999756 14.44 0.0999756Z",fill:"#037DD6"})),qg=()=>Y("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("path",{d:"M16.28 7.53V6.28C16.28 3.58 15.63 0 10 0C4.37 0 3.72 3.58 3.72 6.28V7.53C0.92 7.88 0 9.3 0 12.79V14.65C0 18.75 1.25 20 5.35 20H14.65C18.75 20 20 18.75 20 14.65V12.79C20 9.3 19.08 7.88 16.28 7.53ZM10 16.74C8.33 16.74 6.98 15.38 6.98 13.72C6.98 12.05 8.34 10.7 10 10.7C11.66 10.7 13.02 12.06 13.02 13.72C13.02 15.39 11.67 16.74 10 16.74ZM5.35 7.44C5.27 7.44 5.2 7.44 5.12 7.44V6.28C5.12 3.35 5.95 1.4 10 1.4C14.05 1.4 14.88 3.35 14.88 6.28V7.45C14.8 7.45 14.73 7.45 14.65 7.45H5.35V7.44Z",fill:"#037DD6"})),Wg=()=>Y("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("path",{d:"M16.4405 8.8999C20.0405 9.2099 21.5105 11.0599 21.5105 15.1099V15.2399C21.5105 19.7099 19.7205 21.4999 15.2505 21.4999H8.74047C4.27047 21.4999 2.48047 19.7099 2.48047 15.2399V15.1099C2.48047 11.0899 3.93047 9.2399 7.47047 8.9099",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),Y("path",{d:"M12 2V14.88",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),Y("path",{d:"M15.3504 12.6499L12.0004 15.9999L8.65039 12.6499",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}));function Ia({version:e}){return Y("div",{style:{textAlign:"center",color:"#BBC0C5",fontSize:"12"}},"SDK Version ",e?`v${e}`:"unknown")}const Pa=()=>Y("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("rect",{width:"16",height:"16",fill:"white"}),Y("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.40554 2.40554C2.94627 1.86482 3.82296 1.86482 4.36369 2.40554L8 6.04186L11.6363 2.40554C12.177 1.86482 13.0537 1.86482 13.5945 2.40554C14.1352 2.94627 14.1352 3.82296 13.5945 4.36369L9.95814 8L13.5945 11.6363C14.1352 12.177 14.1352 13.0537 13.5945 13.5945C13.0537 14.1352 12.177 14.1352 11.6363 13.5945L8 9.95814L4.36369 13.5945C3.82296 14.1352 2.94627 14.1352 2.40554 13.5945C1.86482 13.0537 1.86482 12.177 2.40554 11.6363L6.04186 8L2.40554 4.36369C1.86482 3.82296 1.86482 2.94627 2.40554 2.40554Z",fill:"#BBC0C5"})),Ra=()=>Y("svg",{width:"120",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 127 63"},Y("path",{fill:"currentColor",d:"M71.554 48.607v13.81h-7.072v-9.568l-8.059.945c-1.77.205-2.548.79-2.548 1.864 0 1.575 1.478 2.239 4.648 2.239 1.932 0 4.073-.29 5.963-.79l-3.66 5.225c-1.479.332-2.92.496-4.44.496-6.414 0-10.074-2.57-10.074-7.132 0-4.023 2.877-6.136 9.416-6.884l8.638-1.012c-.467-2.532-2.362-3.633-6.13-3.633-3.537 0-7.443.912-10.937 2.613l1.111-6.18c3.248-1.369 6.95-2.074 10.69-2.074 8.226 0 12.461 3.444 12.461 10.075l-.008.005ZM7.938 31.315.208 62.416h7.73l3.836-15.628 6.65 8.039h8.06l6.65-8.039 3.836 15.628h7.73l-7.73-31.105-14.518 17.388L7.934 31.311l.004.004ZM36.97.21 22.452 17.598 7.938.21.208 31.315h7.73l3.836-15.628 6.65 8.039h8.06l6.65-8.039 3.836 15.628h7.73L36.97.21Zm53.17 48.107-6.25-.912c-1.562-.247-2.178-.747-2.178-1.617 0-1.41 1.52-2.032 4.647-2.032 3.62 0 6.868.747 10.283 2.364l-.862-6.094c-2.757-.995-5.922-1.491-9.212-1.491-7.688 0-11.886 2.696-11.886 7.547 0 3.776 2.303 5.889 7.196 6.636l6.335.954c1.603.248 2.261.87 2.261 1.865 0 1.41-1.478 2.074-4.481 2.074-3.948 0-8.225-.953-11.72-2.654l.7 6.094c3.003 1.122 6.91 1.785 10.57 1.785 7.896 0 12.007-2.78 12.007-7.715 0-3.94-2.303-6.057-7.4-6.8l-.01-.004ZM100.3 34.09v28.325h7.071V34.091H100.3Zm15.334 15.595 9.833-10.744h-8.8l-9.296 11.114 9.912 12.356h8.925l-10.574-12.73v.004Zm-16.321-25.09c0 4.56 3.66 7.13 10.074 7.13 1.52 0 2.961-.167 4.44-.495l3.66-5.225c-1.89.496-4.031.79-5.963.79-3.166 0-4.648-.664-4.648-2.239 0-1.079.783-1.659 2.549-1.864l8.058-.945v9.567h7.072v-13.81c0-6.635-4.236-10.075-12.461-10.075-3.744 0-7.442.705-10.691 2.075l-1.112 6.178c3.495-1.701 7.401-2.613 10.937-2.613 3.769 0 5.664 1.1 6.13 3.633l-8.637 1.013c-6.539.747-9.417 2.86-9.417 6.883l.009-.004Zm-19.779-1.492c0 5.725 3.29 8.627 9.787 8.627 2.59 0 4.732-.416 6.785-1.37l.903-6.261c-1.974 1.2-3.99 1.822-6.005 1.822-3.044 0-4.402-1.243-4.402-4.023v-8.295h10.732V7.84H86.601V2.948l-13.448 7.174v3.482h6.372V23.1l.008.004Zm-6.95-2.612v1.411H53.47c.862 2.873 3.423 4.187 7.97 4.187 3.62 0 6.993-.747 9.992-2.196l-.862 6.056c-2.757 1.16-6.251 1.785-9.829 1.785-9.5 0-14.68-4.23-14.68-12.066 0-7.838 5.264-12.235 13.406-12.235s13.119 4.771 13.119 13.062l-.005-.004ZM53.378 17.09h12.086c-.637-2.751-2.732-4.188-6.08-4.188-3.349 0-5.335 1.399-6.006 4.188Z"}));function _n(e,t){return e.toString(2).padStart(t,"0")}function Hl(e,t){const n=e%t;return n>=0?n:t+n}function st(e,t){return new Array(e).fill(t)}function Fl(...e){let t=0;for(const r of e)t=Math.max(t,r.length);const n=[];for(let r=0;r<t;r++)for(const i of e)r>=i.length||n.push(i[r]);return new Uint8Array(n)}function zl(e,t,n){if(n<0||n+t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[n+r])return!1;return!0}function ql(e){return{has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(function(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}}}class it{static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: wrong height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: wrong width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){const n=(t=t.replace(/^\n+/g,"").replace(/\n+$/g,"")).split(`
|
|
35
|
+
`),r=n.length,i=new Array(r);let o;for(const c of n){const s=c.split("").map(a=>{if(a==="X")return!0;if(a===" ")return!1;if(a!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${a}`)});if(o&&s.length!==o)throw new Error(`Bitmap.fromString different row sizes: width=${o} cur=${s.length}`);o=s.length,i.push(s)}return o||(o=0),new it({height:r,width:o},i)}constructor(t,n){const{height:r,width:i}=it.size(t);this.data=n||Array.from({length:r},()=>st(i,void 0)),this.height=r,this.width=i}point(t){return this.data[t.y][t.x]}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: wrong x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: wrong y=${t.y}`);return t.x=Hl(t.x,this.width),t.y=Hl(t.y,this.height),t}rect(t,n,r){const{x:i,y:o}=this.xy(t),{height:c,width:s}=it.size(n,this.size({x:i,y:o}));for(let a=0;a<c;a++)for(let l=0;l<s;l++)this.data[o+a][i+l]=typeof r=="function"?r({x:l,y:a},this.data[o+a][i+l]):r;return this}rectRead(t,n,r){return this.rect(t,n,(i,o)=>(r(i,o),o))}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){const r=this.height+2*t,i=this.width+2*t,o=st(t,n),c=Array.from({length:t},()=>st(i,n));return new it({height:r,width:i},[...c,...this.data.map(s=>[...o,...s,...o]),...c])}embed(t,n){return this.rect(t,n.size(),({x:r,y:i})=>n.data[i][r])}rectSlice(t,n=this.size()){const r=new it(it.size(n,this.size(this.xy(t))));return this.rect(t,n,({x:i,y:o},c)=>r.data[o][i]=c),r}inverse(){const{height:t,width:n}=this;return new it({height:n,width:t}).rect({x:0,y:0},1/0,({x:r,y:i})=>this.data[r][i])}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`Wrong scale factor: ${t}`);const{height:n,width:r}=this;return new it({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:i,y:o})=>this.data[Math.floor(o/t)][Math.floor(i/t)])}clone(){return new it(this.size()).rect({x:0,y:0},this.size(),({x:t,y:n})=>this.data[n][t])}assertDrawn(){this.rectRead(0,1/0,(t,n)=>{if(typeof n!="boolean")throw new Error("Invalid color type="+typeof n)})}toString(){return this.data.map(t=>t.map(n=>n===void 0?"?":n?"X":" ").join("")).join(`
|
|
36
|
+
`)}toASCII(){const{height:t,width:n,data:r}=this;let i="";for(let o=0;o<t;o+=2){for(let c=0;c<n;c++){const s=r[o][c],a=o+1>=t||r[o+1][c];s||a?!s&&a?i+="▀":s&&!a?i+="▄":s&&a&&(i+=" "):i+="█"}i+=`
|
|
37
|
+
`}return i}toTerm(){const t="\x1B[0m",n=`\x1B[1;47m ${t}`,r=`\x1B[40m ${t}`;return this.data.map(i=>i.map(o=>o?r:n).join("")).join(`
|
|
38
|
+
`)}toSVG(){let t=`<svg xmlns:svg="http://www.w3.org/2000/svg" viewBox="0 0 ${this.width} ${this.height}" version="1.1" xmlns="http://www.w3.org/2000/svg">`;return this.rectRead(0,1/0,({x:n,y:r},i)=>{i&&(t+=`<rect x="${n}" y="${r}" width="1" height="1" />`)}),t+="</svg>",t}toGIF(){const t=s=>[255&s,s>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(s,a)=>r.push(+(a===!0)));const i=126,o=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...st(381,0),44,0,0,0,0,...n,0,7],c=Math.floor(r.length/i);for(let s=0;s<c;s++)o.push(127,128,...r.slice(i*s,i*(s+1)).map(a=>+a));return o.push(r.length%i+1,128,...r.slice(c*i).map(s=>+s)),o.push(1,129,0,59),new Uint8Array(o)}toImage(t=!1){const{height:n,width:r}=this.size(),i=new Uint8Array(n*r*(t?3:4));let o=0;for(let c=0;c<n;c++)for(let s=0;s<r;s++){const a=this.data[c][s]?0:255;i[o++]=a,i[o++]=a,i[o++]=a,t||(i[o++]=255)}return{height:n,width:r,data:i}}}const Wl=["low","medium","quartile","high"],Vl=["numeric","alphanumeric","byte","kanji","eci"],Vg=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Gg={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},Yg={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},ze={size:{encode:e=>21+4*(e-1),decode:e=>(e-17)/4},sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=ze.size.encode(e)-6-1,n=t-6,r=Math.ceil(n/28);let i=Math.floor(n/r);i%2?i+=1:n%r*2>=r&&(i+=2);const o=[6];for(let c=1;c<r;c++)o.push(t-(r-c)*i);return o.push(t),o},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(e,t){const n=ze.ECCode[e]<<3|t;let r=n;for(let i=0;i<10;i++)r=r<<1^1335*(r>>9);return(n<<10|r)^ze.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^7973*(t>>11);return e<<12|t},alphabet:{numeric:ql("0123456789"),alphanumerc:ql("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits:(e,t)=>({numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]})[t][ze.sizeType(e)],modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(e,t){const n=Vg[e-1],r=Gg[t][e-1],i=Yg[t][e-1],o=Math.floor(n/i)-r,c=i-n%i;return{words:r,numBlocks:i,shortBlocks:c,blockLen:o,capacity:8*(n-r*i),total:(r+o)*i+i-c}}},zs=[(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],oe={tables:(e=>{const t=st(256,0),n=st(256,0);for(let r=0,i=1;r<256;r++)t[r]=i,n[i]=r,i<<=1,256&i&&(i^=285);return{exp:t,log:n}})(),exp:e=>oe.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: wrong arg=${e}`);return oe.tables.log[e]%255},mul:(e,t)=>e===0||t===0?0:oe.tables.exp[(oe.tables.log[e]+oe.tables.log[t])%255],add:(e,t)=>e^t,pow:(e,t)=>oe.tables.exp[oe.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: wrong arg=${e}`);return oe.tables.exp[255-oe.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: wrong length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: wrong degree=${e}`);if(t==0)return[0];let n=st(e+1,0);return n[0]=t,oe.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[oe.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=st(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]=oe.add(n[r+i],oe.mul(e[r],t[i]));return oe.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=st(e.length,0);for(let r=0;r<e.length;r++)n[r]=oe.mul(e[r],t);return oe.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: wrong degree");if(n==0)return[0];const r=st(e.length+t,0);for(let i=0;i<e.length;i++)r[i]=oe.mul(e[i],n);return oe.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let i=st(r.length,0),o=r.length-n.length,c=r.slice(0,o);for(let s=0;s<c.length;s++)i[s]=c[s];for(let s=o;s<r.length;s++)i[s]=oe.add(n[s-o],r[s]);return oe.polynomial(i)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const i=n[r];if(i!==0)for(let o=1;o<t.length;o++)t[o]!==0&&(n[r+o]=oe.add(n[r+o],oe.mul(t[o],i)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=oe.mulPoly(t,[1,oe.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return oe.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=oe.add(oe.mul(t,n),e[r]);return n},euclidian(e,t,n){oe.degree(e)<oe.degree(t)&&([e,t]=[t,e]);let r=e,i=t,o=[0],c=[1];for(;2*oe.degree(i)>=n;){let l=r,u=o;if(r=i,o=c,r[0]===0)throw new Error("rLast[0] === 0");i=l;let d=[0];const f=oe.inv(r[0]);for(;oe.degree(i)>=oe.degree(r)&&i[0]!==0;){const h=oe.degree(i)-oe.degree(r),g=oe.mul(i[0],f);d=oe.addPoly(d,oe.monomial(h,g)),i=oe.addPoly(i,oe.mulPolyMonomial(r,h,g))}if(d=oe.mulPoly(d,o),c=oe.addPoly(d,u),oe.degree(i)>=oe.degree(r))throw new Error(`Division failed r: ${i}, rLast: ${r}`)}const s=oe.coefficient(c,0);if(s==0)throw new Error("sigmaTilde(0) was zero");const a=oe.inv(s);return[oe.mulPolyScalar(c,a),oe.mulPolyScalar(i,a)]}};function Zg(e,t){const{words:n,shortBlocks:r,numBlocks:i,blockLen:o,total:c}=ze.capacity(e,t),s=(a=n,{encode(l){const u=oe.divisorPoly(a),d=Array.from(l);return d.push(...u.slice(0,-1).fill(0)),Uint8Array.from(oe.remainderPoly(d,u))},decode(l){const u=l.slice(),d=oe.polynomial(Array.from(l));let f=st(a,0),h=!1;for(let _=0;_<a;_++){const P=oe.evalPoly(d,oe.exp(_));f[f.length-1-_]=P,P!==0&&(h=!0)}if(!h)return u;f=oe.polynomial(f);const g=oe.monomial(a,1),[m,w]=oe.euclidian(g,f,a),p=st(oe.degree(m),0);let S=0;for(let _=1;_<256&&S<p.length;_++)oe.evalPoly(m,_)===0&&(p[S++]=oe.inv(_));if(S!==p.length)throw new Error("RS.decode: wrong errors number");for(let _=0;_<p.length;_++){const P=u.length-1-oe.log(p[_]);if(P<0)throw new Error("RS.decode: wrong error location");const O=oe.inv(p[_]);let K=1;for(let q=0;q<p.length;q++)_!==q&&(K=oe.mul(K,oe.add(1,oe.mul(p[q],O))));u[P]=oe.add(u[P],oe.mul(oe.evalPoly(w,O),oe.inv(K)))}return u}});var a;return{encode(l){const u=[],d=[];for(let m=0;m<i;m++){const w=o+(m<r?0:1);u.push(l.subarray(0,w)),d.push(s.encode(l.subarray(0,w))),l=l.subarray(w)}const f=Fl(...u),h=Fl(...d),g=new Uint8Array(f.length+h.length);return g.set(f),g.set(h,f.length),g},decode(l){if(l.length!==c)throw new Error(`interleave.decode: len(data)=${l.length}, total=${c}`);const u=[];for(let h=0;h<i;h++){const g=h<r;u.push(new Uint8Array(n+o+(g?0:1)))}let d=0;for(let h=0;h<o;h++)for(let g=0;g<i;g++)u[g][h]=l[d++];for(let h=r;h<i;h++)u[h][o]=l[d++];for(let h=o;h<o+n;h++)for(let g=0;g<i;g++){const m=g<r;u[g][h+(m?0:1)]=l[d++]}const f=[];for(const h of u)f.push(...Array.from(s.decode(h)).slice(0,-n));return Uint8Array.from(f)}}}function Gl(e,t,n,r){let i="",o=n.length;if(r==="numeric"){const d=ze.alphabet.numeric.decode(n.split("")),f=d.length;for(let h=0;h<f-2;h+=3)i+=_n(100*d[h]+10*d[h+1]+d[h+2],10);f%3==1?i+=_n(d[f-1],4):f%3==2&&(i+=_n(10*d[f-2]+d[f-1],7))}else if(r==="alphanumeric"){const d=ze.alphabet.alphanumerc.decode(n.split("")),f=d.length;for(let h=0;h<f-1;h+=2)i+=_n(45*d[h]+d[h+1],11);f%2==1&&(i+=_n(d[f-1],6))}else{if(r!=="byte")throw new Error("encode: unsupported type");{const d=function(f){if(typeof f!="string")throw new Error("utf8ToBytes expected string, got "+typeof f);return new Uint8Array(new TextEncoder().encode(f))}(n);o=d.length,i=Array.from(d).map(f=>_n(f,8)).join("")}}const{capacity:c}=ze.capacity(e,t),s=_n(o,ze.lengthBits(e,r));let a=ze.modeBits[r]+s+i;if(a.length>c)throw new Error("Capacity overflow");a+="0".repeat(Math.min(4,Math.max(0,c-a.length))),a.length%8&&(a+="0".repeat(8-a.length%8));const l="1110110000010001";for(let d=0;a.length!==c;d++)a+=l[d%16];const u=Uint8Array.from(a.match(/(.{8})/g).map(d=>+`0b${d}`));return Zg(e,t).encode(u)}function Yl(e,t,n,r,i=!1){const o=function(a,l,u,d=!1){const f=ze.size.encode(a);let h=new it(f+2);const g=new it(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);h=h.embed(0,g).embed({x:-g.width,y:0},g).embed({x:0,y:-g.height},g),h=h.rectSlice(1,f);const m=new it(1).rect(0,1,!0).border(1,!1).border(1,!0),w=ze.alignmentPatterns(a);for(const p of w)for(const S of w)h.data[p][S]===void 0&&h.embed({x:S-2,y:p-2},m);h=h.hLine({x:0,y:6},1/0,({x:p},S)=>S===void 0?p%2==0:S).vLine({x:6,y:0},1/0,({y:p},S)=>S===void 0?p%2==0:S);{const p=ze.formatBits(l,u),S=_=>!d&&(p>>_&1)==1;for(let _=0;_<6;_++)h.data[_][8]=S(_);for(let _=6;_<8;_++)h.data[_+1][8]=S(_);for(let _=8;_<15;_++)h.data[f-15+_][8]=S(_);for(let _=0;_<8;_++)h.data[8][f-_-1]=S(_);for(let _=8;_<9;_++)h.data[8][15-_-1+1]=S(_);for(let _=9;_<15;_++)h.data[8][15-_-1]=S(_);h.data[f-8][8]=!d}if(a>=7){const p=ze.versionBits(a);for(let S=0;S<18;S+=1){const _=!d&&(p>>S&1)==1,P=Math.floor(S/3),O=S%3+f-8-3;h.data[P][O]=_,h.data[O][P]=_}}return h}(e,t,r,i);let c=0;const s=8*n.length;if(function(a,l,u){const d=a.height,f=zs[l];let h=-1,g=d-1;for(let m=d-1;m>0;m-=2){for(m==6&&(m=5);;g+=h){for(let w=0;w<2;w+=1){const p=m-w;a.data[g][p]===void 0&&u(p,g,f(p,g))}if(g+h<0||g+h>=d)break}h=-h}}(o,r,(a,l,u)=>{let d=!1;c<s&&(d=(n[c>>>3]>>(7-c&7)&1)!=0,c++),o.data[l][a]=d!==u}),c!==s)throw new Error("QR: bytes left after draw");return o}function Jg(e){const t=e.inverse(),n=h=>{let g=0;for(let m,w=0,p=1;w<h.length;w++)m===h[w]&&(p++,w!==h.length-1)||(p>=5&&(g+=p-5+3),m=h[w],p=1);return g};let r=0;e.data.forEach(h=>r+=n(h)),t.data.forEach(h=>r+=n(h));let i=0,o=e.data;const c=e.width-1,s=e.height-1;for(let h=0;h<c;h++)for(let g=0;g<s;g++){const m=h+1,w=g+1;o[h][g]===o[m][g]&&o[m][g]===o[h][w]&&o[m][g]===o[m][w]&&(i+=3)}const a=h=>{const g=[!0,!1,!0,!0,!0,!1,!0],m=[!1,!1,!1,!1],w=[...g,...m],p=[...m,...g];let S=0;for(let _=0;_<h.length;_++)zl(h,w,_)&&(S+=40),zl(h,p,_)&&(S+=40);return S};let l=0;for(const h of e.data)l+=a(h);for(const h of t.data)l+=a(h);let u=0;e.rectRead(0,1/0,(h,g)=>u+=g?1:0);const d=u/(e.height*e.width)*100,f=10*Math.floor(Math.abs(d-50)/5);return r+i+l+f}function Jf(e,t="raw",n={}){const r=n.ecc!==void 0?n.ecc:"medium";(function(u){if(!Wl.includes(u))throw new Error(`Invalid error correction mode=${u}. Expected: ${Wl}`)})(r);const i=n.encoding!==void 0?n.encoding:function(u){let d="numeric";for(let f of u)if(!ze.alphabet.numeric.has(f)&&(d="alphanumeric",!ze.alphabet.alphanumerc.has(f)))return"byte";return d}(e);(function(u){if(!Vl.includes(u))throw new Error(`Encoding: invalid mode=${u}. Expected: ${Vl}`);if(u==="kanji"||u==="eci")throw new Error(`Encoding: ${u} is not supported (yet?).`)})(i),n.mask!==void 0&&function(u){if(![0,1,2,3,4,5,6,7].includes(u)||!zs[u])throw new Error(`Invalid mask=${u}. Expected number [0..7]`)}(n.mask);let o,c=n.version,s=new Error("Unknown error");if(c!==void 0)(function(u){if(!Number.isSafeInteger(u)||u<1||u>40)throw new Error(`Invalid version=${u}. Expected number [1..40]`)})(c),o=Gl(c,r,e,i);else for(let u=1;u<=40;u++)try{o=Gl(u,r,e,i),c=u;break}catch(d){s=d}if(!c||!o)throw s;let a=function(u,d,f,h){if(h===void 0){const g=function(){let m,w=1/0;return{add(p,S){p>=w||(m=S,w=p)},get:()=>m,score:()=>w}}();for(let m=0;m<zs.length;m++)g.add(Jg(Yl(u,d,f,m,!0)),m);h=g.get()}if(h===void 0)throw new Error("Cannot find mask");return Yl(u,d,f,h)}(c,r,o,n.mask);a.assertDrawn();const l=n.border===void 0?2:n.border;if(!Number.isSafeInteger(l))throw new Error("Wrong border type="+typeof l);if(a=a.border(l,!1),n.scale!==void 0&&(a=a.scale(n.scale)),t==="raw")return a.data;if(t==="ascii")return a.toASCII();if(t==="svg")return a.toSVG();if(t==="gif")return a.toGIF();if(t==="term")return a.toTerm();throw new Error(`Unknown output: ${t}`)}const ss={DESKTOP:"Desktop",MOBILE:"Mobile",META_MASK_MOBILE_APP:"MetaMask mobile app",SCAN_TO_CONNECT:"Scan to connect and sign with",CONNECT_WITH_EXTENSION:"Connect With MetaMask Extension",INSTALL_MODAL:{TRUSTED_BY_USERS:"Trusted by over 30 million users to buy, store, send and swap crypto securely",LEADING_CRYPTO_WALLET:"The leading crypto wallet & gateway to blockchain apps built on Ethereum Mainnet, Polygon, Optimism, and many other networks",CONTROL_DIGITAL_INTERACTIONS:"Puts you in control of your digital interactions by making power of cryptography more accessible",INSTALL_META_MASK_EXTENSION:"Install MetaMask Extension"},PENDING_MODAL:{OPEN_META_MASK_SELECT_CODE:"Please open the MetaMask wallet app and select the code on the screen OR disconnect",OPEN_META_MASK_CONTINUE:"Open the MetaMask app to continue with your session.",NUMBER_AFTER_OPEN_NOTICE:"If a number doesn't appear after opening MetaMask, please click disconnect and re-scan the QRCode.",DISCONNECT:"Disconnect"},SELECT_MODAL:{CRYPTO_TAKE_CONTROL_TEXT:"Take control of your crypto and explore the blockchain with the wallet trusted by over 30 million people worldwide"},META_MASK_MODAL:{ADDRESS_COPIED:"Address copied to clipboard!",DISCONNECT:"Disconnect",ACTIVE_NETWORK:"Active Network"}};class Oa{constructor(t){var n;this.translations=ss,this.supportedLocales=["es","fr","he","it","pt","tr"],this.baseUrl=(n=t==null?void 0:t.baseUrl)!==null&&n!==void 0?n:"https://raw.githubusercontent.com/MetaMask/metamask-sdk/refs/heads/gh-pages/locales"}getBrowserLanguage(){if((navigator.languages||[navigator.language]).some(n=>n.toLowerCase().startsWith("en")))return"en";const t=navigator.language.toLowerCase().split("-")[0];return this.supportedLocales.includes(t)?t:"en"}async init(t){const n=this.getBrowserLanguage()||t.fallbackLng;await this.loadTranslations(n)}async loadTranslations(t){const n=t.split("-")[0];if(n!=="en"&&this.supportedLocales.includes(n))try{const r=`${this.baseUrl}/${n}.json`,i=await fetch(r);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);this.translations=await i.json()}catch(r){console.warn(`❌ Failed to load ${n} translations, falling back to English:`,r),this.translations=ss}else this.translations=ss}t(t){return this.getNestedTranslation(t,this.translations)||t}getNestedTranslation(t,n){const r=t.split(".");let i=n;for(const o of r){if(typeof i!="object")return"";i=i[o]}return typeof i=="string"?i:""}}var Sr;(function(e){e.SDK_MODAL_VIEWED="sdk_modal_viewed",e.SDK_MODAL_BUTTON_CLICKED="sdk_modal_button_clicked",e.SDK_MODAL_TOGGLE_CHANGED="sdk_modal_toggle_changed"})(Sr||(Sr={}));const Xf=class{constructor(e){_a(this,e),this.close=yn(this,"close"),this.startDesktopOnboarding=yn(this,"startDesktopOnboarding"),this.trackAnalytics=yn(this,"trackAnalytics"),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.onClose=this.onClose.bind(this),this.onStartDesktopOnboardingHandler=this.onStartDesktopOnboardingHandler.bind(this),this.setTab=this.setTab.bind(this),this.render=this.render.bind(this),this.setTab(this.preferDesktop?1:2),this.i18nInstance=new Oa}componentDidLoad(){this.trackAnalytics.emit({event:Sr.SDK_MODAL_VIEWED,params:{extensionInstalled:!1,tab:this.tab===1?"desktop":"mobile"}})}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}updatePreferDesktop(e){e?this.setTab(1):this.setTab(2)}onClose(e=!1){this.close.emit({shouldTerminate:e})}onStartDesktopOnboardingHandler(){this.trackAnalytics.emit({event:Sr.SDK_MODAL_BUTTON_CLICKED,params:{button_type:"install_extension",tab:"desktop"}}),this.startDesktopOnboarding.emit()}setTab(e,t=!1){t&&this.trackAnalytics.emit({event:Sr.SDK_MODAL_TOGGLE_CHANGED,params:{toggle:this.tab===1?"desktop_to_mobile":"mobile_to_desktop"}}),this.tab=e,this.isDefaultTab=!1}render(){if(!this.translationsLoaded)return null;const e=r=>this.i18nInstance.t(r),t=this.isDefaultTab?this.preferDesktop?1:2:this.tab,n=Jf(this.link,"svg",{ecc:"medium",scale:2});return Y(Ta,{className:"install-model"},Y("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),Y("div",{class:"modal"},Y("div",{class:"closeButtonContainer"},Y("div",{class:"right"},Y("span",{class:"closeButton",onClick:()=>this.onClose(!0)},Y(Pa,null)))),Y("div",{class:"logoContainer"},Y(Ra,null)),Y("div",null,Y("div",{class:"tabcontainer"},Y("div",{class:"flexContainer"},Y("div",{onClick:()=>this.setTab(1,!0),class:"tab flexItem "+(t===1?"tabactive":"")},e("DESKTOP")),Y("div",{onClick:()=>this.setTab(2,!0),class:"tab flexItem "+(t===2?"tabactive":"")},e("MOBILE")))),Y("div",{style:{display:t===1?"none":"block"}},Y("div",{class:"flexContainer"},Y("div",{class:"flexItem",style:{textAlign:"center",marginTop:"4"}},n&&Y("div",{id:"sdk-mm-qrcode",class:"center",innerHTML:n}),Y("div",{class:"connectMobileText"},e("SCAN_TO_CONNECT")," ",Y("br",null),Y("span",{class:"blue"},Y("b",null,e("META_MASK_MOBILE_APP"))))))),Y("div",{style:{display:t===2?"none":"block"}},Y("div",{class:"item"},Y(os,{Icon:zg,text:e("INSTALL_MODAL.TRUSTED_BY_USERS")})),Y("div",{class:"item"},Y(os,{Icon:Fg,text:e("INSTALL_MODAL.LEADING_CRYPTO_WALLET")})),Y("div",{class:"item"},Y(os,{Icon:qg,text:e("INSTALL_MODAL.CONTROL_DIGITAL_INTERACTIONS")})),Y("button",{class:"button",onClick:()=>this.onStartDesktopOnboardingHandler()},Y(Wg,null),Y("span",{class:"installExtensionText"},e("INSTALL_MODAL.INSTALL_META_MASK_EXTENSION"))))),Y(Ia,{version:this.sdkVersion})))}get el(){return mo(this)}static get watchers(){return{preferDesktop:["updatePreferDesktop"]}}};Xf.style=`.flexContainer {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.flexItem {
|
|
46
|
+
flex: 1;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.flexItem11 {
|
|
52
|
+
flex: 11;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.flexItem1 {
|
|
58
|
+
flex: 1;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tab {
|
|
64
|
+
padding: 8px;
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
background-color: #F2F4F6;
|
|
67
|
+
font-size: 12px;
|
|
68
|
+
text-align: center;
|
|
69
|
+
color: #24292E;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.tabcontainer {
|
|
73
|
+
padding: 4px;
|
|
74
|
+
background-color: #F2F4F6;
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
margin-bottom: 30px;
|
|
77
|
+
margin-top: 30px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tabactive {
|
|
81
|
+
background-color: white;
|
|
82
|
+
-webkit-transition: background-color 300ms linear;
|
|
83
|
+
-ms-transition: background-color 300ms linear;
|
|
84
|
+
transition: background-color 300ms linear;
|
|
85
|
+
border-radius: 8px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.item {
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
margin-bottom: 16px;
|
|
91
|
+
border-radius: 8px;
|
|
92
|
+
padding: 10px;
|
|
93
|
+
border: 2px #F2F4F6 solid;
|
|
94
|
+
color: #24292E;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.extensionLabel {
|
|
98
|
+
font-style: normal;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
text-align: cetner;
|
|
102
|
+
color: #24272A;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.notice {
|
|
106
|
+
font-size: 12px;
|
|
107
|
+
margin-left: 10px;
|
|
108
|
+
margin-right: 10px;
|
|
109
|
+
color: grey;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.button {
|
|
113
|
+
margin-top: 41.5px;
|
|
114
|
+
margin-bottom: 20px;
|
|
115
|
+
width: 100%;
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: row;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
align-items: center;
|
|
120
|
+
padding: 12px 20px;
|
|
121
|
+
background: #037DD6;
|
|
122
|
+
border-radius: 32px;
|
|
123
|
+
color: white;
|
|
124
|
+
border: 0;
|
|
125
|
+
font-size: 14px;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.backdrop {
|
|
130
|
+
visibility: visible;
|
|
131
|
+
position: fixed;
|
|
132
|
+
top: 0;
|
|
133
|
+
left: 0;
|
|
134
|
+
right: 0;
|
|
135
|
+
bottom: 0;
|
|
136
|
+
width: 100%;
|
|
137
|
+
z-index: 99998;
|
|
138
|
+
background: rgba(0, 0, 0, 0.87);
|
|
139
|
+
opacity: 0.3;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.modal {
|
|
143
|
+
visibility: visible;
|
|
144
|
+
position: fixed;
|
|
145
|
+
left: 50%;
|
|
146
|
+
transform: translate(-50%, -50%);
|
|
147
|
+
z-index: 99999;
|
|
148
|
+
background: white;
|
|
149
|
+
padding: 20px;
|
|
150
|
+
border-radius: 8px;
|
|
151
|
+
top: 50%;
|
|
152
|
+
max-width: 100%;
|
|
153
|
+
width: 460px;
|
|
154
|
+
min-width: 300px;
|
|
155
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
|
|
156
|
+
-webkit-font-smoothing: antialiased;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.closeButton {
|
|
160
|
+
color: #BBC0C5;
|
|
161
|
+
cursor: pointer;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.logoContainer {
|
|
165
|
+
margin-left: 24px;
|
|
166
|
+
margin-right: 24px;
|
|
167
|
+
margin-top: 24px;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.connectMobileText {
|
|
174
|
+
font-size: 14px;
|
|
175
|
+
color: black;
|
|
176
|
+
margin-top: 28px;
|
|
177
|
+
margin-bottom: 28px;
|
|
178
|
+
line-height: 2;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.blue {
|
|
182
|
+
color: #037DD6;
|
|
183
|
+
font-weight: 700;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.installExtensionText {
|
|
187
|
+
margin-left: 10px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.center {
|
|
191
|
+
display: flex;
|
|
192
|
+
justify-content: center;
|
|
193
|
+
align-items: center;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.right {
|
|
197
|
+
display: flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: right;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#sdk-mm-qrcode {
|
|
203
|
+
svg {
|
|
204
|
+
width: 50%;
|
|
205
|
+
}
|
|
206
|
+
}`;const Qf=class{constructor(e){_a(this,e),this.close=yn(this,"close"),this.disconnect=yn(this,"disconnect"),this.updateOTPValue=yn(this,"updateOTPValue"),this.displayOTP=void 0,this.sdkVersion=void 0,this.otpCode=void 0,this.translationsLoaded=!1,this.i18nInstance=new Oa}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(){this.close.emit()}onDisconnect(){this.disconnect.emit()}onUpdateOTPValueHandler(e){this.updateOTPValue.emit({otpValue:e})}disconnectedCallback(){this.onClose()}render(){var e;if(!this.translationsLoaded)return null;const t=(e=this.displayOTP)===null||e===void 0||e,n=this.sdkVersion,r=i=>this.i18nInstance.t(i);return Y(Ta,{className:"pending-modal"},Y("div",{class:"backdrop",onClick:()=>this.onClose()}),Y("div",{class:"modal"},Y("div",{class:"closeButtonContainer"},Y("div",{class:"right"},Y("span",{class:"closeButton",onClick:()=>this.onClose()},Y(Pa,null)))),Y("div",{class:"logoContainer"},Y(Ra,null)),Y("div",null,Y("div",{class:"flexContainer",style:{flexDirection:"column",color:"black"}},Y("div",{class:"flexItem",style:{textAlign:"center",marginTop:"30px",marginBottom:"30px",fontSize:"16px"}},r(t?"PENDING_MODAL.OPEN_META_MASK_SELECT_CODE":"PENDING_MODAL.OPEN_META_MASK_CONTINUE")),Y("div",{id:"sdk-mm-otp-value",style:{padding:"10px",fontSize:"32px",display:this.otpCode?"block":"none"}},this.otpCode),t&&Y("div",{class:"notice"},"* ",r("PENDING_MODAL.NUMBER_AFTER_OPEN_NOTICE"))),Y("div",{style:{marginTop:"20px"}},Y("button",{class:"button blue",style:{marginTop:"5px",color:"#0376C9",borderColor:"#0376C9",borderWidth:"1px",borderStyle:"solid",backgroundColor:"white"},onClick:()=>this.onDisconnect()},r("PENDING_MODAL.DISCONNECT")))),Y(Ia,{version:n})))}get el(){return mo(this)}};Qf.style=`.flexContainer {
|
|
207
|
+
display: flex;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
align-items: center;
|
|
210
|
+
flex-direction: row;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.flexItem {
|
|
214
|
+
flex: 1;
|
|
215
|
+
justify-content: center;
|
|
216
|
+
align-items: center;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.flexItem11 {
|
|
220
|
+
flex: 11;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
align-items: center;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.flexItem1 {
|
|
226
|
+
flex: 1;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
align-items: center;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.tab {
|
|
232
|
+
padding: 8px;
|
|
233
|
+
cursor: pointer;
|
|
234
|
+
background-color: #F2F4F6;
|
|
235
|
+
font-size: 12px;
|
|
236
|
+
text-align: center;
|
|
237
|
+
color: #24292E;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.tabcontainer {
|
|
241
|
+
padding: 4px;
|
|
242
|
+
background-color: #F2F4F6;
|
|
243
|
+
border-radius: 8px;
|
|
244
|
+
margin-bottom: 30px;
|
|
245
|
+
margin-top: 30px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.tabactive {
|
|
249
|
+
background-color: white;
|
|
250
|
+
-webkit-transition: background-color 300ms linear;
|
|
251
|
+
-ms-transition: background-color 300ms linear;
|
|
252
|
+
transition: background-color 300ms linear;
|
|
253
|
+
border-radius: 8px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.item {
|
|
257
|
+
font-size: 12px;
|
|
258
|
+
margin-bottom: 16px;
|
|
259
|
+
border-radius: 8px;
|
|
260
|
+
padding: 10px;
|
|
261
|
+
border: 2px #F2F4F6 solid;
|
|
262
|
+
color: #24292E;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.extensionLabel {
|
|
266
|
+
font-style: normal;
|
|
267
|
+
font-weight: bold;
|
|
268
|
+
font-size: 14px;
|
|
269
|
+
text-align: cetner;
|
|
270
|
+
color: #24272A;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.notice {
|
|
274
|
+
font-size: 12px;
|
|
275
|
+
margin-left: 10px;
|
|
276
|
+
margin-right: 10px;
|
|
277
|
+
color: grey;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.button {
|
|
281
|
+
margin-top: 41.5px;
|
|
282
|
+
margin-bottom: 20px;
|
|
283
|
+
width: 100%;
|
|
284
|
+
display: flex;
|
|
285
|
+
flex-direction: row;
|
|
286
|
+
justify-content: center;
|
|
287
|
+
align-items: center;
|
|
288
|
+
padding: 12px 20px;
|
|
289
|
+
background: #037DD6;
|
|
290
|
+
border-radius: 32px;
|
|
291
|
+
color: white;
|
|
292
|
+
border: 0;
|
|
293
|
+
font-size: 14px;
|
|
294
|
+
cursor: pointer;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.backdrop {
|
|
298
|
+
visibility: visible;
|
|
299
|
+
position: fixed;
|
|
300
|
+
top: 0;
|
|
301
|
+
left: 0;
|
|
302
|
+
right: 0;
|
|
303
|
+
bottom: 0;
|
|
304
|
+
width: 100%;
|
|
305
|
+
z-index: 99998;
|
|
306
|
+
background: rgba(0, 0, 0, 0.87);
|
|
307
|
+
opacity: 0.3;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.modal {
|
|
311
|
+
visibility: visible;
|
|
312
|
+
position: fixed;
|
|
313
|
+
left: 50%;
|
|
314
|
+
transform: translate(-50%, -50%);
|
|
315
|
+
z-index: 99999;
|
|
316
|
+
background: white;
|
|
317
|
+
padding: 20px;
|
|
318
|
+
border-radius: 8px;
|
|
319
|
+
top: 50%;
|
|
320
|
+
max-width: 100%;
|
|
321
|
+
width: 460px;
|
|
322
|
+
min-width: 300px;
|
|
323
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
|
|
324
|
+
-webkit-font-smoothing: antialiased;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.closeButton {
|
|
328
|
+
color: #BBC0C5;
|
|
329
|
+
cursor: pointer;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.logoContainer {
|
|
333
|
+
margin-left: 24px;
|
|
334
|
+
margin-right: 24px;
|
|
335
|
+
margin-top: 24px;
|
|
336
|
+
display: flex;
|
|
337
|
+
align-items: center;
|
|
338
|
+
justify-content: center;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.connectMobileText {
|
|
342
|
+
font-size: 14px;
|
|
343
|
+
color: black;
|
|
344
|
+
margin-top: 28px;
|
|
345
|
+
margin-bottom: 28px;
|
|
346
|
+
line-height: 2;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.blue {
|
|
350
|
+
color: #037DD6;
|
|
351
|
+
font-weight: 700;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.installExtensionText {
|
|
355
|
+
margin-left: 10px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.center {
|
|
359
|
+
display: flex;
|
|
360
|
+
justify-content: center;
|
|
361
|
+
align-items: center;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.right {
|
|
365
|
+
display: flex;
|
|
366
|
+
align-items: center;
|
|
367
|
+
justify-content: right;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
#sdk-mm-qrcode {
|
|
371
|
+
svg {
|
|
372
|
+
width: 50%;
|
|
373
|
+
}
|
|
374
|
+
}`;const Xg=()=>Y("svg",{width:"21",height:"15",viewBox:"0 0 21 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("path",{d:"M14.1364 14.9851C13.5909 14.9851 13.2273 14.5851 13.2273 13.9851C13.2273 13.3851 13.5909 12.9851 14.1364 12.9851C16.6818 12.9851 18.6818 10.7851 18.6818 7.98508C18.6818 5.18508 16.6818 2.98508 14.1364 2.98508C11.5909 2.98508 9.59091 5.18508 9.59091 7.98508C9.59091 8.58508 9.22727 8.98508 8.68182 8.98508C8.13636 8.98508 7.77273 8.58508 7.77273 7.98508C7.77273 4.08508 10.5909 0.985077 14.1364 0.985077C17.6818 0.985077 20.5 4.08508 20.5 7.98508C20.5 11.8851 17.6818 14.9851 14.1364 14.9851ZM6.68182 14.7851C3.22727 14.7851 0.5 11.6851 0.5 7.98508C0.5 4.28508 3.22727 1.18508 6.68182 1.18508C7.22727 1.18508 7.59091 1.58508 7.59091 2.18508C7.59091 2.78508 7.22727 3.18508 6.68182 3.18508C4.22727 3.18508 2.31818 5.38508 2.31818 7.98508C2.31818 10.5851 4.22727 12.7851 6.68182 12.7851C9.13636 12.7851 11.0455 10.6851 11.0455 7.98508C11.0455 7.38508 11.4091 6.98508 11.9545 6.98508C12.5 6.98508 12.8636 7.38508 12.8636 7.98508C12.7727 11.6851 10.0455 14.7851 6.68182 14.7851Z",fill:"white"})),Qg=()=>Y("svg",{width:"400",height:"300",viewBox:"0 0 400 300",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y("rect",{width:"400",height:"300",fill:"white"}),Y("path",{d:"M300.116 242.46L250.485 227.681L213.057 250.055L186.944 250.045L149.493 227.681L99.8843 242.46L84.7939 191.518L99.8843 134.979L84.7939 87.1777L99.8843 27.9336L177.402 74.2466H222.598L300.116 27.9336L315.206 87.1777L300.116 134.979L315.206 191.518L300.116 242.46Z",fill:"#FF5C16"}),Y("path",{d:"M99.8955 27.9336L177.414 74.2792L174.331 106.085L99.8955 27.9336Z",fill:"#FF5C16"}),Y("path",{d:"M149.505 191.539L183.612 217.521L149.505 227.681V191.539Z",fill:"#FF5C16"}),Y("path",{d:"M180.886 148.585L174.33 106.107L132.369 134.991L132.348 134.98V135.001L132.477 164.732L149.493 148.585H149.504H180.886Z",fill:"#FF5C16"}),Y("path",{d:"M300.116 27.9336L222.598 74.2792L225.67 106.085L300.116 27.9336Z",fill:"#FF5C16"}),Y("path",{d:"M250.508 191.539L216.4 217.521L250.508 227.681V191.539Z",fill:"#FF5C16"}),Y("path",{d:"M267.652 135.001H267.663H267.652V134.98L267.641 134.991L225.68 106.107L219.125 148.585H250.507L267.533 164.732L267.652 135.001Z",fill:"#FF5C16"}),Y("path",{d:"M149.493 227.681L99.8843 242.46L84.7939 191.54H149.493V227.681Z",fill:"#E34807"}),Y("path",{d:"M180.875 148.574L190.351 209.98L177.219 175.838L132.456 164.732L149.483 148.574H180.864H180.875Z",fill:"#E34807"}),Y("path",{d:"M250.507 227.681L300.116 242.46L315.206 191.54H250.507V227.681Z",fill:"#E34807"}),Y("path",{d:"M219.126 148.574L209.649 209.98L222.782 175.838L267.545 164.732L250.507 148.574H219.126Z",fill:"#E34807"}),Y("path",{d:"M84.7939 191.517L99.8843 134.979H132.337L132.456 164.721L177.219 175.826L190.351 209.969L183.601 217.488L149.493 191.506H84.7939V191.517Z",fill:"#FF8D5D"}),Y("path",{d:"M315.206 191.517L300.116 134.979H267.664L267.545 164.721L222.782 175.826L209.649 209.969L216.4 217.488L250.507 191.506H315.206V191.517Z",fill:"#FF8D5D"}),Y("path",{d:"M222.598 74.2466H200H177.402L174.33 106.053L190.351 209.936H209.649L225.681 106.053L222.598 74.2466Z",fill:"#FF8D5D"}),Y("path",{d:"M99.8843 27.9336L84.7939 87.1777L99.8843 134.979H132.337L174.319 106.085L99.8843 27.9336Z",fill:"#661800"}),Y("path",{d:"M171.496 160.906H156.795L148.79 168.752L177.229 175.804L171.496 160.896V160.906Z",fill:"#661800"}),Y("path",{d:"M300.116 27.9336L315.206 87.1777L300.116 134.979H267.663L225.681 106.085L300.116 27.9336Z",fill:"#661800"}),Y("path",{d:"M228.525 160.906H243.248L251.253 168.763L222.781 175.826L228.525 160.896V160.906Z",fill:"#661800"}),Y("path",{d:"M213.046 229.789L216.399 217.51L209.649 209.991H190.34L183.59 217.51L186.943 229.789",fill:"#661800"}),Y("path",{d:"M213.047 229.789V250.066H186.944V229.789H213.047Z",fill:"#C0C4CD"}),Y("path",{d:"M149.504 227.66L186.965 250.056V229.779L183.611 217.5L149.504 227.66Z",fill:"#E7EBF6"}),Y("path",{d:"M250.506 227.66L213.045 250.056V229.779L216.398 217.5L250.506 227.66Z",fill:"#E7EBF6"})),eh=class{constructor(e){_a(this,e),this.close=yn(this,"close"),this.connectWithExtension=yn(this,"connectWithExtension"),this.link=void 0,this.sdkVersion=void 0,this.preferDesktop=void 0,this.tab=1,this.isDefaultTab=!0,this.translationsLoaded=!1,this.i18nInstance=new Oa,this.setTab(this.preferDesktop?1:2)}async connectedCallback(){await this.i18nInstance.init({fallbackLng:"en"}),this.translationsLoaded=!0}onClose(e=!1){this.close.emit({shouldTerminate:e})}connectWithExtensionHandler(){this.connectWithExtension.emit()}setTab(e){this.tab=e,this.isDefaultTab=!1}disconnectedCallback(){this.onClose()}updatePreferDesktop(e){e?this.setTab(1):this.setTab(2)}render(){if(!this.translationsLoaded)return null;const e=i=>this.i18nInstance.t(i),t=this.sdkVersion,n=this.isDefaultTab?this.preferDesktop?1:2:this.tab,r=Jf(this.link,"svg",{ecc:"medium",scale:2});return Y(Ta,{className:"select-modal"},Y("div",{class:"backdrop",onClick:()=>this.onClose(!0)}),Y("div",{class:"modal"},Y("div",{class:"closeButtonContainer"},Y("div",{class:"right"},Y("span",{class:"closeButton",onClick:()=>this.onClose(!0)},Y(Pa,null)))),Y("div",{class:"logoContainer"},Y(Ra,null)),Y("div",null,Y("div",{class:"tabcontainer"},Y("div",{class:"flexContainer"},Y("div",{onClick:()=>this.setTab(1),class:"tab flexItem "+(n===1?"tabactive":"")},e("DESKTOP")),Y("div",{onClick:()=>this.setTab(2),class:"tab flexItem "+(n===2?"tabactive":"")},e("MOBILE")))),Y("div",{style:{display:n===1?"none":"block"}},Y("div",{class:"flexContainer"},Y("div",{class:"flexItem",style:{textAlign:"center",marginTop:"4"}},Y("div",{class:"center",id:"sdk-mm-qrcode",innerHTML:r}),Y("div",{class:"connectMobileText"},e("SCAN_TO_CONNECT"),Y("br",null),Y("span",{class:"blue"},Y("b",null,e("META_MASK_MOBILE_APP"))))))),Y("div",{style:{display:n===2?"none":"block"}},Y("div",{style:{display:"flex",justifyContent:"center",height:"300",marginTop:"-20"}},Y(Qg,null)),Y("div",{class:"extensionLabel"},e("SELECT_MODAL.CRYPTO_TAKE_CONTROL_TEXT")),Y("button",{class:"button",onClick:()=>this.connectWithExtensionHandler()},Y(Xg,null),Y("span",{class:"installExtensionText"},e("CONNECT_WITH_EXTENSION"))))),Y(Ia,{version:t})))}get el(){return mo(this)}static get watchers(){return{preferDesktop:["updatePreferDesktop"]}}};eh.style=`.flexContainer {
|
|
375
|
+
display: flex;
|
|
376
|
+
justify-content: center;
|
|
377
|
+
align-items: center;
|
|
378
|
+
flex-direction: row;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.flexItem {
|
|
382
|
+
flex: 1;
|
|
383
|
+
justify-content: center;
|
|
384
|
+
align-items: center;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.flexItem11 {
|
|
388
|
+
flex: 11;
|
|
389
|
+
justify-content: center;
|
|
390
|
+
align-items: center;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.flexItem1 {
|
|
394
|
+
flex: 1;
|
|
395
|
+
justify-content: center;
|
|
396
|
+
align-items: center;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.tab {
|
|
400
|
+
padding: 8px;
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
background-color: #F2F4F6;
|
|
403
|
+
font-size: 12px;
|
|
404
|
+
text-align: center;
|
|
405
|
+
color: #24292E;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.tabcontainer {
|
|
409
|
+
padding: 4px;
|
|
410
|
+
background-color: #F2F4F6;
|
|
411
|
+
border-radius: 8px;
|
|
412
|
+
margin-bottom: 30px;
|
|
413
|
+
margin-top: 30px;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.tabactive {
|
|
417
|
+
background-color: white;
|
|
418
|
+
-webkit-transition: background-color 300ms linear;
|
|
419
|
+
-ms-transition: background-color 300ms linear;
|
|
420
|
+
transition: background-color 300ms linear;
|
|
421
|
+
border-radius: 8px;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.item {
|
|
425
|
+
font-size: 12px;
|
|
426
|
+
margin-bottom: 16px;
|
|
427
|
+
border-radius: 8px;
|
|
428
|
+
padding: 10px;
|
|
429
|
+
border: 2px #F2F4F6 solid;
|
|
430
|
+
color: #24292E;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.extensionLabel {
|
|
434
|
+
font-style: normal;
|
|
435
|
+
font-weight: bold;
|
|
436
|
+
font-size: 14px;
|
|
437
|
+
text-align: cetner;
|
|
438
|
+
color: #24272A;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.notice {
|
|
442
|
+
font-size: 12px;
|
|
443
|
+
margin-left: 10px;
|
|
444
|
+
margin-right: 10px;
|
|
445
|
+
color: grey;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.button {
|
|
449
|
+
margin-top: 41.5px;
|
|
450
|
+
margin-bottom: 20px;
|
|
451
|
+
width: 100%;
|
|
452
|
+
display: flex;
|
|
453
|
+
flex-direction: row;
|
|
454
|
+
justify-content: center;
|
|
455
|
+
align-items: center;
|
|
456
|
+
padding: 12px 20px;
|
|
457
|
+
background: #037DD6;
|
|
458
|
+
border-radius: 32px;
|
|
459
|
+
color: white;
|
|
460
|
+
border: 0;
|
|
461
|
+
font-size: 14px;
|
|
462
|
+
cursor: pointer;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.backdrop {
|
|
466
|
+
visibility: visible;
|
|
467
|
+
position: fixed;
|
|
468
|
+
top: 0;
|
|
469
|
+
left: 0;
|
|
470
|
+
right: 0;
|
|
471
|
+
bottom: 0;
|
|
472
|
+
width: 100%;
|
|
473
|
+
z-index: 99998;
|
|
474
|
+
background: rgba(0, 0, 0, 0.87);
|
|
475
|
+
opacity: 0.3;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.modal {
|
|
479
|
+
visibility: visible;
|
|
480
|
+
position: fixed;
|
|
481
|
+
left: 50%;
|
|
482
|
+
transform: translate(-50%, -50%);
|
|
483
|
+
z-index: 99999;
|
|
484
|
+
background: white;
|
|
485
|
+
padding: 20px;
|
|
486
|
+
border-radius: 8px;
|
|
487
|
+
top: 50%;
|
|
488
|
+
max-width: 100%;
|
|
489
|
+
width: 460px;
|
|
490
|
+
min-width: 300px;
|
|
491
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
|
|
492
|
+
-webkit-font-smoothing: antialiased;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.closeButton {
|
|
496
|
+
color: #BBC0C5;
|
|
497
|
+
cursor: pointer;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.logoContainer {
|
|
501
|
+
margin-left: 24px;
|
|
502
|
+
margin-right: 24px;
|
|
503
|
+
margin-top: 24px;
|
|
504
|
+
display: flex;
|
|
505
|
+
align-items: center;
|
|
506
|
+
justify-content: center;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.connectMobileText {
|
|
510
|
+
font-size: 14px;
|
|
511
|
+
color: black;
|
|
512
|
+
margin-top: 28px;
|
|
513
|
+
margin-bottom: 28px;
|
|
514
|
+
line-height: 2;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.blue {
|
|
518
|
+
color: #037DD6;
|
|
519
|
+
font-weight: 700;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.installExtensionText {
|
|
523
|
+
margin-left: 10px;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.center {
|
|
527
|
+
display: flex;
|
|
528
|
+
justify-content: center;
|
|
529
|
+
align-items: center;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.right {
|
|
533
|
+
display: flex;
|
|
534
|
+
align-items: center;
|
|
535
|
+
justify-content: right;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
#sdk-mm-qrcode {
|
|
539
|
+
svg {
|
|
540
|
+
width: 50%;
|
|
541
|
+
}
|
|
542
|
+
}`;var ey=Object.freeze({__proto__:null,mm_install_modal:Xf,mm_pending_modal:Qf,mm_select_modal:eh});export{In as CommunicationLayerPreference,Be as ConnectionStatus,er as DEFAULT_SERVER_URL,te as EventType,Ae as MessageType,ry as MetaMaskSDK,Qe as MetaMaskSDKEvent,Lt as PROVIDER_UPDATE_TYPE,Fe as PlatformType,Um as SDKProvider,ry as default};
|
|
543
|
+
//# sourceMappingURL=metamask-sdk-Dk18cS5U.js.map
|