@dcl/shop 0.1.0-29486857005.commit-ce86113 → 0.1.0-29495843989.commit-0baa544
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-CSKpoAiw.js → AnimatedBackground-D3Gy9n8c.js} +3 -3
- package/assets/Assets-DM_Z2lkK.js +1 -0
- package/assets/{Cart-BsA0l3Fx.js → Cart-BX0thVlr.js} +1 -1
- package/assets/{CircularProgress-DMraLpW6.js → CircularProgress-DWai3Bv9.js} +1 -1
- package/assets/{Collection-DWjxItgF.js → Collection-rweWV0Uz.js} +1 -1
- package/assets/{Creator-CBtQR_MS.js → Creator-CP4fBHy7.js} +1 -1
- package/assets/{ExchangeController-B16TY4R0.js → ExchangeController-C9NMWHfu.js} +1 -1
- package/assets/GetCredits-B4UFplQh.js +1 -0
- package/assets/{HelpersUtil-dzcCVi2C.js → HelpersUtil-BWtRwz2S.js} +1 -1
- package/assets/{ImportListings-_bk6or2o.js → ImportListings-D16mAgR-.js} +1 -1
- package/assets/{ItemDetail-Be-4Ssog.js → ItemDetail-CgUb4pzW.js} +2 -2
- package/assets/{MyAssets-DEmMtRyU.js → MyAssets-D8fDqZbL.js} +1 -1
- package/assets/{MyFavorites-HEVUxqJp.js → MyFavorites-CgBszoEh.js} +1 -1
- package/assets/{MyPurchases-8ga0dHjm.js → MyPurchases-DlYgUcz5.js} +1 -1
- package/assets/{NotFound-DdEDiuzm.js → NotFound-Beomq6OS.js} +1 -1
- package/assets/{Success-BbjHoCHE.js → Success-D7IYJbUz.js} +1 -1
- package/assets/{SwapController-DCkTtU5I.js → SwapController-D_MhWpcG.js} +1 -1
- package/assets/{TradeService-pRIg7XVx.js → TradeService-vWJIo6w8.js} +1 -1
- package/assets/{W3MFrameProviderSingleton-CXl-VmLK.js → W3MFrameProviderSingleton-DzlOG4gc.js} +3 -3
- package/assets/{WebCryptoP256-Df_sac4N.js → WebCryptoP256-Bx70NcxT.js} +1 -1
- package/assets/{basic-Dn0p8_wv.js → basic-XnyRjywq.js} +1 -1
- package/assets/{biconomy-7SGKW4cr.js → biconomy-C4h3r-aU.js} +1 -1
- package/assets/{buy-DdD2tVOt.js → buy-6ch17rLn.js} +1 -1
- package/assets/{buy-gasless-CpnilQaQ.js → buy-gasless-CxJZG2RA.js} +1 -1
- package/assets/{ccip-CJmMit3f.js → ccip-Bnoxu2Lf.js} +1 -1
- package/assets/{ccip-D_wuC5BK.js → ccip-CdY2l1_z.js} +1 -1
- package/assets/{collection-Bre_UDGz.js → collection-Bfwcw1Pv.js} +1 -1
- package/assets/{controller-BZ4xpOjj.js → controller-BtgcJEiB.js} +2 -2
- package/assets/{core-CjT_lqV1.js → core-BIaaqL8C.js} +4 -4
- package/assets/{custom-DQBoiONc.js → custom-BrViAam0.js} +1 -1
- package/assets/{data-capture-B3AYrdO6.js → data-capture-PE-40fOT.js} +1 -1
- package/assets/{decimals-Dc4qfMjN.js → decimals-ChbOFqgz.js} +1 -1
- package/assets/decimals-bIY5Oj70.js +1 -0
- package/assets/{detectExtension-ovPs-dj4.js → detectExtension-DkJJuvPf.js} +1 -1
- package/assets/{email-xwWqtQnU.js → email-B8G0iBV_.js} +1 -1
- package/assets/{embedded-wallet-DI3H8Dp6.js → embedded-wallet-CBQOWksv.js} +1 -1
- package/assets/{emotion-styled.browser.esm-36X_ITjC.js → emotion-styled.browser.esm-DKYYKjNd.js} +1 -1
- package/assets/{engine-BtYtwZv4.js → engine-D-u2ITDe.js} +1 -1
- package/assets/{estimate-l1-fee-Cb-qEiTe.js → estimate-l1-fee-Ce2XyKSe.js} +1 -1
- package/assets/{eth_estimateGas-CSrtyRoQ.js → eth_estimateGas-Gs01iEix.js} +1 -1
- package/assets/{eth_getStorageAt-DJjWRJF_.js → eth_getStorageAt-C6FiR47S.js} +1 -1
- package/assets/{eth_getTransactionCount-C5GlZrlM.js → eth_getTransactionCount-DWBAGX_2.js} +1 -1
- package/assets/{extractIPFS-xnudoWDm.js → extractIPFS-CwQSuIDH.js} +1 -1
- package/assets/{features-CAcjGpNA.js → features-DHRXuzkb.js} +1 -1
- package/assets/{fetchTokenMetadata-DDaIpKWd.js → fetchTokenMetadata-BnhlOm1g.js} +2 -2
- package/assets/{get-ecosystem-wallet-info-C16xfGwK.js → get-ecosystem-wallet-info-D2AqnnCA.js} +1 -1
- package/assets/{getBalance-B-GgCbdt.js → getBalance-6XZEzEZw.js} +1 -1
- package/assets/{getInstalledModules-BxBiIEfa.js → getInstalledModules-CXEInKkm.js} +1 -1
- package/assets/{getNFT-CMGbD-To.js → getNFT-BdpIOeCP.js} +2 -2
- package/assets/{getNFT-iRVC3Ytu.js → getNFT-NqI0oC5o.js} +1 -1
- package/assets/{hashTypedData-CarJl_v0.js → hashTypedData-DLdYR8R7.js} +1 -1
- package/assets/{hashTypedData-DHMAmH7d.js → hashTypedData-eF3tdeXu.js} +1 -1
- package/assets/{import-CrwTfMPH.js → import-DxE4fKhA.js} +1 -1
- package/assets/{in-app-wallet-calls-BwHafzWk.js → in-app-wallet-calls-C93lu0n9.js} +1 -1
- package/assets/{index-DnlsRgzG.js → index-23lSOtZN.js} +1 -1
- package/assets/{index-DX4cZMjY.js → index-5OA3QXPs.js} +1 -1
- package/assets/{index-B2jc3TwW.js → index-9O17hGpO.js} +1 -1
- package/assets/{index-BsGRXrXC.js → index-9rd0DkIw.js} +1 -1
- package/assets/{index-D9DqvxxL.js → index-B1r6lfiW.js} +1 -1
- package/assets/{index-CkRnMhP5.js → index-B4KBZ-30.js} +28 -28
- package/assets/{index-BCt-8dc9.js → index-B86g_TxX.js} +1 -1
- package/assets/{index-DZgUD1sN.js → index-BDL22mLG.js} +1 -1
- package/assets/{index-D9hH77ze.js → index-BINxsZdy.js} +1 -1
- package/assets/{index-Bvs_uTLV.js → index-BKivAZuY.js} +1 -1
- package/assets/{index-CzLgJ4m5.js → index-BNzQ7Yn2.js} +1 -1
- package/assets/{index-CzMiA3Qu.js → index-BP31ftNV.js} +1 -1
- package/assets/{index-OJItZh8l.js → index-BeZo1vmU.js} +1 -1
- package/assets/{index-BWCC_-hh.js → index-BkZ3OMC_.js} +1 -1
- package/assets/{index-RA3saodL.js → index-BkhvY9_I.js} +3 -3
- package/assets/{index-BAgwZfdn.js → index-BqBn12GD.js} +1 -1
- package/assets/{index-C2hRR_bo.js → index-BvNQjv1T.js} +2 -2
- package/assets/{index-YLAXjMX1.js → index-Bxld0u_6.js} +1 -1
- package/assets/{index-DkwAtvPl.js → index-C3f3w75X.js} +1 -1
- package/assets/{index-FpR597Ri.js → index-C3kGSCQV.js} +3 -3
- package/assets/{index-O_NpD4QP.js → index-CCNUo_gT.js} +1 -1
- package/assets/{index-Bnq2aytU.js → index-CJJsswRN.js} +1 -1
- package/assets/{index-tZIsTXgW.js → index-CJzTqBXf.js} +1 -1
- package/assets/{index-C-kEogT0.js → index-CKNdoVdY.js} +1 -1
- package/assets/{index-DjI-5ALg.js → index-CLWAajM1.js} +1 -1
- package/assets/{index-Bm6K2qdv.js → index-CSPamf9F.js} +1 -1
- package/assets/{index-fG3R-MKm.js → index-ChYPr03d.js} +1 -1
- package/assets/{index-DVXQMtwt.js → index-CkJXcS4y.js} +1 -1
- package/assets/{index-n6lZYWT1.js → index-Cn-neAze.js} +1 -1
- package/assets/{index-IqW6gcOL.js → index-CpBHoJxI.js} +1 -1
- package/assets/{index-mtyQxy2f.js → index-CpzpQgRm.js} +1 -1
- package/assets/{index-3dJ63MCY.js → index-CqqCPemC.js} +1 -1
- package/assets/{index-DGpOJwn6.js → index-Crtrv-sd.js} +1 -1
- package/assets/{index-CzRZzgdu.js → index-CzpN2YW5.js} +1 -1
- package/assets/{index-QKQGloH4.js → index-D2INhRK8.js} +1 -1
- package/assets/{index-BEXf5O4m.js → index-DA3E9stj.js} +1 -1
- package/assets/{index-CFoKvG3n.js → index-DHm29hjg.js} +1 -1
- package/assets/{index-DezL01cH.js → index-DKZ1F35w.js} +1 -1
- package/assets/{index-aE3V3IWZ.js → index-DTTxIIQh.js} +2 -2
- package/assets/{index-DA8NVLd4.js → index-DTePQG0p.js} +1 -1
- package/assets/{index-Cb7_JofM.js → index-D_58xTrv.js} +1 -1
- package/assets/{index-D0-n2X98.js → index-DaItAVBT.js} +1 -1
- package/assets/{index-Chf91iaL.js → index-DbJ9Stq6.js} +1 -1
- package/assets/{index-CLB6UmN7.js → index-DeXqvind.js} +1 -1
- package/assets/{index-BmICK3rq.js → index-Di-Jg-J4.js} +1 -1
- package/assets/{index-BTzOLXWY.js → index-Dn-Bfk0b.js} +1 -1
- package/assets/{index-DAI07wBB.js → index-DqJqhCvH.js} +1 -1
- package/assets/{index-CMpX-Ctb.js → index-Dt8dzVyE.js} +1 -1
- package/assets/{index-BCVzWbca.js → index-DuNKJP0b.js} +1 -1
- package/assets/{index-DdpTnx7n.js → index-DvpyoeV3.js} +1 -1
- package/assets/{index-g4d_m9FW.js → index-EdNSEiRj.js} +2 -2
- package/assets/{index-BmEkOtyq.js → index-EkDY0XDC.js} +1 -1
- package/assets/{index-Ch4e0UNv.js → index-pOEGQPZP.js} +1 -1
- package/assets/{index.es-Dx7ZI9-M.js → index.es-4xyRJ0dX.js} +4 -4
- package/assets/{index.es-JJCCiy_4.js → index.es-CKI_PFVB.js} +1 -1
- package/assets/{index.es-Ckybqs62.js → index.es-tHG2pIgS.js} +1 -1
- package/assets/{localBatchGatewayRequest-ChMRYED3.js → localBatchGatewayRequest-KKa4XmPl.js} +1 -1
- package/assets/{mana-rate-Cfr_j_TR.js → mana-rate-jYuh3Bpg.js} +1 -1
- package/assets/network-CEIK-Msp.js +1 -0
- package/assets/{networks-CqEhvTd8.js → networks-HgsFj36f.js} +1 -1
- package/assets/{onramp-ByryxKM_.js → onramp-CFBC_-uy.js} +1 -1
- package/assets/{openzeppelin-B2qGNv-B.js → openzeppelin-Dv2ZaH5E.js} +1 -1
- package/assets/{ownerOf-C6RmDZCo.js → ownerOf-C17uE7_W.js} +1 -1
- package/assets/{parseNft-CTk9tOkF.js → parseNft-CjOZB3FJ.js} +2 -2
- package/assets/{parseSignature-xCBdpaBO.js → parseSignature-B1ph5Hff.js} +3 -3
- package/assets/{parseSignature-5Nhh1cQd.js → parseSignature-DPyec4ef.js} +1 -1
- package/assets/{pay-with-exchange-CcouL09J.js → pay-with-exchange-ByeSYsXl.js} +1 -1
- package/assets/{qr-overlay-BIP1og2B.js → qr-overlay-Dhx6Fe0G.js} +1 -1
- package/assets/{receive-BWhuAEkD.js → receive-1DBj48Hd.js} +1 -1
- package/assets/{resolveImplementation-oCBtEFvI.js → resolveImplementation-CwN0iqcw.js} +1 -1
- package/assets/{rpc-D2zf8CFL.js → rpc-ttcVNFRF.js} +1 -1
- package/assets/{secp256k1-Ds6DHtr8.js → secp256k1-Bn9D14Kp.js} +1 -1
- package/assets/{secp256k1-DcCEX9gr.js → secp256k1-BtL81a_K.js} +1 -1
- package/assets/{secp256k1-BzU9f319.js → secp256k1-CL7k4ogY.js} +1 -1
- package/assets/{send-D_IKoN1O.js → send-CXpW5sHD.js} +1 -1
- package/assets/{send-batch-transaction-DpI5HMBm.js → send-batch-transaction-DOrDXIAs.js} +1 -1
- package/assets/{send-eip712-transaction-DaBDMwTZ.js → send-eip712-transaction-Co7_YbJn.js} +2 -2
- package/assets/{send-gasless-transaction-D4LWcd6G.js → send-gasless-transaction-DAbe8qj-.js} +2 -2
- package/assets/{sendRawTransaction-CszgHKWD.js → sendRawTransaction-ZRWfAJA8.js} +3 -3
- package/assets/{serializeTransaction-ZkqjwQkO.js → serializeTransaction-eqvsiWFa.js} +1 -1
- package/assets/{session-proposal-Bc8YGAm4.js → session-proposal-DSrkGWxp.js} +1 -1
- package/assets/{session-request-Dj818-sL.js → session-request-Bq16piG3.js} +2 -2
- package/assets/{sha256-CKmH0Dua.js → sha256-CDrDGww-.js} +1 -1
- package/assets/{signing-DAZWuXp4.js → signing-DDwE02O8.js} +4 -4
- package/assets/{socials-DmAY69OM.js → socials-BQRxZ0du.js} +1 -1
- package/assets/{swaps-COmDRwgN.js → swaps-_wvKv0dm.js} +1 -1
- package/assets/{thirdweb-B-0DLC9q.js → thirdweb-Bf_vE0ea.js} +3 -3
- package/assets/{totalSupply-DQDHFHMq.js → totalSupply-D9Uv0g4N.js} +1 -1
- package/assets/{trade-encoding-B5I2gNLg.js → trade-encoding-DmF15n2Y.js} +1 -1
- package/assets/{transactionReceipt-CJXYkmwS.js → transactionReceipt-ZV7fu-qH.js} +1 -1
- package/assets/{transactions-gl-nw0jT.js → transactions-xNkbA_iy.js} +1 -1
- package/assets/{useInfiniteGrid-BD4id0JM.js → useInfiniteGrid-DldqpHDP.js} +1 -1
- package/assets/{verifyHash-XFubsvFC.js → verifyHash-cttLXwBU.js} +1 -1
- package/assets/{w3m-modal-DeRCNq5n.js → w3m-modal-a9MqER_Q.js} +1 -1
- package/assets/{w3m-modal-8lsHZRB7.js → w3m-modal-tF9Sv1xA.js} +1 -1
- package/assets/{wait-for-tx-receipt-BVdPvNLp.js → wait-for-tx-receipt-C-Gv9HCq.js} +1 -1
- package/assets/{wallet-kind-BvMpmLyJ.js → wallet-kind-DHmwqCrn.js} +1 -1
- package/assets/{wallets-BFvxk__C.js → wallets-DjUCXU7M.js} +6 -6
- package/assets/{web-connector-UGHKV2Ge.js → web-connector-DTM8ISyy.js} +3 -3
- package/assets/{writeContract-C5U9S2xh.js → writeContract-CFe8dzYy.js} +1 -1
- package/assets/{zoraTestnet-B5N5CLBq.js → zoraTestnet-DLxM002k.js} +1 -1
- package/index.html +8 -8
- package/package.json +2 -2
- package/assets/Assets-CXLUVOrg.js +0 -1
- package/assets/GetCredits-DUYI8o5g.js +0 -1
- package/assets/decimals-9K2S3utA.js +0 -1
- package/assets/network-_2ZZuLRN.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-29495843989.commit-0baa544/favicon.ico" sizes="16x16 32x32 48x48" />
|
|
20
|
+
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29495843989.commit-0baa544/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-29495843989.commit-0baa544/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-29495843989.commit-0baa544/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-29495843989.commit-0baa544/assets/index-B4KBZ-30.js"></script>
|
|
64
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29495843989.commit-0baa544/assets/react-iAgwec9M.js">
|
|
65
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29495843989.commit-0baa544/assets/ethers-D-4WUfRB.js">
|
|
66
|
+
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29495843989.commit-0baa544/assets/index-Ctf6wteV.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-29495843989.commit-0baa544",
|
|
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": "0baa54443f06e9f2a8f1dc3c57cddd047d8886aa"
|
|
12
12
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,a as fe,d as ye}from"./react-iAgwec9M.js";import{u as xe,i as z,c as ke,v as je,w as ae,h as Ne,q as ge,F as ve,J as A,z as R,I as D,H as V,e as E,aj as J,x as Ce,y as H,A as Z,am as we}from"./index-CkRnMhP5.js";import{r as Se,a as U,m as Ee}from"./mana-rate-Cfr_j_TR.js";import{S as X}from"./SkeletonCards-BhzQlTiQ.js";import{L as Ie}from"./LoadMore-8Dx5lULo.js";import{a as ee}from"./buy-DdD2tVOt.js";import{g as Me,a as Fe,w as Pe,S as Ae,G as Re}from"./buy-gasless-CpnilQaQ.js";import{u as $e}from"./useInfiniteGrid-BD4id0JM.js";import"./ethers-D-4WUfRB.js";import"./index-3dJ63MCY.js";import"./trade-encoding-B5I2gNLg.js";function Le(){return xe({queryKey:["mana-rate",z.chainId],queryFn:()=>Se(z.chainId),staleTime:6e4,refetchInterval:6e4,retry:1})}const Be=[{key:"all",label:"Shop All"},{key:"wearable",label:"Wearables",expandable:!0,subs:[{key:"Head",label:"Head",icon:"cat-head"},{key:"Upper Body",label:"Upper Body",icon:"cat-upper"},{key:"Handwear",label:"Handwear",icon:"cat-handwear"},{key:"Lower Body",label:"Lower Body",icon:"cat-lower"},{key:"Feet",label:"Feet",icon:"cat-feet"},{key:"Accessories",label:"Accessories",icon:"cat-accessories"},{key:"Skins",label:"Skins",icon:"cat-skins"}]},{key:"emote",label:"Emotes",expandable:!0,subs:[{key:"Dance",label:"Dance",icon:"emote-dance"},{key:"Stunt",label:"Stunt",icon:"emote-stunt"},{key:"Greetings",label:"Greetings",icon:"emote-greetings"},{key:"Fun",label:"Fun",icon:"emote-fun"},{key:"Poses",label:"Poses",icon:"emote-poses"},{key:"Reactions",label:"Reactions",icon:"emote-reactions"},{key:"Horror",label:"Horror",icon:"emote-horror"},{key:"Miscellaneous",label:"Miscellaneous",icon:"emote-misc"}]}];function qe({category:s,subCategory:c,onCategory:o,onSub:b}){const[t,d]=l.useState(()=>s==="wearable"?"wearable":null);function y(r){r.subs?d(m=>{const h=m!==r.key;return h&&o(r.key),h?r.key:null}):(o(r.key),d(null))}return e.jsx("div",{className:"catfilter",children:Be.map(r=>{const m=t===r.key&&!!r.subs,h=r.key===s;return e.jsxs("div",{className:"catfilter__group",children:[e.jsxs("button",{type:"button",className:`catfilter__cat${m?" is-expanded":""}${h?" is-selected":""}`,onClick:()=>y(r),children:[e.jsx("span",{className:"catfilter__cat-label",children:r.label}),r.expandable?e.jsx("span",{className:`ico ico-chevron catfilter__chev${m?" is-up":""}`,"aria-hidden":!0}):null]}),r.subs?e.jsx("div",{className:`catfilter__subs${m?" is-open":""}`,children:e.jsx("div",{className:"catfilter__subs-inner",children:r.subs.map(i=>e.jsx("button",{type:"button",className:`catfilter__sub${c===i.key?" is-active":""}`,onClick:()=>b(c===i.key?null:i.key),children:e.jsxs("span",{className:"catfilter__sub-left",children:[e.jsx("span",{className:`ico ico-${i.icon} catfilter__sub-ico`,"aria-hidden":!0}),e.jsx("span",{className:"catfilter__sub-label",children:i.label})]})},i.key))})}):null]},r.key)})})}const Te=["common","uncommon","rare","epic","legendary","mythic","unique","exotic"],K=[{key:"newest",label:"Newest",server:"newest"},{key:"price-asc",label:"Cheapest",server:"cheapest"},{key:"price-desc",label:"Most Expensive",server:"most_expensive"},{key:"name",label:"Name (A–Z)",server:"name"}];function We({panelKey:s,label:c,active:o,badge:b,align:t="left",panel:d,children:y}){const r=d.open===s,m=t==="right"?"filterbar__sort":"filterbar__trigger";return e.jsxs("div",{className:"filterbar__item",children:[e.jsxs("button",{className:`${m}${r?" is-open":""}${o?" is-active":""}`,onClick:()=>d.toggle(s),children:[c," ",b?e.jsx("span",{className:"filterbar__badge",children:b}):null," ",e.jsx("span",{className:`ico ico-chevron filterbar__chev${r?" is-up":""}`,"aria-hidden":!0})]}),r?y:null]})}function Ge({sort:s,onSort:c,sortOptions:o=K,total:b,loading:t,query:d,onOpenFilters:y}){const[r,m]=l.useState(null),h={open:r,toggle:i=>m(j=>j===i?null:i),close:()=>m(null)};return e.jsxs(e.Fragment,{children:[r?e.jsx("div",{className:"filterbar__scrim",onClick:h.close,"aria-hidden":!0}):null,e.jsxs("div",{className:"browse__toolbar",children:[e.jsxs("span",{className:"browse__count",children:[t?"…":`${b.toLocaleString()} Item${b===1?"":"s"}`,d?` for “${d}”`:""]}),e.jsxs("div",{className:"browse__dropdowns",children:[y?e.jsxs("button",{type:"button",className:"browse__filters-btn",onClick:y,children:[e.jsx("span",{className:"ico ico-filter","aria-hidden":!0}),"Filters"]}):null,e.jsx(We,{panelKey:"sort",label:"Sort By",align:"right",panel:h,children:e.jsx("div",{className:"filter-pop filter-pop--sort",children:o.map(i=>e.jsx("button",{className:`filter-pop__sort${i.key===s?" is-active":""}`,onClick:()=>{c(i.key),h.close()},children:i.label},i.key))})})]})]})]})}function se(s){const c=s,o=(c.message??"").toLowerCase();return c.code===4001||o.includes("reject")||o.includes("denied")||o.includes("cancel")?"You cancelled the request.":o.includes("insufficient")?`Not enough ${H.name} — get more first.`:o.includes("not found")||o.includes("no active listing")||o.includes("404")?"This item was just sold or removed. Refreshing the market…":o.includes("your own listing")?"You can't buy your own listing.":"Couldn't complete checkout — please try again."}function Oe(s){return{id:s.tradeId,tradeId:s.tradeId,name:s.name,creator:s.creator,contractAddress:s.contractAddress,itemId:s.itemId,category:s.category,wearableCategory:s.wearableCategory??void 0,rarity:s.rarity,network:s.network,chainId:s.chainId,thumbnail:s.thumbnail,priceCredits:0,gender:null}}function Ue({listing:s,rate:c,onClose:o,onSold:b}){const{session:t}=ke(),{data:d,isError:y}=je(t),r=ae(),m=fe(),[h,i]=l.useState("confirm"),[j,I]=l.useState("Locking today’s price…"),[C,M]=l.useState(null),[n,G]=l.useState(null),f=l.useRef(null),S=Math.ceil(U(s.manaWei,c)/10);l.useEffect(()=>{let v=!1;if(!t){i("error"),M("Sign in to check out.");return}return(async()=>{try{const u=await Ne(s.tradeId);if(!u)throw new Error("not found");if(ge(u,t.address))throw new Error("You can't buy your own listing.");const p=U(s.manaWei,c);if(!Number.isFinite(p)||p<=0)throw new Error("price unavailable");const{credit:x,maxCreditedValue:$,usdCents:N}=await ve(t.identity,p,s.tradeId);if(v){A(t.identity,[x.id]).catch(()=>{});return}f.current=x.id,G({trade:u,credit:x,maxCreditedValue:$,usdCents:N,credits:Math.ceil(N/10)}),I("")}catch(u){if(v)return;console.error("[market] authorize failed",u),R(V(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:D(u),value_usd:Math.round(U(s.manaWei,c))/100}),i("error"),M(se(u))}})(),()=>{v=!0,f.current&&t&&(A(t.identity,[f.current]).catch(()=>{}),f.current=null)}},[]);const F=!!n&&d!=null&&d.credits<n.credits;async function P(){if(!t||!n)return;if(F){A(t.identity,[n.credit.id]).catch(()=>{}),f.current=null,m("/credits");return}i("working"),M(null);let v=!1;try{I("Confirming your purchase…");const u={trade:n.trade,buyer:t.address,signer:t.signer,credits:[n.credit],maxCreditedValue:n.maxCreditedValue};let p;if(Me())try{p=await Fe(u),await Pe(p),v=!0}catch(x){if(x instanceof Ae)v=!0;else if(x instanceof Re)p=await ee(u);else throw x}else p=await ee(u);f.current=null,R("Shop Completed Purchase",{items:[{item_id:s.itemId??null,contract_address:s.contractAddress,token_id:null,price_usd:n.usdCents/100}],value_credits:n.credits,value_usd:n.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:v,transaction_hash:p??null}),r.invalidateQueries({queryKey:["usd-balance"]}),m("/success",{state:{items:[Oe(s)],txHash:p}})}catch(u){console.error("[market] buy now failed",u),A(t.identity,[n.credit.id]).catch(()=>{}),f.current=null,R(V(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:D(u),value_usd:n.usdCents/100}),r.invalidateQueries({queryKey:["usd-balance"]});const p=se(u);M(p),i("error"),/sold or removed/i.test(p)&&b()}}function g(){t&&n&&A(t.identity,[n.credit.id]).catch(()=>{}),f.current=null,o()}const k=h==="working";return e.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":`Buy ${s.name}`,children:[e.jsx("div",{className:"mkt-modal__scrim",onClick:k?void 0:g,"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:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs("div",{children:[e.jsx("div",{className:"mkt-modal__name",title:s.name,children:s.name||"Item"}),e.jsx("span",{className:"chip chip--rarity",children:s.rarity})]})]}),e.jsx("div",{className:"mkt-modal__price",children:n?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(E,{className:"mkt-modal__diamond"}),J(n.credits)]}),e.jsxs("div",{className:"mkt-modal__price-sub muted",children:["Locked for this purchase · $",(n.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(E,{className:"mkt-modal__diamond"}),J(S)]}),e.jsx("div",{className:"mkt-modal__price-sub muted",children:j||"Locking today’s price…"})]})}),t?e.jsxs("div",{className:"mkt-modal__balance muted",children:["Your balance: ",e.jsx(E,{className:"ccy-mark"})," ",Ce(d,y)]}):null,F?e.jsxs("p",{className:"muted mkt-modal__note",children:["You’ll need a few more ",H.name," to buy this."]}):null,j&&h==="working"?e.jsx("p",{className:"muted mkt-modal__note",children:j}):null,C?e.jsx("p",{className:"error mkt-modal__note",children:C}):null,e.jsxs("div",{className:"mkt-modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:g,disabled:k,children:"Cancel"}),e.jsx("button",{className:"btn btn--purple",onClick:P,disabled:k||!n,children:k?"Buying…":F?`Get ${H.name}`:"Confirm purchase"})]})]})]})}const He=48,w=1e5,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"],Dance:["dance"],Stunt:["stunt"],Greetings:["greetings"],Fun:["fun"],Poses:["poses"],Reactions:["reactions"],Horror:["horror"],Miscellaneous:["miscellaneous"]};function Ye(s){return{tradeId:s.tradeId??s.id,listingType:"primary",contractAddress:s.contractAddress,itemId:s.itemId??"",name:s.name,thumbnail:s.thumbnail,rarity:s.rarity,category:s.category,wearableCategory:s.wearableCategory??null,creator:s.creator,manaWei:s.manaWei??"0",available:1,network:s.network,chainId:s.chainId,createdAt:0}}function ts(){const[s]=ye(),c=(s.get("q")??"").trim().toLowerCase(),o=ae(),[b,t]=l.useState("wearable"),[d,y]=l.useState(null),[r,m]=l.useState([]),[h,i]=l.useState(""),[j,I]=l.useState(""),[C,M]=l.useState("newest"),[n,G]=l.useState(!1),[f,S]=l.useState(!1),[F,P]=l.useState(null);l.useEffect(()=>{if(!f)return;const a=_=>{_.key==="Escape"&&S(!1)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[f]);const g=h&&!Number.isNaN(Number(h))?Number(h):void 0,k=j&&!Number.isNaN(Number(j))?Number(j):void 0,v=d?Ke[d]:void 0,u=(K.find(a=>a.key===C)??K[0]).server,p={category:b,rarities:r.length?r:void 0,wearableCategories:v,minPriceCredits:g,maxPriceCredits:k,search:c||void 0,sortBy:u},{items:x,total:$,isLoading:N,error:re,hasNextPage:te,isFetchingNextPage:Y,fetchNextPage:ie}=$e(["unified-listings",p],a=>we({...p,first:He,skip:a})),L=$,{data:B,isError:ne}=Le(),le=a=>B&&a.manaWei?Ee(a.manaWei,B):null,Q=l.useRef(null);l.useEffect(()=>{N||!c||Q.current===c||(Q.current=c,R("Shop Searched",{query:c,result_count:L}))},[c,N,L]);const q=l.useRef("__init__");l.useEffect(()=>{if(N)return;const a=JSON.stringify({category:b,subCategory:d,rarities:r,min:g,max:k,sort:C});if(q.current==="__init__"||q.current===a){q.current=a;return}q.current=a,R("Shop Applied Filter",{filters:{category:b,sub_category:d,rarities:r,min_price_credits:g??null,max_price_credits:k??null,sort:C},result_count:L})},[b,d,r,g,k,C,N,L]);function ce(a){t(a),y(null)}function oe(a){m(_=>_.includes(a)?_.filter(O=>O!==a):[..._,a])}function de(){t("wearable"),y(null),m([]),i(""),I("")}function ue(a){const _=x.find(O=>O.id===a.id);_&&_.source==="legacy"&&_.manaWei&&P(Ye(_))}function me(){o.invalidateQueries({queryKey:["unified-listings"]})}const T=g!=null?Math.min(g,w):0,W=k!=null?Math.min(k,w):w,he=T/w*100,pe=W/w*100;function _e(a){const _=Math.min(a,W);i(_<=0?"":String(_))}function be(a){const _=Math.max(a,T);I(_>=w?"":String(_))}return e.jsxs("div",{className:"browse browse--sidebar",children:[f?e.jsx("div",{className:"browse__scrim",onClick:()=>S(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${f?" is-open":""}`,children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:"Filters"}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>S(!1),"aria-label":"Close filters",children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:"Category"}),e.jsx(qe,{category:b,subCategory:d,onCategory:ce,onSub:y}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:"Price"}),e.jsxs("div",{className:"price-filter",children:[e.jsxs("div",{className:"price-filter__inputs",children:[e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:"Min"}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(E,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":"Minimum price",placeholder:"0",value:h,onChange:a=>i(a.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:"to"}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:"Max"}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(E,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":"Maximum price",placeholder:"0",value:j,onChange:a=>I(a.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${he}%`,"--max-pct":`${pe}%`},children:[e.jsx("div",{className:"price-filter__track","aria-hidden":!0}),e.jsx("div",{className:"price-filter__fill","aria-hidden":!0}),e.jsx("input",{type:"range",min:0,max:w,value:T,"aria-label":"Minimum price slider",onChange:a=>_e(Number(a.target.value))}),e.jsx("input",{type:"range",min:0,max:w,value:W,"aria-label":"Maximum price slider",onChange:a=>be(Number(a.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(E,{className:"price-filter__coin"}),T.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(E,{className:"price-filter__coin"}),W.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","aria-expanded":n,onClick:()=>G(a=>!a),children:[e.jsx("span",{className:"sidebar__section-label",children:"Rarity"}),e.jsx("span",{className:`ico ico-chevron sidebar__section-chev${n?" is-up":""}`,"aria-hidden":!0})]}),n?e.jsx("div",{className:"rarity-filter",children:Te.map(a=>e.jsxs("label",{className:`rarity-filter__check${r.includes(a)?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:r.includes(a),onChange:()=>oe(a)}),e.jsx("span",{children:a})]},a))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:de,children:"Clear Filters"}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>S(!1),children:"Apply"})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(Ge,{sort:C,onSort:M,total:$,loading:N,query:c,onOpenFilters:()=>S(!0)}),ne&&x.some(a=>a.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:"Some market prices are temporarily unavailable — buying those items is paused for a moment. Please try again shortly."}):null,re?e.jsx("p",{className:"error",children:"Couldn’t load items — please try again."}):null,e.jsx("div",{className:"grid",children:N?e.jsx(X,{count:15}):e.jsxs(e.Fragment,{children:[x.map(a=>a.source==="legacy"?e.jsx(Z,{item:a,mode:"market",marketPriceCredits:le(a),onBuyNow:ue},a.id):e.jsx(Z,{item:a},a.id)),Y?e.jsx(X,{count:6}):null]})}),e.jsx(Ie,{hasNextPage:te,isFetching:Y,onLoadMore:()=>ie()}),!N&&x.length===0?e.jsx("p",{className:"muted",children:"No items match your filters."}):null]}),F&&B?e.jsx(Ue,{listing:F,rate:B,onClose:()=>P(null),onSold:()=>{P(null),me()}}):null]})}export{ts as Assets};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as H,d as Q,r as l,j as e}from"./react-iAgwec9M.js";import{ah as T,i as j,ai as W,c as J,w as X,z as _,y as m,E as G,I as M,e as S,aj as D}from"./index-CkRnMhP5.js";import{C as A}from"./CircularProgress-DMraLpW6.js";import"./ethers-D-4WUfRB.js";function F(){return j.creditsServerUrl}async function Z(s,t){const r=await T(`${F()}/credits/checkout`,{method:"POST",identity:t,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify({packId:s})});if(!r.ok)throw new Error(`checkout ${r.status}: ${await r.text()}`);const{orderId:a,url:n}=await r.json();return{orderId:a,url:n,mock:!1}}async function ee(s,t,r={}){const{intervalMs:a=1500,timeoutMs:n=6e4,signal:o}=r,h=Date.now()+n;for(;;){if(o!=null&&o.aborted)throw new DOMException("Aborted","AbortError");const u=await te(s,t,o);if(u.status!=="processing")return u;if(Date.now()>h)return{status:"pending"};await se(a,o)}}async function te(s,t,r){const a=await T(`${F()}/credits/orders/${s}`,{method:"GET",identity:t,metadata:{},signal:r});if(!a.ok)throw new Error(`order status ${a.status}`);return a.json()}function se(s,t){return new Promise((r,a)=>{const n=setTimeout(r,s);t==null||t.addEventListener("abort",()=>{clearTimeout(n),a(new DOMException("Aborted","AbortError"))})})}const re=.1,U=[{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(s){return Math.round(s/re)}function O(s){return U.find(t=>t.id===s)}const b="mock_cs_",ae=new Set([80002,11155111,1337,31337]);function E(){const s=!j.stripePublishableKey;if(s&&!ae.has(j.chainId))throw new Error(`Stripe publishable key is missing on chainId=${j.chainId}, which is not a recognized test network. Refusing to fall back to mock payments in a real-money environment — configure STRIPE_PUBLISHABLE_KEY.`);return s}async function ne(s,t){const r=O(s);if(!r)throw new Error("Unknown pack");if(E())return ie(r);if(!(t!=null&&t.identity))throw new Error("Sign in to get credits.");return Z(s,t.identity)}async function ce(s,t={}){const{intervalMs:r,timeoutMs:a,signal:n,identity:o}=t;if(E()||s.startsWith(b))return oe(s,t);if(!o)throw new Error("Sign in to get credits.");return ee(s,o,{intervalMs:r,timeoutMs:a,signal:n})}function ie(s){const t=`${b}${s.id}_${Date.now()}`;return L(400).then(()=>({orderId:t,clientSecret:`${b}${s.id}`,mock:!0}))}async function oe(s,t={}){await L(t.intervalMs??900);const r=s.replace(b,"").replace(/_\d+$/,""),a=O(r),n=(a==null?void 0:a.credits)??0;if(t.address&&a)try{const o=await W(t.address,Math.round(a.usd*100));return{status:"credited",creditsGranted:n,newBalance:o.credits}}catch(o){return{status:"failed",error:o.message}}return{status:"credited",creditsGranted:n,newBalance:n}}function L(s,t){return new Promise((r,a)=>{setTimeout(r,s)})}const v=E()?"mock":"stripe";function B(s){const t=s;if((t==null?void 0:t.name)==="AbortError")return"You cancelled the request.";const r=((t==null?void 0:t.message)??"").toLowerCase();return r.includes("sign in")?`Sign in to get ${m.name}.`:r.includes("timed out")?`This is taking longer than usual — your ${m.name} will appear shortly.`:"Couldn't complete your purchase — please try again."}function ge(){const s=H(),{session:t,signIn:r}=J(),a=X(),[n,o]=Q(),[h,u]=l.useState("select"),[c,P]=l.useState(null),[y,$]=l.useState(null),[Y,R]=l.useState(null),[K,g]=l.useState(null),[V,k]=l.useState(!1),w=l.useRef(null);l.useEffect(()=>()=>{var i;return(i=w.current)==null?void 0:i.abort()},[]);const I=l.useCallback(()=>{o(i=>{const d=new URLSearchParams(i);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[o]),N=l.useCallback(async i=>{u("processing");const d=new AbortController;w.current=d;try{const p=await ce(i,{signal:d.signal,address:t==null?void 0:t.address,identity:t==null?void 0:t.identity});p.status==="credited"?(R(p.creditsGranted??(c==null?void 0:c.credits)??0),u("success"),_("Shop Completed Buy Credits",{order_id:i,pack_usd:(c==null?void 0:c.usd)??null,credits:p.creditsGranted??(c==null?void 0:c.credits)??0,provider:v}),a.invalidateQueries({queryKey:["usd-balance"]})):p.status==="pending"?(_("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),a.invalidateQueries({queryKey:["usd-balance"]}),u("pending")):(_("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),g(p.error??`Couldn't add your ${m.name} — please try again.`),u("error"))}catch(p){G(p,{flow:"get_credits",step:"grant",order_id:i}),_("Shop Buy Credits Failed",{step:"grant",error_code:M(p),pack_usd:(c==null?void 0:c.usd)??null}),g(B(p)),u("error")}},[c,t,a]),q=l.useCallback(async i=>{if(!t){r();return}g(null),k(!1),P(i),u("paying"),_("Shop Started Buy Credits",{pack_usd:i.usd,credits:i.credits,provider:v});try{const d=await ne(i.id,{address:t.address,identity:t.identity});if(d.mock)$(d);else if(d.url)window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){G(d,{flow:"get_credits",step:"checkout",provider:v}),_("Shop Buy Credits Failed",{step:"checkout",error_code:M(d),pack_usd:i.usd}),g(B(d)),u("error")}},[t,r]),z=l.useCallback(()=>{y&&N(y.orderId)},[y,N]),C=l.useRef(!1);l.useEffect(()=>{if(C.current)return;const i=n.get("order");if(n.get("canceled")!=null){C.current=!0,I(),k(!0),u("select");return}i&&(u("processing"),t&&(C.current=!0,I(),N(i)))},[n,t]);function f(){var i;(i=w.current)==null||i.abort(),u("select"),P(null),$(null),R(null),g(null),k(!1)}return e.jsxs("div",{className:"getcredits",children:[e.jsxs("header",{className:"getcredits__head",children:[e.jsxs("h1",{className:"getcredits__title",children:["Get ",m.name]}),e.jsxs("p",{className:"muted",children:["Add ",m.name," to your account to shop. Pay with any card."]})]}),t?e.jsxs(e.Fragment,{children:[h==="select"&&e.jsxs(e.Fragment,{children:[V&&e.jsx("p",{className:"getcredits__note muted",role:"status",children:"Payment canceled — no charge was made. Pick a pack whenever you’re ready."}),e.jsx(de,{onSelect:q})]}),h==="paying"&&c&&e.jsx(le,{pack:c,checkout:y,onPaid:z,onCancel:f}),h==="processing"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(A,{size:40}),e.jsxs("p",{className:"getcredits__status-title",children:["Adding your ",m.name,"…"]}),e.jsx("p",{className:"muted",children:"Payment received. Just a moment while we top up your balance."})]}),h==="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:[e.jsx(S,{className:"ccy-mark"})," ",Y]})," ",m.name," added to your account."]}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>s("/cart"),children:"Back to cart"}),e.jsxs("button",{className:"btn btn--ghost",onClick:f,children:["Get more ",m.name]})]})]}),h==="pending"&&e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Your ",m.name," are on the way"]}),e.jsx("p",{className:"muted",children:"Your payment went through. It’s taking a little longer than usual to confirm — your balance will update automatically as soon as it lands, no need to pay again."}),e.jsxs("div",{className:"getcredits__status-actions",children:[e.jsx("button",{className:"btn",onClick:()=>s("/cart"),children:"Back to cart"}),e.jsx("button",{className:"btn btn--ghost",onClick:f,children:"Done"})]})]}),h==="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:K}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn",onClick:f,children:"Try again"})})]})]}):e.jsxs("div",{className:"getcredits__status",role:"status",children:[e.jsxs("p",{className:"getcredits__status-title",children:["Sign in to get ",m.name]}),e.jsxs("p",{className:"muted",children:["Connect your account to buy ",m.name," and start shopping."]}),e.jsx("div",{className:"getcredits__status-actions",children:e.jsx("button",{className:"btn btn--purple",onClick:r,children:"Sign in"})})]})]})}function de({onSelect:s}){return e.jsx("div",{className:"packs",children:U.map(t=>e.jsxs("button",{type:"button",className:`pack${t.bestValue?" pack--best":""}`,onClick:()=>s(t),"aria-label":`Get ${D(t.credits)} for $${t.usd}`,children:[t.bestValue&&e.jsx("span",{className:"pack__ribbon",children:"Best value"}),e.jsxs("span",{className:"pack__credits",children:[e.jsx(S,{className:"pack__credits-ico"}),t.credits]}),e.jsx("span",{className:"pack__label",children:m.name}),e.jsxs("span",{className:"pack__price",children:["$",t.usd]}),e.jsxs("span",{className:"pack__cta",children:["Get ",m.name]})]},t.id))})}function le({pack:s,checkout:t,onPaid:r,onCancel:a}){return e.jsxs("div",{className:"pay",children:[e.jsxs("div",{className:"pay__summary",children:[e.jsx("button",{className:"link",onClick:a,children:"← Choose a different pack"}),e.jsxs("div",{className:"pay__summary-row",children:[e.jsx("span",{children:"You’ll get"}),e.jsxs("strong",{children:[e.jsx(S,{className:"ccy-mark"})," ",D(s.credits)]})]}),e.jsxs("div",{className:"pay__summary-row pay__summary-row--total",children:[e.jsx("span",{children:"You pay"}),e.jsxs("strong",{children:["$",s.usd]})]})]}),e.jsx("div",{className:"pay__form",children:t!=null&&t.mock?e.jsx(ue,{onPaid:r,amountUsd:s.usd}):e.jsxs("div",{className:"getcredits__status",role:"status","aria-live":"polite",children:[e.jsx(A,{size:32}),e.jsx("p",{className:"muted",children:"Getting the payment form ready…"})]})})]})}function ue({onPaid:s,amountUsd:t}){const[r,a]=l.useState("4242 4242 4242 4242"),[n,o]=l.useState(!1);function h(){o(!0),setTimeout(()=>s(),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:r,onChange:u=>a(u.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:h,disabled:n,children:n?"Processing…":`Pay $${t}`})]})}export{ge as GetCredits,ge as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as r}from"./utils-DmMVfaK5.js";import{d as a}from"./decimals-Dc4qfMjN.js";import"./ethers-D-4WUfRB.js";import"./react-iAgwec9M.js";import"./signing-DAZWuXp4.js";import"./index-CkRnMhP5.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r}from"./index-CkRnMhP5.js";var e=r();export{e as n};
|