@dcl/shop 0.1.0-29735885306.commit-7a39d45 → 0.1.0-29736515487.commit-b64bf82

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.
Files changed (178) hide show
  1. package/assets/{AnimatedBackground-nfWV-TLm.js → AnimatedBackground-BJBUqhHZ.js} +3 -3
  2. package/assets/Assets-BLEE2McM.js +1 -0
  3. package/assets/Cart-CNsRhX_R.js +1 -0
  4. package/assets/{CircularProgress-DndPkIP8.js → CircularProgress-C9g4a9bc.js} +1 -1
  5. package/assets/Collection-CEmVbx8y.js +1 -0
  6. package/assets/{CollectionCarousel-DttKFbs9.js → CollectionCarousel-CiKValmX.js} +1 -1
  7. package/assets/Creator-CSW1SPi9.js +1 -0
  8. package/assets/{CssVarsProvider-B8lKeq36.js → CssVarsProvider-Bc8wQjEb.js} +1 -1
  9. package/assets/ErrorNotice-Rze9rgc9.js +1 -0
  10. package/assets/{ExchangeController-B7IETzbU.js → ExchangeController-B6lNqmFK.js} +1 -1
  11. package/assets/{GetCredits-DbHhfh2c.js → GetCredits-CovHo4LD.js} +1 -1
  12. package/assets/{HelpersUtil-DlIzn60f.js → HelpersUtil-zS6eOrPz.js} +1 -1
  13. package/assets/{ImportListings-S_dZIlJJ.js → ImportListings-B_GYydG3.js} +1 -1
  14. package/assets/ItemDetail-DmBWsg8l.js +2 -0
  15. package/assets/{LoadMore-DOqijdHT.js → LoadMore-BIjeTH4T.js} +1 -1
  16. package/assets/MarketCheckout-DoRZsMk0.js +1 -0
  17. package/assets/MyAssets-7sMdrGBa.js +1 -0
  18. package/assets/{MyFavorites-BiTv35sh.js → MyFavorites-CRqCDkA2.js} +1 -1
  19. package/assets/{MyPurchases-7h6djrh3.js → MyPurchases-BsTMOXYC.js} +1 -1
  20. package/assets/{NotFound-Dla84AhU.js → NotFound-COraILzW.js} +1 -1
  21. package/assets/StoreSettings-C_SlMQ79.js +1 -0
  22. package/assets/{Success-grPwRvA7.js → Success-3OL55SvR.js} +1 -1
  23. package/assets/{SwapController-Dfa4Uexs.js → SwapController-BHBv5Fp0.js} +1 -1
  24. package/assets/{TradeService-oRYiZhuO.js → TradeService-CNoDt48E.js} +1 -1
  25. package/assets/{W3MFrameProviderSingleton-BIMCH_xH.js → W3MFrameProviderSingleton-Bndo_4Rg.js} +3 -3
  26. package/assets/{WebCryptoP256-CrVbiM8b.js → WebCryptoP256-Bt50-H1K.js} +1 -1
  27. package/assets/{basic-BNz1bcOI.js → basic-Bub5O4ZI.js} +1 -1
  28. package/assets/{biconomy-DTAZzZV9.js → biconomy-DuIIEXUB.js} +1 -1
  29. package/assets/{buy-C3XM-F5L.js → buy--wjHgZbY.js} +1 -1
  30. package/assets/{buy-gasless-CgW1uOlT.js → buy-gasless-DaSij0O9.js} +1 -1
  31. package/assets/{cart-checkout-N2i7gwjl.js → cart-checkout-RV2JhHc0.js} +1 -1
  32. package/assets/{categories-DlVqkFPG.js → categories-BwgdoXaT.js} +1 -1
  33. package/assets/{ccip-wZRny90t.js → ccip-C1ke5tRS.js} +1 -1
  34. package/assets/{ccip-D0GvNkRi.js → ccip-Cbub1KDX.js} +1 -1
  35. package/assets/{collection-Cb2Yk135.js → collection-CtZ-NDco.js} +1 -1
  36. package/assets/{controller-DzxfBNm5.js → controller-Cn9mR-pN.js} +2 -2
  37. package/assets/{core-BQO-8l1a.js → core-Z6gT3FaJ.js} +4 -4
  38. package/assets/{custom-Q09UtzLL.js → custom-Djk6BRDC.js} +1 -1
  39. package/assets/{data-capture-DQHHGJqw.js → data-capture-CaF6YYAr.js} +1 -1
  40. package/assets/{decimals-Lrh0ljC2.js → decimals-BW2hoshz.js} +1 -1
  41. package/assets/{decimals-BKlvk0e7.js → decimals-_kiKzbOr.js} +1 -1
  42. package/assets/{detectExtension-BdYqD6Wo.js → detectExtension-BkZ-FjJy.js} +1 -1
  43. package/assets/{email-CrFGZcog.js → email-1Van4lx1.js} +1 -1
  44. package/assets/{embedded-wallet-CKipxTpW.js → embedded-wallet-_TVgs7Qd.js} +1 -1
  45. package/assets/{emotion-styled.browser.esm-De8LzLi0.js → emotion-styled.browser.esm-B2VU5Fdx.js} +1 -1
  46. package/assets/{engine-MccFrbTY.js → engine-D9uS1iWH.js} +1 -1
  47. package/assets/errors-BFbUxXdM.js +1 -0
  48. package/assets/{estimate-l1-fee-D1fAN0FJ.js → estimate-l1-fee-DFpjQWvm.js} +1 -1
  49. package/assets/{eth_estimateGas-DMW0srlc.js → eth_estimateGas-XGJ1z-TU.js} +1 -1
  50. package/assets/{eth_getStorageAt-CmJ0aKBu.js → eth_getStorageAt-4_YV1iAo.js} +1 -1
  51. package/assets/{eth_getTransactionCount-DQPgCd6N.js → eth_getTransactionCount-DO_4-OAP.js} +1 -1
  52. package/assets/{extractIPFS-B5WjncQS.js → extractIPFS-CMkI68ZH.js} +1 -1
  53. package/assets/{features-VCGghgYt.js → features-Dzd7PGBD.js} +1 -1
  54. package/assets/{fetchTokenMetadata-DkvbC6O0.js → fetchTokenMetadata-BJILnwgp.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-DkDbe072.js → get-ecosystem-wallet-info-BD5YDDMh.js} +1 -1
  56. package/assets/{getBalance-BTMKBCSR.js → getBalance-SRetmB3S.js} +1 -1
  57. package/assets/{getInstalledModules-CwEcTlva.js → getInstalledModules-DFh2dv3C.js} +1 -1
  58. package/assets/{getNFT-CJo_PX2T.js → getNFT-CJ8nxXzA.js} +1 -1
  59. package/assets/{getNFT-CboVo0ST.js → getNFT-CtODGGom.js} +2 -2
  60. package/assets/{getOverlayAlpha-DC6Z8-Ah.js → getOverlayAlpha-DqVbiGQa.js} +1 -1
  61. package/assets/{hashTypedData-BVFQaTLd.js → hashTypedData-B9EX4kQr.js} +1 -1
  62. package/assets/{hashTypedData-Wmo1SoPQ.js → hashTypedData-DF-5orkI.js} +1 -1
  63. package/assets/{import-CXHQHUHE.js → import-DjSObRBl.js} +1 -1
  64. package/assets/{in-app-wallet-calls-B_WDQVOa.js → in-app-wallet-calls-BIFm_f4e.js} +1 -1
  65. package/assets/{index-BrmfoEW0.js → index-435lMBSs.js} +1 -1
  66. package/assets/{index-C8n7W-px.js → index-4FVRm8A1.js} +1 -1
  67. package/assets/{index-DWn4PjtM.js → index-5DUAhgPD.js} +1 -1
  68. package/assets/{index-tThe6wod.js → index-B-R-UWD3.js} +1 -1
  69. package/assets/{index-Bg_Z6GcI.js → index-B0vpo1ZT.js} +1 -1
  70. package/assets/{index-brSzzARD.js → index-B84aCWu7.js} +1 -1
  71. package/assets/{index-BvXoWZ6K.js → index-B8oIDYaY.js} +1 -1
  72. package/assets/{index-ImENe_e0.js → index-BDpvYYDT.js} +2 -2
  73. package/assets/{index-DGY13Ahk.js → index-BIm4mg7q.js} +1 -1
  74. package/assets/{index-6iJH5OM1.js → index-BJhyH2t3.js} +1 -1
  75. package/assets/{index-D9qKBsi3.js → index-BMvjtMcC.js} +1 -1
  76. package/assets/{index-QAGQ97Gb.js → index-BP93EahD.js} +1 -1
  77. package/assets/{index-B4j7NVUo.js → index-BTBCIBCb.js} +1 -1
  78. package/assets/{index-BiwUvFgE.js → index-Baz_xGcG.js} +1 -1
  79. package/assets/{index-Dnfafk6L.js → index-BuMqkfRn.js} +1 -1
  80. package/assets/{index-Bq9AJ_VL.js → index-C1ZfYzAF.js} +1 -1
  81. package/assets/{index-Bcl8cVXN.js → index-C2Nkwj4Q.js} +1 -1
  82. package/assets/{index-1GZEZj4_.js → index-C4u9N2Kl.js} +1 -1
  83. package/assets/{index-C3fHjE5h.js → index-C6_L5Mw_.js} +1 -1
  84. package/assets/{index-BROh4m8F.js → index-C7FmrxuL.js} +2 -2
  85. package/assets/{index-nKws02kd.js → index-C7dwOEd4.js} +1 -1
  86. package/assets/{index-ODYcuX6L.js → index-CB1b6TrQ.js} +1 -1
  87. package/assets/{index-C7swV0s7.js → index-CDzDnyJW.js} +9 -9
  88. package/assets/{index-Bj8v99Kt.js → index-CI-M1Arz.js} +1 -1
  89. package/assets/{index-hxyN2V1_.js → index-COxhR5RZ.js} +1 -1
  90. package/assets/{index-Cx0y-N27.js → index-CPEmMCeJ.js} +1 -1
  91. package/assets/{index-C8sLfN4n.js → index-CXx3fqSb.js} +1 -1
  92. package/assets/{index-CubVHBvM.js → index-Ca1AwnnV.js} +1 -1
  93. package/assets/{index-CLw6S26l.js → index-ChsZA2LJ.js} +1 -1
  94. package/assets/{index-B6PMUPlS.js → index-CnO86Xf-.js} +2 -2
  95. package/assets/{index-oL7RezGF.js → index-Cq05ek6k.js} +1 -1
  96. package/assets/{index-SDT0ZTp_.js → index-CuuFwMsN.js} +1 -1
  97. package/assets/{index-BA4dfRb5.js → index-Cxc0o5xP.js} +3 -3
  98. package/assets/{index-C3jzUKd2.js → index-D-OL6_Yb.js} +1 -1
  99. package/assets/{index-Dwz4bI1F.js → index-D-g3I2lj.js} +1 -1
  100. package/assets/{index-BB7DOq9K.js → index-D1WSRIS2.js} +1 -1
  101. package/assets/{index-DyrEEs7h.js → index-D4I9bYC2.js} +1 -1
  102. package/assets/{index-B1fyFQFf.js → index-D6gXM0CC.js} +1 -1
  103. package/assets/{index-dgWkyV5E.js → index-D9ieJGKB.js} +3 -3
  104. package/assets/{index-CetrppOt.js → index-DZXCznoC.js} +1 -1
  105. package/assets/{index-Bxzx66sM.js → index-Dp3LaHz2.js} +1 -1
  106. package/assets/index-DvbMYtAp.css +1 -0
  107. package/assets/{index-CskTAJ-W.js → index-DxHhM-lc.js} +1 -1
  108. package/assets/{index-VBXOJYUE.js → index-RUxrTr_p.js} +1 -1
  109. package/assets/{index-BmjbHn2J.js → index-_PfBd9GI.js} +1 -1
  110. package/assets/{index-CPHHOZWE.js → index-icCmSJB-.js} +1 -1
  111. package/assets/{index-C88tdWU9.js → index-kwYOhJAZ.js} +1 -1
  112. package/assets/{index-BEsHe9Z5.js → index-lt9H89-j.js} +1 -1
  113. package/assets/{index-D6vI6KM2.js → index-mj00iiOs.js} +1 -1
  114. package/assets/{index-DMlzjjO0.js → index-rjGwBRLW.js} +1 -1
  115. package/assets/{index-BiI9BcQf.js → index-wua-qNwF.js} +1 -1
  116. package/assets/{index-BOT_rPtb.js → index-z0NRAVC7.js} +1 -1
  117. package/assets/{index.es-qyZ61vOn.js → index.es-1OmAzkct.js} +4 -4
  118. package/assets/{index.es-BGK42TWV.js → index.es-BzNqI7gq.js} +1 -1
  119. package/assets/{index.es-BhZE_HCI.js → index.es-CwZSb0ol.js} +1 -1
  120. package/assets/{localBatchGatewayRequest-CDYO5vBd.js → localBatchGatewayRequest-yoTBhn0Z.js} +1 -1
  121. package/assets/{mana-rate-B7ShUGMF.js → mana-rate-Db4BQ-_Q.js} +1 -1
  122. package/assets/{networks-CpFUsIQ_.js → networks-DK4RaMPB.js} +1 -1
  123. package/assets/{onramp-DWAWL5fr.js → onramp-D9q0W6xC.js} +1 -1
  124. package/assets/{openzeppelin-BaxH-Q6e.js → openzeppelin-BquKm-KX.js} +1 -1
  125. package/assets/{ownerOf-DBfj8RDj.js → ownerOf-DuMQ2Sl6.js} +1 -1
  126. package/assets/{parseNft-cZiLURCL.js → parseNft-ufNn3-SE.js} +2 -2
  127. package/assets/{parseSignature-CUH6T5zg.js → parseSignature-BwqWTE77.js} +3 -3
  128. package/assets/{parseSignature-CX4h7HOk.js → parseSignature-DMb3jl_X.js} +1 -1
  129. package/assets/{pay-with-exchange-DjAaDdMt.js → pay-with-exchange-CTQ9umub.js} +1 -1
  130. package/assets/{payments-BojP1AK1.js → payments-tEVDRx3d.js} +1 -1
  131. package/assets/{qr-overlay-Fy7O6nEI.js → qr-overlay-dEspWwjk.js} +1 -1
  132. package/assets/{receive-BNl1PgFA.js → receive-D0GHoQxU.js} +1 -1
  133. package/assets/{resolveImplementation-CZ_XMNcD.js → resolveImplementation-C8pfiiFc.js} +1 -1
  134. package/assets/{rpc-DXpRyhuY.js → rpc-DmLUQYS0.js} +1 -1
  135. package/assets/{secp256k1-CxwXKjt6.js → secp256k1-Dfs57S6d.js} +1 -1
  136. package/assets/{secp256k1-BFgSemLO.js → secp256k1-Dr9eLw2v.js} +1 -1
  137. package/assets/{secp256k1-CJ-cDuAO.js → secp256k1-Nx-YHmXH.js} +1 -1
  138. package/assets/{send-BWF4FoMf.js → send-BwQAcpw3.js} +1 -1
  139. package/assets/{send-batch-transaction-D-WGupzl.js → send-batch-transaction-DzTkK7I2.js} +1 -1
  140. package/assets/{send-eip712-transaction-D7CHMT8d.js → send-eip712-transaction-Cwec8TpW.js} +2 -2
  141. package/assets/{send-gasless-transaction-jYvtBlEa.js → send-gasless-transaction-CM25TtQp.js} +2 -2
  142. package/assets/{sendRawTransaction-BuyvDRxp.js → sendRawTransaction-D4a6ft8m.js} +3 -3
  143. package/assets/{serializeTransaction-DUb3Uucc.js → serializeTransaction-2sq4x0kU.js} +1 -1
  144. package/assets/{session-proposal-BG4o8sS8.js → session-proposal-BdXqD0a8.js} +1 -1
  145. package/assets/{session-request-CWTif92g.js → session-request-DK4XwmDL.js} +2 -2
  146. package/assets/{sha256-BwE5sZLM.js → sha256-D-WKRl2Q.js} +1 -1
  147. package/assets/{signing-MwqooMKP.js → signing-BT7JgIF_.js} +4 -4
  148. package/assets/{socials-DpvGTg5S.js → socials-BOqU6AoU.js} +1 -1
  149. package/assets/{swaps-QEBdU08e.js → swaps-CG6VNxsT.js} +1 -1
  150. package/assets/{thirdweb-D3Oq7iMk.js → thirdweb-CAdiquMi.js} +3 -3
  151. package/assets/{totalSupply-DRMMQQGk.js → totalSupply-DjhdgKBK.js} +1 -1
  152. package/assets/{trade-encoding-BkDaYyvb.js → trade-encoding-6ejU5fQD.js} +1 -1
  153. package/assets/{transactionReceipt-4Guo2WN5.js → transactionReceipt-DWMHa3N1.js} +1 -1
  154. package/assets/{transactions-x2ljt4Bz.js → transactions-BgR8COf-.js} +1 -1
  155. package/assets/{useInfiniteGrid-LLmuFcQo.js → useInfiniteGrid-gL0KJ-yb.js} +1 -1
  156. package/assets/{useStore-CTx-2Xfe.js → useStore-BXbR3Zt_.js} +1 -1
  157. package/assets/{useTheme-3xICgEAy.js → useTheme-CmaVa_eU.js} +1 -1
  158. package/assets/useTheme-bLwsL2uj.js +1 -0
  159. package/assets/{verifyHash-DmZ6Vxbz.js → verifyHash-0bNfbKAs.js} +1 -1
  160. package/assets/{w3m-modal-CD__AMAe.js → w3m-modal-Cb8f-N8c.js} +1 -1
  161. package/assets/{w3m-modal-1ZEUEUoj.js → w3m-modal-L-SoXhRP.js} +1 -1
  162. package/assets/{wait-for-tx-receipt-D9CGEBK0.js → wait-for-tx-receipt-DHi00k13.js} +1 -1
  163. package/assets/{wallets-B5OIkVJ3.js → wallets-DQmx7SO4.js} +6 -6
  164. package/assets/{web-connector-BSSZAM8o.js → web-connector-DZjwkeRe.js} +3 -3
  165. package/assets/{writeContract-PwOFfBlu.js → writeContract-DzbrR3T0.js} +1 -1
  166. package/assets/{zoraTestnet-BjKQVWoc.js → zoraTestnet-CiD1Xv8j.js} +1 -1
  167. package/index.html +11 -11
  168. package/package.json +2 -2
  169. package/assets/Assets-DxJogT5a.js +0 -1
  170. package/assets/Cart-CIl0AjqN.js +0 -1
  171. package/assets/Collection-BJEblsKJ.js +0 -1
  172. package/assets/Creator-DZmgR_-B.js +0 -1
  173. package/assets/ItemDetail-DkTooWrA.js +0 -2
  174. package/assets/MarketCheckout-BSyyg6RV.js +0 -1
  175. package/assets/MyAssets-DVnMIIXj.js +0 -1
  176. package/assets/StoreSettings-TpgP82R_.js +0 -1
  177. package/assets/index-DgcUoaxa.css +0 -1
  178. package/assets/useTheme-B8h6R_Xd.js +0 -1
