@dcl/shop 0.10.1-31029565525.commit-8eeaa8f → 0.10.1-31032606668.commit-30914a5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_assets/{Activity-BnUTRccC.js → Activity-CBQ0_5Gp.js} +3 -3
- package/_assets/{AnimatedBackground-CFxGJrvr.js → AnimatedBackground-DzU3vjuD.js} +1 -1
- package/_assets/{Assets-DKArlsdV.js → Assets-Bm8xT-wK.js} +48 -48
- package/_assets/{Assets.styles-Crxo5ZgZ.js → Assets.styles-D_DUFdKV.js} +56 -56
- package/_assets/{Authorizations-BVsBhVRE.js → Authorizations-YCl9mcd9.js} +1 -1
- package/_assets/{Cart-DGWIQa7u.js → Cart-BRPkkQw3.js} +13 -13
- package/_assets/{CircularProgress-C2EMA-WY.js → CircularProgress-BvMoYOvy.js} +1 -1
- package/_assets/Collection-D7bUo9dI.js +162 -0
- package/_assets/{CollectionCarousel-BfWdU9TS.js → CollectionCarousel-Bs4fBuN6.js} +18 -18
- package/_assets/{Confetti-2clep845.js → Confetti-Bf7aP0NE.js} +1 -1
- package/_assets/Creator-DctbYEDT.js +306 -0
- package/_assets/{ErrorNotice-DuUZx_7m.js → ErrorNotice-BU7FyT1W.js} +1 -1
- package/_assets/{ExchangeController-d78CG8uk.js → ExchangeController-D7v6FLdb.js} +1 -1
- package/_assets/{Faq-CD5Cn1w0.js → Faq-DBZpkL9P.js} +1 -1
- package/_assets/{GetCredits-DByVocxz.js → GetCredits-DEsgS54C.js} +14 -14
- package/_assets/{Grow-pVAVq4p8.js → Grow-GSOfEN2l.js} +1 -1
- package/_assets/{HelpersUtil-OmexlG_i.js → HelpersUtil-CkBhbL_r.js} +1 -1
- package/_assets/{ItemDetail-BB7--DmF.js → ItemDetail-B3yupLtb.js} +209 -209
- package/_assets/LazyEmoteControls-DLcKgwgu.js +2 -0
- package/_assets/{LoadMore-Bka3px9r.js → LoadMore-i3u3Pyt6.js} +1 -1
- package/_assets/{ManaPricingBanner.styles-05aOeHWK.js → ManaPricingBanner.styles-C18BesFl.js} +1 -1
- package/_assets/MyAssets-C-lv91w7.js +381 -0
- package/_assets/{MyFavorites-CdmRx3i0.js → MyFavorites-U-UxHb-o.js} +2 -2
- package/_assets/{NotFound-Cv_WsqDu.js → NotFound-DkcTAlkz.js} +1 -1
- package/_assets/{NotificationsBell-B_4w5VLE.js → NotificationsBell-DDCAY3l-.js} +1 -1
- package/_assets/{OutfitDetail-BlE4dNxL.js → OutfitDetail-BFmRzzjx.js} +4 -4
- package/_assets/{OutfitPreview-BjiO0VsO.js → OutfitPreview-DPS3H3_3.js} +2 -2
- package/_assets/{OutfitStudio-D9LQ_WGt.js → OutfitStudio-CrgVuCXP.js} +59 -59
- package/_assets/{StoreSettings-DpevQbL3.js → StoreSettings-BLndphwX.js} +43 -43
- package/_assets/Success-BY9OhkKm.js +280 -0
- package/_assets/{SwapController-BCq8cczu.js → SwapController-DXYjEOyv.js} +1 -1
- package/_assets/{Tooltip-BSg8PAuJ.js → Tooltip-BajbwTea.js} +1 -1
- package/_assets/{TradeService-DnRblc5X.js → TradeService-Cv02JkEQ.js} +1 -1
- package/_assets/{W3MFrameProviderSingleton-BkgMeT5j.js → W3MFrameProviderSingleton-A5mBxhYF.js} +3 -3
- package/_assets/{WebCryptoP256-5hLL6y4k.js → WebCryptoP256-CnQALEMv.js} +1 -1
- package/_assets/{authorizations-BZabD414.js → authorizations-Xqbnmu9x.js} +1 -1
- package/_assets/{basic-CID-Qs3b.js → basic-CvPWviGS.js} +1 -1
- package/_assets/{biconomy-BWK8rG_e.js → biconomy-glo4y4ek.js} +1 -1
- package/_assets/{builder-C0HXHDnK.js → builder-BqnhdDxo.js} +1 -1
- package/_assets/{buy-DMMwBXQK.js → buy-Cq5r6s_d.js} +1 -1
- package/_assets/{buy-gasless-DkT1GvmP.js → buy-gasless-CaSmt8Rn.js} +1 -1
- package/_assets/{categories-LpPpJwMX.js → categories-Cc9LF1R4.js} +44 -50
- package/_assets/{ccip-CmVA7LRy.js → ccip-DtPCxwhK.js} +1 -1
- package/_assets/{ccip-CTHaF-0F.js → ccip-HLzoBWhd.js} +1 -1
- package/_assets/{collectionPage.styles-C0OU97Vl.js → collectionPage.styles-rLItNGdu.js} +2 -2
- package/_assets/{controller-BSCAkC53.js → controller-DLVCl98j.js} +2 -2
- package/_assets/{core-BY58gAaC.js → core-BoCM39Dc.js} +4 -4
- package/_assets/{createSvgIcon-Co2I3KNE.js → createSvgIcon-CF6VIRxG.js} +1 -1
- package/_assets/{custom-BFUJnR6C.js → custom-BQJpm4NP.js} +1 -1
- package/_assets/{data-capture-BcT9TYL5.js → data-capture-CPxjWW7W.js} +1 -1
- package/_assets/{email-zKJhfKOQ.js → email-DglJsBXd.js} +1 -1
- package/_assets/{embedded-wallet-DZzfkRu7.js → embedded-wallet-CRWhciW5.js} +1 -1
- package/_assets/{emotion-styled.browser.esm-dvplhB66.js → emotion-styled.browser.esm-BATaYRNB.js} +1 -1
- package/_assets/{engine-B3Mf1brx.js → engine-CRPW7FqE.js} +1 -1
- package/_assets/{errors-BGVCQOMz.js → errors-D4C9kv7B.js} +1 -1
- package/_assets/{estimate-l1-fee-DMFrbofF.js → estimate-l1-fee-aOXZ8ihZ.js} +1 -1
- package/_assets/{execute-DCGV6tDo.js → execute-k2RZ2hTw.js} +2 -2
- package/_assets/{features-DqHFEBDx.js → features-BmdkdPP-.js} +1 -1
- package/_assets/{fetchTokenMetadata-D6K4KP_4.js → fetchTokenMetadata-Bmcczr66.js} +2 -2
- package/_assets/{field.styles-DcKQ_iNz.js → field.styles-DQVBZTuq.js} +1 -1
- package/_assets/{get-ecosystem-wallet-info-D6HzrmoJ.js → get-ecosystem-wallet-info-BbJRcc1t.js} +1 -1
- package/_assets/{getBalance-LGdYuyxa.js → getBalance-DC-t3UhM.js} +1 -1
- package/_assets/{getNFT-Cw0O3Ml9.js → getNFT-BlzNSmnK.js} +1 -1
- package/_assets/{getNFT-CuZyZceA.js → getNFT-DwruUWap.js} +1 -1
- package/_assets/{grid.styles-BoDTH9-L.js → grid.styles-2-Lphh1_.js} +1 -1
- package/_assets/{hashTypedData-CM__DDH2.js → hashTypedData-BLMgL5Vz.js} +1 -1
- package/_assets/{hashTypedData-qqC1Tbni.js → hashTypedData-D6ew3JpS.js} +1 -1
- package/_assets/{in-app-BwohLVFE.js → in-app-BRl8aLUS.js} +1 -1
- package/_assets/{in-app-wallet-calls-DkQZMb0p.js → in-app-wallet-calls-Cf8UnG06.js} +1 -1
- package/_assets/{index-D8uSGtoz.js → index-B2N5oNn8.js} +1 -1
- package/_assets/{index-DplFHsVz.js → index-BBOn5orP.js} +1 -1
- package/_assets/{index-CRUz-lFa.js → index-BD25cQD4.js} +1 -1
- package/_assets/{index-C4OULSnf.js → index-BDzGigH2.js} +1 -1
- package/_assets/{index-txSbIXUX.js → index-BISFLA3c.js} +1 -1
- package/_assets/{index-DY-CJBBw.js → index-BJovGEvB.js} +1 -1
- package/_assets/{index-CwEAusBk.js → index-BKj0f9wi.js} +1 -1
- package/_assets/{index-BeHXNx4l.js → index-BTkQgQDi.js} +1 -1
- package/_assets/{index-BHs8Nm1v.js → index-BXzvQW0o.js} +1 -1
- package/_assets/{index-jQ98hJsI.js → index-BZL5qpA4.js} +2 -2
- package/_assets/{index-BOCGS4MY.js → index-B_PIYV8c.js} +2 -2
- package/_assets/{index-BDKp6O92.js → index-BelRIVeb.js} +1 -1
- package/_assets/{index-BSioXpnp.js → index-BkspOCIc.js} +1 -1
- package/_assets/{index-unjRyi-x.js → index-Bq_9XM9n.js} +1 -1
- package/_assets/{index-CVEw6hKC.js → index-C-WOsJGb.js} +1 -1
- package/_assets/{index-CvJmHkgv.js → index-C0tIouBf.js} +3 -3
- package/_assets/{index-DVP9mmy0.js → index-C6G5Ojpz.js} +1 -1
- package/_assets/{index-MhPhsWP8.js → index-C7hGN0lI.js} +1 -1
- package/_assets/{index-CFjdvXcL.js → index-CBe4gtAt.js} +2 -2
- package/_assets/{index-DOmua37r.js → index-CFypPkBr.js} +1 -1
- package/_assets/{index-dguKxdA7.js → index-CHb52k2r.js} +2 -2
- package/_assets/{index-DnafkRIs.js → index-CN8WHGrH.js} +1 -1
- package/_assets/{index-CDV3IoQm.js → index-COY9dHV9.js} +1 -1
- package/_assets/{index-DqogjYMl.js → index-CPTPmsi2.js} +1 -1
- package/_assets/{index-CM4gYpZ8.js → index-CPhcLOEq.js} +1 -1
- package/_assets/{index-Dg22Nieo.js → index-Ch87wzNg.js} +1 -1
- package/_assets/index-CqRUWZDq.js +1 -0
- package/_assets/{index-Dij6LJf6.js → index-CuSvjeNM.js} +1 -1
- package/_assets/{index-BLKe1fxG.js → index-CwFxxSc1.js} +299 -299
- package/_assets/{index-CRd1XuYs.js → index-CwKi0BcO.js} +1 -1
- package/_assets/{index-B9zvMdI0.js → index-CxTgEmAp.js} +1 -1
- package/_assets/{index-BPqobsB6.js → index-CyQd3Dif.js} +1 -1
- package/_assets/{index-BRZA_fuK.js → index-D7TrWXvV.js} +1 -1
- package/_assets/{index-BSFFapHO.js → index-DCZ36akI.js} +1 -1
- package/_assets/{index-CCenxE7k.js → index-DFNARVN7.js} +1 -1
- package/_assets/{index-Bo-edPJM.js → index-DGXzZsJb.js} +1 -1
- package/_assets/{index-CSHbp-r-.js → index-DKKo0LoX.js} +11 -11
- package/_assets/{index-MuXfi5UE.js → index-DOGInGKk.js} +1 -1
- package/_assets/{index-BsgL3ujL.js → index-DQ1Y3Whz.js} +1 -1
- package/_assets/{index-BzVWz4Tj.js → index-DRKYu1B3.js} +1 -1
- package/_assets/{index-DlhJ9Qox.js → index-DRyHPso7.js} +1 -1
- package/_assets/{index-UR9Qpju9.js → index-DSJJjIyM.js} +3 -3
- package/_assets/{index-B-2CvxPO.js → index-DSQSVjLs.js} +1 -1
- package/_assets/{index-CVIbA-VT.js → index-DdL-MVH6.js} +1 -1
- package/_assets/{index-CTenZZ8l.js → index-DgkGEui6.js} +1 -1
- package/_assets/{index-LP5Of-SX.js → index-Sn4izkWE.js} +1 -1
- package/_assets/index-UdM3HuhV.js +1 -0
- package/_assets/{index-CWhL4zBo.js → index-e3mxlGeM.js} +1 -1
- package/_assets/{index-Bo5HGYUE.js → index-fRwny2zx.js} +1 -1
- package/_assets/{index-0DS7nWrl.js → index-fvtPPVdt.js} +1 -1
- package/_assets/{index-ShFdgjrK.js → index-j8jUDLYS.js} +1 -1
- package/_assets/{index-BBrm4kwZ.js → index-rj2Zyfmj.js} +3 -3
- package/_assets/{index.es-WFmF4El-.js → index.es-C7evsiQb.js} +4 -4
- package/_assets/{index.es-CM1g4yN5.js → index.es-DF_rXR3Q.js} +1 -1
- package/_assets/{index.es-C61rbBYw.js → index.es-DYP1_xK_.js} +1 -1
- package/_assets/{localBatchGatewayRequest-DGjQ1weV.js → localBatchGatewayRequest-BXykDIjc.js} +1 -1
- package/_assets/{networks-C1UzX1Sm.js → networks-DKlZyT-L.js} +1 -1
- package/_assets/{onramp-Fd2Cj3wL.js → onramp-ByQtA-xO.js} +1 -1
- package/_assets/{openzeppelin-BYo8OyKm.js → openzeppelin-CroDtw4s.js} +1 -1
- package/_assets/{parseNft-Gein49L0.js → parseNft-BH0wDTt0.js} +2 -2
- package/_assets/{parseSignature-k67zYFy4.js → parseSignature-DgaK7Nqy.js} +1 -1
- package/_assets/{parseSignature-DaGe9UWu.js → parseSignature-VSsiOnpe.js} +3 -3
- package/_assets/{passkeys-D3J4DzgH.js → passkeys-C1oIb99i.js} +1 -1
- package/_assets/{pay-with-exchange-CbWF1HDJ.js → pay-with-exchange-CttWQzQs.js} +1 -1
- package/_assets/{qr-overlay-nWKGC2_v.js → qr-overlay-DHUyjo36.js} +1 -1
- package/_assets/{receive-bg6fMaP3.js → receive-BKxXWv2t.js} +1 -1
- package/_assets/{resolveImplementation-3oaoK01c.js → resolveImplementation-X7KhKw3S.js} +1 -1
- package/_assets/{rpc-BohETOPd.js → rpc-CLJ9sbD8.js} +1 -1
- package/_assets/{secp256k1-DDb2NhqN.js → secp256k1-Cbp19gqh.js} +1 -1
- package/_assets/{secp256k1-DTNpVYCz.js → secp256k1-DPi4cvKJ.js} +1 -1
- package/_assets/{secp256k1-C-hoA_Tn.js → secp256k1-DxA18vH5.js} +1 -1
- package/_assets/{send-CmaFLfs9.js → send-EgTowmAZ.js} +1 -1
- package/_assets/{send-batch-transaction-BGvy0zyD.js → send-batch-transaction-wEk0AI7v.js} +1 -1
- package/_assets/{send-eip712-transaction-hYvHM7vZ.js → send-eip712-transaction-BBM2idYc.js} +2 -2
- package/_assets/{send-gasless-transaction-QyhmnHZB.js → send-gasless-transaction-UdxWKrE2.js} +2 -2
- package/_assets/{send-transaction-CtZe85mL.js → send-transaction-DEvt9fmJ.js} +2 -2
- package/_assets/{sendMetaTransaction-C5SAvbei.js → sendMetaTransaction-BYbBPih_.js} +1 -1
- package/_assets/{sendRawTransaction-B2WHhB1D.js → sendRawTransaction-D5OSt6IO.js} +3 -3
- package/_assets/{serializeTransaction-BwuobXgs.js → serializeTransaction-Blc5JuIS.js} +1 -1
- package/_assets/{session-proposal-pdBgnfq3.js → session-proposal-BOLRFjK9.js} +1 -1
- package/_assets/{session-request-DVhv1Cj8.js → session-request-CRjXklwV.js} +2 -2
- package/_assets/{signing-BRSDIb8-.js → signing-B3rrMiJs.js} +3 -3
- package/_assets/skeleton.styles-D3iPDKdT.js +7 -0
- package/_assets/{socials-D7ScJClR.js → socials-QIa2OQ6D.js} +1 -1
- package/_assets/{styled-CrSAMFFb.js → styled-CMJUrQY2.js} +1 -1
- package/_assets/{swaps-wmzxaVLP.js → swaps-DIftYDvd.js} +1 -1
- package/_assets/{thirdweb-WdIIt1R4.js → thirdweb-C0YKMkrc.js} +3 -3
- package/_assets/{to-serializable-transaction-Dcp4UJq5.js → to-serializable-transaction-Cjnw6yJ0.js} +2 -2
- package/_assets/{transactionReceipt-CX5pZ3y-.js → transactionReceipt-BCryC1fM.js} +1 -1
- package/_assets/{transactions-CP64yjJv.js → transactions-p19NlOdG.js} +1 -1
- package/_assets/{useCreditPacks-BtlA3bsY.js → useCreditPacks-DL0joeDc.js} +1 -1
- package/_assets/{useImportable-30ssdgwW.js → useImportable-CXGXlKVj.js} +1 -1
- package/_assets/{useInfiniteGrid-DwOzTLpA.js → useInfiniteGrid-DCnfT2gg.js} +1 -1
- package/_assets/{useTheme-BTDb7mvT.js → useTheme-vYv6two9.js} +1 -1
- package/_assets/{verifyHash-C6FN0xpS.js → verifyHash-Dnb3FmXs.js} +1 -1
- package/_assets/{w3m-modal-Bq0A97y3.js → w3m-modal-BPKpwX5-.js} +1 -1
- package/_assets/{w3m-modal-DoKC93v3.js → w3m-modal-CQfqosvf.js} +1 -1
- package/_assets/{wait-for-tx-receipt-25yHA4Ha.js → wait-for-tx-receipt-H6RTv4Cw.js} +1 -1
- package/_assets/{wallets-CLLcXEAl.js → wallets-C2vtueR8.js} +5 -5
- package/_assets/{web-connector-CXNgxhSL.js → web-connector-Cc4ShgT6.js} +3 -3
- package/_assets/{writeContract-78bJpqls.js → writeContract-B_DvmCjk.js} +1 -1
- package/_assets/{zoraTestnet-CNk9bURD.js → zoraTestnet-TFaEQBOe.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/_assets/Collection-D6DIMkEd.js +0 -162
- package/_assets/Creator-k4PUSiKV.js +0 -306
- package/_assets/LazyEmoteControls-CtiNE6Cc.js +0 -2
- package/_assets/MyAssets-_v0xxc8e.js +0 -381
- package/_assets/Success-rROJaYNs.js +0 -280
- package/_assets/index-CLm02-HM.js +0 -1
- package/_assets/index-zCa2boac.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-
|
|
2
|
-
import{n as we,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-DKKo0LoX.js","_assets/react-BYHuwl8r.js","_assets/index-CwFxxSc1.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/sentry-Dx-KuLV3.js","_assets/ethers-BDpbhgX6.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-CXGXlKVj.js","_assets/buy-Cq5r6s_d.js","_assets/authorizations-Xqbnmu9x.js","_assets/sendMetaTransaction-BYbBPih_.js","_assets/ManaPricingBanner.styles-C18BesFl.js","_assets/Faq-DBZpkL9P.js","_assets/field.styles-DQVBZTuq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as we,bM as je,o as q,v as I,bN as ke,s as l,t as s,w as Ie,B as Ae,x as $e,b as d,ao as Pe,I as A,bO as Y,bP as ee,bQ as Le,_ as Ne,z as N,bR as Ee,A as Te,bh as z,L as Ce,bS as Se,E as Fe,bT as De,bU as O}from"./index-CwFxxSc1.js";import{r as g,u as Me,j as t,L as se,e as He}from"./react-BYHuwl8r.js";import{u as qe}from"./useImportable-CXGXlKVj.js";import{L as ze}from"./LoadMore-i3u3Pyt6.js";import{u as P}from"./useInfiniteGrid-DCnfT2gg.js";import{m as ne}from"./mana-matic-C4e1sNO3.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./buy-Cq5r6s_d.js";import"./authorizations-Xqbnmu9x.js";import"./sendMetaTransaction-BYbBPih_.js";const Oe=15e3;function Re(e,a){return e.txHash&&a.txHash?e.txHash===a.txHash:e.txHash||a.txHash?!1:e.status===a.status&&Math.abs(e.createdAt-a.createdAt)<=Oe}function We(e){const a=[...e].sort((i,r)=>r.createdAt-i.createdAt),n=[];for(const i of a){const r=n[n.length-1];r&&Re(r[r.length-1],i)?r.push(i):n.push([i])}return n.map(i=>{var r;return{id:((r=i.find(c=>c.txHash))==null?void 0:r.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,u)=>c+u.credits,0),lines:i}})}function _e(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Be(e){const a=[],n=new Map;for(const i of e){const r=_e(i);if(!r){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=n.get(r);if(c){c.quantity+=1,c.credits+=i.credits;continue}const u={key:r,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(r,u),a.push(u)}return a}function Ge(e,a){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:a?we(e.manaWei,a):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Ue(e){const n=We(e.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=e.sales.map(o=>{const x=Ge(o,e.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),r=(e.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),c=new Set(e.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(o=>!c.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...r,...u].sort((o,x)=>x.createdAt-o.createdAt||(o.id<x.id?-1:1))}function Ke(e,a){return a==="all"?e:a==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const re=e=>e.trim().toLowerCase();function Qe(e){const a=new Map;for(const n of e??[]){const i=re(n.txHash??"");if(!i)continue;const r=a.get(i);r?r.push(n):a.set(i,[n])}return a}function Ve(e,a,n=Date.now()){const i=a.txHash?e.get(re(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const r=i.length===1?Xe(i[0].netCents):null,c=i.filter(o=>!o.available&&o.availableAt>n);if(c.length===0)return{kind:"credited",credits:r};const u=c.reduce((o,x)=>Math.max(o,x.availableAt),0);return{kind:"pending",credits:r,availableAt:u}}function Xe(e){return je(e)}function Ze(){const e=q(i=>{var r;return(r=i.session)==null?void 0:r.address}),{data:a,isLoading:n}=I({queryKey:["listing-count",e],queryFn:()=>ke({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:a==null?void 0:a.total,isLoading:n}}const Je="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/credits-product-vs4Q6u6l.svg",R=Ie`
|
|
3
3
|
0% { background-position: 200% 0; }
|
|
4
4
|
100% { background-position: -200% 0; }
|
|
5
5
|
`,Ye=l.section`
|
|
@@ -378,4 +378,4 @@ import{n as we,bL as je,o as q,v as I,bM as ke,s as l,t as s,w as Ie,B as Ae,x a
|
|
|
378
378
|
margin: 6px 0 0;
|
|
379
379
|
`,ht=l(Ae)`
|
|
380
380
|
margin-top: 12px;
|
|
381
|
-
`,V=H.withComponent(se),ut=g.lazy(()=>Ne(()=>import("./index-
|
|
381
|
+
`,V=H.withComponent(se),ut=g.lazy(()=>Ne(()=>import("./index-DKKo0LoX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),L=24,pt=["all","purchases","sales"],ae="migrate";function k(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function he(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function ue(e){const a=Number(e)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function pe({children:e}){const a=g.useRef(null),[n,i]=g.useState(null),r=()=>{var u;const c=(u=a.current)==null?void 0:u.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(ct,{ref:a,tabIndex:0,onMouseEnter:r,onMouseLeave:()=>i(null),onFocus:r,onBlur:()=>i(null),children:[e,n?He.createPortal(t.jsx(dt,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function xt({item:e}){const a=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||a,{data:i,isLoading:r}=I({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?De(e.tradeId):O(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),c=n&&r,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",x=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[c?t.jsx(B,{}):t.jsx(_,{children:o?t.jsx("img",{src:o,alt:u}):t.jsx(A,{name:"cart",size:20})}),t.jsxs(G,{children:[c?t.jsx(K,{}):t.jsx(U,{title:u,children:u}),e.quantity>1?t.jsx(Q,{children:d("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(lt,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]});return x?t.jsx(V,{to:x,"data-link":"true",children:f}):t.jsx(H,{children:f})}function mt({order:e}){const a=Be(e.lines),n=a.reduce((i,r)=>i+r.quantity,0);return t.jsxs(E,{"data-testid":"purchase-order",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsxs(F,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),t.jsxs(D,{children:[t.jsx(M,{"data-status":e.status,children:e.status==="PENDING"?d("activity.processing"):d("activity.completed")}),t.jsxs(j,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(W,{children:a.map(i=>t.jsx(xt,{item:i},i.key))})]})}function gt({sale:e}){const{data:a,isLoading:n}=I({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>O(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??d("activity.itemFallback"),r=(a==null?void 0:a.thumbnail)??"",c=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(B,{}):t.jsx(_,{children:r?t.jsx("img",{src:r,alt:i}):t.jsx(A,{name:"offer",size:20})}),t.jsxs(G,{children:[n?t.jsx(K,{}):t.jsx(U,{title:i,children:i}),t.jsx(Q,{children:d("activity.boughtFrom",{account:he(e.seller)})})]})]});return t.jsxs(E,{"data-testid":"activity-mana-purchase",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsx(F,{children:d("activity.paidWithMana")})]}),t.jsxs(D,{children:[t.jsx(M,{"data-status":"SETTLED",children:d("activity.completed")}),t.jsxs(j,{children:[ue(e.manaWei)," ",t.jsx(pe,{children:t.jsx(ce,{src:ne,alt:"MANA"})})]})]})]}),t.jsx(W,{children:c?t.jsx(V,{to:c,"data-link":"true",children:u}):t.jsx(H,{children:u})})]})}function ft({sale:e,payout:a}){const{data:n,isLoading:i}=I({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>O(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),r=(n==null?void 0:n.name)??d("activity.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,o=t.jsxs(t.Fragment,{children:[i?t.jsx(B,{}):t.jsx(_,{children:c?t.jsx("img",{src:c,alt:r}):t.jsx(A,{name:"offer",size:20})}),t.jsxs(G,{children:[i?t.jsx(K,{}):t.jsx(U,{title:r,children:r}),t.jsxs(Q,{children:[d("activity.soldTo",{account:he(e.counterparty)}),a.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:k(a.availableAt)})}`:""]})]})]});return t.jsxs(E,{"data-testid":"activity-sale",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsx(F,{children:d("activity.saleLabel")})]}),t.jsxs(D,{children:[t.jsx(M,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),a.kind==="direct"?t.jsxs(j,{"data-kind":"income",children:["+",ue(e.manaWei)," ",t.jsx(pe,{children:t.jsx(ce,{src:ne,alt:"MANA"})})]}):a.credits!==null?t.jsxs(j,{"data-kind":"income",children:[t.jsx(N,{className:"ccy-mark"})," +",Ce(a.credits)]}):t.jsx(j,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),t.jsx(W,{children:u?t.jsx(V,{to:u,"data-link":"true",children:o}):t.jsx(H,{children:o})})]})}function bt({order:e}){const a=`$${(e.usdCents/100).toFixed(2)}`,n=Ee(e.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):n==="UNFINISHED"?d("activity.unfinished"):d("activity.processing"),r=q(p=>p.session),c=Te(),[u,o]=g.useState(!1),x=e.status==="initiated"&&!!r;async function f(){if(!(!r||u)){o(!0);try{const p=await Se(e.id,r.identity);if(p){window.location.href=p;return}Fe.info(d("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})}finally{o(!1)}}}return t.jsx(E,{"data-testid":"credit-order",children:t.jsxs(T,{children:[t.jsx(rt,{children:t.jsx("img",{src:Je,alt:"","aria-hidden":!0})}),t.jsxs(C,{children:[t.jsx(S,{children:k(e.createdAt)}),t.jsxs(F,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:a})]})]}),t.jsxs(D,{children:[x?t.jsx(ot,{type:"button",onClick:()=>void f(),disabled:u,"data-testid":"resume-order",children:u?d("activity.resuming"):d("activity.resume")}):null,t.jsx(M,{"data-status":n,children:i}),t.jsxs(j,{"data-kind":"income",children:["+",t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]})]})})}function yt({filter:e}){const a={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[e];return t.jsxs(de,{children:[t.jsx(A,{name:a.icon,size:40,color:s.colors.muted2}),t.jsx(le,{children:a.title}),t.jsx("p",{className:"muted",children:a.body}),e!=="sales"?t.jsx(ht,{as:se,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function St(){const{session:e}=q(),[a,n]=g.useState("all"),[i,r]=Me(),c=i.get("view")===ae;$e({title:c?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=qe(),{count:o}=Ze(),f=u!==void 0&&o!==void 0&&(u>0||o>0||c),p=!!e&&!c&&a!=="sales",m=!!e&&!c&&a!=="purchases",b=P(["purchases",e==null?void 0:e.address],h=>Le(e.address,e.identity,{first:L,skip:h}),{enabled:p}),y=P(["sales",e==null?void 0:e.address],h=>Y(e.address,{role:"seller",first:L,skip:h}),{enabled:m}),v=P(["credit-orders",e==null?void 0:e.address],h=>ee(e.address,e.identity,{first:L,skip:h}),{enabled:p}),w=P(["mana-purchases",e==null?void 0:e.address],h=>Y(e.address,{role:"buyer",first:L,skip:h}),{enabled:p}),{data:X}=I({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ee(e.address,e.identity,{first:200}).then(h=>h.payouts),enabled:m,staleTime:6e4}),xe=g.useMemo(()=>Qe(X),[X]),{data:me}=Pe(m);if(!e)return t.jsxs(de,{children:[t.jsx(A,{name:"clock",size:40,color:s.colors.muted2}),t.jsx(le,{children:d("activity.signInTitle")}),t.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const Z=Ke(Ue({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?w.items:[],rate:me}),a),ge=p&&(b.isLoading||v.isLoading||w.isLoading)||m&&y.isLoading,J=p&&(b.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||m&&y.isFetchingNextPage,fe=p&&(b.hasNextPage||v.hasNextPage||w.hasNextPage)||m&&y.hasNextPage;function be(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&w.hasNextPage&&w.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function ye(h){if(n(h),!c)return;const $=new URLSearchParams(i);$.delete("view"),r($,{replace:!0})}function ve(){const h=new URLSearchParams(i);h.set("view",ae),r(h,{replace:!0})}return t.jsxs(Ye,{children:[t.jsx(et,{children:t.jsx(tt,{children:d("nav.activity")})}),t.jsxs(it,{role:"tablist","aria-label":d("nav.activity"),children:[pt.map(h=>t.jsx(oe,{type:"button",role:"tab","aria-selected":!c&&a===h,"data-active":!c&&a===h,"data-testid":`activity-filter-${h}`,onClick:()=>ye(h),children:d(`activity.filter.${h}`)},h)),f?t.jsxs(at,{type:"button",role:"tab","aria-selected":c,"data-active":c,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:ve,children:[d("activity.migrate.chip"),u?t.jsx(st,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),c?t.jsx(g.Suspense,{fallback:t.jsx(nt,{"aria-busy":"true"}),children:t.jsx(ut,{})}):ge?t.jsx(te,{children:Array.from({length:5}).map((h,$)=>t.jsx(ie,{},$))}):Z.length===0?t.jsx(yt,{filter:a}):t.jsxs(t.Fragment,{children:[t.jsxs(te,{children:[Z.map(h=>h.kind==="purchase"?t.jsx(mt,{order:h.order},h.id):h.kind==="credit"?t.jsx(bt,{order:h.order},h.id):h.kind==="mana-purchase"?t.jsx(gt,{sale:h.sale},h.id):t.jsx(ft,{sale:h.sale,payout:Ve(xe,h.sale)},h.id)),J?t.jsx(ie,{}):null]}),t.jsx(ze,{hasNextPage:fe,isFetching:J,onLoadMore:be})]})]})}export{St as Activity};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,j as v}from"./react-BYHuwl8r.js";import{s as u}from"./index-
|
|
1
|
+
import{r as l,j as v}from"./react-BYHuwl8r.js";import{s as u}from"./index-CwFxxSc1.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_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{b as Ae,r as w,j as e,u as
|
|
1
|
+
import{b as Ae,r as w,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Je}from"./useUrlFilters-DH-gxdfV.js";import{u as Qe,S as ke,R as Xe,F as Ye,e as et}from"./categories-Cc9LF1R4.js";import{c as W,r as tt,bm as nt,bn as st,aC as rt,a as it,s,t,o as Me,bc as ot,A as at,L as me,b as n,y as lt,I as T,z as A,bZ as Y,bb as ct,$ as Q,br as dt,bq as pt,x as Ne,ao as Pe,n as We,q as ht,am as xt,aq as Se,ar as G,aG as mt,bK as ft}from"./index-CwFxxSc1.js";import{g as ut,h as gt,i as bt,j as yt,k as wt,C as jt,l as vt,o as $t,m as Ct,n as kt,M as St,u as Et,E as Tt,v as _t,p as Rt,q as zt,r as It,s as At,t as Mt}from"./Assets.styles-D_DUFdKV.js";import{L as Nt}from"./LoadMore-i3u3Pyt6.js";import{u as Pt}from"./useInfiniteGrid-DCnfT2gg.js";import{E as Wt}from"./ErrorNotice-BU7FyT1W.js";import{d as Bt}from"./dcl-schemas-CmtP3U6y.js";import{s as Ft,G as Lt,w as Ut,S as Ht}from"./buy-gasless-CaSmt8Rn.js";import{s as Ot,k as Gt}from"./buy-Cq5r6s_d.js";import{f as Dt}from"./errors-D4C9kv7B.js";import{J as qt,C as Vt,B as fe}from"./ethers-BDpbhgX6.js";import{n as Zt}from"./Tooltip-BajbwTea.js";import{G as Kt}from"./grid.styles-2-Lphh1_.js";import"./skeleton.styles-D3iPDKdT.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-Xqbnmu9x.js";import"./sendMetaTransaction-BYbBPih_.js";function D(r){const o=r.source??"item",l=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${o}:${l}`}const B="100000000000000000000",Be=2,X=15,Jt=/^[a-zA-Z0-9]+$/;function Ee(r){const o=r.trim();return o.length===0?{ok:!1,reason:"empty"}:Jt.test(o)?o.length<Be?{ok:!1,reason:"too-short"}:o.length>X?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,X)}const Xt=["function available(string _subdomain) view returns (bool)"],Te={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return W.chainId===Number(Bt.ChainId.MATIC_MAINNET)?Te.mainnet:Te.sepolia}async function en(r,o={}){var c;const{rpc:l,address:x}=Yt(),h=new qt(l),d=new Vt(x,Xt,h);console.info(`[names] availability check → DCLRegistrar(${x}).available("${r}") on ${l}`);const p=await d.available(r);if((c=o.signal)!=null&&c.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${p}`),p?"available":"taken"}const tn="https://app.across.to/api";class ue extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(r){return rt(B,r)}async function sn(r,o,l={}){var c;const x=l.chainId??W.chainId,h=l.provider??"across",d=`${W.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${x}&provider=${h}`,p=await it(d,{method:"GET",identity:r,metadata:{}});if(!p.ok){let a;try{a=(c=await p.json())==null?void 0:c.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new ue:new Error(`fetchNameCreditRoute ${p.status}`)}return p.json()}function rn(r,o){const l=fe.from(r.availableAmount),h=fe.from(B).sub(l);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Gt(r.id)}],creditsSignatures:[r.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:h.isNegative()?"0":h.toString(),maxCreditedValue:B}}async function on(r,o={}){const l=tn,x=o.intervalMs??1e4,h=o.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let p=0;p<h;p++){try{const c=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${r}`);if(c.ok){const a=await c.json(),m=(a.status??"pending").toLowerCase(),g=a.fillTx??a.fillTxnRef??null,u=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:u};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:u}}}catch{}p<h-1&&await new Promise(c=>setTimeout(c,x))}return d}async function an(r){const{name:o,identity:l,signer:x}=r,h=r.chainId??W.chainId,d=r.provider??"across",p=(r.beneficiary??await x.getAddress()).toLowerCase();let c=null,a=!1;console.info("[names] register start",{name:o,buyer:p,chainId:h,provider:d});try{const m=await tt(h),g=nn(m);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:m});const u=await sn(l,o,{chainId:h,provider:d});console.info("[names] step 2/6 route fetched",{target:u.externalCall.target,selector:u.externalCall.selector,provider:u.provider,quoteId:u.quoteId});const v=await nt(l,g);if(c=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),fe.from(v.maxCreditedValue).lt(B))throw new Error("Credit under-sized for the name price");const j=rn(v.credit,u);let f;try{f=await Ft({chainId:h,buyer:p,signer:x,args:j})}catch(b){if(!(b instanceof Lt))throw b;f=await Ot(h,j,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ut(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await on(f,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:f};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:o,buyer:p,originConfirmed:a}),m instanceof Ht)return{status:"pending",originTxHash:m.txHash};if(c&&!a&&await st(l,[c]).catch(()=>{}),m instanceof ue)throw m;const g=new Error(Dt(m,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=m,g}}const ln=s.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
inset: 0;
|
|
4
4
|
z-index: 10000;
|
|
@@ -7,7 +7,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
7
7
|
justify-content: center;
|
|
8
8
|
padding: 16px;
|
|
9
9
|
background: rgba(22, 21, 24, 0.55);
|
|
10
|
-
`,
|
|
10
|
+
`,cn=s.div`
|
|
11
11
|
width: 560px;
|
|
12
12
|
max-width: 100%;
|
|
13
13
|
max-height: 92vh;
|
|
@@ -127,17 +127,17 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
127
127
|
height: 22px;
|
|
128
128
|
color: ${t.colors.brandViolet};
|
|
129
129
|
}
|
|
130
|
-
`,
|
|
130
|
+
`,dn=s.div`
|
|
131
131
|
margin-top: 16px;
|
|
132
132
|
padding: 16px;
|
|
133
133
|
border-radius: 12px;
|
|
134
134
|
background: #f2e7fc;
|
|
135
|
-
`,
|
|
135
|
+
`,pn=s.div`
|
|
136
136
|
font-family: ${t.font.sans};
|
|
137
137
|
font-weight: 700;
|
|
138
138
|
font-size: 16px;
|
|
139
139
|
color: ${t.colors.text};
|
|
140
|
-
`,
|
|
140
|
+
`,hn=s.p`
|
|
141
141
|
margin: 8px 0 16px;
|
|
142
142
|
font-family: ${t.font.sans};
|
|
143
143
|
font-size: 14px;
|
|
@@ -148,7 +148,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
148
148
|
font-weight: 700;
|
|
149
149
|
color: ${t.colors.brandViolet};
|
|
150
150
|
}
|
|
151
|
-
`,
|
|
151
|
+
`,xn=s.label`
|
|
152
152
|
display: flex;
|
|
153
153
|
align-items: center;
|
|
154
154
|
gap: 8px;
|
|
@@ -161,7 +161,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
161
161
|
&:focus-within {
|
|
162
162
|
border-color: ${t.colors.magenta};
|
|
163
163
|
}
|
|
164
|
-
`,
|
|
164
|
+
`,mn=s.span`
|
|
165
165
|
flex: none;
|
|
166
166
|
font-family: ${t.font.sans};
|
|
167
167
|
font-size: 18px;
|
|
@@ -181,12 +181,12 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
181
181
|
color: ${t.colors.muted2};
|
|
182
182
|
font-weight: 400;
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
184
|
+
`,un=s.span`
|
|
185
185
|
flex: none;
|
|
186
186
|
font-family: ${t.font.sans};
|
|
187
187
|
font-size: 16px;
|
|
188
188
|
color: ${t.colors.muted2};
|
|
189
|
-
`,
|
|
189
|
+
`,_e=s.button`
|
|
190
190
|
margin-top: 16px;
|
|
191
191
|
width: 100%;
|
|
192
192
|
height: 52px;
|
|
@@ -213,27 +213,27 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
213
213
|
background: #ddc7ec;
|
|
214
214
|
color: #f4ecfa;
|
|
215
215
|
}
|
|
216
|
-
`,
|
|
216
|
+
`,gn=s.div`
|
|
217
217
|
display: flex;
|
|
218
218
|
flex-direction: column;
|
|
219
219
|
align-items: flex-start;
|
|
220
220
|
gap: 20px;
|
|
221
221
|
padding: 32px 0 8px;
|
|
222
|
-
`,
|
|
222
|
+
`,bn=s.img`
|
|
223
223
|
align-self: center;
|
|
224
224
|
width: 56px;
|
|
225
225
|
height: 56px;
|
|
226
|
-
`,
|
|
226
|
+
`,yn=s.div`
|
|
227
227
|
font-family: ${t.font.sans};
|
|
228
228
|
font-weight: 700;
|
|
229
229
|
font-size: 18px;
|
|
230
230
|
color: ${t.colors.text};
|
|
231
|
-
`,
|
|
231
|
+
`,wn=s.div`
|
|
232
232
|
display: flex;
|
|
233
233
|
align-items: center;
|
|
234
234
|
gap: 12px;
|
|
235
235
|
width: 100%;
|
|
236
|
-
`,
|
|
236
|
+
`,jn=s.div`
|
|
237
237
|
flex: 1;
|
|
238
238
|
height: 8px;
|
|
239
239
|
border-radius: 999px;
|
|
@@ -257,12 +257,12 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
257
257
|
transform: translateX(320%);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
`,
|
|
260
|
+
`,vn=s.span`
|
|
261
261
|
flex: none;
|
|
262
262
|
font-family: ${t.font.sans};
|
|
263
263
|
font-size: 14px;
|
|
264
264
|
color: ${t.colors.muted};
|
|
265
|
-
|
|
265
|
+
`,$n=s.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
flex-direction: column;
|
|
268
268
|
align-items: center;
|
|
@@ -271,7 +271,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
271
271
|
border-radius: 12px;
|
|
272
272
|
background: #e2f5ea;
|
|
273
273
|
text-align: center;
|
|
274
|
-
|
|
274
|
+
`,Cn=s.div`
|
|
275
275
|
display: grid;
|
|
276
276
|
place-items: center;
|
|
277
277
|
width: 56px;
|
|
@@ -284,7 +284,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
284
284
|
width: 30px;
|
|
285
285
|
height: 30px;
|
|
286
286
|
}
|
|
287
|
-
`,
|
|
287
|
+
`,kn=s.p`
|
|
288
288
|
margin: 0;
|
|
289
289
|
font-family: ${t.font.sans};
|
|
290
290
|
font-size: 16px;
|
|
@@ -323,7 +323,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
323
323
|
outline: 2px solid ${t.colors.accent};
|
|
324
324
|
outline-offset: 2px;
|
|
325
325
|
}
|
|
326
|
-
`,
|
|
326
|
+
`,Sn=s.a`
|
|
327
327
|
flex: 1;
|
|
328
328
|
display: inline-flex;
|
|
329
329
|
align-items: center;
|
|
@@ -379,10 +379,10 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
379
379
|
color: ${t.colors.accent};
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
`;function
|
|
382
|
+
`;function En({name:r,priceCredits:o,onClose:l}){const{session:x}=Me(),{data:h,isError:d}=ot(x),p=at(),c=Ae(),[a,m]=w.useState("confirm"),[g,u]=w.useState(""),[v,j]=w.useState(null),f=w.useRef(!1),b=g.trim().toLowerCase()===r.toLowerCase(),$=a==="completing",C=o!=null?me(o):"—",k=o==null,E=h==null?void 0:h.credits,M=o!=null&&E!=null?o-E:0,S=M>0,N=k?n("names.priceUnavailable"):S?n("names.insufficientCredits",{credits:me(M)}):null;w.useEffect(()=>{const y=R=>{R.key==="Escape"&&!$&&l()};document.addEventListener("keydown",y);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=_}},[$,l]);async function F(){if(!(!x||!b||k||S||f.current)){f.current=!0,m("completing"),j(null);try{const y=await an({name:r,identity:x.identity,signer:x.signer});Q("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,settlement:y.status}),p.invalidateQueries({queryKey:["usd-balance"]}),p.invalidateQueries({queryKey:["my-assets"]}),m(y.status==="registered"?"success":"pending")}catch(y){Q(pt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:dt(y),purchase_type:"name"}),j(y instanceof ue?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),m("error")}finally{f.current=!1}}}const L=a!=="success"&&a!=="pending",z=lt(x==null?void 0:x.providerType);return e.jsx(ln,{onClick:$?void 0:l,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[L&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:a==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ne,{onClick:l,disabled:$,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ie,{children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:v})]}),e.jsx(_e,{onClick:()=>m("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Tn(r)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(fn,{value:g,onChange:y=>u(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),N?e.jsxs(pe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}):null,e.jsx(_e,{onClick:()=>void F(),disabled:!b||!x||k||S,children:n("names.buyCta")})]})]}),a==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ct,alt:"",width:56,height:56}),e.jsx(yn,{children:z?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),a==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:n("names.pendingHeaderTitle")}),e.jsx(ne,{onClick:l,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{}),e.jsxs(pe,{"data-tone":"info",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ie,{style:{marginTop:20},children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),e.jsx(Re,{children:e.jsx(ze,{onClick:()=>{l(),c("/my-items")},children:n("names.myItems")})})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:n("names.successHeaderTitle")}),e.jsx(ne,{onClick:l,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ie,{style:{marginTop:20},children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),e.jsxs(Re,{children:[e.jsx(ze,{onClick:()=>{l(),c("/my-items")},children:n("names.myItems")}),e.jsx(Sn,{href:W.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Tn(r){return r.replace(/[&<>"']/g,o=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[o])}const _n="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/identity-B4DXDuJP.webp",Rn="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.10.1-31032606668.commit-30914a5/_assets/governance-DnazlIjy.webp",An=s.div`
|
|
383
383
|
width: 100%;
|
|
384
384
|
min-width: 0;
|
|
385
|
-
`,
|
|
385
|
+
`,Mn=s.nav`
|
|
386
386
|
display: flex;
|
|
387
387
|
align-items: center;
|
|
388
388
|
gap: 6px;
|
|
@@ -391,7 +391,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
391
391
|
font-size: 12px;
|
|
392
392
|
line-height: 1;
|
|
393
393
|
color: ${t.colors.muted};
|
|
394
|
-
`,
|
|
394
|
+
`,Nn=s.button`
|
|
395
395
|
border: 0;
|
|
396
396
|
background: none;
|
|
397
397
|
padding: 0;
|
|
@@ -406,10 +406,10 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
406
406
|
outline: 2px solid ${t.colors.accent};
|
|
407
407
|
outline-offset: 2px;
|
|
408
408
|
}
|
|
409
|
-
`,
|
|
409
|
+
`,Pn=s.span`
|
|
410
410
|
font-weight: 700;
|
|
411
411
|
color: ${t.colors.muted};
|
|
412
|
-
`,
|
|
412
|
+
`,Wn=s.div`
|
|
413
413
|
display: flex;
|
|
414
414
|
flex-direction: column;
|
|
415
415
|
gap: 48px;
|
|
@@ -438,12 +438,12 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
438
438
|
padding: 40px 20px;
|
|
439
439
|
gap: 28px;
|
|
440
440
|
}
|
|
441
|
-
`,
|
|
441
|
+
`,Fn=s.div`
|
|
442
442
|
display: flex;
|
|
443
443
|
flex-direction: column;
|
|
444
444
|
align-items: center;
|
|
445
445
|
gap: 12px;
|
|
446
|
-
`,
|
|
446
|
+
`,Ln=s.h1`
|
|
447
447
|
margin: 0;
|
|
448
448
|
font-family: ${t.font.sans};
|
|
449
449
|
font-weight: 600;
|
|
@@ -454,7 +454,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
454
454
|
${t.media.maxWidth("mobile")} {
|
|
455
455
|
font-size: 26px;
|
|
456
456
|
}
|
|
457
|
-
`,
|
|
457
|
+
`,Un=s.p`
|
|
458
458
|
margin: 0;
|
|
459
459
|
max-width: 760px;
|
|
460
460
|
font-family: ${t.font.sans};
|
|
@@ -466,14 +466,14 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
466
466
|
${t.media.maxWidth("mobile")} {
|
|
467
467
|
font-size: 16px;
|
|
468
468
|
}
|
|
469
|
-
`,
|
|
469
|
+
`,Hn=s.div`
|
|
470
470
|
width: min(785px, 100%);
|
|
471
471
|
display: flex;
|
|
472
472
|
flex-direction: column;
|
|
473
473
|
gap: 12px;
|
|
474
|
-
`,
|
|
474
|
+
`,On=s.div`
|
|
475
475
|
position: relative;
|
|
476
|
-
`,
|
|
476
|
+
`,Gn=s("div",Zt("invalid"))`
|
|
477
477
|
display: flex;
|
|
478
478
|
align-items: center;
|
|
479
479
|
gap: 8px;
|
|
@@ -504,7 +504,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
504
504
|
${t.media.maxWidth("mobile")} {
|
|
505
505
|
font-size: 16px;
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
507
|
+
`,qn=s.div`
|
|
508
508
|
position: absolute;
|
|
509
509
|
top: calc(100% + 8px);
|
|
510
510
|
left: 0;
|
|
@@ -529,7 +529,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
529
529
|
align-items: flex-start;
|
|
530
530
|
flex-wrap: wrap;
|
|
531
531
|
}
|
|
532
|
-
`,
|
|
532
|
+
`,Vn=s.a`
|
|
533
533
|
display: inline-flex;
|
|
534
534
|
align-items: center;
|
|
535
535
|
gap: 2px;
|
|
@@ -543,7 +543,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
543
543
|
${t.media.maxWidth("mobile")} {
|
|
544
544
|
margin-left: 0;
|
|
545
545
|
}
|
|
546
|
-
`,
|
|
546
|
+
`,Zn=s.label`
|
|
547
547
|
flex: 1;
|
|
548
548
|
min-width: 0;
|
|
549
549
|
display: flex;
|
|
@@ -551,7 +551,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
551
551
|
gap: 0;
|
|
552
552
|
cursor: text;
|
|
553
553
|
overflow: hidden;
|
|
554
|
-
`,
|
|
554
|
+
`,Kn=s.span`
|
|
555
555
|
flex: none;
|
|
556
556
|
margin-right: 8px;
|
|
557
557
|
font-family: ${t.font.sans};
|
|
@@ -585,7 +585,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
585
585
|
${t.media.maxWidth("mobile")} {
|
|
586
586
|
font-size: 16px;
|
|
587
587
|
}
|
|
588
|
-
`,
|
|
588
|
+
`,Qn=s.span`
|
|
589
589
|
flex: none;
|
|
590
590
|
margin-left: 2px;
|
|
591
591
|
font-family: ${t.font.sans};
|
|
@@ -597,7 +597,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
597
597
|
${t.media.maxWidth("mobile")} {
|
|
598
598
|
font-size: 16px;
|
|
599
599
|
}
|
|
600
|
-
`,
|
|
600
|
+
`,Xn=s.span`
|
|
601
601
|
flex: none;
|
|
602
602
|
font-family: ${t.font.sans};
|
|
603
603
|
font-size: 13px;
|
|
@@ -639,7 +639,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
639
639
|
${t.media.maxWidth("mobile")} {
|
|
640
640
|
display: none;
|
|
641
641
|
}
|
|
642
|
-
`,
|
|
642
|
+
`,Yn=s(Fe)`
|
|
643
643
|
display: none;
|
|
644
644
|
|
|
645
645
|
${t.media.maxWidth("mobile")} {
|
|
@@ -648,7 +648,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
648
648
|
height: 48px;
|
|
649
649
|
border-radius: 12px;
|
|
650
650
|
}
|
|
651
|
-
`,
|
|
651
|
+
`,es=s.span`
|
|
652
652
|
display: inline-flex;
|
|
653
653
|
align-items: center;
|
|
654
654
|
gap: 4px;
|
|
@@ -677,7 +677,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
677
677
|
height: 16px;
|
|
678
678
|
flex: none;
|
|
679
679
|
}
|
|
680
|
-
`,
|
|
680
|
+
`,ts=s.section`
|
|
681
681
|
display: flex;
|
|
682
682
|
flex-direction: column;
|
|
683
683
|
gap: 48px;
|
|
@@ -687,12 +687,12 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
687
687
|
gap: 32px;
|
|
688
688
|
padding: 0 20px;
|
|
689
689
|
}
|
|
690
|
-
`,
|
|
690
|
+
`,ns=s.div`
|
|
691
691
|
display: flex;
|
|
692
692
|
flex-direction: column;
|
|
693
693
|
align-items: center;
|
|
694
694
|
gap: 24px;
|
|
695
|
-
`,
|
|
695
|
+
`,ss=s.h2`
|
|
696
696
|
margin: 0;
|
|
697
697
|
text-align: center;
|
|
698
698
|
font-family: ${t.font.sans};
|
|
@@ -704,7 +704,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
704
704
|
${t.media.maxWidth("mobile")} {
|
|
705
705
|
font-size: 22px;
|
|
706
706
|
}
|
|
707
|
-
`,
|
|
707
|
+
`,rs=s.p`
|
|
708
708
|
margin: 0;
|
|
709
709
|
max-width: 907px;
|
|
710
710
|
text-align: center;
|
|
@@ -717,7 +717,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
717
717
|
${t.media.maxWidth("mobile")} {
|
|
718
718
|
font-size: 16px;
|
|
719
719
|
}
|
|
720
|
-
`,
|
|
720
|
+
`,is=s.div`
|
|
721
721
|
display: grid;
|
|
722
722
|
grid-template-columns: repeat(4, 1fr);
|
|
723
723
|
gap: 24px;
|
|
@@ -749,7 +749,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
749
749
|
flex-direction: column;
|
|
750
750
|
gap: 6px;
|
|
751
751
|
padding: 12px 16px;
|
|
752
|
-
`,
|
|
752
|
+
`,K=s.h3`
|
|
753
753
|
margin: 0;
|
|
754
754
|
font-family: ${t.font.sans};
|
|
755
755
|
font-weight: 700;
|
|
@@ -757,14 +757,14 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
757
757
|
line-height: 1.57;
|
|
758
758
|
text-transform: uppercase;
|
|
759
759
|
color: ${t.colors.text};
|
|
760
|
-
`,
|
|
760
|
+
`,J=s.p`
|
|
761
761
|
margin: 0;
|
|
762
762
|
font-family: ${t.font.sans};
|
|
763
763
|
font-weight: 400;
|
|
764
764
|
font-size: 14px;
|
|
765
765
|
line-height: 1.57;
|
|
766
766
|
color: ${t.colors.text};
|
|
767
|
-
`,
|
|
767
|
+
`,os=s.span`
|
|
768
768
|
font-weight: 600;
|
|
769
769
|
color: ${t.colors.accent};
|
|
770
770
|
`,Ie=s.a`
|
|
@@ -788,7 +788,7 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
788
788
|
width: 13px;
|
|
789
789
|
height: 13px;
|
|
790
790
|
}
|
|
791
|
-
`,
|
|
791
|
+
`,as=s.span`
|
|
792
792
|
position: absolute;
|
|
793
793
|
width: 1px;
|
|
794
794
|
height: 1px;
|
|
@@ -798,4 +798,4 @@ import{b as Ae,r as w,j as e,u as Je}from"./react-BYHuwl8r.js";import{u as Ke}fr
|
|
|
798
798
|
clip: rect(0, 0, 0, 0);
|
|
799
799
|
white-space: nowrap;
|
|
800
800
|
border: 0;
|
|
801
|
-
`,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(r){const o=typeof window<"u"?window.location.hostname:"";return`${o.endsWith("decentraland.org")?"https://decentraland.org":o.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(r)}`}function ds({onBack:r}){Ne({title:n("seo.names.title"),description:n("seo.names.description")});const{session:o,signIn:l}=Me(),{data:x}=Pe(),h=x?Be(W,x):null,[c,p]=w.useState(""),[d,a]=w.useState("idle"),[f,g]=w.useState(!1),u=w.useRef(null),[v,j]=w.useState(void 0);w.useLayoutEffect(()=>{u.current&&j(u.current.offsetWidth)},[c]),w.useEffect(()=>{if(!Ee(c).ok){a(c.length===0?"idle":"invalid");return}a("checking");const E=new AbortController,M=setTimeout(()=>{(async()=>{try{const S=await Yt(c,{signal:E.signal});a(S)}catch(S){if((S==null?void 0:S.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(M),E.abort()}},[c]);const m=Ee(c),b=m.ok&&(d==="available"||d==="error");function $(){if(b){if(!o){l();return}g(!0)}}const C=e.jsxs(e.Fragment,{children:[n("names.claim"),h!=null?e.jsxs(Yn,{children:[e.jsx(A,{}),fe(h)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Mn,{onClick:r,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Nn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Bn,{children:[e.jsxs(Wn,{children:[e.jsx(Fn,{children:n("names.heroTitle")}),e.jsx(Ln,{children:n("names.heroSubtitle")})]}),e.jsxs(Un,{children:[e.jsxs(Hn,{children:[e.jsxs(On,{invalid:d==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Zn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:c,onChange:k=>p(Kt(k.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:v!=null?`${v}px`:void 0}}),e.jsx(Dn,{ref:u,"aria-hidden":!0,children:c||n("names.inputPlaceholder")}),e.jsx(Kn,{children:n("names.suffix")})]}),c.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[c.length,"/",X]}):null,e.jsx(Fe,{onClick:$,disabled:!b,"data-testid":"names-claim",children:C})]}),d==="taken"?e.jsxs(Gn,{role:"status","data-testid":"names-taken",children:[e.jsx(_,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(qn,{href:cs(c),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(_,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:$,disabled:!b,children:C}),d==="checking"?e.jsx(he,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):d==="error"?e.jsx(he,{tone:"muted",role:"status",children:n("names.checkError")}):d==="invalid"&&!m.ok&&m.reason==="too-short"?e.jsx(he,{tone:"muted",role:"status",children:n("names.tooShort",{min:We})}):null,e.jsx(os,{role:"status","aria-live":"polite",children:d==="available"?n("names.available",{name:c}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:n("names.whyTitle")}),e.jsx(ss,{children:n("names.whyIntro")})]}),e.jsxs(rs,{children:[e.jsxs(q,{children:[e.jsx(V,{src:_n,alt:""}),e.jsxs(Z,{children:[e.jsx(J,{children:n("names.why1Title")}),e.jsx(K,{children:n("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Tn,alt:""}),e.jsxs(Z,{children:[e.jsx(J,{children:n("names.why2Title")}),e.jsxs(K,{children:[n("names.why2")," ",e.jsx(is,{children:n("names.why2Address")})]}),e.jsxs(Ie,{href:as,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(_,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Rn,alt:""}),e.jsxs(Z,{children:[e.jsx(J,{children:n("names.why3Title")}),e.jsx(K,{children:n("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:zn,alt:""}),e.jsxs(Z,{children:[e.jsx(J,{children:n("names.why4Title")}),e.jsx(K,{children:n("names.why4")}),e.jsxs(Ie,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(_,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),f?e.jsx(Sn,{name:c,priceCredits:h,onClose:()=>g(!1)}):null]})}const ps="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",xe=48,hs=["all","on_sale","not_for_sale"];function Is(){const[r]=Je(),o=Ae(),l=(r.get("q")??"").trim().toLowerCase(),x=(r.get("q")??"").trim();Ne({title:x?n("seo.collectibles.searchTitle",{query:x}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const h=w.useMemo(()=>({category:l?"all":"wearable",status:"on_sale",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[l]),[c,p]=Ke(h),{subCategory:d,rarities:a,priceMin:f,priceMax:g,smart:u,sort:v}=c,j=c.category,m=hs.includes(c.status)?c.status:"on_sale",[b,$]=w.useState(!1);w.useEffect(()=>{if(!b)return;const i=O=>{O.key==="Escape"&&$(!1)};document.addEventListener("keydown",i);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=I}},[b]);const C=m==="on_sale",k=f&&!Number.isNaN(Number(f))?Number(f):void 0,E=g&&!Number.isNaN(Number(g))?Number(g):void 0,M=lt(),S=d?At[d]:void 0,N=(Se.find(i=>i.key===v)??Se[0]).server,F={category:j,rarities:a.length?a:void 0,wearableCategories:S,minPriceCredits:k,maxPriceCredits:E,search:l||void 0,sortBy:N,isSmart:u||void 0,onSale:!0,listingType:M?void 0:"primary"},L={category:j,rarities:a.length?a:void 0,wearableCategories:S,search:l||void 0,sortBy:N,isWearableSmart:u||void 0,isOnSale:m==="not_for_sale"?!1:void 0},{items:z,total:y,isLoading:T,isPlaceholderData:R,error:ge,hasNextPage:Le,isFetchingNextPage:be,isFetchNextPageError:Ue,fetchNextPage:He}=Nt(C?["shop-items",F]:["catalog-items",L],i=>C?dt({...F,first:xe,skip:i}):pt({...L,first:xe,skip:i}),{enabled:j!=="names"}),U=y,{data:ye,isError:Oe,isPending:De}=Pe(),Ge=i=>ye&&i.manaWei?Be(i.manaWei,ye):null,qe=C&&De&&z.some(i=>i.source==="legacy"),we=T||R||qe,Ve=T?15:Math.min(Math.max(z.length,1),xe),je=w.useRef(null);w.useEffect(()=>{T||R||!l||je.current===l||(je.current=l,Q("Shop Searched",{query:l,result_count:U}))},[l,T,R,U]);const H=w.useRef("__init__");w.useEffect(()=>{if(T||R)return;const i=JSON.stringify({category:j,subCategory:d,rarities:a,min:k,max:E,sort:v,status:m,smart:u});if(H.current==="__init__"||H.current===i){H.current=i;return}H.current=i,Q("Shop Applied Filter",{filters:{category:j,sub_category:d,rarities:a,min_price_credits:k??null,max_price_credits:E??null,status:m,smart:u,sort:v},result_count:U})},[j,d,a,k,E,v,m,u,T,R,U]);function ve(i){p({category:i,subCategory:null})}function $e(i){p({status:i})}function Ce(i){p({rarities:a.includes(i)?a.filter(I=>I!==i):[...a,i]})}function Ze(){p(h)}const P=[];(k!=null||E!=null)&&P.push({key:"price",label:n("filter.price"),onRemove:()=>{p({priceMin:"",priceMax:""})}});for(const i of zt)a.includes(i)&&P.push({key:`rarity-${i}`,label:ct(i),onRemove:()=>Ce(i)});return u&&P.push({key:"smart",label:n("filter.smart"),onRemove:()=>p({smart:!1})}),m!=="on_sale"&&P.push({key:"status",label:m==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>$e("on_sale")}),e.jsxs(ht,{"data-testid":"browse",children:[j!=="names"&&e.jsxs(e.Fragment,{children:[b?e.jsx(xt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(ft,{"data-open":b||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(mt,{children:[e.jsx(ut,{children:n("assets.filters")}),e.jsx(gt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(bt,{children:e.jsx(yt,{category:j,subCategory:d,onCategory:ve,onSub:i=>p({subCategory:i}),priceMin:f,priceMax:g,onPriceMin:i=>p({priceMin:i}),onPriceMax:i=>p({priceMax:i}),rarities:a,onToggleRarity:Ce,status:m,onStatus:$e,smart:u,onSmart:i=>p({smart:i})})}),e.jsx(wt,{children:e.jsx(jt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(vt,{children:j==="names"?e.jsx(ds,{onBack:()=>ve("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(It,{sort:v,onSort:i=>p({sort:i}),total:y,loading:T||R,query:l,onOpenFilters:()=>$(!0),chips:P,onClearChips:Ze}),Oe&&C&&z.some(i=>i.source==="legacy")?e.jsx($t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ge?e.jsx(Pt,{message:n("assets.loadError"),testId:"browse-error"}):null,!we&&z.length===0&&!ge?e.jsxs(Ct,{"data-testid":"browse-empty",children:[e.jsx(kt,{src:ps,alt:""}),e.jsxs(St,{children:[e.jsx(Et,{children:n("assets.empty.title")}),e.jsx(_t,{children:x?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:x}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(Rt,{type:"button",onClick:()=>o("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Zt,{"data-testid":"grid",children:we?e.jsx(ke,{count:Ve}):e.jsxs(e.Fragment,{children:[z.map(i=>{if(!C)return e.jsx(D,{item:i,mode:"view"},G(i));const I=i;if(I.source!=="legacy")return e.jsx(D,{item:i},G(i));const O=Ge(I);return O==null?e.jsx(D,{item:i,mode:"view"},G(i)):e.jsx(D,{item:{...I,priceCredits:O}},G(i))}),be?e.jsx(ke,{count:6}):null]})}),e.jsx(Mt,{hasNextPage:Le,isFetching:be,isError:Ue,onLoadMore:()=>void He()})]})]})})]})}export{Is as Assets};
|
|
801
|
+
`,ls="https://docs.decentraland.org/creator/worlds/about/",cs="https://governance.decentraland.org";function ds(r){const o=typeof window<"u"?window.location.hostname:"";return`${o.endsWith("decentraland.org")?"https://decentraland.org":o.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(r)}`}function ps({onBack:r}){Ne({title:n("seo.names.title"),description:n("seo.names.description")});const{session:o,signIn:l}=Me(),{data:x}=Pe(),h=x?We(B,x):null,[d,p]=w.useState(""),[c,a]=w.useState("idle"),[m,g]=w.useState(!1),u=w.useRef(null),[v,j]=w.useState(void 0);w.useLayoutEffect(()=>{u.current&&j(u.current.offsetWidth)},[d]),w.useEffect(()=>{if(!Ee(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const E=new AbortController,M=setTimeout(()=>{(async()=>{try{const S=await en(d,{signal:E.signal});a(S)}catch(S){if((S==null?void 0:S.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(M),E.abort()}},[d]);const f=Ee(d),b=f.ok&&(c==="available"||c==="error");function $(){if(b){if(!o){l();return}g(!0)}}const C=e.jsxs(e.Fragment,{children:[n("names.claim"),h!=null?e.jsxs(es,{children:[e.jsx(A,{}),me(h)]}):null]});return e.jsxs(An,{"data-testid":"names-page",children:[e.jsxs(Mn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:r,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Pn,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsxs(Fn,{children:[e.jsx(Ln,{children:n("names.heroTitle")}),e.jsx(Un,{children:n("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{invalid:c==="taken",children:[e.jsxs(Zn,{children:[e.jsx(Kn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:k=>p(Qt(k.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:v!=null?`${v}px`:void 0}}),e.jsx(Dn,{ref:u,"aria-hidden":!0,children:d||n("names.inputPlaceholder")}),e.jsx(Qn,{children:n("names.suffix")})]}),d.length>0?e.jsxs(Xn,{"aria-hidden":!0,children:[d.length,"/",X]}):null,e.jsx(Fe,{onClick:$,disabled:!b,"data-testid":"names-claim",children:C})]}),c==="taken"?e.jsxs(qn,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Vn,{href:ds(d),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Yn,{onClick:$,disabled:!b,children:C}),c==="checking"?e.jsx(he,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):c==="error"?e.jsx(he,{tone:"muted",role:"status",children:n("names.checkError")}):c==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(he,{tone:"muted",role:"status",children:n("names.tooShort",{min:Be})}):null,e.jsx(as,{role:"status","aria-live":"polite",children:c==="available"?n("names.available",{name:d}):""})]})]}),e.jsxs(ts,{children:[e.jsxs(ns,{children:[e.jsx(ss,{children:n("names.whyTitle")}),e.jsx(rs,{children:n("names.whyIntro")})]}),e.jsxs(is,{children:[e.jsxs(q,{children:[e.jsx(V,{src:_n,alt:""}),e.jsxs(Z,{children:[e.jsx(K,{children:n("names.why1Title")}),e.jsx(J,{children:n("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Rn,alt:""}),e.jsxs(Z,{children:[e.jsx(K,{children:n("names.why2Title")}),e.jsxs(J,{children:[n("names.why2")," ",e.jsx(os,{children:n("names.why2Address")})]}),e.jsxs(Ie,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:zn,alt:""}),e.jsxs(Z,{children:[e.jsx(K,{children:n("names.why3Title")}),e.jsx(J,{children:n("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:In,alt:""}),e.jsxs(Z,{children:[e.jsx(K,{children:n("names.why4Title")}),e.jsx(J,{children:n("names.why4")}),e.jsxs(Ie,{href:cs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),m?e.jsx(En,{name:d,priceCredits:h,onClose:()=>g(!1)}):null]})}const hs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",xe=48,xs=["all","on_sale","not_for_sale"];function Ms(){const[r]=Ke(),o=Ae(),l=(r.get("q")??"").trim().toLowerCase(),x=(r.get("q")??"").trim();Ne({title:x?n("seo.collectibles.searchTitle",{query:x}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const h=w.useMemo(()=>({category:"all",status:"on_sale",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[d,p]=Je(h),{subCategory:c,rarities:a,priceMin:m,priceMax:g,smart:u,sort:v}=d,j=d.category,f=xs.includes(d.status)?d.status:"on_sale";Qe(`${j}:${c??""}`);const[b,$]=w.useState(!1);w.useEffect(()=>{if(!b)return;const i=O=>{O.key==="Escape"&&$(!1)};document.addEventListener("keydown",i);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=I}},[b]);const C=f==="on_sale",k=m&&!Number.isNaN(Number(m))?Number(m):void 0,E=g&&!Number.isNaN(Number(g))?Number(g):void 0,M=ht(),S=c?et[c]:void 0,N=(ke.find(i=>i.key===v)??ke[0]).server,F={category:j,rarities:a.length?a:void 0,wearableCategories:S,minPriceCredits:k,maxPriceCredits:E,search:l||void 0,sortBy:N,isSmart:u||void 0,onSale:!0,listingType:M?void 0:"primary"},L={category:j,rarities:a.length?a:void 0,wearableCategories:S,search:l||void 0,sortBy:N,isWearableSmart:u||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:z,total:y,isLoading:_,isPlaceholderData:R,error:ge,hasNextPage:Le,isFetchingNextPage:be,isFetchNextPageError:Ue,fetchNextPage:He}=Pt(C?["shop-items",F]:["catalog-items",L],i=>C?mt({...F,first:xe,skip:i}):ft({...L,first:xe,skip:i}),{enabled:j!=="names"}),U=y,{data:ye,isError:Oe,isPending:Ge}=Pe(),De=i=>ye&&i.manaWei?We(i.manaWei,ye):null,qe=C&&Ge&&z.some(i=>i.source==="legacy"),we=_||R||qe,Ve=_?15:Math.min(Math.max(z.length,1),xe),je=w.useRef(null);w.useEffect(()=>{_||R||!l||je.current===l||(je.current=l,Q("Shop Searched",{query:l,result_count:U}))},[l,_,R,U]);const H=w.useRef("__init__");w.useEffect(()=>{if(_||R)return;const i=JSON.stringify({category:j,subCategory:c,rarities:a,min:k,max:E,sort:v,status:f,smart:u});if(H.current==="__init__"||H.current===i){H.current=i;return}H.current=i,Q("Shop Applied Filter",{filters:{category:j,sub_category:c,rarities:a,min_price_credits:k??null,max_price_credits:E??null,status:f,smart:u,sort:v},result_count:U})},[j,c,a,k,E,v,f,u,_,R,U]);function ve(i){p({category:i,subCategory:null})}function $e(i){p({status:i})}function Ce(i){p({rarities:a.includes(i)?a.filter(I=>I!==i):[...a,i]})}function Ze(){p(h)}const P=[];(k!=null||E!=null)&&P.push({key:"price",label:n("filter.price"),onRemove:()=>{p({priceMin:"",priceMax:""})}});for(const i of Xe)a.includes(i)&&P.push({key:`rarity-${i}`,label:xt(i),onRemove:()=>Ce(i)});return u&&P.push({key:"smart",label:n("filter.smart"),onRemove:()=>p({smart:!1})}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>$e("on_sale")}),e.jsxs(ut,{"data-testid":"browse",children:[j!=="names"&&e.jsxs(e.Fragment,{children:[b?e.jsx(gt,{onClick:()=>$(!1),"aria-hidden":!0}):null,e.jsxs(bt,{"data-open":b||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(yt,{children:[e.jsx(wt,{children:n("assets.filters")}),e.jsx(jt,{onClick:()=>$(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(vt,{children:e.jsx($t,{category:j,subCategory:c,onCategory:ve,onSub:i=>p({subCategory:i}),priceMin:m,priceMax:g,onPriceMin:i=>p({priceMin:i}),onPriceMax:i=>p({priceMax:i}),rarities:a,onToggleRarity:Ce,status:f,onStatus:$e,smart:u,onSmart:i=>p({smart:i})})}),e.jsx(Ct,{children:e.jsx(kt,{type:"button",onClick:()=>$(!1),children:n("assets.showItems")})})]})]}),e.jsx(St,{children:j==="names"?e.jsx(ps,{onBack:()=>ve("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Ye,{sort:v,onSort:i=>p({sort:i}),total:y,loading:_||R,query:l,onOpenFilters:()=>$(!0),chips:P,onClearChips:Ze}),Oe&&C&&z.some(i=>i.source==="legacy")?e.jsx(Et,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,ge?e.jsx(Wt,{message:n("assets.loadError"),testId:"browse-error"}):null,!we&&z.length===0&&!ge?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(_t,{src:hs,alt:""}),e.jsxs(Rt,{children:[e.jsx(zt,{children:n("assets.empty.title")}),e.jsx(It,{children:x?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:x}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(At,{children:e.jsx(Mt,{type:"button",onClick:()=>o("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{"data-testid":"grid",children:we?e.jsx(Se,{count:Ve}):e.jsxs(e.Fragment,{children:[z.map(i=>{if(!C)return e.jsx(G,{item:i,mode:"view"},D(i));const I=i;if(I.source!=="legacy")return e.jsx(G,{item:i},D(i));const O=De(I);return O==null?e.jsx(G,{item:i,mode:"view"},D(i)):e.jsx(G,{item:{...I,priceCredits:O}},D(i))}),be?e.jsx(Se,{count:6}):null]})}),e.jsx(Nt,{hasNextPage:Le,isFetching:be,isError:Ue,onLoadMore:()=>void He()})]})]})})]})}export{Ms as Assets};
|