@dcl/shop 1.11.2 → 1.11.3-33096177368.commit-6f0f3de
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-BhrsqnTy.js → Activity-DDiEmOsx.js} +8 -8
- package/_assets/{AnimatedBackground-DB2urHfN.js → AnimatedBackground-CVHTTGZi.js} +2 -2
- package/_assets/{Assets-CEOKXfHN.js → Assets-R174CnUb.js} +3 -3
- package/_assets/{Authorizations-zY_jkrdd.js → Authorizations-BpQ-lzdP.js} +2 -2
- package/_assets/{Cart-CD3QMZMU.js → Cart-BsI419x2.js} +2 -2
- package/_assets/{Collection-fLHFUGHo.js → Collection-C620zyzC.js} +2 -2
- package/_assets/{CollectionCarousel-Cs01J4sG.js → CollectionCarousel-Cwf724uA.js} +38 -21
- package/_assets/{Confetti-DI93CkCr.js → Confetti-CB1yZzVw.js} +4 -4
- package/_assets/{ConstantsUtil-9orAwS_V.js → ConstantsUtil-CFYdyJk0.js} +2 -2
- package/_assets/{ContentClient-Dr4IkAbb.js → ContentClient-GzostOsU.js} +2 -2
- package/_assets/{Creator-DGT3lqoW.js → Creator-DxjcHNGc.js} +2 -2
- package/_assets/{DeploymentBuilder-BsQ4GIy9.js → DeploymentBuilder-DDKLtbBM.js} +2 -2
- package/_assets/{EmotePlaybackBar-WqjOzm12.js → EmotePlaybackBar-DVIeTHjQ.js} +3 -3
- package/_assets/{ErrorNotice-BanVYx_o.js → ErrorNotice-DGpmSHFq.js} +2 -2
- package/_assets/{ExchangeController-BWLF9BXM.js → ExchangeController-56N8xni5.js} +2 -2
- package/_assets/{Faq-Dt8RPaHZ.js → Faq-mlHE1lJ-.js} +2 -2
- package/_assets/{GetCredits-BtM_F2J_.js → GetCredits-DsOH_PZB.js} +2 -2
- package/_assets/{Grow-DqnkmJ7j.js → Grow-D6DG-S-e.js} +2 -2
- package/_assets/{HelpersUtil-BtPtcaFe.js → HelpersUtil-BjRYK1HI.js} +2 -2
- package/_assets/{ItemDetail-C28UgJKw.js → ItemDetail-DO0vMUED.js} +319 -319
- package/_assets/{LoadMore-hoiSVN2H.js → LoadMore-CHhSQR_A.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-rIYX7xjf.js → ManaPricingBanner.styles-CAJcVFK8.js} +2 -2
- package/_assets/{MyAssets-BtAcjcuT.js → MyAssets-Dj6Kvu7N.js} +2 -2
- package/_assets/{MyFavorites-C3BVkIkn.js → MyFavorites-BF76BQio.js} +2 -2
- package/_assets/{NetworkUtil-BIUbrPWa.js → NetworkUtil-DuWsUf1s.js} +2 -2
- package/_assets/{NotFound-BgmQ5oFS.js → NotFound-DMt0E07P.js} +2 -2
- package/_assets/{NotificationsBell-Bjpu5hGT.js → NotificationsBell-CFknF7nN.js} +2 -2
- package/_assets/{OutfitDetail-CIeX74fk.js → OutfitDetail-CqvqCpur.js} +2 -2
- package/_assets/{OutfitPreview-Clicok_x.js → OutfitPreview-BWSHYJQo.js} +2 -2
- package/_assets/{OutfitStudio-DLStaax_.js → OutfitStudio-YYVzC2vq.js} +2 -2
- package/_assets/{StoreSettings-DwoVLG99.js → StoreSettings-Bcj58Qsl.js} +22 -22
- package/_assets/{Success-BKkeu6d7.js → Success-DQFnJCq1.js} +31 -31
- package/_assets/{SwapController-Cnrhnusk.js → SwapController-BG_0Rnli.js} +2 -2
- package/_assets/{TradeService-BgsoZh0O.js → TradeService-BQ0LfIIn.js} +2 -2
- package/_assets/{W3MFrameProviderSingleton-DqaMm2mV.js → W3MFrameProviderSingleton-DFZh2-P1.js} +4 -4
- package/_assets/{WebCryptoP256-R5qc29Sl.js → WebCryptoP256-DY-BoRUy.js} +2 -2
- package/_assets/{authorizations-DC168PVR.js → authorizations-r_yIs4_S.js} +2 -2
- package/_assets/{basic-CcMC-Noe.js → basic-NTA-d2L3.js} +2 -2
- package/_assets/{biconomy-MuBR1fCG.js → biconomy-Ca4RWWX7.js} +2 -2
- package/_assets/{browseLayout.styles-C_vn8XYJ.js → browseLayout.styles-B5WZBOX4.js} +2 -2
- package/_assets/{browser-CTTbQgwQ.js → browser-BSJZzHk7.js} +2 -2
- package/_assets/{browser-ponyfill-2MY_3eYQ.js → browser-ponyfill-BfJ9XPXG.js} +2 -2
- package/_assets/{builder-CpxipFmE.js → builder-C7euKgzs.js} +2 -2
- package/_assets/{buy-C9vFcpIy.js → buy-BBspDwaD.js} +2 -2
- package/_assets/{buy-gasless-Co1yjKqt.js → buy-gasless-CDHGUFyR.js} +2 -2
- package/_assets/{categories-DSulO5YB.js → categories-CSWMIFKV.js} +2 -2
- package/_assets/{ccip-BGKWaLZd.js → ccip-C-7Q5nOx.js} +2 -2
- package/_assets/{ccip-CIGFVe9f.js → ccip-D59yTDkH.js} +2 -2
- package/_assets/{chains-B_96BGTk.js → chains-Df2U73pw.js} +2 -2
- package/_assets/collectionPage.styles-CVj8bQ38.js +40 -0
- package/_assets/{common-nayH6Qb7.js → common-Ced0DDGw.js} +2 -2
- package/_assets/{controller-BoM50IGk.js → controller-VIdMekC7.js} +3 -3
- package/_assets/{core-C6U0AzoB.js → core-DnqUUiNf.js} +5 -5
- package/_assets/{createSvgIcon-DLtjIgIX.js → createSvgIcon-rpmuP-04.js} +2 -2
- package/_assets/{custom-BDzyroM1.js → custom-CaIsQUk6.js} +2 -2
- package/_assets/{data-capture-Zb8-AfOh.js → data-capture-VFIfTOLh.js} +2 -2
- package/_assets/{dcl-schemas-OH8G4Ndl.js → dcl-schemas-D3MMsa96.js} +2 -2
- package/_assets/{decimals-gxw11IoF.js → decimals-Bhq5HaFG.js} +2 -2
- package/_assets/{decimals-DwmaOPpT.js → decimals-CbgB-D98.js} +2 -2
- package/_assets/{detectExtension-GZk2y11b.js → detectExtension-CTH4nWTQ.js} +2 -2
- package/_assets/{disposePreview-CoU0o2LJ.js → disposePreview-Dhj7G1yu.js} +2 -2
- package/_assets/{email-Bs2nQCjl.js → email-DKwgACJ9.js} +2 -2
- package/_assets/{embedded-wallet-DaMZY5wt.js → embedded-wallet-BvFexqw_.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-pl53fr_X.js → emotion-styled.browser.esm--6OqWmeO.js} +2 -2
- package/_assets/{engine-_-Y9EygX.js → engine-Cj_ytnKe.js} +2 -2
- package/_assets/{errors-ISVrHVty.js → errors-V6zhnTod.js} +2 -2
- package/_assets/{estimate-l1-fee-C2MojaUq.js → estimate-l1-fee-CRr-9P4j.js} +2 -2
- package/_assets/{eth_estimateGas-ByaJEeM-.js → eth_estimateGas-8PG-LgjK.js} +2 -2
- package/_assets/{eth_getStorageAt-CfRtAGD-.js → eth_getStorageAt-CzRui93q.js} +2 -2
- package/_assets/{eth_getTransactionCount-DCx1pf2k.js → eth_getTransactionCount-B6uEKHJJ.js} +2 -2
- package/_assets/{ethereum-BgVZC6F_.js → ethereum-u7pXJb69.js} +2 -2
- package/_assets/{ethers-DwK2TdL6.js → ethers-CFmosx3s.js} +2 -2
- package/_assets/{events-CSIN-_05.js → events-BijXrLgV.js} +2 -2
- package/_assets/{execute-wmZZdldV.js → execute-B12s_EMl.js} +3 -3
- package/_assets/{extractIPFS-BS6I288E.js → extractIPFS-BO3gyVwL.js} +2 -2
- package/_assets/{features-DimRp-1s.js → features-DvGGBhy_.js} +2 -2
- package/_assets/{fetchTokenMetadata-DZy_tSZt.js → fetchTokenMetadata-B-L9nStS.js} +3 -3
- package/_assets/{field.styles-6_NAJBdz.js → field.styles-BYvs7GyZ.js} +2 -2
- package/_assets/{fortmatic-D-iEWKOV.js → fortmatic-Dk7tB2Cc.js} +2 -2
- package/_assets/{get-bytecode-We_Yud0L.js → get-bytecode-CRhd_-w6.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-CZ2Y-cLY.js → get-ecosystem-wallet-info-84hXtg9T.js} +2 -2
- package/_assets/{getBalance-SeTBLCzL.js → getBalance-BZ5IqH6E.js} +3 -3
- package/_assets/{getInstalledModules-Dj-K4xQC.js → getInstalledModules-BxDwRN8h.js} +2 -2
- package/_assets/{getNFT-BCYWBTK4.js → getNFT-B_RYObDB.js} +3 -3
- package/_assets/{getNFT-BiPo4cEC.js → getNFT-BlXV1Nbm.js} +2 -2
- package/_assets/{grid.styles-DlGaOCzf.js → grid.styles-B15cNj07.js} +2 -2
- package/_assets/{hashTypedData-OCiZaYsv.js → hashTypedData-CvW0E5r9.js} +2 -2
- package/_assets/{hashTypedData-Dr6t3Q-D.js → hashTypedData-iIDq5Ym-.js} +2 -2
- package/_assets/{in-app-CVvPAYT7.js → in-app-BtFFE7ZS.js} +2 -2
- package/_assets/{in-app-wallet-calls-ChA73nJF.js → in-app-wallet-calls-DUdTy2mQ.js} +2 -2
- package/_assets/{index-BDJuqgxU.js → index-1aJPWImZ.js} +2 -2
- package/_assets/{index-BWEvNyOP.js → index-4yyQV3Ii.js} +2 -2
- package/_assets/{index-CFGlj3ri.js → index-75GXxbyC.js} +2 -2
- package/_assets/{index-CATjpM0W.js → index-8Sq2Laxu.js} +2 -2
- package/_assets/{index-Cj5zg5gT.js → index-Awgz4ffT.js} +2 -2
- package/_assets/{index-BACBbqlk.js → index-B7yEfYvF.js} +2 -2
- package/_assets/{index-DLKAGp7r.js → index-BERlZlkD.js} +2 -2
- package/_assets/{index-nQ3hptXe.js → index-BFQuWtYs.js} +2 -2
- package/_assets/{index-gm_D0aNI.js → index-BGRK42zM.js} +2 -2
- package/_assets/{index-_-VFmxzj.js → index-BGa7JO1k.js} +2 -2
- package/_assets/{index-BPQVwfa5.js → index-BJYAOcKy.js} +2 -2
- package/_assets/{index-D7_zDlZP.js → index-Be3X4HXZ.js} +2 -2
- package/_assets/{index-DGwAzxg5.js → index-BfA6yQqc.js} +2 -2
- package/_assets/{index-C3LVhWuY.js → index-Bi_cxGZL.js} +2 -2
- package/_assets/{index-BHbHN01N.js → index-Blu_X-5c.js} +2 -2
- package/_assets/{index-DejzmYQv.js → index-BtF9e9Uu.js} +2 -2
- package/_assets/{index-ChNIU-k1.js → index-BtyN-hwY.js} +2 -2
- package/_assets/{index-CUa90VgH.js → index-BynUY8x7.js} +2 -2
- package/_assets/{index-D2CYJ9zD.js → index-BzifxYje.js} +2 -2
- package/_assets/{index-BjdjqJv4.js → index-C7t87Zs_.js} +4 -4
- package/_assets/{index-CQvLWK26.js → index-CHDVYYal.js} +2 -2
- package/_assets/{index-CS1VnyR1.js → index-CHp8Yn9f.js} +2 -2
- package/_assets/{index-2aK4zhJE.js → index-CLoD3Be1.js} +2 -2
- package/_assets/{index-ncctYqB-.js → index-CMAp5Zcw.js} +2 -2
- package/_assets/{index-Ct9dUkSX.js → index-CQtnSuxq.js} +2 -2
- package/_assets/{index-CO9qakt0.js → index-CSUAwcgb.js} +2 -2
- package/_assets/{index-CY38y8q8.js → index-CX3dLd9W.js} +2 -2
- package/_assets/{index-CtayMM8a.js → index-Cd-qOUE-.js} +4 -4
- package/_assets/{index-ARGrbe3A.js → index-CdKgL1QK.js} +3 -3
- package/_assets/{index-DAqd6v3r.js → index-ChboSjzT.js} +2 -2
- package/_assets/{index-D8QWWYMI.js → index-CitByYvg.js} +2 -2
- package/_assets/{index-DZcNiUa1.js → index-CqyGsGNi.js} +2 -2
- package/_assets/{index-B2uxq6bU.js → index-CtxqhjhC.js} +2 -2
- package/_assets/{index-B0OkSRGZ.js → index-Cu3FnKVy.js} +2 -2
- package/_assets/{index-DCE7JXu8.js → index-Cu7kQ3eJ.js} +2 -2
- package/_assets/{index-B1wSCmue.js → index-CwoKDI7V.js} +2 -2
- package/_assets/{index-BiAbz-7Q.js → index-D-jGbFC6.js} +2 -2
- package/_assets/{index-CbMw0H1W.js → index-D22uBSRA.js} +3 -3
- package/_assets/{index-DKiFTtAe.js → index-D6KrRNZn.js} +3 -3
- package/_assets/{index-CK4WqWqO.js → index-DCrOq2wd.js} +2 -2
- package/_assets/{index-DRR34LYo.js → index-DFLKOa3I.js} +2 -2
- package/_assets/{index-BlorBoCd.js → index-DGi-pDgC.js} +2 -2
- package/_assets/{index-BPinodm9.js → index-DIURmrHc.js} +2 -2
- package/_assets/{index-Axq2dKdE.js → index-DOYNCVik.js} +2 -2
- package/_assets/{index-DJXUib_8.js → index-DOZ6UG7t.js} +2 -2
- package/_assets/{index-Dn8vBHwo.js → index-DTQo8MWQ.js} +2 -2
- package/_assets/{index-CGdQ1CYx.js → index-DcdoZVBU.js} +3 -3
- package/_assets/{index-DGUzkX-I.js → index-DsLn2baO.js} +2 -2
- package/_assets/{index-bJXcZSYa.js → index-DtHHdoPj.js} +152 -123
- package/_assets/{index-CmcTFc5W.js → index-DucxpIJX.js} +4 -4
- package/_assets/{index-ficvqfHi.js → index-DyHgoZVr.js} +2 -2
- package/_assets/{index-DibFNBla.js → index-ET91y1L4.js} +2 -2
- package/_assets/{index-BJA_2Ynv.js → index-FwAqH4Jg.js} +2 -2
- package/_assets/{index-gAex9EE8.js → index-GMK5LYtv.js} +2 -2
- package/_assets/{index-MZXf7D1W.js → index-INu2i__0.js} +2 -2
- package/_assets/{index-B9Up_SK0.js → index-IzgVmiKy.js} +2 -2
- package/_assets/{index-n4qOUE64.js → index-O3-idy_g.js} +2 -2
- package/_assets/{index-D1jUYM4a.js → index-SrWaz5aK.js} +2 -2
- package/_assets/{index-Cst1nEOO.js → index-Wv_D67im.js} +2 -2
- package/_assets/{index-G5AacsmF.js → index-asQzvqC5.js} +2 -2
- package/_assets/{index-zkaZwO7E.js → index-hgUDiN1A.js} +2 -2
- package/_assets/{index-CWThS2BY.js → index-jDlI52U4.js} +2 -2
- package/_assets/{index-D0Wlf6gr.js → index-juvpUDkX.js} +2 -2
- package/_assets/{index-B3Ji4DRo.js → index-kJ8yZh7l.js} +2 -2
- package/_assets/{index-D0q045Px.js → index-phZzSnhX.js} +2 -2
- package/_assets/{index-Dxe6AOQE.js → index-shk4Nfrg.js} +2 -2
- package/_assets/{index-CmcvBNcU.js → index-xUQrDXPD.js} +2 -2
- package/_assets/{index.es-DzLQ6Fnb.js → index.es-B5BDv7Up.js} +2 -2
- package/_assets/{index.es-CstVHWlV.js → index.es-BKFBDEdF.js} +5 -5
- package/_assets/{index.es-DYbPPtM5.js → index.es-Dk-yJOBf.js} +2 -2
- package/_assets/{index.es-4xrWWZcO.js → index.es-nTFebsyp.js} +2 -2
- package/_assets/items-empty-DtvQhcHO.js +2 -0
- package/_assets/{jump-CVtY0iTz.js → jump-CKAtFOwO.js} +2 -2
- package/_assets/{linkAccount-6NTQv8aT.js → linkAccount-D37ZKt7i.js} +2 -2
- package/_assets/{localBatchGatewayRequest-Dks7VfkN.js → localBatchGatewayRequest-CnvnHVld.js} +2 -2
- package/_assets/{native-CXAGKkI7.js → native-CAETsTK5.js} +2 -2
- package/_assets/{networks-DtT18tMT.js → networks-DRuoicxJ.js} +2 -2
- package/_assets/{onramp-CUVL5AKN.js → onramp-BwGhJ_q4.js} +2 -2
- package/_assets/{openzeppelin-C6HmSX5F.js → openzeppelin-DAbLTIrx.js} +2 -2
- package/_assets/{ownerOf-iHeO-A0L.js → ownerOf-CccB5Df2.js} +2 -2
- package/_assets/{parseNft-_qkiBgGY.js → parseNft-QMLtRgH8.js} +3 -3
- package/_assets/{parseSignature-DpYJxwtD.js → parseSignature-DBFFz9Fc.js} +2 -2
- package/_assets/{parseSignature-DCX2Homx.js → parseSignature-DLhzdjdz.js} +4 -4
- package/_assets/{passkeys-CaDDwDfa.js → passkeys-DUhoeSr2.js} +2 -2
- package/_assets/{pay-with-exchange-mjjMFDoB.js → pay-with-exchange-wv4pj6K4.js} +2 -2
- package/_assets/{prepare-contract-call-B3PEXjk8.js → prepare-contract-call-CZgIb5_m.js} +2 -2
- package/_assets/{qr-overlay-Dte-FwLF.js → qr-overlay-BvMbYq7B.js} +4 -4
- package/_assets/{react-Io5Wove7.js → react-Cu6RTeaf.js} +2 -2
- package/_assets/{receive-BOylnCCD.js → receive-B1TTNgiL.js} +2 -2
- package/_assets/{resolveImplementation-eqKe_Jd_.js → resolveImplementation-DqHPzOZ1.js} +2 -2
- package/_assets/{resume-buy-l-MsHDN-.js → resume-buy-DBJOysCn.js} +2 -2
- package/_assets/{rpc-Bd3ag8E4.js → rpc-DY_6x6sN.js} +2 -2
- package/_assets/{sales-empty-71lDTBeo.js → sales-empty-sKHyys3f.js} +2 -2
- package/_assets/{search-empty-C2pIWVz4.js → search-empty-BLqSZDPi.js} +2 -2
- package/_assets/{secp256k1-D89skxyt.js → secp256k1-BEqU8sYg.js} +2 -2
- package/_assets/{secp256k1-ChjjZr2n.js → secp256k1-CmiJzTHS.js} +2 -2
- package/_assets/{secp256k1-BCTY01q6.js → secp256k1-WxEVCU75.js} +2 -2
- package/_assets/{send-BoRH3tdn.js → send-CAIzabYu.js} +2 -2
- package/_assets/{send-batch-transaction-qs3ijcbz.js → send-batch-transaction-D8sYAmn9.js} +2 -2
- package/_assets/{send-eip712-transaction-BLU365vg.js → send-eip712-transaction-Bj_Dviud.js} +3 -3
- package/_assets/{send-gasless-transaction-COE6PePF.js → send-gasless-transaction-D1sAgdfS.js} +3 -3
- package/_assets/{send-transaction-DWia223-.js → send-transaction-BlkeWOl3.js} +3 -3
- package/_assets/{sendMetaTransaction-Bnb1e1Oo.js → sendMetaTransaction-CqnRe296.js} +2 -2
- package/_assets/{sendRawTransaction-QUpRtv1T.js → sendRawTransaction-cowcF1Zi.js} +4 -4
- package/_assets/{sentry-faeuEJiQ.js → sentry-BIexM3hF.js} +3 -3
- package/_assets/{serializeTransaction-Bzap5VIj.js → serializeTransaction-DXNnXLd5.js} +2 -2
- package/_assets/{session-proposal-BRPQA6_F.js → session-proposal-DKZwcLCZ.js} +2 -2
- package/_assets/{session-request-DE3BfIwL.js → session-request-Dak6hx32.js} +3 -3
- package/_assets/{sha256-my9t8oLg.js → sha256-D6LtjOnB.js} +2 -2
- package/_assets/{signing-BKRnKKdl.js → signing-CeMNDy_m.js} +4 -4
- package/_assets/{skeleton.styles-Cjpy58bn.js → skeleton.styles-BC2avkie.js} +2 -2
- package/_assets/{socials-CHs46oCs.js → socials-ygRGzmms.js} +2 -2
- package/_assets/{styled-3e6FPpFM.js → styled-DjZ-UOQs.js} +2 -2
- package/_assets/{swaps-BQAfj8hR.js → swaps-DomEuyxC.js} +2 -2
- package/_assets/{thirdweb-I3ycy-sq.js → thirdweb-pkB5sCqN.js} +4 -4
- package/_assets/{to-serializable-transaction-D4JXNF6K.js → to-serializable-transaction-BGYR6mL7.js} +3 -3
- package/_assets/{totalSupply-RRjcgrsd.js → totalSupply-_s3nO9Hq.js} +2 -2
- package/_assets/{transaction-CpNDZT6H.js → transaction-Drph0tvC.js} +2 -2
- package/_assets/{transactionReceipt-BsGymDgp.js → transactionReceipt-UBxlSqk5.js} +2 -2
- package/_assets/{transactions-ZyGjrTz1.js → transactions-CHMKCKRv.js} +2 -2
- package/_assets/{useCreditPacks-RKaHRtDl.js → useCreditPacks-DV8TpCkV.js} +2 -2
- package/_assets/{useInfiniteGrid-CKUOL3of.js → useInfiniteGrid-EJxCLDAB.js} +2 -2
- package/_assets/{useStore-zwLaMv5E.js → useStore-CmOmf_pZ.js} +3 -3
- package/_assets/{useTheme-6lXtg_We.js → useTheme-CxS-nUL6.js} +2 -2
- package/_assets/{utils-DmCacC3Z.js → utils-DK0-s9yl.js} +2 -2
- package/_assets/{verifyHash-BnLy1LQ8.js → verifyHash-C7Sy8sQa.js} +2 -2
- package/_assets/{w3m-modal-igkHA2Yg.js → w3m-modal-DlSk4w8R.js} +2 -2
- package/_assets/{w3m-modal-CqeYEpsp.js → w3m-modal-dl0m9MGw.js} +2 -2
- package/_assets/{wait-for-tx-receipt-BBZ5JG62.js → wait-for-tx-receipt-u8qlSCaY.js} +2 -2
- package/_assets/{wallets-BUa02PiV.js → wallets-rkrKp4c1.js} +6 -6
- package/_assets/{web-connector-C7j-Aqf_.js → web-connector-B0ui-2UM.js} +4 -4
- package/_assets/{writeContract-DUS_4K4j.js → writeContract-CIcRNaaC.js} +2 -2
- package/_assets/{zora-sepolia-CDPQd0aL.js → zora-sepolia-BMPN4lD4.js} +2 -2
- package/_assets/{zoraTestnet-DzzH_a_k.js → zoraTestnet-CnfxOehO.js} +2 -2
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/collectionPage.styles-DUDsxvQH.js +0 -40
- package/_assets/items-empty-CpzVwMne.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as D,Z as qe,t as H,O as x,a7 as $e,e as De,p as xe,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-
|
|
3
|
-
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function i(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",i).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(i,e){var n;let t;if(typeof e.connector=="function"?t=i._internal.connectors.setup(e.connector):t=e.connector,t.uid===i.state.current)throw new ht;try{i.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:o,...s}=e,u=await t.connect(s);return t.emitter.off("connect",i._internal.events.connect),t.emitter.on("change",i._internal.events.change),t.emitter.on("disconnect",i._internal.events.disconnect),await((n=i.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),i.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:s.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:s.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(o){throw i.setState(s=>({...s,status:s.current?"connected":"disconnected"})),o}}async function G(i,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(i.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=i.state.connections.get(i.state.current);if(!n)throw new ft;const o=e.chainId??n.chainId,s=await n.connector.getChainId();if(t&&s!==o)throw new mt({connectionChainId:o,connectorChainId:s});const u=n.connector;if(u.getClient)return u.getClient({chainId:o});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=i.chains.find(r=>r.id===o),a=await n.connector.getProvider({chainId:o});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(i,e={}){var o,s;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=i.state,d=u.get(c);t=d==null?void 0:d.connector}const n=i.state.connections;t&&(await t.disconnect(),t.emitter.off("change",i._internal.events.change),t.emitter.off("disconnect",i._internal.events.disconnect),t.emitter.on("connect",i._internal.events.connect),n.delete(t.uid)),i.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=i.state.current;if(!u)return;const c=(o=i.state.connections.get(u))==null?void 0:o.connector;if(!c)return;await((s=i.storage)==null?void 0:s.setItem("recentConnectorId",c.id))}}async function wt(i,e){const{chainId:t,connector:n,...o}=e;let s;e.account?s=e.account:s=(await G(i,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=i.getClient({chainId:t});return U(u,Xe,"estimateGas")({...o,account:s})}async function pt(i,e){const{address:t,blockNumber:n,blockTag:o,chainId:s}=e,u=i.getClient({chainId:s}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:o}),a=i.chains.find(r=>r.id===s)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(i.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(i)&&Array.isArray(e)){if(t=i.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(i[n],e[n]))return!1;return!0}if(typeof i.valueOf=="function"&&i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(typeof i.toString=="function"&&i.toString!==Object.prototype.toString)return i.toString()===e.toString();const o=Object.keys(i);if(t=o.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,o[n]))return!1;for(n=t;n--!==0;){const s=o[n];if(s&&!V(i[s],e[s]))return!1}return!0}return i!==i&&e!==e}function se(i){const e=i.state.current,t=i.state.connections.get(e),n=t==null?void 0:t.accounts,o=n==null?void 0:n[0],s=i.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=i.state.status;switch(u){case"connected":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!o,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(i){const e=[...i.state.connections.values()];return i.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o}),U(u,Ye,"prepareTransactionRequest")({...s,...t?{account:t}:{}})}let le=!1;async function he(i,e={}){var a,r;if(le)return[];le=!0,i.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=i._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...i.connectors);let n;try{n=await((r=i.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const o={};for(const[,l]of i.state.connections)o[l.connector.id]=1;n&&(o[n]=0);const s=Object.keys(o).length>0?[...t].sort((l,g)=>(o[l.id]??10)-(o[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of s){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",i._internal.events.connect),l.emitter.on("change",i._internal.events.change),l.emitter.on("disconnect",i._internal.events.disconnect),i.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(i.state.status==="reconnecting"||i.state.status==="connecting")&&(u?i.setState(l=>({...l,status:"connected"})):i.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:s.gas??void 0})}async function bt(i,e){const{account:t,connector:n,...o}=e;let s;return typeof t=="object"&&t.type==="local"?s=i.getClient():s=await G(i,{account:t,connector:n}),U(s,ut,"signMessage")({...o,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(i,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,o=i.state.connections.get(((u=e.connector)==null?void 0:u.uid)??i.state.current);if(o){const c=o.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const s=i.chains.find(c=>c.id===n);if(!s)throw new z;return i.setState(c=>({...c,chainId:n})),s}async function At(i,e){const{chainId:t,timeout:n=0,...o}=e,s=i.getClient({chainId:t}),c=await U(s,st,"waitForTransactionReceipt")({...o,timeout:n});if(c.status==="reverted"){const d=U(s,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(s,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:s.chain.id}}function Nt(i,e){const{onChange:t}=e;return i.subscribe(()=>se(i),t,{equalityFn(n,o){const{connector:s,...u}=n,{connector:c,...d}=o;return V(u,d)&&(s==null?void 0:s.id)===(c==null?void 0:c.id)&&(s==null?void 0:s.uid)===(c==null?void 0:c.uid)}})}function Et(i,e){const{onChange:t}=e;return i.subscribe(()=>M(i),t,{equalityFn:V})}function St(i,e){const{onChange:t}=e;return i._internal.connectors.subscribe((n,o)=>{t(Object.values(n),o)})}function _t(i,e){const{syncConnectedChain:t=i._internal.syncConnectedChain,...n}=e;let o;const s=d=>{o&&o();const a=i.getClient({chainId:d});return o=U(a,rt,"watchPendingTransactions")(n),o},u=s(e.chainId);let c;return t&&!e.chainId&&(c=i.subscribe(({chainId:d})=>d,async d=>s(d))),()=>{u==null||u(),c==null||c()}}async function Tt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c})}function dn(i){return i}ae.type="injected";function ae(i={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=i;function n(){const d=i.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let o,s,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&i.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),o||(o=this.onAccountsChanged.bind(this),a.on("accountsChanged",o)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),i.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;s&&(a.removeListener("chainChanged",s),s=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),i.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!i.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(s&&(r.removeListener("chainChanged",s),s=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(i){return i!=null&&i.coinbaseWalletExtension?i.coinbaseWalletExtension:oe(i,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(i){return oe(i,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(i){var e,t;return(e=i==null?void 0:i.phantom)!=null&&e.ethereum?(t=i.phantom)==null?void 0:t.ethereum:oe(i,"isPhantom")}}};function oe(i,e){function t(o){return typeof e=="function"?e(o):typeof e=="string"?o[e]:!0}const n=i.ethereum;if(n!=null&&n.providers)return n.providers.find(o=>t(o));if(n&&t(n))return n}const kt=i=>(e,t,n)=>{const o=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return o(a)},i(e,t,n)},Rt=kt;function Ot(i,e){let t;try{t=i()}catch{return}return{getItem:o=>{var s;const u=d=>d===null?null:JSON.parse(d,void 0),c=(s=t.getItem(o))!=null?s:null;return c instanceof Promise?c.then(u):u(c)},setItem:(o,s)=>t.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>t.removeItem(o)}}const me=i=>e=>{try{const t=i(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(i,e)=>(t,n,o)=>{let s={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=s.storage;if(!a)return i((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...m)},n,o);const r=()=>{const m=s.partialize({...n()});return a.setItem(s.name,{state:m,version:s.version})},l=o.setState;o.setState=(m,I)=>{l(m,I),r()};const g=i((...m)=>{t(...m),r()},n,o);o.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=s.onRehydrateStorage)==null?void 0:I.call(s,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(s.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return[!0,s.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=s.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return o.persist={setOptions:m=>{s={...s,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},s.skipHydration||p(),f||g},jt=Ut,Ne=i=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=i(n,o,c);return c},fe=i=>i?Ne(i):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(i){return new Mt(i)}function Lt(i,e){return JSON.parse(i,(t,n)=>{let o=n;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(e==null?void 0:e(t,o))??o})}function Ee(i,e){return i.slice(0,e).join(".")||"."}function Se(i,e){const{length:t}=i;for(let n=0;n<t;++n)if(i[n]===e)return n+1;return 0}function qt(i,e){const t=typeof i=="function",n=typeof e=="function",o=[],s=[];return function(c,d){if(typeof d=="object")if(o.length){const a=Se(o,this);a===0?o[o.length]=this:(o.splice(a),s.splice(a)),s[s.length]=c;const r=Se(o,d);if(r!==0)return n?e.call(this,c,d,Ee(s,r)):`[ref=${Ee(s,r)}]`}else o[0]=d,s[0]=c;return t?i.call(this,c,d):d}}function $t(i,e,t,n){return JSON.stringify(i,qt((o,s)=>{let u=s;return typeof u=="bigint"&&(u={__type:"bigint",value:s.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(o,u))??u},n),t??void 0)}function Dt(i){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:o=Oe}=i;function s(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...o,key:t,async getItem(u,c){const d=o.getItem(`${t}.${u}`),a=await s(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await s(o.removeItem(d)):await s(o.setItem(d,n(c)))},async removeItem(u){await s(o.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function xt(){const i=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return i.getItem(e)},removeItem(e){i.removeItem(e)},setItem(e,t){try{i.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(i=11){if(!te||ee+i>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++i)}function Ft(i){const{multiInjectedProviderDiscovery:e=!0,storage:t=Dt({storage:xt()}),syncConnectedChain:n=!0,ssr:o=!1,...s}=i,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>s.chains),d=fe(()=>{const h=[],C=new Set;for(const w of s.connectors??[]){const A=a(w);if(h.push(A),!o&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!o&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:s.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(s.client)A=s.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(s);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>s.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:o,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!o,syncConnectedChain:n,transports:s.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(i){let e=[],t,n;function o(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function s(){var c;return t||(t=ye.getInstance({projectId:i.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:i.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=s();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=i.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=o(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:i.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:i.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return o(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(i){const e=i.isNewChainsStale??!0;let t,n,o,s,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:i.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(s||(s=this.onConnect.bind(this),r.on("connect",s)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=x.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),s&&(m.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),m.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{o&&(r==null||r.removeListener("chainChanged",o),o=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),s||(s=this.onConnect.bind(this),r==null||r.on("connect",s)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=i.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),o&&(l.removeListener("chainChanged",o),o=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=xe({pendingTransactions:0}),_e={state:F,subscribeKey(i,e){return De(F,i,e)},increase(i){F[i]+=1},decrease(i){F[i]-=1},reset(i){F[i]=0}};async function Bt(i){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-CbMw0H1W.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.type==="safe"))return e()}return null}async function zt(i){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-CbMw0H1W.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(i){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-CbMw0H1W.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:o,chainId:s}=se(this.wagmiConfig);return Promise.resolve({accounts:s?[...new Set(n||[o])].map(u=>ne.createAccount({caipAddress:`eip155:${s}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(o=>o.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(o=>{var c,d;const s=(c=e.transports)==null?void 0:c[o.id],u=X.getCaipNetworkId(o);s?t[o.id]=X.extendWagmiTransports(o,e.projectId,s):t[o.id]=X.getViemTransport(o,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(s=>s.id===t.chainId),o=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(s=>({address:this.toChecksummedAddress(s)})),caipNetwork:n,connectorId:t.connector.id,auth:o?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const o=e.address!==(t==null?void 0:t.address),s=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(o||s||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=x.state||{};if(n!==!1){const s=await zt(this.wagmiConfig.connectors);s&&e.push(s)}if(t!==!1){const s=await Vt(this.wagmiConfig.connectors);s&&e.push(s)}const o=await Bt(this.wagmiConfig.connectors);o&&e.push(o),await Promise.all(e.map(s=>{const u=this.configureInternalConnector(s);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];x.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:o,enableAuthLogger:s}=x.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:o,enableAuthLogger:s}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const o=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:o,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),o=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),s={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:o,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,s);const u=await yt(this.wagmiConfig,s);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,o=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===o);return{hash:await Tt(this.wagmiConfig,{chain:s,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=x.state||{},o=e.type===S.CONNECTOR_ID.INJECTED,s=e.id===S.CONNECTOR_ID.INJECTED,u=o&&!s;if(s&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:o}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&o}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,s=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(s!=null&&s.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=s==null?void 0:s.connector.type)==null?void 0:a.toUpperCase(),id:s==null?void 0:s.connector.id}}}return{chainId:Number(s==null?void 0:s.chainId),address:this.toChecksummedAddress(s==null?void 0:s.accounts[0]),provider:c,type:(r=s==null?void 0:s.connector.type)==null?void 0:r.toUpperCase(),id:s==null?void 0:s.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const o=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return o.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:o.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,o,s,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(o=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:o.get(p.uid);if(m){await((s=this.wagmiConfig.storage)==null?void 0:s.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(o=>o.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const o=`${n.caipNetworkId}:${e.address}`,s=this.balancePromises[o];if(s)return s;const u=H.getNativeBalanceCacheForCaipAddress(o);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[o]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:o,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[o]}),this.balancePromises[o]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),o=M(this.wagmiConfig).find(s=>Y.isLowerCaseMatch(s.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),x.state.enableReconnect===!1&&this.deleteConnection(e.id),o?{connections:[{accounts:o.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:o.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const o=this.getWagmiConnector(n.connector.id);return o&&await ve(this.wagmiConfig,{connector:o}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(o=>({address:this.toChecksummedAddress(o)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:o,nativeCurrency:s,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=s??t.nativeCurrency,g=o??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await s.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return s.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return s.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return s.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),o=this.getWagmiConnector("walletConnect");if(o&&!n.find(s=>s.connector.id===o.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[o]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const un=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,un as b,dn as c,ae as i};
|
|
4
|
-
//# sourceMappingURL=index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-D22uBSRA.js","_assets/index-DtHHdoPj.js","_assets/react-Cu6RTeaf.js","_assets/dcl-schemas-D3MMsa96.js","_assets/sentry-BIexM3hF.js","_assets/ethers-CFmosx3s.js","_assets/intl-AKLEHPeO.js","_assets/index-CKGO8NWe.css","_assets/sendRawTransaction-cowcF1Zi.js","_assets/NetworkUtil-DuWsUf1s.js","_assets/W3MFrameProviderSingleton-DFZh2-P1.js","_assets/index-Awgz4ffT.js","_assets/index-CdKgL1QK.js","_assets/events-BijXrLgV.js","_assets/browser-ponyfill-BfJ9XPXG.js","_assets/custom-CaIsQUk6.js","_assets/index-Blu_X-5c.js","_assets/index-Bi_cxGZL.js","_assets/store-80QKZ2rN.js","_assets/writeContract-CIcRNaaC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{w as Me,a as We,l as Ie,C as k,o as Le,a5 as ye,F as W,a6 as J,A as D,Z as qe,t as H,O as x,a7 as $e,e as De,p as xe,b as ne,a8 as He,a9 as X,aa as j,L as Fe,a3 as Y,ab as Q,X as be,ac as Be}from"./W3MFrameProviderSingleton-DFZh2-P1.js";import{al as ze,ao as Ve,ab as Ge,x as B,af as re,Y as _,r as de,au as S,az as ge,a4 as Ke}from"./NetworkUtil-DuWsUf1s.js";import{b7 as Je,bh as Te,aI as q,cv as Xe,bc as Ye,bi as Qe,ah as Ze}from"./sendRawTransaction-cowcF1Zi.js";import"./dcl-schemas-D3MMsa96.js";import"./index-Awgz4ffT.js";import"./index-CdKgL1QK.js";import"./browser-ponyfill-BfJ9XPXG.js";import{_ as we}from"./index-DtHHdoPj.js";import{E as et}from"./index-Blu_X-5c.js";import{c as tt}from"./store-80QKZ2rN.js";import{c as Pe,a as nt,g as it,b as st,d as ot,e as rt,p as ct}from"./custom-CaIsQUk6.js";import{s as at,w as dt}from"./writeContract-CIcRNaaC.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new i.Error().stack;e&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[e]="ca765f95-f73d-4260-8744-fde508dbff27",i._sentryDebugIdIdentifier="sentry-dbid-ca765f95-f73d-4260-8744-fde508dbff27")}catch{}})();async function ut(i,{account:e=i.account,message:t}){if(!e)throw new Je({docsPath:"/docs/actions/wallet/signMessage"});const n=Te(e);if(n.signMessage)return n.signMessage({message:t});const o=typeof t=="string"?ze(t):t.raw instanceof Uint8Array?Ve(t.raw):t.raw;return i.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}function U(i,e,t){const n=i[e.name];if(typeof n=="function")return n;const o=i[t];return typeof o=="function"?o:s=>e(i,s)}const ie="3.5.5",lt=()=>`@wagmi/core@${ie}`;var ke=function(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)},ce,Re;class O extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return lt()}constructor(e,t={}){var s;super(),ce.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=t.cause instanceof O?t.cause.details:(s=t.cause)!=null&&s.message?t.cause.message:t.details,o=t.cause instanceof O&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: ${this.docsBaseUrl}${o}.html${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
|
|
3
|
+
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return ke(this,ce,"m",Re).call(this,this,e)}}ce=new WeakSet,Re=function i(e,t){return t!=null&&t(e)?e:e.cause?ke(this,ce,"m",i).call(this,e.cause,t):e};class z extends O{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ht extends O{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ft extends O{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class gt extends O{constructor({address:e,connector:t}){super(`Account "${e}" not found for connector "${t.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class mt extends O{constructor({connectionChainId:e,connectorChainId:t}){super(`The current chain of the connector (id: ${t}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${t}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class Ct extends O{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function ue(i,e){var n;let t;if(typeof e.connector=="function"?t=i._internal.connectors.setup(e.connector):t=e.connector,t.uid===i.state.current)throw new ht;try{i.setState(c=>({...c,status:"connecting"})),t.emitter.emit("message",{type:"connecting"});const{connector:o,...s}=e,u=await t.connect(s);return t.emitter.off("connect",i._internal.events.connect),t.emitter.on("change",i._internal.events.change),t.emitter.on("disconnect",i._internal.events.disconnect),await((n=i.storage)==null?void 0:n.setItem("recentConnectorId",t.id)),i.setState(c=>({...c,connections:new Map(c.connections).set(t.uid,{accounts:s.withCapabilities?u.accounts.map(d=>typeof d=="object"?d.address:d):u.accounts,chainId:u.chainId,connector:t}),current:t.uid,status:"connected"})),{accounts:s.withCapabilities?u.accounts.map(c=>typeof c=="object"?c:{address:c,capabilities:{}}):u.accounts,chainId:u.chainId}}catch(o){throw i.setState(s=>({...s,status:s.current?"connected":"disconnected"})),o}}async function G(i,e={}){const{assertChainId:t=!0}=e;let n;if(e.connector){const{connector:r}=e;if(i.state.status==="reconnecting"&&!r.getAccounts&&!r.getChainId)throw new Ct({connector:r});const[l,g]=await Promise.all([r.getAccounts().catch(f=>{if(e.account===null)return[];throw f}),r.getChainId()]);n={accounts:l,chainId:g,connector:r}}else n=i.state.connections.get(i.state.current);if(!n)throw new ft;const o=e.chainId??n.chainId,s=await n.connector.getChainId();if(t&&s!==o)throw new mt({connectionChainId:o,connectorChainId:s});const u=n.connector;if(u.getClient)return u.getClient({chainId:o});const c=Te(e.account??n.accounts[0]);if(c&&(c.address=q(c.address)),e.account&&!n.accounts.some(r=>r.toLowerCase()===c.address.toLowerCase()))throw new gt({address:c.address,connector:u});const d=i.chains.find(r=>r.id===o),a=await n.connector.getProvider({chainId:o});return Pe({account:c,chain:d,name:"Connector Client",transport:r=>nt(a)({...r,retryCount:0})})}async function ve(i,e={}){var o,s;let t;if(e.connector)t=e.connector;else{const{connections:u,current:c}=i.state,d=u.get(c);t=d==null?void 0:d.connector}const n=i.state.connections;t&&(await t.disconnect(),t.emitter.off("change",i._internal.events.change),t.emitter.off("disconnect",i._internal.events.disconnect),t.emitter.on("connect",i._internal.events.connect),n.delete(t.uid)),i.setState(u=>{if(n.size===0)return{...u,connections:new Map,current:null,status:"disconnected"};const c=n.values().next().value;return{...u,connections:new Map(n),current:c.connector.uid}});{const u=i.state.current;if(!u)return;const c=(o=i.state.connections.get(u))==null?void 0:o.connector;if(!c)return;await((s=i.storage)==null?void 0:s.setItem("recentConnectorId",c.id))}}async function wt(i,e){const{chainId:t,connector:n,...o}=e;let s;e.account?s=e.account:s=(await G(i,{account:e.account,assertChainId:!1,chainId:t,connector:n})).account;const u=i.getClient({chainId:t});return U(u,Xe,"estimateGas")({...o,account:s})}async function pt(i,e){const{address:t,blockNumber:n,blockTag:o,chainId:s}=e,u=i.getClient({chainId:s}),d=await U(u,it,"getBalance")(n?{address:t,blockNumber:n}:{address:t,blockTag:o}),a=i.chains.find(r=>r.id===s)??u.chain;return{decimals:a.nativeCurrency.decimals,symbol:a.nativeCurrency.symbol,value:d}}function V(i,e){if(i===e)return!0;if(i&&e&&typeof i=="object"&&typeof e=="object"){if(i.constructor!==e.constructor)return!1;let t,n;if(Array.isArray(i)&&Array.isArray(e)){if(t=i.length,t!==e.length)return!1;for(n=t;n--!==0;)if(!V(i[n],e[n]))return!1;return!0}if(typeof i.valueOf=="function"&&i.valueOf!==Object.prototype.valueOf)return i.valueOf()===e.valueOf();if(typeof i.toString=="function"&&i.toString!==Object.prototype.toString)return i.toString()===e.toString();const o=Object.keys(i);if(t=o.length,t!==Object.keys(e).length)return!1;for(n=t;n--!==0;)if(!Object.hasOwn(e,o[n]))return!1;for(n=t;n--!==0;){const s=o[n];if(s&&!V(i[s],e[s]))return!1}return!0}return i!==i&&e!==e}function se(i){const e=i.state.current,t=i.state.connections.get(e),n=t==null?void 0:t.accounts,o=n==null?void 0:n[0],s=i.chains.find(c=>c.id===(t==null?void 0:t.chainId)),u=i.state.status;switch(u){case"connected":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:u};case"reconnecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!!o,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:u};case"connecting":return{address:o,addresses:n,chain:s,chainId:t==null?void 0:t.chainId,connector:t==null?void 0:t.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:u};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:u}}}let Z=[];function M(i){const e=[...i.state.connections.values()];return i.state.status==="reconnecting"||V(Z,e)?Z:(Z=e,e)}async function It(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;return typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o}),U(u,Ye,"prepareTransactionRequest")({...s,...t?{account:t}:{}})}let le=!1;async function he(i,e={}){var a,r;if(le)return[];le=!0,i.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const t=[];if((a=e.connectors)!=null&&a.length)for(const l of e.connectors){let g;typeof l=="function"?g=i._internal.connectors.setup(l):g=l,t.push(g)}else t.push(...i.connectors);let n;try{n=await((r=i.storage)==null?void 0:r.getItem("recentConnectorId"))}catch{}const o={};for(const[,l]of i.state.connections)o[l.connector.id]=1;n&&(o[n]=0);const s=Object.keys(o).length>0?[...t].sort((l,g)=>(o[l.id]??10)-(o[g.id]??10)):t;let u=!1;const c=[],d=[];for(const l of s){const g=await l.getProvider().catch(()=>{});if(!g||d.some(m=>m===g)||!await l.isAuthorized())continue;const p=await l.connect({isReconnecting:!0}).catch(()=>null);p&&(l.emitter.off("connect",i._internal.events.connect),l.emitter.on("change",i._internal.events.change),l.emitter.on("disconnect",i._internal.events.disconnect),i.setState(m=>{const I=new Map(u?m.connections:new Map).set(l.uid,{accounts:p.accounts,chainId:p.chainId,connector:l});return{...m,current:u?m.current:l.uid,connections:I}}),c.push({accounts:p.accounts,chainId:p.chainId,connector:l}),d.push(g),u=!0)}return(i.state.status==="reconnecting"||i.state.status==="connecting")&&(u?i.setState(l=>({...l,status:"connected"})):i.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),le=!1,c}async function yt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,at,"sendTransaction")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c,gas:s.gas??void 0})}async function bt(i,e){const{account:t,connector:n,...o}=e;let s;return typeof t=="object"&&t.type==="local"?s=i.getClient():s=await G(i,{account:t,connector:n}),U(s,ut,"signMessage")({...o,...t?{account:t}:{}})}class L extends O{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class vt extends O{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function Ae(i,e){var u;const{addEthereumChainParameter:t,chainId:n}=e,o=i.state.connections.get(((u=e.connector)==null?void 0:u.uid)??i.state.current);if(o){const c=o.connector;if(!c.switchChain)throw new vt({connector:c});return await c.switchChain({addEthereumChainParameter:t,chainId:n})}const s=i.chains.find(c=>c.id===n);if(!s)throw new z;return i.setState(c=>({...c,chainId:n})),s}async function At(i,e){const{chainId:t,timeout:n=0,...o}=e,s=i.getClient({chainId:t}),c=await U(s,st,"waitForTransactionReceipt")({...o,timeout:n});if(c.status==="reverted"){const d=U(s,ot,"getTransaction"),{from:a,...r}=await d({hash:c.transactionHash}),g=await U(s,Qe,"call")({...r,account:a,data:r.input,gasPrice:r.type!=="eip1559"?r.gasPrice:void 0,maxFeePerGas:r.type==="eip1559"?r.maxFeePerGas:void 0,maxPriorityFeePerGas:r.type==="eip1559"?r.maxPriorityFeePerGas:void 0}),f=g!=null&&g.data?Ge(`0x${g.data.substring(138)}`):"unknown reason";throw new Error(f)}return{...c,chainId:s.chain.id}}function Nt(i,e){const{onChange:t}=e;return i.subscribe(()=>se(i),t,{equalityFn(n,o){const{connector:s,...u}=n,{connector:c,...d}=o;return V(u,d)&&(s==null?void 0:s.id)===(c==null?void 0:c.id)&&(s==null?void 0:s.uid)===(c==null?void 0:c.uid)}})}function Et(i,e){const{onChange:t}=e;return i.subscribe(()=>M(i),t,{equalityFn:V})}function St(i,e){const{onChange:t}=e;return i._internal.connectors.subscribe((n,o)=>{t(Object.values(n),o)})}function _t(i,e){const{syncConnectedChain:t=i._internal.syncConnectedChain,...n}=e;let o;const s=d=>{o&&o();const a=i.getClient({chainId:d});return o=U(a,rt,"watchPendingTransactions")(n),o},u=s(e.chainId);let c;return t&&!e.chainId&&(c=i.subscribe(({chainId:d})=>d,async d=>s(d))),()=>{u==null||u(),c==null||c()}}async function Tt(i,e){const{account:t,chainId:n,connector:o,...s}=e;let u;typeof t=="object"&&(t==null?void 0:t.type)==="local"?u=i.getClient({chainId:n}):u=await G(i,{account:t??void 0,assertChainId:!1,chainId:n,connector:o});const c=(()=>{var r;return!n||((r=u.chain)==null?void 0:r.id)===n?u.chain:{id:n}})();return await U(u,dt,"writeContract")({...s,...t?{account:t}:{},assertChainId:!!n,chain:c})}function dn(i){return i}ae.type="injected";function ae(i={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:t}=i;function n(){const d=i.target;if(typeof d=="function"){const a=d();if(a)return a}return typeof d=="object"?d:typeof d=="string"?{...Pt[d]??{id:d,name:`${d[0].toUpperCase()}${d.slice(1)}`,provider:`is${d[0].toUpperCase()}${d.slice(1)}`}}:{id:"injected",name:"Injected",provider(a){return a==null?void 0:a.ethereum}}}let o,s,u,c;return d=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:ae.type,async setup(){const a=await this.getProvider();a!=null&&a.on&&i.target&&(u||(u=this.onConnect.bind(this),a.on("connect",u)),o||(o=this.onAccountsChanged.bind(this),a.on("accountsChanged",o)))},async connect({chainId:a,isReconnecting:r,withCapabilities:l}={}){var p,m,I,v,y,E;const g=await this.getProvider();if(!g)throw new L;let f=[];if(r)f=await this.getAccounts().catch(()=>[]);else if(e)try{f=(v=(I=(m=(p=(await g.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:p.caveats)==null?void 0:m[0])==null?void 0:I.value)==null?void 0:v.map(h=>q(h)),f.length>0&&(f=await this.getAccounts())}catch(N){const h=N;if(h.code===_.code)throw new _(h);if(h.code===de.code)throw h}try{!(f!=null&&f.length)&&!r&&(f=(await g.request({method:"eth_requestAccounts"})).map(C=>q(C))),u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c));let N=await this.getChainId();if(a&&N!==a){const h=await this.switchChain({chainId:a}).catch(C=>{if(C.code===_.code)throw C;return{id:N}});N=(h==null?void 0:h.id)??N}return e&&await((y=d.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),i.target||await((E=d.storage)==null?void 0:E.setItem("injected.connected",!0)),{accounts:l?f.map(h=>({address:h,capabilities:{}})):f,chainId:N}}catch(N){const h=N;throw h.code===_.code?new _(h):h.code===de.code?new de(h):h}},async disconnect(){var r,l;const a=await this.getProvider();if(!a)throw new L;s&&(a.removeListener("chainChanged",s),s=void 0),c&&(a.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),a.on("connect",u));try{await We(()=>a.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((r=d.storage)==null?void 0:r.setItem(`${this.id}.disconnected`,!0)),i.target||await((l=d.storage)==null?void 0:l.removeItem("injected.connected"))},async getAccounts(){const a=await this.getProvider();if(!a)throw new L;return(await a.request({method:"eth_accounts"})).map(l=>q(l))},async getChainId(){const a=await this.getProvider();if(!a)throw new L;const r=await a.request({method:"eth_chainId"});return Number(r)},async getProvider(){if(typeof window>"u")return;let a;const r=n();return typeof r.provider=="function"?a=r.provider(window):typeof r.provider=="string"?a=oe(window,r.provider):a=r.provider,a&&!a.removeListener&&("off"in a&&typeof a.off=="function"?a.removeListener=a.off:a.removeListener=()=>{}),a},async isAuthorized(){var a,r;try{if(e&&await((a=d.storage)==null?void 0:a.getItem(`${this.id}.disconnected`))||!i.target&&!await((r=d.storage)==null?void 0:r.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(t!==void 0&&t!==!1){const p=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",p),!!await this.getProvider()),m=typeof t=="number"?t:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(v=>window.addEventListener("ethereum#initialized",()=>v(p()),{once:!0}))]:[],new Promise(v=>setTimeout(()=>v(p()),m))]))return!0}throw new L}return!!(await Me(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:r}){var p,m,I,v;const l=await this.getProvider();if(!l)throw new L;const g=d.chains.find(y=>y.id===r);if(!g)throw new B(new z);const f=new Promise(y=>{const E=(N=>{"chainId"in N&&N.chainId===r&&(d.emitter.off("change",E),y())});d.emitter.on("change",E)});try{return await Promise.all([l.request({method:"wallet_switchEthereumChain",params:[{chainId:re(r)}]}).then(async()=>{await this.getChainId()===r&&d.emitter.emit("change",{chainId:r})}),f]),g}catch(y){const E=y;if(E.code===4902||((m=(p=E==null?void 0:E.data)==null?void 0:p.originalError)==null?void 0:m.code)===4902)try{const{default:N,...h}=g.blockExplorers??{};let C;a!=null&&a.blockExplorerUrls?C=a.blockExplorerUrls:N&&(C=[N.url,...Object.values(h).map(b=>b.url)]);let w;(I=a==null?void 0:a.rpcUrls)!=null&&I.length?w=a.rpcUrls:w=[((v=g.rpcUrls.default)==null?void 0:v.http[0])??""];const A={blockExplorerUrls:C,chainId:re(r),chainName:(a==null?void 0:a.chainName)??g.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??g.nativeCurrency,rpcUrls:w};return await Promise.all([l.request({method:"wallet_addEthereumChain",params:[A]}).then(async()=>{if(await this.getChainId()===r)d.emitter.emit("change",{chainId:r});else throw new _(new Error("User rejected switch after adding network."))}),f]),g}catch(N){throw new _(N)}throw E.code===_.code?new _(E):new B(E)}},async onAccountsChanged(a){var r;if(a.length===0)this.onDisconnect();else if(d.emitter.listenerCount("connect")){const l=(await this.getChainId()).toString();this.onConnect({chainId:l}),e&&await((r=d.storage)==null?void 0:r.removeItem(`${this.id}.disconnected`))}else d.emitter.emit("change",{accounts:a.map(l=>q(l))})},onChainChanged(a){const r=Number(a);d.emitter.emit("change",{chainId:r})},async onConnect(a){const r=await this.getAccounts();if(r.length===0)return;const l=Number(a.chainId);d.emitter.emit("connect",{accounts:r,chainId:l});const g=await this.getProvider();g&&(u&&(g.removeListener("connect",u),u=void 0),o||(o=this.onAccountsChanged.bind(this),g.on("accountsChanged",o)),s||(s=this.onChainChanged.bind(this),g.on("chainChanged",s)),c||(c=this.onDisconnect.bind(this),g.on("disconnect",c)))},async onDisconnect(a){const r=await this.getProvider();a&&a.code===1013&&r&&(await this.getAccounts()).length||(d.emitter.emit("disconnect"),r&&(s&&(r.removeListener("chainChanged",s),s=void 0),c&&(r.removeListener("disconnect",c),c=void 0),u||(u=this.onConnect.bind(this),r.on("connect",u))))}})}const Pt={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(i){return i!=null&&i.coinbaseWalletExtension?i.coinbaseWalletExtension:oe(i,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(i){return oe(i,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const t=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of t)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(i){var e,t;return(e=i==null?void 0:i.phantom)!=null&&e.ethereum?(t=i.phantom)==null?void 0:t.ethereum:oe(i,"isPhantom")}}};function oe(i,e){function t(o){return typeof e=="function"?e(o):typeof e=="string"?o[e]:!0}const n=i.ethereum;if(n!=null&&n.providers)return n.providers.find(o=>t(o));if(n&&t(n))return n}const kt=i=>(e,t,n)=>{const o=n.subscribe;return n.subscribe=(u,c,d)=>{let a=u;if(c){const r=(d==null?void 0:d.equalityFn)||Object.is;let l=u(n.getState());a=g=>{const f=u(g);if(!r(l,f)){const p=l;c(l=f,p)}},d!=null&&d.fireImmediately&&c(l,l)}return o(a)},i(e,t,n)},Rt=kt;function Ot(i,e){let t;try{t=i()}catch{return}return{getItem:o=>{var s;const u=d=>d===null?null:JSON.parse(d,void 0),c=(s=t.getItem(o))!=null?s:null;return c instanceof Promise?c.then(u):u(c)},setItem:(o,s)=>t.setItem(o,JSON.stringify(s,void 0)),removeItem:o=>t.removeItem(o)}}const me=i=>e=>{try{const t=i(e);return t instanceof Promise?t:{then(n){return me(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return me(n)(t)}}}},Ut=(i,e)=>(t,n,o)=>{let s={storage:Ot(()=>localStorage),partialize:m=>m,version:0,merge:(m,I)=>({...I,...m}),...e},u=!1;const c=new Set,d=new Set;let a=s.storage;if(!a)return i((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),t(...m)},n,o);const r=()=>{const m=s.partialize({...n()});return a.setItem(s.name,{state:m,version:s.version})},l=o.setState;o.setState=(m,I)=>{l(m,I),r()};const g=i((...m)=>{t(...m),r()},n,o);o.getInitialState=()=>g;let f;const p=()=>{var m,I;if(!a)return;u=!1,c.forEach(y=>{var E;return y((E=n())!=null?E:g)});const v=((I=s.onRehydrateStorage)==null?void 0:I.call(s,(m=n())!=null?m:g))||void 0;return me(a.getItem.bind(a))(s.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return[!0,s.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[N,h]=y;if(f=s.merge(h,(E=n())!=null?E:g),t(f,!0),N)return r()}).then(()=>{v==null||v(f,void 0),f=n(),u=!0,d.forEach(y=>y(f))}).catch(y=>{v==null||v(void 0,y)})};return o.persist={setOptions:m=>{s={...s,...m},m.storage&&(a=m.storage)},clearStorage:()=>{a==null||a.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>u,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(d.add(m),()=>{d.delete(m)})},s.skipHydration||p(),f||g},jt=Ut,Ne=i=>{let e;const t=new Set,n=(a,r)=>{const l=typeof a=="function"?a(e):a;if(!Object.is(l,e)){const g=e;e=r??(typeof l!="object"||l===null)?l:Object.assign({},e,l),t.forEach(f=>f(e,g))}},o=()=>e,c={setState:n,getState:o,getInitialState:()=>d,subscribe:a=>(t.add(a),()=>t.delete(a))},d=e=i(n,o,c);return c},fe=i=>i?Ne(i):Ne;class Mt{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new et})}on(e,t){this._emitter.on(e,t)}once(e,t){this._emitter.once(e,t)}off(e,t){this._emitter.off(e,t)}emit(e,...t){const n=t[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Wt(i){return new Mt(i)}function Lt(i,e){return JSON.parse(i,(t,n)=>{let o=n;return(o==null?void 0:o.__type)==="bigint"&&(o=BigInt(o.value)),(o==null?void 0:o.__type)==="Map"&&(o=new Map(o.value)),(e==null?void 0:e(t,o))??o})}function Ee(i,e){return i.slice(0,e).join(".")||"."}function Se(i,e){const{length:t}=i;for(let n=0;n<t;++n)if(i[n]===e)return n+1;return 0}function qt(i,e){const t=typeof i=="function",n=typeof e=="function",o=[],s=[];return function(c,d){if(typeof d=="object")if(o.length){const a=Se(o,this);a===0?o[o.length]=this:(o.splice(a),s.splice(a)),s[s.length]=c;const r=Se(o,d);if(r!==0)return n?e.call(this,c,d,Ee(s,r)):`[ref=${Ee(s,r)}]`}else o[0]=d,s[0]=c;return t?i.call(this,c,d):d}}function $t(i,e,t,n){return JSON.stringify(i,qt((o,s)=>{let u=s;return typeof u=="bigint"&&(u={__type:"bigint",value:s.toString()}),u instanceof Map&&(u={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(o,u))??u},n),t??void 0)}function Dt(i){const{deserialize:e=Lt,key:t="wagmi",serialize:n=$t,storage:o=Oe}=i;function s(u){return u instanceof Promise?u.then(c=>c).catch(()=>null):u}return{...o,key:t,async getItem(u,c){const d=o.getItem(`${t}.${u}`),a=await s(d);return a?e(a)??null:c??null},async setItem(u,c){const d=`${t}.${u}`;c===null?await s(o.removeItem(d)):await s(o.setItem(d,n(c)))},async removeItem(u){await s(o.removeItem(`${t}.${u}`))}}}const Oe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function xt(){const i=typeof window<"u"&&window.localStorage?window.localStorage:Oe;return{getItem(e){return i.getItem(e)},removeItem(e){i.removeItem(e)},setItem(e,t){try{i.setItem(e,t)}catch{}}}}const Ce=256;let ee=Ce,te;function Ht(i=11){if(!te||ee+i>Ce*2){te="",ee=0;for(let e=0;e<Ce;e++)te+=(256+Math.random()*256|0).toString(16).substring(1)}return te.substring(ee,ee+++i)}function Ft(i){const{multiInjectedProviderDiscovery:e=!0,storage:t=Dt({storage:xt()}),syncConnectedChain:n=!0,ssr:o=!1,...s}=i,u=typeof window<"u"&&e?tt():void 0,c=fe(()=>s.chains),d=fe(()=>{const h=[],C=new Set;for(const w of s.connectors??[]){const A=a(w);if(h.push(A),!o&&A.rdns){const b=typeof A.rdns=="string"?[A.rdns]:A.rdns;for(const T of b)C.add(T)}}if(!o&&u){const w=u.getProviders();for(const A of w)C.has(A.info.rdns)||h.push(a(r(A)))}return h});function a(h){var b;const C=Wt(Ht());let w;const A={...h({emitter:C,chains:c.getState(),get providers(){if(!u||!w)return[];const T=typeof w=="string"?[w]:w,R=u.getProviders();return T.flatMap(K=>R.filter(P=>P.info.rdns===K))},storage:t,transports:s.transports}),emitter:C,uid:C.uid};return w=A.rdns,C.on("connect",E),(b=A.setup)==null||b.call(A),A}function r(h){const{info:C}=h,w=h.provider;return ae({target:{...C,id:C.rdns,provider:w}})}const l=new Map;function g(h={}){const C=h.chainId??I.getState().chainId,w=c.getState().find(b=>b.id===C);if(h.chainId&&!w)throw new z;{const b=l.get(I.getState().chainId);if(b&&!w)return b;if(!w)throw new z}{const b=l.get(C);if(b)return b}let A;if(s.client)A=s.client({chain:w});else{const b=w.id,T=c.getState().map(P=>P.id),R={},K=Object.entries(s);for(const[P,$]of K)if(!(P==="chains"||P==="client"||P==="connectors"||P==="transports"))if(typeof $=="object")if(b in $)R[P]=$[b];else{if(T.some(je=>je in $))continue;R[P]=$}else R[P]=$;A=Pe({...R,chain:w,batch:R.batch??{multicall:!0},transport:P=>s.transports[b]({...P,connectors:d})})}return l.set(C,A),A}function f(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let p;const m="0.0.0-canary-";ie.startsWith(m)?p=Number.parseInt(ie.replace(m,""),10):p=Number.parseInt(ie.split(".")[0]??"0",10);const I=fe(Rt(t?jt(f,{migrate(h,C){if(C===p)return h;const w=f(),A=v(h,w.chainId);return{...w,chainId:A}},name:"store",partialize(h){return{connections:{__type:"Map",value:Array.from(h.connections.entries()).map(([C,w])=>{const{id:A,name:b,type:T,uid:R}=w.connector;return[C,{...w,connector:{id:A,name:b,type:T,uid:R}}]})},chainId:h.chainId,current:h.current}},merge(h,C){typeof h=="object"&&h&&"status"in h&&delete h.status;const w=v(h,C.chainId);return{...C,...h,chainId:w}},skipHydration:o,storage:t,version:p}):f));I.setState(f());function v(h,C){return h&&typeof h=="object"&&"chainId"in h&&typeof h.chainId=="number"&&c.getState().some(w=>w.id===h.chainId)?h.chainId:C}n&&I.subscribe(({connections:h,current:C})=>{var w;return C?(w=h.get(C))==null?void 0:w.chainId:void 0},h=>{if(c.getState().some(w=>w.id===h))return I.setState(w=>({...w,chainId:h??w.chainId}))}),u==null||u.subscribe(h=>{const C=new Set,w=new Set;for(const b of d.getState())if(C.add(b.id),b.rdns){const T=typeof b.rdns=="string"?[b.rdns]:b.rdns;for(const R of T)w.add(R)}const A=[];for(const b of h){if(w.has(b.info.rdns))continue;const T=a(r(b));C.has(T.id)||A.push(T)}t&&!I.persist.hasHydrated()||d.setState(b=>[...b,...A],!0)});function y(h){I.setState(C=>{const w=C.connections.get(h.uid);return w?{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts??w.accounts,chainId:h.chainId??w.chainId,connector:w.connector})}:C})}function E(h){I.getState().status==="connecting"||I.getState().status==="reconnecting"||I.setState(C=>{const w=d.getState().find(A=>A.uid===h.uid);return w?(w.emitter.listenerCount("connect")&&w.emitter.off("connect",y),w.emitter.listenerCount("change")||w.emitter.on("change",y),w.emitter.listenerCount("disconnect")||w.emitter.on("disconnect",N),{...C,connections:new Map(C.connections).set(h.uid,{accounts:h.accounts,chainId:h.chainId,connector:w}),current:h.uid,status:"connected"}):C})}function N(h){I.setState(C=>{const w=C.connections.get(h.uid);if(w){const b=w.connector;b.emitter.listenerCount("change")&&w.connector.emitter.off("change",y),b.emitter.listenerCount("disconnect")&&w.connector.emitter.off("disconnect",N),b.emitter.listenerCount("connect")||w.connector.emitter.on("connect",E)}if(C.connections.delete(h.uid),C.connections.size===0)return{...C,connections:new Map,current:null,status:"disconnected"};const A=C.connections.values().next().value;return{...C,connections:new Map(C.connections),current:A.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return d.getState()},storage:t,getClient:g,get state(){return I.getState()},setState(h){let C;typeof h=="function"?C=h(I.getState()):C=h;const w=f();typeof C!="object"&&(C=w),Object.keys(w).some(b=>!(b in C))&&(C=w),I.setState(C,!0)},subscribe(h,C,w){return I.subscribe(h,C,w?{...w,fireImmediately:w.emitImmediately}:void 0)},_internal:{mipd:u,async revalidate(){const h=I.getState(),C=h.connections;let w=h.current;for(const[,A]of C){const b=A.connector;b.isAuthorized&&await b.isAuthorized()||(C.delete(b.uid),w===b.uid&&(w=null))}I.setState(A=>({...A,connections:C,current:w}))},store:I,ssr:!!o,syncConnectedChain:n,transports:s.transports,chains:{setState(h){const C=typeof h=="function"?h(c.getState()):h;if(C.length!==0)return c.setState(C,!0)},subscribe(h){return c.subscribe(h)}},connectors:{providerDetailToConnector:r,setup:a,setState(h){return d.setState(typeof h=="function"?h(d.getState()):h,!0)},subscribe(h){return d.subscribe(h)}},events:{change:y,connect:E,disconnect:N}}}}function Ue(i){let e=[],t,n;function o(c){var r,l;const d=k.getCaipNetworks(S.CHAIN.EVM);let a=Number(ge.parseEvmChainId(c));if(!d.some(g=>String(g.id)===String(c))){const g=((r=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:r.id)||((l=d[0])==null?void 0:l.id);g&&Number.isInteger(Number(g))&&(a=Number(g))}if(!a)throw new Error("ChainId not found in networks");return a}function s(){var c;return t||(t=ye.getInstance({projectId:i.options.projectId,chainId:(c=J())==null?void 0:c.caipNetworkId,enableLogger:i.options.enableAuthLogger,onTimeout:d=>{d==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):d==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):d==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:W.EmbeddedWalletAbortController,getActiveCaipNetwork:d=>J(d),getCaipNetworks:d=>k.getCaipNetworks(d)})),t}async function u(c={}){var m;const d=s();let a=c.chainId;if(c.isReconnecting){const I=ge.parseEvmChainId(d.getLastUsedChainId()||""),v=(m=i.chains)==null?void 0:m[0].id;if(a=I||v,!a)throw new Error("ChainId not found in provider")}const r=Ie("eip155"),{address:l,chainId:g,accounts:f}=await qe.authConnectorAuthenticate({authConnector:d,chainId:a,preferredAccountType:r,socialUri:c.socialUri,chainNamespace:S.CHAIN.EVM});e=(f==null?void 0:f.map(I=>I.address))||[l];const p=o(g);return{accounts:e,account:l,chainId:p,chain:{id:p,unsupported:!1}}}return c=>({id:S.CONNECTOR_ID.AUTH,name:S.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:S.CHAIN.EVM,async connect(d={}){if(n){const r=await n;return{accounts:d.withCapabilities?r.accounts.map(l=>({address:l,capabilities:{}})):r.accounts,chainId:r.chainId}}n||(n=new Promise(r=>{r(u(d))}));const a=await n;return n=void 0,{accounts:d.withCapabilities?a.accounts.map(r=>({address:r,capabilities:{}})):a.accounts,chainId:a.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(c.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var d;return this.provider||(this.provider=ye.getInstance({projectId:i.options.projectId,chainId:(d=J())==null?void 0:d.caipNetworkId,enableLogger:i.options.enableAuthLogger,abortController:W.EmbeddedWalletAbortController,onTimeout:a=>{a==="iframe_load_failed"?D.open(W.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):a==="iframe_request_timeout"?D.open(W.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):a==="unverified_domain"&&D.open(W.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:a=>J(a),getCaipNetworks:a=>k.getCaipNetworks(a)})),Promise.resolve(this.provider)},async getChainId(){const d=await this.getProvider(),{chainId:a}=await d.getChainId();return o(a)},async isAuthorized(){const a=k.state.activeChain===S.CHAIN.EVM;if(S.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(g=>Le.getConnectorId(g)===S.CONNECTOR_ID.AUTH)&&!a)return!1;const l=await this.getProvider();return Promise.resolve(l.getLoginEmailUsed())},async switchChain({chainId:d}){var a;try{const r=c.chains.find(p=>p.id===d);if(!r)throw new B(new Error("chain not found on connector."));const l=await this.getProvider(),g=Ie("eip155"),f=await l.connect({chainId:d,preferredAccountType:g});return e=((a=f==null?void 0:f.accounts)==null?void 0:a.map(p=>p.address))||[f.address],c.emitter.emit("change",{chainId:Number(d),accounts:e}),r}catch(r){throw r instanceof Error?new B(r):r}},onAccountsChanged(d){d.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:d.map(q)})},onChainChanged(d){const a=Number(d);c.emitter.emit("change",{chainId:a})},async onDisconnect(d){await(await this.getProvider()).disconnect()}})}pe.type="walletConnect";function pe(i){const e=i.isNewChainsStale??!0;let t,n,o,s,u,c,d;return a=>({id:"walletConnect",name:"WalletConnect",type:pe.type,provider:i.universalProvider,async setup(){const r=await this.getProvider().catch(()=>null);r&&(s||(s=this.onConnect.bind(this),r.on("connect",s)),c||(c=this.onSessionDelete.bind(this),r.on("session_delete",c)))},async connect({...r}={}){var l,g,f;try{const p=k.getCaipNetworks(),m=await this.getProvider();if(!m)throw new L;u||(u=this.onDisplayUri,m.on("display_uri",u));const I=await this.isChainsStale();m.session&&I&&await m.disconnect();const v=x.state.universalProviderConfigOverride;if(!m.session||I){const A=$e.createNamespaces(p,v);await m.connect({optionalNamespaces:A,..."pairingTopic"in r?{pairingTopic:r.pairingTopic}:{}}),this.setRequestedChainsIds(p.map(b=>Number(b.id)))}const y=await this.getAccounts(),E=await this.getChainId(),N=(f=(g=(l=m.session)==null?void 0:l.namespaces)==null?void 0:g.eip155)==null?void 0:f.chains,h=N==null?void 0:N.some(A=>Number(A.split(":")[1])===E);let C=1;h?C=E:N!=null&&N[0]&&(C=Number(N[0].split(":")[1])),u&&(m.removeListener("display_uri",u),u=void 0),s&&(m.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),m.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),m.on("chainChanged",o)),d||(d=this.onDisconnect.bind(this),m.on("disconnect",d)),c||(c=this.onSessionDelete.bind(this),m.on("session_delete",c));const w=v==null?void 0:v.defaultChain;return m.setDefaultChain(w??`eip155:${C}`),{accounts:y,chainId:C}}catch(p){throw/(user rejected|connection request reset)/i.test(p==null?void 0:p.message)?new _(p):p}},async disconnect(){const r=await this.getProvider();try{await(r==null?void 0:r.disconnect())}catch(l){if(!/No matching key/i.test(l.message))throw l}finally{o&&(r==null||r.removeListener("chainChanged",o),o=void 0),d&&(r==null||r.removeListener("disconnect",d),d=void 0),s||(s=this.onConnect.bind(this),r==null||r.on("connect",s)),n&&(r==null||r.removeListener("accountsChanged",n),n=void 0),c&&(r==null||r.removeListener("session_delete",c),c=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var m,I,v;const r=await this.getProvider();if(!((m=r==null?void 0:r.session)!=null&&m.namespaces))return[];const l=(v=(I=r==null?void 0:r.session)==null?void 0:I.namespaces[S.CHAIN.EVM])==null?void 0:v.accounts,g=(l==null?void 0:l.map(y=>y.split(":")[2]))??[],f=new Set;return g.filter(y=>{const E=y==null?void 0:y.toLowerCase();return f.has(E)?!1:(f.add(E),!0)})},async getProvider({chainId:r}={}){var f,p;t||(t=i.universalProvider,t==null||t.events.setMaxListeners(Number.POSITIVE_INFINITY));const l=H.getActiveNamespace(),g=(f=k.getActiveCaipNetwork())==null?void 0:f.id;if(r&&g!==r&&l){const m=H.getStoredActiveCaipNetworkId(),I=l?k.getCaipNetworks(l):[],v=I==null?void 0:I.find(y=>y.id===m);v&&v.chainNamespace===S.CHAIN.EVM&&await((p=this.switchChain)==null?void 0:p.call(this,{chainId:Number(v.id)}))}return t},async getChainId(){var p,m,I,v;const r=(p=k.getActiveCaipNetwork(S.CHAIN.EVM))==null?void 0:p.id;if(r)return r;const g=(v=(I=(m=(await this.getProvider()).session)==null?void 0:m.namespaces[S.CHAIN.EVM])==null?void 0:I.chains)==null?void 0:v[0],f=k.getCaipNetworks().find(y=>y.id===g);return f==null?void 0:f.id},async isAuthorized(){try{const[r,l]=await Promise.all([this.getAccounts(),this.getProvider()]);return r.length?await this.isChainsStale()&&l.session?(await l.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:l}){var p,m,I,v;const g=await this.getProvider();if(!g)throw new L;const f=k.getCaipNetworks().find(y=>y.id===l);if(!f)throw new B(new z);try{await g.request({method:"wallet_switchEthereumChain",params:[{chainId:re(l)}]}),f!=null&&f.caipNetworkId&&g.setDefaultChain(f==null?void 0:f.caipNetworkId),a.emitter.emit("change",{chainId:Number(l)});const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,l]),{...f,id:f.id}}catch(y){const E=y;if(/(?:user rejected)/iu.test(E.message))throw new _(E);try{let N;r!=null&&r.blockExplorerUrls?N=r.blockExplorerUrls:N=(p=f.blockExplorers)!=null&&p.default.url?[(m=f.blockExplorers)==null?void 0:m.default.url]:[];const h=((v=(I=f.rpcUrls)==null?void 0:I.chainDefault)==null?void 0:v.http)||[],C={blockExplorerUrls:N,chainId:re(l),chainName:f.name,iconUrls:r==null?void 0:r.iconUrls,nativeCurrency:f.nativeCurrency,rpcUrls:h};await g.request({method:"wallet_addEthereumChain",params:[C]});const w=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...w,l]),{...f,id:f.id}}catch(N){throw new _(N)}}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(l=>q(l))})},onChainChanged(r){const l=Number(r);a.emitter.emit("change",{chainId:l})},onConnect(r){this.setRequestedChainsIds(k.getCaipNetworks().map(l=>Number(l.id)))},async onDisconnect(r){this.setRequestedChainsIds([]),a.emitter.emit("disconnect");const l=await this.getProvider();n&&(l.removeListener("accountsChanged",n),n=void 0),o&&(l.removeListener("chainChanged",o),o=void 0),d&&(l.removeListener("disconnect",d),d=void 0),c&&(l.removeListener("session_delete",c),c=void 0),s||(s=this.onConnect.bind(this),l.on("connect",s))},onDisplayUri(r){a.emitter.emit("message",{type:"display_uri",data:r})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var g,f,p;if(!((g=t==null?void 0:t.session)!=null&&g.namespaces))return[];const r=(p=(f=t==null?void 0:t.session)==null?void 0:f.namespaces[S.CHAIN.EVM])==null?void 0:p.accounts;return(r==null?void 0:r.map(m=>Number.parseInt(m.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var l;const r=await((l=a.storage)==null?void 0:l.getItem(this.requestedChainsStorageKey))??[];return[...new Set(r)]},async isChainsStale(){if(!e)return!1;const r=a.chains.map(f=>f.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(f=>r.includes(f)))return!1;const g=await this.getRequestedChainsIds();return!r.every(f=>g.includes(Number(f)))},async setRequestedChainsIds(r){var l;await((l=a.storage)==null?void 0:l.setItem(this.requestedChainsStorageKey,r))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const F=xe({pendingTransactions:0}),_e={state:F,subscribeKey(i,e){return De(F,i,e)},increase(i){F[i]+=1},decrease(i){F[i]-=1},reset(i){F[i]=0}};async function Bt(i){if(ne.isSafeApp()){const{safe:e}=await we(async()=>{const{safe:t}=await import("./index-D22uBSRA.js");return{safe:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.type==="safe"))return e()}return null}async function zt(i){try{const{baseAccount:e}=await we(async()=>{const{baseAccount:t}=await import("./index-D22uBSRA.js");return{baseAccount:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Base Account SDK:",e)}return null}async function Vt(i){try{const{coinbaseWallet:e}=await we(async()=>{const{coinbaseWallet:t}=await import("./index-D22uBSRA.js");return{coinbaseWallet:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]));if(e&&!i.some(t=>t.id==="coinbaseWallet"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Gt={enable:!1,pollingInterval:3e4};class Kt extends He{constructor(e){const t=X.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=S.CHAIN.EVM,this.adapterType=S.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Gt,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:t}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const t=this.getWagmiConnector(e.id);if(!t)return{accounts:[]};if(t.id===S.CONNECTOR_ID.AUTH){const u=await t.getProvider();if(!(u!=null&&u.user))return{accounts:[]};const{address:c,accounts:d,chainId:a}=u.user;return Promise.resolve({accounts:(d||[{address:c,type:"eoa"}]).map(r=>ne.createAccount({caipAddress:`eip155:${a}:${r.address}`,type:r.type}))})}const{addresses:n,address:o,chainId:s}=se(this.wagmiConfig);return Promise.resolve({accounts:s?[...new Set(n||[o])].map(u=>ne.createAccount({caipAddress:`eip155:${s}:${u||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=se(this.wagmiConfig);e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(t=>t.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(o=>o.chainNamespace===S.CHAIN.EVM);const t={},n=[...e.connectors??[]];this.wagmiChains.forEach(o=>{var c,d;const s=(c=e.transports)==null?void 0:c[o.id],u=X.getCaipNetworkId(o);s?t[o.id]=X.extendWagmiTransports(o,e.projectId,s):t[o.id]=X.getViemTransport(o,e.projectId,(d=e.customRpcUrls)==null?void 0:d[u])}),this.wagmiConfig=Ft({...e,chains:this.wagmiChains,connectors:n,transports:t})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=_t(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),_e.increase("pendingTransactions")}});const e=_e.subscribeKey("pendingTransactions",t=>{var n;t>=S.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Et(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(t=>{const n=this.getCaipNetworks().find(s=>s.id===t.chainId),o=t.connector.id===S.CONNECTOR_ID.AUTH;return{accounts:t.accounts.map(s=>({address:this.toChecksummedAddress(s)})),caipNetwork:n,connectorId:t.connector.id,auth:o?{name:H.getConnectedSocialProvider(),username:H.getConnectedSocialUsername()}:void 0}}))}}),Nt(this.wagmiConfig,{onChange:(e,t)=>{var n;if(e.status==="disconnected"&&t.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(t==null?void 0:t.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const o=e.address!==(t==null?void 0:t.address),s=e.connector.id!==((n=t.connector)==null?void 0:n.id),u=t.status!=="connected";(o||s||u)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:t,enableBaseAccount:n}=x.state||{};if(n!==!1){const s=await zt(this.wagmiConfig.connectors);s&&e.push(s)}if(t!==!1){const s=await Vt(this.wagmiConfig.connectors);s&&e.push(s)}const o=await Bt(this.wagmiConfig.connectors);o&&e.push(o),await Promise.all(e.map(s=>{const u=this.configureInternalConnector(s);return this.addWagmiConnector(u)}))}addWagmiConnectors(){const e=[];x.state.enableInjected!==!1&&e.push(ae({shimDisconnect:!0}));const{features:t,remoteFeatures:n,projectId:o,enableAuthLogger:s}=x.state,u=(n==null?void 0:n.email)??(t==null?void 0:t.email)??!0,c=(n==null?void 0:n.socials)??(t==null?void 0:t.socials),d=Array.isArray(c)&&(c==null?void 0:c.length)>0;(u||d)&&e.push(Ue({chains:this.wagmiChains,options:{projectId:o,enableAuthLogger:s}})),e.forEach(a=>{this.configureInternalConnector(a)})}configureInternalConnector(e){const t=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,t]),t}async handleAccountChanged({address:e,chainId:t,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const o=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:t,connector:{id:n.id,name:j.ConnectorNamesMap[n.id]??n.name,imageId:j.ConnectorImageIds[n.id],type:j.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:o,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await bt(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var c;const{chainId:t,address:n}=se(this.wagmiConfig),o=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===t),s={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:o,type:"legacy",parameters:["nonce"]};await It(this.wagmiConfig,s);const u=await yt(this.wagmiConfig,s);return await At(this.wagmiConfig,{hash:u,timeout:25e3}),{hash:u}}async writeContract(e){var c;const{caipNetwork:t,...n}=e,o=Number(ge.caipNetworkIdToNumber(t.caipNetworkId)),s=(c=this.wagmiChains)==null?void 0:c.find(d=>d.id===o);return{hash:await Tt(this.wagmiConfig,{chain:s,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await wt(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return ct(e.value,e.decimals)}formatUnits(e){return Ke(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:t,enableInjected:n}=x.state||{},o=e.type===S.CONNECTOR_ID.INJECTED,s=e.id===S.CONNECTOR_ID.INJECTED,u=o&&!s;if(s&&n===!1||u&&t===!1||e.id===S.CONNECTOR_ID.AUTH||e.id===S.CONNECTOR_ID.WALLET_CONNECT)return;let c;e.id!==S.CONNECTOR_ID.BASE_ACCOUNT&&(c=await e.getProvider().catch(()=>{}));const d=Fe.state.connectorImages;this.addConnector({id:e.id,explorerId:j.ConnectorExplorerIds[e.id]??j.ConnectorExplorerIds[e.name],imageUrl:(d==null?void 0:d[e.id])??e.icon,name:j.ConnectorNamesMap[e.id]??e.name,imageId:j.ConnectorImageIds[e.id],type:j.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===S.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:c,chain:this.namespace,chains:[]})}async syncConnectors(){St(this.wagmiConfig,{onChange:e=>{e.forEach(t=>this.addWagmiConnector(t))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(t=>{const{hasDisconnected:n,hasConnected:o}=Y.getConnectorStorageInfo(t.id,this.namespace);return!n&&o}).map(t=>this.getWagmiConnector(t.id)).filter(Boolean);await he(this.wagmiConfig,{connectors:e})}async syncConnection(e){var a,r;const{id:t,chainId:n}=e,s=M(this.wagmiConfig).find(l=>l.connector.id===t),u=this.getWagmiConnector(t),c=await(u==null?void 0:u.getProvider());if(ne.isSafeApp()&&t===S.CONNECTOR_ID.SAFE&&!(s!=null&&s.accounts.length)){const l=this.getWagmiConnector("safe");if(l){const g=await ue(this.wagmiConfig,{connector:l,chainId:Number(n)}),f=await l.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(g.accounts[0]),provider:f,type:(a=s==null?void 0:s.connector.type)==null?void 0:a.toUpperCase(),id:s==null?void 0:s.connector.id}}}return{chainId:Number(s==null?void 0:s.chainId),address:this.toChecksummedAddress(s==null?void 0:s.accounts[0]),provider:c,type:(r=s==null?void 0:s.connector.type)==null?void 0:r.toUpperCase(),id:s==null?void 0:s.connector.id}}async connectWalletConnect(e){try{const t=this.getWalletConnectConnector();await t.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const o=await ue(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return o.chainId!==Number(e)&&await Ae(this.wagmiConfig,{chainId:o.chainId}),{clientId:await t.provider.client.core.crypto.getClientId()}}catch(t){throw t instanceof _?new Q(t):be.isUserRejectedRequestError(t)?new Q(t):t}}async connect(e){var t,n,o,s,u;try{const{id:c,address:d,provider:a,type:r,info:l,chainId:g,socialUri:f}=e,p=this.getWagmiConnector(c);if(!p)throw new Error("connectionControllerClient:connectExternal - connector is undefined");a&&l&&p.id===S.CONNECTOR_ID.EIP6963&&((t=p.setEip6963Wallet)==null||t.call(p,{provider:a,info:l}));const m=(o=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:o.get(p.uid);if(m){await((s=this.wagmiConfig.storage)==null?void 0:s.setItem("recentConnectorId",p.id));const y=[...m.accounts].sort((E,N)=>Y.isLowerCaseMatch(E,d)?-1:Y.isLowerCaseMatch(N,d)?1:0);return(u=this.wagmiConfig)==null||u.setState(E=>({...E,connections:new Map(E.connections).set(p.uid,{accounts:y,chainId:m.chainId,connector:m.connector}),current:p.uid,status:"connected"})),{address:this.toChecksummedAddress(y[0]),chainId:m.chainId,provider:a,type:r,id:c}}const I=await ue(this.wagmiConfig,{connector:p,chainId:g?Number(g):void 0,socialUri:f}),v=a??await p.getProvider();return{address:this.toChecksummedAddress(I.accounts[0]),chainId:I.chainId,provider:v,type:r,id:c}}catch(c){throw c instanceof _?new Q(c):be.isUserRejectedRequestError(c)?new Q(c):c}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(t=>({address:this.toChecksummedAddress(t)})),connectorId:e.connector.id}))}async reconnect(e){const{id:t}=e,n=this.getWagmiConnector(t);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await he(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const t=e.address,n=this.getCaipNetworks().find(o=>o.id===e.chainId);if(!t)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const o=`${n.caipNetworkId}:${e.address}`,s=this.balancePromises[o];if(s)return s;const u=H.getNativeBalanceCacheForCaipAddress(o);return u?{balance:u.balance,symbol:u.symbol}:(this.balancePromises[o]=new Promise(async c=>{var d,a;try{const r=Number(e.chainId),l=await pt(this.wagmiConfig,{address:e.address,chainId:r,token:(a=(d=e.tokens)==null?void 0:d[n.caipNetworkId])==null?void 0:a.address});H.updateNativeBalanceCache({caipAddress:o,balance:l.formatted,symbol:l.symbol,timestamp:Date.now()}),c({balance:l.formatted,symbol:l.symbol})}catch(r){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",r),c({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[o]}),this.balancePromises[o]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const t=this.getWagmiConnector(e.id),o=M(this.wagmiConfig).find(s=>Y.isLowerCaseMatch(s.connector.id,e.id));return await ve(this.wagmiConfig,{connector:t}),x.state.enableReconnect===!1&&this.deleteConnection(e.id),o?{connections:[{accounts:o.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:o.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=M(this.wagmiConfig),t=await Promise.allSettled(e.map(async n=>{const o=this.getWagmiConnector(n.connector.id);return o&&await ve(this.wagmiConfig,{connector:o}),n}));return this.wagmiConfig.state.connections.clear(),{connections:t.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(o=>({address:this.toChecksummedAddress(o)})),connectorId:n.connector.id}))}}async switchNetwork(e){var f,p,m,I,v;const{caipNetwork:t}=e,n=this.wagmiConfig.chains.find(y=>y.id.toString()===t.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:o,nativeCurrency:s,rpcUrls:u,blockExplorers:c,id:d}=n,a=((m=(p=(f=t.rpcUrls)==null?void 0:f.chainDefault)==null?void 0:p.http)==null?void 0:m[0])??u.default.http[0]??"",r=(c==null?void 0:c.default.url)??((v=(I=t.blockExplorers)==null?void 0:I.default)==null?void 0:v.url)??"",l=s??t.nativeCurrency,g=o??t.name;await Ae(this.wagmiConfig,{chainId:d,addEthereumChainParameter:{chainName:g,nativeCurrency:l,rpcUrls:[a],blockExplorerUrls:[r]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await s.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return s.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return s.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=M(this.wagmiConfig)[0],o=n?this.getWagmiConnector(n.connector.id):null;if(!o)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const s=await o.getProvider();if(!s)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return s.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");this.addConnector({id:S.CONNECTOR_ID.AUTH,type:"AUTH",name:S.CONNECTOR_NAMES.AUTH,provider:e,imageId:j.ConnectorImageIds[S.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=M(this.wagmiConfig),o=this.getWagmiConnector("walletConnect");if(o&&!n.find(s=>s.connector.id===o.id)){if(k.state.activeChain==="eip155")return;he(this.wagmiConfig,{connectors:[o]})}});const t=pe({universalProvider:e});return this.configureInternalConnector(t),this.addConnector(new Be({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){if(!e)return e;try{return Ze(e.toLowerCase())}catch{return e}}}const un=Object.freeze(Object.defineProperty({__proto__:null,WagmiAdapter:Kt,authConnector:Ue},Symbol.toStringTag,{value:"Module"}));export{z as C,L as P,ft as a,un as b,dn as c,ae as i};
|
|
4
|
+
//# sourceMappingURL=index-DucxpIJX.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,b as pe,r as p,L as he}from"./react-
|
|
1
|
+
import{j as e,b as pe,r as p,L as he}from"./react-Cu6RTeaf.js";import{t as A,s as n,m as ge,p as xe,b as a,C as N,B as Q,bS as re,q as O,ao as oe,ad as me,b8 as U,h as K,a5 as ue,o as fe,r as we,b7 as be,I as G,ap as ye,ar as ve,bT as je,bU as ke,bc as $e,w as H}from"./index-DtHHdoPj.js";import{c as Ce,i as Ie,R as Te,u as Se}from"./sales-empty-sKHyys3f.js";import{S as Le,C as ze}from"./ManaPricingBanner.styles-CAJcVFK8.js";import{F as V}from"./Faq-mlHE1lJ-.js";import{C as Y}from"./field.styles-BYvs7GyZ.js";import"./dcl-schemas-D3MMsa96.js";import"./sentry-BIexM3hF.js";import"./ethers-CFmosx3s.js";import"./intl-AKLEHPeO.js";import"./buy-BBspDwaD.js";import"./authorizations-r_yIs4_S.js";import"./sendMetaTransaction-CqnRe296.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new s.Error().stack;d&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[d]="e448b25f-4d5a-4f04-9d4b-47fd29d18749",s._sentryDebugIdIdentifier="sentry-dbid-e448b25f-4d5a-4f04-9d4b-47fd29d18749")}catch{}})();function Ae({size:s=12,...d}){return e.jsx("svg",{viewBox:"0 0 20 20",width:s,height:s,fill:"none","aria-hidden":!0,focusable:"false",...d,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Re({size:s=84.837,...d}){return e.jsxs("svg",{viewBox:"0 0 84.837 84.837",width:s,height:s,fill:"none","aria-hidden":!0,focusable:"false",...d,children:[e.jsxs("g",{stroke:A.colors.errStrong,strokeWidth:"6.08696",strokeLinecap:"round",children:[e.jsx("circle",{cx:"42.4185",cy:"42.4185",r:"39.375"}),e.jsx("path",{d:"M42.4185 22.5V47.5"})]}),e.jsx("circle",{cx:"42.4185",cy:"60.75",r:"3.8",fill:A.colors.errStrong})]})}const{colors:R,radius:_e,z:Fe}=A,Ee=ge`
|
|
2
2
|
0% {
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
opacity: 0;
|
|
@@ -623,4 +623,4 @@ import{j as e,b as pe,r as p,L as he}from"./react-Io5Wove7.js";import{t as A,s a
|
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
625
|
`,W=[5e3,15e3,35e3],se=[{question:"faq.sellers.whatAreQ",answer:"faq.sellers.whatAreA"},{question:"faq.sellers.whyCreditsQ",answer:"faq.sellers.whyCreditsA"},{question:"faq.sellers.receiveCreditsQ",answer:"faq.sellers.receiveCreditsA"},{question:"faq.sellers.changePriceQ",answer:"faq.sellers.changePriceA"},{question:"faq.sellers.mustSwitchQ",answer:"faq.sellers.mustSwitchA"},{question:"faq.sellers.suggestedPriceQ",answer:"faq.sellers.suggestedPriceA"}],Wt="https://docs.decentraland.org";function Nt(s){try{return $e(BigInt(s))}catch{return null}}function ni(){const{session:s}=fe(),d=we(),{items:h,isLoading:I}=Se(),[B,y]=p.useState({}),[q,F]=p.useState(new Set),[x,E]=p.useState(null),l=p.useRef({timer:null,alive:!0,migrated:new Set});p.useEffect(()=>{const t=l.current;return t.alive=!0,()=>{t.alive=!1,t.timer&&clearTimeout(t.timer)}},[]),p.useEffect(()=>{h.length&&y(t=>{const i={...t};for(const r of h)i[r.oldTradeId]==null&&(i[r.oldTradeId]=r.suggestedCredits);return i})},[h]);const b=t=>!q.has(t),v=t=>B[t.oldTradeId]??t.suggestedCredits,w=h.filter(t=>b(t.oldTradeId)),T=w.reduce((t,i)=>t+v(i),0),j=h.length>0&&w.length===h.length,k=w.length>0&&!j;function M(t,i){const r=i.replace(/[^\d]/g,"");y(c=>({...c,[t]:r===""?0:parseInt(r,10)}))}function D(t){F(i=>{const r=new Set(i);return r.has(t)?r.delete(t):r.add(t),r})}function C(){F(j?new Set(h.map(t=>t.oldTradeId)):new Set)}function S(t){return t.map(i=>({item:i,priceCredits:Math.max(1,v(i))}))}function m(t){const i=(r=[])=>r.filter(c=>!t.has(c.oldTradeId));d.setQueriesData({queryKey:["importable"]},r=>r&&{creations:i(r.creations),owned:i(r.owned)})}function $(t){return d.getQueriesData({queryKey:["importable"]}).flatMap(([,i])=>[...(i==null?void 0:i.creations)??[],...(i==null?void 0:i.owned)??[]]).some(i=>t.has(i.oldTradeId))}function L(t){const i=l.current;i.timer&&clearTimeout(i.timer),i.timer=setTimeout(()=>{d.refetchQueries({queryKey:["importable"]}).then(()=>{if(i.alive){if(!$(i.migrated)||t+1>=W.length){i.migrated.clear();return}m(i.migrated),L(t+1)}})},W[t]-(W[t-1]??0))}function P(t){if(t.failed===0&&t.cancelled===0&&t.listed>0&&(x!=null&&x.length)){const{migrated:i}=l.current;for(const r of x)i.add(r.item.oldTradeId);m(i),L(0)}else d.invalidateQueries({queryKey:["importable"]});d.invalidateQueries({queryKey:["shop-items"]}),d.invalidateQueries({queryKey:["catalog-items"]}),d.invalidateQueries({queryKey:["overview-listings"]}),d.invalidateQueries({queryKey:["upsell-listings"]}),d.invalidateQueries({queryKey:["my-assets"]}),d.invalidateQueries({queryKey:["collection-sale-state"]}),t.failed>0?H.error(a(t.listed>0?"importListings.toastPartial":"importListings.toastFailed")):t.listed>0&&H.success(a("importListings.toastUpdated"))}return!I&&h.length===0?e.jsxs(ee,{children:[e.jsx(at,{"data-testid":"import-empty",children:e.jsxs(st,{children:[e.jsx(rt,{"aria-hidden":!0,children:e.jsx("img",{src:it,alt:"",width:85,height:85})}),e.jsxs(ot,{children:[e.jsx(dt,{children:a("importListings.emptyTitle")}),e.jsx(lt,{children:a("importListings.emptyBody")})]}),e.jsx(ct,{children:e.jsx(pt,{as:he,to:re,variant:"purple",children:a("importListings.goToMyAssets")})})]})}),e.jsx(ae,{children:e.jsx(V,{title:"faq.title",entries:se,tone:"on-dark"})})]}):e.jsxs(ee,{children:[e.jsxs(ht,{children:[e.jsxs(gt,{children:[e.jsx(xt,{children:a("importListings.title")}),e.jsxs("div",{children:[e.jsx(mt,{children:a("importListings.lede",{currency:be(N.name)})}),e.jsxs(ut,{href:Wt,target:"_blank",rel:"noopener noreferrer",children:[a("importListings.learnMore"),e.jsx(G,{name:"external-link",className:"ico","aria-hidden":!0})]})]})]}),e.jsx(ze,{tone:"on-dark"})]}),e.jsx(te,{}),e.jsxs(ft,{children:[e.jsxs(wt,{"data-testid":"import-progress",children:[e.jsx(bt,{"data-testid":"import-count",children:h.length}),a("importListings.updatePricing")]}),e.jsxs(yt,{children:[e.jsxs(vt,{children:[e.jsx(ie,{"data-tone":"on-dark",children:e.jsx(Y,{type:"checkbox",checked:j,ref:t=>{t&&(t.indeterminate=k)},"data-indeterminate":k,onChange:C,"data-testid":"import-select-all","aria-label":a("importListings.selectAllAria")})}),a("importListings.selectAll")]}),e.jsx(jt,{children:I?Array.from({length:4}).map((t,i)=>e.jsx(Ft,{},i)):h.map(t=>{const i=v(t),r=ye({...t,wearableCategory:t.wearableCategory??void 0}),c=Nt(t.manaWei);return e.jsxs(kt,{"data-off":b(t.oldTradeId)?void 0:!0,children:[e.jsxs($t,{children:[e.jsx(ie,{children:e.jsx(Y,{type:"checkbox",checked:b(t.oldTradeId),onChange:()=>D(t.oldTradeId),"data-testid":"import-row-check","aria-label":a("importListings.includeItem",{name:t.name})})}),e.jsx(Ct,{children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:""}):null})]}),e.jsxs(It,{children:[e.jsx(Tt,{title:t.name,children:t.name||a("importListings.itemFallback")}),e.jsxs(St,{children:[e.jsx(ne,{"data-variant":"rarity",style:{background:ke(t.rarity),color:je(t.rarity)},children:ve(t.rarity)}),r?e.jsx(ne,{"data-variant":"icon",children:e.jsx(G,{name:r,"aria-hidden":!0})}):null]})]}),e.jsxs(Lt,{children:[e.jsxs(zt,{children:[e.jsx(O,{}),e.jsx(At,{"data-testid":"imp-price-input",inputMode:"numeric",value:i.toLocaleString(),onChange:g=>M(t.oldTradeId,g.target.value),"aria-label":a("importListings.priceAria",{currency:N.name,name:t.name})})]}),e.jsxs(Rt,{children:[e.jsxs("span",{children:["$",U(i).toFixed(2)]}),c?e.jsx(_t,{children:a("importListings.wasMana",{amount:c})}):null]})]})]},t.oldTradeId)})})]})]}),e.jsx(te,{}),e.jsx(ae,{children:e.jsx(V,{title:"faq.title",entries:se,tone:"on-dark"})}),e.jsx(Et,{children:e.jsxs(Mt,{children:[e.jsxs(Pt,{children:[e.jsxs(Qt,{children:[e.jsx(O,{})," ",e.jsx(oe,{credits:T})]}),e.jsx(Bt,{children:a("importListings.selectedSummary",{count:w.length,usd:U(T).toFixed(2)})})]}),e.jsx(qt,{}),e.jsx(Dt,{variant:"red","data-testid":"import-list-all",disabled:w.length===0,onClick:()=>E(S(w)),children:a("importListings.listAll",{count:w.length})})]})}),x&&s?e.jsx(tt,{queue:x,session:s,onClose:()=>E(null),onDone:P}):null]})}export{ni as ImportListings};
|
|
626
|
-
//# sourceMappingURL=index-
|
|
626
|
+
//# sourceMappingURL=index-DyHgoZVr.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as _,b as l,a as Te}from"./lit-element-wjYUA6aF.js";import{n as x,o as f,r as h,a as Ie}from"./class-map-DopF_Eyi.js";import{d as U,r as Ne,e as Se,v as ke}from"./index-
|
|
1
|
+
import{i as _,b as l,a as Te}from"./lit-element-wjYUA6aF.js";import{n as x,o as f,r as h,a as Ie}from"./class-map-DopF_Eyi.js";import{d as U,r as Ne,e as Se,v as ke}from"./index-Cd-qOUE-.js";import{c as C,U as _e}from"./index-juvpUDkX.js";import"./index-DOZ6UG7t.js";import"./index-jDlI52U4.js";import"./index-75GXxbyC.js";import"./index-GMK5LYtv.js";import"./index-DIURmrHc.js";import"./index-BfA6yQqc.js";import"./index-8Sq2Laxu.js";import{$ as Ce,k as T,a0 as $e,a1 as y,b as O,a2 as Re,a3 as N,O as ce,N as A,a4 as me,C as m,q as v,E as M,S as R,n as Oe,M as G,e as Ue,i as Le,p as qe,o as P,R as z}from"./W3MFrameProviderSingleton-DFZh2-P1.js";import{au as I}from"./NetworkUtil-DuWsUf1s.js";import"./index-FwAqH4Jg.js";import{M as ge}from"./MathUtil-BvP0JcjY.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="98d0b7c5-a2c2-4f59-96d8-94fa819634b1",t._sentryDebugIdIdentifier="sentry-dbid-98d0b7c5-a2c2-4f59-96d8-94fa819634b1")}catch{}})();const De=U`
|
|
2
2
|
:host {
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
@@ -1062,4 +1062,4 @@ import{i as _,b as l,a as Te}from"./lit-element-wjYUA6aF.js";import{n as x,o as
|
|
|
1062
1062
|
></wui-icon>`}
|
|
1063
1063
|
</wui-button>
|
|
1064
1064
|
`}getPaymentAssetFromTokenBalances(){return this.namespace?(this.tokenBalances[this.namespace]??[]).map(i=>{try{return tt(i)}catch{return null}}).filter(i=>!!i).filter(i=>{const{chainId:a}=y.parseCaipNetworkId(i.network),{chainId:o}=y.parseCaipNetworkId(this.paymentAsset.network);return N.isLowerCaseMatch(i.asset,this.paymentAsset.asset)?!0:this.selectedExchange?!N.isLowerCaseMatch(a.toString(),o.toString()):!0}):[]}onTokenBalancesChanged(e){this.tokenBalances=e;const[n]=this.getPaymentAssetFromTokenBalances();n&&u.setSelectedPaymentAsset(n)}async onConnectOtherWallet(){await P.connect(),await G.open({view:"PayQuote"})}onAccountStateChanged(e){const{address:n}=this.caipAddress?y.parseCaipAddress(this.caipAddress):{};if(this.caipAddress=e==null?void 0:e.caipAddress,this.profileName=(e==null?void 0:e.profileName)??null,n){const{address:s}=this.caipAddress?y.parseCaipAddress(this.caipAddress):{};s?N.isLowerCaseMatch(s,n)||(this.resetAssetsState(),this.resetQuoteState(),this.fetchTokens()):G.close()}}onSelectedPaymentAssetChanged(e){this.isFetchingQuote||u.setSelectedPaymentAsset(e)}async onTransfer(){var n,s,i;const e=ie(this.quote);if(e){if(!N.isLowerCaseMatch((n=this.selectedPaymentAsset)==null?void 0:n.asset,e.deposit.currency))throw new Error("Quote asset is not the same as the selected payment asset");const o=((s=this.selectedPaymentAsset)==null?void 0:s.amount)??"0",c=A.formatNumber(e.deposit.amount,{decimals:((i=this.selectedPaymentAsset)==null?void 0:i.metadata.decimals)??0}).toString();if(!A.bigNumber(o).gte(c)){R.showError("Insufficient funds");return}if(this.quote&&this.selectedPaymentAsset&&this.caipAddress&&this.namespace){const{address:L}=y.parseCaipAddress(this.caipAddress);await u.onTransfer({chainNamespace:this.namespace,fromAddress:L,toAddress:e.deposit.receiver,amount:c,paymentAsset:this.selectedPaymentAsset}),u.setRequestId(e.requestId),z.push("PayLoading")}}}async onSendTransactions(){var o,c,g;const e=((o=this.selectedPaymentAsset)==null?void 0:o.amount)??"0",n=A.formatNumber(((c=this.quote)==null?void 0:c.origin.amount)??0,{decimals:((g=this.selectedPaymentAsset)==null?void 0:g.metadata.decimals)??0}).toString();if(!A.bigNumber(e).gte(n)){R.showError("Insufficient funds");return}const i=te(this.quote),[a]=te(this.quote,this.completedTransactionsCount);a&&this.namespace&&(await u.onSendTransaction({namespace:this.namespace,transactionStep:a}),this.completedTransactionsCount+=1,this.completedTransactionsCount===i.length&&(u.setRequestId(a.requestId),z.push("PayLoading")))}onPayWithExchange(){if(this.exchangeUrlForQuote){const e=O.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!e)throw new Error("Could not create popup window");e.location.href=this.exchangeUrlForQuote;const n=ie(this.quote);n&&u.setRequestId(n.requestId),u.initiatePayment(),z.push("PayLoading")}}resetAssetsState(){u.setSelectedPaymentAsset(null)}resetQuoteState(){u.resetQuoteState()}};w.styles=Nt;b([h()],w.prototype,"profileName",void 0);b([h()],w.prototype,"paymentAsset",void 0);b([h()],w.prototype,"namespace",void 0);b([h()],w.prototype,"caipAddress",void 0);b([h()],w.prototype,"amount",void 0);b([h()],w.prototype,"recipient",void 0);b([h()],w.prototype,"activeConnectorIds",void 0);b([h()],w.prototype,"selectedPaymentAsset",void 0);b([h()],w.prototype,"selectedExchange",void 0);b([h()],w.prototype,"isFetchingQuote",void 0);b([h()],w.prototype,"quoteError",void 0);b([h()],w.prototype,"quote",void 0);b([h()],w.prototype,"isFetchingTokenBalances",void 0);b([h()],w.prototype,"tokenBalances",void 0);b([h()],w.prototype,"isPaymentInProgress",void 0);b([h()],w.prototype,"exchangeUrlForQuote",void 0);b([h()],w.prototype,"completedTransactionsCount",void 0);w=b([C("w3m-pay-quote-view")],w);export{p as A,u as P,E as W,d as a,w as b,k as c};
|
|
1065
|
-
//# sourceMappingURL=index-
|
|
1065
|
+
//# sourceMappingURL=index-ET91y1L4.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as h,b as c}from"./lit-element-wjYUA6aF.js";import{n as f}from"./class-map-DopF_Eyi.js";import{c as l}from"./index-
|
|
1
|
+
import{i as h,b as c}from"./lit-element-wjYUA6aF.js";import{n as f}from"./class-map-DopF_Eyi.js";import{c as l}from"./index-juvpUDkX.js";import{d as m}from"./index-Cd-qOUE-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b21c7cf0-1498-4042-832f-f3d6aad405d1",e._sentryDebugIdIdentifier="sentry-dbid-b21c7cf0-1498-4042-832f-f3d6aad405d1")}catch{}})();const p=m`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
background: linear-gradient(
|
|
@@ -28,4 +28,4 @@ import{i as h,b as c}from"./lit-element-wjYUA6aF.js";import{n as f}from"./class-
|
|
|
28
28
|
width: ${this.width};
|
|
29
29
|
height: ${this.height};
|
|
30
30
|
`,this.dataset.rounded=this.rounded?"true":"false",c`<slot></slot>`}};o.styles=[p];d([f()],o.prototype,"width",void 0);d([f()],o.prototype,"height",void 0);d([f()],o.prototype,"variant",void 0);d([f({type:Boolean})],o.prototype,"rounded",void 0);o=d([l("wui-shimmer")],o);
|
|
31
|
-
//# sourceMappingURL=index-
|
|
31
|
+
//# sourceMappingURL=index-FwAqH4Jg.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as h,b as a}from"./lit-element-wjYUA6aF.js";import{n as i,o as p}from"./class-map-DopF_Eyi.js";import"./index-
|
|
1
|
+
import{i as h,b as a}from"./lit-element-wjYUA6aF.js";import{n as i,o as p}from"./class-map-DopF_Eyi.js";import"./index-DIURmrHc.js";import{c as f}from"./index-juvpUDkX.js";import{d as y,r as g,e as b}from"./index-Cd-qOUE-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="5806738f-93d0-49c2-9fb3-f953e7736cd6",e._sentryDebugIdIdentifier="sentry-dbid-5806738f-93d0-49c2-9fb3-f953e7736cd6")}catch{}})();const m=y`
|
|
2
2
|
:host {
|
|
3
3
|
width: 100%;
|
|
4
4
|
}
|
|
@@ -75,4 +75,4 @@ import{i as h,b as a}from"./lit-element-wjYUA6aF.js";import{n as i,o as p}from".
|
|
|
75
75
|
src=${this.imageSrc}
|
|
76
76
|
boxColor=${this.boxColor}
|
|
77
77
|
></wui-image>`}templateRightIcon(){return this.rightIcon?this.loading?a`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:a`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>`:null}};o.styles=[g,b,m];t([i()],o.prototype,"type",void 0);t([i()],o.prototype,"imageSrc",void 0);t([i()],o.prototype,"imageSize",void 0);t([i()],o.prototype,"icon",void 0);t([i()],o.prototype,"iconColor",void 0);t([i({type:Boolean})],o.prototype,"loading",void 0);t([i()],o.prototype,"tabIdx",void 0);t([i()],o.prototype,"boxColor",void 0);t([i({type:Boolean})],o.prototype,"disabled",void 0);t([i({type:Boolean})],o.prototype,"rightIcon",void 0);t([i({type:Boolean})],o.prototype,"boxed",void 0);t([i({type:Boolean})],o.prototype,"rounded",void 0);t([i({type:Boolean})],o.prototype,"fullSize",void 0);o=t([f("wui-list-item")],o);
|
|
78
|
-
//# sourceMappingURL=index-
|
|
78
|
+
//# sourceMappingURL=index-GMK5LYtv.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as w,i as g,b as f}from"./lit-element-wjYUA6aF.js";import{n as y,r as h}from"./class-map-DopF_Eyi.js";import{d as v}from"./index-
|
|
1
|
+
import{a as w,i as g,b as f}from"./lit-element-wjYUA6aF.js";import{n as y,r as h}from"./class-map-DopF_Eyi.js";import{d as v}from"./index-Cd-qOUE-.js";import{c as b}from"./index-juvpUDkX.js";import{j as x,e as $,i as R,p as _,R as T,M as C}from"./W3MFrameProviderSingleton-DFZh2-P1.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="ad751328-ffee-4ae0-9ad8-69a6a57c61be",t._sentryDebugIdIdentifier="sentry-dbid-ad751328-ffee-4ae0-9ad8-69a6a57c61be")}catch{}})();const s=_({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),P={state:s,subscribe(t){return R(s,()=>t(s))},subscribeKey(t,e){return $(s,t,e)},showTooltip({message:t,triggerRect:e,variant:o}){s.open=!0,s.message=t,s.triggerRect=e,s.variant=o},hide(){s.open=!1,s.message="",s.triggerRect={width:0,height:0,top:0,left:0}}},a=x(P),j=w`
|
|
2
2
|
:host {
|
|
3
3
|
width: 100%;
|
|
4
4
|
display: block;
|
|
@@ -98,4 +98,4 @@ import{a as w,i as g,b as f}from"./lit-element-wjYUA6aF.js";import{n as y,r as h
|
|
|
98
98
|
<wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
|
|
99
99
|
<wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
|
|
100
100
|
</wui-flex>`}};p.styles=[E];u([h()],p.prototype,"open",void 0);u([h()],p.prototype,"message",void 0);u([h()],p.prototype,"triggerRect",void 0);u([h()],p.prototype,"variant",void 0);p=u([b("w3m-tooltip")],p);
|
|
101
|
-
//# sourceMappingURL=index-
|
|
101
|
+
//# sourceMappingURL=index-INu2i__0.js.map
|