package/index.html CHANGED
@@ -16,10 +16,10 @@
16
16
  <link rel="canonical" href="https://shop.decentraland.org/" />
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-29735885306.commit-7a39d45/favicon.ico" sizes="16x16 32x32 48x48" />
20
- <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/apple-touch-icon.png" />
19
+ <link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/favicon.ico" sizes="16x16 32x32 48x48" />
20
+ <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/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-29735885306.commit-7a39d45/site.webmanifest" />
22
+ <link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/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-29735885306.commit-7a39d45/sitemap.xml" />
51
+ <link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/sitemap.xml" />
52
52
 
53
53
  <!-- Warm the 3D preview / fonts -->
54
54
  <link rel="preconnect" href="https://fonts.googleapis.com" />
@@ -60,13 +60,13 @@
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-29735885306.commit-7a39d45/assets/index-C7swV0s7.js"></script>
64
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/react-yytiy0wi.js">
65
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/dcl-schemas-BICTSpB5.js">
66
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/sentry-BPJvc5GU.js">
67
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/ethers-w2AslR0v.js">
68
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/intl-CBcMB1D2.js">
69
- <link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/index-DgcUoaxa.css">
63
+ <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/index-CDzDnyJW.js"></script>
64
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/react-yytiy0wi.js">
65
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/dcl-schemas-BICTSpB5.js">
66
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/sentry-BPJvc5GU.js">
67
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/ethers-w2AslR0v.js">
68
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/intl-CBcMB1D2.js">
69
+ <link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29736515487.commit-b64bf82/assets/index-DvbMYtAp.css">
70
70
  </head>
71
71
  <body>
72
72
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/shop",
3
- "version": "0.1.0-29735885306.commit-7a39d45",
3
+ "version": "0.1.0-29736515487.commit-b64bf82",
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": "7a39d4538c0f696f3a45d44ff6fcfff427a5d822"
11
+ "commit": "b64bf82817c005e4e9d6ba283924dfa8824ce216"
12
12
  }
