@dcl/shop 0.1.0-28716680419.commit-115ef85 → 0.1.0-28716868442.commit-8bfb3b0
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/Assets-nmQB2810.js +1 -0
- package/assets/Cart-CVq8ErN4.js +1 -0
- package/assets/Collection-DrWaGsbD.js +1 -0
- package/assets/Creator-CODX4HY-.js +1 -0
- package/assets/{ExchangeController-oKZCI5Cm.js → ExchangeController-DGYlS1u1.js} +1 -1
- package/assets/GetCredits-BJ-vtPKx.js +2 -0
- package/assets/{HelpersUtil-DlwsWqwo.js → HelpersUtil-Cs7A9lff.js} +1 -1
- package/assets/ImportListings-DWEJuGBQ.js +1 -0
- package/assets/ItemDetail-CLZiYPr_.js +1 -0
- package/assets/LoadMore-DB6TwvRe.js +1 -0
- package/assets/Market-C5YZkU0k.js +1 -0
- package/assets/MyAssets-DiQ1f-Nx.js +1 -0
- package/assets/MyFavorites-D2neF-WT.js +1 -0
- package/assets/MyPurchases-CX-sT4T9.js +1 -0
- package/assets/{RealCheckout-B-VZgd32.js → RealCheckout-DVYTPQMi.js} +1 -1
- package/assets/SkeletonCards-yV2mi4oc.js +1 -0
- package/assets/{Success-UyUVmhqC.js → Success-Dty0MEac.js} +1 -1
- package/assets/{SwapController-C4kBShaN.js → SwapController-CTsLqo0R.js} +1 -1
- package/assets/{TradeService-DJv1m80G.js → TradeService-Co6yXz1n.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-BajAKkgJ.js → W3MFrameProviderSingleton-DBf03HGk.js} +3 -3
- package/assets/{WebCryptoP256-1b46_-Gp.js → WebCryptoP256-BMVi41Tf.js} +1 -1
- package/assets/{basic-BYmmYUvJ.js → basic-BKlH1yZE.js} +1 -1
- package/assets/{biconomy-Dn8n1yMa.js → biconomy-BuC8Y20q.js} +1 -1
- package/assets/{buy-gasless-DvmGkt5H.js → buy-gasless-EwLKJESl.js} +1 -1
- package/assets/{buy-B7s3xnPy.js → buy-qVYsiH8c.js} +1 -1
- package/assets/{ccip-6aROGgJo.js → ccip-BXAlyEXK.js} +1 -1
- package/assets/{ccip-ns4bJSsS.js → ccip-BhXlCEl_.js} +1 -1
- package/assets/{collection-Clqatgq9.js → collection-yK7CsBpq.js} +1 -1
- package/assets/{controller-Bv77GbzU.js → controller-D31V5T7x.js} +2 -2
- package/assets/{core-fQqw9elX.js → core-HiY9JG8Q.js} +4 -4
- package/assets/{custom-CDeGqBaz.js → custom-CNeK1SBe.js} +1 -1
- package/assets/{data-capture-Du4NJ56P.js → data-capture-BGCV8f_8.js} +1 -1
- package/assets/decimals-690uYbRk.js +1 -0
- package/assets/{decimals-DAUiLOwK.js → decimals-eyiqtEAM.js} +1 -1
- package/assets/{detectExtension-Ds3yS-BV.js → detectExtension-HGgsLFYa.js} +1 -1
- package/assets/{email-B_pxpP5c.js → email-D3mSaTDc.js} +1 -1
- package/assets/{embedded-wallet-DPVZun8j.js → embedded-wallet-BIpOn63k.js} +1 -1
- package/assets/{engine-hhTljyZB.js → engine-Cp4bGvGY.js} +1 -1
- package/assets/{estimate-l1-fee-C4oOyuI_.js → estimate-l1-fee-DqCr-VRj.js} +1 -1
- package/assets/{eth_estimateGas-D0gecbs_.js → eth_estimateGas-Btj3BdU3.js} +1 -1
- package/assets/{eth_getStorageAt-BFVhklul.js → eth_getStorageAt-cAsXEzwb.js} +1 -1
- package/assets/{eth_getTransactionCount-DCcVmIL3.js → eth_getTransactionCount-9mRngMvR.js} +1 -1
- package/assets/{extractIPFS-_lNiLeth.js → extractIPFS-Cos3MMqA.js} +1 -1
- package/assets/{features-DncncE5f.js → features-CS9ITEyv.js} +1 -1
- package/assets/{fetchTokenMetadata-DvRBbgwu.js → fetchTokenMetadata--27nDLvT.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-B7f_phjw.js → get-ecosystem-wallet-info-DsGpr1v9.js} +1 -1
- package/assets/{getBalance-BnpIAunn.js → getBalance-C1EIeWK3.js} +1 -1
- package/assets/{getInstalledModules-uDQciopR.js → getInstalledModules-CSy_anIJ.js} +1 -1
- package/assets/{getNFT-CTXTVdrc.js → getNFT-Biv4Mkbw.js} +1 -1
- package/assets/{getNFT-DoDC41xG.js → getNFT-C3k4-I_M.js} +2 -2
- package/assets/{hashTypedData-DK4wFgd9.js → hashTypedData-D-eX1daT.js} +1 -1
- package/assets/{hashTypedData-CFB72Lv_.js → hashTypedData-DCkFFbNQ.js} +1 -1
- package/assets/{import-Cnia99Q3.js → import-DjExR-_c.js} +1 -1
- package/assets/{in-app-wallet-calls-BjNeExD4.js → in-app-wallet-calls-BsZ7t_xW.js} +1 -1
- package/assets/{index-Dfm9U86F.js → index-0QSHJ5kM.js} +1 -1
- package/assets/{index-BrCIZMhr.js → index-B-iF1tO2.js} +1 -1
- package/assets/{index-Bo3uMk6y.js → index-B91_eufC.js} +1 -1
- package/assets/{index-CWLWfuhG.js → index-BBWsjtyi.js} +1 -1
- package/assets/{index-nGmuCx2o.js → index-BDnsSs1l.js} +1 -1
- package/assets/{index-BqlddYem.js → index-BEDCm9Wu.js} +1 -1
- package/assets/{index-G2m5zW4B.js → index-BP1BUYI1.js} +1 -1
- package/assets/{index-CDefEfgf.js → index-BSTJA_7O.js} +2 -2
- package/assets/{index-D9Y2-jjA.js → index-BTkTkfcn.js} +1 -1
- package/assets/{index-DbbWMdX8.js → index-BbTcdIk0.js} +1 -1
- package/assets/{index-BhN3BfbK.js → index-BgPhxGKT.js} +1 -1
- package/assets/{index-B8QnqxlO.js → index-BkdaY7_G.js} +3 -3
- package/assets/{index-BQfq4rEJ.js → index-BnFty3Li.js} +1 -1
- package/assets/{index-BBAS_XzU.js → index-BoJsJx--.js} +1 -1
- package/assets/{index-yU_-adaI.js → index-Brg6cgDQ.js} +1 -1
- package/assets/{index-CAWxx-t9.js → index-C0nXxFCO.js} +1 -1
- package/assets/{index-CLIt2qWt.js → index-CJEb8Kzs.js} +1 -1
- package/assets/{index-ra_FFhx_.js → index-CLE07-_x.js} +1 -1
- package/assets/{index-CqbILdiv.js → index-CLXqEKlA.js} +1 -1
- package/assets/{index-ORO4OGRK.js → index-CLkVyB5o.js} +1 -1
- package/assets/{index-C7mxuo2v.js → index-CLy-wBAP.js} +2 -2
- package/assets/{index-CRymZiKW.js → index-CQtzuPXx.js} +1 -1
- package/assets/{index-BwIPPZe_.js → index-CWRbefrn.js} +1 -1
- package/assets/{index-W3bT5EjH.js → index-CWgv2cWv.js} +1 -1
- package/assets/{index-DFpOueb5.js → index-CXiOQLIu.js} +1 -1
- package/assets/{index-DAPfm2Hj.js → index-CdcrnJ5_.js} +1 -1
- package/assets/{index-BZHLf8Dx.js → index-Cj7vACZe.js} +1 -1
- package/assets/{index-_6K_Lm8_.js → index-Cmk_xiBk.js} +7 -7
- package/assets/{index-C3xQgbb2.js → index-CqIROolS.js} +1 -1
- package/assets/{index-yxg1tO6a.js → index-CrBV_1yu.js} +1 -1
- package/assets/{index-Djj4c5iy.js → index-CyqLliR_.js} +3 -3
- package/assets/{index-l6gRgJ4r.js → index-D-S19rzI.js} +1 -1
- package/assets/{index-D-cD9Fhz.js → index-D1cUVAY6.js} +1 -1
- package/assets/{index-BKpKjRh2.js → index-D5uLI4BM.js} +1 -1
- package/assets/{index-Cqm_NJEy.js → index-DDLsPu5_.js} +12 -12
- package/assets/{index-CPTeXTyI.js → index-DGoPqCsR.js} +1 -1
- package/assets/{index-Bx0NX1Wy.js → index-DOExxORl.js} +1 -1
- package/assets/{index-CifOEt4M.js → index-DUVY_38U.js} +1 -1
- package/assets/index-DccLoKMC.js +2 -0
- package/assets/{index-DLmaljHx.js → index-DgAZv7hc.js} +1 -1
- package/assets/{index-BE8AJRWt.js → index-DpcKgN-v.js} +1 -1
- package/assets/{index-C0KPF2ok.js → index-DquEMs4O.js} +1 -1
- package/assets/{index-CWVYaGnK.js → index-KarPC4Z4.js} +1 -1
- package/assets/{index-BTNxDX2G.js → index-NdfBDpoO.js} +1 -1
- package/assets/{index-BI9iNAKi.js → index-Xk2toQGa.js} +1 -1
- package/assets/{index-BQIH261h.js → index-XzW65SVh.js} +1 -1
- package/assets/{index-ChCcNci6.js → index-cWedEEGZ.js} +1 -1
- package/assets/{index-CXpxRn3z.js → index-kpX0X-RL.js} +1 -1
- package/assets/{index-Dr1f_0US.js → index-m9UlXIqW.js} +1 -1
- package/assets/{index-Cd6ChLZW.js → index-xmSB5b1v.js} +1 -1
- package/assets/{index-C--hbOLp.css → index-xq0r0dow.css} +1 -1
- package/assets/{index-Cvs_N0Ve.js → index-zhHTnO6h.js} +1 -1
- package/assets/{index.es-HUt3VpyX.js → index.es-BtrYS_gk.js} +4 -4
- package/assets/{index.es-CKLkgDZt.js → index.es-CFwo152a.js} +1 -1
- package/assets/{index.es-DGdHHHtp.js → index.es-Cw0Wg8zr.js} +1 -1
- package/assets/{localBatchGatewayRequest-iNoZcrHT.js → localBatchGatewayRequest-W5wM5RIw.js} +1 -1
- package/assets/{mana-rate-C_Yy03l8.js → mana-rate-D91Nq-wO.js} +1 -1
- package/assets/network-ivZE_UMc.js +1 -0
- package/assets/{networks-BWmZZyaq.js → networks-DLxu9QYW.js} +1 -1
- package/assets/{onramp-QCIxEeo3.js → onramp-DjMFTSAW.js} +1 -1
- package/assets/{openzeppelin-xqR8JMTB.js → openzeppelin-2ZkXoMQF.js} +1 -1
- package/assets/{ownerOf-B89ptWrA.js → ownerOf-BAgrPslR.js} +1 -1
- package/assets/{parseNft-AcTYDuXN.js → parseNft-xmwbSwKx.js} +2 -2
- package/assets/{parseSignature-DpYdqsGi.js → parseSignature-DS_qYYXg.js} +3 -3
- package/assets/{parseSignature-DBgAZruJ.js → parseSignature-Dfqx4qdB.js} +1 -1
- package/assets/{pay-with-exchange-CWJUDtoF.js → pay-with-exchange-BfqKWl-i.js} +1 -1
- package/assets/{qr-overlay-DgpsQY2R.js → qr-overlay-CuzJkOyH.js} +1 -1
- package/assets/{receive-D1oWMsub.js → receive-BXV5EvIe.js} +1 -1
- package/assets/{resolveImplementation-CCmXeJg1.js → resolveImplementation-Cp1kSEV-.js} +1 -1
- package/assets/{rpc-BuAzgf8H.js → rpc-Dtax0ZGB.js} +1 -1
- package/assets/{secp256k1-DDtV5KEA.js → secp256k1-C95i4S9L.js} +1 -1
- package/assets/{secp256k1-Dnfgbr2s.js → secp256k1-D8wYY9C6.js} +1 -1
- package/assets/{secp256k1-BPbHjUCl.js → secp256k1-yf38iHjx.js} +1 -1
- package/assets/{send-BQ0FuoZ9.js → send-bACcTxXh.js} +1 -1
- package/assets/{send-batch-transaction-DyiLluuy.js → send-batch-transaction-vUlQ3f8W.js} +1 -1
- package/assets/{send-eip712-transaction-C_eikAWL.js → send-eip712-transaction-BAhg0sSO.js} +2 -2
- package/assets/{send-gasless-transaction-D7W_wzMo.js → send-gasless-transaction-Bbc--ckt.js} +2 -2
- package/assets/{sendRawTransaction-BSnJUgqM.js → sendRawTransaction-Cn-exoEI.js} +3 -3
- package/assets/{serializeTransaction-DKint7z0.js → serializeTransaction-CI3T0WRP.js} +1 -1
- package/assets/{session-proposal-D3LluU_8.js → session-proposal-D0XHSqV_.js} +1 -1
- package/assets/{session-request-DQlplaEX.js → session-request-BsTTXWj7.js} +2 -2
- package/assets/{sha256-bqbJ7V3D.js → sha256-DMkvy9Cz.js} +1 -1
- package/assets/{signing-vGxXLj5d.js → signing-DeH43Aaw.js} +4 -4
- package/assets/{socials-S8l_pJBo.js → socials-D-IAo2yx.js} +1 -1
- package/assets/{swaps-CTxiHwdM.js → swaps-BWMX0U3I.js} +1 -1
- package/assets/{thirdweb-utLlPpMo.js → thirdweb-iPhsIfpR.js} +3 -3
- package/assets/{totalSupply-B4hRGo3K.js → totalSupply-CSwsdpN_.js} +1 -1
- package/assets/{transactionReceipt-C8k8Opcm.js → transactionReceipt-U1NdpKCV.js} +1 -1
- package/assets/{transactions-2nmqx5cb.js → transactions-BkfWn19q.js} +1 -1
- package/assets/useInfiniteGrid-6pBFQ8Kh.js +1 -0
- package/assets/{verifyHash-Bf81sELO.js → verifyHash-C7RY1nlI.js} +1 -1
- package/assets/{w3m-modal-8A7Qjg8T.js → w3m-modal-1UZQLvps.js} +1 -1
- package/assets/{w3m-modal-CsNCA81W.js → w3m-modal-DMTcXY8g.js} +1 -1
- package/assets/{wait-for-tx-receipt-C76Hb5Zh.js → wait-for-tx-receipt-Dy501zTV.js} +1 -1
- package/assets/{wallet-kind-D_XdST5P.js → wallet-kind-By432Wm8.js} +1 -1
- package/assets/{wallets-D8P40Wbw.js → wallets-DpuodgNe.js} +6 -6
- package/assets/{web-connector-CkTchwt2.js → web-connector-C0IKOCFh.js} +3 -3
- package/assets/{writeContract-DmDACNNF.js → writeContract-B_fZae2g.js} +1 -1
- package/assets/{zoraTestnet-BaDaLVMN.js → zoraTestnet-DBtbozoi.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/Assets-DokepZqK.js +0 -1
- package/assets/Cart-m5buv6cO.js +0 -1
- package/assets/Collection-CQmLgLU7.js +0 -1
- package/assets/Creator-IjVK-CLN.js +0 -1
- package/assets/GetCredits-DDBBHPyF.js +0 -2
- package/assets/ImportListings-B4ddKo7M.js +0 -1
- package/assets/ItemDetail-DpuaTZWb.js +0 -1
- package/assets/Market-CmN66hf8.js +0 -1
- package/assets/MyAssets-BSfT19rO.js +0 -1
- package/assets/MyFavorites-CE_zEiSL.js +0 -1
- package/assets/MyPurchases-Dsoq_U6b.js +0 -1
- package/assets/decimals-CFPKxJPz.js +0 -1
- package/assets/index-BCqi-WJ_.js +0 -2
- package/assets/network-3abJoeoe.js +0 -1
package/index.html
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
<link rel="canonical" href="https://shop.decentraland.zone/" />
|
|
17
17
|
|
|
18
18
|
<!-- Favicon: the Decentraland mark (same as the marketplace). -->
|
|
19
|
-
<link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
20
|
-
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
19
|
+
<link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/favicon.ico" sizes="16x16 32x32 48x48" />
|
|
20
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/apple-touch-icon.png" />
|
|
21
21
|
<meta name="apple-mobile-web-app-title" content="DCL Shop" />
|
|
22
|
-
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
22
|
+
<link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/site.webmanifest" />
|
|
23
23
|
|
|
24
24
|
<!-- Open Graph -->
|
|
25
25
|
<meta property="og:type" content="website" />
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<meta name="twitter:image:alt" content="Decentraland Shop — wearables and emotes for your avatar" />
|
|
49
49
|
|
|
50
50
|
<!-- Sitemap -->
|
|
51
|
-
<link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
51
|
+
<link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/sitemap.xml" />
|
|
52
52
|
|
|
53
53
|
<!-- Warm the 3D preview / fonts -->
|
|
54
54
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
<link rel="preconnect" href="https://wearable-preview.decentraland.org" />
|
|
61
61
|
<link rel="preconnect" href="https://peer.decentraland.zone" crossorigin />
|
|
62
62
|
<link rel="preconnect" href="https://peer.decentraland.org" crossorigin />
|
|
63
|
-
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
64
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
65
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
66
|
-
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-
|
|
63
|
+
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/assets/index-DDLsPu5_.js"></script>
|
|
64
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/assets/react-E8ng6RF2.js">
|
|
65
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/assets/ethers-BxoDGoYp.js">
|
|
66
|
+
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-28716868442.commit-8bfb3b0/assets/index-xq0r0dow.css">
|
|
67
67
|
</head>
|
|
68
68
|
<body>
|
|
69
69
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/shop",
|
|
3
|
-
"version": "0.1.0-
|
|
3
|
+
"version": "0.1.0-28716868442.commit-8bfb3b0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "Decentraland",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/decentraland/shop.git"
|
|
10
10
|
},
|
|
11
|
-
"commit": "
|
|
11
|
+
"commit": "8bfb3b031970bc699938feab7aed37b5738e8860"
|
|
12
12
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as K,r as t,j as s}from"./react-E8ng6RF2.js";import{u as Q,t as E,C as W,A as Y,k as Z,f as z}from"./index-Cqm_NJEy.js";import"./ethers-BxoDGoYp.js";const C=[{key:"wearable",label:"Wearables",sub:["Head","Upper Body","Handwear","Lower Body","Feet","Accessories","Skins"]},{key:"emote",label:"Emotes",sub:[]},{key:"ens",label:"NAMEs",sub:[]},{key:"parcel",label:"Lands",sub:[]}],V={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"]},X=["common","uncommon","rare","epic","legendary","mythic","unique","exotic"],y=[{key:"newest",label:"Newest",server:"newest"},{key:"price-asc",label:"Price: Low to High",server:"cheapest"},{key:"price-desc",label:"Price: High to Low",server:"most_expensive"},{key:"name",label:"Name (A–Z)",server:"name"}];function te(){const[M]=K(),n=(M.get("q")??"").trim().toLowerCase(),[c,S]=t.useState("wearable"),[r,N]=t.useState(null),[i,w]=t.useState([]),[m,$]=t.useState(""),[h,A]=t.useState(""),[u,q]=t.useState("newest"),[l,d]=t.useState(null),b=m&&!Number.isNaN(Number(m))?Number(m):void 0,_=h&&!Number.isNaN(Number(h))?Number(h):void 0,B=r?V[r]:void 0,H=(y.find(e=>e.key===u)??y[0]).server,P={category:c,rarities:i.length?i:void 0,wearableCategories:B,minPriceCredits:b,maxPriceCredits:_,search:n||void 0,sortBy:H,first:200},{data:p,isLoading:o,error:R}=Q({queryKey:["listings",P],queryFn:()=>z(P),placeholderData:Z}),f=(p==null?void 0:p.items)??[],g=(p==null?void 0:p.total)??f.length,L=t.useRef(null);t.useEffect(()=>{o||!n||L.current===n||(L.current=n,E("Shop Searched",{query:n,result_count:g}))},[n,o,g]);const j=t.useRef("__init__");t.useEffect(()=>{if(o)return;const e=JSON.stringify({category:c,subCategory:r,rarities:i,min:b,max:_,sort:u});if(j.current==="__init__"||j.current===e){j.current=e;return}j.current=e,E("Shop Applied Filter",{filters:{category:c,sub_category:r,rarities:i,min_price_credits:b??null,max_price_credits:_??null,sort:u},result_count:g})},[c,r,i,b,_,u,o,g]);function F(e){S(e),N(null)}function O(e){w(a=>a.includes(e)?a.filter(J=>J!==e):[...a,e])}function T(){S("wearable"),N(null),w([]),$(""),A(""),d(null)}function v(e){d(a=>a===e?null:e)}const U=y.find(e=>e.key===u)??y[0],x=C.find(e=>e.key===c)??C[0],I=r?`${x.label} · ${r}`:x.label,k=!!(b||_),D=k?`${m||"0"}–${h||"∞"}`:"Price",G=c!=="wearable"||!!r||i.length>0||k;return s.jsxs("div",{className:"browse",children:[l?s.jsx("div",{className:"filterbar__scrim",onClick:()=>d(null),"aria-hidden":!0}):null,s.jsxs("div",{className:"filterbar",children:[s.jsxs("div",{className:"filterbar__filters",children:[s.jsxs("div",{className:"filterbar__item",children:[s.jsxs("button",{className:`filterbar__trigger${l==="section"?" is-open":""}${r||c!=="wearable"?" is-active":""}`,onClick:()=>v("section"),children:[I," ",s.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),l==="section"?s.jsxs("div",{className:"filter-pop filter-pop--section",children:[s.jsx("ul",{className:"filter-pop__cats",children:C.map(e=>s.jsx("li",{children:s.jsx("button",{className:`filter-pop__cat${c===e.key?" is-active":""}`,onClick:()=>F(e.key),children:e.label})},e.key))}),x.sub.length?s.jsxs("ul",{className:"filter-pop__subs",children:[s.jsx("li",{children:s.jsxs("button",{className:`filter-pop__sub${r?"":" is-active"}`,onClick:()=>{N(null),d(null)},children:["All ",x.label]})}),x.sub.map(e=>s.jsx("li",{children:s.jsx("button",{className:`filter-pop__sub${r===e?" is-active":""}`,onClick:()=>{N(a=>a===e?null:e),d(null)},children:e})},e))]}):null]}):null]}),s.jsxs("div",{className:"filterbar__item",children:[s.jsxs("button",{className:`filterbar__trigger${l==="rarity"?" is-open":""}${i.length?" is-active":""}`,onClick:()=>v("rarity"),children:["Rarity ",i.length?s.jsx("span",{className:"filterbar__badge",children:i.length}):null," ",s.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),l==="rarity"?s.jsx("div",{className:"filter-pop filter-pop--rarity",children:X.map(e=>s.jsxs("label",{className:"filter-pop__check",children:[s.jsx("input",{type:"checkbox",checked:i.includes(e),onChange:()=>O(e)}),s.jsx("span",{children:e})]},e))}):null]}),s.jsxs("div",{className:"filterbar__item",children:[s.jsxs("button",{className:`filterbar__trigger${l==="price"?" is-open":""}${k?" is-active":""}`,onClick:()=>v("price"),children:[D," ",s.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),l==="price"?s.jsxs("div",{className:"filter-pop filter-pop--price",children:[s.jsxs("div",{className:"filter-pop__price-row",children:[s.jsx("input",{type:"number",min:"0",placeholder:"Min",value:m,onChange:e=>$(e.target.value)}),s.jsx("span",{children:"–"}),s.jsx("input",{type:"number",min:"0",placeholder:"Max",value:h,onChange:e=>A(e.target.value)})]}),s.jsxs("p",{className:"filter-pop__hint",children:["Price in ",W.name]})]}):null]}),G?s.jsx("button",{className:"filterbar__clear",onClick:T,children:"Clear all"}):null]}),s.jsxs("div",{className:"filterbar__right",children:[s.jsxs("span",{className:"filterbar__count",children:[o?"…":`${f.length.toLocaleString()} item${f.length===1?"":"s"}`,n?` for “${n}”`:""]}),s.jsxs("div",{className:"filterbar__item",children:[s.jsxs("button",{className:`filterbar__sort${l==="sort"?" is-open":""}`,onClick:()=>v("sort"),children:["Sort by: ",U.label," ",s.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),l==="sort"?s.jsx("div",{className:"filter-pop filter-pop--sort",children:y.map(e=>s.jsx("button",{className:`filter-pop__sort${e.key===u?" is-active":""}`,onClick:()=>{q(e.key),d(null)},children:e.label},e.key))}):null]})]})]}),R?s.jsx("p",{className:"error",children:R.message}):null,s.jsx("div",{className:"grid",children:o?Array.from({length:15}).map((e,a)=>s.jsx("div",{className:"card card--skeleton"},a)):f.map(e=>s.jsx(Y,{item:e},e.id))}),!o&&f.length===0?s.jsx("p",{className:"muted",children:"No items match your filters."}):null]})}export{te as Assets};
|
package/assets/Cart-m5buv6cO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as z,r as j,j as e,L as T}from"./react-E8ng6RF2.js";import{j as _,d as B,u as L,l as Q,m as K,C as d,t as b,n as q,h as W,o as $,q as A,r as M,s as H,v as V,w as D,x as J,f as O}from"./index-Cqm_NJEy.js";import{f as I}from"./buy-B7s3xnPy.js";import{g as X,b as Z,w as ee,G as se}from"./buy-gasless-DvmGkt5H.js";import"./ethers-BxoDGoYp.js";import"./index-Dfm9U86F.js";function ae(a){const o=a,l=(o.message??"").toLowerCase();return o.code===4001||l.includes("reject")||l.includes("denied")||l.includes("cancel")?"You cancelled the request.":l.includes("insufficient")?`You don't have enough ${d.name} — get more first.`:l.includes("no active listing")?o.message:"Couldn't complete checkout — please try again."}function te(a){return J(a.received[0].amount)}function oe(){const a=_(s=>s.items),o=_(s=>s.remove),l=_(s=>s.clear),P=_(s=>s.add),{session:t}=B(),{data:y}=L({queryKey:["upsell-listings"],queryFn:()=>O({first:40}),staleTime:6e4}),{data:n}=Q(t),v=K(),F=z(),[g,h]=j.useState(null),[N,f]=j.useState(null),[p,C]=j.useState(!1),u=a.reduce((s,m)=>s+m.priceCredits,0),U=new Set(a.map(s=>s.id)),w=((y==null?void 0:y.items)??[]).filter(s=>!U.has(s.id)).slice(0,6);async function Y(){if(!t){f("Sign in to check out.");return}f(null),C(!0),b("Shop Started Checkout",{cart_size:a.length,cart_value_credits:u,cart_value_usd:q(u),has_sufficient_credits:((n==null?void 0:n.credits)??0)>=u});const s=a.slice(),m=[];let k="authorize",S=!1;try{h("Preparing your order…");const c=[];for(const r of a){const x=r.tradeId?await W(r.tradeId):await $(r.contractAddress,r.itemId??"");if(!x)throw new Error(`No active listing for ${r.name}.`);const G=te(x),{credit:E,maxCreditedValue:R}=await A(t.identity,G,r.tradeId);m.push(E.id),c.push({trade:x,credits:[E],maxCreditedValue:R})}h("Confirming your purchase…"),k="submit";let i=[];if(X())try{i=await Z({purchases:c,buyer:t.address,signer:t.signer}),await Promise.all(i.map(r=>ee(r))),S=!0}catch(r){if(!(r instanceof se))throw r;i=await I({purchases:c,buyer:t.address,signer:t.signer})}else i=await I({purchases:c,buyer:t.address,signer:t.signer});l(),h("Purchased! 🎉"),b("Shop Completed Purchase",{...M(s),payment_type:"credits",no_crypto_step:S,transaction_hash:i[0]??null}),v.invalidateQueries({queryKey:["usd-balance"]}),F("/success",{state:{items:s,txHash:i[0]}})}catch(c){if(console.error("[checkout] failed",c),b(V(c)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:k,error_code:H(c),value_usd:q(u),cart_size:a.length}),m.length){try{await D(t.identity,m)}catch(i){console.error("[checkout] release failed",i)}v.invalidateQueries({queryKey:["usd-balance"]})}f(ae(c)),h(null)}finally{C(!1)}}return a.length===0?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx("span",{className:"ico ico-cart cart-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"cart-empty__title",children:"Your cart is empty"}),e.jsx("p",{className:"muted",children:"Find something you love and it’ll show up here."}),e.jsx(T,{className:"btn btn--purple",to:"/assets",children:"Browse the shop"})]}):e.jsxs("div",{className:"cart",children:[e.jsxs("h1",{children:["Cart (",a.length,")"]}),e.jsx("div",{className:"cart__list",children:a.map(s=>e.jsxs("div",{className:"cart__row",children:[e.jsx("div",{className:"cart__thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}),e.jsxs("div",{className:"cart__info",children:[e.jsx("div",{className:"cart__name",children:s.name}),e.jsx("div",{className:"muted",children:s.creator?`By ${s.creator}`:""})]}),e.jsxs("div",{className:"cart__price",children:[d.symbol," ",s.priceCredits]}),e.jsx("button",{className:"link",onClick:()=>o(s.id),disabled:p,children:"Remove"})]},s.id))}),e.jsxs("div",{className:"cart__foot",children:[e.jsxs("div",{className:"cart__total",children:[e.jsxs("div",{children:["Total ",e.jsxs("strong",{children:[d.symbol," ",u]})]}),t?e.jsxs("div",{className:"muted cart__balance",children:["Your balance: ",d.symbol," ",(n==null?void 0:n.credits)??0]}):null]}),e.jsxs("div",{className:"cart__actions",children:[e.jsxs(T,{className:"btn btn--ghost",to:"/credits",children:["Get ",d.name]}),null,e.jsx("button",{className:"btn btn--ghost",onClick:l,disabled:p,children:"Clear"}),e.jsx("button",{className:"btn btn--purple",onClick:Y,disabled:p,children:"Checkout"})]})]}),g?e.jsx("p",{className:"muted",style:{marginTop:12},children:g}):null,N?e.jsx("p",{className:"error",style:{marginTop:12},children:N}):null,w.length>0?e.jsxs("div",{className:"cart-upsell",children:[e.jsx("h2",{className:"cart-upsell__title",children:"You might also like"}),e.jsx("div",{className:"cart-upsell__row",children:w.map(s=>e.jsxs("div",{className:"cart-upsell__card",children:[e.jsx("div",{className:"cart-upsell__thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}),e.jsx("div",{className:"cart-upsell__name",title:s.name,children:s.name}),e.jsxs("div",{className:"cart-upsell__price",children:[d.symbol," ",s.priceCredits]}),e.jsx("button",{className:"btn btn--sm cart-upsell__add",onClick:()=>P(s,"upsell"),disabled:p,children:"Add"})]},s.id))})]}):null]})}export{oe as Cart};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m,b as d,j as e}from"./react-E8ng6RF2.js";import{u,a as p,A as h,b as g}from"./index-Cqm_NJEy.js";import{A as x}from"./collection-Clqatgq9.js";import"./ethers-BxoDGoYp.js";function C(){var r;const{contractAddress:l}=m(),n=d(),{data:s=[],isLoading:a,error:c}=u({queryKey:["collection-page",l],enabled:!!l,queryFn:()=>g(l,{first:60})}),t=(r=s[0])==null?void 0:r.creator;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>n("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Collection"})]}),e.jsxs("header",{className:"collection-page__head",children:[e.jsx("h1",{className:"collection-page__title",children:"Collection"}),t?e.jsx(p,{address:t,className:"collection-page__creator"}):null,e.jsx("span",{className:"muted collection-page__count",children:a?"…":`${s.length.toLocaleString()} item${s.length===1?"":"s"}`})]}),!a&&s.length>0?e.jsx(x,{items:s,source:"collection"}):null,c?e.jsx("p",{className:"error",children:c.message}):null,e.jsx("div",{className:"grid",children:a?Array.from({length:12}).map((o,i)=>e.jsx("div",{className:"card card--skeleton"},i)):s.map(o=>e.jsx(h,{item:o},o.id))}),!a&&!c&&s.length===0?e.jsx("p",{className:"muted",children:"This collection has no items to show."}):null]})}export{C as Collection,C as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,a as i,b as m}from"./react-E8ng6RF2.js";import{D as n,u,a as d,A as g,E as p}from"./index-Cqm_NJEy.js";import{A as h}from"./collection-Clqatgq9.js";import"./ethers-BxoDGoYp.js";function x({address:s,className:o=""}){const l=n(a=>a.followed.includes(s.toLowerCase())),t=n(a=>a.toggle);return s?e.jsx("button",{type:"button",className:`btn btn--sm ${l?"btn--ghost":"btn--outline"} ${o}`.trim(),"aria-pressed":l,title:l?"Unfollow creator":"Follow creator",onClick:()=>t(s),children:l?"Following":"Follow"}):null}function f(){const{address:s}=i(),o=m(),{data:l=[],isLoading:t,error:a}=u({queryKey:["creator-page",s],enabled:!!s,queryFn:()=>p(s,{first:60})});return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>o("/assets"),children:"Collectibles"}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:"Creator"})]}),e.jsxs("header",{className:"collection-page__head",children:[s?e.jsx(d,{address:s,className:"collection-page__title-creator"}):null,s?e.jsx(x,{address:s}):null,e.jsx("span",{className:"muted collection-page__count",children:t?"…":`${l.length.toLocaleString()} item${l.length===1?"":"s"}`})]}),!t&&l.length>0?e.jsx(h,{items:l,source:"creator"}):null,a?e.jsx("p",{className:"error",children:a.message}):null,e.jsx("div",{className:"grid",children:t?Array.from({length:12}).map((r,c)=>e.jsx("div",{className:"card card--skeleton"},c)):l.map(r=>e.jsx(g,{item:r},r.id))}),!t&&!a&&l.length===0?e.jsx("p",{className:"muted",children:"This creator has no items to show yet."}):null]})}export{f as Creator,f as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RealCheckout-B-VZgd32.js","assets/react-E8ng6RF2.js","assets/index-Cqm_NJEy.js","assets/ethers-BxoDGoYp.js","assets/index-C--hbOLp.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{H as M,d as B,m as T,t as p,s as b,C as u,F as D,I as S,_ as V}from"./index-Cqm_NJEy.js";import{b as A,r as o,j as e}from"./react-E8ng6RF2.js";import{C as f}from"./CircularProgress-D-iaLmF3.js";import"./ethers-BxoDGoYp.js";import"./generateUtilityClasses-sji8XAMf.js";const F=.1,w=[{id:"pack_5",usd:5,credits:x(5)},{id:"pack_10",usd:10,credits:x(10)},{id:"pack_25",usd:25,credits:x(25),bestValue:!0},{id:"pack_50",usd:50,credits:x(50)}];function x(t){return Math.round(t/F)}function P(t){return w.find(s=>s.id===t)}const y="mock_cs_";function U(){return!0}async function Y(t,s){const a=P(t);if(!a)throw new Error("Unknown pack");return q(a)}async function z(t,s={}){const{intervalMs:a,timeoutMs:c,signal:n,identity:i}=s;if(t.startsWith(y)||U())return K(t,s)}function q(t){const s=`${y}${t.id}_${Date.now()}`;return E(400).then(()=>({orderId:s,clientSecret:`${y}${t.id}`,mock:!0}))}async function K(t,s={}){await E(s.intervalMs??900);const a=t.replace(y,"").replace(/_\d+$/,""),c=P(a),n=(c==null?void 0:c.credits)??0;if(s.address&&c)try{const i=await M(s.address,Math.round(c.usd*100));return{status:"credited",creditsGranted:n,newBalance:i.credits}}catch(i){return{status:"failed",error:i.message}}return{status:"credited",creditsGranted:n,newBalance:n}}function E(t,s){return new Promise((a,c)=>{setTimeout(a,t)})}const k="mock",L=o.lazy(()=>V(()=>import("./RealCheckout-B-VZgd32.js"),__vite__mapDeps([0,1,2,3,4])));function v(t){const s=t;if((s==null?void 0:s.name)==="AbortError")return"You cancelled the request.";const a=((s==null?void 0:s.message)??"").toLowerCase();return a.includes("sign in")?`Sign in to get ${u.name}.`:a.includes("timed out")?`This is taking longer than usual — your ${u.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function se(){const t=A(),{session:s,signIn:a}=B(),c=T(),[n,i]=o.useState("select"),[r,_]=o.useState(null),[m,C]=o.useState(null),[$,N]=o.useState(null),[R,h]=o.useState(null),j=o.useRef(null);o.useEffect(()=>()=>{var d;return(d=j.current)==null?void 0:d.abort()},[]);const G=o.useCallback(async d=>{if(!s){a();return}h(null),_(d),i("paying"),p("Shop Started Buy Credits",{pack_usd:d.usd,credits:d.credits,provider:k});try{const l=await Y(d.id,{address:s.address,identity:s.identity});C(l)}catch(l){console.error(l),p("Shop Buy Credits Failed",{step:"checkout",error_code:b(l),pack_usd:d.usd}),h(v(l)),i("error")}},[s,a]),I=o.useCallback(async()=>{if(!m)return;i("processing");const d=new AbortController;j.current=d;try{const l=await z(m.orderId,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});l.status==="credited"?(N(l.creditsGranted??(r==null?void 0:r.credits)??0),i("success"),p("Shop Completed Buy Credits",{order_id:m.orderId,pack_usd:(r==null?void 0:r.usd)??null,credits:l.creditsGranted??(r==null?void 0:r.credits)??0,provider:k}),c.invalidateQueries({queryKey:["usd-balance"]})):(p("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(r==null?void 0:r.usd)??null}),h(l.error??`Couldn't add your ${u.name} — please try again.`),i("error"))}catch(l){console.error(l),p("Shop Buy Credits Failed",{step:"grant",error_code:b(l),pack_usd:(r==null?void 0:r.usd)??null}),h(v(l)),i("error")}},[m,r,s,c]);function g(){var d;(d=j.current)==null||d.abort(),i("select"),_(null),C(null),N(null),h(null)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",u.name]}),e.jsxs("p",{className:"muted",children:["Add ",u.name," to your account to shop. Pay with any card."]})]}),n==="select"&&e.jsx(O,{onSelect:G}),n==="paying"&&r&&e.jsx(Q,{pack:r,checkout:m,onPaid:I,onCancel:g}),n==="processing"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(f,{size:40}),e.jsxs("p",{className:"getcredits__status-title",children:["Adding your ",u.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),n==="success"&&e.jsxs("div",{className:"getcredits__status getcredits__status--ok",role:"status","aria-live":"polite",children:[e.jsx("div",{className:"getcredits__confetti","aria-hidden":!0,children:"🎉"}),e.jsx("p",{className:"getcredits__status-title",children:"You’re all set!"}),e.jsxs("p",{className:"muted",children:[e.jsxs("strong",{children:[u.symbol," ",$]})," ",u.name," added to your account."]}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>t("/cart"),children:"Back to cart"}),e.jsxs("button",{className:"btn btn--ghost",onClick:g,children:["Get more ",u.name]})]})]}),n==="error"&&e.jsxs("div",{className:"getcredits__status getcredits__status--err",role:"alert",children:[e.jsx("p",{className:"getcredits__status-title",children:"Something went wrong"}),e.jsx("p",{className:"error",children:R}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn",onClick:g,children:"Try again"})})]})]})}function O({onSelect:t}){return e.jsx("div",{className:"packs",children:w.map(s=>e.jsxs("button",{type:"button",className:`pack${s.bestValue?" pack--best":""}`,onClick:()=>t(s),"aria-label":`Get ${S(s.credits)} for $${s.usd}`,children:[s.bestValue&&e.jsx("span",{className:"pack__ribbon",children:"Best value"}),e.jsxs("span",{className:"pack__credits",children:[e.jsx(D,{className:"pack__credits-ico"}),s.credits]}),e.jsx("span",{className:"pack__label",children:u.name}),e.jsxs("span",{className:"pack__price",children:["$",s.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",u.name]})]},s.id))})}function Q({pack:t,checkout:s,onPaid:a,onCancel:c}){return e.jsxs("div",{className:"pay",children:[e.jsxs("div",{className:"pay__summary",children:[e.jsx("button",{className:"link",onClick:c,children:"← Choose a different pack"}),e.jsxs("div",{className:"pay__summary-row",children:[e.jsx("span",{children:"You’ll get"}),e.jsxs("strong",{children:[u.symbol," ",S(t.credits)]})]}),e.jsxs("div",{className:"pay__summary-row pay__summary-row--total",children:[e.jsx("span",{children:"You pay"}),e.jsxs("strong",{children:["$",t.usd]})]})]}),e.jsx("div",{className:"pay__form",children:s?s.mock?e.jsx(W,{onPaid:a,amountUsd:t.usd}):e.jsx(o.Suspense,{fallback:e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(f,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]}),children:e.jsx(L,{clientSecret:s.clientSecret,onComplete:a})}):e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(f,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]})})]})}function W({onPaid:t,amountUsd:s}){const[a,c]=o.useState("4242 4242 4242 4242"),[n,i]=o.useState(!1);function r(){i(!0),setTimeout(()=>t(),700)}return e.jsxs("div",{className:"card-form","aria-label":"Payment details",children:[e.jsx("p",{className:"muted small card-form__note",children:"Demo mode — no real charge is made."}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Card number"}),e.jsx("input",{value:a,onChange:_=>c(_.target.value),disabled:n,inputMode:"numeric"})]}),e.jsxs("div",{className:"card-form__row",children:[e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"Expiry"}),e.jsx("input",{defaultValue:"12 / 34",disabled:n})]}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:"CVC"}),e.jsx("input",{defaultValue:"123",disabled:n,inputMode:"numeric"})]})]}),e.jsx("button",{className:"btn btn--purple card-form__pay",onClick:r,disabled:n,children:n?"Processing…":`Pay $${s}`})]})}export{se as GetCredits,se as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as L,r as d,j as e,L as E}from"./react-E8ng6RF2.js";import{t as M,C as o,d as Q,m as A,u as K,G as F}from"./index-Cqm_NJEy.js";import{i as P,f as R}from"./import-Cnia99Q3.js";import{s as Y}from"./wallet-kind-D_XdST5P.js";import"./ethers-BxoDGoYp.js";import"./buy-B7s3xnPy.js";import"./index-Dfm9U86F.js";import"./mana-rate-C_Yy03l8.js";function W({queue:n,session:k,onClose:N,onDone:u}){const f=L(),r=Y(k.providerType),[c,y]=d.useState(()=>n.map(()=>"pending")),[b,C]=d.useState("running"),S=d.useRef(!1);d.useEffect(()=>{if(S.current)return;S.current=!0;let a=!1;return(async()=>{for(let i=0;i<n.length;i++){if(a)return;y(p=>p.map((h,g)=>g===i?"active":h));try{await P(n[i].item,n[i].priceCredits,k),M("Shop Migrated Listing",{item_id:n[i].item.itemId??n[i].item.oldTradeId??null,contract_address:n[i].item.contractAddress,new_price_credits:n[i].priceCredits,new_price_usd:n[i].priceCredits/10}),a||y(p=>p.map((h,g)=>g===i?"done":h))}catch(p){const h=p,g=h.code===4001||/reject|denied|cancel/i.test(h.message??"");a||y(I=>I.map((w,t)=>t===i?g?"skipped":"failed":w))}}a||C("finished")})(),()=>{a=!0}},[]);const m=c.filter(a=>a==="done").length,x=c.findIndex(a=>a==="active"),_=Math.round(c.filter(a=>a!=="pending"&&a!=="active").length/n.length*100);function j(){u(),N()}if(b==="finished"){const a=c.filter(i=>i==="skipped"||i==="failed").length;return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal modal--success",role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:m>0?"You're in the Shop! 🎉":"Nothing listed"}),e.jsxs("p",{className:"muted",style:{margin:0},children:[m>0?`${m} ${m===1?"item is":"items are"} now for sale with ${o.name}.`:"No items were listed.",a>0?` ${a} skipped — you can try those again anytime.`:""]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:j,children:"Done"}),m>0?e.jsx("button",{className:"btn btn--purple",onClick:()=>{u(),N(),f("/assets")},children:"View in Shop"}):null]})]})})}return e.jsx("div",{className:"modal-backdrop",role:"presentation",children:e.jsxs("div",{className:"modal migrate",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx("h2",{className:"modal__title",children:"Listing your items"}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[r?"Confirm each item to add it to the Shop.":"Adding your items to the Shop."," ",x>=0?`${x+1} of ${n.length}`:""]}),e.jsx("div",{className:"migrate__progress",children:e.jsx("div",{className:"migrate__bar",style:{width:`${_}%`}})}),e.jsx("ul",{className:"migrate__list",children:n.map((a,i)=>e.jsxs("li",{className:`migrate__row migrate__row--${c[i]}`,children:[e.jsx("span",{className:"migrate__thumb",children:a.item.thumbnail?e.jsx("img",{src:a.item.thumbnail,alt:""}):null}),e.jsx("span",{className:"migrate__name",title:a.item.name,children:a.item.name||"Item"}),e.jsxs("span",{className:"migrate__price",children:[o.symbol," ",a.priceCredits.toLocaleString()]}),e.jsx("span",{className:"migrate__status",children:c[i]==="active"?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"spinner migrate__spin","aria-hidden":!0})," ",r?"Confirm…":"Adding…"]}):c[i]==="done"?e.jsx("span",{className:"migrate__tick",children:"✓"}):c[i]==="skipped"?e.jsx("span",{className:"migrate__skip",children:"Skipped"}):c[i]==="failed"?e.jsx("span",{className:"migrate__skip",children:"Failed"}):e.jsx("span",{className:"migrate__wait",children:"Waiting"})})]},a.item.oldTradeId))}),e.jsx("p",{className:"muted small migrate__hint",children:r?"A quick confirmation pops up for each item. Keep this open.":"This only takes a moment — keep this open."})]})})}const G=[{key:"creations",title:"Your creations",sub:"Items you made. Put them on sale in the Shop."},{key:"owned",title:"Items you own",sub:"Things you've bought elsewhere — resell them in the Shop."}];function X(){const{session:n,signIn:k,restore:N}=Q(),u=A(),f=n==null?void 0:n.address;d.useEffect(()=>{N()},[N]);const{data:r,isLoading:c}=K({queryKey:["importable",f],queryFn:()=>R(f),enabled:!!f}),[y,b]=d.useState({}),[C,S]=d.useState(new Set),[m,x]=d.useState(null),_=d.useMemo(()=>[...(r==null?void 0:r.creations)??[],...(r==null?void 0:r.owned)??[]],[r]);d.useEffect(()=>{_.length&&b(t=>{const l={...t};for(const s of _)l[s.oldTradeId]==null&&(l[s.oldTradeId]=s.suggestedCredits);return l})},[_]);const j=t=>!C.has(t),a=t=>y[t.oldTradeId]??t.suggestedCredits,i=_.filter(t=>j(t.oldTradeId)),p=i.reduce((t,l)=>t+a(l),0);function h(t,l){const s=l.replace(/[^\d]/g,"");b(v=>({...v,[t]:s===""?0:parseInt(s,10)}))}function g(t){S(l=>{const s=new Set(l);return s.has(t)?s.delete(t):s.add(t),s})}function I(t){return t.map(l=>({item:l,priceCredits:Math.max(1,a(l))}))}function w(){u.invalidateQueries({queryKey:["importable"]}),u.invalidateQueries({queryKey:["listings"]}),u.invalidateQueries({queryKey:["my-assets"]}),u.invalidateQueries({queryKey:["collection-sale-state"]}),F.success("Your Shop is updated.")}return n?!c&&_.length===0?e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"✨"}),e.jsx("h1",{className:"imp-empty__title",children:"You're all caught up"}),e.jsx("p",{className:"muted",children:"Everything you sell is already in the Shop — nothing to import."}),e.jsx(E,{className:"btn btn--purple",to:"/my-assets",children:"Go to My Assets"})]}):e.jsxs("div",{className:"imp",children:[e.jsxs("header",{className:"imp__head",children:[e.jsx("span",{className:"imp__eyebrow",children:"Import to the Shop"}),e.jsxs("h1",{className:"imp__title",children:["Bring your listings ",e.jsx("span",{className:"imp__grad",children:"into the Shop"})]}),e.jsxs("p",{className:"imp__lede",children:["These items are already for sale elsewhere. We suggested a price in ",o.name," for each — matched to today's rate and rounded up. Adjust anything, then list them."]})]}),e.jsxs("div",{className:"imp__ratebar",children:[e.jsx("span",{className:"imp__diamond",children:o.symbol})," 1 ",o.nameSingular," = $0.10 · prices rounded up"]}),c?e.jsx("div",{className:"imp__list",children:Array.from({length:4}).map((t,l)=>e.jsx("div",{className:"imp-row imp-row--skeleton"},l))}):G.map(t=>{const l=(r==null?void 0:r[t.key])??[];return l.length===0?null:e.jsxs("section",{className:"imp__section",children:[e.jsxs("div",{className:"imp__section-head",children:[e.jsx("h2",{className:"imp__section-title",children:t.title}),e.jsx("span",{className:"imp__section-sub",children:t.sub})]}),e.jsx("div",{className:"imp__list",children:l.map(s=>{const v=a(s),$=v!==s.suggestedCredits;return e.jsxs("article",{className:`imp-row${j(s.oldTradeId)?"":" is-off"}`,children:[e.jsx("input",{type:"checkbox",className:"imp-check",checked:j(s.oldTradeId),onChange:()=>g(s.oldTradeId),"aria-label":`Include ${s.name}`}),e.jsx("div",{className:"imp-thumb",children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{className:"imp-meta",children:[e.jsx("div",{className:"imp-name",title:s.name,children:s.name||"Item"}),e.jsx("span",{className:"imp-chip",children:s.rarity})]}),e.jsxs("div",{className:"imp-price",children:[e.jsxs("div",{className:"imp-price__field",children:[e.jsx("span",{className:"imp-price__diamond","aria-hidden":!0,children:o.symbol}),e.jsx("input",{className:"imp-price__input",inputMode:"numeric",value:v.toLocaleString(),onChange:T=>h(s.oldTradeId,T.target.value),"aria-label":`Price in ${o.name} for ${s.name}`})]}),e.jsxs("div",{className:"imp-price__sub",children:[e.jsxs("span",{children:["$",(v*.1).toFixed(2)]}),$?e.jsxs("button",{className:"imp-price__reset",onClick:()=>b(T=>({...T,[s.oldTradeId]:s.suggestedCredits})),children:["Reset to ",o.symbol,s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx("div",{className:"imp-action",children:e.jsx("button",{className:"btn btn--sm imp-row__list",disabled:!j(s.oldTradeId),onClick:()=>x(I([s])),children:"List"})})]},s.oldTradeId)})})]},t.key)}),e.jsx("div",{className:"imp-dock",children:e.jsxs("div",{className:"imp-dock__inner",children:[e.jsxs("div",{className:"imp-dock__summary",children:[e.jsxs("div",{className:"imp-dock__total",children:[e.jsx("span",{className:"imp__diamond",children:o.symbol})," ",p.toLocaleString()]}),e.jsxs("div",{className:"imp-dock__sub",children:[i.length," item",i.length===1?"":"s"," selected · $",(p*.1).toFixed(2)]})]}),e.jsx("span",{className:"imp-dock__spacer"}),e.jsxs("button",{className:"btn btn--purple imp-dock__cta",disabled:i.length===0,onClick:()=>x(I(i)),children:["List all (",i.length,")"]})]})}),m&&n?e.jsx(W,{queue:m,session:n,onClose:()=>x(null),onDone:w}):null]}):e.jsxs("div",{className:"imp-empty",children:[e.jsx("span",{className:"imp-empty__ico","aria-hidden":!0,children:"📦"}),e.jsx("h1",{className:"imp-empty__title",children:"Import your listings"}),e.jsx("p",{className:"muted",children:"Sign in to bring the items you already sell into the Shop."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>k(),children:"Sign in"})]})}export{X as ImportListings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as d,a as ce,d as ne,b as le}from"./react-E8ng6RF2.js";import{d as U,K as de,W as oe,y as E,i as V,j as S,F as K,G as ue,l as me,u as $,t as F,L as he,M as fe,a as _e,C as O,h as pe,x as xe,q as ve,r as be,w as je,n as Ie,s as Ne,v as ye,b as ge,N as we,o as Ce}from"./index-Cqm_NJEy.js";import{h as G}from"./buy-B7s3xnPy.js";import{g as ke,a as Ae,w as Ee,G as Se}from"./buy-gasless-DvmGkt5H.js";import"./ethers-BxoDGoYp.js";import"./index-Dfm9U86F.js";function Te({item:i}){const c=U(b=>{var l;return(l=b.session)==null?void 0:l.address}),{data:r}=de(c),m=c&&r?c:"default",f=i.category==="emote";return e.jsx(oe,{id:"shop-item-preview",contractAddress:i.contractAddress,tokenId:i.tokenId??void 0,itemId:i.tokenId?void 0:i.itemId??void 0,profile:m,type:f?void 0:E.PreviewType.AVATAR,emote:f?void 0:E.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:f?1.5:void 0,wheelStart:f?100:void 0,dev:V.chainId===80002,disableFadeEffect:!0},i.id)}function Le(i){return i==="male"?"♂":i==="female"?"♀":i==="unisex"?"⚥":""}function Pe({title:i,items:c,activeId:r,onSelect:m,onViewAll:f}){const b=d.useRef(null),l=S(a=>a.add),g=S(a=>a.items.map(o=>o.id));if(c.length===0)return null;function s(a){l(a,"carousel"),ue.success(`“${a.name}” added to your cart.`)}function j(a){const o=b.current;o&&o.scrollBy({left:a*Math.round(o.clientWidth*.8),behavior:"smooth"})}return e.jsxs("section",{className:"collection-carousel",children:[e.jsxs("div",{className:"collection-carousel__head",children:[e.jsx("h2",{className:"collection-carousel__title",children:i}),e.jsxs("div",{className:"collection-carousel__head-right",children:[f?e.jsx("button",{className:"collection-carousel__viewall",onClick:f,children:"View all"}):null,e.jsxs("div",{className:"collection-carousel__arrows",children:[e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>j(-1),"aria-label":"Scroll left",children:"‹"}),e.jsx("button",{className:"collection-carousel__arrow",onClick:()=>j(1),"aria-label":"Scroll right",children:"›"})]})]})]}),e.jsx("div",{className:"collection-carousel__track",ref:b,children:c.map(a=>{const o=Le(a.gender),w=a.id===r,I=a.priceCredits>0,_=g.includes(a.id);return e.jsxs("article",{className:`collection-carousel__card${w?" is-active":""}`,onClick:()=>m(a),role:"button",tabIndex:0,"aria-current":w||void 0,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),m(a))},children:[e.jsxs("div",{className:"collection-carousel__media",children:[a.thumbnail?e.jsx("img",{className:"collection-carousel__img",src:a.thumbnail,alt:a.name,loading:"lazy"}):null,I?e.jsx("button",{className:"collection-carousel__add",disabled:_,"aria-label":_?"In cart":`Add ${a.name} to cart`,title:_?"In cart":"Add to cart",onClick:h=>{h.stopPropagation(),_||s(a)},children:e.jsx("span",{className:`ico ${_?"ico-cart-solid":"ico-cart"}`,"aria-hidden":!0})}):null]}),e.jsxs("div",{className:"collection-carousel__body",children:[e.jsx("div",{className:"collection-carousel__name",title:a.name,children:a.name}),e.jsxs("div",{className:"collection-carousel__meta",children:[I?e.jsxs("span",{className:"collection-carousel__price",children:[e.jsx(K,{className:"collection-carousel__diamond"}),a.priceCredits]}):e.jsx("span",{className:"collection-carousel__price collection-carousel__na",children:"Not listed"}),e.jsxs("span",{className:"collection-carousel__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:a.rarity}),o?e.jsx("span",{className:"chip chip--icon",children:o}):null]})]})]})]},a.id)})})]})}function Re(i){return Object.values(E.Rarity).includes(i)}function $e(i){return i==="male"?"Male":i==="female"?"Female":i==="unisex"?"Unisex":null}function Fe(i){const c=i,r=(c.message??"").toLowerCase();return c.code===4001||r.includes("reject")||r.includes("denied")||r.includes("cancel")?"You cancelled the request.":r.includes("insufficient")?`You don't have enough ${O.name} — get more first.`:r.includes("no active listing")||r.includes("not for sale")?"This item is not for sale right now.":"Couldn't complete checkout — please try again."}function Ve(){const{contractAddress:i,tokenId:c}=ce(),{state:r}=ne(),m=le(),f=S(t=>t.add),b=S(t=>t.items),{session:l}=U(),{data:g}=me(l),[s,j]=d.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${i}-${c}`,name:"",creator:"",contractAddress:i??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:V.chainId,thumbnail:"",priceCredits:0,gender:null,tokenId:c??void 0,tradeId:r==null?void 0:r.tradeId}),[a,o]=d.useState(!1),[w,I]=d.useState(null),[_,h]=d.useState(null),{data:N=[],isFetched:Y}=$({queryKey:["collection-items",s.contractAddress],enabled:!!s.contractAddress,queryFn:()=>ge(s.contractAddress,{first:20})}),{data:T,isLoading:z}=$({queryKey:["shop-item",s.contractAddress,c],enabled:!(r!=null&&r.item)&&!!s.contractAddress&&!!c,queryFn:()=>we(s.contractAddress,c)});d.useEffect(()=>{T&&j(t=>t.tradeId?t:{...T})},[T]),d.useEffect(()=>{if(s.name||N.length===0)return;const t=c&&N.find(n=>n.tokenId===c||n.itemId===c)||N.find(n=>n.contractAddress===s.contractAddress);t&&j(n=>({...t,tradeId:n.tradeId??t.tradeId}))},[N]);const D=d.useMemo(()=>{const t=new Set,n=[];for(const u of N){if(u.id===s.id||s.itemId&&u.itemId===s.itemId||s.tokenId&&u.tokenId===s.tokenId)continue;const A=`${u.contractAddress}-${u.itemId??u.tokenId??u.id}`;t.has(A)||(t.add(A),n.push(u))}return n},[N,s.id,s.itemId,s.tokenId]),{data:H,isLoading:C}=$({queryKey:["detail-trade",s.id,s.tradeId,s.contractAddress,s.itemId],enabled:!!s.contractAddress,queryFn:async()=>{if(s.tradeId)return s.tradeId;if(s.itemId){const t=await Ce(s.contractAddress,s.itemId);return(t==null?void 0:t.id)??null}return null}}),v=s.tradeId??H??void 0,p=!!v,k=d.useMemo(()=>({...s,tradeId:v,id:v??s.id}),[s,v]),L=b.some(t=>t.id===k.id);d.useEffect(()=>{I(null),h(null)},[s.id]);const B=d.useRef(null);d.useEffect(()=>{!s.name||C||B.current===s.id||(B.current=s.id,F("Shop Viewed Item",{...he(s),for_sale:p}),fe(s))},[s.id,s.name,C,p]);function Q(t){j(t);const n=t.tokenId??t.itemId;t.contractAddress&&n&&m(`/item/${t.contractAddress}/${n}`,{replace:!0,state:{item:t}}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}function Z(){!p||L||f(k,"item_detail")}async function J(){var A;if(!p||!v)return;if(!l){h("Log in to check out.");return}h(null),o(!0);let t,n="authorize",u=!1;try{I(`Buying ${s.name||"item"}…`);const x=await pe(v);if(!x)throw new Error("not for sale");const P=(A=x.received)==null?void 0:A[0],ie=xe(P==null?void 0:P.amount),{credit:M,maxCreditedValue:re}=await ve(l.identity,ie,v);t=M.id,n="submit";const R={trade:x,buyer:l.address,signer:l.signer,credits:[M],maxCreditedValue:re};let y;if(ke())try{y=await Ae(R),await Ee(y),u=!0}catch(W){if(!(W instanceof Se))throw W;y=await G(R)}else y=await G(R);t=void 0,F("Shop Completed Purchase",{...be([k]),payment_type:"credits",no_crypto_step:u,transaction_hash:y??null}),m("/success",{state:{items:[k],txHash:y}})}catch(x){console.error("[detail] buy now failed:",x),t&&je(l.identity,[t]).catch(()=>{}),F(ye(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:n,error_code:Ne(x),value_usd:Ie(k.priceCredits)}),h(Fe(x)),I(null)}finally{o(!1)}}const X=Re(s.rarity)?s.rarity:E.Rarity.COMMON,[ee]=E.Rarity.getGradient(X),q=$e(s.gender),se="More from this collection",te=p?L?"In cart":C?"Checking…":"Add to cart":"Not for sale",ae=z||!!s.contractAddress&&!Y;return!s.name&&!ae?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx("span",{className:"ico ico-cart item-detail__notfound-ico","aria-hidden":!0}),e.jsx("h1",{className:"item-detail__notfound-title",children:"This item isn’t available"}),e.jsx("p",{className:"muted",children:"It may have been delisted or moved. Browse the shop for something else."}),e.jsx("button",{className:"btn btn--purple",onClick:()=>m("/assets"),children:"Browse the shop"})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":"Breadcrumb",children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>m("/assets"),children:"Collectibles"}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:s.name||"Item"})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsx("div",{className:"item-detail__preview",style:{background:`radial-gradient(circle at 50% 38%, ${ee}33 0%, var(--media) 68%)`},children:e.jsx(Te,{item:s})}),e.jsxs("div",{className:"item-detail__info",children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:s.name||"Loading…"}),e.jsx("button",{className:"item-detail__fav","aria-label":"Add to favorites",children:e.jsx("span",{className:"ico ico-heart","aria-hidden":!0})})]}),s.creator?e.jsx(_e,{address:s.creator,className:"item-detail__creator",linkToProfile:!0}):null,e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",children:s.rarity}),e.jsx("span",{className:"chip",children:s.category==="emote"?"Emote":"Wearable"}),q?e.jsx("span",{className:"chip",children:q}):null]}),e.jsxs("div",{className:"item-detail__card",children:[e.jsxs("div",{className:"item-detail__price-block",children:[e.jsx("div",{className:"item-detail__price-label",children:"Price"}),p?e.jsxs("div",{className:"item-detail__price",children:[e.jsx(K,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:s.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:"Not for sale"}),l?e.jsxs("div",{className:"item-detail__balance muted",children:["Your balance: ",O.symbol," ",(g==null?void 0:g.credits)??0]}):null]}),e.jsxs("div",{className:"item-detail__ctas",children:[p?e.jsx("button",{className:"btn btn--purple item-detail__cta",onClick:J,disabled:a||C,children:a?"Working…":"Buy now"}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Z,disabled:!p||L||C||a,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),te]})]}),w?e.jsx("p",{className:"muted item-detail__status",children:w}):null,_?e.jsx("p",{className:"error item-detail__status",children:_}):null]})]})]}),e.jsx(Pe,{title:se,items:D,activeId:s.id,onSelect:Q,onViewAll:s.contractAddress?()=>m(`/collection/${s.contractAddress}`):void 0})]})}export{Ve as ItemDetail,Ve as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ae,r as c,j as e,u as re}from"./react-E8ng6RF2.js";import{u as z,i as B,d as se,l as te,m as V,h as ie,q as ne,w as A,t as T,s as H,v as G,F as K,I as Q,C as R,A as le,k as ce,J as oe}from"./index-Cqm_NJEy.js";import{r as de,a as U,m as ue}from"./mana-rate-C_Yy03l8.js";import{h as O}from"./buy-B7s3xnPy.js";import{g as me,a as he,w as pe,G as ye}from"./buy-gasless-DvmGkt5H.js";import"./ethers-BxoDGoYp.js";import"./index-Dfm9U86F.js";function _e(){return z({queryKey:["mana-rate",B.chainId],queryFn:()=>de(B.chainId),staleTime:6e4,refetchInterval:6e4,retry:1})}function Y(a){const u=a,d=(u.message??"").toLowerCase();return u.code===4001||d.includes("reject")||d.includes("denied")||d.includes("cancel")?"You cancelled the request.":d.includes("insufficient")?`Not enough ${R.name} — get more first.`:d.includes("not found")||d.includes("no active listing")||d.includes("404")?"This item was just sold or removed. Refreshing the market…":"Couldn't complete checkout — please try again."}function fe(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function be({listing:a,rate:u,onClose:d,onSold:v}){const{session:i}=se(),{data:n}=te(i),g=V(),m=ae(),[C,f]=c.useState("confirm"),[N,h]=c.useState("Locking today’s price…"),[y,j]=c.useState(null),[s,P]=c.useState(null),p=c.useRef(null),E=Math.ceil(U(a.manaWei,u)/10);c.useEffect(()=>{let k=!1;if(!i){f("error"),j("Log in to check out.");return}return(async()=>{try{const t=await ie(a.tradeId);if(!t)throw new Error("not found");const l=U(a.manaWei,u);if(!Number.isFinite(l)||l<=0)throw new Error("price unavailable");const{credit:x,maxCreditedValue:q,usdCents:L}=await ne(i.identity,l,a.tradeId);if(k){A(i.identity,[x.id]).catch(()=>{});return}p.current=x.id,P({trade:t,credit:x,maxCreditedValue:q,usdCents:L,credits:Math.ceil(L/10)}),h("")}catch(t){if(k)return;console.error("[market] authorize failed",t),T(G(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:H(t),value_usd:Math.round(U(a.manaWei,u))/100}),f("error"),j(Y(t))}})(),()=>{k=!0,p.current&&i&&(A(i.identity,[p.current]).catch(()=>{}),p.current=null)}},[]);const b=!!s&&((n==null?void 0:n.credits)??0)<s.credits;async function w(){if(!i||!s)return;if(b){A(i.identity,[s.credit.id]).catch(()=>{}),p.current=null,m("/credits");return}f("working"),j(null);let k=!1;try{h("Confirming your purchase…");const t={trade:s.trade,buyer:i.address,signer:i.signer,credits:[s.credit],maxCreditedValue:s.maxCreditedValue};let l;if(me())try{l=await he(t),await pe(l),k=!0}catch(x){if(!(x instanceof ye))throw x;l=await O(t)}else l=await O(t);p.current=null,T("Shop Completed Purchase",{items:[{item_id:a.itemId??null,contract_address:a.contractAddress,token_id:null,price_usd:s.usdCents/100}],value_credits:s.credits,value_usd:s.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:k,transaction_hash:l??null}),g.invalidateQueries({queryKey:["usd-balance"]}),m("/success",{state:{items:[fe(a)],txHash:l}})}catch(t){console.error("[market] buy now failed",t),A(i.identity,[s.credit.id]).catch(()=>{}),p.current=null,T(G(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:H(t),value_usd:s.usdCents/100}),g.invalidateQueries({queryKey:["usd-balance"]});const l=Y(t);j(l),f("error"),/sold or removed/i.test(l)&&v()}}function I(){i&&s&&A(i.identity,[s.credit.id]).catch(()=>{}),p.current=null,d()}const _=C==="working";return e.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":`Buy ${a.name}`,children:[e.jsx("div",{className:"mkt-modal__scrim",onClick:_?void 0:I,"aria-hidden":!0}),e.jsxs("div",{className:"mkt-modal__card",children:[e.jsxs("div",{className:"mkt-modal__head",children:[e.jsx("div",{className:"mkt-modal__thumb",children:a.thumbnail?e.jsx("img",{src:a.thumbnail,alt:""}):null}),e.jsxs("div",{children:[e.jsx("div",{className:"mkt-modal__name",title:a.name,children:a.name||"Item"}),e.jsx("span",{className:"chip chip--rarity",children:a.rarity})]})]}),e.jsx("div",{className:"mkt-modal__price",children:s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Final price"}),e.jsxs("div",{className:"mkt-modal__price-value",children:[e.jsx(K,{className:"mkt-modal__diamond"}),Q(s.credits)]}),e.jsxs("div",{className:"mkt-modal__price-sub muted",children:["Locked for this purchase · $",(s.usdCents/100).toFixed(2)]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mkt-modal__price-label",children:"Today’s price"}),e.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[e.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),e.jsx(K,{className:"mkt-modal__diamond"}),Q(E)]}),e.jsx("div",{className:"mkt-modal__price-sub muted",children:N||"Locking today’s price…"})]})}),i?e.jsxs("div",{className:"mkt-modal__balance muted",children:["Your balance: ",R.symbol," ",(n==null?void 0:n.credits)??0]}):null,b?e.jsxs("p",{className:"muted mkt-modal__note",children:["You’ll need a few more ",R.name," to buy this."]}):null,N&&C==="working"?e.jsx("p",{className:"muted mkt-modal__note",children:N}):null,y?e.jsx("p",{className:"error mkt-modal__note",children:y}):null,e.jsxs("div",{className:"mkt-modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:I,disabled:_,children:"Cancel"}),e.jsx("button",{className:"btn btn--purple",onClick:w,disabled:_||!s,children:_?"Working…":b?`Get ${R.name}`:"Confirm purchase"})]})]})]})}const W=[{key:"wearable",label:"Wearables",sub:["Head","Upper Body","Handwear","Lower Body","Feet","Accessories","Skins"]},{key:"emote",label:"Emotes",sub:[]}],ke={Head:["head","hat","hair","facial_hair","eyes","eyebrows","mouth","mask","helmet","tiara","top_head"],"Upper Body":["upper_body"],Handwear:["hands_wear"],"Lower Body":["lower_body"],Feet:["feet"],Accessories:["earring","eyewear"],Skins:["skin"]},xe=["common","uncommon","rare","epic","legendary","mythic","unique","exotic"],$=[{key:"newest",label:"Newest",server:"newest"},{key:"price-asc",label:"Price: Low to High",server:"cheapest"},{key:"price-desc",label:"Price: High to Low",server:"most_expensive"},{key:"name",label:"Name (A–Z)",server:"name"}];function ve(a){return{id:a.tradeId,tradeId:a.tradeId,name:a.name,creator:a.creator,contractAddress:a.contractAddress,itemId:a.itemId,category:a.category,wearableCategory:a.wearableCategory??void 0,rarity:a.rarity,network:a.network,chainId:a.chainId,thumbnail:a.thumbnail,priceCredits:0,gender:null}}function Ae(){const[a]=re(),u=(a.get("q")??"").trim().toLowerCase(),d=V(),[v,i]=c.useState("wearable"),[n,g]=c.useState(null),[m,C]=c.useState([]),[f,N]=c.useState("newest"),[h,y]=c.useState(null),[j,s]=c.useState(null),P=n?ke[n]:void 0,p=($.find(r=>r.key===f)??$[0]).server,E={category:v,rarities:m.length?m:void 0,wearableCategories:P,search:u||void 0,sortBy:p,first:200},{data:b,isLoading:w,error:I}=z({queryKey:["legacy-listings",E],queryFn:()=>oe(E),placeholderData:ce}),{data:_,isError:k}=_e(),t=c.useMemo(()=>(b==null?void 0:b.items)??[],[b]),l=r=>_?ue(r.manaWei,_):null;function x(r){i(r),g(null)}function q(r){C(o=>o.includes(r)?o.filter(M=>M!==r):[...o,r])}function L(){i("wearable"),g(null),C([]),y(null)}function F(r){y(o=>o===r?null:r)}function D(r){const o=t.find(M=>M.tradeId===r.tradeId);o&&s(o)}function J(){d.invalidateQueries({queryKey:["legacy-listings"]})}const Z=$.find(r=>r.key===f)??$[0],S=W.find(r=>r.key===v)??W[0],X=n?`${S.label} · ${n}`:S.label,ee=v!=="wearable"||!!n||m.length>0;return e.jsxs("div",{className:"browse",children:[e.jsxs("div",{className:"market-banner",children:[e.jsx("span",{className:"market-banner__ico","aria-hidden":!0,children:"✨"}),e.jsx("span",{children:"Prices here follow the live market and may shift slightly at checkout."})]}),k?e.jsx("p",{className:"market-banner market-banner--warn",children:"The market price is temporarily unavailable — buying is paused for a moment. Please try again shortly."}):null,h?e.jsx("div",{className:"filterbar__scrim",onClick:()=>y(null),"aria-hidden":!0}):null,e.jsxs("div",{className:"filterbar",children:[e.jsxs("div",{className:"filterbar__filters",children:[e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`filterbar__trigger${h==="section"?" is-open":""}${n||v!=="wearable"?" is-active":""}`,onClick:()=>F("section"),children:[X," ",e.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),h==="section"?e.jsxs("div",{className:"filter-pop filter-pop--section",children:[e.jsx("ul",{className:"filter-pop__cats",children:W.map(r=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__cat${v===r.key?" is-active":""}`,onClick:()=>x(r.key),children:r.label})},r.key))}),S.sub.length?e.jsxs("ul",{className:"filter-pop__subs",children:[e.jsx("li",{children:e.jsxs("button",{className:`filter-pop__sub${n?"":" is-active"}`,onClick:()=>{g(null),y(null)},children:["All ",S.label]})}),S.sub.map(r=>e.jsx("li",{children:e.jsx("button",{className:`filter-pop__sub${n===r?" is-active":""}`,onClick:()=>{g(o=>o===r?null:r),y(null)},children:r})},r))]}):null]}):null]}),e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`filterbar__trigger${h==="rarity"?" is-open":""}${m.length?" is-active":""}`,onClick:()=>F("rarity"),children:["Rarity ",m.length?e.jsx("span",{className:"filterbar__badge",children:m.length}):null," ",e.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),h==="rarity"?e.jsx("div",{className:"filter-pop filter-pop--rarity",children:xe.map(r=>e.jsxs("label",{className:"filter-pop__check",children:[e.jsx("input",{type:"checkbox",checked:m.includes(r),onChange:()=>q(r)}),e.jsx("span",{children:r})]},r))}):null]}),ee?e.jsx("button",{className:"filterbar__clear",onClick:L,children:"Clear all"}):null]}),e.jsxs("div",{className:"filterbar__right",children:[e.jsxs("span",{className:"filterbar__count",children:[w?"…":`${t.length.toLocaleString()} item${t.length===1?"":"s"}`,u?` for “${u}”`:""]}),e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`filterbar__sort${h==="sort"?" is-open":""}`,onClick:()=>F("sort"),children:["Sort by: ",Z.label," ",e.jsx("span",{className:"filterbar__chev","aria-hidden":!0,children:"▾"})]}),h==="sort"?e.jsx("div",{className:"filter-pop filter-pop--sort",children:$.map(r=>e.jsx("button",{className:`filter-pop__sort${r.key===f?" is-active":""}`,onClick:()=>{N(r.key),y(null)},children:r.label},r.key))}):null]})]})]}),I?e.jsx("p",{className:"error",children:I.message}):null,e.jsx("div",{className:"grid",children:w?Array.from({length:15}).map((r,o)=>e.jsx("div",{className:"card card--skeleton"},o)):t.map(r=>e.jsx(le,{item:ve(r),mode:"market",marketPriceCredits:l(r),onBuyNow:D},r.tradeId))}),!w&&t.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null,j&&_?e.jsx(be,{listing:j,rate:_,onClose:()=>s(null),onSold:()=>{s(null),J()}}):null]})}export{Ae as Market,Ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Q,r as u,j as s,L as se}from"./react-E8ng6RF2.js";import{y as H,i as Y,O as ne,m as U,C as j,p as X,t as P,G as W,s as J,d as ae,u as F,h as te,P as ie,Q as re}from"./index-Cqm_NJEy.js";import{f as le}from"./import-Cnia99Q3.js";import{a as ce,b as oe,i as de,e as me,c as ue,d as he}from"./buy-B7s3xnPy.js";import{s as pe}from"./wallet-kind-D_XdST5P.js";import"./ethers-BxoDGoYp.js";import"./mana-rate-C_Yy03l8.js";import"./index-Dfm9U86F.js";const D=()=>`${Y.builderServerUrl}/v1`;function z(e){return Array.isArray(e)?e:"results"in e&&Array.isArray(e.results)?e.results:"data"in e&&Array.isArray(e.data)?e.data:[]}async function Z(e,i){const a=await ne(e,{method:"GET",identity:i,metadata:{}});if(!a.ok)throw new Error(`builder-server ${a.status}: ${await a.text()}`);const o=await a.json();return o.data??o}function be(e,i){const a=i-e;return a>0?a:0}function ge(e){var i,a,o,l,c;return((a=(i=e.data)==null?void 0:i.wearable)==null?void 0:a.category)??((l=(o=e.data)==null?void 0:o.emote)==null?void 0:l.category)??((c=e.data)==null?void 0:c.category)??e.type??"wearable"}function G(e){return`${D()}/storage/contents/${e}`}function L(e,i){if(!e)return"";if(/^https?:\/\//.test(e))return e;const a=i==null?void 0:i[e];return a?G(a):/^(ba|Qm)/.test(e)?G(e):""}async function ye(e,i){try{const a=await fetch(`${D()}/items/${e}/${i}/contents`);if(!a.ok)return{};const o=await a.json();return o.data??o}catch{return{}}}async function xe(e,i,a){const o=L(e.thumbnail,e.contents)||L("thumbnail.png",e.contents);if(o)return o;if(i&&a){const l=await ye(i,a);return L(e.thumbnail,l)||L("thumbnail.png",l)||L("image.png",l)}return""}async function fe(e,i){const a=`${D()}/${e.toLowerCase()}/collections?is_published=true`,o=await Z(a,i);return z(o).filter(l=>l.is_published&&!!l.contract_address).map(l=>({id:l.id,name:l.name,contractAddress:l.contract_address.toLowerCase(),isPublished:l.is_published,isApproved:l.is_approved,minters:(l.minters??[]).map(c=>c.toLowerCase())}))}async function je(e,i){const a=`${D()}/collections/${e.id}/items`,o=await Z(a,i);return(await Promise.all(z(o).map(async c=>{const I=c.rarity??"common",_=Number(c.total_supply??0)||0;let h=0;try{h=H.Rarity.getMaxSupply(I)}catch{h=0}const N=(c.contract_address??e.contractAddress).toLowerCase(),p=c.blockchain_item_id??"";return{id:c.id,collectionId:e.id,collectionName:e.name,contractAddress:N,blockchainItemId:p,name:c.name,category:ge(c),rarity:I,thumbnail:await xe(c,N,p),type:c.type??"wearable",isPublished:c.is_published??e.isPublished,isApproved:c.is_approved??e.isApproved,totalSupply:_,maxSupply:h,remainingSupply:be(_,h),minters:e.minters}}))).filter(_e)}function _e(e){return e.isPublished&&e.isApproved&&e.blockchainItemId!==""&&e.blockchainItemId!=null&&e.remainingSupply>0}async function Ne(e,i){const a=await fe(e,i);return(await Promise.all(a.map(async l=>{try{return await je(l,i)}catch{return[]}}))).flat()}const ve=1e3*60*60*24*182;function Ie(e){const i=e,a=(i.message??"").toLowerCase();return i.code===4001||a.includes("reject")||a.includes("denied")||a.includes("cancel")?"You cancelled the request.":"Couldn't list your item — please try again."}function ke({asset:e,session:i,onClose:a}){const o=U(),l=Q(),[c,I]=u.useState("10"),[_,h]=u.useState(null),[N,p]=u.useState(null),[b,C]=u.useState(!1),[x,f]=u.useState(null);async function A(){p(null);const d=Number(c);if(!Number.isInteger(d)||d<=0){p("Enter a whole number of credits");return}C(!0);try{h("Getting your item ready…"),await ce({signer:i.signer,contractAddress:e.contractAddress,chainId:e.chainId}),h("Listing your item…");const v=await oe({signer:i.signer,nft:{contractAddress:e.contractAddress,tokenId:e.tokenId,network:e.network,chainId:e.chainId},usdPrice:d/10,expiresAtMs:Date.now()+ve});h("Publishing…"),await X(v,i.identity),h(null),f(d),P("Shop Listed Item",{item_id:e.itemId??e.tokenId??null,contract_address:e.contractAddress,price_credits:d,price_usd:d/10,listing_type:"secondary",is_primary:!1}),W.success(`“${e.name}” is now on sale!`),o.invalidateQueries({queryKey:["my-assets",i.address]})}catch(v){console.error(v),P("Shop Listing Failed",{listing_type:"secondary",error_code:J(v)}),p(Ie(v)),h(null)}finally{C(!1)}}function g(){a(),l(`/item/${e.contractAddress}/${e.tokenId}`)}return x!==null?s.jsx("div",{className:"modal-backdrop",onClick:a,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:"It’s on sale! 🎉"}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:["Listed for ",s.jsxs("strong",{children:[j.symbol," ",x]})]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:a,children:"Done"}),s.jsx("button",{className:"btn btn--purple",onClick:g,children:"View in Shop"})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:a,role:"presentation",children:s.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsxs("h2",{className:"modal__title",children:["List “",e.name,"”"]}),e.image?s.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Price (",j.name,")"]}),s.jsx("input",{type:"number",min:"1",step:"1",value:c,onChange:d=>I(d.target.value),disabled:b})]}),s.jsxs("p",{className:"muted small",children:["Priced in whole ",j.name," (1 ",j.nameSingular," = $0.10)."]}),_?s.jsx("p",{className:"muted",children:_}):null,N?s.jsx("p",{className:"error",children:N}):null,s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:a,disabled:b,children:"Cancel"}),s.jsx("button",{className:"btn",onClick:A,disabled:b,children:b?"Working…":"List for sale"})]})]})})}const Ce=1e3*60*60*24*182;function Se(e){const i=e,a=(i.message??"").toLowerCase();return i.code===4001||a.includes("reject")||a.includes("denied")||a.includes("cancel")?"You cancelled the request.":"Couldn't publish your item — please try again."}function we({item:e,session:i,onClose:a}){const o=U(),l=Q(),[c,I]=u.useState("10"),[_,h]=u.useState(null),[N,p]=u.useState(null),[b,C]=u.useState(!1),[x,f]=u.useState(null),[A,g]=u.useState(null),d=Y.chainId,v=pe(i.providerType);u.useEffect(()=>{let m=!1;return(async()=>{try{const k=await de({contractAddress:e.contractAddress,chainId:d});m||f(k)}catch{m||f(!1)}})(),()=>{m=!0}},[e.contractAddress,d]);async function E(){p(null);const m=Number(c);if(!Number.isInteger(m)||m<=0){p("Enter a whole number of credits");return}C(!0);try{x||(h("Enabling sales for this collection…"),await me({signer:i.signer,contractAddress:e.contractAddress,chainId:d}),f(!0)),h("Publishing your item…");const k=await ue({signer:i.signer,item:{contractAddress:e.contractAddress,itemId:e.blockchainItemId,network:H.Network.MATIC,chainId:d},usdPrice:m/10,uses:e.remainingSupply,expiresAtMs:Date.now()+Ce});h("Finishing up…"),await X(k,i.identity),h(null),g(m),P("Shop Listed Item",{item_id:e.blockchainItemId,contract_address:e.contractAddress,price_credits:m,price_usd:m/10,listing_type:"primary",is_primary:!0}),W.success(`“${e.name}” is now on sale!`),o.invalidateQueries({queryKey:["publishable-items"]}),o.invalidateQueries({queryKey:["collection-sale-state"]})}catch(k){console.error(k),P("Shop Listing Failed",{listing_type:"primary",error_code:J(k)}),p(Se(k)),h(null)}finally{C(!1)}}function S(){a(),l(`/item/${e.contractAddress}/${e.blockchainItemId}`)}const $=b?"Working…":x===!1?"Enable & publish":"Publish for sale";return A!==null?s.jsx("div",{className:"modal-backdrop",onClick:a,role:"presentation",children:s.jsxs("div",{className:"modal modal--success",onClick:m=>m.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),s.jsx("h2",{className:"modal__title",children:"It’s on sale! 🎉"}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsx("p",{className:"modal-success__name",children:e.name}),s.jsxs("p",{className:"muted small",children:["Listed for ",s.jsxs("strong",{children:[j.symbol," ",A]})," · ",e.remainingSupply.toLocaleString()," available"]}),s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:a,children:"Done"}),s.jsx("button",{className:"btn btn--purple",onClick:S,children:"View in Shop"})]})]})}):s.jsx("div",{className:"modal-backdrop",onClick:a,role:"presentation",children:s.jsxs("div",{className:"modal",onClick:m=>m.stopPropagation(),role:"dialog","aria-modal":"true",children:[s.jsxs("h2",{className:"modal__title",children:["Publish “",e.name,"”"]}),e.thumbnail?s.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,s.jsxs("p",{className:"muted small",children:["From your collection “",e.collectionName,"” · ",e.remainingSupply.toLocaleString()," available"]}),s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Price (",j.name,")"]}),s.jsx("input",{type:"number",min:"1",step:"1",value:c,onChange:m=>I(m.target.value),disabled:b})]}),s.jsxs("p",{className:"muted small",children:["Priced in whole ",j.name," (1 ",j.nameSingular," = $0.10)."]}),x===!1&&!b?v?s.jsxs("p",{className:"muted small primary-note",children:["First time selling from “",e.collectionName,"”? It needs a one-time approval, then you’ll confirm the listing — two quick confirmations. After this, listing more items from this collection is a single step."]}):s.jsxs("p",{className:"muted small primary-note",children:["First time selling from “",e.collectionName,"”? Setting it up takes a moment — after that, listing more items from this collection is instant."]}):x===!0&&!b?v?s.jsx("p",{className:"muted small primary-note",children:"This collection is ready — publishing is a single confirmation."}):s.jsx("p",{className:"muted small primary-note",children:"This collection is ready — publishing is instant."}):null,_?s.jsx("p",{className:"muted",children:_}):null,N?s.jsx("p",{className:"error",children:N}):null,s.jsxs("div",{className:"modal__actions",children:[s.jsx("button",{className:"btn btn--ghost",onClick:a,disabled:b,children:"Cancel"}),s.jsx("button",{className:"btn",onClick:E,disabled:b||x===null,children:x===null?"Checking…":$})]})]})})}function V(e){return{id:e.id,name:e.name,creator:"",contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,rarity:e.rarity??"common",network:e.network,chainId:e.chainId,thumbnail:e.image,priceCredits:e.listingPrice??0,gender:null,tokenId:e.tokenId}}function T(e){return{id:`${e.contractAddress}-${e.blockchainItemId}`,name:e.name,creator:"",contractAddress:e.contractAddress,itemId:e.blockchainItemId,category:e.category,rarity:e.rarity,network:"MATIC",chainId:Y.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null}}function Te(){const{session:e,error:i,signIn:a,restore:o}=ae(),l=Q(),c=U(),[I,_]=u.useState(null),[h,N]=u.useState(null),[p,b]=u.useState(null),[C,x]=u.useState(null);function f(n){const t=n.tokenId??n.itemId??"";!n.contractAddress||!t||l(`/item/${n.contractAddress}/${t}`,{state:{item:n}})}async function A(n,t,r){if(e){x(null),b(r);try{const y=await te(n);await he({trade:y,signer:e.signer}),W.success(`“${t}” is no longer for sale.`),await c.invalidateQueries({queryKey:["my-assets",e.address]}),await c.invalidateQueries({queryKey:["collection-sale-state"]})}catch(y){const M=y,q=(M.message??"").toLowerCase();x(M.code===4001||q.includes("reject")||q.includes("denied")?"You cancelled the request.":"Couldn't remove the listing — please try again.")}finally{b(null)}}}u.useEffect(()=>{o()},[o]);const g=e==null?void 0:e.address,{data:d,isLoading:v,error:E}=F({queryKey:["my-assets",g],queryFn:()=>ie(g),enabled:!!g}),{data:S}=F({queryKey:["importable",g],queryFn:()=>le(g),enabled:!!g}),$=((S==null?void 0:S.creations.length)??0)+((S==null?void 0:S.owned.length)??0),{data:m,isLoading:k,isError:ee}=F({queryKey:["publishable-items",g],queryFn:()=>Ne(g,e.identity),enabled:!!e,retry:!1}),K=u.useMemo(()=>[...new Set((m??[]).map(n=>n.contractAddress))],[m]),{data:w}=F({queryKey:["collection-sale-state",g,K],enabled:K.length>0,queryFn:async()=>{const n=await Promise.all(K.map(async r=>[r,await re(r)])),t={};for(const[r,y]of n)for(const[M,q]of Object.entries(y))t[`${r}-${M}`]=q;return t}}),O=n=>w==null?void 0:w[`${n.contractAddress}-${n.blockchainItemId}`],R=u.useMemo(()=>(m??[]).filter(n=>{var t;return(t=O(n))==null?void 0:t.isOnSale}),[m,w]),B=u.useMemo(()=>{var t;const n=new Map;for(const r of m??[]){if((t=w==null?void 0:w[`${r.contractAddress}-${r.blockchainItemId}`])!=null&&t.isOnSale)continue;const y=n.get(r.collectionId)??{id:r.collectionId,name:r.collectionName,items:[]};y.items.push(r),n.set(r.collectionId,y)}return[...n.values()]},[m,w]);return e?s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:"My Assets"}),$>0?s.jsxs(se,{className:"import-banner",to:"/import",children:[s.jsx("span",{className:"import-banner__ico","aria-hidden":!0,children:"📦"}),s.jsxs("span",{className:"import-banner__text",children:[s.jsx("strong",{children:"Import your listings"}),s.jsxs("span",{className:"import-banner__sub",children:["You have ",$," item",$===1?"":"s"," for sale elsewhere — bring them into the Shop."]})]}),s.jsx("span",{className:"import-banner__cta",children:"Import"})]}):null,s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:"Items you own"}),s.jsx("p",{className:"myassets__section-sub",children:"Wearables & emotes you’ve bought — resell them in the Shop."})]}),E?s.jsx("p",{className:"error",children:E.message}):null,C?s.jsx("p",{className:"error",children:C}):null,s.jsx("div",{className:"asset-grid",children:v?Array.from({length:8}).map((n,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`sk-${t}`)):d==null?void 0:d.assets.map(n=>s.jsxs("article",{className:"asset-card asset-card--link",onClick:()=>f(V(n)),role:"link",tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),f(V(n)))},children:[s.jsx("div",{className:"asset-card__img",children:n.image?s.jsx("img",{src:n.image,alt:n.name}):null}),s.jsx("div",{className:"asset-card__name",title:n.name,children:n.name}),n.isOnSale?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"asset-card__listed",children:[s.jsxs("span",{className:"asset-card__price",children:[j.symbol," ",n.listingPrice]}),s.jsx("span",{className:"badge",children:"On sale"})]}),s.jsx("button",{className:"btn btn--sm btn--ghost asset-card__remove",disabled:p===n.id||!n.tradeId,onClick:t=>{t.stopPropagation(),n.tradeId&&A(n.tradeId,n.name,n.id)},children:p===n.id?"Removing…":"Remove listing"})]}):s.jsx("button",{className:"btn btn--sm",onClick:t=>{t.stopPropagation(),P("Shop Started Listing",{listing_type:"secondary",item_id:n.itemId??n.tokenId??null}),_(n)},children:"List for sale"})]},n.id))}),!v&&d&&d.assets.length===0?s.jsx("p",{className:"muted",children:"No items in your inventory yet."}):null]}),s.jsxs("div",{className:"myassets__section",children:[s.jsxs("div",{className:"myassets__section-head",children:[s.jsx("h2",{className:"myassets__section-title",children:"Your creations"}),s.jsxs("p",{className:"myassets__section-sub",children:["Items you made. Put them on sale in the Shop — set a price in ",j.name," and buyers pay with ",j.name,"."]})]}),k?s.jsx("div",{className:"publish-grid",children:Array.from({length:4}).map((n,t)=>s.jsx("div",{className:"asset-card asset-card--skeleton"},`pub-sk-${t}`))}):ee?s.jsx("p",{className:"publish-empty",children:"We couldn’t load your collections right now. Please try again in a moment."}):R.length===0&&B.length===0?s.jsx("p",{className:"publish-empty",children:"You don’t have any items to publish yet."}):s.jsxs(s.Fragment,{children:[R.length>0?s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:"On sale"}),s.jsx("div",{className:"publish-grid",children:R.map(n=>{var t;return s.jsxs("article",{className:"publish-card publish-card--link",onClick:()=>f(T(n)),role:"link",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),f(T(n)))},children:[s.jsx("div",{className:"publish-card__img",children:n.thumbnail?s.jsx("img",{src:n.thumbnail,alt:n.name}):null}),s.jsx("div",{className:"publish-card__name",title:n.name,children:n.name}),s.jsxs("div",{className:"publish-card__listed",children:[s.jsxs("span",{className:"publish-card__price",children:[j.symbol," ",((t=O(n))==null?void 0:t.priceCredits)??0]}),s.jsx("span",{className:"badge",children:"On sale"})]}),s.jsx("button",{className:"btn btn--sm btn--ghost publish-card__cta",disabled:p===n.id,onClick:r=>{r.stopPropagation();const y=O(n);y!=null&&y.tradeId&&A(y.tradeId,n.name,n.id)},children:p===n.id?"Removing…":"Remove listing"})]},`${n.contractAddress}-${n.blockchainItemId}`)})})]}):null,B.map(n=>s.jsxs("div",{className:"creations-collection",children:[s.jsx("h3",{className:"creations-collection__name",children:n.name}),s.jsx("div",{className:"publish-grid",children:n.items.map(t=>s.jsxs("article",{className:"publish-card publish-card--link",onClick:()=>f(T(t)),role:"link",tabIndex:0,onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),f(T(t)))},children:[s.jsx("div",{className:"publish-card__img",children:t.thumbnail?s.jsx("img",{src:t.thumbnail,alt:t.name}):null}),s.jsx("div",{className:"publish-card__name",title:t.name,children:t.name}),s.jsxs("div",{className:"publish-card__meta",children:[s.jsx("span",{className:"publish-chip publish-chip--rarity",children:t.rarity}),s.jsxs("span",{className:"publish-card__supply",children:[t.remainingSupply.toLocaleString()," available"]})]}),s.jsx("button",{className:"btn btn--sm btn--purple publish-card__cta",onClick:r=>{r.stopPropagation(),P("Shop Started Listing",{listing_type:"primary",item_id:t.blockchainItemId}),N(t)},children:"Put on sale"})]},`${t.contractAddress}-${t.blockchainItemId}`))})]},n.id))]})]}),I?s.jsx(ke,{asset:I,session:e,onClose:()=>_(null)}):null,h?s.jsx(we,{item:h,session:e,onClose:()=>N(null)}):null]}):s.jsxs("section",{className:"myassets",children:[s.jsx("h1",{children:"My Assets"}),s.jsx("p",{className:"muted",children:"Sign in to sell your items."}),s.jsx("div",{className:"connect-row",children:s.jsx("button",{className:"btn btn--purple",onClick:()=>a(),children:"Sign in"})}),i?s.jsx("p",{className:"error",children:i}):null]})}export{Te as MyAssets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,L as a}from"./react-E8ng6RF2.js";import{c as i,A as r}from"./index-Cqm_NJEy.js";import"./ethers-BxoDGoYp.js";function l(){const e=i(t=>Object.values(t.items));return e.length===0?s.jsxs("div",{className:"favorites-empty",children:[s.jsx("span",{className:"ico ico-heart favorites-empty__ico","aria-hidden":!0}),s.jsx("p",{className:"favorites-empty__title",children:"No favorites yet"}),s.jsx("p",{className:"muted",children:"Tap the heart on any item to save it here."}),s.jsx(a,{className:"btn btn--purple",to:"/assets",children:"Browse the shop"})]}):s.jsxs("section",{className:"favorites",children:[s.jsxs("div",{className:"favorites__head",children:[s.jsx("h1",{children:"My Favorites"}),s.jsxs("span",{className:"favorites__count",children:[e.length," item",e.length>1?"s":""]})]}),s.jsx("div",{className:"grid",children:e.map(t=>s.jsx(r,{item:t},t.id))})]})}export{l as MyFavorites};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,L as d}from"./react-E8ng6RF2.js";import{d as u,u as h,C as l,e as o,g as m}from"./index-Cqm_NJEy.js";import"./ethers-BxoDGoYp.js";function p(s){try{return new Date(s).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function _({status:s}){return s==="PENDING"?e.jsx("span",{className:"purchase__badge purchase__badge--pending",children:"Processing"}):e.jsx("span",{className:"purchase__badge purchase__badge--done",children:"Completed"})}function x({purchase:s}){const{data:a}=h({queryKey:["trade-display",s.tradeId],queryFn:()=>o(s.tradeId),enabled:!!s.tradeId,staleTime:3e5}),t=(a==null?void 0:a.name)??"Item",c=(a==null?void 0:a.thumbnail)??"",r=(a==null?void 0:a.tokenId)??(a==null?void 0:a.itemId)??"",n=a!=null&&a.contractAddress&&r?`/item/${a.contractAddress}/${r}`:void 0,i=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"purchase__thumb",children:c?e.jsx("img",{src:c,alt:t}):null}),e.jsxs("div",{className:"purchase__info",children:[e.jsx("div",{className:"purchase__name",title:t,children:t}),e.jsx("div",{className:"muted purchase__date",children:p(s.createdAt)})]}),e.jsx(_,{status:s.status}),e.jsxs("div",{className:"purchase__price",children:[l.symbol," ",s.credits]})]});return n?e.jsx(d,{className:"purchase",to:n,children:i}):e.jsx("div",{className:"purchase",children:i})}function g(){const{session:s}=u(),{data:a,isLoading:t}=h({queryKey:["purchases",s==null?void 0:s.address],queryFn:()=>m(s.address,s.identity),enabled:!!s});if(!s)return e.jsxs("div",{className:"purchases-empty",children:[e.jsx("span",{className:"ico ico-cart purchases-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"purchases-empty__title",children:"Sign in to see your purchases"}),e.jsx("p",{className:"muted",children:"Your order history shows up here once you sign in."})]});const c=(a??[]).filter(r=>r.status!=="EXPIRED");return!t&&c.length===0?e.jsxs("div",{className:"purchases-empty",children:[e.jsx("span",{className:"ico ico-cart purchases-empty__ico","aria-hidden":!0}),e.jsx("p",{className:"purchases-empty__title",children:"No purchases yet"}),e.jsx("p",{className:"muted",children:"When you buy something it’ll appear here."}),e.jsx(d,{className:"btn btn--purple",to:"/assets",children:"Browse the shop"})]}):e.jsxs("section",{className:"purchases",children:[e.jsxs("div",{className:"purchases__head",children:[e.jsx("h1",{children:"My Purchases"}),t?null:e.jsxs("span",{className:"purchases__count",children:[c.length," order",c.length>1?"s":""]})]}),e.jsx("div",{className:"purchases__list",children:t?Array.from({length:4}).map((r,n)=>e.jsx("div",{className:"purchase purchase--skeleton"},n)):c.map(r=>e.jsx(x,{purchase:r},r.id))})]})}export{g as MyPurchases};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as r}from"./utils-CtSpY5KY.js";import{d as a}from"./decimals-DAUiLOwK.js";import"./ethers-BxoDGoYp.js";import"./react-E8ng6RF2.js";import"./signing-vGxXLj5d.js";import"./index-Cqm_NJEy.js";async function s(c){return r(()=>a(c),{cacheKey:`${c.contract.chain.id}:${c.contract.address}:decimals`,cacheTime:Number.POSITIVE_INFINITY})}export{s as decimals};
|