@dcl/shop 1.15.0 → 1.15.1-35758984456.commit-e35d44f
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-BBgqwdRc.js → Activity-bKECsdYw.js} +4 -4
- package/_assets/{AnimatedBackground-CAe8erqx.js → AnimatedBackground-DxV5mqF_.js} +2 -2
- package/_assets/{Assets-BVr6Ienp.js → Assets-DbsPVOVg.js} +7 -7
- package/_assets/{Cart-uMh-LLkS.js → Cart-DO4LIC11.js} +5 -5
- package/_assets/{Collection-C6wH7PGc.js → Collection-DYqdwnMp.js} +9 -9
- package/_assets/{CollectionCarousel-DLu1yG2d.js → CollectionCarousel-ySH8e59r.js} +6 -6
- package/_assets/{Confetti-CUYY8WKL.js → Confetti-HEIQLhzP.js} +4 -4
- package/_assets/{ConstantsUtil-Du7Rw-I9.js → ConstantsUtil-BgXRXYGw.js} +2 -2
- package/_assets/{ContentClient-CQ0rZRJX.js → ContentClient-9KfSWsTj.js} +2 -2
- package/_assets/{Creator-DiqRz4sK.js → Creator-CORE-kBH.js} +9 -9
- package/_assets/{CreditPackPicker-CZe0q7lQ.js → CreditPackPicker-COxZsW_g.js} +7 -7
- package/_assets/{DeploymentBuilder-B8n1ixz5.js → DeploymentBuilder--7EWiL5t.js} +2 -2
- package/_assets/{EmotePlaybackBar-Dh9mWTmr.js → EmotePlaybackBar-CvNNr5Oh.js} +5 -5
- package/_assets/{ErrorNotice-BZweT4nq.js → ErrorNotice-QFoLzcXZ.js} +2 -2
- package/_assets/{Event-BhrUy_li.js → Event-C21gULzn.js} +2 -2
- package/_assets/{ExchangeController-B8eGX00R.js → ExchangeController-dZXZndcr.js} +2 -2
- package/_assets/{Faq-BRUGz0o1.js → Faq-C8NlTkMm.js} +2 -2
- package/_assets/{Filters-CWaA5jz_.js → Filters-BfKlKsFH.js} +9 -9
- package/_assets/{GetCredits-91FKPj2S.js → GetCredits-C9eifvig.js} +2 -2
- package/_assets/{Grow-BtoTVtjh.js → Grow-BtwC3ton.js} +2 -2
- package/_assets/{HelpersUtil-DtSGcn50.js → HelpersUtil-h8eAZyJ2.js} +2 -2
- package/_assets/{ItemDetail-CPUr9pIj.js → ItemDetail-C2elfZqB.js} +219 -219
- package/_assets/{LoadMore-VpUeZFim.js → LoadMore-wrn8CZ0P.js} +2 -2
- package/_assets/{ManaPricingBanner.styles-CAt88qh9.js → ManaPricingBanner.styles-DiO-oavz.js} +2 -2
- package/_assets/{MyAssets-BUFp0lDY.js → MyAssets-BJlrmf_H.js} +4 -4
- package/_assets/{MyFavorites-BJRUv9oZ.js → MyFavorites-BvCzcgXV.js} +2 -2
- package/_assets/{MyStore-CEJ3my3_.js → MyStore-CE01tniW.js} +7 -7
- package/_assets/{NetworkUtil-Ciq8Tbsc.js → NetworkUtil-B82sps2w.js} +2 -2
- package/_assets/{NotFound-DmCwRSbf.js → NotFound-B38vd0-2.js} +2 -2
- package/_assets/{NotificationsBell-DbHW9KbV.js → NotificationsBell-BAFhPYD4.js} +2 -2
- package/_assets/{OutfitDetail-BdCmpPcB.js → OutfitDetail-CmC7Fz7V.js} +2 -2
- package/_assets/{OutfitPreview-ziiAIMxw.js → OutfitPreview-doqFX8RK.js} +2 -2
- package/_assets/{OutfitStudio-i641piGk.js → OutfitStudio-BQC32jpc.js} +2 -2
- package/_assets/{PaymentMethodStep-DLWg_1Mg.js → PaymentMethodStep-D2ZZeBhr.js} +2 -2
- package/_assets/{SaleCountdown-D_0C1G0b.js → SaleCountdown-75C7xcxV.js} +2 -2
- package/_assets/{Spinner-k8dLtOrJ.js → Spinner-6yZpkHLg.js} +2 -2
- package/_assets/{StoreSettings-DiqvHUbK.js → StoreSettings-CmumjCaY.js} +2 -2
- package/_assets/{Success-yvCjE3be.js → Success-DAcLzy2D.js} +2 -2
- package/_assets/{SwapController-L-o_4Zfy.js → SwapController-DsDt8xqV.js} +2 -2
- package/_assets/{Tooltip-BEJkU8QC.js → Tooltip-CXZh9bO7.js} +2 -2
- package/_assets/TradeService-D3CWOt2G.js +2 -0
- package/_assets/{W3MFrameProviderSingleton-BxpE6Qai.js → W3MFrameProviderSingleton-B_WgnQJA.js} +4 -4
- package/_assets/{WebCryptoP256-DKkCHgRo.js → WebCryptoP256-CO4P30_Q.js} +2 -2
- package/_assets/{basic-DHFzByJo.js → basic-DqTETUY2.js} +2 -2
- package/_assets/{biconomy-DCsUE-Aa.js → biconomy-BRd-F-Rd.js} +2 -2
- package/_assets/{browseLayout.styles-fXEIBUq8.js → browseLayout.styles-DH4Un0Jq.js} +2 -2
- package/_assets/{browser-zYx7iqzr.js → browser-D85mhr-s.js} +2 -2
- package/_assets/{browser-gYEIuxiW.js → browser-D_g_kata.js} +2 -2
- package/_assets/{browser-ponyfill-5UyluzqP.js → browser-ponyfill-BcP6O00l.js} +2 -2
- package/_assets/{buy-zKbAn0Jr.js → buy-C9hvyAAq.js} +2 -2
- package/_assets/{buy-gasless-BheWI81y.js → buy-gasless-BnU0dUSp.js} +2 -2
- package/_assets/{ccip-DAEHnzsX.js → ccip-pFur8j_T.js} +2 -2
- package/_assets/{ccip-DvIRUO6I.js → ccip-wDBYP7tI.js} +2 -2
- package/_assets/{chains-lku0nIXt.js → chains-BCg_IRC_.js} +2 -2
- package/_assets/{collectionPage.styles-B8UMV0wt.js → collectionPage.styles-BfpCypx0.js} +8 -8
- package/_assets/{common-C03gEIWz.js → common-CBJZ92yk.js} +2 -2
- package/_assets/{controller-CoiO-8ak.js → controller-CWOh6-hc.js} +3 -3
- package/_assets/{core-BOjd_Eve.js → core-tb2wOJCE.js} +5 -5
- package/_assets/{createSvgIcon-BiXHCpBo.js → createSvgIcon-CTNepu6k.js} +6 -6
- package/_assets/{crumbs.styles-Bq-08Eo1.js → crumbs.styles-DK1l5Q6W.js} +2 -2
- package/_assets/{custom-D9bjz_2p.js → custom-CM-BIPga.js} +2 -2
- package/_assets/{data-capture-CGASy8JJ.js → data-capture-C9lve2O6.js} +2 -2
- package/_assets/{dcl-schemas-COntwfiV.js → dcl-schemas-Bm7CwtMo.js} +2 -2
- package/_assets/{decimals-BpivF8HU.js → decimals-CDDpcnDv.js} +2 -2
- package/_assets/{decimals-C39Js9A5.js → decimals-CDs72b7s.js} +2 -2
- package/_assets/{detectExtension-CYK2hYlo.js → detectExtension-CVIbYye2.js} +2 -2
- package/_assets/{disposePreview-C9RvsbNf.js → disposePreview-CeFK0Gbv.js} +2 -2
- package/_assets/{email-B7Hqc3Al.js → email-WP5ANIYF.js} +2 -2
- package/_assets/{embedded-wallet-DQ3g7rbj.js → embedded-wallet-CxxDH2Y_.js} +2 -2
- package/_assets/{emotion-styled.browser.esm-orHSWwQS.js → emotion-styled.browser.esm-CwFt_fv-.js} +2 -2
- package/_assets/{engine-BVrA-eDe.js → engine-BSVHzcxQ.js} +2 -2
- package/_assets/{errors-DxKvZXrL.js → errors-DgTO8Pwf.js} +2 -2
- package/_assets/{estimate-l1-fee-CI9CaMqP.js → estimate-l1-fee-wbi1CwgU.js} +2 -2
- package/_assets/{eth_estimateGas-grjD8ZC6.js → eth_estimateGas-X0nU1zIX.js} +2 -2
- package/_assets/{eth_getStorageAt-Di8D3-FZ.js → eth_getStorageAt-smMUPSW5.js} +2 -2
- package/_assets/{eth_getTransactionCount-dmwPv1uL.js → eth_getTransactionCount-DJFj4Z-a.js} +2 -2
- package/_assets/{ethereum-BXBXB0WJ.js → ethereum-Bd9kTKCd.js} +2 -2
- package/_assets/{ethers-BIoA35Pn.js → ethers-CCCzUGvE.js} +2 -2
- package/_assets/{events-DNWUGNd7.js → events-CI6p1q09.js} +2 -2
- package/_assets/{execute-BRAlOglu.js → execute-YTrfihja.js} +3 -3
- package/_assets/{extractIPFS-B6dS8Wbs.js → extractIPFS-Beribx_y.js} +2 -2
- package/_assets/{features-YldM2Blt.js → features-2QVGTJN6.js} +2 -2
- package/_assets/{fetchTokenMetadata-BTPEU-3q.js → fetchTokenMetadata-Bph0BjJ-.js} +3 -3
- package/_assets/{field.styles-7aAfESFo.js → field.styles-DjrPseLy.js} +2 -2
- package/_assets/{fortmatic-Du20O965.js → fortmatic-f94MqiA_.js} +2 -2
- package/_assets/{get-bytecode-Dmk-6Mk4.js → get-bytecode-C2VYXUvG.js} +2 -2
- package/_assets/{get-ecosystem-wallet-info-IK9mOCLo.js → get-ecosystem-wallet-info-DY9KXpsf.js} +2 -2
- package/_assets/{getBalance-ktnD9Moc.js → getBalance-BdiZ9TAk.js} +3 -3
- package/_assets/{getInstalledModules-jTPTLnb8.js → getInstalledModules-BxXhvx70.js} +2 -2
- package/_assets/{getNFT-DbXgJ4kx.js → getNFT-CsityKp4.js} +3 -3
- package/_assets/{getNFT-CwzF6z_7.js → getNFT-w9X9S-KF.js} +2 -2
- package/_assets/{grid.styles-Reh_Sfmk.js → grid.styles-DY7OtvuI.js} +2 -2
- package/_assets/{hashTypedData-B72YO7bf.js → hashTypedData-CSbxHx5S.js} +2 -2
- package/_assets/{hashTypedData-B5WTbVYh.js → hashTypedData-DUcKfkeM.js} +2 -2
- package/_assets/{import-CJWafgcM.js → import-eY4HDWmz.js} +2 -2
- package/_assets/{in-app-reC7MW7U.js → in-app-BtkzLNRf.js} +2 -2
- package/_assets/{in-app-wallet-calls-YVgiy_Z_.js → in-app-wallet-calls-CRNOIw3M.js} +2 -2
- package/_assets/{index-CnNEDEKF.js → index--Ir8Tnq2.js} +2 -2
- package/_assets/{index-nBFm5kuI.js → index-2uhvgeUf.js} +2 -2
- package/_assets/{index-DkEEbiDR.js → index-97h9870i.js} +2 -2
- package/_assets/{index-DKiO6CtY.js → index-B06t_xi0.js} +2 -2
- package/_assets/{index-B610oYVJ.js → index-B4O2ZDef.js} +2 -2
- package/_assets/{index-DURI-gf8.js → index-B4hbKg8s.js} +4 -4
- package/_assets/{index-CZiKz5pK.js → index-B6kVIcHh.js} +2 -2
- package/_assets/{index-Csltect9.js → index-B9A39IHu.js} +2 -2
- package/_assets/{index-DcTChipn.js → index-BDN7ohqQ.js} +3 -3
- package/_assets/{index-CQ_hwt2w.js → index-BNt2xj6D.js} +2 -2
- package/_assets/{index-Butijfje.js → index-BO_D8zz8.js} +2 -2
- package/_assets/{index-DHvU-KWh.js → index-BTZOJ-cb.js} +2 -2
- package/_assets/{index-GQaePZB9.js → index-BbS-Emo7.js} +2 -2
- package/_assets/{index-Cvfa-O4J.js → index-BfPqBm6q.js} +2 -2
- package/_assets/{index-B0NLjhmz.js → index-BhLMHrfP.js} +2 -2
- package/_assets/{index-D8OXtAip.js → index-Bjmt4M2e.js} +2 -2
- package/_assets/{index-BQBSlmH-.js → index-BrnkmZmr.js} +2 -2
- package/_assets/{index-D4EeOyaA.js → index-BsxJZNP6.js} +2 -2
- package/_assets/{index-CyJXEo_c.js → index-C0I2xWST.js} +2 -2
- package/_assets/{index-B7A8C7MY.js → index-C1SUyZUZ.js} +2 -2
- package/_assets/{index-D2gmXgfJ.js → index-C20Xo0Qk.js} +2 -2
- package/_assets/{index-Ys04Xign.js → index-C3ykhW34.js} +2 -2
- package/_assets/index-CJi7LEDC.css +1 -0
- package/_assets/{index-2QUWziXM.js → index-CR6q93wr.js} +2 -2
- package/_assets/{index-B7Z8xaGK.js → index-CTh9rk5N.js} +2 -2
- package/_assets/{index-DJIQTk8q.js → index-CY5zoHO0.js} +2 -2
- package/_assets/{index-C-w85US7.js → index-CZ6WEeXs.js} +2 -2
- package/_assets/{index-DA4F0G5P.js → index-Cb0lWl7u.js} +2 -2
- package/_assets/{index-BVGDgDVf.js → index-Ceo5R3J-.js} +2 -2
- package/_assets/{index-D-gigTjB.js → index-ChROYmEk.js} +2 -2
- package/_assets/{index-D1h1jMQm.js → index-Ch_bMVeI.js} +2 -2
- package/_assets/{index-DSwXuC0D.js → index-CnhnjJ5R.js} +2 -2
- package/_assets/{index-D48CxYHB.js → index-CoUk50Lc.js} +2 -2
- package/_assets/{index-DdpXntwz.js → index-CoVvIOee.js} +2 -2
- package/_assets/{index-DW-Melj-.js → index-CsfoMOIL.js} +2 -2
- package/_assets/{index-CJ1iqO8A.js → index-Cy5gnEAh.js} +2 -2
- package/_assets/{index-CLFGNSZ-.js → index-CywqcYsx.js} +2 -2
- package/_assets/{index-DAFOiLHS.js → index-D1dmapyR.js} +3 -3
- package/_assets/{index-B5Il9w_t.js → index-D5tuSU4_.js} +2 -2
- package/_assets/{index-DtTYXgF3.js → index-DBjnYsMO.js} +2 -2
- package/_assets/{index-B18ZHjoG.js → index-DDc2PRAu.js} +2 -2
- package/_assets/{index-YHzCYJkG.js → index-DHm0H4jh.js} +2 -2
- package/_assets/{index-DDjkaD8J.js → index-DIdrDGIp.js} +2 -2
- package/_assets/{index-C_gzza3J.js → index-DMO-4UAS.js} +2 -2
- package/_assets/{index-COT5Frck.js → index-DMclcFGD.js} +2 -2
- package/_assets/{index-uYTIcGSZ.js → index-DZri9_d8.js} +2 -2
- package/_assets/{index-B3PqY8NV.js → index-Di1f_gg-.js} +2 -2
- package/_assets/{index-7WKP3ObD.js → index-DijPoity.js} +2 -2
- package/_assets/{index-DAh-ftDy.js → index-Dix506II.js} +2 -2
- package/_assets/{index-Ba4Qb-tQ.js → index-DjcH_GIm.js} +2 -2
- package/_assets/{index-CnZUnVbC.js → index-Dmln48uu.js} +2 -2
- package/_assets/{index-B-cCk8d1.js → index-Dos83S_O.js} +2 -2
- package/_assets/{index-DcpPAZS7.js → index-DxSFFM9n.js} +2 -2
- package/_assets/{index-D71yoQwh.js → index-DxfG2pYK.js} +4 -4
- package/_assets/{index-1tydFwH5.js → index-Dz4zx8G5.js} +4 -4
- package/_assets/{index-DrLA_VU_.js → index-ESgisqJB.js} +2 -2
- package/_assets/{index-ClePbRUv.js → index-FWLwLI_L.js} +3 -3
- package/_assets/{index-BYiScitc.js → index-Ie1K2NKm.js} +2 -2
- package/_assets/index-Rj6xitw3.js +4310 -0
- package/_assets/{index-jyj9sHwU.js → index-_6zzOXqE.js} +2 -2
- package/_assets/{index-CBv79d7E.js → index-hA_dK_jp.js} +2 -2
- package/_assets/{index-BXCm1lR6.js → index-iHQu-gMp.js} +2 -2
- package/_assets/{index-CYwEY6Wy.js → index-jIjsvCCP.js} +2 -2
- package/_assets/{index-Cd_cQb_5.js → index-s3zzx4qf.js} +4 -4
- package/_assets/{index-CcdPYHZS.js → index-sOzSRz9a.js} +3 -3
- package/_assets/{index-BWz0ngpy.js → index-tDGGT4se.js} +2 -2
- package/_assets/{index-CA7DDOOl.js → index-u5579SSN.js} +3 -3
- package/_assets/{index-BZcBt3X8.js → index-ucQUr7A4.js} +2 -2
- package/_assets/{index.es-Bn4oTPjZ.js → index.es-BNPjhrfs.js} +2 -2
- package/_assets/{index.es-CU-vsJdv.js → index.es-CmIxggjj.js} +2 -2
- package/_assets/{index.es-BZK_Cifn.js → index.es-OZ_jrVxQ.js} +5 -5
- package/_assets/{index.es-BXEjCl7y.js → index.es-dvTFi3WB.js} +2 -2
- package/_assets/items-empty-CAzEAuwb.js +2 -0
- package/_assets/{jump-DWbTrGpm.js → jump-Cx61htXz.js} +2 -2
- package/_assets/{linkAccount-CMtMM4t3.js → linkAccount-CWB2Woh-.js} +2 -2
- package/_assets/loader-logo-BiK3-TWh.js +2 -0
- package/_assets/{localBatchGatewayRequest-8oF0MPC1.js → localBatchGatewayRequest-DQFeMjbz.js} +2 -2
- package/_assets/{modal.styles-hpuefgX4.js → modal.styles-DgTxff7r.js} +2 -2
- package/_assets/{native-CPeL4rJZ.js → native-C4y7GMWV.js} +2 -2
- package/_assets/{networks-BhouyyPS.js → networks-ckUxzfdf.js} +2 -2
- package/_assets/{onramp-BvIHLQAv.js → onramp-Dt3jsYUN.js} +2 -2
- package/_assets/{openzeppelin-OZNoWqYj.js → openzeppelin-DIpsN3nf.js} +2 -2
- package/_assets/{ownerOf-bCzxqzq0.js → ownerOf-C54s5389.js} +2 -2
- package/_assets/{parseNft-pxEjnpjF.js → parseNft-BbR1W56D.js} +3 -3
- package/_assets/{parseSignature-CpDiAFfJ.js → parseSignature-2VcJfsir.js} +2 -2
- package/_assets/{parseSignature-BAJHdtSB.js → parseSignature-CBgqGFix.js} +4 -4
- package/_assets/{passkeys-iblxlDv1.js → passkeys-C8p4-ZyD.js} +2 -2
- package/_assets/{pay-with-exchange-CLgZOiU6.js → pay-with-exchange-DJcHLYup.js} +2 -2
- package/_assets/{prepare-contract-call-CoHsXlvg.js → prepare-contract-call-o4uVYz2Y.js} +2 -2
- package/_assets/{qr-overlay-B_NIDLKC.js → qr-overlay-dYbTNa51.js} +4 -4
- package/_assets/{react-BmPeg6sG.js → react-BJuMEjl2.js} +2 -2
- package/_assets/{receive-DszbAWAn.js → receive-DYycxA_C.js} +2 -2
- package/_assets/{resolveImplementation-32KPFc_U.js → resolveImplementation-mVYsIlgT.js} +2 -2
- package/_assets/{resume-buy-D2TWyIFl.js → resume-buy-Bkdykvli.js} +2 -2
- package/_assets/{resume-name-B-MASXQk.js → resume-name-CTNS9sIV.js} +2 -2
- package/_assets/{rpc-CHnWH0rF.js → rpc-CoZaI6EH.js} +2 -2
- package/_assets/{sales-empty-UircscXh.js → sales-empty-raINyj4_.js} +2 -2
- package/_assets/{search-empty-CPirv6rw.js → search-empty-DjCdKfBZ.js} +2 -2
- package/_assets/{secp256k1-BUEs1rcj.js → secp256k1-CI4f5kiN.js} +2 -2
- package/_assets/{secp256k1-D1DTa_mW.js → secp256k1-Cbo2_8kp.js} +2 -2
- package/_assets/{secp256k1-Bb0zIfEz.js → secp256k1-Dyn2w5P5.js} +2 -2
- package/_assets/{send-batch-transaction-CcXPrdOH.js → send-batch-transaction-CpVRyS6x.js} +2 -2
- package/_assets/{send-eip712-transaction-ouILrTb6.js → send-eip712-transaction-Dxs7wPRW.js} +3 -3
- package/_assets/{send-gasless-transaction-rKjG34Kj.js → send-gasless-transaction-S_6BUU5w.js} +3 -3
- package/_assets/{send-transaction-BbLs2Ynf.js → send-transaction-C20Ra9-I.js} +3 -3
- package/_assets/{send-C8TzZsHF.js → send-yYwvRRB7.js} +2 -2
- package/_assets/{sendMetaTransaction-Dy6lp92T.js → sendMetaTransaction-C5b7rSXh.js} +2 -2
- package/_assets/{sendRawTransaction-BY7CWiPp.js → sendRawTransaction-DDyy707c.js} +4 -4
- package/_assets/{sentry-CfKEockx.js → sentry-Cv7iYFas.js} +3 -3
- package/_assets/{serializeTransaction-DOIuoefa.js → serializeTransaction-eHQIao0M.js} +2 -2
- package/_assets/{session-proposal-BR55dEaA.js → session-proposal-nhUt9PDC.js} +2 -2
- package/_assets/{session-request-C_hO74mD.js → session-request-C-_ZZWXU.js} +3 -3
- package/_assets/{sha256-BJjUSCTX.js → sha256-BBrHzqm3.js} +2 -2
- package/_assets/{sha3-B3El3U9k.js → sha3-DF3IgY7u.js} +2 -2
- package/_assets/signin-empty-VJ2i5nlY.js +2 -0
- package/_assets/{signing-D66RpSSx.js → signing-CUVnfBov.js} +4 -4
- package/_assets/{skeleton.styles-B3BxeSy_.js → skeleton.styles-Dkdpu9S4.js} +2 -2
- package/_assets/{socials-fdANcU4O.js → socials-CzT9Ope8.js} +2 -2
- package/_assets/{styled-ihfZhc5C.js → styled-BPuJZtLw.js} +3 -3
- package/_assets/{swaps-DZV3-WZp.js → swaps-D_nn608d.js} +2 -2
- package/_assets/{thirdweb-dhrmjSPt.js → thirdweb-aXR7VZgh.js} +4 -4
- package/_assets/{to-serializable-transaction-BxxEhlQY.js → to-serializable-transaction-BmsY8QrV.js} +3 -3
- package/_assets/{totalSupply-B2nCZvgY.js → totalSupply-BMwx0h3k.js} +2 -2
- package/_assets/{trade-encoding-D0iBabuM.js → trade-encoding-DWpimiL1.js} +2 -2
- package/_assets/{transaction-CJXWN8an.js → transaction-BO0a3JDp.js} +2 -2
- package/_assets/{transactionReceipt-CpzMTSMZ.js → transactionReceipt-DTRPLDyn.js} +2 -2
- package/_assets/{transactions-CKkVNjQ4.js → transactions-DcXz63jV.js} +2 -2
- package/_assets/{useCreatorSales-Ze3V5ohC.js → useCreatorSales-Dne7wG4l.js} +77 -77
- package/_assets/{useInfiniteGrid-D8vhQEzx.js → useInfiniteGrid-Dd07CrOc.js} +2 -2
- package/_assets/{useStore-DdvCUhO-.js → useStore-5H_8nJCb.js} +3 -3
- package/_assets/{useTheme-QKnvhO7_.js → useTheme-7-3gcs4V.js} +2 -2
- package/_assets/{utils-5qk7WI4m.js → utils-t7866p84.js} +2 -2
- package/_assets/{verifyHash-Dm5TFWpr.js → verifyHash-Auu6O9eS.js} +2 -2
- package/_assets/{w3m-modal-B5R3n_ak.js → w3m-modal-BY88qkF-.js} +2 -2
- package/_assets/{w3m-modal-CEqDQIHN.js → w3m-modal-CBUfdWNk.js} +2 -2
- package/_assets/{wait-for-tx-receipt-CUblm3Uy.js → wait-for-tx-receipt-CgJna2Ie.js} +2 -2
- package/_assets/{wallets-BT0Osdwo.js → wallets-CHxO-Ctc.js} +6 -6
- package/_assets/{web-connector-BzJlWUBl.js → web-connector-DmFj8e1e.js} +4 -4
- package/_assets/{writeContract-CH8f16EO.js → writeContract-7U0ZKDRI.js} +2 -2
- package/_assets/{zora-sepolia-BfgSfWmM.js → zora-sepolia-BataDEu7.js} +2 -2
- package/_assets/{zoraTestnet-CiGZFo3e.js → zoraTestnet-DWFNTwEp.js} +2 -2
- package/index.html +12 -12
- package/package.json +2 -2
- package/_assets/TradeService-DVeKA0A9.js +0 -2
- package/_assets/index-COio6Ejd.js +0 -4310
- package/_assets/index-DVuzXPDM.css +0 -1
- package/_assets/items-empty-DGRxHTWy.js +0 -2
- package/_assets/loader-logo-CeNjVZuG.js +0 -2
- package/_assets/signin-empty-XsT9jLzt.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{m as Ae,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-B06t_xi0.js","_assets/react-BJuMEjl2.js","_assets/index-Rj6xitw3.js","_assets/dcl-schemas-Bm7CwtMo.js","_assets/sentry-Cv7iYFas.js","_assets/ethers-CCCzUGvE.js","_assets/intl-AKLEHPeO.js","_assets/index-CJi7LEDC.css","_assets/import-eY4HDWmz.js","_assets/buy-C9hvyAAq.js","_assets/trade-encoding-DWpimiL1.js","_assets/sendMetaTransaction-C5b7rSXh.js","_assets/modal.styles-DgTxff7r.js","_assets/ManaPricingBanner.styles-DiO-oavz.js","_assets/Faq-C8NlTkMm.js","_assets/sales-empty-raINyj4_.js","_assets/field.styles-DjrPseLy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{m as Ae,bH as Ee,x as U,w as E,c2 as Le,s as u,a as d,k as Ne,B as Te,t as o,Y as $e,aF as Pe,$ as ce,c3 as se,c4 as ne,c5 as Se,_ as Fe,z as L,as as B,c6 as Ce,aG as De,bt as K,I as V,F as Me,c7 as He,aP as T,c8 as Re,c9 as Q}from"./index-Rj6xitw3.js";import{r as f,u as We,j as t,d as qe,L as Oe}from"./react-BJuMEjl2.js";import{u as _e,s as ze}from"./sales-empty-raINyj4_.js";import{L as Ge}from"./LoadMore-wrn8CZ0P.js";import{u as $}from"./useInfiniteGrid-Dd07CrOc.js";import{m as le}from"./mana-matic-CEqvSwrJ.js";import{n as Ue}from"./name-glyph-aUugT8vq.js";import{s as Be}from"./signin-empty-VJ2i5nlY.js";import"./dcl-schemas-Bm7CwtMo.js";import"./sentry-Cv7iYFas.js";import"./ethers-CCCzUGvE.js";import"./intl-AKLEHPeO.js";import"./import-eY4HDWmz.js";import"./buy-C9hvyAAq.js";import"./trade-encoding-DWpimiL1.js";import"./sendMetaTransaction-C5b7rSXh.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="573d475a-a076-419d-9c7a-ea0367d481c9",e._sentryDebugIdIdentifier="sentry-dbid-573d475a-a076-419d-9c7a-ea0367d481c9")}catch{}})();const Ke=15e3;function Ve(e,a){return e.txHash&&a.txHash?e.txHash===a.txHash:e.txHash||a.txHash?!1:e.status===a.status&&Math.abs(e.createdAt-a.createdAt)<=Ke}function Qe(e){const a=[...e].sort((i,n)=>n.createdAt-i.createdAt),s=[];for(const i of a){const n=s[s.length-1];n&&Ve(n[n.length-1],i)?n.push(i):s.push([i])}return s.map(i=>{var n;return{id:((n=i.find(c=>c.txHash))==null?void 0:n.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:Xe(i),totalCredits:i.reduce((c,l)=>c+l.credits,0),lines:i}})}function Xe(e){return e.some(a=>a.status==="PENDING")?"PENDING":e.some(a=>a.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ye(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ze(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Je(e){const a=[],s=new Map;for(const i of e){const n=Ze(i);if(!n){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits});continue}const c=s.get(n);if(c){c.quantity+=1,c.credits+=i.credits;continue}const l={key:n,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};s.set(n,l),a.push(l)}return a}function et(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?Ae(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function tt(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function it(e){const s=Qe(e.purchases.filter(tt)).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=e.sales.map(r=>{const p=et(r,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),n=(e.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(e.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),l=(e.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...i,...n,...l].sort((r,p)=>p.createdAt-r.createdAt||(r.id<p.id?-1:1))}function at(e,a){return a==="all"?e:a==="sales"?e.filter(s=>s.kind==="sale"):e.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const he=e=>e.trim().toLowerCase();function st(e){const a=new Map;for(const s of e??[]){const i=he(s.txHash??"");if(!i)continue;const n=a.get(i);n?n.push(s):a.set(i,[s])}return a}function nt(e,a,s=Date.now()){const i=a.txHash?e.get(he(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const n=i.length===1?rt(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const l=c.reduce((r,p)=>Math.max(r,p.availableAt),0);return{kind:"pending",credits:n,availableAt:l}}function rt(e){return Ee(e)}function ot(){const e=U(i=>{var n;return(n=i.session)==null?void 0:n.address}),{data:a,isLoading:s}=E({queryKey:["listing-count",e],queryFn:()=>Le({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:a==null?void 0:a.total,isLoading:s}}const dt="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/credits-product-vs4Q6u6l.svg",X=Ne`
|
|
3
3
|
0% { background-position: 200% 0; }
|
|
4
4
|
100% { background-position: -200% 0; }
|
|
5
5
|
`,ct=u.section`
|
|
@@ -396,5 +396,5 @@ import{m as Ae,bF as Ee,x as U,w as E,c0 as Le,s as u,a as d,k as Ne,B as Te,t a
|
|
|
396
396
|
height: 26px;
|
|
397
397
|
object-fit: contain;
|
|
398
398
|
}
|
|
399
|
-
`,ee=N.withComponent(Oe),jt=f.lazy(()=>Fe(()=>import("./index-DKiO6CtY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],z="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ge(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function fe({children:e}){const a=f.useRef(null),[s,i]=f.useState(null),n=()=>{var l;const c=(l=a.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(yt,{ref:a,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>i(null),onFocus:n,onBlur:()=>i(null),children:[e,s?qe.createPortal(t.jsx(bt,{style:{top:s.top,left:s.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const a=!!e.contractAddress&&!!e.itemId,s=!!e.tradeId||a,{data:i,isLoading:n}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:s,staleTime:5*6e4}),c=s&&n,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=K({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,j=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(W,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(V,{name:"cart",size:20})}),t.jsxs(q,{children:[c?t.jsx(J,{}):t.jsx(O,{title:l,children:l}),e.quantity>1?t.jsx(_,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:j}):t.jsx(N,{children:j})}function Lt({item:e}){const a=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(q,{children:[t.jsx(O,{title:a,children:a}),t.jsx(_,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const a=Je(e.lines),s=a.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),n=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(F,{children:[t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:s})]})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":i,children:n}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:a.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function Tt({sale:e}){const{data:a,isLoading:s}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??o("activity.itemFallback"),n=(a==null?void 0:a.thumbnail)??"",c=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[s?t.jsx(Z,{}):t.jsx(W,{children:n?t.jsx("img",{src:n,alt:i}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(q,{children:[s?t.jsx(J,{}):t.jsx(O,{title:i,children:i}),t.jsx(_,{children:o("activity.boughtFrom",{account:ge(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(F,{children:[t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function $t({sale:e,payout:a}){const{data:s,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),n=(s==null?void 0:s.name)??o("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",l=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(W,{children:c?t.jsx("img",{src:c,alt:n}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(q,{children:[i?t.jsx(J,{}):t.jsx(O,{title:n,children:n}),t.jsxs(_,{children:[o("activity.soldTo",{account:ge(e.counterparty)}),a.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(a.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(F,{children:[t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),a.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):a.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",Me(a.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Pt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,s=Ce(e.status),i=s==="SETTLED"?o("activity.completed"):s==="FAILED"?o("activity.failed"):s==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),n=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!n;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function j(){if(!(!n||l)){r(!0);try{const m=await He(e.id,n.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}T.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?(T.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?(T.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):T.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(F,{children:[t.jsx(xt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:a})]})]}),t.jsxs(H,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void j(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":s,children:i}),t.jsxs(k,{"data-kind":s==="UNFINISHED"?void 0:"income",children:[s==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]})]})})}function St({filter:e}){const a={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(wt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:ze,title:o("activity.emptyTitle"),body:a,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Qt(){const{session:e,signIn:a}=U(),[s,i]=f.useState("all"),[n,c]=We(),l=n.get(z)===de||n.get(G)===At;Te({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=_e(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),g=!!e&&!l&&s!=="sales",x=!!e&&!l&&s!=="purchases",y=$(["purchases",e==null?void 0:e.address],h=>Se(e.address,e.identity,{first:P,skip:h}),{enabled:g}),b=$(["sales",e==null?void 0:e.address],h=>se(e.address,{role:"seller",first:P,skip:h}),{enabled:x}),v=$(["credit-orders",e==null?void 0:e.address],h=>ne(e.address,e.identity,{first:P,skip:h}),{enabled:g}),w=$(["mana-purchases",e==null?void 0:e.address],h=>se(e.address,{role:"buyer",first:P,skip:h}),{enabled:g}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ye=f.useMemo(()=>st(te),[te]),{data:be}=$e(x);if(!e)return t.jsx(Pe,{children:t.jsx(ce,{testId:"activity-signin",icon:Be,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>a()},ctaVariant:"solid",fill:!0})});const ie=at(it({purchases:g?y.items:[],sales:x?b.items:[],creditOrders:g?v.items:[],manaPurchases:g?w.items:[],rate:be}),s),ve=g&&(y.isLoading||v.isLoading||w.isLoading)||x&&b.isLoading,ae=g&&(y.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||x&&b.isFetchingNextPage,we=g&&(y.hasNextPage||v.hasNextPage||w.hasNextPage)||x&&b.hasNextPage;function ke(){g&&y.hasNextPage&&y.fetchNextPage(),g&&v.hasNextPage&&v.fetchNextPage(),g&&w.hasNextPage&&w.fetchNextPage(),x&&b.hasNextPage&&b.fetchNextPage()}function je(h){if(i(h),!l)return;const I=new URLSearchParams(n);I.delete(z),I.delete(G),c(I,{replace:!0})}function Ie(){const h=new URLSearchParams(n);h.set(z,de),h.delete(G),c(h,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ht,{children:o("nav.activity")})}),t.jsxs(ut,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(h=>t.jsx(ue,{type:"button",role:"tab","aria-selected":!l&&s===h,"data-active":!l&&s===h,"data-testid":`activity-filter-${h}`,onClick:()=>je(h),children:o(`activity.filter.${h}`)},h)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(gt,{"aria-busy":"true"}),children:t.jsx(jt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((h,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(h=>h.kind==="purchase"?t.jsx(Nt,{order:h.order},h.id):h.kind==="credit"?t.jsx(Pt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(Tt,{sale:h.sale},h.id):t.jsx($t,{sale:h.sale,payout:nt(ye,h.sale)},h.id)),ae?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:we,isFetching:ae,onLoadMore:ke})]})]})}export{Qt as Activity};
|
|
400
|
-
//# sourceMappingURL=Activity-
|
|
399
|
+
`,ee=N.withComponent(Oe),jt=f.lazy(()=>Fe(()=>import("./index-B06t_xi0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(e=>({default:e.ImportListings}))),P=24,It=["all","purchases","sales"],z="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ge(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function fe({children:e}){const a=f.useRef(null),[s,i]=f.useState(null),n=()=>{var l;const c=(l=a.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(yt,{ref:a,tabIndex:0,onMouseEnter:n,onMouseLeave:()=>i(null),onFocus:n,onBlur:()=>i(null),children:[e,s?qe.createPortal(t.jsx(bt,{style:{top:s.top,left:s.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const a=!!e.contractAddress&&!!e.itemId,s=!!e.tradeId||a,{data:i,isLoading:n}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:s,staleTime:5*6e4}),c=s&&n,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=K({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,j=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(W,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(V,{name:"cart",size:20})}),t.jsxs(q,{children:[c?t.jsx(J,{}):t.jsx(O,{title:l,children:l}),e.quantity>1?t.jsx(_,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:j}):t.jsx(N,{children:j})}function Lt({item:e}){const a=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(q,{children:[t.jsx(O,{title:a,children:a}),t.jsx(_,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const a=Je(e.lines),s=a.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),n=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(F,{children:[t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:s})]})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":i,children:n}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:a.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function Tt({sale:e}){const{data:a,isLoading:s}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??o("activity.itemFallback"),n=(a==null?void 0:a.thumbnail)??"",c=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[s?t.jsx(Z,{}):t.jsx(W,{children:n?t.jsx("img",{src:n,alt:i}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(q,{children:[s?t.jsx(J,{}):t.jsx(O,{title:i,children:i}),t.jsx(_,{children:o("activity.boughtFrom",{account:ge(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(F,{children:[t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function $t({sale:e,payout:a}){const{data:s,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),n=(s==null?void 0:s.name)??o("activity.itemFallback"),c=(s==null?void 0:s.thumbnail)??"",l=K({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(W,{children:c?t.jsx("img",{src:c,alt:n}):t.jsx(V,{name:"offer",size:20})}),t.jsxs(q,{children:[i?t.jsx(J,{}):t.jsx(O,{title:n,children:n}),t.jsxs(_,{children:[o("activity.soldTo",{account:ge(e.counterparty)}),a.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(a.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(F,{children:[t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),a.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):a.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",Me(a.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Pt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,s=Ce(e.status),i=s==="SETTLED"?o("activity.completed"):s==="FAILED"?o("activity.failed"):s==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),n=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!n;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function j(){if(!(!n||l)){r(!0);try{const m=await He(e.id,n.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}T.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?(T.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?(T.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):T.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(F,{children:[t.jsx(xt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(C,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:a})]})]}),t.jsxs(H,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void j(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":s,children:i}),t.jsxs(k,{"data-kind":s==="UNFINISHED"?void 0:"income",children:[s==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(B,{credits:e.credits})]})]})]})})}function St({filter:e}){const a={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(wt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:ze,title:o("activity.emptyTitle"),body:a,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Qt(){const{session:e,signIn:a}=U(),[s,i]=f.useState("all"),[n,c]=We(),l=n.get(z)===de||n.get(G)===At;Te({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=_e(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),g=!!e&&!l&&s!=="sales",x=!!e&&!l&&s!=="purchases",y=$(["purchases",e==null?void 0:e.address],h=>Se(e.address,e.identity,{first:P,skip:h}),{enabled:g}),b=$(["sales",e==null?void 0:e.address],h=>se(e.address,{role:"seller",first:P,skip:h}),{enabled:x}),v=$(["credit-orders",e==null?void 0:e.address],h=>ne(e.address,e.identity,{first:P,skip:h}),{enabled:g}),w=$(["mana-purchases",e==null?void 0:e.address],h=>se(e.address,{role:"buyer",first:P,skip:h}),{enabled:g}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ne(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:x,staleTime:6e4}),ye=f.useMemo(()=>st(te),[te]),{data:be}=$e(x);if(!e)return t.jsx(Pe,{children:t.jsx(ce,{testId:"activity-signin",icon:Be,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>a()},ctaVariant:"solid",fill:!0})});const ie=at(it({purchases:g?y.items:[],sales:x?b.items:[],creditOrders:g?v.items:[],manaPurchases:g?w.items:[],rate:be}),s),ve=g&&(y.isLoading||v.isLoading||w.isLoading)||x&&b.isLoading,ae=g&&(y.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||x&&b.isFetchingNextPage,we=g&&(y.hasNextPage||v.hasNextPage||w.hasNextPage)||x&&b.hasNextPage;function ke(){g&&y.hasNextPage&&y.fetchNextPage(),g&&v.hasNextPage&&v.fetchNextPage(),g&&w.hasNextPage&&w.fetchNextPage(),x&&b.hasNextPage&&b.fetchNextPage()}function je(h){if(i(h),!l)return;const I=new URLSearchParams(n);I.delete(z),I.delete(G),c(I,{replace:!0})}function Ie(){const h=new URLSearchParams(n);h.set(z,de),h.delete(G),c(h,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ht,{children:o("nav.activity")})}),t.jsxs(ut,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(h=>t.jsx(ue,{type:"button",role:"tab","aria-selected":!l&&s===h,"data-active":!l&&s===h,"data-testid":`activity-filter-${h}`,onClick:()=>je(h),children:o(`activity.filter.${h}`)},h)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(gt,{"aria-busy":"true"}),children:t.jsx(jt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((h,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(h=>h.kind==="purchase"?t.jsx(Nt,{order:h.order},h.id):h.kind==="credit"?t.jsx(Pt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(Tt,{sale:h.sale},h.id):t.jsx($t,{sale:h.sale,payout:nt(ye,h.sale)},h.id)),ae?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:we,isFetching:ae,onLoadMore:ke})]})]})}export{Qt as Activity};
|
|
400
|
+
//# sourceMappingURL=Activity-bKECsdYw.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as d}from"./react-
|
|
1
|
+
import{r as u,j as d}from"./react-BJuMEjl2.js";import{s as f}from"./index-Rj6xitw3.js";import"./dcl-schemas-Bm7CwtMo.js";import"./sentry-Cv7iYFas.js";import"./ethers-CCCzUGvE.js";import"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="cca2300d-f393-45a2-8f17-e990c85553c0",e._sentryDebugIdIdentifier="sentry-dbid-cca2300d-f393-45a2-8f17-e990c85553c0")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -95,4 +95,4 @@ void main() {
|
|
|
95
95
|
width: 100%;
|
|
96
96
|
height: 100%;
|
|
97
97
|
`;function K({patternTiling:e=1.66}){const a=u.useRef(null),n=u.useRef(0),r=u.useRef(e);return r.current=e,u.useEffect(()=>{var _;const o=a.current;if(!o||(_=window.matchMedia)!=null&&_.call(window,"(prefers-reduced-motion: reduce)").matches)return;const t=o.getContext("webgl",{alpha:!1,antialias:!1});if(!t)return;const c=p(t,t.VERTEX_SHADER,L),s=p(t,t.FRAGMENT_SHADER,I);if(!c||!s){c&&t.deleteShader(c),s&&t.deleteShader(s);return}const i=B(t,c,s);if(!i){t.deleteShader(c),t.deleteShader(s);return}const m=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),w=t.getUniformLocation(i,"u_resolution"),b=t.getUniformLocation(i,"u_overlayTex"),A=t.getUniformLocation(i,"u_overlayTiling"),v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);let g=!1;const h=F(t,P,()=>g),S=()=>{const l=window.devicePixelRatio||1,E=o.clientWidth*l,x=o.clientHeight*l;(o.width!==E||o.height!==x)&&(o.width=E,o.height=x)},U=performance.now()/1e3,y=()=>{S(),t.viewport(0,0,o.width,o.height),t.useProgram(i),t.uniform1f(R,performance.now()/1e3-U),t.uniform2f(w,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(b,0),t.enableVertexAttribArray(m),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(m,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),n.current=requestAnimationFrame(y)},T=l=>{l.preventDefault(),cancelAnimationFrame(n.current),o.style.opacity="0"};return o.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(y),()=>{g=!0,cancelAnimationFrame(n.current),o.removeEventListener("webglcontextlost",T),t.deleteProgram(i),t.deleteShader(c),t.deleteShader(s),t.deleteBuffer(v),t.deleteTexture(h)}},[]),d.jsxs(C,{"aria-hidden":!0,children:[d.jsx(k,{style:{backgroundImage:`url(${D})`}}),d.jsx(V,{ref:a})]})}export{K as default};
|
|
98
|
-
//# sourceMappingURL=AnimatedBackground-
|
|
98
|
+
//# sourceMappingURL=AnimatedBackground-DxV5mqF_.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-
|
|
1
|
+
import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-BJuMEjl2.js";import{c as se,r as wt,b as jt,bF as vt,h as Ye,j as Xe,bB as Ct,bc as $t,ba as kt,w as St,c$ as Et,d0 as Rt,s as i,a as t,x as dt,bl as Tt,aG as _t,F as ht,t as s,d1 as Mt,bI as We,D as It,I as W,z as V,d2 as ze,E as ge,bk as At,l as Nt,O as Me,bv as Je,bE as Lt,bD as Wt,B as pt,Y as ut,m as mt,bX as zt,bY as Pt,y as Bt,bR as Ft,av as Ot,$ as Ut,a1 as et,a2 as be,aE as Ht,bS as Dt,bT as Gt}from"./index-Rj6xitw3.js";import{u as qt,s as Kt}from"./search-empty-DjCdKfBZ.js";import{u as Vt,l as Zt,m as Qt,S as Yt,F as Xt,a as Jt}from"./Filters-BfKlKsFH.js";import{R as en,S as tn,a as nn,D as sn,b as an,C as on,c as rn,d as ln,e as cn,M as dn}from"./browseLayout.styles-DH4Un0Jq.js";import{L as hn}from"./LoadMore-wrn8CZ0P.js";import{u as pn}from"./useInfiniteGrid-Dd07CrOc.js";import{E as un}from"./ErrorNotice-QFoLzcXZ.js";import{d as mn}from"./dcl-schemas-Bm7CwtMo.js";import{s as fn,G as xn,w as gn,S as bn}from"./buy-gasless-BnU0dUSp.js";import{s as yn}from"./buy-C9hvyAAq.js";import{u as wn,A as jn,C as vn}from"./trade-encoding-DWpimiL1.js";import{f as Cn}from"./errors-DgTO8Pwf.js";import{J as $n,C as kn,B as Ie}from"./ethers-CCCzUGvE.js";import{z as Sn,D as En,w as Rn,W as Tn,m as _n,n as Mn,o as In,v as An,j as tt}from"./CreditPackPicker-COxZsW_g.js";import{u as Nn,M as Ln,o as Wn,l as zn,R as Pn,c as Bn}from"./loader-logo-BiK3-TWh.js";import{P as Fn}from"./PaymentMethodStep-D2ZZeBhr.js";import{R as nt}from"./resume-name-CTNS9sIV.js";import{R as On}from"./resume-buy-Bkdykvli.js";import{n as Un}from"./name-glyph-aUugT8vq.js";import{c as Hn}from"./crumbs.styles-DK1l5Q6W.js";import{n as Dn}from"./Tooltip-CXZh9bO7.js";import{G as Gn}from"./grid.styles-DY7OtvuI.js";import"./sentry-Cv7iYFas.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-Dkdpu9S4.js";import"./sendMetaTransaction-C5b7rSXh.js";import"./mana-matic-CEqvSwrJ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="dc2b866a-a36a-47a2-9829-7f994c89e531",n._sentryDebugIdIdentifier="sentry-dbid-dc2b866a-a36a-47a2-9829-7f994c89e531")}catch{}})();function ye(n){const a=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${a}:${r}`}const Z="100000000000000000000",ft=2,Ae=15,qn=/^[a-zA-Z0-9]+$/;function st(n){const a=n.trim();return a.length===0?{ok:!1,reason:"empty"}:qn.test(a)?a.length<ft?{ok:!1,reason:"too-short"}:a.length>Ae?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Kn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,Ae)}const Vn=["function available(string _subdomain) view returns (bool)"],it={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Zn(){return se.chainId===Number(mn.ChainId.MATIC_MAINNET)?it.mainnet:it.sepolia}async function Qn(n,a={}){var g;const{rpc:r,address:h}=Zn(),d=new $n(r),w=new kn(h,Vn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const c=await w.available(n);if((g=a.signal)!=null&&g.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${c}`),c?"available":"taken"}const Yn="https://app.across.to/api";class Qe extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Ke extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ve extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function Xn(n){return $t(Z,n)}async function Jn(n,a,r={}){var g;const h=r.chainId??se.chainId,d=r.provider??"across",w=`${se.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(a)}&chainId=${h}&provider=${d}`,c=await kt(w,{method:"GET",identity:n,metadata:{}});if(!c.ok){let l;try{l=(g=await c.json())==null?void 0:g.code}catch{}throw l==="ROUTE_COST_TOO_HIGH"?new Qe:new Error(`fetchNameCreditRoute ${c.status}`)}return c.json()}function es(n,a){const r=Ie.from(n.availableAmount),d=Ie.from(Z).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:vn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:a.externalCall.target,selector:a.externalCall.selector,data:a.externalCall.data,expiresAt:a.externalCall.expiresAt,salt:a.externalCall.salt},customExternalCallSignature:a.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:Z}}async function ts(n,a={}){const r=Yn,h=a.intervalMs??1e4,d=a.maxAttempts??60;let w={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let c=0;c<d;c++){try{const g=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(g.ok){const l=await g.json(),j=(l.status??"pending").toLowerCase(),b=l.fillTx??l.fillTxnRef??null,C=typeof l.actionsSucceeded=="boolean"?l.actionsSucceeded:null;if(j==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:C};if(j==="refunded"||j==="expired")return{status:j,destinationTxHash:null,actionsSucceeded:!1};w={status:"pending",destinationTxHash:b,actionsSucceeded:C}}}catch{}c<d-1&&await new Promise(g=>setTimeout(g,h))}return w}async function ns(n){const{name:a,identity:r,signer:h}=n,d=b=>{var C;try{(C=n.onProgress)==null||C.call(n,b)}catch{}},w=n.chainId??se.chainId,c=n.provider??"across",g=(n.beneficiary??await h.getAddress()).toLowerCase();let l=null,j="unconfirmed";console.info("[names] register start",{name:a,buyer:g,chainId:w,provider:c}),d("preparing");try{const b=await wt(jt(se.chainId).address),C=Xn(b),m=n.creditsCents!=null?Math.max(1,Math.min(Math.trunc(n.creditsCents),C)):C,k=m<C;console.info("[names] step 1/6 sized reservation",{usdCents:m,fullPriceCents:C,payingWithMana:k,manaRate:b});const x=await Jn(r,a,{chainId:w,provider:c});console.info("[names] step 2/6 route fetched",{target:x.externalCall.target,selector:x.externalCall.selector,provider:x.provider,quoteId:x.quoteId});const y=await vt(r,m,void 0,void 0,a);if(l=y.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:y.credit.id,maxCreditedValue:y.maxCreditedValue}),!k&&Ie.from(y.maxCreditedValue).lt(Z))throw new Error("Credit under-sized for the name price");if(k){const u=Ie.from(Z).sub(y.credit.availableAmount);if(n.maxManaWei!=null&&u.gt(n.maxManaWei.toString()))throw new Error("The MANA needed moved past what was agreed");u.gt(0)&&(d("awaiting-confirmation"),await wn({auth:{kind:jn.Allowance,contractAddress:Ye(Xe.MANAToken,w).address,spenderAddress:Ye(Xe.CreditsManager,w).address,chainId:w},signer:h,requiredWei:BigInt(u.toString())}),console.info("[names] step 3b/6 mana allowance ensured",{gapWei:u.toString()}))}d("awaiting-confirmation");const v=es(y.credit,x);let $;try{$=await fn({chainId:w,buyer:g,signer:h,args:v})}catch(u){if(!(u instanceof xn))throw u;if(u.reason==="relayer-unreachable"){j="unobservable";const N=new Ve;throw N.cause=u,N}$=await yn(w,v,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:$}),d("confirming"),await gn($),j="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:$}),c==="across"){d("registering");const u=await ts($,n.acrossPoll);if(console.info("[names] step 6/6 across status",u),u.status==="pending")return{status:"pending",originTxHash:$};if(u.status==="filled"&&u.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:$}),{status:"pending",originTxHash:$};if(u.status!=="filled"||u.actionsSucceeded!==!0)throw new Ke;return{status:"registered",originTxHash:$,destinationTxHash:u.destinationTxHash}}return{status:"pending",originTxHash:$}}catch(b){if(console.error("[names] register failed — raw error:",b,{name:a,buyer:g,originState:j}),b instanceof bn)return{status:"pending",originTxHash:b.txHash};if(l&&j==="unconfirmed"&&await Ct(r,[l]).catch(()=>{}),b instanceof Qe||b instanceof Ke||b instanceof Ve)throw b;const C=new Error(Cn(b,"Couldn't register the name. Please try again.",{sale:!0}));throw C.cause=b,C}}function ss(){const{data:n}=St({queryKey:["feature-flag","shop-names"],queryFn:()=>Et(Rt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const is=60,as=700,os=25;function rs(n){if(!n)return[];const a=[];for(let r=1;r<=n.length;r++)a.push({text:n.slice(0,r),delay:is});a[a.length-1]={text:n,delay:as};for(let r=n.length-1;r>=1;r--)a.push({text:n.slice(0,r),delay:os});return a}function ls(n){return n.flatMap(rs)}function cs(n,a){const r=p.useMemo(()=>ls(n),[n]),[h,d]=p.useState(0);return p.useEffect(()=>{if(!a||r.length===0)return;const w=setTimeout(()=>d(c=>(c+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(w)},[h,a,r]),!a||r.length===0?"":r[h%r.length].text}const ds="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/name-verified-oGwQ3ntb.svg",hs="#34fee6",ps=i.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -509,10 +509,10 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-BmPeg6sG.js";import{c
|
|
|
509
509
|
font-size: 32px;
|
|
510
510
|
font-weight: 700;
|
|
511
511
|
color: ${t.colors.white};
|
|
512
|
-
`;function Fs({name:n,priceCredits:a,onClose:r}){const{session:h}=dt(),{data:d,isError:w}=Tt(h),c=_t(),g=Ze(),[l,j]=p.useState("confirm"),[b,C]=p.useState(""),[m,k]=p.useState(""),[x,y]=p.useState(!1),[v,$]=p.useState(null),u=(v==null?void 0:v.rail)??"credits",[N,F]=p.useState(null),[re,I]=p.useState(!1),[R,O]=p.useState("preparing"),B=p.useRef(!1),ie=b.trim().toLowerCase()===n.toLowerCase(),T=l==="completing"||x,A=a!=null?ht(a):"—",L=a==null,J=d==null?void 0:d.credits,U=a!=null&&J!=null?a-J:0,z=U>0,H=L?s("names.priceUnavailable"):null,{data:G}=Mt(h),q=(G==null?void 0:G.matic)??0n,D=Rn({priceCents:a!=null?a*We:0,priceManaWei:BigInt(Z),balanceCents:(d==null?void 0:d.balanceCents)??0,manaBalanceWei:q,manaOnlyRail:!1}),S=D.options.some(f=>f.method!=="credits"),P=D.options.find(f=>f.method==="combined"),_=v==null&&S&&!L,M=Nn().packs.slice(0,Ln),{packs:ae,recommended:ee,closesGap:le}=Wn(M,U),V=ae.find(f=>f.id===m)??ee;p.useEffect(()=>{const f=E=>{E.key==="Escape"&&!T&&r()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[T,r]);async function Ne(){if(!h||!ie||L||B.current||u==="credits"&&z)return;B.current=!0;const f=u==="combined"?Math.floor(((v==null?void 0:v.creditsCents)??0)/We):a??null;j("completing"),F(null),O("preparing");try{const E=await ns({name:n,identity:h.identity,signer:h.signer,creditsCents:v==null?void 0:v.creditsCents,maxManaWei:v==null?void 0:v.manaWei,onProgress:O});Me("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Je(a??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:u==="combined"?"credits_and_mana":"credits",value_credits:f,value_usd:Je(f??0),transaction_hash:E.originTxHash??null,settlement:E.status}),c.invalidateQueries({queryKey:["usd-balance"]}),c.invalidateQueries({queryKey:["my-assets"]}),j(E.status==="registered"?"success":"pending")}catch(E){Me(Wt(E)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Lt(E),purchase_type:"name"});const oe=E instanceof Ve,fe=E instanceof Ke;F(E instanceof Qe?s("names.errorRouteCost"):oe?s("names.errorNotRegistered"):fe?s("names.errorSettlementUnknown"):(E==null?void 0:E.message)||s("names.errorGeneric")),I(oe||fe),j("error")}finally{B.current=!1}}p.useEffect(()=>{const f=E=>{E.persisted&&y(!1)};return window.addEventListener("pageshow",f),()=>window.removeEventListener("pageshow",f)},[]);async function te(){if(!(!h||!V||x)){y(!0);try{sessionStorage.removeItem(Pn),sessionStorage.removeItem(On),sessionStorage.setItem(nt,n)}catch{}try{const f=await Bn(V.id,{address:h.address,identity:h.identity});if(f.url){window.location.href=f.url;return}if(!f.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");g(`/credits?order=${encodeURIComponent(f.orderId)}`)}catch(f){Nt(f,{flow:"name_buy_credits"});try{sessionStorage.removeItem(nt)}catch{}F(s("buyModal.error.creditsCheckout")),I(!1),j("error"),y(!1)}}}const ce=l!=="success"&&l!=="pending"&&!_,de=It(h==null?void 0:h.providerType),he=de?2:1,pe=de&&(R==="preparing"||R==="awaiting-confirmation"),Le=pe?1:he,ue=pe?s("names.confirming"):R==="registering"?s("names.registering"):s("names.completing"),me=R==="registering"?s("names.processingRegistering"):null,Q=l==="confirm"&&z&&!S,Y=l==="error"?s("names.errorTitle"):Q?s("names.buyCreditsTitle"):s("names.buyTitle");return e.jsx(ps,{onClick:T?void 0:r,role:"presentation",children:e.jsxs(us,{role:"dialog","aria-modal":"true","aria-label":Y,onClick:f=>f.stopPropagation(),children:[ce&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:Y}),e.jsx(Fe,{onClick:r,disabled:T,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(K,{})," ",ze(d,w)]}),e.jsx(Ue,{})]}),Q&&e.jsxs(zs,{children:[e.jsxs(Tn,{children:[e.jsx(_n,{}),e.jsxs(Mn,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:U})})," ",s("names.warningToPurchase"),ge()?null:e.jsxs(e.Fragment,{children:[" ",e.jsx(In,{href:At("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),ge()?e.jsxs(we,{"data-testid":"name-row-iap",children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(K,{}),A]})]}):null,ge()?null:e.jsx(e.Fragment,{children:e.jsx(An,{packs:ae,selectedId:V==null?void 0:V.id,onSelect:k,recommendedId:le?ee==null?void 0:ee.id:void 0})}),e.jsxs(Ps,{children:[e.jsx(tt,{"data-variant":"outline",onClick:r,disabled:T,"data-testid":"name-topup-cancel",children:s("buyModal.cancel")}),ge()?null:e.jsx(tt,{"data-variant":"gradient","data-testid":"name-buy-credits",disabled:!h||!V||x,onClick:()=>void te(),children:s("buyModal.buy")})]})]}),l==="confirm"&&!Q&&_&&e.jsx(Fn,{asset:{name:`${n}.dcl.eth`,caption:s("names.subtitle"),thumb:e.jsx(Bs,{"aria-hidden":!0,children:"@"})},priceCredits:a??0,priceCents:(a??0)*We,options:D.options,priceManaWei:BigInt(Z),balanceCredits:(d==null?void 0:d.credits)??0,manaBalanceWei:q,onBuy:f=>{$(f==="combined"&&P?{rail:"combined",creditsCents:P.creditsCents,manaWei:P.manaWei}:{rail:"credits"})},onClose:r,busy:T}),(l==="confirm"||l==="error")&&!Q&&!_&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(K,{}),A]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}),re?e.jsx(De,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(De,{onClick:()=>j("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(bs,{children:[e.jsx(ys,{children:s("names.confirmTitle")}),e.jsx(ws,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${Os(n)}</b>`})}}),e.jsxs(js,{children:[e.jsx(vs,{"aria-hidden":!0,children:"@"}),e.jsx(Cs,{value:b,onChange:f=>C(f.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx($s,{children:".dcl.eth"})]})]}),H?e.jsxs(Ge,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:H})]}):null,e.jsx(De,{onClick:()=>void Ne(),disabled:!ie||!h||L||u==="credits"&&z,children:s("names.buyCta")})]})]}),l==="completing"&&e.jsxs(ks,{children:[e.jsx(Ss,{src:zn,alt:"",width:61,height:61}),e.jsxs(Es,{children:[e.jsx(Rs,{children:ue}),e.jsxs(_s,{children:[e.jsx(Ms,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Is,{"data-testid":"name-progress-count",children:`${Le}/${he}`})]}),me?e.jsx(Ts,{children:me}):null]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.pendingHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(K,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(Ge,{"data-tone":"info",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(K,{}),A]})]}),e.jsx(at,{children:e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.successHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(K,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(As,{children:[e.jsx(Ns,{"aria-hidden":!0,children:e.jsx(W,{name:"check"})}),e.jsxs(Ls,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsxs(ms,{"data-testid":"name-success-tile",children:[e.jsx(fs,{src:Un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(xs,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(gs,{src:ds,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(K,{}),A]})]}),e.jsxs(at,{children:[e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")}),e.jsx(Ws,{href:se.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function Os(n){return n.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a])}const Us="https://cdn.decentraland.org/@dcl/shop/1.15.0/_assets/identity-icon-C8yAW_Gq.svg",Hs="https://cdn.decentraland.org/@dcl/shop/1.15.0/_assets/world-icon-6xQ-PmmW.svg",Ds="https://cdn.decentraland.org/@dcl/shop/1.15.0/_assets/invite-icon-Bz6lCTuB.svg",Gs="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",qs=i.div`
|
|
512
|
+
`;function Fs({name:n,priceCredits:a,onClose:r}){const{session:h}=dt(),{data:d,isError:w}=Tt(h),c=_t(),g=Ze(),[l,j]=p.useState("confirm"),[b,C]=p.useState(""),[m,k]=p.useState(""),[x,y]=p.useState(!1),[v,$]=p.useState(null),u=(v==null?void 0:v.rail)??"credits",[N,F]=p.useState(null),[re,I]=p.useState(!1),[R,O]=p.useState("preparing"),B=p.useRef(!1),ie=b.trim().toLowerCase()===n.toLowerCase(),T=l==="completing"||x,A=a!=null?ht(a):"—",L=a==null,J=d==null?void 0:d.credits,U=a!=null&&J!=null?a-J:0,z=U>0,H=L?s("names.priceUnavailable"):null,{data:G}=Mt(h),q=(G==null?void 0:G.matic)??0n,D=Rn({priceCents:a!=null?a*We:0,priceManaWei:BigInt(Z),balanceCents:(d==null?void 0:d.balanceCents)??0,manaBalanceWei:q,manaOnlyRail:!1}),S=D.options.some(f=>f.method!=="credits"),P=D.options.find(f=>f.method==="combined"),_=v==null&&S&&!L,M=Nn().packs.slice(0,Ln),{packs:ae,recommended:ee,closesGap:le}=Wn(M,U),K=ae.find(f=>f.id===m)??ee;p.useEffect(()=>{const f=E=>{E.key==="Escape"&&!T&&r()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[T,r]);async function Ne(){if(!h||!ie||L||B.current||u==="credits"&&z)return;B.current=!0;const f=u==="combined"?Math.floor(((v==null?void 0:v.creditsCents)??0)/We):a??null;j("completing"),F(null),O("preparing");try{const E=await ns({name:n,identity:h.identity,signer:h.signer,creditsCents:v==null?void 0:v.creditsCents,maxManaWei:v==null?void 0:v.manaWei,onProgress:O});Me("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:Je(a??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:u==="combined"?"credits_and_mana":"credits",value_credits:f,value_usd:Je(f??0),transaction_hash:E.originTxHash??null,settlement:E.status}),c.invalidateQueries({queryKey:["usd-balance"]}),c.invalidateQueries({queryKey:["my-assets"]}),j(E.status==="registered"?"success":"pending")}catch(E){Me(Wt(E)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Lt(E),purchase_type:"name"});const oe=E instanceof Ke,fe=E instanceof Ve;F(E instanceof Qe?s("names.errorRouteCost"):oe?s("names.errorNotRegistered"):fe?s("names.errorSettlementUnknown"):(E==null?void 0:E.message)||s("names.errorGeneric")),I(oe||fe),j("error")}finally{B.current=!1}}p.useEffect(()=>{const f=E=>{E.persisted&&y(!1)};return window.addEventListener("pageshow",f),()=>window.removeEventListener("pageshow",f)},[]);async function te(){if(!(!h||!K||x)){y(!0);try{sessionStorage.removeItem(Pn),sessionStorage.removeItem(On),sessionStorage.setItem(nt,n)}catch{}try{const f=await Bn(K.id,{address:h.address,identity:h.identity});if(f.url){window.location.href=f.url;return}if(!f.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");g(`/credits?order=${encodeURIComponent(f.orderId)}`)}catch(f){Nt(f,{flow:"name_buy_credits"});try{sessionStorage.removeItem(nt)}catch{}F(s("buyModal.error.creditsCheckout")),I(!1),j("error"),y(!1)}}}const ce=l!=="success"&&l!=="pending"&&!_,de=It(h==null?void 0:h.providerType),he=de?2:1,pe=de&&(R==="preparing"||R==="awaiting-confirmation"),Le=pe?1:he,ue=pe?s("names.confirming"):R==="registering"?s("names.registering"):s("names.completing"),me=R==="registering"?s("names.processingRegistering"):null,Q=l==="confirm"&&z&&!S,Y=l==="error"?s("names.errorTitle"):Q?s("names.buyCreditsTitle"):s("names.buyTitle");return e.jsx(ps,{onClick:T?void 0:r,role:"presentation",children:e.jsxs(us,{role:"dialog","aria-modal":"true","aria-label":Y,onClick:f=>f.stopPropagation(),children:[ce&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:Y}),e.jsx(Fe,{onClick:r,disabled:T,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{})]}),Q&&e.jsxs(zs,{children:[e.jsxs(Tn,{children:[e.jsx(_n,{}),e.jsxs(Mn,{children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:U})})," ",s("names.warningToPurchase"),ge()?null:e.jsxs(e.Fragment,{children:[" ",e.jsx(In,{href:At("/credits"),target:"_blank",rel:"noopener noreferrer",children:s("buyModal.warningLearnMore")})]})]})]}),ge()?e.jsxs(we,{"data-testid":"name-row-iap",children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}):null,ge()?null:e.jsx(e.Fragment,{children:e.jsx(An,{packs:ae,selectedId:K==null?void 0:K.id,onSelect:k,recommendedId:le?ee==null?void 0:ee.id:void 0})}),e.jsxs(Ps,{children:[e.jsx(tt,{"data-variant":"outline",onClick:r,disabled:T,"data-testid":"name-topup-cancel",children:s("buyModal.cancel")}),ge()?null:e.jsx(tt,{"data-variant":"gradient","data-testid":"name-buy-credits",disabled:!h||!K||x,onClick:()=>void te(),children:s("buyModal.buy")})]})]}),l==="confirm"&&!Q&&_&&e.jsx(Fn,{asset:{name:`${n}.dcl.eth`,caption:s("names.subtitle"),thumb:e.jsx(Bs,{"aria-hidden":!0,children:"@"})},priceCredits:a??0,priceCents:(a??0)*We,options:D.options,priceManaWei:BigInt(Z),balanceCredits:(d==null?void 0:d.credits)??0,manaBalanceWei:q,onBuy:f=>{$(f==="combined"&&P?{rail:"combined",creditsCents:P.creditsCents,manaWei:P.manaWei}:{rail:"credits"})},onClose:r,busy:T}),(l==="confirm"||l==="error")&&!Q&&!_&&e.jsxs(e.Fragment,{children:[e.jsxs(we,{children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),l==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ge,{children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}),re?e.jsx(De,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(De,{onClick:()=>j("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(bs,{children:[e.jsx(ys,{children:s("names.confirmTitle")}),e.jsx(ws,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${Os(n)}</b>`})}}),e.jsxs(js,{children:[e.jsx(vs,{"aria-hidden":!0,children:"@"}),e.jsx(Cs,{value:b,onChange:f=>C(f.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx($s,{children:".dcl.eth"})]})]}),H?e.jsxs(Ge,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsx("span",{children:H})]}):null,e.jsx(De,{onClick:()=>void Ne(),disabled:!ie||!h||L||u==="credits"&&z,children:s("names.buyCta")})]})]}),l==="completing"&&e.jsxs(ks,{children:[e.jsx(Ss,{src:zn,alt:"",width:61,height:61}),e.jsxs(Es,{children:[e.jsx(Rs,{children:ue}),e.jsxs(_s,{children:[e.jsx(Ms,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(Is,{"data-testid":"name-progress-count",children:`${Le}/${he}`})]}),me?e.jsx(Ts,{children:me}):null]})]}),l==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.pendingHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(Ge,{"data-tone":"info",children:[e.jsx(W,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsx(He,{"aria-hidden":!0,children:"@"}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsx(at,{children:e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")})})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(Pe,{children:[e.jsx(Be,{children:s("names.successHeaderTitle")}),e.jsx(Fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(W,{name:"close"})})]}),e.jsxs(Oe,{children:[s("names.myCreditsBalance")," ",e.jsx(V,{})," ",ze(d,w)]}),e.jsx(Ue,{}),e.jsxs(As,{children:[e.jsx(Ns,{"aria-hidden":!0,children:e.jsx(W,{name:"check"})}),e.jsxs(Ls,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(we,{style:{marginTop:20},children:[e.jsxs(ms,{"data-testid":"name-success-tile",children:[e.jsx(fs,{src:Un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(xs,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(gs,{src:ds,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(je,{children:[e.jsxs(ve,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ce,{children:s("names.subtitle")})]}),e.jsxs($e,{children:[e.jsx(V,{}),A]})]}),e.jsxs(at,{children:[e.jsx(ot,{onClick:()=>{r(),g("/my-items")},children:s("names.myItems")}),e.jsx(Ws,{href:se.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function Os(n){return n.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a])}const Us="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/identity-icon-C8yAW_Gq.svg",Hs="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/world-icon-6xQ-PmmW.svg",Ds="https://cdn.decentraland.org/@dcl/shop/1.15.1-35758984456.commit-e35d44f/_assets/invite-icon-Bz6lCTuB.svg",Gs="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",qs=i.div`
|
|
513
513
|
width: 100%;
|
|
514
514
|
min-width: 0;
|
|
515
|
-
`,
|
|
515
|
+
`,Ks=i.nav`
|
|
516
516
|
display: flex;
|
|
517
517
|
align-items: center;
|
|
518
518
|
gap: 6px;
|
|
@@ -522,7 +522,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-BmPeg6sG.js";import{c
|
|
|
522
522
|
line-height: 1;
|
|
523
523
|
color: ${t.colors.gray4};
|
|
524
524
|
${Hn};
|
|
525
|
-
`,
|
|
525
|
+
`,Vs=i.button`
|
|
526
526
|
border: 0;
|
|
527
527
|
background: none;
|
|
528
528
|
padding: 0;
|
|
@@ -970,7 +970,7 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-BmPeg6sG.js";import{c
|
|
|
970
970
|
clip: rect(0, 0, 0, 0);
|
|
971
971
|
white-space: nowrap;
|
|
972
972
|
border: 0;
|
|
973
|
-
`,Ci="https://docs.decentraland.org/creator/worlds/about/",$i="https://governance.decentraland.org";function lt(n){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ki({onBack:n}){pt({title:s("seo.names.title"),description:s("seo.names.description")});const{session:a,signIn:r}=dt(),h=Ze(),d=bt(),{pathname:w,search:c}=d,g=d.state,l=typeof(g==null?void 0:g.resumeName)=="string"?g:void 0,j=ss(),{data:b}=ut(),C=b?mt(Z,b):null,[m,k]=p.useState((l==null?void 0:l.resumeName)??""),[x,y]=p.useState("idle"),[v,$]=p.useState(!1),[u,N]=p.useState((l==null?void 0:l.resumeName)??""),[F,re]=p.useState(!!(l!=null&&l.resumeName)),[I,R]=p.useState(()=>{var S;return typeof window<"u"&&!!((S=window.matchMedia)!=null&&S.call(window,"(prefers-reduced-motion: reduce)").matches)});p.useEffect(()=>{var _;const S=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)");if(!S)return;const P=M=>R(M.matches);return S.addEventListener("change",P),()=>S.removeEventListener("change",P)},[]);const O=s("names.placeholderExamples"),B=p.useMemo(()=>O.split(",").map(S=>S.trim()).filter(Boolean),[O]),T=cs(B,!F&&!m&&!I)||s("names.inputPlaceholder"),A=p.useRef(null),[L,J]=p.useState(void 0);p.useLayoutEffect(()=>{A.current&&J(A.current.getBoundingClientRect().width)},[m,T]),p.useEffect(()=>{if(!st(m).ok){y(m.length===0?"idle":"invalid");return}y("checking");const P=new AbortController,_=setTimeout(()=>{(async()=>{try{const M=await Qn(m,{signal:P.signal});y(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;y("error")}})()},400);return()=>{clearTimeout(_),P.abort()}},[m]);const U=st(m),z=U.ok&&(x==="available"||x==="error"),H=j&&z,G=!j&&z;function q(){if(H){if(!a){r();return}$(!0)}}p.useEffect(()=>{l!=null&&l.resumeName&&h(`${w}${c}`,{replace:!0,state:null})},[l==null?void 0:l.resumeName,h,w,c]),p.useEffect(()=>{if(u){if(m.toLowerCase()!==u.toLowerCase()){N("");return}if(!(x==="idle"||x==="checking")){if(!z){N("");return}!j||!a||(N(""),$(!0))}}},[u,m,x,z,j,a]);const D=e.jsxs(e.Fragment,{children:[s("names.claim"),C!=null?e.jsxs(ui,{children:[e.jsx(
|
|
973
|
+
`,Ci="https://docs.decentraland.org/creator/worlds/about/",$i="https://governance.decentraland.org";function lt(n){const a=typeof window<"u"?window.location.hostname:"";return`${a.endsWith("decentraland.org")?"https://decentraland.org":a.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function ki({onBack:n}){pt({title:s("seo.names.title"),description:s("seo.names.description")});const{session:a,signIn:r}=dt(),h=Ze(),d=bt(),{pathname:w,search:c}=d,g=d.state,l=typeof(g==null?void 0:g.resumeName)=="string"?g:void 0,j=ss(),{data:b}=ut(),C=b?mt(Z,b):null,[m,k]=p.useState((l==null?void 0:l.resumeName)??""),[x,y]=p.useState("idle"),[v,$]=p.useState(!1),[u,N]=p.useState((l==null?void 0:l.resumeName)??""),[F,re]=p.useState(!!(l!=null&&l.resumeName)),[I,R]=p.useState(()=>{var S;return typeof window<"u"&&!!((S=window.matchMedia)!=null&&S.call(window,"(prefers-reduced-motion: reduce)").matches)});p.useEffect(()=>{var _;const S=(_=window.matchMedia)==null?void 0:_.call(window,"(prefers-reduced-motion: reduce)");if(!S)return;const P=M=>R(M.matches);return S.addEventListener("change",P),()=>S.removeEventListener("change",P)},[]);const O=s("names.placeholderExamples"),B=p.useMemo(()=>O.split(",").map(S=>S.trim()).filter(Boolean),[O]),T=cs(B,!F&&!m&&!I)||s("names.inputPlaceholder"),A=p.useRef(null),[L,J]=p.useState(void 0);p.useLayoutEffect(()=>{A.current&&J(A.current.getBoundingClientRect().width)},[m,T]),p.useEffect(()=>{if(!st(m).ok){y(m.length===0?"idle":"invalid");return}y("checking");const P=new AbortController,_=setTimeout(()=>{(async()=>{try{const M=await Qn(m,{signal:P.signal});y(M)}catch(M){if((M==null?void 0:M.name)==="AbortError")return;y("error")}})()},400);return()=>{clearTimeout(_),P.abort()}},[m]);const U=st(m),z=U.ok&&(x==="available"||x==="error"),H=j&&z,G=!j&&z;function q(){if(H){if(!a){r();return}$(!0)}}p.useEffect(()=>{l!=null&&l.resumeName&&h(`${w}${c}`,{replace:!0,state:null})},[l==null?void 0:l.resumeName,h,w,c]),p.useEffect(()=>{if(u){if(m.toLowerCase()!==u.toLowerCase()){N("");return}if(!(x==="idle"||x==="checking")){if(!z){N("");return}!j||!a||(N(""),$(!0))}}},[u,m,x,z,j,a]);const D=e.jsxs(e.Fragment,{children:[s("names.claim"),C!=null?e.jsxs(ui,{children:[e.jsx(V,{}),ht(C)]}):null]});return e.jsxs(qs,{"data-testid":"names-page",children:[e.jsxs(Ks,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Vs,{onClick:n,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Zs,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Qs,{children:[e.jsxs(Ys,{children:[e.jsxs(Xs,{children:[e.jsx(Js,{children:s("names.heroTitle")}),e.jsx(ei,{children:s("names.heroSubtitle")})]}),e.jsxs(ti,{children:[e.jsxs(ni,{"data-testid":"names-input-wrap",children:[e.jsxs(si,{invalid:x==="taken",children:[e.jsxs(ri,{children:[e.jsx(li,{"aria-hidden":!0,children:"@"}),e.jsx(ci,{value:m,onChange:S=>k(Kn(S.target.value)),placeholder:T,"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Ae,onFocus:()=>re(!0),style:{width:L!=null?`${L}px`:void 0}}),e.jsx(ii,{ref:A,"aria-hidden":!0,"data-placeholder":!m||void 0,children:m||T}),e.jsx(di,{children:s("names.suffix")})]}),m.length>0?e.jsxs(hi,{"aria-hidden":!0,children:[m.length,"/",Ae]}):null,e.jsx(gt,{onClick:q,disabled:!H,"data-testid":"names-claim",children:D})]}),x==="taken"?e.jsxs(ai,{role:"status","data-testid":"names-taken",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(oi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null,x==="checking"?e.jsx(ke,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):G?e.jsxs(ke,{tone:"muted",role:"status","data-testid":"names-disabled",children:[e.jsx(W,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.registrationDisabled")}),e.jsxs(fi,{href:lt(m),target:"_blank",rel:"noopener noreferrer",children:[s("names.registrationDisabledLink"),e.jsx(W,{name:"external-link",size:13,"aria-hidden":!0})]})]}):x==="error"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.checkError")}):x==="invalid"&&!U.ok&&U.reason==="too-short"?e.jsx(ke,{tone:"muted",role:"status",children:s("names.tooShort",{min:ft})}):null]}),e.jsx(pi,{onClick:q,disabled:!H,children:D}),e.jsx(vi,{role:"status","aria-live":"polite",children:x==="available"?s("names.available",{name:m}):""})]})]}),e.jsxs(xi,{children:[e.jsxs(gi,{children:[e.jsx(bi,{children:s("names.whyTitle")}),e.jsx(yi,{children:s("names.whyIntro")})]}),e.jsxs(wi,{children:[e.jsxs(Se,{children:[e.jsx(Ee,{src:Us,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why1Title")}),e.jsx(_e,{children:s("names.why1")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Hs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why2Title")}),e.jsxs(_e,{children:[s("names.why2")," ",e.jsx(ji,{children:s("names.why2Address")})]}),e.jsxs(rt,{href:Ci,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Ds,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why3Title")}),e.jsx(_e,{children:s("names.why3")})]})]}),e.jsxs(Se,{children:[e.jsx(Ee,{src:Gs,alt:""}),e.jsxs(Re,{children:[e.jsx(Te,{children:s("names.why4Title")}),e.jsx(_e,{children:s("names.why4")}),e.jsxs(rt,{href:$i,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(W,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),v?e.jsx(Fs,{name:m,priceCredits:C,onClose:()=>$(!1)}):null]})}const Si=i.p`
|
|
974
974
|
display: flex;
|
|
975
975
|
align-items: center;
|
|
976
976
|
gap: 10px;
|
|
@@ -986,5 +986,5 @@ import{r as p,b as Ze,j as e,a as bt,u as yt}from"./react-BmPeg6sG.js";import{c
|
|
|
986
986
|
background: rgba(211, 51, 51, 0.1);
|
|
987
987
|
color: ${t.colors.err};
|
|
988
988
|
}
|
|
989
|
-
`,ct=48,Ei=["all","on_sale","not_for_sale"],Ri=n=>n?"all":"on_sale",qe=(n,a)=>n?"relevance":a?"discount":"newest";function sa({contracts:n,hideNames:a=!1,seo:r,lockStatus:h}={}){const[d]=yt(),w=Ze(),c=(d.get("q")??"").trim().toLowerCase(),g=(d.get("q")??"").trim();pt(r??{title:g?s("seo.collectibles.searchTitle",{query:g}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const l=Ri(!!c),j=zt(),b=j&&d.get("deals")==="true",C=p.useMemo(()=>({category:"all",status:l,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:qe(!!c,b)}),[l,b,c]),[m,k]=qt(C),{subCategory:x,rarities:y,priceMin:v,priceMax:$,smart:u,sort:N}=m,F=j&&m.deals,I=Pt.map(o=>o.key).filter(o=>!(a&&o==="names")).includes(m.category)?m.category:"all",R=h??(Ei.includes(m.status)?m.status:l);
|
|
990
|
-
//# sourceMappingURL=Assets-
|
|
989
|
+
`,ct=48,Ei=["all","on_sale","not_for_sale"],Ri=n=>n?"all":"on_sale",qe=(n,a)=>n?"relevance":a?"discount":"newest";function sa({contracts:n,hideNames:a=!1,seo:r,lockStatus:h}={}){const[d]=yt(),w=Ze(),c=(d.get("q")??"").trim().toLowerCase(),g=(d.get("q")??"").trim();pt(r??{title:g?s("seo.collectibles.searchTitle",{query:g}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const l=Ri(!!c),j=zt(),b=j&&d.get("deals")==="true",C=p.useMemo(()=>({category:"all",status:l,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:qe(!!c,b)}),[l,b,c]),[m,k]=qt(C),{subCategory:x,rarities:y,priceMin:v,priceMax:$,smart:u,sort:N}=m,F=j&&m.deals,I=Pt.map(o=>o.key).filter(o=>!(a&&o==="names")).includes(m.category)?m.category:"all",R=h??(Ei.includes(m.status)?m.status:l);Vt(`${I}:${x??""}`);const[O,B]=p.useState(!1);p.useEffect(()=>{if(!O)return;const o=xe=>{xe.key==="Escape"&&B(!1)};document.addEventListener("keydown",o);const X=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=X}},[O]);const ie=n!==void 0&&n.length===0,T=R==="on_sale",A=v&&!Number.isNaN(Number(v))?Number(v):void 0,L=$&&!Number.isNaN(Number($))?Number($):void 0,J=Bt(),U=x?Gt[x]:void 0,z=[...c?[Zt]:[],...F?Qt:Yt],H=z.find(o=>o.key===N)??z[0],G=H.server,q={category:I,rarities:y.length?y:void 0,wearableCategories:U,minPriceCredits:A,maxPriceCredits:L,search:c||void 0,sortBy:G,isSmart:u||void 0,onSale:!0,discounted:F||void 0,listingType:J?void 0:"primary",contractAddresses:n!=null&&n.length?n:void 0},D={category:I,rarities:y.length?y:void 0,wearableCategories:U,search:c||void 0,sortBy:G,isWearableSmart:u||void 0,isOnSale:R==="not_for_sale"?!1:void 0,contractAddresses:n!=null&&n.length?n:void 0},{items:S,total:P,isLoading:_,isPlaceholderData:M,error:ae,hasNextPage:ee,isFetchingNextPage:le,isFetchNextPageError:K,fetchNextPage:Ne}=pn(T?["shop-items",q]:["catalog-items",D],o=>T?Ht({...q,first:ct,skip:o}):Dt({...D,first:ct,skip:o}),{enabled:I!=="names"&&!ie}),te=P,{data:ce,isError:de,isPending:he}=ut(),pe=o=>ce&&o.manaWei?mt(o.manaWei,ce):null,Le=T&&he&&S.some(o=>o.source==="legacy"),ue=_||M||Le,me=_?15:Math.max(S.length,1),Q=p.useRef(null);p.useEffect(()=>{_||M||!c||Q.current===c||(Q.current=c,Me("Shop Searched",{query:c,result_count:te}))},[c,_,M,te]);const Y=p.useRef("__init__");p.useEffect(()=>{if(_||M)return;const o=JSON.stringify({category:I,subCategory:x,rarities:y,min:A,max:L,sort:N,status:R,smart:u});if(Y.current==="__init__"||Y.current===o){Y.current=o;return}Y.current=o,Me("Shop Applied Filter",{filters:{category:I,sub_category:x,rarities:y,min_price_credits:A??null,max_price_credits:L??null,status:R,smart:u,sort:N},result_count:te})},[I,x,y,A,L,N,R,u,_,M,te]);function f(o){k({category:o,subCategory:null})}function E(o){k({status:o})}function oe(o){k({rarities:y.includes(o)?y.filter(X=>X!==o):[...y,o]})}function fe(){k(C)}const ne=[];(A!=null||L!=null)&&ne.push({key:"price",label:s("filter.price"),onRemove:()=>{k({priceMin:"",priceMax:""})}});for(const o of Ft)y.includes(o)&&ne.push({key:`rarity-${o}`,label:Ot(o),onRemove:()=>oe(o)});return u&&ne.push({key:"smart",label:s("filter.smart"),onRemove:()=>k({smart:!1})}),F&&ne.push({key:"deals",label:s("filter.deals"),onRemove:()=>k({deals:!1,sort:qe(!!c,!1)})}),R!==l&&ne.push({key:"status",label:R==="all"?s("filter.statusAll"):R==="on_sale"?s("filter.onSale"):s("filter.notForSale"),onRemove:()=>E(l)}),e.jsxs(en,{"data-testid":"browse",children:[I!=="names"&&e.jsxs(e.Fragment,{children:[O?e.jsx(tn,{onClick:()=>B(!1),"aria-hidden":!0}):null,e.jsxs(nn,{"data-open":O||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(sn,{children:[e.jsx(an,{children:s("assets.filters")}),e.jsx(on,{onClick:()=>B(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(rn,{children:e.jsx(Xt,{category:I,subCategory:x,onCategory:f,onSub:o=>k({subCategory:o}),priceMin:v,priceMax:$,onPriceMin:o=>k({priceMin:o}),onPriceMax:o=>k({priceMax:o}),rarities:y,onToggleRarity:oe,status:R,onStatus:E,hideNames:a,smart:u,onSmart:o=>k({smart:o}),deals:F,onDeals:j?o=>k({deals:o,sort:qe(!!c,o)}):void 0})}),e.jsx(ln,{children:e.jsx(cn,{type:"button",onClick:()=>B(!1),children:s("assets.showItems")})})]})]}),e.jsx(dn,{children:I==="names"?e.jsx(ki,{onBack:()=>f("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Jt,{sort:H.key,sortOptions:z,onSort:o=>k({sort:o}),total:P,loading:_||M,query:c,onOpenFilters:()=>B(!0),chips:ne,onClearChips:fe}),de&&T&&S.some(o=>o.source==="legacy")?e.jsx(Si,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,ae?e.jsx(un,{message:s("assets.loadError"),testId:"browse-error"}):null,!ue&&S.length===0&&!ae?e.jsx(Ut,{testId:"browse-empty",icon:Kt,title:s("assets.empty.title"),body:g?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:g}),s("assets.empty.searchAfter")]}):s("assets.empty.filters"),cta:{label:s("assets.empty.cta"),onClick:()=>w("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(Gn,{"data-testid":"grid",children:ue?e.jsx(et,{count:me}):e.jsxs(e.Fragment,{children:[S.map(o=>{if(!T)return e.jsx(be,{item:o,mode:"view"},ye(o));const X=o;if(X.source!=="legacy")return e.jsx(be,{item:o},ye(o));const xe=pe(X);return xe==null?e.jsx(be,{item:o,mode:"view"},ye(o)):e.jsx(be,{item:{...X,priceCredits:xe}},ye(o))}),le?e.jsx(et,{count:6}):null]})}),e.jsx(hn,{hasNextPage:ee,isFetching:le,isError:K,onLoadMore:()=>void Ne()})]})]})})]})}export{sa as Assets};
|
|
990
|
+
//# sourceMappingURL=Assets-DbsPVOVg.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-
|
|
1
|
+
import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-BJuMEjl2.js";import{s as i,a as z,t as a,z as Ie,F as pe,W as Fe,C as Me,E as Le,bk as Ma,A as Ta,I as Y,n as Je,B as Ia,ag as H,X as Tt,x as Aa,y as Ea,w as Pa,bl as za,aG as Ra,bm as Ba,Y as _a,bn as qa,bo as Wa,bp as Fa,bq as It,$ as La,br as Ka,bs as Na,bt as Qa,as as Ke,a0 as Ua,D as Ga,bu as At,O as V,bv as Et,bw as Oa,bx as Ha,l as ie,by as Da,bz as Va,bA as Ya,bB as Ne,bh as Xa,bC as we,bD as Ce,bE as Pt,bF as Ja,h as zt,j as Rt,bG as Za}from"./index-Rj6xitw3.js";import{C as es,b as ts,t as as,a as ss,A as ns,s as Bt,r as _t,i as qt,m as is,c as rs,p as Wt,d as os}from"./CollectionCarousel-ySH8e59r.js";import{M as cs,S as ls,C as ds,H as us,a as hs,T as ps,X as gs,B as fs,b as xs,c as Ft,d as ms,e as Ae,f as bs,g as ys,h as vs,i as Xe,j as he,L as ws,P as Cs,k as Lt,l as Kt,W as js,m as ks,n as Ss,o as $s,A as Ms,p as Ts,q as Is,r as As,s as Es,t as Ps,u as zs,v as Rs,w as Qe,x as Bs,y as _s}from"./CreditPackPicker-COxZsW_g.js";import{m as Te}from"./mana-matic-light-Bl5duieC.js";import{q as qs,s as Ws,g as Fs,t as Ls,u as Ks,A as Ns}from"./trade-encoding-DWpimiL1.js";import{p as Nt,g as Qs,a as Ue}from"./buy-C9hvyAAq.js";import{w as Us,S as Ge,b as Gs,G as Os}from"./buy-gasless-BnU0dUSp.js";import{l as Hs,u as Ds,M as Vs,R as je,o as Ys,r as Xs,c as Js,g as Zs,a as en,p as Qt,b as Oe}from"./loader-logo-BiK3-TWh.js";import{i as tn,a as an}from"./errors-DgTO8Pwf.js";import{E as sn}from"./ErrorNotice-QFoLzcXZ.js";import"./dcl-schemas-Bm7CwtMo.js";import"./sentry-Cv7iYFas.js";import"./ethers-CCCzUGvE.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-C5b7rSXh.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new n.Error().stack;d&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[d]="1f1c6841-4176-49db-8b0e-6c81c0a070ef",n._sentryDebugIdIdentifier="sentry-dbid-1f1c6841-4176-49db-8b0e-6c81c0a070ef")}catch{}})();const nn=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -161,7 +161,7 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-BmPeg6sG.js";import{s
|
|
|
161
161
|
font-weight: 700;
|
|
162
162
|
color: ${re.text};
|
|
163
163
|
}
|
|
164
|
-
`,
|
|
164
|
+
`,fn=i.p`
|
|
165
165
|
margin: 12px 0 0;
|
|
166
166
|
background: rgba(255, 162, 90, 0.3);
|
|
167
167
|
border-radius: ${z.radius.btn};
|
|
@@ -170,7 +170,7 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-BmPeg6sG.js";import{s
|
|
|
170
170
|
font-size: 14px;
|
|
171
171
|
line-height: 1.334;
|
|
172
172
|
color: ${z.colors.text2};
|
|
173
|
-
`;function
|
|
173
|
+
`;function xn(n){const{phase:d,balanceCredits:k,onClose:S}=n,R=d==="processing",U=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),G=d==="processing";return e.jsxs(cs,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ls,{onClick:R?void 0:S,"aria-hidden":!0}),e.jsxs(ds,{"data-tall":G||void 0,children:[e.jsxs(us,{children:[e.jsxs(hs,{children:[e.jsx(ps,{children:U}),!R&&e.jsx(gs,{onClick:S,"aria-label":a("buyModal.close"),children:e.jsx(es,{})})]}),e.jsxs(fs,{children:[e.jsx(xs,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(Ft,{}),e.jsx(ms,{children:pe(k)})]}),n.heldCreditsCount&&(d==="choose"||d==="nofunds")?e.jsx(fn,{"data-testid":"cart-held-notice",children:a("buyModal.heldExplainer",{credits:n.heldCreditsCount,currency:Me.name})}):null]}),d==="choose"&&e.jsxs(Ae,{children:[e.jsxs(gn,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(Ft,{}),pe(n.totalCredits??0)]})]}),e.jsx(Zt,{options:n.options??[],totalCents:n.totalCents??0,shortfall:n.shortfall,onPay:n.onPay??(()=>{})})]}),d==="processing"&&e.jsx(mn,{stage:n.stage??"reserving",step:n.step??1,total:n.total??1,isSelfCustody:!!n.isSelfCustody,signatures:n.signatures}),d==="nofunds"&&e.jsx(bn,{lines:n.lines??[],shortfallCredits:n.shortfallCredits??0,packs:n.packs??[],selectedPack:n.selectedPack??"",onSelectPack:n.onSelectPack??(()=>{}),onBuyPacks:n.onBuyPacks??(()=>{}),onCancel:S}),d==="error"&&e.jsxs(Ae,{children:[e.jsxs(bs,{"data-testid":"buy-error",children:[e.jsx(ys,{src:ts,alt:"",width:64,height:80}),e.jsxs(vs,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",n.heldCredits?e.jsxs(e.Fragment,{children:[n.message?e.jsxs(e.Fragment,{children:[n.message," "]}):null,a("cartCheckout.heldLead",{currency:Me.name}),e.jsx("b",{children:a("cartCheckout.heldBold")}),a("cartCheckout.heldTail",{currency:Me.name})]}):n.message??a("cartCheckout.errorBody")]})]}),n.heldCredits?e.jsx(Xe,{children:e.jsx(he,{"data-variant":"purple","data-full":!0,onClick:S,children:a("cartCheckout.gotIt")})}):e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:S,children:a("buyModal.cancel")}),e.jsx(he,{"data-variant":"purple",onClick:n.onRetry??S,children:a("cartCheckout.tryAgain")})]})]})]})]})}function mn({stage:n,step:d,total:k,isSelfCustody:S,signatures:R}){const U=n==="reserving",G=k>0?Math.min(100,Math.round(d/k*100)):0,O=S&&R&&R.total>1,M=n==="awaiting-signature"?S?O?a("cartCheckout.confirmMultiple",{current:R.current,total:R.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):n==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ae,{"data-processing":!0,children:[e.jsx(ws,{src:Hs,alt:"",width:61,height:61}),e.jsx(Cs,{children:M}),U?e.jsxs(dn,{children:[e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{"data-step":!0,style:{width:`${G}%`}})}),k>1?e.jsxs(un,{children:[d,"/",k]}):null]}):e.jsx(Lt,{"aria-hidden":!0,children:e.jsx(Kt,{})})]})}function bn({lines:n,shortfallCredits:d,packs:k,selectedPack:S,onSelectPack:R,onBuyPacks:U,onCancel:G}){const O=n.reduce((M,r)=>M+(r.quantity??1),0);return e.jsxs(Ae,{children:[e.jsxs(js,{"data-testid":"nofunds-warning",children:[e.jsx(ks,{}),e.jsxs(Ss,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:O}),Le()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx($s,{href:Ma("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(hn,{children:n.map(M=>{const r=M.quantity??1;return e.jsxs(Ms,{children:[e.jsx(Ts,{children:M.item.thumbnail?e.jsx("img",{src:M.item.thumbnail,alt:""}):null}),e.jsxs(Is,{children:[e.jsxs("div",{children:[e.jsxs(As,{title:M.item.name,children:[M.item.name||a("buyModal.itemFallback"),r>1?e.jsx(pn,{children:a("cartCheckout.qty",{count:r})}):null]}),M.item.creator?e.jsx(Es,{address:M.item.creator}):null]}),e.jsxs(Ps,{children:[e.jsx(zs,{}),e.jsx("span",{children:pe(M.priceCredits*r)})]})]})]},M.item.id)})}),Le()?null:e.jsx(e.Fragment,{children:e.jsx(Rs,{packs:k,selectedId:S||void 0,onSelect:R})}),e.jsxs(Xe,{children:[e.jsx(he,{"data-variant":"outline",onClick:G,children:a("buyModal.cancel")}),Le()?null:e.jsx(he,{"data-variant":"gradient",onClick:U,children:a("buyModal.buy")})]})]})}const{colors:l,gradients:yn,radius:oe}=z,ea="@media (max-width: 1080px)",E="@media (max-width: 880px)",Gt=i.div`
|
|
174
174
|
max-width: 1510px;
|
|
175
175
|
margin: 0 auto;
|
|
176
176
|
/* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
|
|
@@ -744,5 +744,5 @@ import{j as e,L as Xt,r as T,b as Sa,a as $a}from"./react-BmPeg6sG.js";import{s
|
|
|
744
744
|
& section {
|
|
745
745
|
margin-top: 0;
|
|
746
746
|
}
|
|
747
|
-
`;function Ve(n){if(tn(n))return a("errors.rejected");const d=(n.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Me.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const oi=12e4;function ci(n){const d=[];return n.unavailable.length&&d.push(a("cart.drop.unavailable",{count:n.unavailable.length})),n.own.length&&d.push(a("cart.drop.own",{count:n.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=n=>n.reduce((d,k)=>d+k.priceCredits*k.quantity,0),$e=n=>n.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Yt=8;function Si(){var St,$t,Mt;Ia({title:a("nav.cart"),noindex:!0});const n=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),S=H(t=>t.decrement),R=H(t=>t.clear),U=H(t=>t.restore),G=H(t=>t.setFittingOpen),O=Tt(t=>t.items),M=Tt(t=>t.toggle),{session:r,signIn:Ze}=Aa(),na=Ea(),ge=Ds().packs.slice(0,Vs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ia=n.some(t=>t.category!=="emote"),{data:Ee}=Pa({queryKey:["upsell-listings"],queryFn:()=>Za({first:40}),staleTime:6e4}),{data:j}=za(r),y=Ra(),X=Sa(),{state:B}=$a(),[ra,ce]=T.useState(null),[et,xe]=T.useState(null),[oa,q]=T.useState(!1),[W,D]=T.useState(null),tt=T.useRef(0),[u,$]=T.useState(null),{data:fe}=Ba(r),{data:le}=_a(!0),[Pe,at]=T.useState(""),de=T.useRef(null),st=qa(n),nt=t=>At(st[t.id]),ze=n.filter(nt),it=n.length>0&&ze.length===0,ca=ze.reduce((t,s)=>t+s.priceCredits*s.quantity,0),la=n.reduce((t,s)=>t+s.quantity,0),da=ze.reduce((t,s)=>t+s.quantity,0),rt=W?W.liveTotalCredits:ca,ua=new Set(n.map(t=>t.id)),ot=((Ee==null?void 0:Ee.items)??[]).filter(t=>!ua.has(t.id)).slice(0,12),ct=T.useMemo(()=>n.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[n]),te=Wa(Yt,{exclude:ct}),lt=Fa({enabled:te.enabled,hasSignal:te.hasSignal,isLoading:te.isLoading,isError:te.isError,personalized:(St=te.result)==null?void 0:St.personalized,rowCount:(($t=te.result)==null?void 0:$t.data.length)??0}),ha=new Map(W==null?void 0:W.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=rt*10,pa=le?It(Re,le):0n,Be=Qe({priceCents:Re,priceManaWei:pa,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n}),ga=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),xa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),fa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Oa,ba=t=>Va(t.contractAddress,String(t.itemId));function be(t){t(),D(null),xe(null),ce(null)}function ya(){$(null),q(!1)}function dt(t){const s=Ye(t),o=Math.max(0,s-me),c=ge.find(h=>h.credits>=o)??ge[ge.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:o}),$({phase:"nofunds",lines:t.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),q(!1)}async function _e(t){if(!r||t.length===0)return;const s=$e(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),h=[];let v="authorize";const x=new Set,I=new Set,L=new Set,F=[];let w=!1;$({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=Zs(s,Nt);let K=0;for(const p of P){$({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:f,maxCreditedValue:b}=await Ya(r.identity,p.units.map(en));p.units.forEach((Q,ne)=>{h.push({salt:f.id,itemId:Q.item.id}),m.push({...p.drafts[ne],credits:[f],maxCreditedValue:b})}),K+=p.units.length}catch(f){if(an(f)){if(h.length){try{await Ne(r.identity,[...new Set(h.map(b=>b.salt))])}catch(b){ie(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw f}}h.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Qs(m).length,ee=p=>N>1?{current:p,total:N}:void 0,_=(p,f)=>$({phase:"processing",stage:p,step:s.length,total:s.length,signatures:ee(f)}),C=p=>p<N?_("awaiting-signature",p+1):_("settling",N);_("awaiting-signature",1);let g=[];const A=new Map,ae=async p=>{const f=await Promise.allSettled(p.map(b=>Us(b)));return f.forEach((b,Q)=>{const ne=A.get(p[Q])??[];b.status==="fulfilled"?(ne.forEach(We=>I.add(We)),F.push(p[Q])):b.reason instanceof Ge||ne.forEach(We=>L.add(We))}),f.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(qs())try{let p=0;g=await Gs({purchases:m,buyer:r.address,signer:r.signer,identity:r.identity,onSigned:()=>_("settling",Math.min(p+1,N)),onBroadcast:({txHash:b,salts:Q})=>{p+=1,A.set(b,Q),Q.forEach(ne=>x.add(ne))},onGroupSettling:({settled:b})=>_("settling",b)});const f=await ae(g);if(f.length&&!f.some(b=>b instanceof Ge))throw f[0];w=!0}catch(p){if(p instanceof Ge)throw await ae([...A.keys()]),p;if(!(p instanceof Os)||!Xa(r.providerType))throw p;g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:f})=>f.forEach(b=>x.add(b)),onSettled:({txHash:f,salts:b})=>{b.forEach(Q=>I.add(Q)),F.push(f)},onReverted:({salts:f})=>f.forEach(b=>L.add(b))})}else g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(f=>x.add(f)),onSettled:({txHash:p,salts:f})=>{f.forEach(b=>I.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(f=>L.add(f))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"credits",no_crypto_step:w,transaction_hash:g[0]??null}),_t(o.map(p=>p.coupon)),qt(y);const ve=de.current;de.current=null,$(null),q(!1);const se={items:c,txHash:g[0]??void 0,txHashes:g,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:se,replace:!0})}catch(m){Ce(m)||ie(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...x].filter(g=>!L.has(g))),{toRelease:K,boughtItemIds:N}=Qt({reservations:h,spent:P,settled:I}),ee=[...P].some(g=>!I.has(g)),_=o.filter(g=>N.includes(g.id)),C=o.filter(g=>!N.includes(g.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((g,A)=>g+A.priceCredits,0)),cart_size:s.length,partial:_.length>0}),K.length)try{await Ne(r.identity,K)}catch(g){ie(g,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),_.length>0){N.forEach(g=>d(g)),D(null),_t(_.map(g=>g.coupon)),qt(y),V("Shop Completed Purchase",{...we(_),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),$({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:ee}),q(!1);return}$({phase:"error",message:ee?void 0:Ve(m),heldCredits:ee})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=de.current;de.current=null,$(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){Ce(t)||ie(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),$({phase:"error",message:Ve(t)}),q(!1)}async function va(t,s,o){const c=zt(Rt.MANAToken,s),h=zt(Rt.CreditsManager,s);await Ks({auth:{kind:Ns.Allowance,contractAddress:c.address,spenderAddress:h.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(le)return le;try{return await y.fetchQuery(Da())}catch{return}}async function wa(t){const s=$e(t).reduce((v,x)=>v+x.usdCents,0),c=(fe??0n)>0n?await pt():le,h=c?It(s,c):0n;return{totalCents:s,manaWei:h}}async function gt(t,s){const o=Ye(t),{totalCents:c,manaWei:h}=await wa(t),v=Qe({priceCents:c,priceManaWei:h,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n});if(s&&v.options.some(x=>x.method===s)){if(s==="credits"){_e(t);return}const x=bt(v,s);await ft(xt(s,t),x,()=>s==="mana"?void yt(t,x):void vt(t,c,h));return}if(v.options.some(x=>x.method==="mana"||x.method==="combined")){$({phase:"choose",lines:t,totalCents:c,manaWei:h}),q(!1);return}if(j!=null&&j.credits<o){dt(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n})}const[ue,ye]=T.useState(null);function xt(t,s){const o=new Map;for(const c of s){const h=is(t,Oe(c));o.set(`${h.chainId}:${h.spender.toLowerCase()}`,h)}return[...o.values()]}async function ft(t,s,o){const c=[];for(const{spender:h,chainId:v}of t){const x=Ws(v,h),I=r?await Fs(x,r.address,s).catch(()=>!0):!0;Ls(r==null?void 0:r.providerType,I)&&c.push(x)}if(c.length===0){o();return}q(!1),mt(c,0,o)}function mt(t,s,o){ye({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function Ca(t){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=u;if(t==="credits"){_e(s);return}const h=bt(qe(u),t);ft(xt(t,s),h,()=>t==="mana"?void yt(s,h):void vt(s,o,c))}async function yt(t,s){if(!r||t.length===0)return;const o=$e(t),c=o.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),v=()=>$({phase:"processing",stage:"settling",step:o.length,total:o.length});$({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const x=await rs({trades:xa(o),coupons:fa(o),mints:ga(o),buyer:r.address,signer:r.signer,onSigned:v,manaWei:s});t.forEach(I=>d(I.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:x[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(h,x)}catch(x){ht(x,"buy_cart_mana")}}async function vt(t,s,o){if(!r||t.length===0)return;const c=$e(t),h=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),x=Bs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),I=[],L=new Set,F=new Set;$({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const g=c[C],A=w[C],ae=x[C],ve=_s(Math.max(0,g.usdCents-ae),s,o);let se;if(ae<=0)se=Wt(A,[],"0");else{$({phase:"processing",stage:"reserving",step:C+1,total:c.length});const f=g.item,{credit:b,maxCreditedValue:Q}=await Ja(r.identity,ae,A.kind==="trade"?A.trade.id:void 0,f.contractAddress&&f.itemId!=null?{contractAddress:f.contractAddress,itemId:String(f.itemId)}:void 0);I.push({salt:b.id,itemId:f.id}),se=Wt(A,[b],Q)}const p=Nt(se);P.set(p,(P.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(se)}I.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,g]of P){const A=K.get(C);A==null||g<=0n||(m[A]={...m[A],maxCreditedValue:(BigInt(m[A].maxCreditedValue)+g).toString()})}const N=[...P.values()].reduce((C,g)=>C+g,0n);await va(r.signer,os(w[0]),N);const ee=()=>$({phase:"processing",stage:"settling",step:c.length,total:c.length});$({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const _=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:ee,onBroadcast:({salts:C})=>C.forEach(g=>L.add(g)),onReverted:({salts:C})=>C.forEach(g=>F.add(g))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(h),payment_type:"credits_and_mana",transaction_hash:_[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,_)}catch(w){const{toRelease:m}=Qt({reservations:I,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(r.identity,m).catch(()=>{}),I.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function J(t){if(!r){Bt({type:"cart-checkout"}),Ze();return}const s=H.getState().items.filter(nt);if(s.length===0)return;ce(null),xe(null),q(!0);const o=s.reduce((c,h)=>c+h.priceCredits*h.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:me>=o});try{const c=await Xs(s,r.address,ma,await pt(),ba,Ha),h=[...c.unavailable,...c.own];if(h.length&&(h.forEach(v=>d(v.id)),xe(ci(c))),c.buyable.length===0){ce(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){ie(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ce(Ve(c))}finally{q(!1)}}async function wt(){if(W){if(!r){Bt({type:"cart-checkout"}),Ze();return}if(Date.now()-tt.current>oi){D(null),xe(null),await J();return}ce(null),gt(W.buyable)}}async function ja(){if(Pe){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Js(Pe,r?{address:r.address,identity:r.identity}:void 0);if(t.url){window.location.href=t.url;return}if(!t.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");X(`/credits?order=${encodeURIComponent(t.orderId)}`)}catch(t){try{sessionStorage.removeItem(je)}catch{}ie(t,{flow:"cart_buy_credits"}),$({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const Ct=T.useRef(!1);T.useEffect(()=>{if(!r||Ct.current||!as("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[r]);const jt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,de.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(je);if(s){sessionStorage.removeItem(je);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const Z=oa||(u==null?void 0:u.phase)==="processing";if(n.length===0&&!u)return e.jsx(Gt,{children:e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(kn,{children:e.jsx(La,{variant:"light",testId:"cart-empty",icon:Ka,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})});const ka=Ys(ge,(u==null?void 0:u.phase)==="nofunds"?u.shortfall:0).packs;return e.jsxs(Gt,{children:[e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vn,{children:[e.jsxs(wn,{children:[e.jsxs(Cn,{children:[e.jsx(Sn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx($n,{children:a("cart.panelTitle",{count:la})}),ia?e.jsxs(Mn,{onClick:()=>G(!0),disabled:Z,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(jn,{children:[e.jsx(Tn,{children:n.map(t=>{const s=ha.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,h=!t.tokenId,v=t.quantity,x=typeof t.available=="number"&&v>=t.available,I=o*v,L=Na(t),F=!!L&&!!O[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(In,{"data-unavailable":P||void 0,children:[e.jsxs(An,{"data-thumb":!0,children:[w?e.jsx(En,{to:w,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Pn,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(zn,{children:[e.jsxs(Rn,{"data-desc":!0,children:[w?e.jsx(_n,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Bn,{title:t.name,children:t.name}),t.creator?e.jsx(qn,{address:t.creator,linkToProfile:!0}):null,na&&h?e.jsxs(Hn,{"data-testid":"cart-creator-tag",children:[e.jsx(Dn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Wn,{children:P?e.jsxs(Gn,{children:[e.jsx(On,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(Fn,{children:[e.jsx(Dt,{onClick:()=>be(()=>S(t.id)),disabled:Z||v<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(Ln,{children:v}),e.jsx(Dt,{onClick:()=>be(()=>k(t.id)),disabled:Z||x,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(Kn,{children:[e.jsx(Nn,{})," ",e.jsx(Ke,{credits:I}),c?e.jsx(Qn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Un,{children:[L?e.jsx(Vn,{"data-on":F||void 0,onClick:()=>M(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(Yn,{onClick:()=>be(()=>d(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Xn,{children:e.jsx("button",{className:"link",onClick:()=>be(R),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Jn,{children:[e.jsx(Zn,{children:a("cart.purchaseSummary")}),e.jsxs(ei,{children:[e.jsxs(ti,{children:[e.jsx(ai,{children:a("cart.totalItems",{count:da})}),e.jsx(ni,{children:e.jsxs(si,{children:[e.jsx(ii,{})," ",e.jsx(Ke,{credits:rt})]})})]}),e.jsx(Zt,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:W?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||it,onPay:t=>void(W?wt():J(t)),creditsFallback:{label:Z?a("cart.working"):W?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(W?wt():J())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,r?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),W?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(ri,{message:ra})]})]})]})]}),lt===null&&e.jsx(Vt,{"data-testid":"cart-personal-upsell",children:e.jsx(Ua,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Yt})}),lt!==null&&ot.length>0?e.jsx(Vt,{children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ot})}):null,ue&&r?e.jsx(ns,{auth:ue.auth,signer:r.signer,step:{index:ue.index,total:ue.total},title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Te,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=ue;ye(null),t()},onCancel:()=>ye(null),onClose:()=>ye(null)}):null,u?e.jsx(fn,{phase:u.phase,balanceCredits:me,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ya,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ga(r==null?void 0:r.providerType),signatures:u.phase==="processing"?u.signatures:void 0,options:u.phase==="choose"?qe(u).options:void 0,shortfall:u.phase==="choose"?qe(u).manaShortfall:void 0,onPay:Ca,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?Ye(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:ka,selectedPack:Pe,onSelectPack:at,onBuyPacks:()=>void ja(),message:u.phase==="error"?u.message:void 0,heldCredits:u.phase==="error"&&!!u.heldCredits,onRetry:()=>void J()}):null]})}export{Si as Cart};
|
|
748
|
-
//# sourceMappingURL=Cart-
|
|
747
|
+
`;function Ve(n){if(tn(n))return a("errors.rejected");const d=(n.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Me.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const oi=12e4;function ci(n){const d=[];return n.unavailable.length&&d.push(a("cart.drop.unavailable",{count:n.unavailable.length})),n.own.length&&d.push(a("cart.drop.own",{count:n.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Ye=n=>n.reduce((d,k)=>d+k.priceCredits*k.quantity,0),$e=n=>n.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Yt=8;function Si(){var St,$t,Mt;Ia({title:a("nav.cart"),noindex:!0});const n=H(t=>t.items),d=H(t=>t.remove),k=H(t=>t.increment),S=H(t=>t.decrement),R=H(t=>t.clear),U=H(t=>t.restore),G=H(t=>t.setFittingOpen),O=Tt(t=>t.items),M=Tt(t=>t.toggle),{session:r,signIn:Ze}=Aa(),na=Ea(),ge=Ds().packs.slice(0,Vs);T.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const ia=n.some(t=>t.category!=="emote"),{data:Ee}=Pa({queryKey:["upsell-listings"],queryFn:()=>Za({first:40}),staleTime:6e4}),{data:j}=za(r),y=Ra(),X=Sa(),{state:B}=$a(),[ra,ce]=T.useState(null),[et,fe]=T.useState(null),[oa,q]=T.useState(!1),[W,D]=T.useState(null),tt=T.useRef(0),[u,$]=T.useState(null),{data:xe}=Ba(r),{data:le}=_a(!0),[Pe,at]=T.useState(""),de=T.useRef(null),st=qa(n),nt=t=>At(st[t.id]),ze=n.filter(nt),it=n.length>0&&ze.length===0,ca=ze.reduce((t,s)=>t+s.priceCredits*s.quantity,0),la=n.reduce((t,s)=>t+s.quantity,0),da=ze.reduce((t,s)=>t+s.quantity,0),rt=W?W.liveTotalCredits:ca,ua=new Set(n.map(t=>t.id)),ot=((Ee==null?void 0:Ee.items)??[]).filter(t=>!ua.has(t.id)).slice(0,12),ct=T.useMemo(()=>n.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[n]),te=Wa(Yt,{exclude:ct}),lt=Fa({enabled:te.enabled,hasSignal:te.hasSignal,isLoading:te.isLoading,isError:te.isError,personalized:(St=te.result)==null?void 0:St.personalized,rowCount:(($t=te.result)==null?void 0:$t.data.length)??0}),ha=new Map(W==null?void 0:W.buyable.map(t=>[t.item.id,t])),me=(j==null?void 0:j.credits)??0,Re=rt*10,pa=le?It(Re,le):0n,Be=Qe({priceCents:Re,priceManaWei:pa,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n}),ga=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),fa=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),xa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Oa,ba=t=>Va(t.contractAddress,String(t.itemId));function be(t){t(),D(null),fe(null),ce(null)}function ya(){$(null),q(!1)}function dt(t){const s=Ye(t),o=Math.max(0,s-me),c=ge.find(h=>h.credits>=o)??ge[ge.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:me,shortfall:o}),$({phase:"nofunds",lines:t.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),q(!1)}async function _e(t){if(!r||t.length===0)return;const s=$e(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),h=[];let v="authorize";const f=new Set,I=new Set,L=new Set,F=[];let w=!1;$({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=Zs(s,Nt);let K=0;for(const p of P){$({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:x,maxCreditedValue:b}=await Ya(r.identity,p.units.map(en));p.units.forEach((Q,ne)=>{h.push({salt:x.id,itemId:Q.item.id}),m.push({...p.drafts[ne],credits:[x],maxCreditedValue:b})}),K+=p.units.length}catch(x){if(an(x)){if(h.length){try{await Ne(r.identity,[...new Set(h.map(b=>b.salt))])}catch(b){ie(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw x}}h.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const N=Qs(m).length,ee=p=>N>1?{current:p,total:N}:void 0,_=(p,x)=>$({phase:"processing",stage:p,step:s.length,total:s.length,signatures:ee(x)}),C=p=>p<N?_("awaiting-signature",p+1):_("settling",N);_("awaiting-signature",1);let g=[];const A=new Map,ae=async p=>{const x=await Promise.allSettled(p.map(b=>Us(b)));return x.forEach((b,Q)=>{const ne=A.get(p[Q])??[];b.status==="fulfilled"?(ne.forEach(We=>I.add(We)),F.push(p[Q])):b.reason instanceof Ge||ne.forEach(We=>L.add(We))}),x.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(qs())try{let p=0;g=await Gs({purchases:m,buyer:r.address,signer:r.signer,identity:r.identity,onSigned:()=>_("settling",Math.min(p+1,N)),onBroadcast:({txHash:b,salts:Q})=>{p+=1,A.set(b,Q),Q.forEach(ne=>f.add(ne))},onGroupSettling:({settled:b})=>_("settling",b)});const x=await ae(g);if(x.length&&!x.some(b=>b instanceof Ge))throw x[0];w=!0}catch(p){if(p instanceof Ge)throw await ae([...A.keys()]),p;if(!(p instanceof Os)||!Xa(r.providerType))throw p;g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:x})=>x.forEach(b=>f.add(b)),onSettled:({txHash:x,salts:b})=>{b.forEach(Q=>I.add(Q)),F.push(x)},onReverted:({salts:x})=>x.forEach(b=>L.add(b))})}else g=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(x=>f.add(x)),onSettled:({txHash:p,salts:x})=>{x.forEach(b=>I.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(x=>L.add(x))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...we(o),payment_type:"credits",no_crypto_step:w,transaction_hash:g[0]??null}),_t(o.map(p=>p.coupon)),qt(y);const ve=de.current;de.current=null,$(null),q(!1);const se={items:c,txHash:g[0]??void 0,txHashes:g,settled:!0,...ve?{creditsAdded:ve}:{}};X("/success",{state:se,replace:!0})}catch(m){Ce(m)||ie(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...f].filter(g=>!L.has(g))),{toRelease:K,boughtItemIds:N}=Qt({reservations:h,spent:P,settled:I}),ee=[...P].some(g=>!I.has(g)),_=o.filter(g=>N.includes(g.id)),C=o.filter(g=>!N.includes(g.id));if(V(Ce(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((g,A)=>g+A.priceCredits,0)),cart_size:s.length,partial:_.length>0}),K.length)try{await Ne(r.identity,K)}catch(g){ie(g,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),_.length>0){N.forEach(g=>d(g)),D(null),_t(_.map(g=>g.coupon)),qt(y),V("Shop Completed Purchase",{...we(_),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),$({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:ee}),q(!1);return}$({phase:"error",message:ee?void 0:Ve(m),heldCredits:ee})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=de.current;de.current=null,$(null),q(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){Ce(t)||ie(t,{flow:s,step:"submit"}),V(Ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),$({phase:"error",message:Ve(t)}),q(!1)}async function va(t,s,o){const c=zt(Rt.MANAToken,s),h=zt(Rt.CreditsManager,s);await Ks({auth:{kind:Ns.Allowance,contractAddress:c.address,spenderAddress:h.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(le)return le;try{return await y.fetchQuery(Da())}catch{return}}async function wa(t){const s=$e(t).reduce((v,f)=>v+f.usdCents,0),c=(xe??0n)>0n?await pt():le,h=c?It(s,c):0n;return{totalCents:s,manaWei:h}}async function gt(t,s){const o=Ye(t),{totalCents:c,manaWei:h}=await wa(t),v=Qe({priceCents:c,priceManaWei:h,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n});if(s&&v.options.some(f=>f.method===s)){if(s==="credits"){_e(t);return}const f=bt(v,s);await xt(ft(s,t),f,()=>s==="mana"?void yt(t,f):void vt(t,c,h));return}if(v.options.some(f=>f.method==="mana"||f.method==="combined")){$({phase:"choose",lines:t,totalCents:c,manaWei:h}),q(!1);return}if(j!=null&&j.credits<o){dt(t);return}_e(t)}function qe(t){return Qe({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:xe??0n})}const[ue,ye]=T.useState(null);function ft(t,s){const o=new Map;for(const c of s){const h=is(t,Oe(c));o.set(`${h.chainId}:${h.spender.toLowerCase()}`,h)}return[...o.values()]}async function xt(t,s,o){const c=[];for(const{spender:h,chainId:v}of t){const f=Ws(v,h),I=r?await Fs(f,r.address,s).catch(()=>!0):!0;Ls(r==null?void 0:r.providerType,I)&&c.push(f)}if(c.length===0){o();return}q(!1),mt(c,0,o)}function mt(t,s,o){ye({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function Ca(t){if((u==null?void 0:u.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=u;if(t==="credits"){_e(s);return}const h=bt(qe(u),t);xt(ft(t,s),h,()=>t==="mana"?void yt(s,h):void vt(s,o,c))}async function yt(t,s){if(!r||t.length===0)return;const o=$e(t),c=o.map(f=>({...f.item,priceCredits:f.priceCredits})),h=t.map(f=>({...f.item,priceCredits:f.priceCredits,quantity:f.quantity})),v=()=>$({phase:"processing",stage:"settling",step:o.length,total:o.length});$({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const f=await rs({trades:fa(o),coupons:xa(o),mints:ga(o),buyer:r.address,signer:r.signer,onSigned:v,manaWei:s});t.forEach(I=>d(I.item.id)),D(null),V("Shop Completed Purchase",{...we(c),payment_type:"mana",transaction_hash:f[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(h,f)}catch(f){ht(f,"buy_cart_mana")}}async function vt(t,s,o){if(!r||t.length===0)return;const c=$e(t),h=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),f=Bs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),I=[],L=new Set,F=new Set;$({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const g=c[C],A=w[C],ae=f[C],ve=_s(Math.max(0,g.usdCents-ae),s,o);let se;if(ae<=0)se=Wt(A,[],"0");else{$({phase:"processing",stage:"reserving",step:C+1,total:c.length});const x=g.item,{credit:b,maxCreditedValue:Q}=await Ja(r.identity,ae,A.kind==="trade"?A.trade.id:void 0,x.contractAddress&&x.itemId!=null?{contractAddress:x.contractAddress,itemId:String(x.itemId)}:void 0);I.push({salt:b.id,itemId:x.id}),se=Wt(A,[b],Q)}const p=Nt(se);P.set(p,(P.get(p)??0n)+ve),K.has(p)||K.set(p,m.length),m.push(se)}I.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,g]of P){const A=K.get(C);A==null||g<=0n||(m[A]={...m[A],maxCreditedValue:(BigInt(m[A].maxCreditedValue)+g).toString()})}const N=[...P.values()].reduce((C,g)=>C+g,0n);await va(r.signer,os(w[0]),N);const ee=()=>$({phase:"processing",stage:"settling",step:c.length,total:c.length});$({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const _=await Ue({purchases:m,buyer:r.address,signer:r.signer,onSigned:ee,onBroadcast:({salts:C})=>C.forEach(g=>L.add(g)),onReverted:({salts:C})=>C.forEach(g=>F.add(g))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...we(h),payment_type:"credits_and_mana",transaction_hash:_[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,_)}catch(w){const{toRelease:m}=Qt({reservations:I,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(r.identity,m).catch(()=>{}),I.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function J(t){if(!r){Bt({type:"cart-checkout"}),Ze();return}const s=H.getState().items.filter(nt);if(s.length===0)return;ce(null),fe(null),q(!0);const o=s.reduce((c,h)=>c+h.priceCredits*h.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:me>=o});try{const c=await Xs(s,r.address,ma,await pt(),ba,Ha),h=[...c.unavailable,...c.own];if(h.length&&(h.forEach(v=>d(v.id)),fe(ci(c))),c.buyable.length===0){ce(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){ie(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),ce(Ve(c))}finally{q(!1)}}async function wt(){if(W){if(!r){Bt({type:"cart-checkout"}),Ze();return}if(Date.now()-tt.current>oi){D(null),fe(null),await J();return}ce(null),gt(W.buyable)}}async function ja(){if(Pe){try{sessionStorage.setItem(je,JSON.stringify(H.getState().items))}catch{}q(!0);try{const t=await Js(Pe,r?{address:r.address,identity:r.identity}:void 0);if(t.url){window.location.href=t.url;return}if(!t.orderId)throw new Error("Checkout returned neither a redirect url nor an order id");X(`/credits?order=${encodeURIComponent(t.orderId)}`)}catch(t){try{sessionStorage.removeItem(je)}catch{}ie(t,{flow:"cart_buy_credits"}),$({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{q(!1)}}}const Ct=T.useRef(!1);T.useEffect(()=>{if(!r||Ct.current||!as("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[r]);const jt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,de.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(je);if(s){sessionStorage.removeItem(je);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=T.useRef(!1);T.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void J(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const Z=oa||(u==null?void 0:u.phase)==="processing";if(n.length===0&&!u)return e.jsx(Gt,{children:e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(kn,{children:e.jsx(La,{variant:"light",testId:"cart-empty",icon:Ka,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})});const ka=Ys(ge,(u==null?void 0:u.phase)==="nofunds"?u.shortfall:0).packs;return e.jsxs(Gt,{children:[e.jsxs(Ht,{children:[e.jsxs(Ot,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(vn,{children:[e.jsxs(wn,{children:[e.jsxs(Cn,{children:[e.jsx(Sn,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx($n,{children:a("cart.panelTitle",{count:la})}),ia?e.jsxs(Mn,{onClick:()=>G(!0),disabled:Z,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(jn,{children:[e.jsx(Tn,{children:n.map(t=>{const s=ha.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,h=!t.tokenId,v=t.quantity,f=typeof t.available=="number"&&v>=t.available,I=o*v,L=Na(t),F=!!L&&!!O[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(In,{"data-unavailable":P||void 0,children:[e.jsxs(An,{"data-thumb":!0,children:[w?e.jsx(En,{to:w,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Pn,{"data-check":!0,"aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs(zn,{children:[e.jsxs(Rn,{"data-desc":!0,children:[w?e.jsx(_n,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Bn,{title:t.name,children:t.name}),t.creator?e.jsx(qn,{address:t.creator,linkToProfile:!0}):null,na&&h?e.jsxs(Hn,{"data-testid":"cart-creator-tag",children:[e.jsx(Dn,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Wn,{children:P?e.jsxs(Gn,{children:[e.jsx(On,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[h?e.jsxs(Fn,{children:[e.jsx(Dt,{onClick:()=>be(()=>S(t.id)),disabled:Z||v<=1,"aria-label":a("cart.decreaseQuantity",{name:t.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx(Ln,{children:v}),e.jsx(Dt,{onClick:()=>be(()=>k(t.id)),disabled:Z||f,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(Kn,{children:[e.jsx(Nn,{})," ",e.jsx(Ke,{credits:I}),c?e.jsx(Qn,{children:e.jsx(Ke,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Un,{children:[L?e.jsx(Vn,{"data-on":F||void 0,onClick:()=>M(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(Yn,{onClick:()=>be(()=>d(t.id)),disabled:Z,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(Xn,{children:e.jsx("button",{className:"link",onClick:()=>be(R),disabled:Z,children:a("cart.clearCart")})})]})]}),e.jsxs(Jn,{children:[e.jsx(Zn,{children:a("cart.purchaseSummary")}),e.jsxs(ei,{children:[e.jsxs(ti,{children:[e.jsx(ai,{children:a("cart.totalItems",{count:da})}),e.jsx(ni,{children:e.jsxs(si,{children:[e.jsx(ii,{})," ",e.jsx(Ke,{credits:rt})]})})]}),e.jsx(Zt,{options:Be.options,totalCents:Re,shortfall:Be.manaShortfall,showCreditsAmount:!1,creditsLabel:W?a("marketCheckout.confirmPurchase"):Be.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:Z||it,onPay:t=>void(W?wt():J(t)),creditsFallback:{label:Z?a("cart.working"):W?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(W?wt():J())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,r?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),W?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(ri,{message:ra})]})]})]})]}),lt===null&&e.jsx(Vt,{"data-testid":"cart-personal-upsell",children:e.jsx(Ua,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Yt})}),lt!==null&&ot.length>0?e.jsx(Vt,{children:e.jsx(ss,{title:a("cart.youMightAlsoLike"),items:ot})}):null,ue&&r?e.jsx(ns,{auth:ue.auth,signer:r.signer,step:{index:ue.index,total:ue.total},title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Te,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=ue;ye(null),t()},onCancel:()=>ye(null),onClose:()=>ye(null)}):null,u?e.jsx(xn,{phase:u.phase,balanceCredits:me,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ya,stage:u.phase==="processing"?u.stage:void 0,step:u.phase==="processing"?u.step:void 0,total:u.phase==="processing"?u.total:void 0,isSelfCustody:Ga(r==null?void 0:r.providerType),signatures:u.phase==="processing"?u.signatures:void 0,options:u.phase==="choose"?qe(u).options:void 0,shortfall:u.phase==="choose"?qe(u).manaShortfall:void 0,onPay:Ca,totalCents:u.phase==="choose"?u.totalCents:void 0,totalManaWei:u.phase==="choose"?u.manaWei:void 0,totalCredits:u.phase==="choose"?Ye(u.lines):void 0,lines:u.phase==="nofunds"?u.lines:void 0,shortfallCredits:u.phase==="nofunds"?u.shortfall:void 0,packs:ka,selectedPack:Pe,onSelectPack:at,onBuyPacks:()=>void ja(),message:u.phase==="error"?u.message:void 0,heldCredits:u.phase==="error"&&!!u.heldCredits,onRetry:()=>void J()}):null]})}export{Si as Cart};
|
|
748
|
+
//# sourceMappingURL=Cart-DO4LIC11.js.map
|