@@ -1 +0,0 @@
1
- import{u as oe,r as t,j as e}from"./react-yytiy0wi.js";import{u as de,a as ue,t as a,b as $,C,A as B,f as me}from"./index-C7swV0s7.js";import{m as pe}from"./mana-rate-B7ShUGMF.js";import{u as _e,M as xe}from"./MarketCheckout-BSyyg6RV.js";import{S as G,C as fe,R as he,F as be,a as Q,b as ge}from"./categories-DlVqkFPG.js";import{L as je}from"./LoadMore-DOqijdHT.js";import{u as Ne}from"./useInfiniteGrid-LLmuFcQo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-C3XM-F5L.js";import"./trade-encoding-BkDaYyvb.js";import"./buy-gasless-CgW1uOlT.js";const ye=48,n=1e5;function ve(r){return{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei??"0",available:1,network:r.network,chainId:r.chainId,createdAt:0}}function We(){const[r]=oe(),l=(r.get("q")??"").trim().toLowerCase(),U=de(),I=(r.get("q")??"").trim();ue({title:I?a("seo.collectibles.searchTitle",{query:I}):a("seo.collectibles.title"),description:a("seo.collectibles.description")});const[p,F]=t.useState("wearable"),[d,k]=t.useState(null),[c,R]=t.useState([]),[f,w]=t.useState(""),[h,M]=t.useState(""),[_,K]=t.useState("newest"),[P,D]=t.useState(!1),[b,x]=t.useState(!1),[L,A]=t.useState(null);t.useEffect(()=>{if(!b)return;const s=i=>{i.key==="Escape"&&x(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[b]);const u=f&&!Number.isNaN(Number(f))?Number(f):void 0,m=h&&!Number.isNaN(Number(h))?Number(h):void 0,J=d?ge[d]:void 0,X=(G.find(s=>s.key===_)??G[0]).server,q={category:p,rarities:c.length?c:void 0,wearableCategories:J,minPriceCredits:u,maxPriceCredits:m,search:l||void 0,sortBy:X},{items:g,total:O,isLoading:o,error:Z,hasNextPage:z,isFetchingNextPage:T,fetchNextPage:H}=Ne(["unified-listings",q],s=>me({...q,first:ye,skip:s})),j=O,{data:N,isError:V}=_e(),Y=s=>N&&s.manaWei?pe(s.manaWei,N):null,W=t.useRef(null);t.useEffect(()=>{o||!l||W.current===l||(W.current=l,$("Shop Searched",{query:l,result_count:j}))},[l,o,j]);const y=t.useRef("__init__");t.useEffect(()=>{if(o)return;const s=JSON.stringify({category:p,subCategory:d,rarities:c,min:u,max:m,sort:_});if(y.current==="__init__"||y.current===s){y.current=s;return}y.current=s,$("Shop Applied Filter",{filters:{category:p,sub_category:d,rarities:c,min_price_credits:u??null,max_price_credits:m??null,sort:_},result_count:j})},[p,d,c,u,m,_,o,j]);function ee(s){F(s),k(null)}function se(s){R(i=>i.includes(s)?i.filter(E=>E!==s):[...i,s])}function ae(){F("wearable"),k(null),R([]),w(""),M("")}function re(s){const i=g.find(E=>E.id===s.id);i&&i.source==="legacy"&&i.manaWei&&A(ve(i))}function ie(){U.invalidateQueries({queryKey:["unified-listings"]})}const v=u!=null?Math.min(u,n):0,S=m!=null?Math.min(m,n):n,te=v/n*100,ne=S/n*100;function le(s){const i=Math.min(s,S);w(i<=0?"":String(i))}function ce(s){const i=Math.max(s,v);M(i>=n?"":String(i))}return e.jsxs("div",{className:"browse browse--sidebar",children:[b?e.jsx("div",{className:"browse__scrim",onClick:()=>x(!1),"aria-hidden":!0}):null,e.jsxs("aside",{className:`browse__sidebar${b?" is-open":""}`,children:[e.jsxs("div",{className:"browse__sidebar-head",children:[e.jsx("span",{className:"browse__sidebar-title",children:a("assets.filters")}),e.jsx("button",{className:"browse__sidebar-close",onClick:()=>x(!1),"aria-label":a("assets.closeFilters"),children:"✕"})]}),e.jsx("div",{className:"sidebar__section-label",children:a("assets.category")}),e.jsx(fe,{category:p,subCategory:d,onCategory:ee,onSub:k}),e.jsx("div",{className:"sidebar__divider"}),e.jsx("div",{className:"sidebar__section-label",children:a("filter.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:a("assets.min")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(C,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.minPriceAria"),placeholder:"0",value:f,onChange:s=>w(s.target.value)})]})]}),e.jsx("span",{className:"price-filter__to",children:a("assets.priceTo")}),e.jsxs("label",{className:"price-filter__field",children:[e.jsx("span",{className:"price-filter__field-label",children:a("assets.max")}),e.jsxs("span",{className:"price-filter__box",children:[e.jsx(C,{className:"price-filter__coin"}),e.jsx("input",{type:"number",min:"0","aria-label":a("assets.maxPriceAria"),placeholder:"0",value:h,onChange:s=>M(s.target.value)})]})]})]}),e.jsxs("div",{className:"price-filter__slider",style:{"--min-pct":`${te}%`,"--max-pct":`${ne}%`},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:n,value:v,"aria-label":a("assets.minPriceSliderAria"),onChange:s=>le(Number(s.target.value))}),e.jsx("input",{type:"range",min:0,max:n,value:S,"aria-label":a("assets.maxPriceSliderAria"),onChange:s=>ce(Number(s.target.value))})]}),e.jsxs("div",{className:"price-filter__range",children:[e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(C,{className:"price-filter__coin"}),v.toLocaleString()]}),e.jsxs("span",{className:"price-filter__range-val",children:[e.jsx(C,{className:"price-filter__coin"}),S.toLocaleString()]})]})]}),e.jsx("div",{className:"sidebar__divider"}),e.jsxs("button",{type:"button",className:"sidebar__section-toggle","aria-expanded":P,onClick:()=>D(s=>!s),children:[e.jsx("span",{className:"sidebar__section-label",children:a("assets.rarity")}),e.jsx("span",{className:`ico ico-chevron sidebar__section-chev${P?" is-up":""}`,"aria-hidden":!0})]}),P?e.jsx("div",{className:"rarity-filter",children:he.map(s=>e.jsxs("label",{className:`rarity-filter__check${c.includes(s)?" is-on":""}`,children:[e.jsx("input",{type:"checkbox",checked:c.includes(s),onChange:()=>se(s)}),e.jsx("span",{children:s})]},s))}):null,e.jsxs("div",{className:"browse__sidebar-foot",children:[e.jsx("button",{type:"button",className:"browse__clear",onClick:ae,children:a("assets.clearFilters")}),e.jsx("button",{type:"button",className:"browse__apply",onClick:()=>x(!1),children:a("assets.apply")})]})]}),e.jsxs("div",{className:"browse__main",children:[e.jsx(be,{sort:_,onSort:K,total:O,loading:o,query:l,onOpenFilters:()=>x(!0)}),V&&g.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:a("assets.marketUnavailable")}):null,Z?e.jsx("p",{className:"error",children:a("assets.loadError")}):null,e.jsx("div",{className:"grid",children:o?e.jsx(Q,{count:15}):e.jsxs(e.Fragment,{children:[g.map(s=>s.source==="legacy"?e.jsx(B,{item:s,mode:"market",marketPriceCredits:Y(s),onBuyNow:re},s.id):e.jsx(B,{item:s},s.id)),T?e.jsx(Q,{count:6}):null]})}),e.jsx(je,{hasNextPage:z,isFetching:T,onLoadMore:()=>void H()}),!o&&g.length===0?e.jsx("p",{className:"muted",children:a("assets.noItems")}):null]}),L&&N?e.jsx(xe,{listing:L,rate:N,onClose:()=>A(null),onSold:()=>{A(null),ie()}}):null]})}export{We as Assets};
@@ -1 +0,0 @@
1
- import{j as e,a as fe,b as ke,r as j,L as J}from"./react-yytiy0wi.js";import{t as a,C as N,ad as A,a as ge,ae as v,c as ce,d as ve,g as Ne,n as Ce,u as we,af as Me,b as $,ag as re,ah as Se,z as B,j as Ie,s as Le,v as Pe,o as ne,ai as Te,x as le,w as Fe,aj as Ee}from"./index-C7swV0s7.js";import{a as ie}from"./buy-C3XM-F5L.js";import{g as Be,a as Ae,w as Re,S as We,G as Ue}from"./buy-gasless-CgW1uOlT.js";import{R as q,r as ze}from"./cart-checkout-N2i7gwjl.js";import{c as $e,C as qe}from"./payments-BojP1AK1.js";import{C as Ke}from"./CollectionCarousel-DttKFbs9.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BkDaYyvb.js";import"./index-HN6Rk25C.js";function Qe(t){const{phase:r,balanceCredits:h,onClose:i}=t,C=r==="processing",I=r!=="complete",L=r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),n=r==="processing";return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:C?void 0:i,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${n?" buy-modal__card--tall":""}`,children:[I&&e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:L}),!C&&e.jsx("button",{className:"buy-modal__x",onClick:i,"aria-label":a("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:r==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(N,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:A(h)})]})]}),r==="processing"&&e.jsx(Oe,{step:t.step??1,total:t.total??1}),r==="nofunds"&&e.jsx(Ge,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:i}),r==="complete"&&e.jsx(De,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??i,onTryInWorld:t.onTryInWorld??i}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx("p",{className:"buy-modal__error",children:t.message}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:i,children:a("buyModal.close")})})]})]})]})}function Oe({step:t,total:r}){return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:a("buyModal.completingTransaction")}),e.jsxs("div",{className:"cart-checkout__progress-row",children:[e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})}),e.jsxs("span",{className:"cart-checkout__step",children:[t,"/",r]})]})]})}function Ge({lines:t,shortfallCredits:r,packs:h,selectedPack:i,onSelectPack:C,onBuyPacks:I,onCancel:L}){const n=h.find(o=>o.id===i);return e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,r)})})," ",a("buyModal.warningToPurchase",{count:t.length})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(o=>e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:o.item.thumbnail?e.jsx("img",{src:o.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:o.item.name,children:o.item.name||a("buyModal.itemFallback")}),o.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:o.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(N,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:A(o.priceCredits)})]})]})]},o.item.id))}),e.jsx("div",{className:"buy-modal__packs",children:h.map(o=>{const P=o.id===i;return e.jsxs("button",{className:`buy-modal__pack${P?" buy-modal__pack--on":""}`,onClick:()=>C(o.id),children:[e.jsx(N,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:A(o.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",o.usd.toFixed(2),")"]})]},o.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(N,{className:"buy-modal__total-ico"}),e.jsx("span",{children:A((n==null?void 0:n.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((n==null?void 0:n.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:L,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:I,children:a("buyModal.buy")})]})]})}function De({purchased:t,onMyAssets:r,onTryInWorld:h}){return e.jsxs("div",{className:"buy-modal__body cart-checkout__done-body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"60",height:"60","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce77"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:a("getCredits.successTitle")})," ",a("buyModal.successBody")]})]}),e.jsx("div",{className:"cart-checkout__done",children:e.jsx("div",{className:"cart-checkout__done-scroll",children:t.map(i=>e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null,e.jsx("span",{className:"cart-checkout__done-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 18 18",width:"12",height:"12",children:e.jsx("path",{d:"M4 9l3.5 3.5L14 5",fill:"none",stroke:"#fff",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"cart-checkout__done-info",children:[e.jsx("div",{className:"cart-checkout__done-name",title:i.name,children:i.name||a("buyModal.itemFallback")}),i.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:i.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(N,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:A(i.priceCredits)})]})]},i.id))})}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:r,children:a("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:h,children:[a("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})}function oe(t){const r=t,h=(r.message??"").toLowerCase();return r.code===4001||h.includes("reject")||h.includes("denied")||h.includes("cancel")?a("getCredits.errorCanceled"):h.includes("insufficient")?a("cart.error.insufficient",{currency:Le.name}):h.includes("no active listing")||h.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}function Je(t){const r=t;return r.code===402||r.status===402||(r.message??"").toLowerCase().includes("insufficient")}const Ve=12e4,K=qe.slice(0,3),Ye=Ie.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function He(t){const r=[];return t.unavailable.length&&r.push(a("cart.drop.unavailable",{count:t.unavailable.length})),t.own.length&&r.push(a("cart.drop.own",{count:t.own.length})),a("cart.drop.removed",{items:r.join(` ${a("cart.drop.and")} `)})}function us(){ge({title:a("nav.cart"),noindex:!0});const t=v(s=>s.items),r=v(s=>s.remove),h=v(s=>s.clear),i=v(s=>s.restore),C=v(s=>s.setFittingOpen),I=ce(s=>s.items),L=ce(s=>s.toggle),{session:n}=ve(),o=t.some(s=>s.category!=="emote"),{data:P}=Ne({queryKey:["upsell-listings"],queryFn:()=>Ee({first:40}),staleTime:6e4}),{data:T}=Ce(n),R=we(),W=fe(),{state:w}=ke(),[V,F]=j.useState(null),[Y,f]=j.useState(null),[H,U]=j.useState(null),[de,M]=j.useState(!1),[x,E]=j.useState(null),X=j.useRef(0),[d,k]=j.useState(null),[Q,Z]=j.useState(""),ue=t.reduce((s,c)=>s+c.priceCredits,0),he=x?x.liveTotalCredits:ue,me=new Set(t.map(s=>s.id)),ee=((P==null?void 0:P.items)??[]).filter(s=>!me.has(s.id)).slice(0,12),_e=new Map(x==null?void 0:x.buyable.map(s=>[s.item.id,s])),z=(T==null?void 0:T.credits)??0,be=Se;function O(s){s(),E(null),U(null),f(null)}function pe(){k(null),M(!1)}function se(s){const c=s.reduce((m,u)=>m+u.priceCredits,0),l=Math.max(0,c-z),y=K.find(m=>m.credits>=l)??K[K.length-1];Z(y.id),$("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:c,credits_balance:z,shortfall:l}),k({phase:"nofunds",lines:s.map(m=>({item:m.item,priceCredits:m.priceCredits})),shortfall:l}),M(!1)}async function ye(s){if(!n||s.length===0)return;const c=s.map(u=>({...u.item,priceCredits:u.priceCredits})),l=[];let y="authorize",m=!1;k({phase:"processing",step:1,total:s.length});try{const u=[];for(let b=0;b<s.length;b++){const g=s[b];k({phase:"processing",step:b+1,total:s.length});try{const{credit:p,maxCreditedValue:D}=await Pe(n.identity,g.usdCents,g.trade.id);l.push(p.id),u.push({trade:g.trade,credits:[p],maxCreditedValue:D})}catch(p){if(Je(p)){if(l.length){try{await ne(n.identity,l)}catch(D){B(D,{flow:"cart_checkout",step:"release"})}R.invalidateQueries({queryKey:["usd-balance"]})}se(s);return}throw p}}y="submit";let _=[];if(Be())try{_=await Ae({purchases:u,buyer:n.address,signer:n.signer});const g=(await Promise.allSettled(_.map(p=>Re(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(g.length&&!g.some(p=>p instanceof We))throw g[0];m=!0}catch(b){if(!(b instanceof Ue))throw b;_=await ie({purchases:u,buyer:n.address,signer:n.signer})}else _=await ie({purchases:u,buyer:n.address,signer:n.signer});s.forEach(b=>r(b.item.id)),E(null),$("Shop Completed Purchase",{...Te(c),payment_type:"credits",no_crypto_step:m,transaction_hash:_[0]??null}),R.invalidateQueries({queryKey:["usd-balance"]}),k({phase:"complete",purchased:c})}catch(u){if(le(u)||B(u,{flow:"cart_checkout",step:y,cart_size:s.length}),$(le(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:y,error_code:Fe(u),value_usd:re(c.reduce((_,b)=>_+b.priceCredits,0)),cart_size:s.length}),l.length){try{await ne(n.identity,l)}catch(_){B(_,{flow:"cart_checkout",step:"release"})}R.invalidateQueries({queryKey:["usd-balance"]})}k({phase:"error",message:oe(u)})}}function ae(s){const c=s.reduce((l,y)=>l+y.priceCredits,0);if(T!=null&&T.credits<c){se(s);return}ye(s)}async function G(){if(!n){f(a("buyModal.signInToCheckout"));return}const s=v.getState().items;if(s.length!==0){f(null),U(null),M(!0),$("Shop Started Checkout",{cart_size:s.length,cart_value_credits:s.reduce((c,l)=>c+l.priceCredits,0),cart_value_usd:re(s.reduce((c,l)=>c+l.priceCredits,0)),has_sufficient_credits:z>=s.reduce((c,l)=>c+l.priceCredits,0)});try{F(a("cart.status.reviewing"));const c=await ze(s,n.address,be),l=[...c.unavailable,...c.own];if(l.length&&(l.forEach(y=>r(y.id)),U(He(c))),c.buyable.length===0){f(a("cart.error.noneAvailable")),E(null),F(null);return}if(c.orderChanged){E(c),X.current=Date.now(),F(null);return}F(null),ae(c.buyable)}catch(c){B(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),f(oe(c)),F(null)}finally{M(!1)}}}async function xe(){if(x){if(!n){f(a("buyModal.signInToCheckout"));return}if(Date.now()-X.current>Ve){E(null),U(null),await G();return}f(null),ae(x.buyable)}}async function je(){if(Q){try{sessionStorage.setItem(q,JSON.stringify(v.getState().items))}catch{}M(!0);try{const s=await $e(Q,n?{address:n.address,identity:n.identity}:void 0);if(s.url){window.location.href=s.url;return}W("/credits")}catch(s){try{sessionStorage.removeItem(q)}catch{}B(s,{flow:"cart_buy_credits"}),k({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{M(!1)}}}const te=j.useRef(!1);j.useEffect(()=>{if(!(w!=null&&w.resumeCheckout)||te.current)return;te.current=!0;try{const c=sessionStorage.getItem(q);if(c){sessionStorage.removeItem(q);const l=JSON.parse(c);Array.isArray(l)&&l.length&&i(l)}}catch{}R.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void G(),0);return()=>clearTimeout(s)},[w==null?void 0:w.resumeCheckout]);const S=de||(d==null?void 0:d.phase)==="processing";return t.length===0&&!d?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:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(J,{className:"btn btn--purple",to:"/assets",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>W(-1),type:"button",children:[e.jsx("span",{className:"ico ico-arrow-left","aria-hidden":!0}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("section",{className:"checkout__panel",children:[e.jsxs("div",{className:"checkout__panel-head",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>W(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx("span",{className:"ico ico-arrow-left","aria-hidden":!0})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:t.length})}),o?e.jsxs("button",{className:"checkout__fitting",onClick:()=>C(!0),disabled:S,children:[e.jsx("span",{className:"ico ico-fitting-room checkout__fitting-ico","aria-hidden":!0}),a("cart.fittingRoom")]}):null]}),e.jsx("div",{className:"checkout__list",children:t.map(s=>{const c=_e.get(s.id),l=c?c.priceCredits:s.priceCredits,y=!!c&&c.priceCredits!==s.priceCredits,m=!!I[s.id],u=s.tokenId??s.itemId,_=s.contractAddress&&u?`/item/${s.contractAddress}/${u}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[_?e.jsx(J,{className:"checkout__thumb-link",to:_,state:{item:s,tradeId:s.tradeId},"aria-label":s.name,children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null}):s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:s.name}):null,e.jsx("span",{className:"checkout__thumb-check","aria-hidden":!0,children:e.jsx("svg",{viewBox:"0 0 20 20",width:"12",height:"12",children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",fill:"none",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"checkout__info",children:[e.jsxs("div",{className:"checkout__desc",children:[_?e.jsx(J,{className:"checkout__name",to:_,state:{item:s,tradeId:s.tradeId},title:s.name,children:s.name}):e.jsx("div",{className:"checkout__name",title:s.name,children:s.name}),s.creator?e.jsx(Me,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>O(()=>r(s.id)),disabled:S,"aria-label":a("cart.removeFromCart",{name:s.name}),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("span",{className:"checkout__qty",children:"1"}),e.jsx("button",{className:"checkout__step",disabled:!0,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"checkout__price",children:[e.jsx(N,{className:"checkout__price-ico"})," ",l,y?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${m?" is-on":""}`,onClick:()=>L(s),"aria-label":m?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:m?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx("span",{className:`ico ${m?"ico-heart-solid":"ico-heart"}`,"aria-hidden":!0})}),e.jsx("button",{className:"checkout__remove",onClick:()=>O(()=>r(s.id)),disabled:S,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx("span",{className:"ico ico-trash","aria-hidden":!0})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>O(h),disabled:S,children:a("cart.clearCart")}),null]})]}),e.jsxs("aside",{className:"checkout__summary",children:[e.jsx("h2",{className:"checkout__summary-title",children:a("cart.purchaseSummary")}),e.jsxs("div",{className:"checkout__summary-body",children:[e.jsxs("div",{className:"checkout__total-line",children:[e.jsx("span",{className:"checkout__total-label",children:a("cart.totalItems",{count:t.length})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(N,{className:"checkout__total-ico"})," ",he]})]}),e.jsx("button",{className:"checkout__cta",onClick:x?xe:G,disabled:S,children:S?a("cart.working"):x?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),x?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,H?e.jsx("p",{className:"muted checkout__msg",children:H}):null,V?e.jsx("p",{className:"muted checkout__msg",children:V}):null,Y?e.jsx("p",{className:"error checkout__msg",children:Y}):null]})]})]}),ee.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(Ke,{title:a("cart.youMightAlsoLike"),items:ee})}):null,d?e.jsx(Qe,{phase:d.phase,balanceCredits:z,onClose:pe,step:d.phase==="processing"?d.step:void 0,total:d.phase==="processing"?d.total:void 0,lines:d.phase==="nofunds"?d.lines:void 0,shortfallCredits:d.phase==="nofunds"?d.shortfall:void 0,packs:K,selectedPack:Q,onSelectPack:Z,onBuyPacks:je,purchased:d.phase==="complete"?d.purchased:void 0,onMyAssets:()=>W("/assets?tab=mine"),onTryInWorld:()=>window.open(Ye,"_blank","noopener"),message:d.phase==="error"?d.message:void 0}):null]})}export{us as Cart};
@@ -1 +0,0 @@
1
- import{j as e,r as u,d as D,a as O}from"./react-yytiy0wi.js";import{F as Q,t as r,j as Y,z as Z,g as J,a as V,A as W,an as X,s as ee,ao as ae}from"./index-C7swV0s7.js";import{d as re,g as te,a as se,A as ce}from"./collection-Cb2Yk135.js";import{u as oe}from"./useStore-CTx-2Xfe.js";import{s as M}from"./address-DrURAr9O.js";import{S as F,C as ie,F as le,c as ne,a as T,b as de}from"./categories-DlVqkFPG.js";import{L as me}from"./LoadMore-DOqijdHT.js";import{u as ue}from"./useInfiniteGrid-LLmuFcQo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function pe({name:t,creator:a}){const{data:o}=oe(a),l=(o==null?void 0:o.cover)||re;return e.jsxs("section",{className:"collection-hero","aria-label":t,children:[e.jsxs("div",{className:"collection-hero__cover",children:[e.jsx("img",{className:"collection-hero__cover-img",src:l,alt:"",loading:"eager"}),e.jsx("div",{className:"collection-hero__scrim","aria-hidden":!0})]}),e.jsx("h1",{className:"collection-hero__title",children:t})]})}function he({address:t}){var x,i;const{data:a}=Q(t),[o,l]=u.useState(!1);if(!t)return null;const n=(a==null?void 0:a.name)||M(t),p=(i=(x=a==null?void 0:a.avatar)==null?void 0:x.snapshots)==null?void 0:i.face256,h=`${Y.profileUrl}/${t}`,g=te(se({name:a==null?void 0:a.name,hasClaimedName:a==null?void 0:a.hasClaimedName,ethAddress:(a==null?void 0:a.ethAddress)??t}));async function d(){try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1500)}catch(_){Z(_,{flow:"copy_creator_address"})}}return e.jsxs("div",{className:"creator-card",children:[p?e.jsx("img",{className:"creator-card__ava",src:p,alt:"",loading:"eager",style:{backgroundColor:g}}):e.jsx("span",{className:"creator-card__ava creator-card__ava--ph","aria-hidden":!0,style:{backgroundColor:g}}),e.jsx("h2",{className:"creator-card__name",title:n,children:n}),e.jsxs("button",{type:"button",className:"creator-card__account",onClick:()=>void d(),title:o?r("collection.copied"):r("collection.copyAddress"),"aria-label":o?r("collection.copied"):r("collection.copyAddress"),children:[e.jsx("span",{className:"creator-card__account-text",children:M(t)}),e.jsx("span",{className:"ico ico-copy creator-card__copy","aria-hidden":!0})]}),e.jsx("a",{className:"creator-card__view",href:h,target:"_blank",rel:"noopener noreferrer",children:r("collection.viewProfile")})]})}const ge=48;function Pe(){var k;const{contractAddress:t}=D(),a=O(),[o,l]=u.useState("wearable"),[n,p]=u.useState(null),[h,g]=u.useState([]),[d,x]=u.useState(""),[i,_]=u.useState(""),[v,R]=u.useState("newest"),f=d&&!Number.isNaN(Number(d))?Number(d):void 0,C=i&&!Number.isNaN(Number(i))?Number(i):void 0,E=n?de[n]:void 0,B=(F.find(s=>s.key===v)??F[0]).server,y={category:o,rarities:h.length?h:void 0,wearableCategories:E,minPriceCredits:f,maxPriceCredits:C,sortBy:B},{items:b,total:L,isLoading:N,error:A,hasNextPage:U,isFetchingNextPage:S,fetchNextPage:$}=ue(["collection-page",t,y],s=>X(t,{...y,first:ge,skip:s}),{enabled:!!t}),{data:c}=J({queryKey:["collection-meta",t],queryFn:()=>ae(t),enabled:!!t,staleTime:5*6e4}),w=(c==null?void 0:c.name)||r("collection.fallbackTitle");V({title:c==null?void 0:c.name,description:c!=null&&c.name?r("seo.collection.description",{name:c.name}):void 0});const P=(c==null?void 0:c.creator)||((k=b[0])==null?void 0:k.creator);function I(s){l(s),p(null)}function q(s){g(m=>m.includes(s)?m.filter(z=>z!==s):[...m,s])}function G(){l("wearable"),p(null),g([]),x(""),_("")}const j=!!(f||C),H=j?`${d||"0"}–${i||"∞"}`:r("filter.price"),K=o!=="wearable"||!!n||h.length>0||j;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":r("collection.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>a("/assets"),children:r("collection.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:w})]}),e.jsx(pe,{name:w,creator:P}),e.jsxs("div",{className:"browse browse--sidebar collection-page__browse",children:[e.jsxs("aside",{className:"browse__sidebar",children:[e.jsx(he,{address:P}),e.jsx(ie,{category:o,subCategory:n,onCategory:I,onSub:p,title:r("collection.category"),flat:!0})]}),e.jsxs("div",{className:"browse__main",children:[!N&&b.length>0?e.jsx(ce,{items:b,source:"collection"}):null,e.jsx(le,{rarities:h,onToggleRarity:q,sort:v,onSort:R,total:L,loading:N,anyActive:K,onClear:G,renderTrailing:s=>e.jsx(ne,{panelKey:"price",label:H,active:j,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":r("collection.priceMin"),placeholder:r("collection.priceMinPlaceholder"),value:d,onChange:m=>x(m.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":r("collection.priceMax"),placeholder:r("collection.priceMaxPlaceholder"),value:i,onChange:m=>_(m.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:r("collection.priceHint",{currency:ee.name})})]})})}),A?e.jsx("p",{className:"error",children:r("collection.error")}):null,e.jsx("div",{className:"grid",children:N?e.jsx(T,{count:15}):e.jsxs(e.Fragment,{children:[b.map(s=>e.jsx(W,{item:s},s.id)),S?e.jsx(T,{count:6}):null]})}),e.jsx(me,{hasNextPage:U,isFetching:S,onLoadMore:()=>void $()}),!N&&!A&&b.length===0?e.jsx("p",{className:"muted",children:r("collection.empty")}):null]})]})]})}export{Pe as Collection,Pe as default};
@@ -1 +0,0 @@
1
- import{a as B,j as e,L as ee,d as ae,u as re,r as j}from"./react-yytiy0wi.js";import{aH as se,aI as te,af as oe,t as a,aJ as $,F as U,d as ce,j as le,a as ne,A as ie,aj as de,aK as me,s as ue}from"./index-C7swV0s7.js";import{d as he,g as ge,a as xe,A as _e}from"./collection-Cb2Yk135.js";import{u as pe,L as Ne}from"./useStore-CTx-2Xfe.js";import{s as K}from"./address-DrURAr9O.js";import{S as I,C as je,a as w,F as be,c as fe,b as Ce}from"./categories-DlVqkFPG.js";import{L as R}from"./LoadMore-DOqijdHT.js";import{u as T}from"./useInfiniteGrid-LLmuFcQo.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";function ve({collection:t,cover:r,itemCount:o}){const n=B(),{contractAddress:m,name:g,creator:x}=t,N=r==null||o==null,{data:i}=se(m,N),p=r==null?(i==null?void 0:i.items)??[]:[],h=o??(i==null?void 0:i.total);function _(){n(`/collection/${m}`)}return e.jsxs("article",{className:"coll-card",role:"link",tabIndex:0,onClick:_,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),_())},children:[e.jsx("div",{className:"coll-card__media",children:r?e.jsx("img",{className:"coll-card__img",src:r,alt:"",loading:"lazy"}):p.length>0?e.jsx(te,{items:p,className:"coll-card__cover"}):null}),e.jsxs("div",{className:"coll-card__body",children:[e.jsx("h3",{className:"coll-card__name",title:g,children:g}),e.jsxs("div",{className:"coll-card__meta",children:[x?e.jsx(oe,{address:x,className:"coll-card__creator",linkToProfile:!0}):e.jsx("span",{className:"coll-card__creator",children:" "}),e.jsx("span",{className:"coll-card__count",children:h==null?"…":a("collectionCard.itemCount",{count:h})})]}),e.jsx("button",{className:"coll-card__view",onClick:d=>{d.stopPropagation(),_()},tabIndex:-1,children:a("collectionCard.viewCollection")})]})]})}function we({address:t,className:r=""}){const o=$(m=>m.followed.includes(t.toLowerCase())),n=$(m=>m.toggle);return t?e.jsx("button",{type:"button",className:`btn btn--sm ${o?"btn--ghost":"btn--outline"} ${r}`.trim(),"aria-pressed":o,title:o?a("creator.unfollowTitle"):a("creator.followTitle"),onClick:()=>n(t),children:o?a("creator.following"):a("creator.follow")}):null}const ke={website:"ico-website",twitter:"ico-twitter",discord:"ico-discord",facebook:"ico-facebook"};function Pe({address:t}){var d,b;const{data:r}=U(t),{data:o}=pe(t),n=ce(l=>{var f;return(f=l.session)==null?void 0:f.address}),m=!!n&&n.toLowerCase()===t.toLowerCase(),g=(r==null?void 0:r.name)||K(t),x=(b=(d=r==null?void 0:r.avatar)==null?void 0:d.snapshots)==null?void 0:b.face256,N=(o==null?void 0:o.cover)||he,i=o==null?void 0:o.description,p=`${le.profileUrl}/${t}`,h=Ne.filter(l=>o==null?void 0:o.links[l]),_=ge(xe({name:r==null?void 0:r.name,hasClaimedName:r==null?void 0:r.hasClaimedName,ethAddress:(r==null?void 0:r.ethAddress)??t}));return e.jsxs("section",{className:"creator-hero","aria-label":`${g} storefront`,children:[e.jsxs("div",{className:"creator-hero__cover",children:[e.jsx("img",{className:"creator-hero__cover-img",src:N,alt:"",loading:"eager"}),e.jsx("div",{className:"creator-hero__scrim","aria-hidden":!0})]}),(h.length>0||m)&&e.jsxs("div",{className:"creator-hero__links",children:[h.map(l=>e.jsx("a",{className:"creator-hero__link",href:(o==null?void 0:o.links[l])??"",target:"_blank",rel:"noopener noreferrer",title:a(`creator.link.${l}`),"aria-label":a(`creator.link.${l}`),children:e.jsx("span",{className:`ico ${ke[l]}`,"aria-hidden":!0})},l)),m&&e.jsx(ee,{className:"creator-hero__link creator-hero__edit",to:"/store-settings",title:a("creator.editStore"),"aria-label":a("creator.editStore"),children:e.jsx("span",{className:"ico ico-pen","aria-hidden":!0})})]}),e.jsxs("div",{className:"creator-hero__body",children:[x?e.jsx("img",{className:"creator-hero__ava",src:x,alt:"",loading:"eager",style:{backgroundColor:_}}):e.jsx("span",{className:"creator-hero__ava creator-hero__ava--ph","aria-hidden":!0,style:{backgroundColor:_}}),e.jsxs("div",{children:[e.jsx("h2",{className:"creator-hero__name",children:g}),i?e.jsx("p",{className:"creator-hero__desc",children:i}):null]}),e.jsxs("div",{className:"creator-hero__actions",children:[e.jsx("a",{className:"creator-hero__view",href:p,target:"_blank",rel:"noopener noreferrer",children:a("creator.viewProfile")}),e.jsx(we,{address:t,className:"creator-hero__follow"})]})]})]})}const E=48;function Ue(){const{address:t}=ae(),r=B(),[o]=re(),n=o.has("collections"),{data:m}=U(t),g=(m==null?void 0:m.name)||(t?K(t):a("creator.fallbackName"));ne({title:g,description:a("seo.creator.description",{name:g})});const[x,N]=j.useState("wearable"),[i,p]=j.useState(null),[h,_]=j.useState([]),[d,b]=j.useState(""),[l,f]=j.useState(""),[P,D]=j.useState("newest"),S=d&&!Number.isNaN(Number(d))?Number(d):void 0,y=l&&!Number.isNaN(Number(l))?Number(l):void 0,H=i?Ce[i]:void 0,O=(I.find(s=>s.key===P)??I[0]).server,L={creator:t,category:x,rarities:h.length?h:void 0,wearableCategories:H,minPriceCredits:S,maxPriceCredits:y,sortBy:O},{items:C,total:G,isLoading:v,error:A,hasNextPage:Y,isFetchingNextPage:F,fetchNextPage:z}=T(["creator-listings",L],s=>de({...L,first:E,skip:s}),{enabled:!!t&&!n}),u=T(["creator-collections",t],s=>me(t,{first:E,skip:s}).then(c=>({items:c.collections,total:c.total})),{enabled:!!t&&n});function J(s){N(s),p(null),n&&M()}function M(){const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}`:""},{replace:!0})}function W(){if(n){M();return}const s=new URLSearchParams(o);s.delete("collections");const c=s.toString();r({search:c?`?${c}&collections`:"?collections"},{replace:!0})}function Z(s){_(c=>c.includes(s)?c.filter(X=>X!==s):[...c,s])}function q(){N("wearable"),p(null),_([]),b(""),f("")}const k=!!(S||y),Q=k?`${d||"0"}–${l||"∞"}`:a("filter.price"),V=x!=="wearable"||!!i||h.length>0||k;return e.jsxs("div",{className:"collection-page",children:[e.jsxs("nav",{className:"collection-page__crumbs","aria-label":a("creator.breadcrumbAria"),children:[e.jsx("button",{className:"collection-page__crumb-link",onClick:()=>r("/assets"),children:a("creator.breadcrumb")}),e.jsx("span",{className:"collection-page__crumb-sep",children:"/"}),e.jsx("span",{className:"collection-page__crumb-current",children:g})]}),t?e.jsx(Pe,{address:t}):null,!n&&!v&&C.length>0?e.jsx(_e,{items:C,source:"creator"}):null,e.jsxs("div",{className:"browse browse--sidebar",children:[e.jsx("aside",{className:"browse__sidebar",children:e.jsx(je,{category:x,subCategory:i,onCategory:J,onSub:p,title:a("creator.category"),flat:!0,collections:n,onCollections:W})}),e.jsx("div",{className:"browse__main",children:n?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"creator-collections__bar",children:e.jsx("span",{className:"assets__count",children:u.isLoading?"…":a("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx("p",{className:"error",children:a("creator.error")}):null,e.jsx("div",{className:"grid grid--collections",children:u.isLoading?e.jsx(w,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(s=>e.jsx(ve,{collection:s,itemCount:s.itemCount},s.contractAddress)),u.isFetchingNextPage?e.jsx(w,{count:6}):null]})}),e.jsx(R,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:a("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(be,{rarities:h,onToggleRarity:Z,sort:P,onSort:D,total:G,loading:v,anyActive:V,onClear:q,renderTrailing:s=>e.jsx(fe,{panelKey:"price",label:Q,active:k,panel:s,children:e.jsxs("div",{className:"filter-pop filter-pop--price",children:[e.jsxs("div",{className:"filter-pop__price-row",children:[e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMin"),placeholder:a("creator.priceMinPlaceholder"),value:d,onChange:c=>b(c.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":a("creator.priceMax"),placeholder:a("creator.priceMaxPlaceholder"),value:l,onChange:c=>f(c.target.value)})]}),e.jsx("p",{className:"filter-pop__hint",children:a("creator.priceHint",{currency:ue.name})})]})})}),A?e.jsx("p",{className:"error",children:a("creator.error")}):null,e.jsx("div",{className:"grid",children:v?e.jsx(w,{count:15}):e.jsxs(e.Fragment,{children:[C.map(s=>e.jsx(ie,{item:s},s.id)),F?e.jsx(w,{count:6}):null]})}),e.jsx(R,{hasNextPage:Y,isFetching:F,onLoadMore:()=>void z()}),!v&&!A&&C.length===0?e.jsx("p",{className:"muted",children:a("creator.empty")}):null]})})]})]})}export{Ue as Creator,Ue as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BB7DOq9K.js","assets/react-yytiy0wi.js","assets/dcl-schemas-BICTSpB5.js","assets/index-C7swV0s7.js","assets/sentry-BPJvc5GU.js","assets/ethers-w2AslR0v.js","assets/intl-CBcMB1D2.js","assets/index-DgcUoaxa.css","assets/emotion-styled.browser.esm-De8LzLi0.js","assets/useTheme-3xICgEAy.js","assets/CircularProgress-DndPkIP8.js","assets/index-BmjbHn2J.js","assets/useTheme-B8h6R_Xd.js","assets/CssVarsProvider-B8lKeq36.js","assets/getOverlayAlpha-DC6Z8-Ah.js","assets/index-CPHHOZWE.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
2
- import{a as se,r as m,j as e,d as Se,b as Pe,L as Ee}from"./react-yytiy0wi.js";import{d as te,n as Fe,u as Le,t as s,ah as De,k as Te,l as Be,v as Re,o as J,b as z,w as me,x as ee,ai as $e,z as ue,C as M,ad as Z,_ as ae,F as We,I as Ve,H as Oe,ar as qe,W as ze,j as fe,as as Ke,at as Ue,ae as _e,c as he,g as q,au as Ge,av as He,aw as Qe,ax as Ye,ay as Je,ak as Ze,a as Xe,az as ea,aA as aa,aB as sa,af as ta,aC as be,aD as ia,an as ra,aE as la,aF as da,ao as na,aG as ca}from"./index-C7swV0s7.js";import{d as $}from"./dcl-schemas-BICTSpB5.js";import{b as pe}from"./buy-C3XM-F5L.js";import{g as oa,b as ma,w as ua,S as _a,G as ha}from"./buy-gasless-CgW1uOlT.js";import{C as ba,c as pa}from"./payments-BojP1AK1.js";import{R as ye}from"./resume-buy-Bf0zIH7y.js";import{C as ya}from"./CircularProgress-DndPkIP8.js";import{u as xa,M as ja}from"./MarketCheckout-BSyyg6RV.js";import{s as va}from"./address-DrURAr9O.js";import{C as fa}from"./CollectionCarousel-DttKFbs9.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BkDaYyvb.js";import"./index-HN6Rk25C.js";import"./mana-rate-B7ShUGMF.js";function xe(i){const l=i,t=(l.message??"").toLowerCase();return l.code===4001||t.includes("reject")||t.includes("denied")||t.includes("cancel")?s("getCredits.errorCanceled"):t.includes("not for sale")||t.includes("not found")||t.includes("404")?s("buyModal.error.soldOrRemoved"):t.includes("your own listing")?s("buyModal.error.cantBuyOwn"):s("buyModal.error.generic")}function Na(i){const l=i;return l.code===402||l.status===402||(l.message??"").toLowerCase().includes("insufficient")}const R=ba.slice(0,3);function ga({item:i,onClose:l,resume:t=!1}){var I,H;const{session:n}=te(),{data:c}=Fe(n),b=Le(),x=se(),[_,d]=m.useState("loading"),[j,a]=m.useState(null),[v,P]=m.useState(""),[f,L]=m.useState(i.priceCredits),[C,g]=m.useState(null),N=m.useRef(null),W=(C==null?void 0:C.credits)??f,k=(c==null?void 0:c.credits)??0;m.useEffect(()=>{let o=!1;if(!n){d("error"),a(s("buyModal.signInToCheckout"));return}const y=u=>{const h=u-((c==null?void 0:c.credits)??0),p=R.find(A=>A.credits>=h)??R[R.length-1];P(p.id),z("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:u,credits_balance:(c==null?void 0:c.credits)??0,shortfall:Math.max(0,h)}),d("nofunds")};return(async()=>{var u,h;try{const p=await De(i);if(!p)throw new Error("not for sale");if(Te(p,n.address))throw new Error("You can't buy your own listing.");const A=Be((h=(u=p.received)==null?void 0:u[0])==null?void 0:h.amount);if(!Number.isFinite(A)||A<=0)throw new Error("price unavailable");const T=Math.ceil(A/10);if(o)return;if(L(T),c!=null&&c.credits<T){y(T);return}try{const{credit:E,maxCreditedValue:V,usdCents:B}=await Re(n.identity,A,p.id);if(o){J(n.identity,[E.id]).catch(()=>{});return}N.current=E.id;const w=Math.ceil(B/10);L(w);const O={trade:p,credit:E,maxCreditedValue:V,usdCents:B,credits:w};g(O),t?K(O):d("ready")}catch(E){if(o)return;if(Na(E)){y(T);return}throw E}}catch(p){if(o)return;z(ee(p)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:me(p)}),d("error"),a(xe(p))}})(),()=>{o=!0,N.current&&n&&(J(n.identity,[N.current]).catch(()=>{}),N.current=null)}},[]);async function K(o=C){if(!n||!o)return;d("processing"),a(null);let y=!1;try{const u={trade:o.trade,buyer:n.address,signer:n.signer,credits:[o.credit],maxCreditedValue:o.maxCreditedValue};let h;if(oa())try{h=await ma(u),await ua(h),y=!0}catch(p){if(p instanceof _a)y=!0;else if(p instanceof ha)h=await pe(u);else throw p}else h=await pe(u);N.current=null,z("Shop Completed Purchase",{...$e([i]),payment_type:"credits",no_crypto_step:y,transaction_hash:h??null}),b.invalidateQueries({queryKey:["usd-balance"]}),d("complete")}catch(u){ee(u)||ue(u,{flow:"buy",step:"submit",gasless:y}),J(n.identity,[o.credit.id]).catch(()=>{}),N.current=null,z(ee(u)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:me(u)}),b.invalidateQueries({queryKey:["usd-balance"]}),a(xe(u)),d("error")}}async function U(){if(!(!v||!n)){try{sessionStorage.setItem(ye,JSON.stringify(i))}catch{}C&&J(n.identity,[C.credit.id]).catch(()=>{}),N.current=null,d("loading");try{const o=await pa(v,{address:n.address,identity:n.identity});if(o.url){window.location.href=o.url;return}x("/credits")}catch(o){ue(o,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(ye)}catch{}a(s("buyModal.error.creditsCheckout")),d("error")}}}const G=_==="processing",D=_==="complete"?s("buyModal.titleComplete"):_==="nofunds"?s("buyModal.titleNoFunds"):s("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":s("buyModal.dialogAria",{name:i.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:G?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${_==="processing"||_==="loading"?" buy-modal__card--tall":""}`,children:[e.jsxs("div",{className:"buy-modal__head",children:[e.jsxs("div",{className:"buy-modal__head-row",children:[e.jsx("h2",{className:"buy-modal__title",children:D}),!G&&e.jsx("button",{className:"buy-modal__x",onClick:l,"aria-label":s("buyModal.close"),children:e.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"buy-modal__balance",children:[e.jsx("span",{className:"buy-modal__balance-label",children:_==="nofunds"?s("buyModal.dclBalance"):s("buyModal.myCreditsBalance")}),e.jsx(M,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:Z(k)})]})]}),_==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(ya,{size:44})}),_==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx("p",{className:"buy-modal__error",children:j}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:l,children:s("buyModal.close")})})]}),_==="nofunds"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__warning",children:[e.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,className:"buy-modal__warning-ico",children:[e.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]}),e.jsxs("p",{className:"buy-modal__warning-text",children:[e.jsx("b",{children:s("buyModal.insufficientFunds")})," ",s("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:s("buyModal.warningCreditsAmount",{count:Math.max(0,W-k)})})," ",s("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(je,{item:i,priceCredits:W}),e.jsx("div",{className:"buy-modal__packs",children:R.map(o=>{const y=o.credits,u=o.id===v;return e.jsxs("button",{className:`buy-modal__pack${u?" buy-modal__pack--on":""}`,onClick:()=>P(o.id),children:[e.jsx(M,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:Z(y)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",o.usd.toFixed(2),")"]})]},o.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(M,{className:"buy-modal__total-ico"}),e.jsx("span",{children:Z(((I=R.find(o=>o.id===v))==null?void 0:I.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((H=R.find(o=>o.id===v))==null?void 0:H.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:l,children:s("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:U,children:s("buyModal.buy")})]})]}),_==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(je,{item:i,priceCredits:W}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>K(),children:s("buyModal.buy")})})]}),_==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:"/icon-192.png",alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:t?s("buyModal.completingPurchase"):s("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),_==="complete"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-modal__success",children:[e.jsxs("svg",{viewBox:"0 0 64 64",width:"64",height:"64","aria-hidden":!0,children:[e.jsx("circle",{cx:"32",cy:"32",r:"32",fill:"#34ce74"}),e.jsx("path",{d:"M20 33l8 8 16-18",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsxs("p",{className:"buy-modal__success-text",children:[e.jsx("b",{children:s("getCredits.successTitle")})," ",s("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>x("/assets?tab=mine"),children:s("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:l,children:[s("buyModal.tryInWorld"),e.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20","aria-hidden":!0,children:e.jsx("path",{d:"M5 12h12M13 7l5 5-5 5",fill:"none",stroke:"#fcfcfc",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]})]})}function je({item:i,priceCredits:l}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:i.thumbnail?e.jsx("img",{src:i.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsx("div",{className:"buy-modal__asset-name",title:i.name,children:i.name||s("buyModal.itemFallback")}),i.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:s("search.byCreator",{name:i.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(M,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:Z(l)})]})]})]})}const wa=m.lazy(async()=>{const[{EmoteControls:i},{Experimental_CssVarsProvider:l},{light:t}]=await Promise.all([ae(()=>import("./index-BB7DOq9K.js").then(n=>n.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ae(()=>import("./index-BmjbHn2J.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ae(()=>import("./index-CPHHOZWE.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:n=>e.jsx(l,{theme:t,children:e.jsx(i,{...n})})}});function Ca(i){return e.jsx(m.Suspense,{fallback:null,children:e.jsx(wa,{...i})})}function ka({item:i}){const l=te(g=>{var N;return(N=g.session)==null?void 0:N.address}),{data:t,isLoading:n}=We(l),c=l&&t?l:"default",b=i.category==="emote",[x,_]=m.useState("item"),d=!b&&x==="item",j=d||!n,[a,v]=m.useState(!0);m.useEffect(()=>{v(!0)},[i.id,d]);const P=!!l&&!!t,f=P&&Ve(i,Oe(t)),L=qe(i)[0],C=P&&!f&&!b;return e.jsxs(e.Fragment,{children:[j?e.jsx(ze,{id:"shop-item-preview",contractAddress:i.contractAddress,tokenId:i.tokenId??void 0,itemId:i.tokenId?void 0:i.itemId??void 0,profile:d?void 0:f?c:"default",bodyShape:d||f?void 0:L,type:b?void 0:d?$.PreviewType.WEARABLE:$.PreviewType.AVATAR,emote:b||d?void 0:$.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:b?1.5:void 0,wheelStart:b?100:void 0,dev:fe.chainId===80002,onLoad:()=>v(!1)}):null,!j||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,C&&!d?e.jsx("p",{className:"item-preview__note",children:s("itemPreview.shownOnBody",{shape:Ke(L)})}):null,b?e.jsx("div",{className:"item-preview__emote-controls",children:e.jsx(Ca,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":s("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:x==="avatar"?"is-active":"","aria-pressed":x==="avatar","aria-label":s("itemPreview.onAvatar"),onClick:()=>_("avatar"),children:[e.jsxs("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[e.jsx("circle",{cx:"12",cy:"7.5",r:"4"}),e.jsx("path",{d:"M4 20c0-4.2 3.6-6.5 8-6.5s8 2.3 8 6.5v.5H4z"})]}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:x==="item"?"is-active":"","aria-pressed":x==="item","aria-label":s("itemPreview.item"),onClick:()=>_("item"),children:[e.jsx("svg",{className:"item-preview__toggle-ico",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8.5 3 3 6l1.8 3.8 2.2-1V21h10V8.8l2.2 1L22 6l-5.5-3a2.6 2.6 0 0 1-4.5 1.4A2.6 2.6 0 0 1 8.5 3z"})}),e.jsx("span",{className:"item-preview__toggle-label",children:s("itemPreview.item")})]})]})]})}function Ia({contractAddress:i,name:l,items:t,className:n}){const c=se();if(!i||!l)return null;const b=(t??[]).map(d=>d.thumbnail).filter(d=>!!d).slice(0,4),x=b.slice(0,2),_=b.slice(2,4);return e.jsxs("button",{className:`creator creator--link${n?` ${n}`:""}`,onClick:d=>{d.stopPropagation(),c(`/collection/${i}`)},children:[b.length>0?e.jsxs("span",{className:"creator__ava collection-collage","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${_.length===0?" collection-collage__row--full":""}`,children:x.map((d,j)=>e.jsx("img",{src:d,alt:""},j))}),_.length>0?e.jsx("span",{className:"collection-collage__row",children:_.map((d,j)=>e.jsx("img",{src:d,alt:""},j))}):null]}):null,e.jsx("span",{className:"creator__name",children:Ue(l)})]})}function Aa(i){return Object.values($.Rarity).includes(i)}function Ma(i){return i==="male"?s("itemDetail.genderMale"):i==="female"?s("itemDetail.genderFemale"):i==="unisex"?s("itemDetail.genderUnisex"):null}function ve(i){return i.wearableCategory?i.wearableCategory.replace(/_/g," "):i.category==="emote"?s("itemDetail.categoryEmote"):s("itemDetail.categoryWearable")}function Ha(){const{contractAddress:i,tokenId:l}=Se(),{state:t}=Pe(),n=se(),c=!!(t!=null&&t.market),b=(t==null?void 0:t.marketPriceCredits)??null,x=_e(r=>r.add),_=_e(r=>r.items),d=he(r=>r.toggle),{session:j}=te(),[a,v]=m.useState(()=>t!=null&&t.item?{...t.item,tradeId:t.tradeId??t.item.tradeId}:{id:`${i}-${l}`,name:"",creator:"",contractAddress:i??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:fe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:l??void 0,tradeId:t==null?void 0:t.tradeId}),[P,f]=m.useState(!1),[L,C]=m.useState(!!(t!=null&&t.resumeBuy));m.useEffect(()=>{t!=null&&t.resumeBuy&&f(!0)},[t==null?void 0:t.resumeBuy]);const{data:g=[],isFetched:N}=q({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>ra(a.contractAddress,{first:20}).then(r=>r.items)}),W=a.available==null&&!a.tokenId,{data:k,isLoading:K}=q({queryKey:["shop-item",a.contractAddress,l],enabled:!c&&!!a.contractAddress&&!!l&&(!(t!=null&&t.item)||W),queryFn:()=>la(a.contractAddress,l)});m.useEffect(()=>{k&&v(r=>r.tradeId?r.available!=null&&r.wearableCategory?r:{...r,available:r.available??k.available,wearableCategory:r.wearableCategory??k.wearableCategory}:{...k})},[k]);const[U,G]=m.useState(!1),{data:D=""}=q({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>da(a.contractAddress,a.itemId)}),{data:I}=q({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>na(a.contractAddress)});m.useEffect(()=>{if(a.name||k||g.length===0)return;const r=l&&g.find(S=>S.tokenId===l||S.itemId===l)||g.find(S=>S.contractAddress===a.contractAddress);r&&v(S=>({...r,tradeId:S.tradeId??r.tradeId}))},[g,k]);const H=m.useMemo(()=>{const r=new Set,S=[];for(const F of g){if(F.id===a.id||a.itemId&&F.itemId===a.itemId||a.tokenId&&F.tokenId===a.tokenId)continue;const oe=`${F.contractAddress}-${F.itemId??F.tokenId??F.id}`;r.has(oe)||(r.add(oe),S.push(F))}return S},[g,a.id,a.itemId,a.tokenId]),{data:o,isLoading:y}=q({queryKey:["detail-trade",a.id,a.tradeId,a.contractAddress,a.itemId],enabled:!!a.contractAddress,queryFn:async()=>{if(a.tradeId)return a.tradeId;if(a.itemId){const r=await ca(a.contractAddress,a.itemId);return(r==null?void 0:r.id)??null}return null}}),u=a.tradeId??o??void 0,h=!!u,{data:p}=xa(c),A=m.useMemo(()=>{if(!c||!(t!=null&&t.item))return null;const r=t.item;return r.manaWei?{tradeId:r.tradeId??r.id,listingType:"primary",contractAddress:r.contractAddress,itemId:r.itemId??"",name:r.name,thumbnail:r.thumbnail,rarity:r.rarity,category:r.category,wearableCategory:r.wearableCategory??null,creator:r.creator,manaWei:r.manaWei,available:1,network:r.network,chainId:r.chainId,createdAt:0}:null},[c,t==null?void 0:t.item]),T=c&&b!=null&&!!p&&!!A,E=Ge({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),V=m.useMemo(()=>({...a,tradeId:u,id:u??a.id}),[a,u]),B=_.some(r=>r.id===V.id),w=he(r=>!!r.items[a.id]),O=m.useRef(null);m.useEffect(()=>{!a.name||y||O.current===a.id||(O.current=a.id,z("Shop Viewed Item",{...He(a),for_sale:h}),Qe(a))},[a.id,a.name,y,h]);const Q=`${i}/${l}`,ie=m.useRef(Q);m.useEffect(()=>{ie.current!==Q&&(ie.current=Q,t!=null&&t.item&&v({...t.item,tradeId:t.tradeId??t.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[Q]);function Ne(){!h||B||Y||x(V,"item_detail")}const X=Aa(a.rarity)?a.rarity:$.Rarity.COMMON,re=Ma(a.gender),le=Ye(a),de=Je(a.gender),ge=h&&E,we=s("itemDetail.moreFromCollection"),Y=Ze(a,j==null?void 0:j.address),ne=h?B?s("assetCard.inCart"):y?s("itemDetail.checking"):s("assetCard.addToCart"):s("itemDetail.notForSale"),Ce=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!c,ke=!Y&&h&&!c,Ie=c||!Y,Ae=K||!!a.contractAddress&&!N,ce=!a.name&&!Ae,Me=/^https?:\/\//i.test(a.thumbnail);return Xe(ce?{title:s("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:D||s("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:ve(a),creator:va(a.creator)}),image:Me?a.thumbnail:void 0,type:"product"}:{}),ce?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:s("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:s("itemDetail.notAvailableBody")}),e.jsx("button",{className:"btn btn--purple",onClick:()=>n("/assets"),children:s("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":s("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>n("/assets"),children:s("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||s("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview",children:[a.name?e.jsx(ka,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":s("itemPreview.loading"),children:e.jsx("span",{className:"skeleton item-preview__skeleton","aria-hidden":!0})}),e.jsx("button",{className:`item-detail__fav item-detail__fav--preview${w?" is-on":""}`,onClick:()=>d(a),"aria-pressed":w,"aria-label":w?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx("span",{className:`ico ${w?"ico-heart-solid":"ico-heart"}`,"aria-hidden":!0})})]}),e.jsx("div",{className:"item-detail__info",children:a.name?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"item-detail__info-head",children:[e.jsx("h1",{className:"item-detail__title",children:a.name}),e.jsx("button",{className:`item-detail__fav${w?" is-on":""}`,onClick:()=>d(a),"aria-pressed":w,"aria-label":w?s("assetCard.removeFromFavorites"):s("assetCard.addToFavorites"),children:e.jsx("span",{className:`ico ${w?"ico-heart-solid":"ico-heart"}`,"aria-hidden":!0})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:sa(X),color:aa(X)},title:ea(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[le?e.jsx("span",{className:`ico ico-${le} item-detail__chip-ico`,"aria-hidden":!0}):null,ve(a)]}),re?e.jsxs("span",{className:"chip item-detail__chip",children:[de?e.jsx("span",{className:`ico ico-${de} item-detail__chip-ico`,"aria-hidden":!0}):null,re]}):null]}),D?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${U?" is-expanded":""}`,children:D}),D.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>G(r=>!r),children:U?s("itemDetail.showLess"):s("itemDetail.readMore")}):null]}):null,a.creator||I!=null&&I.name?e.jsxs("div",{className:"item-detail__meta",children:[a.creator?e.jsxs("div",{className:"item-detail__meta-col",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.creator")}),e.jsx(ta,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,I!=null&&I.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:s("itemDetail.collection")}),e.jsx(Ia,{contractAddress:a.contractAddress,name:I.name,items:g,className:"item-detail__creator"})]}):null]}):null,e.jsx("hr",{className:"item-detail__divider"}),e.jsx("div",{className:"item-detail__price-block",children:e.jsxs("div",{className:"item-detail__price-row",children:[e.jsxs("div",{className:"item-detail__price-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.price")}),c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:b==null?e.jsx("span",{className:"item-detail__price-value",children:"—"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"item-detail__approx","aria-hidden":!0,children:"≈"}),e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:b})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:s("assetCard.marketPrice")})]}):h?ge?e.jsxs("div",{className:"item-detail__price item-detail__price--sale",children:[e.jsxs("span",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}),e.jsxs("span",{className:"item-detail__price-was",children:[e.jsx(M,{className:"item-detail__diamond item-detail__diamond--was"}),a.compareAtCredits]}),be(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:s("assetCard.saleWithDiscount",{pct:be(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(ia,{endsAt:a.saleEndsAt,className:"item-detail__countdown"})]}):e.jsxs("div",{className:"item-detail__price",children:[e.jsx(M,{className:"item-detail__diamond"}),e.jsx("span",{className:"item-detail__price-value",children:a.priceCredits})]}):e.jsx("div",{className:"item-detail__price item-detail__price--none",children:s("itemDetail.notForSale")})]}),Ce?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:s("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",$.Rarity.getMaxSupply(X).toLocaleString()]})]}):null]})}),e.jsx("div",{className:`item-detail__ctas${Ie?" item-detail__ctas--buttons":""}${ke?" item-detail__ctas--dual":""}`,children:c?e.jsxs("button",{className:"btn btn--purple item-detail__cta",onClick:()=>f(!0),disabled:!T,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),b!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),b]}):null]}):Y?e.jsxs("p",{className:"item-detail__own-note muted",children:[s("itemDetail.ownItemPrefix")," ",e.jsx(Ee,{to:"/my-assets",children:s("nav.myAssets")}),s("itemDetail.ownItemSuffix")]}):e.jsxs(e.Fragment,{children:[h?e.jsxs("button",{className:"btn btn--purple item-detail__cta",onClick:()=>f(!0),disabled:y,children:[e.jsx("span",{className:"item-detail__cta-label",children:s("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}):null,e.jsxs("button",{className:"item-detail__addcart",onClick:Ne,disabled:!h||B||y,"aria-label":ne,children:[e.jsx("span",{className:"ico ico-cart-solid item-detail__addcart-ico","aria-hidden":!0}),e.jsx("span",{className:"item-detail__addcart-label",children:ne})]})]})})]}):e.jsx(Sa,{})})]}),e.jsx(fa,{title:we,items:H,onViewAll:a.contractAddress?()=>n(`/collection/${a.contractAddress}`):void 0}),P&&c&&A&&p?e.jsx(ja,{listing:A,rate:p,onClose:()=>f(!1),onSold:()=>f(!1)}):P&&!c?e.jsx(ga,{item:V,resume:L,onClose:()=>{f(!1),C(!1)}}):null]})}function Sa(){return e.jsxs("div",{className:"item-detail__info-skel","aria-hidden":!0,children:[e.jsx("span",{className:"skeleton id-skel__title"}),e.jsxs("div",{className:"id-skel__chips",children:[e.jsx("span",{className:"skeleton id-skel__chip"}),e.jsx("span",{className:"skeleton id-skel__chip"})]}),e.jsx("span",{className:"skeleton id-skel__line"}),e.jsx("span",{className:"skeleton id-skel__line id-skel__line--short"}),e.jsx("hr",{className:"item-detail__divider"}),e.jsx("span",{className:"skeleton id-skel__price"}),e.jsx("span",{className:"skeleton id-skel__btn"})]})}export{Ha as ItemDetail,Ha as default};
@@ -1 +0,0 @@
1
- import{g as K,j as F,d as O,n as V,u as Y,t,o as k,C as x,q as R,r as H,s as w,i as $,k as D,v as J,b as C,w as U,x as q}from"./index-C7swV0s7.js";import{r as X,a as j}from"./mana-rate-B7ShUGMF.js";import{a as Z,r as h,j as r}from"./react-yytiy0wi.js";import{b as A}from"./buy-C3XM-F5L.js";import{g as ee,b as re,w as ae,S as te,G as se}from"./buy-gasless-CgW1uOlT.js";function ue(e=!0){return K({queryKey:["mana-rate",F.chainId],queryFn:()=>X(F.chainId),enabled:e,staleTime:6e4,refetchInterval:6e4,retry:1})}function W(e){const m=e,n=(m.message??"").toLowerCase();return m.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?t("getCredits.errorCanceled"):n.includes("insufficient")?t("marketCheckout.error.insufficient",{currency:w.name}):n.includes("not found")||n.includes("no active listing")||n.includes("404")?t("marketCheckout.error.soldOrRemoved"):n.includes("your own listing")?t("buyModal.error.cantBuyOwn"):t("marketCheckout.error.generic")}function ce(e){return{id:e.tradeId,tradeId:e.tradeId,name:e.name,creator:e.creator,contractAddress:e.contractAddress,itemId:e.itemId,category:e.category,wearableCategory:e.wearableCategory??void 0,rarity:e.rarity,network:e.network,chainId:e.chainId,thumbnail:e.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function me({listing:e,rate:m,onClose:n,onSold:T}){const{session:c}=O(),{data:d,isError:B}=V(c),g=Y(),N=Z(),[I,_]=h.useState("confirm"),[p,P]=h.useState(t("marketCheckout.lockingPrice")),[E,f]=h.useState(null),[a,G]=h.useState(null),o=h.useRef(null),L=Math.ceil(j(e.manaWei,m)/10);h.useEffect(()=>{let l=!1;if(!c){_("error"),f(t("buyModal.signInToCheckout"));return}return(async()=>{try{const s=await $(e.tradeId);if(!s)throw new Error("not found");if(D(s,c.address))throw new Error("You can't buy your own listing.");const u=j(e.manaWei,m);if(!Number.isFinite(u)||u<=0)throw new Error("price unavailable");const{credit:b,maxCreditedValue:z,usdCents:S}=await J(c.identity,u,e.tradeId);if(l){k(c.identity,[b.id]).catch(()=>{});return}o.current=b.id,G({trade:s,credit:b,maxCreditedValue:z,usdCents:S,credits:Math.ceil(S/10)}),P("")}catch(s){if(l)return;console.error("[market] authorize failed",s),C(q(s)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:U(s),value_usd:Math.round(j(e.manaWei,m))/100}),_("error"),f(W(s))}})(),()=>{l=!0,o.current&&c&&(k(c.identity,[o.current]).catch(()=>{}),o.current=null)}},[]);const v=!!a&&d!=null&&d.credits<a.credits;async function Q(){if(!c||!a)return;if(v){C("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:a.credits,credits_balance:(d==null?void 0:d.credits)??0,shortfall:Math.max(0,a.credits-((d==null?void 0:d.credits)??0))}),k(c.identity,[a.credit.id]).catch(()=>{}),o.current=null,N("/credits");return}_("working"),f(null);let l=!1;try{P(t("marketCheckout.confirming"));const i={trade:a.trade,buyer:c.address,signer:c.signer,credits:[a.credit],maxCreditedValue:a.maxCreditedValue};let s;if(ee())try{s=await re(i),await ae(s),l=!0}catch(u){if(u instanceof te)l=!0;else if(u instanceof se)s=await A(i);else throw u}else s=await A(i);o.current=null,C("Shop Completed Purchase",{items:[{item_id:e.itemId??null,contract_address:e.contractAddress,token_id:null,price_usd:a.usdCents/100}],value_credits:a.credits,value_usd:a.usdCents/100,purchase_type:"item",is_primary:!0,payment_type:"credits",no_crypto_step:l,transaction_hash:s??null}),g.invalidateQueries({queryKey:["usd-balance"]}),N("/success",{state:{items:[ce(e)],txHash:s}})}catch(i){console.error("[market] buy now failed",i),k(c.identity,[a.credit.id]).catch(()=>{}),o.current=null,C(q(i)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:U(i),value_usd:a.usdCents/100}),g.invalidateQueries({queryKey:["usd-balance"]}),f(W(i)),_("error");const s=(i.message??"").toLowerCase();(s.includes("not found")||s.includes("no active listing")||s.includes("404"))&&T()}}function M(){c&&a&&k(c.identity,[a.credit.id]).catch(()=>{}),o.current=null,n()}const y=I==="working";return r.jsxs("div",{className:"mkt-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:e.name}),children:[r.jsx("div",{className:"mkt-modal__scrim",onClick:y?void 0:M,"aria-hidden":!0}),r.jsxs("div",{className:"mkt-modal__card",children:[r.jsxs("div",{className:"mkt-modal__head",children:[r.jsx("div",{className:"mkt-modal__thumb",children:e.thumbnail?r.jsx("img",{src:e.thumbnail,alt:""}):null}),r.jsxs("div",{children:[r.jsx("div",{className:"mkt-modal__name",title:e.name,children:e.name||t("buyModal.itemFallback")}),r.jsx("span",{className:"chip chip--rarity",children:e.rarity})]})]}),r.jsx("div",{className:"mkt-modal__price",children:a?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.finalPrice")}),r.jsxs("div",{className:"mkt-modal__price-value",children:[r.jsx(x,{className:"mkt-modal__diamond"}),R(a.credits)]}),r.jsxs("div",{className:"mkt-modal__price-sub muted",children:[t("marketCheckout.lockedForPurchase")," · $",(a.usdCents/100).toFixed(2)]})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mkt-modal__price-label",children:t("marketCheckout.todaysPrice")}),r.jsxs("div",{className:"mkt-modal__price-value mkt-modal__price-value--approx",children:[r.jsx("span",{className:"mkt-modal__approx","aria-hidden":!0,children:"≈"}),r.jsx(x,{className:"mkt-modal__diamond"}),R(L)]}),r.jsx("div",{className:"mkt-modal__price-sub muted",children:p||t("marketCheckout.lockingPrice")})]})}),c?r.jsxs("div",{className:"mkt-modal__balance muted",children:[t("marketCheckout.yourBalance")," ",r.jsx(x,{className:"ccy-mark"})," ",H(d,B)]}):null,v?r.jsx("p",{className:"muted mkt-modal__note",children:t("marketCheckout.needMore",{currency:w.name})}):null,p&&I==="working"?r.jsx("p",{className:"muted mkt-modal__note",children:p}):null,E?r.jsx("p",{className:"error mkt-modal__note",children:E}):null,r.jsxs("div",{className:"mkt-modal__actions",children:[r.jsx("button",{className:"btn btn--ghost",onClick:M,disabled:y,children:t("buyModal.cancel")}),r.jsx("button",{className:"btn btn--purple",onClick:()=>void Q(),disabled:y||!a,children:y?t("marketCheckout.buying"):v?t("nav.getCredits",{currency:w.name}):t("marketCheckout.confirmPurchase")})]})]})]})}export{me as M,ue as u};
@@ -1 +0,0 @@
1
- import{a as D,r as m,j as e,L as ls}from"./react-yytiy0wi.js";import{j as G,D as cs,u as B,t as a,C as q,s as w,p as ss,b as M,ac as H,z as X,w as es,a as os,d as ds,g as W,ap as ms,i as us,aq as hs}from"./index-C7swV0s7.js";import{f as ps}from"./import-CXHQHUHE.js";import{d as as}from"./dcl-schemas-BICTSpB5.js";import{c as ys}from"./buy-C3XM-F5L.js";import{a as bs,b as gs,i as xs,e as js,c as Ns}from"./trade-encoding-BkDaYyvb.js";import{s as _s}from"./wallet-kind-B9P1TeIH.js";import{L as fs}from"./LoadMore-DOqijdHT.js";import{u as vs}from"./useInfiniteGrid-LLmuFcQo.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";import"./mana-rate-B7ShUGMF.js";import"./index-HN6Rk25C.js";const F=()=>`${G.builderServerUrl}/v1`;function ts(s){return Array.isArray(s)?s:"results"in s&&Array.isArray(s.results)?s.results:"data"in s&&Array.isArray(s.data)?s.data:[]}async function ns(s,i){const n=await cs(s,{method:"GET",identity:i,metadata:{}});if(!n.ok)throw new Error(`builder-server ${n.status}: ${await n.text()}`);const o=await n.json();return o.data??o}function Is(s,i){const n=i-s;return n>0?n:0}function As(s){var i,n,o,l,c;return((n=(i=s.data)==null?void 0:i.wearable)==null?void 0:n.category)??((l=(o=s.data)==null?void 0:o.emote)==null?void 0:l.category)??((c=s.data)==null?void 0:c.category)??s.type??"wearable"}function Y(s){return`${F()}/storage/contents/${s}`}function P(s,i){if(!s)return"";if(/^https?:\/\//.test(s))return s;const n=i==null?void 0:i[s];return n?Y(n):/^(ba|Qm)/.test(s)?Y(s):""}async function ks(s,i){try{const n=await fetch(`${F()}/items/${s}/${i}/contents`);if(!n.ok)return{};const o=await n.json();return o.data??o}catch{return{}}}async function Ss(s,i,n){const o=P(s.thumbnail,s.contents)||P("thumbnail.png",s.contents);if(o)return o;if(i&&n){const l=await ks(i,n);return P(s.thumbnail,l)||P("thumbnail.png",l)||P("image.png",l)}return""}async function Cs(s,i){const n=`${F()}/${s.toLowerCase()}/collections?is_published=true`,o=await ns(n,i);return ts(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 ws(s,i){const n=`${F()}/collections/${s.id}/items`,o=await ns(n,i);return(await Promise.all(ts(o).map(async c=>{const I=c.rarity??"common",_=Number(c.total_supply??0)||0;let u;try{u=as.Rarity.getMaxSupply(I)}catch{u=0}const f=(c.contract_address??s.contractAddress).toLowerCase(),y=c.blockchain_item_id??"";return{id:c.id,collectionId:s.id,collectionName:s.name,contractAddress:f,blockchainItemId:y,name:c.name,category:As(c),rarity:I,thumbnail:await Ss(c,f,y),type:c.type??"wearable",isPublished:c.is_published??s.isPublished,isApproved:c.is_approved??s.isApproved,totalSupply:_,maxSupply:u,remainingSupply:Is(_,u),minters:s.minters}}))).filter(Ls)}function Ls(s){return s.isPublished&&s.isApproved&&s.blockchainItemId!==""&&s.blockchainItemId!=null&&s.remainingSupply>0}async function Ms(s,i){const n=await Cs(s,i);return(await Promise.all(n.map(async l=>{try{return await ws(l,i)}catch{return[]}}))).flat()}const Ps=1e3*60*60*24*182;function $s(s){const i=s,n=(i.message??"").toLowerCase();return i.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?a("getCredits.errorCanceled"):a("sellModal.errorGeneric")}function Es({asset:s,session:i,onClose:n}){const o=B(),l=D(),[c,I]=m.useState("10"),[_,u]=m.useState(null),[f,y]=m.useState(null),[b,k]=m.useState(!1),[N,A]=m.useState(null);async function C(){y(null);const d=Number(c);if(!Number.isInteger(d)||d<=0){y(a("sellModal.errorWholeNumber"));return}k(!0);try{u(a("sellModal.statusPreparing")),await bs({signer:i.signer,contractAddress:s.contractAddress,chainId:s.chainId}),u(a("sellModal.statusListing"));const v=await gs({signer:i.signer,nft:{contractAddress:s.contractAddress,tokenId:s.tokenId,network:s.network,chainId:s.chainId},usdPrice:d/10,expiresAtMs:Date.now()+Ps});u(a("sellModal.statusPublishing")),await ss(v,i.identity),u(null),A(d),M("Shop Listed Item",{item_id:s.itemId??s.tokenId??null,contract_address:s.contractAddress,price_credits:d,price_usd:d/10,listing_type:"secondary",is_primary:!1}),H.success(a("sellModal.toastOnSale",{name:s.name})),o.invalidateQueries({queryKey:["my-assets",i.address]})}catch(v){X(v,{flow:"list_secondary"}),M("Shop Listing Failed",{listing_type:"secondary",error_code:es(v)}),y($s(v)),u(null)}finally{k(!1)}}function j(){n(),l(`/item/${s.contractAddress}/${s.tokenId}`)}return N!==null?e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal modal--success",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:a("sellModal.successTitle")}),s.image?e.jsx("img",{className:"modal__img",src:s.image,alt:s.name}):null,e.jsx("p",{className:"modal-success__name",children:s.name}),e.jsxs("p",{className:"muted small",children:[a("sellModal.listedFor")," ",e.jsxs("strong",{children:[e.jsx(q,{className:"ccy-mark"})," ",N]})]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:n,children:a("getCredits.done")}),e.jsx("button",{className:"btn btn--purple",onClick:j,children:a("sellModal.viewInShop")})]})]})}):e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("h2",{className:"modal__title",children:a("sellModal.listTitle",{name:s.name})}),s.image?e.jsx("img",{className:"modal__img",src:s.image,alt:s.name}):null,e.jsxs("label",{className:"field",children:[e.jsx("span",{children:a("sellModal.priceLabel",{currency:w.name})}),e.jsx("input",{type:"number",min:"1",step:"1",value:c,onChange:d=>I(d.target.value),disabled:b})]}),e.jsx("p",{className:"muted small",children:a("sellModal.pricedInWhole",{currency:w.name,currencySingular:w.nameSingular})}),_?e.jsx("p",{className:"muted",children:_}):null,f?e.jsx("p",{className:"error",children:f}):null,e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:b,children:a("sellModal.cancel")}),e.jsx("button",{className:"btn",onClick:()=>void C(),disabled:b,children:b?a("sellModal.listing"):a("sellModal.putOnSale")})]})]})})}const Ts=1e3*60*60*24*182;function qs(s){const i=s,n=(i.message??"").toLowerCase();return i.code===4001||n.includes("reject")||n.includes("denied")||n.includes("cancel")?a("getCredits.errorCanceled"):a("primaryList.errorGeneric")}function Fs({item:s,session:i,onClose:n}){const o=B(),l=D(),[c,I]=m.useState("10"),[_,u]=m.useState(null),[f,y]=m.useState(null),[b,k]=m.useState(!1),[N,A]=m.useState(null),[C,j]=m.useState(null),d=G.chainId,v=_s(i.providerType);m.useEffect(()=>{let h=!1;return(async()=>{try{const g=await xs({contractAddress:s.contractAddress,chainId:d});h||A(g)}catch{h||A(!1)}})(),()=>{h=!0}},[s.contractAddress,d]);async function O(){y(null);const h=Number(c);if(!Number.isInteger(h)||h<=0){y(a("primaryList.errorWholeNumber"));return}k(!0);try{N||(u(a("primaryList.statusEnabling")),await js({signer:i.signer,contractAddress:s.contractAddress,chainId:d}),A(!0)),u(a("primaryList.statusPublishing"));const g=await Ns({signer:i.signer,item:{contractAddress:s.contractAddress,itemId:s.blockchainItemId,network:as.Network.MATIC,chainId:d},usdPrice:h/10,uses:s.remainingSupply,expiresAtMs:Date.now()+Ts});u(a("primaryList.statusFinishing")),await ss(g,i.identity),u(null),j(h),M("Shop Listed Item",{item_id:s.blockchainItemId,contract_address:s.contractAddress,price_credits:h,price_usd:h/10,listing_type:"primary",is_primary:!0}),H.success(a("primaryList.toastOnSale",{name:s.name})),o.invalidateQueries({queryKey:["publishable-items"]}),o.invalidateQueries({queryKey:["collection-sale-state"]})}catch(g){X(g,{flow:"list_primary"}),M("Shop Listing Failed",{listing_type:"primary",error_code:es(g)}),y(qs(g)),u(null)}finally{k(!1)}}function K(){n(),l(`/item/${s.contractAddress}/${s.blockchainItemId}`)}const $=b?a("primaryList.listing"):N===!1?a("primaryList.enableAndPutOnSale"):a("primaryList.putOnSale");return C!==null?e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal modal--success",onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),e.jsx("h2",{className:"modal__title",children:a("primaryList.successTitle")}),s.thumbnail?e.jsx("img",{className:"modal__img",src:s.thumbnail,alt:s.name}):null,e.jsx("p",{className:"modal-success__name",children:s.name}),e.jsxs("p",{className:"muted small",children:[a("primaryList.listedFor")," ",e.jsxs("strong",{children:[e.jsx(q,{className:"ccy-mark"})," ",C]})," ",a("primaryList.dotAvailable",{count:s.remainingSupply})]}),e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:n,children:a("getCredits.done")}),e.jsx("button",{className:"btn btn--purple",onClick:K,children:a("primaryList.viewInShop")})]})]})}):e.jsx("div",{className:"modal-backdrop",onClick:n,role:"presentation",children:e.jsxs("div",{className:"modal",onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true",children:[e.jsx("h2",{className:"modal__title",children:a("primaryList.publishTitle",{name:s.name})}),s.thumbnail?e.jsx("img",{className:"modal__img",src:s.thumbnail,alt:s.name}):null,e.jsx("p",{className:"muted small",children:a("primaryList.fromCollection",{collectionName:s.collectionName,count:s.remainingSupply})}),e.jsxs("label",{className:"field",children:[e.jsx("span",{children:a("primaryList.priceLabel",{currency:w.name})}),e.jsx("input",{type:"number",min:"1",step:"1",value:c,onChange:h=>I(h.target.value),disabled:b})]}),e.jsx("p",{className:"muted small",children:a("primaryList.pricedInWhole",{currency:w.name,currencySingular:w.nameSingular})}),N===!1&&!b?v?e.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeConfirm",{collectionName:s.collectionName})}):e.jsx("p",{className:"muted small primary-note",children:a("primaryList.firstTimeManaged",{collectionName:s.collectionName})}):N===!0&&!b?v?e.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyConfirm")}):e.jsx("p",{className:"muted small primary-note",children:a("primaryList.readyManaged")}):null,_?e.jsx("p",{className:"muted",children:_}):null,f?e.jsx("p",{className:"error",children:f}):null,e.jsxs("div",{className:"modal__actions",children:[e.jsx("button",{className:"btn btn--ghost",onClick:n,disabled:b,children:a("primaryList.cancel")}),e.jsx("button",{className:"btn",onClick:()=>void O(),disabled:b||N===null,children:N===null?a("primaryList.checking"):$})]})]})})}const Os=48;function Ks(s){return{id:s.id,name:s.name,creator:"",contractAddress:s.contractAddress,itemId:s.itemId,category:s.category,rarity:s.rarity??"common",network:s.network,chainId:s.chainId,thumbnail:s.image,priceCredits:s.listingPrice??0,gender:null,isSmart:!1,tokenId:s.tokenId}}function Z(s){return{id:`${s.contractAddress}-${s.blockchainItemId}`,name:s.name,creator:"",contractAddress:s.contractAddress,itemId:s.blockchainItemId,category:s.category,rarity:s.rarity,network:"MATIC",chainId:G.chainId,thumbnail:s.thumbnail,priceCredits:0,gender:null,isSmart:!1}}function se(){os({title:a("nav.myAssets"),noindex:!0});const{session:s,error:i,signIn:n,restore:o}=ds(),l=D(),c=B(),[I,_]=m.useState(null),[u,f]=m.useState(null),[y,b]=m.useState(null),[k,N]=m.useState(null);function A(t){const r=t.tokenId??t.itemId??"";!t.contractAddress||!r||l(`/item/${t.contractAddress}/${r}`,{state:{item:t}})}async function C(t,r,p){if(s){N(null),b(p);try{const x=await us(t);await ys({trade:x,signer:s.signer}),H.success(a("myAssets.removedFromSale",{name:r})),await c.invalidateQueries({queryKey:["my-assets",s.address]}),await c.invalidateQueries({queryKey:["collection-sale-state"]})}catch(x){const E=x,T=(E.message??"").toLowerCase(),V=E.code===4001||T.includes("reject")||T.includes("denied");V||X(x,{flow:"remove-listing",tradeId:t}),N(V?a("getCredits.errorCanceled"):a("myAssets.removeListingError"))}finally{b(null)}}}m.useEffect(()=>{o()},[o]);const j=s==null?void 0:s.address,{items:d,isLoading:v,error:O,hasNextPage:K,isFetchingNextPage:$,fetchNextPage:h}=vs(["my-assets",j],t=>ms(j,{first:Os,skip:t}).then(r=>({items:r.assets,total:r.total})),{enabled:!!j}),{data:g}=W({queryKey:["importable",j],queryFn:()=>ps(j),enabled:!!j}),z=((g==null?void 0:g.creations.length)??0)+((g==null?void 0:g.owned.length)??0),{data:L,isLoading:rs,isError:is}=W({queryKey:["publishable-items",j],queryFn:()=>Ms(j,s.identity),enabled:!!s,retry:!1}),Q=m.useMemo(()=>[...new Set((L??[]).map(t=>t.contractAddress))],[L]),{data:S}=W({queryKey:["collection-sale-state",j,Q],enabled:Q.length>0,queryFn:async()=>{const t=await Promise.all(Q.map(async p=>[p,await hs(p)])),r={};for(const[p,x]of t)for(const[E,T]of Object.entries(x))r[`${p}-${E}`]=T;return r}}),R=t=>S==null?void 0:S[`${t.contractAddress}-${t.blockchainItemId}`],U=m.useMemo(()=>(L??[]).filter(t=>{var r;return(r=R(t))==null?void 0:r.isOnSale}),[L,S]),J=m.useMemo(()=>{var r;const t=new Map;for(const p of L??[]){if((r=S==null?void 0:S[`${p.contractAddress}-${p.blockchainItemId}`])!=null&&r.isOnSale)continue;const x=t.get(p.collectionId)??{id:p.collectionId,name:p.collectionName,items:[]};x.items.push(p),t.set(p.collectionId,x)}return[...t.values()]},[L,S]);return s?e.jsxs("section",{className:"myassets",children:[e.jsx("h1",{children:a("nav.myAssets")}),z>0?e.jsxs(ls,{className:"import-banner",to:"/import",children:[e.jsx("span",{className:"import-banner__ico","aria-hidden":!0,children:"📦"}),e.jsxs("span",{className:"import-banner__text",children:[e.jsx("strong",{children:a("myAssets.importTitle")}),e.jsx("span",{className:"import-banner__sub",children:a("myAssets.importSub",{count:z})})]}),e.jsx("span",{className:"import-banner__cta",children:a("myAssets.import")})]}):null,e.jsxs("div",{className:"myassets__section",children:[e.jsxs("div",{className:"myassets__section-head",children:[e.jsx("h2",{className:"myassets__section-title",children:a("myAssets.ownedTitle")}),e.jsx("p",{className:"myassets__section-sub",children:a("myAssets.ownedSub")})]}),O?e.jsx("p",{className:"error",children:a("myAssets.ownedError")}):null,k?e.jsx("p",{className:"error",children:k}):null,e.jsxs("div",{className:"asset-grid",children:[v?Array.from({length:8}).map((t,r)=>e.jsx("div",{className:"asset-card asset-card--skeleton"},`sk-${r}`)):d.map(t=>e.jsxs("article",{className:"asset-card asset-card--link",children:[e.jsx("button",{className:"card-link-overlay","aria-label":a("myAssets.viewItem",{name:t.name}),onClick:()=>A(Ks(t))}),e.jsx("div",{className:"asset-card__img",children:t.image?e.jsx("img",{src:t.image,alt:t.name}):null}),e.jsx("div",{className:"asset-card__name",title:t.name,children:t.name}),t.isOnSale?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"asset-card__listed",children:[e.jsxs("span",{className:"asset-card__price",children:[e.jsx(q,{className:"ccy-mark"})," ",t.listingPrice]}),e.jsx("span",{className:"badge",children:a("myAssets.onSale")})]}),e.jsx("button",{className:"btn btn--sm btn--ghost asset-card__remove",disabled:y===t.id||!t.tradeId,onClick:r=>{r.stopPropagation(),t.tradeId&&C(t.tradeId,t.name,t.id)},children:y===t.id?a("myAssets.removing"):a("myAssets.removeListing")})]}):e.jsx("button",{className:"btn btn--sm",onClick:r=>{r.stopPropagation(),M("Shop Started Listing",{listing_type:"secondary",item_id:t.itemId??t.tokenId??null}),_(t)},children:a("myAssets.putOnSale")})]},t.id)),$?Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"asset-card asset-card--skeleton"},`msk-${r}`)):null]}),e.jsx(fs,{hasNextPage:K,isFetching:$,onLoadMore:()=>void h()}),!v&&d.length===0?e.jsx("p",{className:"muted",children:a("myAssets.ownedEmpty")}):null]}),e.jsxs("div",{className:"myassets__section",children:[e.jsxs("div",{className:"myassets__section-head",children:[e.jsx("h2",{className:"myassets__section-title",children:a("myAssets.creationsTitle")}),e.jsx("p",{className:"myassets__section-sub",children:a("myAssets.creationsSub",{currency:w.name})})]}),rs?e.jsx("div",{className:"publish-grid",children:Array.from({length:4}).map((t,r)=>e.jsx("div",{className:"asset-card asset-card--skeleton"},`pub-sk-${r}`))}):is?e.jsx("p",{className:"publish-empty",children:a("myAssets.collectionsError")}):U.length===0&&J.length===0?e.jsx("p",{className:"publish-empty",children:a("myAssets.nothingToPublish")}):e.jsxs(e.Fragment,{children:[U.length>0?e.jsxs("div",{className:"creations-collection",children:[e.jsx("h3",{className:"creations-collection__name",children:a("myAssets.onSale")}),e.jsx("div",{className:"publish-grid",children:U.map(t=>{var r;return e.jsxs("article",{className:"publish-card publish-card--link",children:[e.jsx("button",{className:"card-link-overlay","aria-label":a("myAssets.viewItem",{name:t.name}),onClick:()=>A(Z(t))}),e.jsx("div",{className:"publish-card__img",children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}),e.jsx("div",{className:"publish-card__name",title:t.name,children:t.name}),e.jsxs("div",{className:"publish-card__listed",children:[e.jsxs("span",{className:"publish-card__price",children:[e.jsx(q,{className:"ccy-mark"})," ",((r=R(t))==null?void 0:r.priceCredits)??0]}),e.jsx("span",{className:"badge",children:a("myAssets.onSale")})]}),e.jsx("button",{className:"btn btn--sm btn--ghost publish-card__cta",disabled:y===t.id,onClick:p=>{p.stopPropagation();const x=R(t);x!=null&&x.tradeId&&C(x.tradeId,t.name,t.id)},children:y===t.id?a("myAssets.removing"):a("myAssets.removeListing")})]},`${t.contractAddress}-${t.blockchainItemId}`)})})]}):null,J.map(t=>e.jsxs("div",{className:"creations-collection",children:[e.jsx("h3",{className:"creations-collection__name",children:t.name}),e.jsx("div",{className:"publish-grid",children:t.items.map(r=>e.jsxs("article",{className:"publish-card publish-card--link",children:[e.jsx("button",{className:"card-link-overlay","aria-label":a("myAssets.viewItem",{name:r.name}),onClick:()=>A(Z(r))}),e.jsx("div",{className:"publish-card__img",children:r.thumbnail?e.jsx("img",{src:r.thumbnail,alt:r.name}):null}),e.jsx("div",{className:"publish-card__name",title:r.name,children:r.name}),e.jsxs("div",{className:"publish-card__meta",children:[e.jsx("span",{className:"publish-chip publish-chip--rarity",children:r.rarity}),e.jsx("span",{className:"publish-card__supply",children:a("myAssets.available",{count:r.remainingSupply})})]}),e.jsx("button",{className:"btn btn--sm btn--purple publish-card__cta",onClick:p=>{p.stopPropagation(),M("Shop Started Listing",{listing_type:"primary",item_id:r.blockchainItemId}),f(r)},children:a("myAssets.putOnSale")})]},`${r.contractAddress}-${r.blockchainItemId}`))})]},t.id))]})]}),I?e.jsx(Es,{asset:I,session:s,onClose:()=>_(null)}):null,u?e.jsx(Fs,{item:u,session:s,onClose:()=>f(null)}):null]}):e.jsxs("section",{className:"myassets",children:[e.jsx("h1",{children:a("nav.myAssets")}),e.jsx("p",{className:"muted",children:a("myAssets.signInPrompt")}),e.jsx("div",{className:"connect-row",children:e.jsx("button",{className:"btn btn--purple",onClick:()=>n(),children:a("storeSettings.signIn")})}),i?e.jsx("p",{className:"error",children:i}):null]})}export{se as MyAssets};
@@ -1 +0,0 @@
1
- import{j as s,a as U,r as i,L as W}from"./react-yytiy0wi.js";import{t as a,a as X,d as Z,u as ee,ac as T}from"./index-C7swV0s7.js";import{u as se,d as te,t as ae,L as re,i as I,a as v,s as ne}from"./useStore-CTx-2Xfe.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-BPJvc5GU.js";import"./ethers-w2AslR0v.js";import"./intl-CBcMB1D2.js";const ie="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/template-cover-1-BETekfHg.jpeg",oe="https://cdn.decentraland.org/@dcl/shop/0.1.0-29735885306.commit-7a39d45/assets/template-cover-2-Dni9s0i_.jpeg",le=Object.assign({"../assets/creator-covers/template-cover-1.jpeg":ie,"../assets/creator-covers/template-cover-2.jpeg":oe}),h=Object.entries(le).sort(([r],[d])=>r.localeCompare(d)).map(([r,d])=>({name:r.split("/").pop(),url:d}));function ce({label:r,size:d="medium",direction:b="column",className:f}){return s.jsxs("div",{className:`spinner-box spinner-box--${b}${f?` ${f}`:""}`,role:"status","aria-live":"polite","aria-label":r?void 0:a("spinner.loading"),children:[s.jsx("span",{className:`spinner-box__ring spinner-box__ring--${d}`,"aria-hidden":!0}),r?s.jsx("span",{className:"spinner-box__label",children:r}):null]})}const M=1e6,O={cover:"",coverName:"",coverHash:"",description:"",links:{website:"",twitter:"",discord:"",facebook:""}};function R(r){return`${(r/1e6).toLocaleString(void 0,{maximumFractionDigits:2})}MB`}function fe(){X({title:a("seo.storeSettings.title"),noindex:!0});const{session:r,signIn:d}=Z(),b=U(),f=ee(),c=r==null?void 0:r.address,{data:x,isLoading:z}=se(c),[n,u]=i.useState(O),[E,w]=i.useState(O),[j,g]=i.useState(),[p,C]=i.useState(!1),[o,N]=i.useState(null),[_,A]=i.useState({}),L=i.useRef(null);i.useEffect(()=>{if(x){const e=te(x);u(e),w(e),g(void 0),N(e.cover?{url:e.cover,name:e.coverName,hash:e.coverHash}:null)}},[x]),i.useEffect(()=>{let e=!1;return Promise.all(h.map(async t=>[t.name,await ae(t.url)])).then(t=>{e||A(Object.fromEntries(t))}).catch(()=>{}),()=>{e=!0}},[]);const S=i.useMemo(()=>{const e=h.find(l=>n.coverName===`cover/${l.name}`);if(e)return e.name;const t=n.coverHash?h.find(l=>_[l.name]===n.coverHash):void 0;return t==null?void 0:t.name},[n.coverName,n.coverHash,_]);i.useEffect(()=>{o!=null&&o.hash&&h.some(e=>_[e.name]===o.hash)&&N(null)},[_,o]);const $=j!==void 0&&j>M,D=i.useMemo(()=>re.filter(e=>!I(e,n.links[e])),[n.links]),P=$||D.length>0,k=i.useMemo(()=>JSON.stringify(n)!==JSON.stringify(E),[n,E]),F=k&&!P&&!p;if(i.useEffect(()=>{if(!k)return;const e=t=>{t.preventDefault()};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[k]),!r)return s.jsxs("section",{className:"store-settings store-settings--signin","aria-label":a("storeSettings.title"),children:[s.jsx("h1",{className:"store-settings__title",children:a("storeSettings.title")}),s.jsx("p",{className:"muted",children:a("storeSettings.signInPrompt")}),s.jsx("button",{className:"btn btn--purple store-settings__signin-btn",onClick:d,children:a("storeSettings.signIn")})]});function B(e,t){g(void 0),u(l=>({...l,cover:t,coverName:`cover/${e}`,coverHash:""}))}const V=["image/png","image/jpeg","image/webp"];function Y(e){var y;const t=(y=e.target.files)==null?void 0:y[0];if(!t||!V.includes(t.type))return;g(t.size);const l=`cover/${t.name}`,m=new FileReader;m.onload=()=>{const H=m.result;N({url:H,name:l,hash:""}),u(Q=>({...Q,cover:H,coverName:l,coverHash:""}))},m.readAsDataURL(t)}function K(){o&&(g(void 0),u(e=>({...e,cover:o.url,coverName:o.name,coverHash:o.hash})))}function q(e,t){const l=t?(v[e]+t).replace(/\s/g,""):"";u(m=>({...m,links:{...m.links,[e]:l}}))}function G(e){const t=n.links[e];return e==="website"?t:t.replace(v[e],"")}async function J(){if(!(!c||!r)){C(!0);try{await ne(c,n,r.identity),w(n),g(void 0),await f.invalidateQueries({queryKey:["store",c.toLowerCase()]}),T.success(a("storeSettings.saved")),b(`/assets/creator/${c}`)}catch{T.error(a("storeSettings.saveError"))}finally{C(!1)}}}return s.jsxs("section",{className:"store-settings","aria-label":a("storeSettings.title"),children:[s.jsxs("div",{className:"store-settings__head",children:[s.jsxs("div",{className:"store-settings__heading",children:[c?s.jsx(W,{className:"store-settings__back",to:`/assets/creator/${c}`,title:a("storeSettings.back"),"aria-label":a("storeSettings.back"),children:s.jsx("span",{className:"ico ico-arrow-left","aria-hidden":!0})}):null,s.jsx("h1",{className:"store-settings__title",children:a("storeSettings.title")})]}),c?s.jsxs("a",{className:"store-settings__guest",href:`/assets/creator/${c}`,target:"_blank",rel:"noopener noreferrer",children:[a("storeSettings.seeAsGuest"),s.jsx("span",{className:"ico ico-external","aria-hidden":!0})]}):null]}),z?s.jsx(ce,{size:"large",label:a("storeSettings.loading"),className:"store-settings__loading"}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"field",children:[s.jsx("span",{className:"field__label",children:a("storeSettings.cover")}),s.jsxs("div",{className:"cover-picker",role:"group","aria-label":a("storeSettings.cover"),children:[h.map(e=>{const t=S===e.name;return s.jsx("button",{type:"button",className:`cover-picker__tile${t?" is-selected":""}`,"aria-pressed":t,onClick:()=>B(e.name,e.url),children:s.jsx("img",{src:e.url,alt:"",loading:"lazy"})},e.name)}),o?s.jsx("button",{type:"button",className:`cover-picker__tile cover-picker__tile--custom${S?"":" is-selected"}`,"aria-pressed":!S,onClick:K,children:s.jsx("img",{src:o.url,alt:""})}):null,s.jsxs("button",{type:"button",className:"cover-picker__tile cover-picker__upload",onClick:()=>{var e;return(e=L.current)==null?void 0:e.click()},children:[s.jsx("span",{className:"ico ico-upload","aria-hidden":!0}),s.jsx("span",{children:a("storeSettings.upload")})]}),s.jsx("input",{ref:L,type:"file",accept:"image/png, image/jpeg, image/webp",className:"cover-picker__input",onChange:Y})]}),$?s.jsx("p",{className:"error",children:a("storeSettings.sizeError",{max:R(M),current:R(j)})}):null]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{className:"field__label",children:a("storeSettings.description")}),s.jsx("textarea",{value:n.description,rows:4,disabled:p,onChange:e=>u(t=>({...t,description:e.target.value}))})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{className:"field__label",children:a("storeSettings.website")}),s.jsx("input",{type:"url",value:n.links.website,placeholder:v.website,disabled:p,onChange:e=>u(t=>({...t,links:{...t.links,website:e.target.value.replace(/\s/g,"")}}))}),I("website",n.links.website)?null:s.jsx("p",{className:"error",children:a("storeSettings.linkError",{value:v.website})})]}),["twitter","discord","facebook"].map(e=>s.jsxs("label",{className:"field",children:[s.jsx("span",{className:"field__label",children:a(`storeSettings.${e}`)}),s.jsxs("div",{className:"field__prefixed",children:[s.jsx("span",{className:"field__prefix",children:v[e]}),s.jsx("input",{type:"text",value:G(e),disabled:p,onChange:t=>q(e,t.target.value)})]})]},e)),s.jsx("div",{className:"store-settings__actions",children:s.jsx("button",{className:"btn btn--purple store-settings__save",onClick:()=>void J(),disabled:!F,children:p?a("storeSettings.saving"):a("storeSettings.save")})})]})]})}export{fe as StoreSettings,fe as default};