@dcl/shop 0.1.0-30275838080.commit-dc84870 → 0.1.0-30277401547.commit-e877307
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-_qlXQij1.js +287 -0
- package/assets/{AnimatedBackground-xHNygKQ8.js → AnimatedBackground-DO49gSw8.js} +1 -1
- package/assets/Assets-D-VpkQ1l.js +787 -0
- package/assets/{Assets.styles-DvPvkguW.js → Assets.styles-BZMkOQeI.js} +94 -21
- package/assets/Authorizations-BFWG3QA_.js +182 -0
- package/assets/{Button-auVihOkI.js → Button-DvhW1Z1S.js} +3 -3
- package/assets/Cart-C_kThny7.css +1 -0
- package/assets/Cart-Cz7NK8QL.js +1 -0
- package/assets/{CircularProgress-DFdK37rG.js → CircularProgress-BmwVvF17.js} +3 -3
- package/assets/{Collection-B3vEoxu6.js → Collection-Bc2CvIur.js} +2 -2
- package/assets/CollectionCarousel-DEYFBykF.js +292 -0
- package/assets/{Creator-YS98HebA.js → Creator-7vyVsWtE.js} +1 -1
- package/assets/{ExchangeController-BDF-2GeF.js → ExchangeController-icK8vQc1.js} +1 -1
- package/assets/GetCredits-BE-bIUdj.js +611 -0
- package/assets/{HelpersUtil-pH82j1ap.js → HelpersUtil-C_aV_Y-W.js} +1 -1
- package/assets/ImportListings-CgB7Xjb_.css +1 -0
- package/assets/{ImportListings-D5NXWizQ.js → ImportListings-CusN2RYj.js} +2 -2
- package/assets/{ItemDetail-DSWLL-Uv.css → ItemDetail-CkmPrObF.css} +1 -1
- package/assets/ItemDetail-blewhWwg.js +2406 -0
- package/assets/{LoadMore-C2IGYfn5.js → LoadMore-C2uaqP2N.js} +1 -1
- package/assets/{MarketCheckout-BF6QzOp6.js → MarketCheckout-CW6mGgHt.js} +1 -1
- package/assets/{MenuList-CuKsDFTR.js → MenuList-mbP1RxaG.js} +2 -2
- package/assets/{MyAssets-DzPtnmU-.js → MyAssets-HcHA9d8L.js} +4 -4
- package/assets/MyFavorites-DkEAv96J.js +1 -0
- package/assets/{NotFound-C6fJPmtm.js → NotFound-B2W2MHR8.js} +1 -1
- package/assets/NotificationsBell-BEAvIZcq.js +34 -0
- package/assets/{StoreSettings-_eAoEzML.js → StoreSettings-CGc7i0kZ.js} +3 -3
- package/assets/{Success-Bx8rXLT9.js → Success-5LiVLOny.js} +2 -2
- package/assets/{SwapController-CxLE_1Gs.js → SwapController-BZT-uJE0.js} +1 -1
- package/assets/{Tooltip-CTKg0lSi.js → Tooltip-V9fXstBY.js} +1 -1
- package/assets/TradeService-D9nuCaGq.js +1 -0
- package/assets/{W3MFrameProviderSingleton-B2IDULyh.js → W3MFrameProviderSingleton-Ccq1reIt.js} +3 -3
- package/assets/{WebCryptoP256-wzk7delV.js → WebCryptoP256-CrgJppag.js} +1 -1
- package/assets/authorizations-t9AL68YM.js +1 -0
- package/assets/{basic-Ww-Goaw6.js → basic-BIbSgqQe.js} +1 -1
- package/assets/{biconomy-B_JhK1qV.js → biconomy-JEnDnFaz.js} +1 -1
- package/assets/{builder-AyiZYpZU.js → builder-uUlDA8Em.js} +1 -1
- package/assets/buy-84sizoxr.js +1 -0
- package/assets/buy-gasless-oF_YJX_W.js +1 -0
- package/assets/{cart-checkout-CWNsZ2Kj.js → cart-checkout-K77UDHy3.js} +1 -1
- package/assets/{categories-BtWBqb3o.js → categories-BwvbYi6M.js} +6 -6
- package/assets/categories-YFBLpDYC.css +1 -0
- package/assets/{ccip-CqHKhzd2.js → ccip-5L0bsS_C.js} +1 -1
- package/assets/{ccip-BjXLypPq.js → ccip-wypw12me.js} +1 -1
- package/assets/{collection-DOvX-TK6.js → collection-D7HQMUIe.js} +1 -1
- package/assets/{controller-C7WZ94lQ.js → controller-Cwg1NxXB.js} +2 -2
- package/assets/{core-DxTrqfX4.js → core-3ZRiSdvl.js} +4 -4
- package/assets/{custom-4udkoSO3.js → custom-BVE_f5dD.js} +1 -1
- package/assets/{data-capture-DDVUgHnH.js → data-capture-BRhsLQVv.js} +1 -1
- package/assets/{email-Csl1ng9Z.js → email-CldXoMar.js} +1 -1
- package/assets/{embedded-wallet-BkYPvh0b.js → embedded-wallet-vSjh73AM.js} +1 -1
- package/assets/{emotion-styled.browser.esm-Cdq1r4Bx.js → emotion-styled.browser.esm-vQZV14Nf.js} +1 -1
- package/assets/{engine-D35Ks53W.js → engine-BPP9EW4Q.js} +1 -1
- package/assets/{errors-DuOi3T0l.js → errors-D-hio89k.js} +1 -1
- package/assets/{estimate-l1-fee-Di371MAc.js → estimate-l1-fee-BLZxmPJY.js} +1 -1
- package/assets/{execute-TUXY08B1.js → execute-cH8V-8nL.js} +2 -2
- package/assets/{features-B8cziiif.js → features-CJ1tq5LL.js} +1 -1
- package/assets/{fetchTokenMetadata-BpxdUfTL.js → fetchTokenMetadata-hD4VNXHw.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-B-M4E9jS.js → get-ecosystem-wallet-info-3DZHpSG2.js} +1 -1
- package/assets/{getBalance-Bifizyr6.js → getBalance-vjJ5CXDC.js} +1 -1
- package/assets/{getNFT-DF6Vq2zI.js → getNFT-BTjIkFXY.js} +1 -1
- package/assets/{getNFT-BdLG614g.js → getNFT-D8HIjTde.js} +1 -1
- package/assets/{getThemeProps-DxJMDPi7.js → getThemeProps-qmqFWvou.js} +1 -1
- package/assets/governance-DnazlIjy.webp +0 -0
- package/assets/{hashTypedData-C_DXc5T4.js → hashTypedData-BrvDnrgK.js} +1 -1
- package/assets/{hashTypedData-CCVnwMeq.js → hashTypedData-Y2DJnKI9.js} +1 -1
- package/assets/identity-B4DXDuJP.webp +0 -0
- package/assets/{import-Dk9yGfxG.js → import-AgO0v-a5.js} +1 -1
- package/assets/{in-app-9n3fFIsg.js → in-app-C4N5lFwd.js} +1 -1
- package/assets/{in-app-wallet-calls-mZphw4u1.js → in-app-wallet-calls-CMBsSG6j.js} +1 -1
- package/assets/{index-RdnFDXdw.js → index--8tZMj8Y.js} +1 -1
- package/assets/{index-B0_gRdTe.js → index-1cJq3bUz.js} +1 -1
- package/assets/{index-Bpy0DTJn.js → index-B8GAuQX3.js} +3 -3
- package/assets/{index-B5oo797l.js → index-B96cJA0d.js} +1 -1
- package/assets/{index-hgeC0JQZ.js → index-B9AUDrI9.js} +1 -1
- package/assets/index-BFPNYe8x.js +312 -0
- package/assets/{index-BP7gy2xI.js → index-BGTbU_0B.js} +2 -2
- package/assets/{index-DEd7XSCQ.js → index-BKvaZQRw.js} +1 -1
- package/assets/index-BQOr-Vwz.js +4 -0
- package/assets/{index-BuDF20FB.js → index-BQuXaLZX.js} +1 -1
- package/assets/{index-FC51tvWK.js → index-BWgCJZHy.js} +2 -2
- package/assets/{index-DA6wQsaR.js → index-B_jKVCv0.js} +1 -1
- package/assets/{index-Bkrc7UDL.js → index-BcgMkg8Z.js} +1 -1
- package/assets/{index-BAsZQOHh.js → index-BjQNL760.js} +1 -1
- package/assets/{index-CQz4TE_L.js → index-BlBoDOVY.js} +1 -1
- package/assets/{index-BcCAXEd4.js → index-C-2OENmH.js} +1 -1
- package/assets/{index-CxqiofWy.js → index-C7UEmKEb.js} +3 -3
- package/assets/{index-BwPtVV-b.js → index-C7gHM4wY.js} +1 -1
- package/assets/{index-swIqjzKr.js → index-C8Ua1g52.js} +1 -1
- package/assets/{index-DJ5U21fD.js → index-CI-UnS2-.js} +1 -1
- package/assets/{index-CmPocwN2.js → index-CV39-lnY.js} +1 -1
- package/assets/{index-DsV2STGW.js → index-CcARyxeB.js} +1 -1
- package/assets/{index-c9PZfSgh.js → index-Ch88GJdD.js} +1 -1
- package/assets/{index-Dxv5sw39.js → index-CiKWw9L3.js} +2 -2
- package/assets/{index-D2txhfvA.js → index-CmhYJKse.js} +1 -1
- package/assets/{index-BloQv0Rh.js → index-CnIGe1GZ.js} +1 -1
- package/assets/index-CsSypry2.js +2 -0
- package/assets/{index-dlaqrKGR.js → index-CvkWE_vF.js} +1 -1
- package/assets/{index-CSIhwKQ9.js → index-D0cj2XsC.js} +1 -1
- package/assets/{index-BWmGCZ1p.js → index-D2-V-v9q.js} +1 -1
- package/assets/{index-cBh2qc74.js → index-D2iLR1Fl.js} +1 -1
- package/assets/{index-892TBSG5.js → index-D96o2dcC.js} +1 -1
- package/assets/{index-D_7jU7Mb.js → index-DCFYAbF4.js} +1 -1
- package/assets/{index-Dp1f5mtU.js → index-DGwFgPlc.js} +1 -1
- package/assets/{index-CqQDAMpz.js → index-DN-OLR2r.js} +3 -3
- package/assets/{index-PtoeaYYN.js → index-DNLIdOOI.js} +1 -1
- package/assets/{index-CLAml9VI.js → index-DZxRXkvI.js} +1 -1
- package/assets/{index-BYcZdsFn.js → index-Dq7pc9gT.js} +1 -1
- package/assets/index-DwufS2l2.css +1 -0
- package/assets/{index-2v1NJpk7.js → index-Dx4EbFs-.js} +1 -1
- package/assets/{index-D2jkAfLH.js → index-Dz0EI57w.js} +1 -1
- package/assets/{index-Clx5uD4u.js → index-E3wxKJyS.js} +1 -1
- package/assets/{index-C_nN_7-B.js → index-HMuz0PhO.js} +1 -1
- package/assets/{index-BrKWcIRW.js → index-Hb4Ys2Tq.js} +1 -1
- package/assets/{index-CpzF0qFB.js → index-Vlg-GpRL.js} +1 -1
- package/assets/{index-B2uGwMji.js → index-YHVXMMbH.js} +1 -1
- package/assets/{index-BuV9hoRm.js → index-bqj_5mVc.js} +1 -1
- package/assets/{index-DFJtxZT4.js → index-jPOTr4Wq.js} +1 -1
- package/assets/{index-CKKx-sxY.js → index-qDfBJZD7.js} +1 -1
- package/assets/{index-Daa0ny5M.js → index-r7kjVwFs.js} +1 -1
- package/assets/{index-B39oAHib.js → index-rjU6xZd8.js} +1 -1
- package/assets/{index-mmQp95p3.js → index-trxbKGTp.js} +1 -1
- package/assets/{index.es-DmMpOWQ3.js → index.es-BKhU-mgO.js} +1 -1
- package/assets/{index.es-CzPV8SvV.js → index.es-DvYEMDdQ.js} +4 -4
- package/assets/{index.es-4BADL1wA.js → index.es-magZDVqq.js} +1 -1
- package/assets/invite-BfwIhP2C.webp +0 -0
- package/assets/{localBatchGatewayRequest-CnnsiZVW.js → localBatchGatewayRequest-CnLOTida.js} +1 -1
- package/assets/mana-rate-BpgRIQMS.js +1 -0
- package/assets/{networks-B7r9ehKQ.js → networks-BNqJWbtk.js} +1 -1
- package/assets/{onramp--n2FS2dI.js → onramp-BYjThZVX.js} +1 -1
- package/assets/{openzeppelin-BbXNToq4.js → openzeppelin-Ba3p7TP4.js} +1 -1
- package/assets/pack-chest-BX_j84xW.webp +0 -0
- package/assets/pack-coins-BDh1ZDbh.webp +0 -0
- package/assets/pack-stacks-D-V2jSHW.webp +0 -0
- package/assets/packs-backdrop-BcXiUPeP.webp +0 -0
- package/assets/{parseNft-BF90Orsn.js → parseNft-CfH76UUp.js} +2 -2
- package/assets/{parseSignature-BaWXPhl1.js → parseSignature-CuL9-kIi.js} +1 -1
- package/assets/{parseSignature-WOPJhKuP.js → parseSignature-D3qKk3uH.js} +3 -3
- package/assets/{passkeys-CkuCBuiV.js → passkeys-DPVQjClK.js} +1 -1
- package/assets/{pay-with-exchange-uDtQzLx-.js → pay-with-exchange-MNFdDdCT.js} +1 -1
- package/assets/{qr-overlay-BEtM3LtR.js → qr-overlay-DDDT3Q-c.js} +1 -1
- package/assets/{receive-DeKeGYSl.js → receive-BU9aVDlN.js} +1 -1
- package/assets/{resolveImplementation-C9MSE3Ke.js → resolveImplementation-OjvLy3T5.js} +1 -1
- package/assets/{rpc-BvqgbCLc.js → rpc-DjbYCcnH.js} +1 -1
- package/assets/{secp256k1-Dr3qxILc.js → secp256k1-Cz5kqQCg.js} +1 -1
- package/assets/{secp256k1-C8vAuzgh.js → secp256k1-X13vDEXt.js} +1 -1
- package/assets/{secp256k1-BzX_Tu6g.js → secp256k1-w4Bql-wA.js} +1 -1
- package/assets/{send-batch-transaction-BuyyUQwP.js → send-batch-transaction-Dxt9X3nj.js} +1 -1
- package/assets/{send-eip712-transaction-q9T6NkCK.js → send-eip712-transaction-DaAvg9MZ.js} +2 -2
- package/assets/{send-gasless-transaction-qGeRIUzg.js → send-gasless-transaction-BquzQGsb.js} +2 -2
- package/assets/{send-DwfQbeLz.js → send-oOaeKGnc.js} +1 -1
- package/assets/{send-transaction-au-YwQq3.js → send-transaction-BHdPLXiu.js} +2 -2
- package/assets/sendMetaTransaction-DNedK3Cr.js +1 -0
- package/assets/{sendRawTransaction-CfnlIDvI.js → sendRawTransaction-DUzMWVdQ.js} +3 -3
- package/assets/{serializeTransaction-DfOWev7O.js → serializeTransaction-BfDfoMJJ.js} +1 -1
- package/assets/{session-proposal-DlrzMPU6.js → session-proposal-CuVqfqoo.js} +1 -1
- package/assets/{session-request-CWIXGzBr.js → session-request-CKwxSrqb.js} +2 -2
- package/assets/{signing-Blgmj-ki.js → signing-BjyyWrkp.js} +3 -3
- package/assets/{socials-B995t4YH.js → socials-pvmMMGV3.js} +1 -1
- package/assets/{swaps-Clq_Nmgr.js → swaps-padIwW3Y.js} +1 -1
- package/assets/{thirdweb-ivD78gRL.js → thirdweb-kveVeUIA.js} +3 -3
- package/assets/{to-serializable-transaction-DaB5jIxe.js → to-serializable-transaction-108u7zPg.js} +2 -2
- package/assets/trade-encoding-DcECym8l.js +1 -0
- package/assets/{transactionReceipt-CLWilq6h.js → transactionReceipt-Bs-2Cglz.js} +1 -1
- package/assets/{transactions-BpphjA60.js → transactions-dcat6MM1.js} +1 -1
- package/assets/useCreditPacks-BAZLy3JX.js +1 -0
- package/assets/{useInfiniteGrid-CD-N77Cs.js → useInfiniteGrid-BBNOO0mR.js} +1 -1
- package/assets/useManaRate-CGtpZZBQ.js +1 -0
- package/assets/{useStore-BLu1YQjn.js → useStore-Bo6L1SFA.js} +1 -1
- package/assets/useTheme-CQjQJ5Is.js +1 -0
- package/assets/{verifyHash-DRTDPueY.js → verifyHash-BfupbUWA.js} +1 -1
- package/assets/{w3m-modal-CyjbWChP.js → w3m-modal-C2yr-A_-.js} +1 -1
- package/assets/{w3m-modal-BWS5cBnY.js → w3m-modal-CdtZ4EYL.js} +1 -1
- package/assets/{wait-for-tx-receipt-Dwbw_tfy.js → wait-for-tx-receipt-BBOv1oQx.js} +1 -1
- package/assets/{wallets-SowU94TA.js → wallets-CcitqMTg.js} +5 -5
- package/assets/{web-connector-BQYnWq2A.js → web-connector-BLbBOK88.js} +3 -3
- package/assets/world-B-9aPlxu.webp +0 -0
- package/assets/{writeContract-BQBB6IQD.js → writeContract-Cke2dgme.js} +1 -1
- package/assets/{zoraTestnet-AkjTySo9.js → zoraTestnet-NeGGigN-.js} +1 -1
- package/index.html +11 -11
- package/package.json +2 -2
- package/assets/Activity-zOdV7zID.js +0 -284
- package/assets/Assets-BsWk8z8u.js +0 -758
- package/assets/Authorizations-WRwO7XIX.js +0 -175
- package/assets/Cart-BB2vUnjZ.js +0 -3
- package/assets/Cart-BaVkpmjN.css +0 -1
- package/assets/CollectionCarousel-c7FA9ke_.js +0 -1
- package/assets/GetCredits-DKFHGw4S.js +0 -1
- package/assets/ImportListings-Dx8BzO4r.css +0 -1
- package/assets/ItemDetail-BFcnjOnk.js +0 -1762
- package/assets/MyFavorites-CDL0dF1c.js +0 -3
- package/assets/NotificationsBell-B39tpkNG.js +0 -34
- package/assets/TradeService-BS4tPzcI.js +0 -1
- package/assets/authorizations-DWHCeP7j.js +0 -1
- package/assets/buy-B0Piwjmq.js +0 -1
- package/assets/buy-gasless-pPTI8u_1.js +0 -1
- package/assets/categories-_8oO8Yih.css +0 -1
- package/assets/index-B4tgQVEu.js +0 -312
- package/assets/index-CuyaFbh3.js +0 -4
- package/assets/index-CvuJSryR.js +0 -2
- package/assets/index-D3DtvRSj.css +0 -1
- package/assets/index-HN6Rk25C.js +0 -1
- package/assets/mana-rate-B-Ghbv7a.js +0 -1
- package/assets/pack-chips--HnOpf5U.webp +0 -0
- package/assets/sendMetaTransaction-CiO3jI6F.js +0 -1
- package/assets/trade-encoding-BCN0X2W3.js +0 -1
- package/assets/useCreditPacks-CnlSkvVM.js +0 -1
- package/assets/useManaRate-Ctm7UARH.js +0 -1
- package/assets/useTheme-RtXSDv_5.js +0 -1
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
import{u as Le,r as f,j as e,b as et}from"./react-BW1xvPTF.js";import{m as W,h as tt,c as nt,v as st,s,K as t,u as ie,a as ot,b as Be,A as Fe,y as rt,t as o,I,C as F,d as ye,j as J,k as it,l as at,x as We,L as lt,M as te,aN as ct,aO as dt}from"./index-BFPNYe8x.js";import{r as pt,m as ft,a as He}from"./mana-rate-BpgRIQMS.js";import{u as Oe}from"./useManaRate-CGtpZZBQ.js";import{g as ht,h as xt,i as ut,j as mt,k as gt,C as bt,l as yt,o as wt,m as jt,n as vt,M as Ct,E as $t,p as kt,q as St,r as Et,s as It,t as Tt,u as _t}from"./Assets.styles-BZMkOQeI.js";import{d as we,R as Rt,F as zt,S as je,b as At}from"./categories-BwvbYi6M.js";import{L as Nt}from"./LoadMore-C2uaqP2N.js";import{M as Mt}from"./MarketCheckout-CW6mGgHt.js";import{u as Pt}from"./useInfiniteGrid-BBNOO0mR.js";import{E as Lt}from"./ErrorNotice-BG40E5Ff.js";import{d as Bt}from"./dcl-schemas-BICTSpB5.js";import{u as Ft,G as Wt,w as Ht,S as Ot}from"./buy-gasless-oF_YJX_W.js";import{s as Ut}from"./buy-84sizoxr.js";import{i as Dt}from"./trade-encoding-DcECym8l.js";import{f as Gt}from"./errors-D-hio89k.js";import{J as qt,C as Vt,B as re}from"./ethers-CtVvB8eG.js";import{l as Kt}from"./loader-logo-BzY9EKdC.js";import{n as Zt}from"./emotion-CSxEP8yM.js";import"./sentry-BV_ZSgtd.js";import"./intl-CBcMB1D2.js";import"./Tooltip-V9fXstBY.js";import"./authorizations-t9AL68YM.js";import"./sendMetaTransaction-DNedK3Cr.js";function ne(n){const r=n.source??"item",l=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${r}:${l}`}const H="100000000000000000000",Ue=2,X=15,Qt=/^[a-zA-Z0-9]+$/;function ve(n){const r=n.trim();return r.length===0?{ok:!1,reason:"empty"}:Qt.test(r)?r.length<Ue?{ok:!1,reason:"too-short"}:r.length>X?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Jt(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,X)}const Xt=["function available(string _subdomain) view returns (bool)"],Ce={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return W.chainId===Bt.ChainId.MATIC_MAINNET?Ce.mainnet:Ce.sepolia}async function en(n,r={}){var a;const{rpc:l,address:h}=Yt(),u=new qt(l),c=new Vt(h,Xt,u);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${l}`);const x=await c.available(n);if((a=r.signal)!=null&&a.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${x}`),x?"available":"taken"}const tn="https://app.across.to/api";class De extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(n){return ft(H,n)}async function sn(n,r,l={}){var a;const h=l.chainId??W.chainId,u=l.provider??"across",c=`${W.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(r)}&chainId=${h}&provider=${u}`,x=await st(c,{method:"GET",identity:n,metadata:{}});if(!x.ok){let d;try{d=(a=await x.json())==null?void 0:a.code}catch{}throw d==="ROUTE_COST_TOO_HIGH"?new De:new Error(`fetchNameCreditRoute ${x.status}`)}return x.json()}function on(n,r){const l=re.from(n.availableAmount),u=re.from(H).sub(l);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:Dt(n.id)}],creditsSignatures:[n.signature],externalCall:{target:r.externalCall.target,selector:r.externalCall.selector,data:r.externalCall.data,expiresAt:r.externalCall.expiresAt,salt:r.externalCall.salt},customExternalCallSignature:r.customExternalCallSignature,maxUncreditedValue:u.isNegative()?"0":u.toString(),maxCreditedValue:H}}async function rn(n,r={}){const l=tn,h=r.intervalMs??1e4,u=r.maxAttempts??60;let c={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let x=0;x<u;x++){try{const a=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${n}`);if(a.ok){const d=await a.json(),p=(d.status??"pending").toLowerCase(),w=d.fillTx??d.fillTxnRef??null,m=d.actionsSucceeded!==!1;if(p==="filled")return{status:"filled",destinationTxHash:w,actionsSucceeded:m};if(p==="refunded"||p==="expired")return{status:p,destinationTxHash:null,actionsSucceeded:!1};c={status:"pending",destinationTxHash:w,actionsSucceeded:m}}}catch{}x<u-1&&await new Promise(a=>setTimeout(a,h))}return c}async function an(n){const{name:r,identity:l,signer:h}=n,u=n.chainId??W.chainId,c=n.provider??"across",x=(n.beneficiary??await h.getAddress()).toLowerCase();let a=null,d=!1;console.info("[names] register start",{name:r,buyer:x,chainId:u,provider:c});try{const p=await pt(u),w=nn(p);console.info("[names] step 1/6 sized reservation",{usdCents:w,manaRate:p});const m=await sn(l,r,{chainId:u,provider:c});console.info("[names] step 2/6 route fetched",{target:m.externalCall.target,selector:m.externalCall.selector,provider:m.provider,quoteId:m.quoteId});const C=await tt(l,w);if(a=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),re.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const $=on(C.credit,m);let b;try{b=await Ft({chainId:u,buyer:x,signer:h,args:$})}catch(y){if(!(y instanceof Wt))throw y;b=await Ut(u,$,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:b}),await Ht(b),d=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:b}),c==="across"){const y=await rn(b,n.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:b};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:b,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:b}}catch(p){if(console.error("[names] register failed — raw error:",p,{name:r,buyer:x,originConfirmed:d}),p instanceof Ot)return{status:"pending",originTxHash:p.txHash};throw a&&!d&&await nt(l,[a]).catch(()=>{}),p instanceof De?p:new Error(Gt(p,"Couldn't register the name. Please try again.",{sale:!0}))}}const ln=s.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
z-index: 10000;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
padding: 16px;
|
|
9
|
+
background: rgba(22, 21, 24, 0.55);
|
|
10
|
+
`,cn=s.div`
|
|
11
|
+
width: 560px;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
max-height: 92vh;
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
background: ${t.colors.white};
|
|
16
|
+
border-radius: 16px;
|
|
17
|
+
padding: 20px 24px 24px;
|
|
18
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
|
|
19
|
+
|
|
20
|
+
${t.media.down("mobile")} {
|
|
21
|
+
padding: 16px;
|
|
22
|
+
}
|
|
23
|
+
`,$e=s.div`
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
gap: 12px;
|
|
28
|
+
`,ke=s.h2`
|
|
29
|
+
margin: 0;
|
|
30
|
+
font-family: ${t.font.sans};
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
font-size: 22px;
|
|
33
|
+
line-height: 1.2;
|
|
34
|
+
color: ${t.colors.text};
|
|
35
|
+
`,Se=s.button`
|
|
36
|
+
flex: none;
|
|
37
|
+
display: grid;
|
|
38
|
+
place-items: center;
|
|
39
|
+
width: 28px;
|
|
40
|
+
height: 28px;
|
|
41
|
+
border: 0;
|
|
42
|
+
background: none;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
color: ${t.colors.text};
|
|
45
|
+
|
|
46
|
+
.ico {
|
|
47
|
+
width: 18px;
|
|
48
|
+
height: 18px;
|
|
49
|
+
}
|
|
50
|
+
&:disabled {
|
|
51
|
+
opacity: 0.4;
|
|
52
|
+
cursor: default;
|
|
53
|
+
}
|
|
54
|
+
&:focus-visible {
|
|
55
|
+
outline: 2px solid ${t.colors.accent};
|
|
56
|
+
outline-offset: 2px;
|
|
57
|
+
}
|
|
58
|
+
`,Ee=s.div`
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 6px;
|
|
62
|
+
margin-top: 4px;
|
|
63
|
+
font-family: ${t.font.sans};
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
color: ${t.colors.text2};
|
|
66
|
+
|
|
67
|
+
.ico {
|
|
68
|
+
width: 16px;
|
|
69
|
+
height: 16px;
|
|
70
|
+
color: ${t.colors.brandViolet};
|
|
71
|
+
}
|
|
72
|
+
`,Ie=s.hr`
|
|
73
|
+
border: 0;
|
|
74
|
+
border-top: 1px solid ${t.colors.line};
|
|
75
|
+
margin: 16px 0;
|
|
76
|
+
`,Te=s.div`
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: 16px;
|
|
80
|
+
`,_e=s.div`
|
|
81
|
+
flex: none;
|
|
82
|
+
display: grid;
|
|
83
|
+
place-items: center;
|
|
84
|
+
width: 56px;
|
|
85
|
+
height: 56px;
|
|
86
|
+
border-radius: 10px;
|
|
87
|
+
background: ${t.gradients.amethyst};
|
|
88
|
+
color: ${t.colors.white};
|
|
89
|
+
|
|
90
|
+
.ico {
|
|
91
|
+
width: 30px;
|
|
92
|
+
height: 30px;
|
|
93
|
+
}
|
|
94
|
+
`,Re=s.div`
|
|
95
|
+
flex: 1;
|
|
96
|
+
min-width: 0;
|
|
97
|
+
`,ze=s.div`
|
|
98
|
+
font-family: ${t.font.sans};
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
font-size: 20px;
|
|
101
|
+
line-height: 1.3;
|
|
102
|
+
color: ${t.colors.text};
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
|
|
107
|
+
span {
|
|
108
|
+
font-weight: 400;
|
|
109
|
+
color: ${t.colors.muted2};
|
|
110
|
+
}
|
|
111
|
+
`,Ae=s.div`
|
|
112
|
+
font-family: ${t.font.sans};
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
color: ${t.colors.muted2};
|
|
115
|
+
`,Ne=s.div`
|
|
116
|
+
flex: none;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
gap: 6px;
|
|
120
|
+
font-family: ${t.font.sans};
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
font-size: 24px;
|
|
123
|
+
color: ${t.colors.text};
|
|
124
|
+
|
|
125
|
+
.ico {
|
|
126
|
+
width: 22px;
|
|
127
|
+
height: 22px;
|
|
128
|
+
color: ${t.colors.brandViolet};
|
|
129
|
+
}
|
|
130
|
+
`,dn=s.div`
|
|
131
|
+
margin-top: 16px;
|
|
132
|
+
padding: 16px;
|
|
133
|
+
border-radius: 12px;
|
|
134
|
+
background: #f2e7fc;
|
|
135
|
+
`,pn=s.div`
|
|
136
|
+
font-family: ${t.font.sans};
|
|
137
|
+
font-weight: 700;
|
|
138
|
+
font-size: 16px;
|
|
139
|
+
color: ${t.colors.text};
|
|
140
|
+
`,fn=s.p`
|
|
141
|
+
margin: 8px 0 16px;
|
|
142
|
+
font-family: ${t.font.sans};
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
line-height: 1.5;
|
|
145
|
+
color: ${t.colors.text2};
|
|
146
|
+
|
|
147
|
+
b {
|
|
148
|
+
font-weight: 700;
|
|
149
|
+
color: ${t.colors.brandViolet};
|
|
150
|
+
}
|
|
151
|
+
`,hn=s.label`
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
gap: 8px;
|
|
155
|
+
padding: 12px 14px;
|
|
156
|
+
background: ${t.colors.white};
|
|
157
|
+
border: 1px solid ${t.colors.text};
|
|
158
|
+
border-radius: 10px;
|
|
159
|
+
cursor: text;
|
|
160
|
+
|
|
161
|
+
&:focus-within {
|
|
162
|
+
border-color: ${t.colors.magenta};
|
|
163
|
+
}
|
|
164
|
+
`,xn=s.span`
|
|
165
|
+
flex: none;
|
|
166
|
+
font-family: ${t.font.sans};
|
|
167
|
+
font-size: 18px;
|
|
168
|
+
color: ${t.colors.muted2};
|
|
169
|
+
`,un=s.input`
|
|
170
|
+
flex: 0 1 auto;
|
|
171
|
+
min-width: 0;
|
|
172
|
+
border: 0;
|
|
173
|
+
outline: none;
|
|
174
|
+
background: transparent;
|
|
175
|
+
font-family: ${t.font.sans};
|
|
176
|
+
font-size: 16px;
|
|
177
|
+
font-weight: 600;
|
|
178
|
+
color: ${t.colors.text};
|
|
179
|
+
|
|
180
|
+
&::placeholder {
|
|
181
|
+
color: #a09ba8;
|
|
182
|
+
font-weight: 400;
|
|
183
|
+
}
|
|
184
|
+
`,mn=s.span`
|
|
185
|
+
flex: none;
|
|
186
|
+
font-family: ${t.font.sans};
|
|
187
|
+
font-size: 16px;
|
|
188
|
+
color: ${t.colors.muted2};
|
|
189
|
+
`,Me=s.button`
|
|
190
|
+
margin-top: 16px;
|
|
191
|
+
width: 100%;
|
|
192
|
+
height: 52px;
|
|
193
|
+
border: 0;
|
|
194
|
+
border-radius: 12px;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
background: ${t.gradients.amethyst};
|
|
197
|
+
color: ${t.colors.softWhite};
|
|
198
|
+
font-family: ${t.font.sans};
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
font-size: 15px;
|
|
201
|
+
letter-spacing: 0.46px;
|
|
202
|
+
text-transform: uppercase;
|
|
203
|
+
|
|
204
|
+
&:hover:not(:disabled) {
|
|
205
|
+
filter: brightness(1.06);
|
|
206
|
+
}
|
|
207
|
+
&:focus-visible {
|
|
208
|
+
outline: 2px solid ${t.colors.accent};
|
|
209
|
+
outline-offset: 2px;
|
|
210
|
+
}
|
|
211
|
+
&:disabled {
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
background: #ddc7ec;
|
|
214
|
+
color: #f4ecfa;
|
|
215
|
+
}
|
|
216
|
+
`,gn=s.div`
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
align-items: flex-start;
|
|
220
|
+
gap: 20px;
|
|
221
|
+
padding: 32px 0 8px;
|
|
222
|
+
`,bn=s.img`
|
|
223
|
+
align-self: center;
|
|
224
|
+
width: 56px;
|
|
225
|
+
height: 56px;
|
|
226
|
+
`,yn=s.div`
|
|
227
|
+
font-family: ${t.font.sans};
|
|
228
|
+
font-weight: 700;
|
|
229
|
+
font-size: 18px;
|
|
230
|
+
color: ${t.colors.text};
|
|
231
|
+
`,wn=s.div`
|
|
232
|
+
display: flex;
|
|
233
|
+
align-items: center;
|
|
234
|
+
gap: 12px;
|
|
235
|
+
width: 100%;
|
|
236
|
+
`,jn=s.div`
|
|
237
|
+
flex: 1;
|
|
238
|
+
height: 8px;
|
|
239
|
+
border-radius: 999px;
|
|
240
|
+
background: ${t.colors.chip};
|
|
241
|
+
overflow: hidden;
|
|
242
|
+
|
|
243
|
+
span {
|
|
244
|
+
display: block;
|
|
245
|
+
height: 100%;
|
|
246
|
+
width: 40%;
|
|
247
|
+
border-radius: 999px;
|
|
248
|
+
background: ${t.gradients.amethyst};
|
|
249
|
+
animation: nameProgress 1.1s ease-in-out infinite;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@keyframes nameProgress {
|
|
253
|
+
0% {
|
|
254
|
+
transform: translateX(-100%);
|
|
255
|
+
}
|
|
256
|
+
100% {
|
|
257
|
+
transform: translateX(320%);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
`,vn=s.span`
|
|
261
|
+
flex: none;
|
|
262
|
+
font-family: ${t.font.sans};
|
|
263
|
+
font-size: 14px;
|
|
264
|
+
color: ${t.colors.muted};
|
|
265
|
+
`,Cn=s.div`
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-direction: column;
|
|
268
|
+
align-items: center;
|
|
269
|
+
gap: 16px;
|
|
270
|
+
padding: 24px;
|
|
271
|
+
border-radius: 12px;
|
|
272
|
+
background: #e2f5ea;
|
|
273
|
+
text-align: center;
|
|
274
|
+
`,$n=s.div`
|
|
275
|
+
display: grid;
|
|
276
|
+
place-items: center;
|
|
277
|
+
width: 56px;
|
|
278
|
+
height: 56px;
|
|
279
|
+
border-radius: 50%;
|
|
280
|
+
background: ${t.colors.ok};
|
|
281
|
+
color: ${t.colors.white};
|
|
282
|
+
|
|
283
|
+
.ico {
|
|
284
|
+
width: 30px;
|
|
285
|
+
height: 30px;
|
|
286
|
+
}
|
|
287
|
+
`,kn=s.p`
|
|
288
|
+
margin: 0;
|
|
289
|
+
font-family: ${t.font.sans};
|
|
290
|
+
font-size: 16px;
|
|
291
|
+
line-height: 1.4;
|
|
292
|
+
color: ${t.colors.text};
|
|
293
|
+
|
|
294
|
+
b {
|
|
295
|
+
font-weight: 700;
|
|
296
|
+
}
|
|
297
|
+
`,Sn=s.div`
|
|
298
|
+
display: flex;
|
|
299
|
+
gap: 16px;
|
|
300
|
+
margin-top: 20px;
|
|
301
|
+
|
|
302
|
+
${t.media.down("mobile")} {
|
|
303
|
+
flex-direction: column;
|
|
304
|
+
}
|
|
305
|
+
`,En=s.button`
|
|
306
|
+
flex: 1;
|
|
307
|
+
height: 48px;
|
|
308
|
+
border: 1px solid ${t.colors.accent};
|
|
309
|
+
border-radius: 8px;
|
|
310
|
+
background: ${t.colors.white};
|
|
311
|
+
color: ${t.colors.accent};
|
|
312
|
+
cursor: pointer;
|
|
313
|
+
font-family: ${t.font.sans};
|
|
314
|
+
font-weight: 600;
|
|
315
|
+
font-size: 13px;
|
|
316
|
+
letter-spacing: 0.46px;
|
|
317
|
+
text-transform: uppercase;
|
|
318
|
+
|
|
319
|
+
&:hover {
|
|
320
|
+
background: rgba(105, 31, 169, 0.06);
|
|
321
|
+
}
|
|
322
|
+
&:focus-visible {
|
|
323
|
+
outline: 2px solid ${t.colors.accent};
|
|
324
|
+
outline-offset: 2px;
|
|
325
|
+
}
|
|
326
|
+
`,In=s.a`
|
|
327
|
+
flex: 1;
|
|
328
|
+
display: inline-flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
justify-content: center;
|
|
331
|
+
height: 48px;
|
|
332
|
+
border-radius: 8px;
|
|
333
|
+
background: ${t.colors.dclRed};
|
|
334
|
+
color: ${t.colors.softWhite};
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
text-decoration: none;
|
|
337
|
+
font-family: ${t.font.sans};
|
|
338
|
+
font-weight: 600;
|
|
339
|
+
font-size: 13px;
|
|
340
|
+
letter-spacing: 0.46px;
|
|
341
|
+
text-transform: uppercase;
|
|
342
|
+
|
|
343
|
+
&:hover {
|
|
344
|
+
filter: brightness(1.05);
|
|
345
|
+
}
|
|
346
|
+
&:focus-visible {
|
|
347
|
+
outline: 2px solid ${t.colors.accent};
|
|
348
|
+
outline-offset: 2px;
|
|
349
|
+
}
|
|
350
|
+
`,Tn=s.div`
|
|
351
|
+
display: flex;
|
|
352
|
+
align-items: flex-start;
|
|
353
|
+
gap: 12px;
|
|
354
|
+
padding: 16px;
|
|
355
|
+
margin-top: 8px;
|
|
356
|
+
border-radius: 12px;
|
|
357
|
+
background: rgba(255, 45, 85, 0.1);
|
|
358
|
+
font-family: ${t.font.sans};
|
|
359
|
+
font-size: 14px;
|
|
360
|
+
line-height: 1.5;
|
|
361
|
+
color: ${t.colors.text};
|
|
362
|
+
|
|
363
|
+
.ico {
|
|
364
|
+
width: 22px;
|
|
365
|
+
height: 22px;
|
|
366
|
+
flex: none;
|
|
367
|
+
color: ${t.colors.dclRed};
|
|
368
|
+
}
|
|
369
|
+
`;function _n({name:n,priceCredits:r,onClose:l}){const{session:h}=ie(),{data:u,isError:c}=ot(h),x=Be(),a=Le(),[d,p]=f.useState("confirm"),[w,m]=f.useState(""),[C,$]=f.useState(null),b=f.useRef(!1),y=w.trim().toLowerCase()===n.toLowerCase(),S=d==="completing",j=r!=null?Fe(r):"—";f.useEffect(()=>{const g=R=>{R.key==="Escape"&&!S&&l()};document.addEventListener("keydown",g);const Y=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=Y}},[S,l]);async function E(){if(!(!h||!y||b.current)){b.current=!0,p("completing"),$(null);try{await an({name:n,identity:h.identity,signer:h.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:r??null}),x.invalidateQueries({queryKey:["usd-balance"]}),x.invalidateQueries({queryKey:["my-assets"]}),p("success")}catch(g){J(at(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:it(g),purchase_type:"name"}),$((g==null?void 0:g.message)||o("names.errorGeneric")),p("error")}finally{b.current=!1}}}const k=d!=="success",T=rt(h==null?void 0:h.providerType);return e.jsx(ln,{onClick:S?void 0:l,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":o("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[k&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(ke,{children:d==="error"?o("names.errorTitle"):o("names.buyTitle")}),e.jsx(Se,{onClick:l,disabled:S,"aria-label":o("buyModal.close"),children:e.jsx(I,{name:"close"})})]}),e.jsxs(Ee,{children:[o("names.myCreditsBalance")," ",e.jsx(F,{})," ",ye(u,c)]}),e.jsx(Ie,{})]}),(d==="confirm"||d==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(Te,{children:[e.jsx(_e,{"aria-hidden":!0,children:"@"}),e.jsxs(Re,{children:[e.jsxs(ze,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ae,{children:o("names.subtitle")})]}),e.jsxs(Ne,{children:[e.jsx(F,{}),j]})]}),d==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Tn,{children:[e.jsx(I,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>p("confirm"),children:o("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:o("names.confirmTitle")}),e.jsx(fn,{dangerouslySetInnerHTML:{__html:o("names.confirmBody",{name:`<b>@${Rn(n)}</b>`})}}),e.jsxs(hn,{children:[e.jsx(xn,{"aria-hidden":!0,children:"@"}),e.jsx(un,{value:w,onChange:g=>m(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":o("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(w.length,8)}ch`}}),e.jsx(mn,{children:".dcl.eth"})]})]}),e.jsx(Me,{onClick:()=>void E(),disabled:!y||!h,children:o("names.buyCta")})]})]}),d==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:Kt,alt:"",width:56,height:56}),e.jsx(yn,{children:T?o("names.confirming"):o("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),d==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(ke,{children:o("names.successHeaderTitle")}),e.jsx(Se,{onClick:l,"aria-label":o("buyModal.close"),children:e.jsx(I,{name:"close"})})]}),e.jsxs(Ee,{children:[o("names.myCreditsBalance")," ",e.jsx(F,{})," ",ye(u,c)]}),e.jsx(Ie,{}),e.jsxs(Cn,{children:[e.jsx($n,{"aria-hidden":!0,children:e.jsx(I,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:o("names.successBannerBold")})," ",o("names.successBannerRest")]})]}),e.jsxs(Te,{style:{marginTop:20},children:[e.jsx(_e,{"aria-hidden":!0,children:"@"}),e.jsxs(Re,{children:[e.jsxs(ze,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ae,{children:o("names.subtitle")})]}),e.jsxs(Ne,{children:[e.jsx(F,{}),j]})]}),e.jsxs(Sn,{children:[e.jsx(En,{onClick:()=>{l(),a("/my-assets")},children:o("names.myItems")}),e.jsx(In,{href:W.profileUrl,target:"_blank",rel:"noopener noreferrer",children:o("names.assignToAvatar")})]})]})]})})}function Rn(n){return n.replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r])}const zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30277401547.commit-e877307/assets/identity-B4DXDuJP.webp",An="https://cdn.decentraland.org/@dcl/shop/0.1.0-30277401547.commit-e877307/assets/world-B-9aPlxu.webp",Nn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30277401547.commit-e877307/assets/invite-BfwIhP2C.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30277401547.commit-e877307/assets/governance-DnazlIjy.webp",Pn=s.div`
|
|
370
|
+
width: 100%;
|
|
371
|
+
min-width: 0;
|
|
372
|
+
`,Ln=s.nav`
|
|
373
|
+
display: flex;
|
|
374
|
+
align-items: center;
|
|
375
|
+
gap: 6px;
|
|
376
|
+
margin: 4px 0 16px;
|
|
377
|
+
font-family: ${t.font.sans};
|
|
378
|
+
font-size: 12px;
|
|
379
|
+
line-height: 1;
|
|
380
|
+
color: ${t.colors.muted};
|
|
381
|
+
`,Bn=s.button`
|
|
382
|
+
border: 0;
|
|
383
|
+
background: none;
|
|
384
|
+
padding: 0;
|
|
385
|
+
cursor: pointer;
|
|
386
|
+
font: inherit;
|
|
387
|
+
color: ${t.colors.muted};
|
|
388
|
+
|
|
389
|
+
&:hover {
|
|
390
|
+
text-decoration: underline;
|
|
391
|
+
}
|
|
392
|
+
&:focus-visible {
|
|
393
|
+
outline: 2px solid ${t.colors.accent};
|
|
394
|
+
outline-offset: 2px;
|
|
395
|
+
}
|
|
396
|
+
`,Fn=s.span`
|
|
397
|
+
font-weight: 700;
|
|
398
|
+
color: ${t.colors.muted};
|
|
399
|
+
`,Wn=s.div`
|
|
400
|
+
display: flex;
|
|
401
|
+
flex-direction: column;
|
|
402
|
+
gap: 48px;
|
|
403
|
+
padding-bottom: 48px;
|
|
404
|
+
background: #ecdbfd;
|
|
405
|
+
border-radius: ${t.radius.banner};
|
|
406
|
+
overflow: hidden;
|
|
407
|
+
|
|
408
|
+
${t.media.down("mobile")} {
|
|
409
|
+
gap: 32px;
|
|
410
|
+
padding-bottom: 32px;
|
|
411
|
+
}
|
|
412
|
+
`,Hn=s.div`
|
|
413
|
+
position: relative;
|
|
414
|
+
border-radius: ${t.radius.banner};
|
|
415
|
+
overflow: hidden;
|
|
416
|
+
padding: 88px 48px;
|
|
417
|
+
display: flex;
|
|
418
|
+
flex-direction: column;
|
|
419
|
+
align-items: center;
|
|
420
|
+
gap: 48px;
|
|
421
|
+
text-align: center;
|
|
422
|
+
background: radial-gradient(120% 95% at 50% 118%, #d13bd6 0%, #a026b0 28%, #6a1b9c 58%, #4a1173 100%);
|
|
423
|
+
|
|
424
|
+
${t.media.down("mobile")} {
|
|
425
|
+
padding: 40px 20px;
|
|
426
|
+
gap: 28px;
|
|
427
|
+
}
|
|
428
|
+
`,On=s.div`
|
|
429
|
+
display: flex;
|
|
430
|
+
flex-direction: column;
|
|
431
|
+
align-items: center;
|
|
432
|
+
gap: 12px;
|
|
433
|
+
`,Un=s.h1`
|
|
434
|
+
margin: 0;
|
|
435
|
+
font-family: ${t.font.sans};
|
|
436
|
+
font-weight: 600;
|
|
437
|
+
font-size: 40px;
|
|
438
|
+
line-height: 1.167;
|
|
439
|
+
color: ${t.colors.white};
|
|
440
|
+
|
|
441
|
+
${t.media.down("mobile")} {
|
|
442
|
+
font-size: 26px;
|
|
443
|
+
}
|
|
444
|
+
`,Dn=s.p`
|
|
445
|
+
margin: 0;
|
|
446
|
+
max-width: 760px;
|
|
447
|
+
font-family: ${t.font.sans};
|
|
448
|
+
font-weight: 500;
|
|
449
|
+
font-size: 24px;
|
|
450
|
+
line-height: 1.334;
|
|
451
|
+
color: #ecebed;
|
|
452
|
+
|
|
453
|
+
${t.media.down("mobile")} {
|
|
454
|
+
font-size: 16px;
|
|
455
|
+
}
|
|
456
|
+
`,Gn=s.div`
|
|
457
|
+
width: min(785px, 100%);
|
|
458
|
+
display: flex;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
gap: 12px;
|
|
461
|
+
`,qn=s.div`
|
|
462
|
+
position: relative;
|
|
463
|
+
`,Vn=s("div",Zt("invalid"))`
|
|
464
|
+
display: flex;
|
|
465
|
+
align-items: center;
|
|
466
|
+
gap: 8px;
|
|
467
|
+
padding: 8px 8px 8px 16px;
|
|
468
|
+
background: ${t.colors.softWhite};
|
|
469
|
+
border: 1.5px solid ${({invalid:n})=>n?"#ff2d55":t.colors.line};
|
|
470
|
+
border-radius: 20px;
|
|
471
|
+
|
|
472
|
+
&:focus-within {
|
|
473
|
+
border-color: ${({invalid:n})=>n?"#ff2d55":t.colors.magenta};
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
${t.media.down("mobile")} {
|
|
477
|
+
border-radius: 16px;
|
|
478
|
+
}
|
|
479
|
+
`,Kn=s.span`
|
|
480
|
+
position: absolute;
|
|
481
|
+
left: -9999px;
|
|
482
|
+
top: 0;
|
|
483
|
+
visibility: hidden;
|
|
484
|
+
pointer-events: none;
|
|
485
|
+
white-space: pre;
|
|
486
|
+
font-family: ${t.font.sans};
|
|
487
|
+
font-size: 20px;
|
|
488
|
+
font-weight: 600;
|
|
489
|
+
line-height: 1.6;
|
|
490
|
+
|
|
491
|
+
${t.media.down("mobile")} {
|
|
492
|
+
font-size: 16px;
|
|
493
|
+
}
|
|
494
|
+
`,Zn=s.div`
|
|
495
|
+
position: absolute;
|
|
496
|
+
top: calc(100% + 8px);
|
|
497
|
+
left: 0;
|
|
498
|
+
right: 0;
|
|
499
|
+
z-index: 2;
|
|
500
|
+
display: flex;
|
|
501
|
+
align-items: center;
|
|
502
|
+
gap: 8px;
|
|
503
|
+
padding: 8px 12px;
|
|
504
|
+
border-radius: 8px;
|
|
505
|
+
background: #ffcdd4;
|
|
506
|
+
color: #ec303a;
|
|
507
|
+
font-family: ${t.font.sans};
|
|
508
|
+
font-size: 14px;
|
|
509
|
+
font-weight: 500;
|
|
510
|
+
line-height: 1.2;
|
|
511
|
+
text-align: left;
|
|
512
|
+
|
|
513
|
+
${t.media.down("mobile")} {
|
|
514
|
+
position: static;
|
|
515
|
+
margin-top: 8px;
|
|
516
|
+
align-items: flex-start;
|
|
517
|
+
flex-wrap: wrap;
|
|
518
|
+
}
|
|
519
|
+
`,Qn=s.a`
|
|
520
|
+
display: inline-flex;
|
|
521
|
+
align-items: center;
|
|
522
|
+
gap: 2px;
|
|
523
|
+
margin-left: auto;
|
|
524
|
+
color: #ec303a;
|
|
525
|
+
font-weight: 600;
|
|
526
|
+
text-decoration: underline;
|
|
527
|
+
text-transform: uppercase;
|
|
528
|
+
white-space: nowrap;
|
|
529
|
+
|
|
530
|
+
${t.media.down("mobile")} {
|
|
531
|
+
margin-left: 0;
|
|
532
|
+
}
|
|
533
|
+
`,Jn=s.label`
|
|
534
|
+
flex: 1;
|
|
535
|
+
min-width: 0;
|
|
536
|
+
display: flex;
|
|
537
|
+
align-items: center;
|
|
538
|
+
gap: 0;
|
|
539
|
+
cursor: text;
|
|
540
|
+
overflow: hidden;
|
|
541
|
+
`,Xn=s.span`
|
|
542
|
+
flex: none;
|
|
543
|
+
margin-right: 8px;
|
|
544
|
+
font-family: ${t.font.sans};
|
|
545
|
+
font-size: 26px;
|
|
546
|
+
font-weight: 500;
|
|
547
|
+
line-height: 1;
|
|
548
|
+
color: #a09ba8;
|
|
549
|
+
|
|
550
|
+
${t.media.down("mobile")} {
|
|
551
|
+
font-size: 20px;
|
|
552
|
+
}
|
|
553
|
+
`,Yn=s.input`
|
|
554
|
+
flex: 0 1 auto;
|
|
555
|
+
min-width: 0;
|
|
556
|
+
max-width: 100%;
|
|
557
|
+
border: 0;
|
|
558
|
+
outline: none;
|
|
559
|
+
background: transparent;
|
|
560
|
+
font-family: ${t.font.sans};
|
|
561
|
+
font-size: 20px;
|
|
562
|
+
font-weight: 600;
|
|
563
|
+
line-height: 1.6;
|
|
564
|
+
color: ${t.colors.text};
|
|
565
|
+
padding: 0;
|
|
566
|
+
|
|
567
|
+
&::placeholder {
|
|
568
|
+
color: #5e5b67;
|
|
569
|
+
font-weight: 400;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
${t.media.down("mobile")} {
|
|
573
|
+
font-size: 16px;
|
|
574
|
+
}
|
|
575
|
+
`,es=s.span`
|
|
576
|
+
flex: none;
|
|
577
|
+
margin-left: 2px;
|
|
578
|
+
font-family: ${t.font.sans};
|
|
579
|
+
font-size: 20px;
|
|
580
|
+
font-weight: 400;
|
|
581
|
+
line-height: 1.6;
|
|
582
|
+
color: #5e5b67;
|
|
583
|
+
|
|
584
|
+
${t.media.down("mobile")} {
|
|
585
|
+
font-size: 16px;
|
|
586
|
+
}
|
|
587
|
+
`,ts=s.span`
|
|
588
|
+
flex: none;
|
|
589
|
+
font-family: ${t.font.sans};
|
|
590
|
+
font-size: 13px;
|
|
591
|
+
color: #a09ba8;
|
|
592
|
+
white-space: nowrap;
|
|
593
|
+
`,Ge=s.button`
|
|
594
|
+
flex: none;
|
|
595
|
+
display: inline-flex;
|
|
596
|
+
align-items: center;
|
|
597
|
+
justify-content: center;
|
|
598
|
+
gap: 8px;
|
|
599
|
+
height: 52px;
|
|
600
|
+
padding: 0 24px;
|
|
601
|
+
border: 0;
|
|
602
|
+
border-radius: 12px;
|
|
603
|
+
cursor: pointer;
|
|
604
|
+
background: ${t.gradients.cerise};
|
|
605
|
+
color: ${t.colors.softWhite};
|
|
606
|
+
font-family: ${t.font.sans};
|
|
607
|
+
font-weight: 600;
|
|
608
|
+
font-size: 15px;
|
|
609
|
+
letter-spacing: 0.46px;
|
|
610
|
+
line-height: 24px;
|
|
611
|
+
text-transform: uppercase;
|
|
612
|
+
|
|
613
|
+
&:hover:not(:disabled) {
|
|
614
|
+
filter: brightness(1.05);
|
|
615
|
+
}
|
|
616
|
+
&:focus-visible {
|
|
617
|
+
outline: 2px solid ${t.colors.white};
|
|
618
|
+
outline-offset: 2px;
|
|
619
|
+
}
|
|
620
|
+
&:disabled {
|
|
621
|
+
cursor: not-allowed;
|
|
622
|
+
background: #e7c8e9;
|
|
623
|
+
color: #fbe9fb;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
${t.media.down("mobile")} {
|
|
627
|
+
display: none;
|
|
628
|
+
}
|
|
629
|
+
`,ns=s(Ge)`
|
|
630
|
+
display: none;
|
|
631
|
+
|
|
632
|
+
${t.media.down("mobile")} {
|
|
633
|
+
display: inline-flex;
|
|
634
|
+
width: 100%;
|
|
635
|
+
height: 48px;
|
|
636
|
+
border-radius: 12px;
|
|
637
|
+
}
|
|
638
|
+
`,ss=s.span`
|
|
639
|
+
display: inline-flex;
|
|
640
|
+
align-items: center;
|
|
641
|
+
gap: 4px;
|
|
642
|
+
font-weight: 600;
|
|
643
|
+
|
|
644
|
+
.ico {
|
|
645
|
+
width: 16px;
|
|
646
|
+
height: 16px;
|
|
647
|
+
}
|
|
648
|
+
`,se=s.div`
|
|
649
|
+
display: flex;
|
|
650
|
+
align-items: center;
|
|
651
|
+
gap: 8px;
|
|
652
|
+
padding: 8px 14px;
|
|
653
|
+
border-radius: 8px;
|
|
654
|
+
font-family: ${t.font.sans};
|
|
655
|
+
font-size: 13px;
|
|
656
|
+
font-weight: 500;
|
|
657
|
+
text-align: left;
|
|
658
|
+
|
|
659
|
+
background: ${({tone:n})=>n==="error"?"rgba(255, 45, 85, 0.12)":n==="ok"?"rgba(30, 166, 114, 0.14)":"rgba(255,255,255,0.14)"};
|
|
660
|
+
color: ${({tone:n})=>n==="error"?"#ff2d55":n==="ok"?"#0f7a4f":"#ecebed"};
|
|
661
|
+
|
|
662
|
+
.ico {
|
|
663
|
+
width: 16px;
|
|
664
|
+
height: 16px;
|
|
665
|
+
flex: none;
|
|
666
|
+
}
|
|
667
|
+
`,os=s.section`
|
|
668
|
+
display: flex;
|
|
669
|
+
flex-direction: column;
|
|
670
|
+
gap: 48px;
|
|
671
|
+
padding: 0 48px;
|
|
672
|
+
|
|
673
|
+
${t.media.down("mobile")} {
|
|
674
|
+
gap: 32px;
|
|
675
|
+
padding: 0 20px;
|
|
676
|
+
}
|
|
677
|
+
`,rs=s.div`
|
|
678
|
+
display: flex;
|
|
679
|
+
flex-direction: column;
|
|
680
|
+
align-items: center;
|
|
681
|
+
gap: 24px;
|
|
682
|
+
`,is=s.h2`
|
|
683
|
+
margin: 0;
|
|
684
|
+
text-align: center;
|
|
685
|
+
font-family: ${t.font.sans};
|
|
686
|
+
font-weight: 600;
|
|
687
|
+
font-size: 32px;
|
|
688
|
+
line-height: 1.167;
|
|
689
|
+
color: ${t.colors.text2};
|
|
690
|
+
|
|
691
|
+
${t.media.down("mobile")} {
|
|
692
|
+
font-size: 22px;
|
|
693
|
+
}
|
|
694
|
+
`,as=s.p`
|
|
695
|
+
margin: 0;
|
|
696
|
+
max-width: 907px;
|
|
697
|
+
text-align: center;
|
|
698
|
+
font-family: ${t.font.sans};
|
|
699
|
+
font-weight: 400;
|
|
700
|
+
font-size: 20px;
|
|
701
|
+
line-height: 1.57;
|
|
702
|
+
color: ${t.colors.text};
|
|
703
|
+
|
|
704
|
+
${t.media.down("mobile")} {
|
|
705
|
+
font-size: 16px;
|
|
706
|
+
}
|
|
707
|
+
`,ls=s.div`
|
|
708
|
+
display: grid;
|
|
709
|
+
grid-template-columns: repeat(4, 1fr);
|
|
710
|
+
gap: 24px;
|
|
711
|
+
align-items: stretch;
|
|
712
|
+
|
|
713
|
+
${t.media.down("lg")} {
|
|
714
|
+
grid-template-columns: repeat(2, 1fr);
|
|
715
|
+
}
|
|
716
|
+
${t.media.down("mobile")} {
|
|
717
|
+
grid-template-columns: 1fr;
|
|
718
|
+
}
|
|
719
|
+
`,q=s.article`
|
|
720
|
+
min-width: 0;
|
|
721
|
+
display: flex;
|
|
722
|
+
flex-direction: column;
|
|
723
|
+
background: ${t.colors.white};
|
|
724
|
+
border: 0.25px solid ${t.colors.muted2};
|
|
725
|
+
border-radius: ${t.radius.card};
|
|
726
|
+
overflow: hidden;
|
|
727
|
+
`,V=s.img`
|
|
728
|
+
display: block;
|
|
729
|
+
width: 100%;
|
|
730
|
+
aspect-ratio: 388 / 235;
|
|
731
|
+
object-fit: cover;
|
|
732
|
+
`,K=s.div`
|
|
733
|
+
flex: 1;
|
|
734
|
+
display: flex;
|
|
735
|
+
flex-direction: column;
|
|
736
|
+
gap: 6px;
|
|
737
|
+
padding: 12px 16px;
|
|
738
|
+
`,Z=s.h3`
|
|
739
|
+
margin: 0;
|
|
740
|
+
font-family: ${t.font.sans};
|
|
741
|
+
font-weight: 700;
|
|
742
|
+
font-size: 20px;
|
|
743
|
+
line-height: 1.57;
|
|
744
|
+
text-transform: uppercase;
|
|
745
|
+
color: ${t.colors.text};
|
|
746
|
+
`,Q=s.p`
|
|
747
|
+
margin: 0;
|
|
748
|
+
font-family: ${t.font.sans};
|
|
749
|
+
font-weight: 400;
|
|
750
|
+
font-size: 14px;
|
|
751
|
+
line-height: 1.57;
|
|
752
|
+
color: ${t.colors.text};
|
|
753
|
+
`,cs=s.span`
|
|
754
|
+
font-weight: 600;
|
|
755
|
+
color: ${t.colors.accent};
|
|
756
|
+
`,Pe=s.a`
|
|
757
|
+
display: inline-flex;
|
|
758
|
+
align-items: center;
|
|
759
|
+
gap: 2px;
|
|
760
|
+
margin-top: auto;
|
|
761
|
+
font-family: ${t.font.sans};
|
|
762
|
+
font-weight: 500;
|
|
763
|
+
font-size: 14px;
|
|
764
|
+
line-height: 30px;
|
|
765
|
+
color: ${t.colors.accent};
|
|
766
|
+
text-decoration: underline;
|
|
767
|
+
|
|
768
|
+
&:focus-visible {
|
|
769
|
+
outline: 2px solid ${t.colors.accent};
|
|
770
|
+
outline-offset: 2px;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.ico {
|
|
774
|
+
width: 13px;
|
|
775
|
+
height: 13px;
|
|
776
|
+
}
|
|
777
|
+
`,ds=s.span`
|
|
778
|
+
position: absolute;
|
|
779
|
+
width: 1px;
|
|
780
|
+
height: 1px;
|
|
781
|
+
padding: 0;
|
|
782
|
+
margin: -1px;
|
|
783
|
+
overflow: hidden;
|
|
784
|
+
clip: rect(0, 0, 0, 0);
|
|
785
|
+
white-space: nowrap;
|
|
786
|
+
border: 0;
|
|
787
|
+
`,ps="https://docs.decentraland.org/creator/worlds/about/",fs="https://governance.decentraland.org";function hs(n){const r=typeof window<"u"?window.location.hostname:"";return`${r.endsWith("decentraland.org")?"https://decentraland.org":r.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(n)}`}function xs({onBack:n}){We({title:o("seo.names.title"),description:o("seo.names.description")});const{session:r,signIn:l}=ie(),{data:h}=Oe(),u=h?He(H,h):null,[c,x]=f.useState(""),[a,d]=f.useState("idle"),[p,w]=f.useState(!1),m=f.useRef(null),[C,$]=f.useState(void 0);f.useLayoutEffect(()=>{m.current&&$(m.current.offsetWidth)},[c]),f.useEffect(()=>{if(!ve(c).ok){d(c.length===0?"idle":"invalid");return}d("checking");const k=new AbortController,T=setTimeout(()=>{(async()=>{try{const g=await en(c,{signal:k.signal});d(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;d("error")}})()},400);return()=>{clearTimeout(T),k.abort()}},[c]);const b=ve(c),y=b.ok&&(a==="available"||a==="error");function S(){if(y){if(!r){l();return}w(!0)}}const j=e.jsxs(e.Fragment,{children:[o("names.claim"),u!=null?e.jsxs(ss,{children:[e.jsx(F,{}),Fe(u)]}):null]});return e.jsxs(Pn,{"data-testid":"names-page",children:[e.jsxs(Ln,{"aria-label":o("names.breadcrumbAria"),children:[e.jsx(Bn,{onClick:n,children:o("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Fn,{children:o("names.breadcrumbCurrent")})]}),e.jsxs(Wn,{children:[e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsx(Un,{children:o("names.heroTitle")}),e.jsx(Dn,{children:o("names.heroSubtitle")})]}),e.jsxs(Gn,{children:[e.jsxs(qn,{children:[e.jsxs(Vn,{invalid:a==="taken",children:[e.jsxs(Jn,{children:[e.jsx(Xn,{"aria-hidden":!0,children:"@"}),e.jsx(Yn,{value:c,onChange:E=>x(Jt(E.target.value)),placeholder:o("names.inputPlaceholder"),"aria-label":o("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:X,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Kn,{ref:m,"aria-hidden":!0,children:c||o("names.inputPlaceholder")}),e.jsx(es,{children:o("names.suffix")})]}),c.length>0?e.jsxs(ts,{"aria-hidden":!0,children:[c.length,"/",X]}):null,e.jsx(Ge,{onClick:S,disabled:!y,"data-testid":"names-claim",children:j})]}),a==="taken"?e.jsxs(Zn,{role:"status","data-testid":"names-taken",children:[e.jsx(I,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:o("names.taken")}),e.jsxs(Qn,{href:hs(c),target:"_blank",rel:"noopener noreferrer",children:[o("names.takenMakeOffer"),e.jsx(I,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(ns,{onClick:S,disabled:!y,children:j}),a==="checking"?e.jsx(se,{tone:"muted",role:"status","data-testid":"names-checking",children:o("names.checking")}):a==="error"?e.jsx(se,{tone:"muted",role:"status",children:o("names.checkError")}):a==="invalid"&&!b.ok&&b.reason==="too-short"?e.jsx(se,{tone:"muted",role:"status",children:o("names.tooShort",{min:Ue})}):null,e.jsx(ds,{role:"status","aria-live":"polite",children:a==="available"?o("names.available",{name:c}):""})]})]}),e.jsxs(os,{children:[e.jsxs(rs,{children:[e.jsx(is,{children:o("names.whyTitle")}),e.jsx(as,{children:o("names.whyIntro")})]}),e.jsxs(ls,{children:[e.jsxs(q,{children:[e.jsx(V,{src:zn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why1Title")}),e.jsx(Q,{children:o("names.why1")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:An,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why2Title")}),e.jsxs(Q,{children:[o("names.why2")," ",e.jsx(cs,{children:o("names.why2Address")})]}),e.jsxs(Pe,{href:ps,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(I,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Nn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why3Title")}),e.jsx(Q,{children:o("names.why3")})]})]}),e.jsxs(q,{children:[e.jsx(V,{src:Mn,alt:""}),e.jsxs(K,{children:[e.jsx(Z,{children:o("names.why4Title")}),e.jsx(Q,{children:o("names.why4")}),e.jsxs(Pe,{href:fs,target:"_blank",rel:"noopener noreferrer",children:[o("names.learnMore"),e.jsx(I,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),p?e.jsx(_n,{name:c,priceCredits:u,onClose:()=>w(!1)}):null]})}const us="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",oe=48;function ms(n){return{tradeId:n.tradeId??n.id,listingType:"primary",contractAddress:n.contractAddress,itemId:n.itemId??"",name:n.name,thumbnail:n.thumbnail,rarity:n.rarity,category:n.category,wearableCategory:n.wearableCategory??null,creator:n.creator,manaWei:n.manaWei??"0",available:1,network:n.network,chainId:n.chainId,createdAt:0}}function Ws(){const[n]=et(),r=Le(),l=(n.get("q")??"").trim().toLowerCase(),h=Be(),{session:u,signIn:c}=ie(),x=(n.get("q")??"").trim();We({title:x?o("seo.collectibles.searchTitle",{query:x}):o("seo.collectibles.title"),description:o("seo.collectibles.description")});const[a,d]=f.useState("wearable"),[p,w]=f.useState(null),[m,C]=f.useState([]),[$,b]=f.useState(""),[y,S]=f.useState(""),[j,E]=f.useState("on_sale"),[k,T]=f.useState(!1),[g,Y]=f.useState("newest"),[R,A]=f.useState(!1),[ae,ee]=f.useState(null);f.useEffect(()=>{if(!R)return;const i=B=>{B.key==="Escape"&&A(!1)};document.addEventListener("keydown",i);const v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.body.style.overflow=v}},[R]);const O=j==="on_sale",N=$&&!Number.isNaN(Number($))?Number($):void 0,M=y&&!Number.isNaN(Number(y))?Number(y):void 0,le=p?At[p]:void 0,ce=(we.find(i=>i.key===g)??we[0]).server,de={category:a,rarities:m.length?m:void 0,wearableCategories:le,minPriceCredits:N,maxPriceCredits:M,search:l||void 0,sortBy:ce,isSmart:k||void 0,onSale:!0},pe={category:a,rarities:m.length?m:void 0,wearableCategories:le,search:l||void 0,sortBy:ce,isWearableSmart:k||void 0,isOnSale:j==="not_for_sale"?!1:void 0},{items:P,total:fe,isLoading:_,isPlaceholderData:z,error:he,hasNextPage:qe,isFetchingNextPage:xe,fetchNextPage:Ve}=Pt(O?["shop-items",de]:["catalog-items",pe],i=>O?ct({...de,first:oe,skip:i}):dt({...pe,first:oe,skip:i}),{enabled:a!=="names"}),U=fe,ue=_||z,Ke=_?15:Math.min(Math.max(P.length,1),oe),{data:D,isError:Ze}=Oe(),Qe=i=>D&&i.manaWei?He(i.manaWei,D):null,me=f.useRef(null);f.useEffect(()=>{_||z||!l||me.current===l||(me.current=l,J("Shop Searched",{query:l,result_count:U}))},[l,_,z,U]);const G=f.useRef("__init__");f.useEffect(()=>{if(_||z)return;const i=JSON.stringify({category:a,subCategory:p,rarities:m,min:N,max:M,sort:g,status:j,smart:k});if(G.current==="__init__"||G.current===i){G.current=i;return}G.current=i,J("Shop Applied Filter",{filters:{category:a,sub_category:p,rarities:m,min_price_credits:N??null,max_price_credits:M??null,status:j,smart:k,sort:g},result_count:U})},[a,p,m,N,M,g,j,k,_,z,U]);function ge(i){d(i),w(null)}function be(i){C(v=>v.includes(i)?v.filter(B=>B!==i):[...v,i])}function Je(){d("wearable"),w(null),C([]),b(""),S(""),E("on_sale"),T(!1)}function Xe(i){const v=P.find(B=>B.id===i.id);if(!(!v||v.source!=="legacy"||!v.manaWei)){if(!u){c();return}ee(ms(v))}}function Ye(){h.invalidateQueries({queryKey:["shop-items"]})}const L=[];(N!=null||M!=null)&&L.push({key:"price",label:o("filter.price"),onRemove:()=>{b(""),S("")}});for(const i of Rt)m.includes(i)&&L.push({key:`rarity-${i}`,label:lt(i),onRemove:()=>be(i)});return k&&L.push({key:"smart",label:o("filter.smart"),onRemove:()=>T(!1)}),j!=="on_sale"&&L.push({key:"status",label:j==="all"?o("filter.statusAll"):o("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(ht,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[R?e.jsx(xt,{onClick:()=>A(!1),"aria-hidden":!0}):null,e.jsxs(ut,{className:R?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(mt,{children:[e.jsx(gt,{children:o("assets.filters")}),e.jsx(bt,{onClick:()=>A(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(yt,{children:e.jsx(wt,{category:a,subCategory:p,onCategory:ge,onSub:w,priceMin:$,priceMax:y,onPriceMin:b,onPriceMax:S,rarities:m,onToggleRarity:be,status:j,onStatus:E,smart:k,onSmart:T})}),e.jsx(jt,{children:e.jsx(vt,{type:"button",onClick:()=>A(!1),children:o("assets.showItems")})})]})]}),e.jsx(Ct,{children:a==="names"?e.jsx(xs,{onBack:()=>ge("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{sort:g,onSort:Y,total:fe,loading:_||z,query:l,onOpenFilters:()=>A(!0),chips:L,onClearChips:Je}),Ze&&O&&P.some(i=>i.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:o("assets.marketUnavailable")}):null,he?e.jsx(Lt,{message:o("assets.loadError"),testId:"browse-error"}):null,!ue&&P.length===0&&!he?e.jsxs($t,{"data-testid":"browse-empty",children:[e.jsx(kt,{src:us,alt:""}),e.jsxs(St,{children:[e.jsx(Et,{children:o("assets.empty.title")}),e.jsx(It,{children:x?e.jsxs(e.Fragment,{children:[o("assets.empty.searchBefore"),e.jsx("b",{children:x}),o("assets.empty.searchAfter")]}):o("assets.empty.filters")})]}),e.jsx(Tt,{children:e.jsx(_t,{type:"button",onClick:()=>r("/overview"),children:o("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid","data-testid":"grid",children:ue?e.jsx(je,{count:Ke}):e.jsxs(e.Fragment,{children:[P.map(i=>{if(!O)return e.jsx(te,{item:i,mode:"view"},ne(i));const v=i;return v.source==="legacy"?e.jsx(te,{item:v,mode:"market",marketPriceCredits:Qe(v),onBuyNow:Xe},ne(i)):e.jsx(te,{item:i},ne(i))}),xe?e.jsx(je,{count:6}):null]})}),e.jsx(Nt,{hasNextPage:qe,isFetching:xe,onLoadMore:()=>void Ve()})]})]})}),ae&&D?e.jsx(Mt,{listing:ae,rate:D,onClose:()=>ee(null),onSold:()=>{ee(null),Ye()}}):null]})}export{Ws as Assets};
|