@dcl/shop 0.1.0-29842599290.commit-2475f4f → 0.1.0-29843281528.commit-80ee4fe
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/{AnimatedBackground-D2JRqhrS.js → AnimatedBackground-DuljJ5eE.js} +1 -1
- package/assets/{Assets-D_767CI9.js → Assets-C_Pb_gKM.js} +1 -1
- package/assets/Cart-DgfiEY34.js +3 -0
- package/assets/Cart-Ep_4Wxpy.css +1 -0
- package/assets/{CircularProgress-BJ_TjCN_.js → CircularProgress-CFOLSY9J.js} +1 -1
- package/assets/{Collection-CROpeZdX.js → Collection-Br_6eVW2.js} +1 -1
- package/assets/{CollectionCarousel-BRpR9AB4.css → CollectionCarousel-BbM25ExM.css} +1 -1
- package/assets/{CollectionCarousel-BB3DzDmR.js → CollectionCarousel-DijkJOGi.js} +1 -1
- package/assets/{Creator-_z1lwt4_.js → Creator-CXMSNUos.js} +1 -1
- package/assets/{CssVarsProvider-Cb_KA4y8.js → CssVarsProvider-B-9OhdaT.js} +1 -1
- package/assets/{ExchangeController-CBn3jEwJ.js → ExchangeController-DZeSfQ3O.js} +1 -1
- package/assets/GetCredits-Dc4MRaep.js +1 -0
- package/assets/{HelpersUtil-HdrIw3ED.js → HelpersUtil-CIxak-Dl.js} +1 -1
- package/assets/{ImportListings-B4Ah3yQs.js → ImportListings-BupAm--j.js} +1 -1
- package/assets/ItemDetail-CGF_X4b-.js +48 -0
- package/assets/{LoadMore-Blqu_ob_.js → LoadMore-DdNzWoKw.js} +1 -1
- package/assets/{MarketCheckout-DOEU43Cr.js → MarketCheckout-Cec3x9i9.js} +1 -1
- package/assets/{MyAssets-KamgxHyB.js → MyAssets-Bob-0Xll.js} +1 -1
- package/assets/{MyFavorites-46gv8iFB.js → MyFavorites-DIQniaKO.js} +1 -1
- package/assets/{MyPurchases-xyHXfcs_.js → MyPurchases-Ds2kIXc6.js} +1 -1
- package/assets/{NotFound-SYVjtlXK.js → NotFound-CTFVq52Q.js} +1 -1
- package/assets/{PrimaryListModal-B8X89MoS.js → PrimaryListModal-Ca5_30gC.js} +1 -1
- package/assets/{StoreSettings-B4i_rpq0.js → StoreSettings-CcLPXhlS.js} +1 -1
- package/assets/{Success-BoPV7W7T.js → Success-CKgJamne.js} +2 -2
- package/assets/{SwapController-CBn7it3D.js → SwapController-BvaLktQP.js} +1 -1
- package/assets/{TradeService-BUz_DTCw.js → TradeService-BkvXSNTO.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-tZh6bMfi.js → W3MFrameProviderSingleton-CVKTirvY.js} +3 -3
- package/assets/{WebCryptoP256-DSBDULPY.js → WebCryptoP256-DqHDVOgM.js} +1 -1
- package/assets/{basic-DlABK3_N.js → basic-CPzfNN7q.js} +1 -1
- package/assets/{biconomy-MRqMpiGP.js → biconomy-Dv0xaKml.js} +1 -1
- package/assets/buy-C-p0vOlr.js +1 -0
- package/assets/buy-error-22UunaPC.png +0 -0
- package/assets/buy-gasless-80rsxFwS.js +1 -0
- package/assets/{cart-checkout-Cv0O-IMr.js → cart-checkout-C8WkR2Mv.js} +1 -1
- package/assets/{categories-BicEp1xc.js → categories-DMvvNpsP.js} +1 -1
- package/assets/{ccip-7UmS1PeQ.js → ccip-BwGwocPa.js} +1 -1
- package/assets/{ccip-LxG2dAFM.js → ccip-BwOwAXNb.js} +1 -1
- package/assets/collection-DPrYZX6W.js +1 -0
- package/assets/{controller-DduDD9ay.js → controller-CgqGHx7D.js} +2 -2
- package/assets/{core-CeGBqHMO.js → core-B2nfA4sd.js} +4 -4
- package/assets/{custom-D0AtamZ4.js → custom-CdZQaelR.js} +1 -1
- package/assets/{data-capture-DvKKxnqn.js → data-capture-DMW4pF-p.js} +1 -1
- package/assets/{decimals-BHuuK15t.js → decimals-D67NJCrH.js} +1 -1
- package/assets/{decimals-Cy9cbsXq.js → decimals-rp_QRWgQ.js} +1 -1
- package/assets/{detectExtension-DFy8j1N5.js → detectExtension-CdyBy88S.js} +1 -1
- package/assets/{email-Bafq5LVA.js → email-DbiwTCeu.js} +1 -1
- package/assets/{embedded-wallet-Cq9sdxt_.js → embedded-wallet-BsM4YZGP.js} +1 -1
- package/assets/{emotion-styled.browser.esm-IwF2UC65.js → emotion-styled.browser.esm-exjoQmBi.js} +1 -1
- package/assets/{engine-CkrY35__.js → engine-BIaee4cN.js} +1 -1
- package/assets/{errors-VkIbnyNm.js → errors-Cy2OMz1f.js} +1 -1
- package/assets/{estimate-l1-fee-i2iZ2Vqn.js → estimate-l1-fee-gJM_qs-2.js} +1 -1
- package/assets/{eth_estimateGas-DSwQmDKV.js → eth_estimateGas-D2ajTk6Z.js} +1 -1
- package/assets/{eth_getStorageAt-DtuLpaRO.js → eth_getStorageAt-BvK-sxlh.js} +1 -1
- package/assets/{eth_getTransactionCount-jaO8Tr8s.js → eth_getTransactionCount-YDPYaO31.js} +1 -1
- package/assets/{extractIPFS-B1rYPZY7.js → extractIPFS-jmhJ6PDc.js} +1 -1
- package/assets/{features-BEM4jzxK.js → features-DliQhpqn.js} +1 -1
- package/assets/{fetchTokenMetadata-BhtlFZh7.js → fetchTokenMetadata-e-tnU9jP.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-CT1s8m3e.js → get-ecosystem-wallet-info-CZC3jXDk.js} +1 -1
- package/assets/{getBalance-CfJ0XnIl.js → getBalance-DW56jwnz.js} +1 -1
- package/assets/{getInstalledModules-CaXPPvdO.js → getInstalledModules-DnVuL5FL.js} +1 -1
- package/assets/{getNFT-DlVnt9Q9.js → getNFT-BrnrnPkZ.js} +1 -1
- package/assets/{getNFT-CZfISvmz.js → getNFT-DS4NW5JT.js} +2 -2
- package/assets/{getOverlayAlpha-BueYXZ9u.js → getOverlayAlpha-BYOq19Nw.js} +1 -1
- package/assets/{hashTypedData-CuVSwrXW.js → hashTypedData-CwfOunhR.js} +1 -1
- package/assets/{hashTypedData-DLnXsDCk.js → hashTypedData-y5e_N0pF.js} +1 -1
- package/assets/{import-CN6p_MqT.js → import-DGp843-7.js} +1 -1
- package/assets/{in-app-wallet-calls-CJqUcl-9.js → in-app-wallet-calls-ByxidTQ9.js} +1 -1
- package/assets/{index-BIPP0co7.js → index-1HD-ZiOz.js} +1 -1
- package/assets/{index-DF-DiDVu.js → index-5c0GQ1Nl.js} +1 -1
- package/assets/{index-BHCsuHPe.js → index-B0v1VfMr.js} +1 -1
- package/assets/{index-Bsrh1wrG.js → index-B2az3PiP.js} +3 -3
- package/assets/{index-TjznWbc4.js → index-BCJ8zpyP.js} +1 -1
- package/assets/{index-Ckm2E71r.js → index-BJMmq_1b.js} +1 -1
- package/assets/{index-DQfozNLU.js → index-BJi9mWLa.js} +1 -1
- package/assets/{index-BY9My0oM.js → index-BLFpf7VZ.js} +1 -1
- package/assets/{index-BONeQS2n.js → index-BOxK6fGr.js} +2 -2
- package/assets/{index-1gbEXIom.js → index-BR727Jzt.js} +1 -1
- package/assets/{index-DOpbd-jp.js → index-BRDfjRE7.js} +1 -1
- package/assets/{index-Cw5PuAy9.js → index-BT3aLy2n.js} +1 -1
- package/assets/{index-OQjcAgDp.js → index-BVLvW024.js} +1 -1
- package/assets/{index-B1B5XO_U.js → index-BVNelofo.js} +1 -1
- package/assets/{index-sEQX5urS.js → index-BWP2Fumx.js} +1 -1
- package/assets/{index-Tx1QPCiA.js → index-BX4FwzVP.js} +1 -1
- package/assets/{index-BfoFTQum.js → index-BhjB6g3C.js} +1 -1
- package/assets/{index-BvYeGTV6.js → index-BoOFl8c5.js} +1 -1
- package/assets/{index-C8LSdB4m.js → index-BqZuhkNd.js} +1 -1
- package/assets/index-BqifAYYN.css +1 -0
- package/assets/{index-Bpmady1C.js → index-Bu8ostX3.js} +1 -1
- package/assets/{index-P0Yx7vsd.js → index-CAlaPEFD.js} +1 -1
- package/assets/{index-D_kcwQmd.js → index-CEE7Cn_g.js} +1 -1
- package/assets/{index-Dtj-WGsX.js → index-CRwyTQtp.js} +1 -1
- package/assets/{index-BEAmVVuB.js → index-CXBJ9EIH.js} +1 -1
- package/assets/{index-Dl9esg1J.js → index-CczWbtzB.js} +1 -1
- package/assets/{index-BYGUxDY4.js → index-ChULorg8.js} +1 -1
- package/assets/{index-FXbiSAAP.js → index-CnR9-WYz.js} +1 -1
- package/assets/{index-BmFerGWY.js → index-CqSBxYu9.js} +1 -1
- package/assets/{index-D5CqgRew.js → index-CqiRo3Zn.js} +1 -1
- package/assets/{index-Bzl-y_xE.js → index-CthUHORI.js} +1 -1
- package/assets/{index-BPlP5Yrj.js → index-D51Jnqov.js} +1 -1
- package/assets/{index-CgwJgOun.js → index-DHR1PStF.js} +3 -3
- package/assets/{index-DZl9hhbT.js → index-DI8CjH9V.js} +2 -2
- package/assets/{index-CDneVgN3.js → index-DJ4kGSWA.js} +1 -1
- package/assets/{index-BHVOprA5.js → index-DJoRdzge.js} +1 -1
- package/assets/{index-CLJtuWHL.js → index-DM2l6nmY.js} +1 -1
- package/assets/{index-i1ke3OIj.js → index-DNGMKwFA.js} +1 -1
- package/assets/{index-BlNrP_ot.js → index-DsA36hey.js} +1 -1
- package/assets/{index-VVTks7i3.js → index-Dt2sCUK8.js} +1 -1
- package/assets/{index-BGBt5Xm9.js → index-E8b-gnkf.js} +1 -1
- package/assets/{index-oG-jQqT1.js → index-Hi72v_of.js} +1 -1
- package/assets/{index-DOeRQwCQ.js → index-MuXuv7Gk.js} +2 -2
- package/assets/{index-B4D19REm.js → index-T-zasmbE.js} +10 -10
- package/assets/{index-BQxvWH_G.js → index-WmhNuNqi.js} +1 -1
- package/assets/{index-B4edWAth.js → index-g4vOnab2.js} +1 -1
- package/assets/{index-ZV7fMVI5.js → index-kB2cGSV_.js} +1 -1
- package/assets/{index-jtb2-_sz.js → index-m29akl6f.js} +1 -1
- package/assets/{index-DWUDXdC9.js → index-nLudmUJ4.js} +1 -1
- package/assets/{index-ZQBK6Pdm.js → index-rvOCdvOD.js} +1 -1
- package/assets/{index-BrkctpUM.js → index-td4pFZfG.js} +1 -1
- package/assets/{index-bDNg_irz.js → index-ygPPQNgl.js} +1 -1
- package/assets/{index.es-hSZLYkrj.js → index.es-Bvwb44-d.js} +1 -1
- package/assets/{index.es-C89JefA5.js → index.es-C7AZp5D9.js} +1 -1
- package/assets/{index.es-BCuQ9fc-.js → index.es-F7YT6EP3.js} +4 -4
- package/assets/loader-logo-sfRgTXGv.js +1 -0
- package/assets/{localBatchGatewayRequest-CZllhI1g.js → localBatchGatewayRequest-zR7Ha1uQ.js} +1 -1
- package/assets/{mana-rate-Bf-vAahU.js → mana-rate-B9PgPeC4.js} +1 -1
- package/assets/{networks-kfrZy_3R.js → networks-dXDx9gAD.js} +1 -1
- package/assets/{onramp-cgk7gEx6.js → onramp-fNtRJPac.js} +1 -1
- package/assets/{openzeppelin-CBxu6ipZ.js → openzeppelin-sYEux5UU.js} +1 -1
- package/assets/{ownerOf-q_CySRt_.js → ownerOf-CnmeWudT.js} +1 -1
- package/assets/{parseNft-5mLnHHsb.js → parseNft-T29OsJ6m.js} +2 -2
- package/assets/{parseSignature-BXQWiyxd.js → parseSignature-C6Ri9jBZ.js} +1 -1
- package/assets/{parseSignature-Xsezcdr3.js → parseSignature-D06Xu3Gf.js} +3 -3
- package/assets/{pay-with-exchange-8pnV59u_.js → pay-with-exchange-BoMmA1Tj.js} +1 -1
- package/assets/{qr-overlay-BDJyO_OZ.js → qr-overlay-beGwyXqx.js} +1 -1
- package/assets/{receive-BSmYsMYb.js → receive-D4ql0UiI.js} +1 -1
- package/assets/{resolveImplementation-pTzqT2n7.js → resolveImplementation-DQuU7tt4.js} +1 -1
- package/assets/{rpc-2aRT-2co.js → rpc-dvg5kHBi.js} +1 -1
- package/assets/{secp256k1-CV0oEz43.js → secp256k1-BRQHdiKx.js} +1 -1
- package/assets/{secp256k1-DlGyN83x.js → secp256k1-BiBpjJ-Y.js} +1 -1
- package/assets/{secp256k1-CBqMIQsl.js → secp256k1-DzCAsKA4.js} +1 -1
- package/assets/{send-CtmOo9OT.js → send-DsvtMOwS.js} +1 -1
- package/assets/{send-batch-transaction-DczlMlYX.js → send-batch-transaction-BI7PszNe.js} +1 -1
- package/assets/{send-eip712-transaction-C7NnRqWA.js → send-eip712-transaction-DkDZjHS-.js} +2 -2
- package/assets/{send-gasless-transaction-CGNQiDpn.js → send-gasless-transaction-BWiIvBJH.js} +2 -2
- package/assets/{sendRawTransaction-C-hku157.js → sendRawTransaction-CJYjLdky.js} +3 -3
- package/assets/{serializeTransaction-BsWWwZbQ.js → serializeTransaction-DsE3bqzt.js} +1 -1
- package/assets/{session-proposal-ni3LdMGP.js → session-proposal-C87UteoU.js} +1 -1
- package/assets/{session-request-IgqIbKir.js → session-request-Dp0rC7zH.js} +2 -2
- package/assets/{sha256-4_9oQ2I6.js → sha256-D0Lh0Apw.js} +1 -1
- package/assets/{signing-Bhm8lszD.js → signing-BPU6VB4U.js} +4 -4
- package/assets/{socials-DSk2lLL3.js → socials-DS6Oy5zA.js} +1 -1
- package/assets/{swaps-C363NeRy.js → swaps-D1v4d6OG.js} +1 -1
- package/assets/{thirdweb-BhNxfjG0.js → thirdweb-C4HaRY0z.js} +3 -3
- package/assets/{totalSupply-Be_gMWWK.js → totalSupply-BeKwmSJ8.js} +1 -1
- package/assets/{trade-encoding-D5hlkp_r.js → trade-encoding-DWEKE2_D.js} +1 -1
- package/assets/{transactionReceipt-pNi0w4mU.js → transactionReceipt-hL0wb2x7.js} +1 -1
- package/assets/{transactions-CCTEkhLH.js → transactions-D8hLtdUl.js} +1 -1
- package/assets/{useInfiniteGrid-zYFhuy60.js → useInfiniteGrid-DtqZsW6Q.js} +1 -1
- package/assets/{useStore-DlgSV8xZ.js → useStore-JJzXYl67.js} +1 -1
- package/assets/{useTheme-DSjNsZwZ.js → useTheme-B1XbAz3A.js} +1 -1
- package/assets/useTheme-Cke4HwaD.js +1 -0
- package/assets/{verifyHash-DBA8HgBY.js → verifyHash-8JWQpVAA.js} +1 -1
- package/assets/{w3m-modal-C9hrB0_f.js → w3m-modal-BsLEDK_w.js} +1 -1
- package/assets/{w3m-modal-CJSKRyIz.js → w3m-modal-C6EBRfim.js} +1 -1
- package/assets/{wait-for-tx-receipt-BdSu8YP0.js → wait-for-tx-receipt-Dwtf8AK-.js} +1 -1
- package/assets/{wallets-CJn4BiVq.js → wallets-gXvJ-4C5.js} +6 -6
- package/assets/{web-connector-CB2KBra0.js → web-connector-DF_01FjF.js} +3 -3
- package/assets/{writeContract-DobkVUdS.js → writeContract-w2MHfkK2.js} +1 -1
- package/assets/{zoraTestnet-DXF2ZpAM.js → zoraTestnet-B_HTvQOr.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Cart-DXZzP7Af.css +0 -1
- package/assets/Cart-DpvMVP-7.js +0 -3
- package/assets/GetCredits-CBBS-hLK.js +0 -1
- package/assets/ItemDetail-Bdnzeft3.js +0 -48
- package/assets/buy-B5ZS4ZBM.js +0 -1
- package/assets/buy-gasless-Ba7WiBbA.js +0 -1
- package/assets/collection-5wVB2Die.js +0 -1
- package/assets/index-eE-_qVda.css +0 -1
- package/assets/useCreditPacks-BE-fG45H.js +0 -1
- package/assets/useTheme-BmPzYbts.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-C51i12iP.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
1
|
+
import{r as l,j as v}from"./react-C51i12iP.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29843281528.commit-80ee4fe/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29843281528.commit-80ee4fe/assets/DCL_LogoPattern-BryBPc3d.png",U=`
|
|
2
2
|
attribute vec2 a_position;
|
|
3
3
|
varying vec2 v_uv;
|
|
4
4
|
void main() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as t,b as Se}from"./react-C51i12iP.js";import{s as i,
|
|
1
|
+
import{r as l,j as t,b as Se}from"./react-C51i12iP.js";import{s as i,a8 as e,I as O,t as n,ah as me,h as G,m as je,u as ve,v as ie,A as se,ai as ke}from"./index-T-zasmbE.js";import{m as Ce}from"./mana-rate-B9PgPeC4.js";import{u as Re,M as Ne}from"./MarketCheckout-Cec3x9i9.js";import{n as $,R as ee,C as Pe,a as Fe,b as _e,S as ne,F as ze,c as re,d as Ie}from"./categories-DMvvNpsP.js";import{L as Te}from"./LoadMore-DdNzWoKw.js";import{u as Ae}from"./useInfiniteGrid-DtqZsW6Q.js";import{E as Ee}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-C-p0vOlr.js";import"./trade-encoding-DWEKE2_D.js";import"./buy-gasless-80rsxFwS.js";import"./errors-Cy2OMz1f.js";const Le=i.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 12px;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{j as e,r as j,u as Se,a as Le,L as Z}from"./react-C51i12iP.js";import{t as a,C as I,al as W,u as qe,aj as C,a as ie,b as Ie,c as Te,l as Pe,m as Ee,I as E,am as Be,v as J,an as de,ao as Fe,z as R,s as Ae,B as Re,g as We,h as Ue,r as ze,n as ue,ap as $e,x as he,w as Qe,aq as Ke}from"./index-T-zasmbE.js";import{s as Oe}from"./wallet-kind-B9P1TeIH.js";import{a as me}from"./buy-C-p0vOlr.js";import{g as Ge,a as Je,w as De,S as He,G as Ve}from"./buy-gasless-80rsxFwS.js";import{R as D,r as Ye}from"./cart-checkout-C8WkR2Mv.js";import{l as Xe,u as Ze,c as es}from"./loader-logo-sfRgTXGv.js";import{i as ss,a as as}from"./errors-Cy2OMz1f.js";import{E as ts}from"./ErrorNotice-C7soUjRV.js";import{C as cs}from"./CollectionCarousel-DijkJOGi.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DWEKE2_D.js";import"./index-HN6Rk25C.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29843281528.commit-80ee4fe/assets/buy-error-22UunaPC.png";function ns(t){const{phase:r,balanceCredits:u,onClose:l}=t,_=r==="processing",w=r!=="complete",M=r==="error"?a("cartCheckout.errorTitle"):r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),g=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:_?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${g?" buy-modal__card--tall":""}`,children:[w&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:M}),!_&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(I,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:W(u)})]})]}),r==="processing"&&e.jsx(os,{stage:t.stage??"reserving",step:t.step??1,total:t.total??1,isSelfCustody:!!t.isSelfCustody}),r==="nofunds"&&e.jsx(ls,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(is,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:l,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--purple",onClick:t.onRetry??l,children:a("cartCheckout.tryAgain")})]})]})]})]})}function os({stage:t,step:r,total:u,isSelfCustody:l}){const _=t==="reserving",w=u>0?Math.min(100,Math.round(r/u*100)):0,M=t==="awaiting-signature"?l?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):t==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:Xe,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:M}),_?e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[r,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ls({lines:t,shortfallCredits:r,packs:u,selectedPack:l,onSelectPack:_,onBuyPacks:w,onCancel:M}){const g=u.find(c=>c.id===l),H=t.reduce((c,y)=>c+(y.quantity??1),0);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:H})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const y=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),y>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:y})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(I,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:W(c.priceCredits*y)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(c=>{const y=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${y?" buy-modal__pack--on":""}`,onClick:()=>_(c.id),children:[e.jsx(I,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:W(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(I,{className:"buy-modal__total-ico"}),e.jsx("span",{children:W((g==null?void 0:g.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((g==null?void 0:g.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:M,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}function is({purchased:t,onMyAssets:r,onTryInWorld:u}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(l=>{const _=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(I,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:W(l.priceCredits*_)})]})]},l.id)})})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:u,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}const ds=Ae(Re)`
|
|
2
|
+
margin-top: 12px;
|
|
3
|
+
`;function _e(t){if(ss(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const us=12e4,hs=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function ms(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}const ye=t=>t.reduce((r,u)=>r+u.priceCredits*u.quantity,0),_s=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function Is(){qe({title:a("nav.cart"),noindex:!0});const t=C(s=>s.items),r=C(s=>s.remove),u=C(s=>s.increment),l=C(s=>s.decrement),_=C(s=>s.clear),w=C(s=>s.restore),M=C(s=>s.setFittingOpen),g=ie(s=>s.items),H=ie(s=>s.toggle),{session:c}=Ie(),y=Ze().packs.slice(0,3);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=t.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:B}=Pe(c),U=Ee(),z=Se(),{state:T}=Le(),[ee,F]=j.useState(null),[be,S]=j.useState(null),[se,$]=j.useState(null),[xe,P]=j.useState(!1),[k,A]=j.useState(null),ae=j.useRef(0),[i,v]=j.useState(null),[Y,te]=j.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ge=k?k.liveTotalCredits:je,ke=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),fe=new Map(k==null?void 0:k.buyable.map(s=>[s.item.id,s])),Q=(B==null?void 0:B.credits)??0,ve=Fe;function K(s){s(),A(null),$(null),S(null)}function Ne(){v(null),P(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-Q),b=y.find(h=>h.credits>=o)??y[y.length-1];te(b.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),v({phase:"nofunds",lines:s.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),P(!1)}async function Ce(s){if(!c||s.length===0)return;const n=_s(s),o=n.map(d=>({...d.item,priceCredits:d.priceCredits})),b=s.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),h=[];let N="authorize",G=!1;v({phase:"processing",stage:"reserving",step:1,total:n.length});try{const d=[];for(let m=0;m<n.length;m++){const q=n[m];v({phase:"processing",stage:"reserving",step:m+1,total:n.length});try{const{credit:p,maxCreditedValue:X}=await ze(c.identity,q.usdCents,q.trade.id);h.push(p.id),d.push({trade:q.trade,credits:[p],maxCreditedValue:X})}catch(p){if(as(p)){if(h.length){try{await ue(c.identity,h)}catch(X){R(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw p}}N="submit";const x=()=>v({phase:"processing",stage:"settling",step:n.length,total:n.length});v({phase:"processing",stage:"awaiting-signature",step:n.length,total:n.length});let f=[];if(Ge())try{f=await Je({purchases:d,buyer:c.address,signer:c.signer,onSigned:x});const q=(await Promise.allSettled(f.map(p=>De(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(q.length&&!q.some(p=>p instanceof He))throw q[0];G=!0}catch(m){if(!(m instanceof Ve))throw m;f=await me({purchases:d,buyer:c.address,signer:c.signer,onSigned:x})}else f=await me({purchases:d,buyer:c.address,signer:c.signer});s.forEach(m=>r(m.item.id)),A(null),J("Shop Completed Purchase",{...$e(o),payment_type:"credits",no_crypto_step:G,transaction_hash:f[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),v({phase:"complete",purchased:b})}catch(d){if(he(d)||R(d,{flow:"cart_checkout",step:N,cart_size:s.length}),J(he(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:N,error_code:Qe(d),value_usd:de(o.reduce((x,f)=>x+f.priceCredits,0)),cart_size:n.length}),h.length){try{await ue(c.identity,h)}catch(x){R(x,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:_e(d)})}}function oe(s){const n=ye(s);if(B!=null&&B.credits<n){ne(s);return}Ce(s)}async function O(){if(!c){S(a("buyModal.signInToCheckout"));return}const s=C.getState().items;if(s.length===0)return;S(null),$(null),P(!0);const n=s.reduce((o,b)=>o+b.priceCredits*b.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:Q>=n});try{F(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),b=[...o.unavailable,...o.own];if(b.length&&(b.forEach(h=>r(h.id)),$(ms(o))),o.buyable.length===0){S(a("cart.error.noneAvailable")),A(null),F(null);return}if(o.orderChanged){A(o),ae.current=Date.now(),F(null);return}F(null),oe(o.buyable)}catch(o){R(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),S(_e(o)),F(null)}finally{P(!1)}}async function we(){if(k){if(!c){S(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>us){A(null),$(null),await O();return}S(null),oe(k.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(C.getState().items))}catch{}P(!0);try{const s=await es(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}R(s,{flow:"cart_buy_credits"}),v({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const le=j.useRef(!1);j.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&w(o)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const L=xe||(i==null?void 0:i.phase)==="processing";return t.length===0&&!i?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(E,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ds,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(E,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(E,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>M(!0),disabled:L,children:[e.jsx(E,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=fe.get(s.id),o=n?n.priceCredits:s.priceCredits,b=!!n&&n.priceCredits!==s.priceCredits,h=!s.tokenId,N=s.quantity,G=typeof s.available=="number"&&N>=s.available,d=o*N,x=!!g[s.id],f=s.tokenId??s.itemId,m=s.contractAddress&&f?`/item/${s.contractAddress}/${f}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[m?e.jsx(Z,{className:"checkout__thumb-link",to:m,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","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("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[m?e.jsx(Z,{className:"checkout__name",to:m,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[h?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>l(s.id)),disabled:L||N<=1,"aria-label":a("cart.decreaseQuantity",{name:s.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("span",{className:"checkout__qty",children:N}),e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>u(s.id)),disabled:L||G,"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("div",{className:"checkout__price",children:[e.jsx(I,{className:"checkout__price-ico"})," ",d,b?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*N}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${x?" is-on":""}`,onClick:()=>H(s),"aria-label":x?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:x?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(E,{name:x?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>K(()=>r(s.id)),disabled:L,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(E,{name:"trash",size:24})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>K(_),disabled:L,children:a("cart.clearCart")}),null]})]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(I,{className:"checkout__total-ico"})," ",ge]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(k?we():O()),disabled:L,children:L?a("cart.working"):k?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),k?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(ts,{message:be,className:"checkout__msg"})]})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:re})}):null,i?e.jsx(ns,{phase:i.phase,balanceCredits:Q,onClose:Ne,stage:i.phase==="processing"?i.stage:void 0,step:i.phase==="processing"?i.step:void 0,total:i.phase==="processing"?i.total:void 0,isSelfCustody:Oe(c==null?void 0:c.providerType),lines:i.phase==="nofunds"?i.lines:void 0,shortfallCredits:i.phase==="nofunds"?i.shortfall:void 0,packs:y,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:i.phase==="complete"?i.purchased:void 0,onMyAssets:()=>z("/assets?tab=mine"),onTryInWorld:()=>window.open(hs,"_blank","noopener"),message:i.phase==="error"?i.message:void 0,onRetry:()=>void O()}):null]})}export{Is as Cart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
body.shop-cart-bg{background:var(--media)}.checkout{max-width:1510px;margin:0 auto}.checkout__top{position:relative}.checkout__back{display:inline-flex;align-items:center;gap:6px;margin:0 0 16px;padding:0;border:0;background:none;color:var(--text-2);font-size:14px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;cursor:pointer;transition:color .15s ease}.checkout__back:hover{color:var(--accent)}.checkout__back .ico{width:18px;height:18px}.checkout__body{display:grid;grid-template-columns:minmax(0,1fr) 615px;gap:24px;align-items:start}.checkout__left{min-width:0;display:flex;flex-direction:column;gap:12px}.checkout__head-card{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-radius:16px;padding:12px 12px 12px 24px}.checkout__panel{min-width:0;background:#fff;border-radius:16px;padding:24px}.checkout__panel-back{display:none}.checkout__panel-title{margin:0;font-size:14px;font-weight:600;line-height:1.57;color:var(--text)}.checkout__fitting{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 12px;border:2px solid transparent;border-radius:8px;background:linear-gradient(#fff,#fff) padding-box,var(--amethyst) border-box;color:var(--accent);font-size:13px;font-weight:600;line-height:24px;letter-spacing:.46px;text-transform:uppercase;white-space:nowrap;cursor:pointer;transition:box-shadow .15s ease,filter .15s ease}.checkout__fitting:hover:not(:disabled){box-shadow:0 0 8px #a524b359}.checkout__fitting:active:not(:disabled){filter:brightness(.97)}.checkout__fitting:disabled{opacity:.55;cursor:default}.checkout__fitting-ico{width:24px;height:24px}.checkout__list{display:flex;flex-direction:column;gap:24px}.checkout__card{position:relative;display:flex;align-items:stretch;gap:12px;background:#fff;border:1px solid #cfcdd4;border-radius:12px;overflow:hidden}.checkout__thumb{position:relative;flex-shrink:0;width:137.5px;height:137px;background:var(--media);border-radius:12px;display:grid;place-items:center;overflow:hidden}.checkout__thumb-link{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center}.checkout__thumb img{width:83%;height:83%;object-fit:contain;filter:drop-shadow(.56px 2.25px 2.8px rgba(0,0,0,.1))}.checkout__thumb-check{position:absolute;top:7.5px;left:7.5px;width:20px;height:20px;border-radius:50%;background:#34ce77;display:grid;place-items:center}.checkout__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:space-between;gap:8px;padding:16px 8px}.checkout__desc{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:64px}.checkout__name{display:block;font-size:16px;font-weight:600;line-height:1.2;color:var(--text);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}a.checkout__name:hover{color:var(--accent)}.checkout__creator{font-size:10px;line-height:1.43;color:var(--muted)}.checkout__creator [data-avatar]{display:none}.checkout__creator [data-testid=creator-name]{font-size:10px;line-height:1.43}.checkout__foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-right:8px}.checkout__stepper{display:inline-flex;align-items:center;gap:8px;padding:6px;border:.5px solid var(--muted-2);border-radius:50px}.checkout__step{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;background:none;color:var(--text);cursor:pointer}.checkout__step:disabled{color:var(--muted-2);cursor:default}.checkout__step svg{width:16px;height:16px}.checkout__qty{min-width:12px;font-size:14px;font-weight:500;line-height:1.2;color:var(--text);text-align:center}.checkout__price{display:inline-flex;align-items:center;gap:4px;margin-left:auto;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__price-ico{width:24px;height:24px;background:var(--accent)}.checkout__price-was{margin-left:6px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:line-through}.checkout__actions{position:absolute;top:9px;right:7px;display:flex;align-items:flex-start;gap:12px}.checkout__fav,.checkout__remove{display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;background:none;color:var(--muted);cursor:pointer;transition:color .12s ease}.checkout__fav:hover:not(:disabled){color:var(--text)}.checkout__fav.is-on{color:var(--dcl-red)}.checkout__remove:hover:not(:disabled){color:var(--dcl-red)}.checkout__fav:disabled,.checkout__remove:disabled{opacity:.5;cursor:default}.checkout__utils{display:flex;gap:20px;margin-top:16px}.checkout__utils .link{font-size:13px;color:var(--muted);font-weight:600}.checkout__utils .link:hover:not(:disabled){color:var(--text)}.checkout__summary{position:sticky;top:172px;display:flex;flex-direction:column;background:#fff;box-shadow:0 1px 3px #1615180f;border-radius:16px;padding:16px}.checkout__summary-title{margin:0 0 24px;padding-bottom:16px;border-bottom:1px solid #cfcdd4;font-size:24px;font-weight:600;color:var(--text)}.checkout__summary-body{display:flex;flex-direction:column;gap:12px}.checkout__total-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.checkout__total-label{font-size:16px;font-weight:400;color:var(--muted)}.checkout__total-value{display:inline-flex;align-items:center;gap:8px;font-size:24px;font-weight:600;color:var(--text-2)}.checkout__total-ico{width:30px;height:30px;background:var(--accent)}.checkout__cta{width:100%;height:56px;border:0;border-radius:8px;background:var(--amethyst);color:var(--soft-white);font-size:15px;font-weight:600;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;transition:background .15s ease,filter .15s ease}.checkout__cta:hover:not(:disabled){background:var(--accent)}.checkout__cta:active:not(:disabled){filter:brightness(.95)}.checkout__cta:disabled{opacity:.6;cursor:default}.checkout__msg{margin:0;font-size:13px}.cart-upsell{position:relative;padding:40px 0 24px}.cart-upsell:before{content:"";position:absolute;top:0;bottom:-80px;left:50%;width:100vw;transform:translate(-50%);background:var(--bg);z-index:0}.cart-upsell>*{position:relative;z-index:1}@media(max-width:1080px){.checkout__body{grid-template-columns:1fr}.checkout__summary{position:static}}@media(max-width:880px){.checkout{padding-bottom:188px}.checkout__back{display:none}.checkout__panel{padding:16px}.checkout__panel-head{margin-bottom:16px;gap:8px}.checkout__panel-back{display:inline-flex;align-items:center;flex-shrink:0;border:0;background:none;padding:0;color:var(--text);cursor:pointer}.checkout__panel-back .ico{width:20px;height:20px}.checkout__panel-title{flex:1;min-width:0;font-size:16px}.checkout__fitting{height:36px;padding:0 10px;font-size:12px}.checkout__fitting-ico{width:20px;height:20px}.checkout__thumb{width:120px;height:120px}.checkout__info{padding:12px 4px 12px 0}.checkout__name{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical}.checkout__price{font-size:20px}.checkout__price-ico{width:20px;height:20px}.checkout__summary{position:fixed;left:0;right:0;top:auto;bottom:0;z-index:30;border:0;border-radius:16px 16px 0 0;box-shadow:0 -4px 20px #1615181f}.checkout__summary-title{margin-bottom:12px;padding-bottom:12px}}.cart-checkout__progress-row{display:flex;align-items:center;justify-content:center;gap:8px;width:100%}.cart-checkout__step{font-size:16px;line-height:22px;color:var(--text-2);text-transform:capitalize;white-space:nowrap}.cart-checkout__scroll{display:flex;flex-direction:column;gap:8px;max-height:360px;overflow-y:auto;width:100%;scrollbar-width:thin;scrollbar-color:#a2a2a2 var(--media)}.cart-checkout__scroll::-webkit-scrollbar{width:8px}.cart-checkout__scroll::-webkit-scrollbar-track{background:var(--media);border-radius:10px}.cart-checkout__scroll::-webkit-scrollbar-thumb{background:#a2a2a2;border-radius:8px}.cart-checkout__done{display:flex;flex-direction:column;border:1px solid var(--muted-2);border-radius:16px;padding:24px}.cart-checkout__done-scroll{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow-y:auto}.cart-checkout__done-row{display:flex;align-items:center;gap:12px}.cart-checkout__done-row+.cart-checkout__done-row{border-top:1px solid var(--line);padding-top:12px}.cart-checkout__done-thumb{position:relative;flex-shrink:0;width:96px;height:96px;background:var(--media);border:.13px solid var(--muted-2);border-radius:8px;display:grid;place-items:center;overflow:hidden}.cart-checkout__done-thumb img{width:83%;height:83%;object-fit:contain}.cart-checkout__done-check{position:absolute;top:6px;left:6px;width:20px;height:20px;border-radius:4px;background:var(--dcl-red);display:grid;place-items:center}.cart-checkout__done-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:8px;overflow:hidden}.cart-checkout__done-name{font-size:20px;font-weight:600;line-height:1.4;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__qty-tag{margin-left:6px;font-size:12px;font-weight:600;color:var(--muted)}.cart-checkout__done-creator{font-size:10px;line-height:1.43;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cart-checkout__done-price{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;padding-right:4px;font-size:24px;font-weight:600;color:var(--text-2)}.cart-checkout__done-price-ico{width:24px;height:24px;background:var(--accent)}.cart-checkout__done-body{display:flex;flex-direction:column;gap:12px}.cart-checkout__done-body .buy-modal__success{flex-direction:row;align-items:center;gap:24px;padding:16px 24px}.cart-checkout__done-body .buy-modal__success-text{text-align:left;font-size:18px}.cart-checkout__done-body .buy-modal__btn{min-width:0}@media(max-width:600px){.cart-checkout__done-body .buy-modal__success{flex-direction:column;gap:12px;padding:16px}.cart-checkout__done-body .buy-modal__success-text{text-align:center}.cart-checkout__done{padding:16px}.cart-checkout__done-thumb{width:72px;height:72px}.cart-checkout__done-name{font-size:16px}.cart-checkout__done-price{font-size:20px}.cart-checkout__done-price-ico{width:20px;height:20px}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-
|
|
1
|
+
import{H as N,J as U,K as w,L as z,M as o,N as E,O as c,P as I,Q as g,R as D,S as M}from"./index-T-zasmbE.js";import{r as K,j as v}from"./react-C51i12iP.js";function F(r){return N("MuiCircularProgress",r)}U("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const L=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,$;const t=44,W=M(P||(P=l`
|
|
2
2
|
0% {
|
|
3
3
|
transform: rotate(0deg);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{
|
|
1
|
+
import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{a8 as N,s as v,a9 as Z,I as J,t,g as V,z as W,c as X,u as ee,A as ae,au as te,h as re,av as se}from"./index-T-zasmbE.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DPrYZX6W.js";import{u as de}from"./useStore-JJzXYl67.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,e as ue,c as R,d as ge}from"./categories-DMvvNpsP.js";import{L as xe}from"./LoadMore-DdNzWoKw.js";import{u as he}from"./useInfiniteGrid-DtqZsW6Q.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const be=v.section`
|
|
2
2
|
position: relative;
|
|
3
3
|
border-radius: ${N.radius.card};
|
|
4
4
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.collection-carousel{margin-top:64px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:22px;font-weight:700;color:var(--text)}.collection-carousel__viewall{display:inline-flex;align-items:center;gap:4px;background:none;border:0;padding:0;color:var(--accent);font-weight:700;font-size:13px;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__viewall-ico{width:16px;height:16px;transform:rotate(-90deg)}.collection-carousel__viewport{position:relative}.collection-carousel__arrow{position:absolute;top:112px;transform:translateY(-50%);z-index:5;width:53px;height:53px;padding:0;border:0;background:transparent;cursor:pointer;filter:drop-shadow(0 2px 6px rgba(0,0,0,.18));transition:transform .15s ease,filter .15s ease,opacity .15s ease}.collection-carousel__arrow img{display:block;width:100%;height:100%}.collection-carousel__arrow--left{left:-53px}.collection-carousel__arrow--right{right:-53px}.collection-carousel__arrow--left img{transform:scaleX(-1)}.collection-carousel__arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.07)}.collection-carousel__arrow:disabled{opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}@media(max-width:900px){.collection-carousel__arrow{display:none}}.collection-carousel__track{display:
|
|
1
|
+
.collection-carousel{margin-top:64px}.collection-carousel__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.collection-carousel__title{font-size:22px;font-weight:700;color:var(--text)}.collection-carousel__viewall{display:inline-flex;align-items:center;gap:4px;background:none;border:0;padding:0;color:var(--accent);font-weight:700;font-size:13px;letter-spacing:.046em;text-transform:uppercase;cursor:pointer;white-space:nowrap}.collection-carousel__viewall:hover{text-decoration:underline}.collection-carousel__viewall-ico{width:16px;height:16px;transform:rotate(-90deg)}.collection-carousel__viewport{position:relative}.collection-carousel__arrow{position:absolute;top:112px;transform:translateY(-50%);z-index:5;width:53px;height:53px;padding:0;border:0;background:transparent;cursor:pointer;filter:drop-shadow(0 2px 6px rgba(0,0,0,.18));transition:transform .15s ease,filter .15s ease,opacity .15s ease}.collection-carousel__arrow img{display:block;width:100%;height:100%}.collection-carousel__arrow--left{left:-53px}.collection-carousel__arrow--right{right:-53px}.collection-carousel__arrow--left img{transform:scaleX(-1)}.collection-carousel__arrow:hover:not(:disabled){transform:translateY(-50%) scale(1.07)}.collection-carousel__arrow:disabled{opacity:0;pointer-events:none}@media(prefers-reduced-motion:reduce){.collection-carousel__arrow{transition:none}}@media(max-width:900px){.collection-carousel__arrow{display:none}}.collection-carousel__track{display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - 64px)/5);gap:16px;overflow-x:auto;overflow-y:hidden;padding:12px 14px;scroll-padding-inline:14px;scroll-snap-type:x mandatory;scrollbar-width:none}.collection-carousel__track::-webkit-scrollbar{display:none}.collection-carousel__track>.card{scroll-snap-align:start}@media(max-width:1200px){.collection-carousel__track{grid-auto-columns:calc((100% - 48px)/4)}}@media(max-width:900px){.collection-carousel__track{grid-auto-columns:calc((100% - 32px) / 3)}}@media(max-width:720px){.collection-carousel__track{grid-auto-columns:calc((100% - 16px)/2)}}.collection-carousel__dots{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:18px}.collection-carousel__dot{width:10px;height:10px;border-radius:50%;border:0;padding:0;background:var(--line-strong);opacity:.5;cursor:pointer;transition:opacity .12s ease,background .12s ease,transform .12s ease}.collection-carousel__dot:hover{opacity:.8}.collection-carousel__dot.is-active{background:var(--accent);opacity:1;transform:scale(1.1)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as t}from"./react-C51i12iP.js";import{t as s,I as k,G as f,A as N}from"./index-
|
|
1
|
+
import{r as o,j as t}from"./react-C51i12iP.js";import{t as s,I as k,G as f,A as N}from"./index-T-zasmbE.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,C]=o.useState(!0),[b,p]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),C(e<=1),p(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function w(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:b,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>w(e)},e))}):null]})}export{L as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-C51i12iP.js";import{aw as oe,ax as ce,
|
|
1
|
+
import{u as K,j as e,L as re,d as se,b as te,r as j}from"./react-C51i12iP.js";import{aw as oe,ax as ce,am as le,t as a,ay as E,B as ne,a9 as z,b as ie,I,g as de,u as me,A as ue,aq as he,az as ge,h as xe}from"./index-T-zasmbE.js";import{d as _e,g as pe,a as Ne,A as je}from"./collection-DPrYZX6W.js";import{u as be,L as fe}from"./useStore-JJzXYl67.js";import{s as D}from"./address-DrURAr9O.js";import{S as $,C as ve,c as w,F as Ce,e as we,d as ke}from"./categories-DMvvNpsP.js";import{L as B}from"./LoadMore-DdNzWoKw.js";import{u as R}from"./useInfiniteGrid-DtqZsW6Q.js";import{E as T}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";function Pe({collection:t,cover:r,itemCount:o}){const n=K(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=oe(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img","data-testid":"coll-card-img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(ce,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(le,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function ye({address:t,className:r=""}){const o=E(m=>m.followed.includes(t.toLowerCase())),n=E(m=>m.toggle);return t?e.jsx(ne,{type:"button",size:"sm",variant:o?"ghost":"outline",className:r||void 0,"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const Se={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Le({address:t}){var d,b;const{data:r}=z(t),{data:o}=be(t),n=ie(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||D(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||_e,i=o==null?void 0:o.description,p=`${de.profileUrl}/${t}`,h=fe.filter(l=>o==null?void 0:o.links[l]),_=pe(Ne({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link","data-testid":"creator-hero-link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx(I,{name:Se[l]})},l)),m&&e.jsx(re,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx(I,{name:"pen"})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view","data-testid":"creator-hero-view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(ye,{address:t,className:"creator-hero__follow"})]})]})]})}const U=48;function Oe(){const{address:t}=se(),r=K(),[o]=te(),n=o.has("collections"),{data:m}=z(t),g=(m==null?void 0:m.name)||(t?D(t):a("creator.fallbackName"));me({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,O]=j.useState("newest"),y=d&&!Number.isNaN(Number(d))?Number(d):void 0,S=l&&!Number.isNaN(Number(l))?Number(l):void 0,G=i?ke[i]:void 0,H=($.find(s=>s.key===P)??$[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:G,minPriceCredits:y,maxPriceCredits:S,sortBy:H},{items:v,total:Y,isLoading:C,error:A,hasNextPage:q,isFetchingNextPage:F,fetchNextPage:W}=R(["creator-listings",L],s=>he({...L,first:U,skip:s}),{enabled:!!t&&!n}),u=R(["creator-collections",t],s=>ge(t,{first:U,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function Z(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function J(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Q(s){_(c=>c.includes(s)?c.filter(ae=>ae!==s):[...c,s])}function V(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(y||S),X=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),ee=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Le,{address:t}):null,!n&&!C&&v.length>0?e.jsx(je,{items:v,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(ve,{category:x,subCategory:i,onCategory:Z,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:J})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(Pe,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ce,{rarities:h,onToggleRarity:Q,sort:P,onSort:O,total:Y,loading:C,anyActive:ee,onClear:V,renderTrailing:s=>e.jsx(we,{panelKey:"price",label:X,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:xe.name})})]})})}),A?e.jsx(T,{message:a("creator.error")}):null,e.jsx("div",{className:"grid",children:C?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[v.map(s=>e.jsx(ue,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(B,{hasNextPage:q,isFetching:F,onLoadMore:()=>void W()}),!C&&!A&&v.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Oe as Creator,Oe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b7 as U,b8 as Ue,M as C,b9 as qe,ba as Ye,W as Qe,bb as Je,aW as Xe,L as R,a$ as K,a_ as Te,bc as a,bd as Ze,be as Le,T as et,b5 as tt}from"./index-
|
|
1
|
+
import{b7 as U,b8 as Ue,M as C,b9 as qe,ba as Ye,W as Qe,bb as Je,aW as Xe,L as R,a$ as K,a_ as Te,bc as a,bd as Ze,be as Le,T as et,b5 as tt}from"./index-T-zasmbE.js";import{R as rt,g as ot}from"./getOverlayAlpha-BYOq19Nw.js";import{j as T,r as y}from"./react-C51i12iP.js";import{u as nt,a as Be}from"./useTheme-B1XbAz3A.js";function ne(r){const o=Ue(r);return r!==o&&o.styles?(o.styles.match(/^@layer\s+[^{]*$/)||(o.styles=`@layer global{${o.styles}}`),o):r}function at({styles:r,themeId:o,defaultTheme:n={}}){const i=nt(n),s=o&&i[o]||i;let l=typeof r=="function"?r(s):r;return s.modularCssLayers&&(Array.isArray(l)?l=l.map(d=>ne(typeof d=="function"?d(s):d)):l=ne(l)),T.jsx(U,{styles:l})}const Ee=y.createContext(null);function se(){return y.useContext(Ee)}const it=typeof Symbol=="function"&&Symbol.for,st=it?Symbol.for("mui.nested"):"__THEME_NESTED__";function lt(r,o){return typeof o=="function"?o(r):C({},r,o)}function ct(r){const{children:o,theme:n}=r,i=se(),s=y.useMemo(()=>{const l=i===null?n:lt(i,n);return l!=null&&(l[st]=i!==null),l},[n,i]);return T.jsx(Ee.Provider,{value:s,children:o})}function dt(r){const o=Be(),n=qe()||"",{modularCssLayers:i}=r;let s="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!i||o!==null?s="":typeof i=="string"?s=i.replace(/mui(?!\.)/g,s):s=`@layer ${s};`,Ye(()=>{const l=document.querySelector("head");if(!l)return;const d=l.firstChild;if(s){var m;if(d&&(m=d.hasAttribute)!=null&&m.call(d,"data-mui-layer-order")&&d.getAttribute("data-mui-layer-order")===n)return;const S=document.createElement("style");S.setAttribute("data-mui-layer-order",n),S.textContent=s,l.prepend(S)}else{var f;(f=l.querySelector(`style[data-mui-layer-order="${n}"]`))==null||f.remove()}},[s,n]),s?T.jsx(at,{styles:s}):null}const $e={};function xe(r,o,n,i=!1){return y.useMemo(()=>{const s=r&&o[r]||o;if(typeof n=="function"){const l=n(s),d=r?C({},o,{[r]:l}):l;return i?()=>d:d}return r?C({},o,{[r]:n}):C({},o,n)},[r,o,n,i])}function ut(r){const{children:o,theme:n,themeId:i}=r,s=Be($e),l=se()||$e,d=xe(i,s,n),m=xe(i,l,n,!0),f=d.direction==="rtl",S=dt(d);return T.jsx(ct,{theme:m,children:T.jsx(Qe.Provider,{value:d,children:T.jsx(rt,{value:f,children:T.jsxs(Je,{value:d==null?void 0:d.components,children:[S,o]})})})})}const le="mode",ce="color-scheme",Ie="data-color-scheme";function mt(r){const{defaultMode:o="light",defaultLightColorScheme:n="light",defaultDarkColorScheme:i="dark",modeStorageKey:s=le,colorSchemeStorageKey:l=ce,attribute:d=Ie,colorSchemeNode:m="document.documentElement",nonce:f}=r||{};return T.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() {
|
|
2
2
|
try {
|
|
3
3
|
var mode = localStorage.getItem('${s}') || '${o}';
|
|
4
4
|
var colorScheme = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-
|
|
1
|
+
import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-CVKTirvY.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-DHR1PStF.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as $,b as q,r as i,j as e}from"./react-C51i12iP.js";import{u as z,t as s,b as H,m as Q,v as g,h as d,z as P,w as I,C as V,o as W}from"./index-T-zasmbE.js";import{R as G}from"./resume-buy-Bf0zIH7y.js";import{R as D}from"./cart-checkout-C8WkR2Mv.js";import{u as J,p as Z,c as X,l as ee,i as se}from"./loader-logo-sfRgTXGv.js";import{C as te}from"./CircularProgress-CFOLSY9J.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const x="https://cdn.decentraland.org/@dcl/shop/0.1.0-29843281528.commit-80ee4fe/assets/pack-chips--HnOpf5U.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-29843281528.commit-80ee4fe/assets/credit-coin-CmcTCd5i.webp",ae="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",C=se()?"mock":"stripe",ce={pack_5:x,pack_10:x,pack_25:x,pack_50:x},ne="https://docs.decentraland.org";function M(o){const r=o;if((r==null?void 0:r.name)==="AbortError")return s("getCredits.errorCanceled");const m=((r==null?void 0:r.message)??"").toLowerCase();return m.includes("sign in")?s("getCredits.errorSignIn",{currency:d.name}):m.includes("timed out")?s("getCredits.errorTimeout",{currency:d.name}):s("getCredits.errorGeneric")}function xe(){z({title:s("nav.getCredits",{currency:d.name}),noindex:!0});const o=$(),{session:r,signIn:m}=H(),n=Q(),[k,S]=q(),{packs:F,isLoading:T}=J(),[p,l]=i.useState("select"),[c,w]=i.useState(null),[E,R]=i.useState(null),[U,_]=i.useState(null),[K,N]=i.useState(!1),f=i.useRef(null);i.useEffect(()=>()=>{var t;return(t=f.current)==null?void 0:t.abort()},[]);const L=i.useCallback(()=>{S(t=>{const a=new URLSearchParams(t);return a.delete("order"),a.delete("canceled"),a},{replace:!0})},[S]),b=i.useCallback(async t=>{l("processing");const a=new AbortController;f.current=a;try{const u=await Z(t,{signal:a.signal,address:r==null?void 0:r.address,identity:r==null?void 0:r.identity});if(u.status==="credited"){const j=u.creditsGranted??(c==null?void 0:c.credits)??0;R(j>0?j:null),l("success"),g("Shop Completed Buy Credits",{order_id:t,pack_usd:(c==null?void 0:c.usd)??null,credits:j>0?j:null,provider:C}),n.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(D)){o("/cart",{state:{resumeCheckout:!0}});return}}catch{}try{const A=sessionStorage.getItem(G);if(A){sessionStorage.removeItem(G);const h=JSON.parse(A),B=h.tokenId??h.itemId;if(h.contractAddress&&B){o(`/item/${h.contractAddress}/${B}`,{state:{item:h,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),n.invalidateQueries({queryKey:["usd-balance"]}),l("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),_(u.error??s("getCredits.errorGrant",{currency:d.name})),l("error"))}catch(u){P(u,{flow:"get_credits",step:"grant",order_id:t}),g("Shop Buy Credits Failed",{step:"grant",error_code:I(u),pack_usd:(c==null?void 0:c.usd)??null}),_(M(u)),l("error")}},[c,r,n,o]),O=i.useCallback(async t=>{if(!r){m();return}_(null),N(!1),w(t),l(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:t.usd,credits:t.credits,provider:C});try{const a=await X(t.id,{address:r.address,identity:r.identity});if(a.mock)b(a.orderId);else if(a.url)g("Shop Redirected To Stripe",{order_id:a.orderId,pack_usd:t.usd,credits:t.credits}),window.location.href=a.url;else throw new Error("Checkout did not return a redirect url")}catch(a){P(a,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:I(a),pack_usd:t.usd}),_(M(a)),l("error")}},[r,m,b]),y=i.useRef(!1);i.useEffect(()=>{if(y.current)return;const t=k.get("order");if(k.get("canceled")!=null){y.current=!0,g("Shop Buy Credits Cancelled",{order_id:t,provider:C}),L(),N(!0),l("select");return}t&&(l("processing"),r&&(y.current=!0,L(),b(t)))},[k,r]);function v(){var t;(t=f.current)==null||t.abort(),l("select"),w(null),R(null),_(null),N(!1)}const Y=p==="select";return e.jsxs("div",{className:"getcredits",children:[Y&&e.jsxs("header",{className:"getcredits__head",children:[e.jsx("h1",{className:"getcredits__title",children:s("getCredits.title",{currency:d.name})}),e.jsxs("p",{className:"getcredits__sub",children:[s("getCredits.subtitle",{currency:d.name})," ",e.jsxs("a",{className:"getcredits__learn",href:ne,target:"_blank",rel:"noreferrer",children:[s("getCredits.learnMore"),e.jsxs("svg",{className:"getcredits__learn-ico",viewBox:"0 0 13 13","aria-hidden":!0,fill:"none",children:[e.jsx("path",{d:"M4 2h7v7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M11 2 2 11",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})]})]})]}),p==="select"&&e.jsxs(e.Fragment,{children:[K&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:s("getCredits.canceledNote")}),e.jsx(ie,{packs:F,loading:T,onSelect:t=>void O(t)})]}),p==="redirecting"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(te,{size:32}),e.jsx("p",{className:"muted",children:s("getCredits.redirecting")})]}),p==="processing"&&e.jsxs("div",{className:"gc-processing",role:"status","aria-live":"polite",children:[e.jsx("img",{className:"gc-processing__logo",src:ee,alt:"",width:61,height:61}),e.jsxs("div",{className:"gc-processing__body",children:[e.jsxs("p",{className:"gc-processing__title",children:[e.jsx("strong",{children:s("getCredits.processing")}),"…"]}),e.jsxs("div",{className:"gc-progress","aria-hidden":!0,children:[e.jsx("span",{className:"gc-progress__track",children:e.jsx("span",{className:"gc-progress__fill"})}),e.jsx("span",{className:"gc-progress__count",children:"1/1"})]})]})]}),p==="success"&&e.jsxs("div",{className:"gc-success",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"gc-banner",children:[e.jsx("img",{className:"gc-banner__icon",src:ae,alt:"",width:60,height:60}),e.jsxs("p",{className:"gc-banner__text",children:[e.jsx("strong",{children:s("getCredits.successTitle")})," ",s("getCredits.successBody",{currency:d.name})]})]}),E!=null&&e.jsx("div",{className:"gc-credits",children:e.jsxs("div",{className:"gc-credits__row",children:[e.jsx("img",{className:"gc-credits__coin",src:re,alt:"",width:93,height:93}),e.jsxs("p",{className:"gc-credits__text",children:[e.jsx(V,{className:"gc-credits__diamond"}),e.jsxs("span",{children:[e.jsx("strong",{className:"gc-credits__amount",children:s("getCredits.creditsAmount",{credits:E,currency:d.name})})," ",e.jsx("span",{className:"gc-credits__added",children:s("getCredits.creditsAdded")})]})]})]})}),e.jsxs("div",{className:"gc-actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.buyMore",{currency:d.name})}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")})]})]}),p==="pending"&&e.jsxs("div",{className:"gc-status",role:"status","aria-live":"polite",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.pendingTitle",{currency:d.name})}),e.jsx("p",{className:"muted",children:s("getCredits.pendingBody")}),e.jsxs("div",{className:"gc-status__actions",children:[e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:()=>o("/assets"),children:s("getCredits.startShopping")}),e.jsx("button",{className:"gc-actions__btn gc-actions__btn--outline",onClick:v,children:s("getCredits.done")})]})]}),p==="error"&&e.jsxs("div",{className:"gc-status gc-status--err",role:"alert",children:[e.jsx("p",{className:"gc-status__title",children:s("getCredits.errorTitle")}),e.jsx("p",{className:"error",children:U}),e.jsx("div",{className:"gc-status__actions",children:e.jsx("button",{className:"gc-actions__btn gc-actions__btn--solid",onClick:v,children:s("getCredits.tryAgain")})})]})]})}function ie({packs:o,loading:r,onSelect:m}){return r?e.jsx("div",{className:"packs","aria-busy":"true","aria-label":s("getCredits.packsLoading",{currency:d.name}),children:[0,1,2,3].map(n=>e.jsx("div",{className:"pack pack--skeleton","aria-hidden":!0,children:e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"skeleton pack__label-sk"}),e.jsx("span",{className:"skeleton pack__art-sk"}),e.jsx("span",{className:"skeleton pack__cta-sk"})]})},n))}):e.jsx("div",{className:"packs",children:o.map(n=>e.jsxs("button",{type:"button",className:`pack${n.bestValue?" pack--best":""}`,"data-testid":"pack",onClick:()=>m(n),"aria-label":s("getCredits.packAria",{amount:W(n.credits),usd:n.usd}),children:[n.bestValue&&e.jsx("span",{className:"pack__badge",children:s("getCredits.packBadge")}),e.jsxs("span",{className:"pack__inner",children:[e.jsx("span",{className:"pack__label",children:s("getCredits.creditsAmount",{credits:n.credits,currency:d.name})}),e.jsx("span",{className:"pack__art",children:e.jsx("img",{src:ce[n.id]??x,alt:"",loading:"lazy"})}),e.jsx("span",{className:"pack__cta-wrap",children:e.jsxs("span",{className:"pack__cta",children:["$",n.usd.toFixed(2)]})})]})]},n.id))})}export{xe as GetCredits,xe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-
|
|
1
|
+
import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-DJ4kGSWA.js";import{d as g,r as v}from"./index-DHR1PStF.js";import{C as c}from"./ConstantsUtil-CJUlyS7R.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CVKTirvY.js";import{au as y}from"./NetworkUtil-Xp0fNa8X.js";const b=g`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as K,r as u,j as e,L as B}from"./react-C51i12iP.js";import{t as s,h as w,B as k,C as L,v as $,z as A,u as P,b as U,m as W,c as z,s as Q,E as O}from"./index-
|
|
1
|
+
import{u as K,r as u,j as e,L as B}from"./react-C51i12iP.js";import{t as s,h as w,B as k,C as L,v as $,z as A,u as P,b as U,m as W,c as z,s as Q,E as O}from"./index-T-zasmbE.js";import{i as Y,R as D,f as G}from"./import-DGp843-7.js";import{s as H}from"./wallet-kind-B9P1TeIH.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./buy-C-p0vOlr.js";import"./trade-encoding-DWEKE2_D.js";import"./index-HN6Rk25C.js";import"./mana-rate-B9PgPeC4.js";function J({queue:n,session:T,onClose:j,onDone:h}){const N=K(),d=H(T.providerType),[m,f]=u.useState(()=>n.map(()=>"pending")),[I,E]=u.useState("running"),S=u.useRef(!1);u.useEffect(()=>{if(S.current)return;S.current=!0;let t=!1;return(async()=>{for(let r=0;r<n.length;r++){if(t)return;f(p=>p.map((g,o)=>o===r?"active":g));try{await Y(n[r].item,n[r].priceCredits,T),$("Shop Migrated Listing",{item_id:n[r].item.itemId??n[r].item.oldTradeId??null,contract_address:n[r].item.contractAddress,new_price_credits:n[r].priceCredits,new_price_usd:n[r].priceCredits/10}),t||f(p=>p.map((g,o)=>o===r?"done":g))}catch(p){if(p instanceof D)A(p,{flow:"import_listing",step:"relist",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(g=>g.map((o,b)=>b===r?"unlisted":o));else{const g=p,o=g.code===4001||/reject|denied|cancel/i.test(g.message??"");o||A(p,{flow:"import_listing",itemId:n[r].item.itemId??n[r].item.oldTradeId}),t||f(b=>b.map((a,l)=>l===r?o?"skipped":"failed":a))}}}t||E("finished")})(),()=>{t=!0}},[]);const _=m.filter(t=>t==="done").length,v=m.findIndex(t=>t==="active"),x=Math.round(m.filter(t=>t!=="pending"&&t!=="active").length/n.length*100);function y(){h(),j()}if(I==="finished"){const t=m.filter(r=>r==="skipped"||r==="failed").length,c=m.filter(r=>r==="unlisted").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:_>0?s("migrate.successTitle"):s("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[_>0?s("migrate.listedSummary",{count:_,currency:w.name}):s("migrate.noneListed"),t>0?" "+s("migrate.skippedSummary",{count:t}):"",c>0?" "+s("migrate.unlistedSummary",{count:c}):""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx(k,{variant:"ghost",onClick:y,children:s("getCredits.done")}),c>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/my-assets")},children:s("migrate.goToMyAssets")}):_>0?e.jsx(k,{variant:"purple",onClick:()=>{h(),j(),N("/assets")},children:s("migrate.viewInShop")}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate","data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:s("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[d?s("migrate.subConfirm"):s("migrate.subManaged")," ",v>=0?s("migrate.progressCount",{current:v+1,total:n.length}):""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${x}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((t,c)=>e.jsxs("li",{className:`migrate__row migrate__row--${m[c]}`,children:[e.jsx("span",{className:"migrate__thumb",children:t.item.thumbnail?e.jsx("img",{src:t.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:t.item.name,children:t.item.name||s("migrate.itemFallback")}),e.jsxs("span",{className:"migrate__price",children:[e.jsx(L,{className:"ccy-mark"})," ",t.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:m[c]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",d?s("migrate.statusConfirm"):s("migrate.statusAdding")]}):m[c]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):m[c]==="skipped"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusSkipped")}):m[c]==="failed"?e.jsx("span",{className:"migrate__skip",children:s("migrate.statusFailed")}):m[c]==="unlisted"?e.jsx("span",{className:"migrate__skip",title:s("migrate.unlistedTooltip"),children:s("migrate.statusUnlisted")}):e.jsx("span",{className:"migrate__wait",children:s("migrate.statusWaiting")})})]},t.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:d?s("migrate.hintConfirm"):s("migrate.hintManaged")})]})})}const F=Q(k)`
|
|
2
2
|
margin-top: 10px;
|
|
3
3
|
`,V=Q(k)`
|
|
4
4
|
padding: 13px 24px;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BoOFl8c5.js","assets/react-C51i12iP.js","assets/dcl-schemas-BICTSpB5.js","assets/index-T-zasmbE.js","assets/sentry-DKBoGDXH.js","assets/ethers-BeFqf2KO.js","assets/intl-CBcMB1D2.js","assets/index-BqifAYYN.css","assets/emotion-styled.browser.esm-exjoQmBi.js","assets/useTheme-B1XbAz3A.js","assets/CircularProgress-CFOLSY9J.js","assets/index-Dt2sCUK8.js","assets/useTheme-Cke4HwaD.js","assets/CssVarsProvider-B-9OhdaT.js","assets/getOverlayAlpha-BYOq19Nw.js","assets/index-m29akl6f.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as pe,r as o,j as e,d as na,a as da,L as ca}from"./react-C51i12iP.js";import{b as ye,l as oa,m as Ve,t,ao as ma,i as ua,j as ha,r as _a,n as te,v as H,w as Te,x as ue,ap as pa,z as _e,C as S,al as ie,_ as he,a9 as ya,ac as ba,ab as xa,aA as fa,af as va,g as Qe,aB as ja,a8 as re,s as z,aC as ga,aD as Na,aE as wa,ah as ka,aj as Be,a as Re,c as T,aF as Ca,aG as Ia,aH as Aa,aI as Sa,aJ as Ma,ak as Pa,u as Ea,I as O,aK as La,aL as Fa,aM as Da,am as Ta,aN as qe,aO as Ba,B as be,e as Ra,E as qa,au as $a,aP as Ka,aQ as Oa,av as Wa,aR as za,aS as Va}from"./index-T-zasmbE.js";import{d as W}from"./dcl-schemas-BICTSpB5.js";import{b as $e,c as Qa}from"./buy-C-p0vOlr.js";import{S as Ua,P as Ga,f as Ha}from"./PrimaryListModal-Ca5_30gC.js";import{g as Ya,b as Ja,w as Za,S as Xa,G as et}from"./buy-gasless-80rsxFwS.js";import{u as at,l as tt,c as st}from"./loader-logo-sfRgTXGv.js";import{R as Ke}from"./resume-buy-Bf0zIH7y.js";import{a as it,f as Oe,i as rt}from"./errors-Cy2OMz1f.js";import{E as Ue}from"./ErrorNotice-C7soUjRV.js";import{C as lt}from"./CircularProgress-CFOLSY9J.js";import{u as nt,M as dt}from"./MarketCheckout-Cec3x9i9.js";import{s as ct}from"./address-DrURAr9O.js";import{C as ot}from"./CollectionCarousel-DijkJOGi.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-DWEKE2_D.js";import"./index-HN6Rk25C.js";import"./wallet-kind-B9P1TeIH.js";import"./mana-rate-B9PgPeC4.js";function mt({item:r,onClose:u,resume:i=!1}){var J,Z;const{session:h}=ye(),{data:c}=oa(h),_=Ve(),g=pe(),b=at().packs.slice(0,3),[n,l]=o.useState("loading"),[a,N]=o.useState(null),[k,j]=o.useState(""),[B,R]=o.useState(r.priceCredits),[x,q]=o.useState(null),M=o.useRef(null),C=(x==null?void 0:x.credits)??B,Y=(c==null?void 0:c.credits)??0;o.useEffect(()=>{let d=!1;if(!h){l("error"),N(t("buyModal.signInToCheckout"));return}const f=m=>{const v=m-((c==null?void 0:c.credits)??0),p=b.find(E=>E.credits>=v)??b[b.length-1];j(p.id),H("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:m,credits_balance:(c==null?void 0:c.credits)??0,shortfall:Math.max(0,v)}),l("nofunds")};return(async()=>{var m,v;try{const p=await ma(r);if(!p)throw new Error("not for sale");if(ua(p,h.address))throw new Error("You can't buy your own listing.");const E=ha((v=(m=p.received)==null?void 0:m[0])==null?void 0:v.amount);if(!Number.isFinite(E)||E<=0)throw new Error("price unavailable");const $=Math.ceil(E/10);if(d)return;if(R($),c!=null&&c.credits<$){f($);return}try{const{credit:w,maxCreditedValue:Q,usdCents:D}=await _a(h.identity,E,p.id);if(d){te(h.identity,[w.id]).catch(()=>{});return}M.current=w.id;const X=Math.ceil(D/10);R(X);const K={trade:p,credit:w,maxCreditedValue:Q,usdCents:D,credits:X};q(K),i?V(K):l("ready")}catch(w){if(d)return;if(it(w)){f($);return}throw w}}catch(p){if(d)return;H(ue(p)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Te(p)}),l("error"),N(Oe(p,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{d=!0,M.current&&h&&(te(h.identity,[M.current]).catch(()=>{}),M.current=null)}},[]);async function V(d=x){if(!h||!d)return;l("processing"),N(null);let f=!1;try{const m={trade:d.trade,buyer:h.address,signer:h.signer,credits:[d.credit],maxCreditedValue:d.maxCreditedValue};let v;if(Ya())try{v=await Ja(m),await Za(v),f=!0}catch(p){if(p instanceof Xa)f=!0;else if(p instanceof et)v=await $e(m);else throw p}else v=await $e(m);M.current=null,H("Shop Completed Purchase",{...pa([r]),payment_type:"credits",no_crypto_step:f,transaction_hash:v??null}),_.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(m){ue(m)||_e(m,{flow:"buy",step:"submit",gasless:f}),te(h.identity,[d.credit.id]).catch(()=>{}),M.current=null,H(ue(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Te(m)}),_.invalidateQueries({queryKey:["usd-balance"]}),N(Oe(m,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function le(){if(!(!k||!h)){try{sessionStorage.setItem(Ke,JSON.stringify(r))}catch{}x&&te(h.identity,[x.credit.id]).catch(()=>{}),M.current=null,l("loading");try{const d=await st(k,{address:h.address,identity:h.identity});if(d.url){window.location.href=d.url;return}g("/credits")}catch(d){_e(d,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ke)}catch{}N(t("buyModal.error.creditsCheckout")),l("error")}}}const F=n==="processing",P=n==="complete"?t("buyModal.titleComplete"):n==="nofunds"?t("buyModal.titleNoFunds"):t("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:r.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:F?void 0:u,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${n==="processing"||n==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:P}),!F&&e.jsx("button",{className:"buy-modal__x",onClick:u,"aria-label":t("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:n==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(S,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ie(Y)})]})]}),n==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(lt,{size:44})}),n==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ue,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:u,children:t("buyModal.close")})})]}),n==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,C-Y)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(We,{item:r,priceCredits:C}),e.jsx("div",{className:"buy-modal__packs",children:b.map(d=>{const f=d.credits,m=d.id===k;return e.jsxs("button",{className:`buy-modal__pack${m?" buy-modal__pack--on":""}`,onClick:()=>j(d.id),children:[e.jsx(S,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ie(f)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",d.usd.toFixed(2),")"]})]},d.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(S,{className:"buy-modal__total-ico"}),e.jsx("span",{children:ie(((J=b.find(d=>d.id===k))==null?void 0:J.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((Z=b.find(d=>d.id===k))==null?void 0:Z.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:u,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void le(),children:t("buyModal.buy")})]})]}),n==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(We,{item:r,priceCredits:C}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void V(),children:t("buyModal.buy")})})]}),n==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:tt,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:i?t("buyModal.completingPurchase"):t("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),n==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:t("getCredits.successTitle")})," ",t("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>g("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:u,children:[t("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function We({item:r,priceCredits:u}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:r.name,children:r.name||t("buyModal.itemFallback")}),r.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:t("search.byCreator",{name:r.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(S,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ie(u)})]})]})]})}const ut=o.lazy(async()=>{const[{EmoteControls:r},{Experimental_CssVarsProvider:u},{light:i}]=await Promise.all([he(()=>import("./index-BoOFl8c5.js").then(h=>h.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),he(()=>import("./index-Dt2sCUK8.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),he(()=>import("./index-m29akl6f.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:h=>e.jsx(u,{theme:i,children:e.jsx(r,{...h})})}});function ht(r){return e.jsx(o.Suspense,{fallback:null,children:e.jsx(ut,{...r})})}function _t({item:r}){const u=ye(x=>{var q;return(q=x.session)==null?void 0:q.address}),{data:i,isLoading:h}=ya(u),c=u&&i?u:"default",_=r.category==="emote",[g,b]=o.useState("item"),n=!_&&g==="item",l=n||!h,[a,N]=o.useState(!0);o.useEffect(()=>{N(!0)},[r.id,n]);const k=!!u&&!!i,j=k&&ba(r,xa(i)),B=fa(r)[0],R=k&&!j&&!_;return e.jsxs(e.Fragment,{children:[l?e.jsx(va,{id:"shop-item-preview",contractAddress:r.contractAddress,tokenId:r.tokenId??void 0,itemId:r.tokenId?void 0:r.itemId??void 0,profile:n?void 0:j?c:"default",bodyShape:n||j?void 0:B,type:_?void 0:n?W.PreviewType.WEARABLE:W.PreviewType.AVATAR,emote:_||n?void 0:W.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:_?1.5:void 0,wheelStart:_?100:void 0,dev:Qe.chainId===80002,onLoad:()=>N(!1)}):null,!l||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,R&&!n?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:ja(B)})}):null,_?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(ht,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":t("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:g==="avatar"?"is-active":"","aria-pressed":g==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>b("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:g==="item"?"is-active":"","aria-pressed":g==="item","aria-label":t("itemPreview.item"),onClick:()=>b("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:t("itemPreview.item")})]})]})]})}const pt=z(ga)`
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
gap: 1px;
|
|
7
|
+
background: ${re.colors.lineStrong};
|
|
8
|
+
`;function yt({contractAddress:r,name:u,items:i,className:h}){const c=pe();if(!r||!u)return null;const _=(i??[]).map(n=>n.thumbnail).filter(n=>!!n).slice(0,4),g=_.slice(0,2),b=_.slice(2,4);return e.jsxs(Na,{as:"button","data-link":!0,className:h,"data-testid":"creator",onClick:n=>{n.stopPropagation(),c(`/collection/${r}`)},children:[_.length>0?e.jsxs(pt,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${b.length===0?" collection-collage__row--full":""}`,children:g.map((n,l)=>e.jsx("img",{src:n,alt:""},l))}),b.length>0?e.jsx("span",{className:"collection-collage__row",children:b.map((n,l)=>e.jsx("img",{src:n,alt:""},l))}):null]}):null,e.jsx(wa,{"data-testid":"creator-name",children:ka(u)})]})}const bt=z(be)`
|
|
9
|
+
margin-top: 6px;
|
|
10
|
+
`,se=z(be)`
|
|
11
|
+
&& {
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 48px;
|
|
14
|
+
font-size: 15px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
letter-spacing: 0.46px;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${re.media.down("lg")} {
|
|
24
|
+
.item-detail__ctas--dual && {
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
width: auto;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,xt=z("div")`
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: 10px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
`,ft=z(be)`
|
|
35
|
+
&& {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 44px;
|
|
38
|
+
}
|
|
39
|
+
`,vt=z("p")`
|
|
40
|
+
margin: 4px 0 0;
|
|
41
|
+
font-size: 13px;
|
|
42
|
+
color: ${re.colors.muted};
|
|
43
|
+
|
|
44
|
+
a {
|
|
45
|
+
color: ${re.colors.accent};
|
|
46
|
+
font-weight: 600;
|
|
47
|
+
}
|
|
48
|
+
`;function jt(r){return Object.values(W.Rarity).includes(r)}function gt(r){return r==="male"?t("itemDetail.genderMale"):r==="female"?t("itemDetail.genderFemale"):r==="unisex"?t("itemDetail.genderUnisex"):null}function ze(r){return r.wearableCategory?r.wearableCategory.replace(/_/g," "):r.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function Qt(){var Fe;const{contractAddress:r,tokenId:u}=na(),{state:i}=da(),h=pe(),c=!!(i!=null&&i.market),_=(i==null?void 0:i.marketPriceCredits)??null,g=Be(s=>s.add),b=Be(s=>s.items),n=Re(s=>s.toggle),{session:l}=ye(),[a,N]=o.useState(()=>i!=null&&i.item?{...i.item,tradeId:i.tradeId??i.item.tradeId}:{id:`${r}-${u}`,name:"",creator:"",contractAddress:r??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:Qe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:u??void 0,tradeId:i==null?void 0:i.tradeId}),[k,j]=o.useState(!1),[B,R]=o.useState(!!(i!=null&&i.resumeBuy));o.useEffect(()=>{i!=null&&i.resumeBuy&&j(!0)},[i==null?void 0:i.resumeBuy]);const{data:x=[],isFetched:q}=T({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>$a(a.contractAddress,{first:20}).then(s=>s.items)}),M=a.available==null&&!a.tokenId,{data:C,isLoading:Y}=T({queryKey:["shop-item",a.contractAddress,u],enabled:!c&&!!a.contractAddress&&!!u&&(!(i!=null&&i.item)||M),queryFn:()=>Ka(a.contractAddress,u)});o.useEffect(()=>{C&&N(s=>s.tradeId?s.available!=null&&s.wearableCategory?s:{...s,available:s.available??C.available,wearableCategory:s.wearableCategory??C.wearableCategory}:{...C})},[C]);const[V,le]=o.useState(!1),{data:F=""}=T({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Oa(a.contractAddress,a.itemId)}),{data:P}=T({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Wa(a.contractAddress)});o.useEffect(()=>{if(a.name||C||x.length===0)return;const s=u&&x.find(y=>y.tokenId===u||y.itemId===u)||x.find(y=>y.contractAddress===a.contractAddress);s&&N(y=>({...s,tradeId:y.tradeId??s.tradeId}))},[x,C]);const J=o.useMemo(()=>{const s=new Set,y=[];for(const I of x){if(I.id===a.id||a.itemId&&I.itemId===a.itemId||a.tokenId&&I.tokenId===a.tokenId)continue;const De=`${I.contractAddress}-${I.itemId??I.tokenId??I.id}`;s.has(De)||(s.add(De),y.push(I))}return y},[x,a.id,a.itemId,a.tokenId]),{data:Z,isLoading:d}=T({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const s=await za(a.contractAddress,a.itemId);return(s==null?void 0:s.id)??null}return null}}),f=a.tradeId??Z??void 0,m=!!f,{data:v}=nt(c),p=o.useMemo(()=>{if(!c||!(i!=null&&i.item))return null;const s=i.item;return s.manaWei?{tradeId:s.tradeId??s.id,listingType:"primary",contractAddress:s.contractAddress,itemId:s.itemId??"",name:s.name,thumbnail:s.thumbnail,rarity:s.rarity,category:s.category,wearableCategory:s.wearableCategory??null,creator:s.creator,manaWei:s.manaWei,available:1,network:s.network,chainId:s.chainId,createdAt:0}:null},[c,i==null?void 0:i.item]),E=c&&_!=null&&!!v&&!!p,$=Ca({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),w=o.useMemo(()=>({...a,tradeId:f,id:f??a.id}),[a,f]),Q=b.some(s=>s.id===w.id),D=!w.tokenId,X=((Fe=b.find(s=>s.id===w.id))==null?void 0:Fe.quantity)??0,K=D&&typeof a.available=="number"&&X>=a.available,L=Re(s=>!!s.items[a.id]),xe=o.useRef(null);o.useEffect(()=>{!a.name||d||xe.current===a.id||(xe.current=a.id,H("Shop Viewed Item",{...Ia(a),for_sale:m}),Aa(a))},[a.id,a.name,d,m]);const ee=`${r}/${u}`,fe=o.useRef(ee);o.useEffect(()=>{fe.current!==ee&&(fe.current=ee,i!=null&&i.item&&N({...i.item,tradeId:i.tradeId??i.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[ee]);function Ge(){!m||de||d||!D&&Q||K||g(w,"item_detail")}const ne=jt(a.rarity)?a.rarity:W.Rarity.COMMON,ve=gt(a.gender),je=Sa(a),ge=Ma(a.gender),He=m&&$,Ye=t("itemDetail.moreFromCollection"),de=Pa(a,l==null?void 0:l.address),ae=Ve(),[Je,Ne]=o.useState(!1),[Ze,we]=o.useState(!1),[U,ke]=o.useState(!1),[Xe,Ce]=o.useState(null),{data:A}=T({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!c&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?Va(l.address,a.contractAddress,a.tokenId):null}),{data:ce}=T({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:de&&!!l&&!!a.itemId,queryFn:async()=>l?(await Ha(l.address,l.identity)).find(y=>y.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&y.blockchainItemId===a.itemId)??null:null}),G=!!A,oe=!c&&(de||G),ea=G?!!(A!=null&&A.isOnSale):m,me=G?A==null?void 0:A.tradeId:f,Ie=G?!!A:!!ce;async function Ae(){await Promise.all([ae.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),ae.invalidateQueries({queryKey:["detail-trade"]}),ae.invalidateQueries({queryKey:["shop-item"]}),ae.invalidateQueries({queryKey:["collection-sale-state"]})])}async function Se(s={}){if(!l||!me)return!1;Ce(null),ke(!0);try{const y=await Ra(me);return await Qa({trade:y,signer:l.signer}),s.silent||qa.success(t("myAssets.removedFromSale",{name:a.name})),await Ae(),!0}catch(y){const I=rt(y);return I||_e(y,{flow:"remove-listing",tradeId:me}),Ce(I?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{ke(!1)}}function Me(){G?Ne(!0):we(!0)}async function aa(){await Se({silent:!0})&&Me()}function Pe(){Ne(!1),we(!1),Ae()}const Ee=m?d?t("itemDetail.checking"):K?t("itemDetail.maxInCart"):!D&&Q?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),ta=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!c,sa=!oe&&m&&!c,ia=c||!oe,ra=Y||!!a.contractAddress&&!q,Le=!a.name&&!ra,la=/^https?:\/\//i.test(a.thumbnail);return Ea(Le?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:F||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:ze(a),creator:ct(a.creator)}),image:la?a.thumbnail:void 0,type:"product"}:{}),Le?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(O,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:t("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:t("itemDetail.notAvailableBody")}),e.jsx(bt,{variant:"purple",onClick:()=>h("/assets"),children:t("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":t("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>h("/assets"),children:t("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||t("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx(_t,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${L?" is-on":""}`,onClick:()=>n(a),"aria-pressed":L,"aria-label":L?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(O,{name:L?"heart-solid":"heart",size:18})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${L?" is-on":""}`,onClick:()=>n(a),"aria-pressed":L,"aria-label":L?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(O,{name:L?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:Da(ne),color:Fa(ne)},title:La(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[je?e.jsx(O,{name:je,size:18,color:"var(--text-2)"}):null,ze(a)]}),ve?e.jsxs("span",{className:"chip item-detail__chip",children:[ge?e.jsx(O,{name:ge,size:18,color:"var(--text-2)"}):null,ve]}):null]}),F?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${V?" is-expanded":""}`,children:F}),F.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>le(s=>!s),children:V?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||P!=null&&P.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.creator")}),e.jsx(Ta,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,P!=null&&P.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.collection")}),e.jsx(yt,{contractAddress:a.contractAddress,name:P.name,items:x,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}),c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:_==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(S,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:_})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):m?He?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(S,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(S,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),qe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:qe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Ba,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(S,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:t("itemDetail.notForSale")})]}),ta?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",W.Rarity.getMaxSupply(ne).toLocaleString()]})]}):null]})}),e.jsx("div",{className:`item-detail__ctas${ia?" item-detail__ctas--buttons":""}${sa?" item-detail__ctas--dual":""}`,children:c?e.jsxs(se,{variant:"purple",onClick:()=>j(!0),disabled:!E,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),_!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(S,{className:"item-detail__cta-diamond"}),_]}):null]}):oe?e.jsxs(xt,{"data-testid":"manage-actions",children:[e.jsx(Ue,{message:Xe}),ea?e.jsxs(e.Fragment,{children:[e.jsx(se,{variant:"purple",onClick:()=>void aa(),disabled:U||!Ie,children:e.jsx("span",{className:"item-detail__cta-label",children:U?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(ft,{variant:"ghost",onClick:()=>void Se(),disabled:U,children:U?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(se,{variant:"purple",onClick:Me,disabled:U||!Ie,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(vt,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(ca,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):e.jsxs(e.Fragment,{children:[m?e.jsxs(se,{variant:"purple",onClick:()=>j(!0),disabled:d,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(S,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Ge,disabled:!m||d||(D?K:Q),"aria-label":Ee,children:[e.jsx(O,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:Ee})]})]})})]}):e.jsx(Nt,{})})]}),e.jsx(ot,{title:Ye,items:J,onViewAll:a.contractAddress?()=>h(`/collection/${a.contractAddress}`):void 0}),k&&c&&p&&v?e.jsx(dt,{listing:p,rate:v,onClose:()=>j(!1),onSold:()=>j(!1)}):k&&!c?e.jsx(mt,{item:w,resume:B,onClose:()=>{j(!1),R(!1)}}):null,Je&&A&&l?e.jsx(Ua,{asset:A,session:l,onClose:Pe}):null,Ze&&ce&&l?e.jsx(Ga,{item:ce,session:l,onClose:Pe}):null]})}function Nt(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{Qt as ItemDetail,Qt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as c}from"./react-C51i12iP.js";import{s as u,B as p,t as d}from"./index-
|
|
1
|
+
import{r as l,j as c}from"./react-C51i12iP.js";import{s as u,B as p,t as d}from"./index-T-zasmbE.js";const a=u.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
4
|
padding: 28px 0 8px;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as O,g as S,b as V,l as Y,m as H,t,n as h,C as x,o as M,q as $,h as j,e as D,i as J,r as X,v as y,w as F,x as R,s as Z,B as ee}from"./index-
|
|
1
|
+
import{c as O,g as S,b as V,l as Y,m as H,t,n as h,C as x,o as M,q as $,h as j,e as D,i as J,r as X,v as y,w as F,x as R,s as Z,B as ee}from"./index-T-zasmbE.js";import{r as re,a as b}from"./mana-rate-B9PgPeC4.js";import{u as ae,r as m,j as r}from"./react-C51i12iP.js";import{b as A}from"./buy-C-p0vOlr.js";import{g as te,b as se,w as ie,S as ce,G as ne}from"./buy-gasless-80rsxFwS.js";import{i as de}from"./errors-Cy2OMz1f.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";function pe(e=!0){return O({queryKey:["mana-rate",S.chainId],queryFn:()=>re(S.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}const B=Z(ee)`
|
|
2
2
|
flex: 1;
|
|
3
3
|
`;function U(e){if(de(e))return t("errors.rejected");const n=(e.message??"").toLowerCase();return n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:j.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("errors.cantBuyOwn"):t("marketCheckout.error.generic")}function le(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function Ce({listing:e,rate:n,onClose:q,onSold:W}){const{session:i}=V(),{data:d,isError:T}=Y(i),w=H(),g=ae(),[N,k]=m.useState("confirm"),[p,I]=m.useState(t("marketCheckout.lockingPrice")),[G,f]=m.useState(null),[a,L]=m.useState(null),o=m.useRef(null),Q=Math.ceil(b(e.manaWei,n)/10);m.useEffect(()=>{let l=!1;if(!i){k("error"),f(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await D(e.tradeId);if(!s)throw new Error("not found");if(J(s,i.address))throw new Error("You can't buy your own listing.");const u=b(e.manaWei,n);if(!Number.isFinite(u)||u<=0)throw new Error("price unavailable");const{credit:v,maxCreditedValue:K,usdCents:P}=await X(i.identity,u,e.tradeId);if(l){h(i.identity,[v.id]).catch(()=>{});return}o.current=v.id,L({trade:s,credit:v,maxCreditedValue:K,usdCents:P,credits:Math.ceil(P/10)}),I("")}catch(s){if(l)return;console.error("[market] authorize failed",s),y(R(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:F(s),value_usd:Math.round(b(e.manaWei,n))/100}),k("error"),f(U(s))}})(),()=>{l=!0,o.current&&i&&(h(i.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const C=!!a&&d!=null&&d.credits<a.credits;async function z(){if(!i||!a)return;if(C){y("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,g("/credits");return}k("working"),f(null);let l=!1;try{I(t("marketCheckout.confirming"));const c={trade:a.trade,buyer:i.address,signer:i.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(te())try{s=await se(c),await ie(s),l=!0}catch(u){if(u instanceof ce)l=!0;else if(u instanceof ne)s=await A(c);else throw u}else s=await A(c);o.current=null,y("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),w.invalidateQueries({queryKey:["usd-balance"]}),g("/success",{state:{items:[le(e)],txHash:s}})}catch(c){console.error("[market] buy now failed",c),h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,y(R(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:F(c),value_usd:a.usdCents/100}),w.invalidateQueries({queryKey:["usd-balance"]}),f(U(c)),k("error");const s=(c.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&W()}}function E(){i&&a&&h(i.identity,[a.credit.id]).catch(()=>{}),o.current=null,q()}const _=N==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:_?void 0:E,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),M(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),M(Q)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:p||t("marketCheckout.lockingPrice")})]})}),i?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",$(d,T)]}):null,C?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:j.name})}):null,p&&N==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:p}):null,r.jsx(oe,{message:G,className:"mkt-modal__note"}),r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx(B,{variant:"ghost",onClick:E,disabled:_,children:t("buyModal.cancel")}),r.jsx(B,{variant:"purple",onClick:()=>void z(),disabled:_||!a,children:_?t("marketCheckout.buying"):C?t("nav.getCredits",{currency:j.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{Ce as M,pe as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as J,r as o,j as s,L as V}from"./react-C51i12iP.js";import{u as X,t,b as ss,m as es,c as N,B as y,C as T,v as O,D as as,s as B,e as ns,E as ts,z as is,g as rs,h as cs,F as ls}from"./index-
|
|
1
|
+
import{u as J,r as o,j as s,L as V}from"./react-C51i12iP.js";import{u as X,t,b as ss,m as es,c as N,B as y,C as T,v as O,D as as,s as B,e as ns,E as ts,z as is,g as rs,h as cs,F as ls}from"./index-T-zasmbE.js";import{f as os}from"./import-DGp843-7.js";import{S as ds,P as ms,f as hs}from"./PrimaryListModal-Ca5_30gC.js";import{c as us}from"./buy-C-p0vOlr.js";import{L as ps}from"./LoadMore-DdNzWoKw.js";import{u as ys}from"./useInfiniteGrid-DtqZsW6Q.js";import{E as _}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./mana-rate-B9PgPeC4.js";import"./index-HN6Rk25C.js";import"./trade-encoding-DWEKE2_D.js";import"./errors-Cy2OMz1f.js";import"./wallet-kind-B9P1TeIH.js";const gs=B(y)`
|
|
2
2
|
margin-top: 8px;
|
|
3
3
|
width: 100%;
|
|
4
4
|
`,z=B(y)`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as n,j as s,L as m}from"./react-C51i12iP.js";import{u as c,t,a as l,I as d,A as p,s as v,B as x}from"./index-
|
|
1
|
+
import{r as n,j as s,L as m}from"./react-C51i12iP.js";import{u as c,t,a as l,I as d,A as p,s as v,B as x}from"./index-T-zasmbE.js";import{L as u}from"./LoadMore-DdNzWoKw.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const h=v(x)`
|
|
2
2
|
margin-top: 12px;
|
|
3
3
|
`,r=24;function E(){c({title:t("nav.myFavorites"),noindex:!0});const a=l(e=>Object.values(e.items)),[i,o]=n.useState(r);return a.length===0?s.jsxs("div",{className:"favorites-empty",children:[s.jsx(d,{name:"heart",size:40,color:"var(--muted-2)"}),s.jsx("p",{className:"favorites-empty__title",children:t("myFavorites.emptyTitle")}),s.jsx("p",{className:"muted",children:t("myFavorites.emptyBody")}),s.jsx(h,{as:m,to:"/assets",variant:"purple",children:t("notFound.cta")})]}):s.jsxs("section",{className:"favorites",children:[s.jsxs("div",{className:"favorites__head",children:[s.jsx("h1",{children:t("nav.myFavorites")}),s.jsx("span",{className:"favorites__count",children:t("myFavorites.itemCount",{count:a.length})})]}),s.jsx("div",{className:"grid",children:a.slice(0,i).map(e=>s.jsx(p,{item:e},e.id))}),s.jsx(u,{hasNextPage:i<a.length,isFetching:!1,onLoadMore:()=>o(e=>e+r)})]})}export{E as MyFavorites};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as s,L as h}from"./react-C51i12iP.js";import{u as l,t as r,b as p,I as o,f as x,s as j,B as _,c as y,C as N,d as g}from"./index-
|
|
1
|
+
import{j as s,L as h}from"./react-C51i12iP.js";import{u as l,t as r,b as p,I as o,f as x,s as j,B as _,c as y,C as N,d as g}from"./index-T-zasmbE.js";import{L as f}from"./LoadMore-DdNzWoKw.js";import{u as v}from"./useInfiniteGrid-DtqZsW6Q.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";const P=j(_)`
|
|
2
2
|
margin-top: 12px;
|
|
3
3
|
`,I=24;function b(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function E({status:e}){return e==="PENDING"?s.jsx("span",{className:"purchase__badge purchase__badge--pending",children:r("myPurchases.processing")}):s.jsx("span",{className:"purchase__badge purchase__badge--done",children:r("myPurchases.completed")})}function F({purchase:e}){const{data:a}=y({queryKey:["trade-display",e.tradeId],queryFn:()=>g(e.tradeId),enabled:!!e.tradeId,staleTime:3e5}),c=(a==null?void 0:a.name)??r("myPurchases.itemFallback"),m=(a==null?void 0:a.thumbnail)??"",i=(a==null?void 0:a.tokenId)??(a==null?void 0:a.itemId)??"",d=a!=null&&a.contractAddress&&i?`/item/${a.contractAddress}/${i}`:void 0,n=s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"purchase__thumb",children:m?s.jsx("img",{src:m,alt:c}):null}),s.jsxs("div",{className:"purchase__info",children:[s.jsx("div",{className:"purchase__name",title:c,children:c}),s.jsx("div",{className:"muted purchase__date",children:b(e.createdAt)})]}),s.jsx(E,{status:e.status}),s.jsxs("div",{className:"purchase__price",children:[s.jsx(N,{className:"ccy-mark"})," ",e.credits]})]});return d?s.jsx(h,{className:"purchase",to:d,children:n}):s.jsx("div",{className:"purchase",children:n})}function G(){l({title:r("nav.myPurchases"),noindex:!0});const{session:e}=p(),{items:a,isLoading:c,hasNextPage:m,isFetchingNextPage:i,fetchNextPage:d}=v(["purchases",e==null?void 0:e.address],t=>x(e.address,e.identity,{first:I,skip:t}),{enabled:!!e});if(!e)return s.jsxs("div",{className:"purchases-empty",children:[s.jsx(o,{name:"cart",size:40,color:"var(--muted-2)"}),s.jsx("p",{className:"purchases-empty__title",children:r("myPurchases.signInTitle")}),s.jsx("p",{className:"muted",children:r("myPurchases.signInBody")})]});const n=a.filter(t=>t.status!=="EXPIRED");return!c&&n.length===0?s.jsxs("div",{className:"purchases-empty",children:[s.jsx(o,{name:"cart",size:40,color:"var(--muted-2)"}),s.jsx("p",{className:"purchases-empty__title",children:r("myPurchases.emptyTitle")}),s.jsx("p",{className:"muted",children:r("myPurchases.emptyBody")}),s.jsx(P,{as:h,to:"/assets",variant:"purple",children:r("notFound.cta")})]}):s.jsxs("section",{className:"purchases",children:[s.jsxs("div",{className:"purchases__head",children:[s.jsx("h1",{children:r("nav.myPurchases")}),c?null:s.jsx("span",{className:"purchases__count",children:r("myPurchases.orderCount",{count:n.length})})]}),s.jsx("div",{className:"purchases__list",children:c?Array.from({length:4}).map((t,u)=>s.jsx("div",{className:"purchase purchase--skeleton"},u)):s.jsxs(s.Fragment,{children:[n.map(t=>s.jsx(F,{purchase:t},t.id)),i?Array.from({length:2}).map((t,u)=>s.jsx("div",{className:"purchase purchase--skeleton"},`m-${u}`)):null]})}),s.jsx(f,{hasNextPage:m,isFetching:i,onLoadMore:()=>void d()})]})}export{G as MyPurchases};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,L as n}from"./react-C51i12iP.js";import{u as s,t as o,I as e,B as a}from"./index-
|
|
1
|
+
import{j as t,L as n}from"./react-C51i12iP.js";import{u as s,t as o,I as e,B as a}from"./index-T-zasmbE.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";function c(){return s({title:o("seo.notFound.title"),noindex:!0}),t.jsxs("div",{className:"notfound","data-testid":"notfound",children:[t.jsx(e,{name:"cart",className:"notfound__ico"}),t.jsx("h1",{className:"notfound__title",children:o("notFound.title")}),t.jsx("p",{className:"muted",children:o("notFound.body")}),t.jsx(a,{as:n,to:"/assets",variant:"purple",children:o("notFound.cta")})]})}export{c as NotFound,c as default};
|